diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 46e4bfaf..b28d4fdc 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -664,6 +664,9 @@ OTHER CHANGES: See the "agc/options-example.php" file for more information. *This will not affect custom webform query strings that start with "VAR" +185. Added display of the Phone Codes and Postal Codes that are loaded into the + system. Linked from the System Settings page. + diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index fd4bbbc0..120cec77 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -5676,12 +5676,13 @@ if ($SSscript_remove_js > 0) # 210702-0848 - Added transfer_no_dispo campaign setting # 210705-1037 - Added User override for campaign manual_dial_filter setting # 210706-0128 - Added display of Call Time Holidays to the agent screen Scheduled Callbacks calendar +# 210707-0731 - Added display of phone codes and postal codes, linked from System Settings page # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-819a'; -$build = '210706-0128'; +$admin_version = '2.14-820a'; +$build = '210707-0731'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -6726,6 +6727,8 @@ if ($ADD==999991) {$hh='reports'; echo _QXZ("SERVERS VERSIONS");} if ($ADD==999990) {$hh='reports'; echo _QXZ("SYSTEM SNAPSHOT STATS");} if ($ADD==999989) {$hh='reports'; echo _QXZ("USER CHANGE LANGUAGE");} if ($ADD==999988) {$hh='reports'; echo _QXZ("AVAILABLE TIMEZONES");} +if ($ADD==999987) {$hh='reports'; echo _QXZ("PHONE CODES");} +if ($ADD==999986) {$hh='reports'; echo _QXZ("POSTAL CODES");} echo "\n"; @@ -48273,6 +48276,173 @@ date_default_timezone_set($orig_zone); ##### END available timezones display page ##### +###################### +# ADD=999987 - phone_codes display page +###################### +if ($ADD==999987) + { + $orig_zone = date_default_timezone_get(); + + $PCfilterSQL=''; + $PCfilterTEXT=''; + if ( (strlen($stage) > 2) and (preg_match("/-/",$stage)) ) + { + $PSstage = explode('-',$stage); + $PCfilterSQL = "and country_code='$PSstage[0]' and state='$PSstage[1]'"; + $PCfilterTEXT = " ("._QXZ("Country Code").": $PSstage[0]   "._QXZ("State").": $PSstage[1])   "._QXZ("reset")." "; + } + + echo "
\n"; + echo ""; + + # country_code | country | areacode | state | GMT_offset | DST | DST_range | geographic_description | tz_code | php_tz + $stmt="SELECT count(*),tz_code,GMT_offset,country_code,country,country_name,areacode,state,geographic_description,dst,php_tz FROM vicidial_phone_codes p,vicidial_country_iso_tld i where i.iso3=p.country and php_tz!='' $PCfilterSQL group by country_code,areacode,state,tz_code,GMT_offset,dst,php_tz order by country_code,areacode,CAST(GMT_offset as SIGNED INTEGER) desc,tz_code,dst,php_tz;"; + $rslt=mysql_to_mysqli($stmt, $link); + $zones_to_print = mysqli_num_rows($rslt); + + echo "
"._QXZ("PHONE CODES")."
\n"; + echo "
$zones_to_print "._QXZ("RECORDS")."   $PCfilterTEXT
\n"; + 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; + $row_color=0; $last_country=''; + while ($zones_to_print > $o) + { + $rowx=mysqli_fetch_row($rslt); + date_default_timezone_set($rowx[10]); + $tz_time = date("Y-m-d H:i:s"); + + if ($rowx[3] != "$last_country") {$row_color++; $last_country = $rowx[3];} + if (preg_match('/1$|3$|5$|7$|9$/i', $row_color)) + {$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';} + else + {$bgcolor='bgcolor="#'. $SSstd_row1_background .'"';} + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o++; + } + echo "
"._QXZ("Code").""._QXZ("Country").""._QXZ("AreaCode").""._QXZ("State").""._QXZ("DST").""._QXZ("Description").""._QXZ("Offset").""._QXZ("TZ Code").""._QXZ("Current Time")."
$rowx[3]$rowx[4] - $rowx[5]$rowx[6]$rowx[7]$rowx[9]   $rowx[8] - $rowx[5]$rowx[2]$rowx[1]   $tz_time
\n"; + } +date_default_timezone_set($orig_zone); +##### END available phone_codes display page ##### + + +###################### +# ADD=999986 - postal_codes display page +###################### +if ($ADD==999986) + { + echo "
\n"; + echo ""; + + $limitSQL=''; + $next_prev_HTML=''; + $PCentries_per_page='2000'; + + $stmt="SELECT count(*) from vicidial_postal_codes;"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $pc_count = $row[0]; + + if ( ($pc_count > $PCentries_per_page) and ($status != 'display_all') ) + { + if (strlen($start_count) < 1) {$start_count=0;} + $next_count = ($start_count + $PCentries_per_page); + $nextnext_count = ($next_count + $PCentries_per_page); + if ($next_count > $pc_count) + {$next_count = $pc_count;} + else + { + if ($nextnext_count > $pc_count) + { + $next_temp = ($pc_count - $next_count); + $nextHTML = ""._QXZ("NEXT")." $next_temp   "; + } + else + { + $nextHTML = ""._QXZ("NEXT")." $PCentries_per_page   "; + } + } + $next_prev_HTML .= _QXZ("RECORDS")." $start_count - $next_count   "._QXZ("of")." $pc_count     "; + $limitSQL="limit $PCentries_per_page"; + if ($start_count > 0) + { + $prev_count = ($start_count - $PCentries_per_page); + $limitSQL="limit $start_count,$PCentries_per_page"; + $next_prev_HTML .= ""._QXZ("PREVIOUS")." $PCentries_per_page   "; + } + $next_prev_HTML .= $nextHTML; + $next_prev_HTML .= "           "._QXZ("show all postal codes")."   "; + } + + echo "
"._QXZ("POSTAL CODES")."
\n"; + echo "
$next_prev_HTML\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + # postal_code | state | GMT_offset | DST | DST_range | country | country_code + $stmt="SELECT count(*),GMT_offset,country,country_name,postal_code,state,dst FROM vicidial_postal_codes p,vicidial_country_iso_tld i where i.iso3=p.country group by country_code,postal_code,state,GMT_offset,dst order by country_code,postal_code,CAST(GMT_offset as SIGNED INTEGER) desc,dst $limitSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $zones_to_print = mysqli_num_rows($rslt); + $o=0; + $row_color=0; $last_country=''; + while ($zones_to_print > $o) + { + $rowx=mysqli_fetch_row($rslt); + $temp_postal_gmt_offset = $rowx[1]; + if ($rowx[6] == 'Y') {$temp_postal_gmt_offset = ($temp_postal_gmt_offset + 1);} + $LOCALzone=(3600 * $temp_postal_gmt_offset); + $LOCALdate=gmdate("D j M Y H:i", time() + $LOCALzone); + + if ($rowx[3] != "$last_country") {$row_color++; $last_country = $rowx[3];} + if (preg_match('/1$|3$|5$|7$|9$/i', $row_color)) + {$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';} + else + {$bgcolor='bgcolor="#'. $SSstd_row1_background .'"';} + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o++; + } + echo "
"._QXZ("Country").""._QXZ("Postal Code").""._QXZ("State").""._QXZ("DST").""._QXZ("Offset").""._QXZ("Current Time")."
$rowx[2] - $rowx[3]$rowx[4]$rowx[5]$rowx[6]$rowx[1]   $LOCALdate
\n"; + } +##### END available postal_codes display page ##### + + echo "
\n"; echo "
\n"; diff --git a/agc_2-X/trunk/www/vicidial/admin_header.php b/agc_2-X/trunk/www/vicidial/admin_header.php index 5a2f1ed4..c85ddd09 100644 --- a/agc_2-X/trunk/www/vicidial/admin_header.php +++ b/agc_2-X/trunk/www/vicidial/admin_header.php @@ -87,6 +87,7 @@ # 201108-1232 - Added no_header option within short_header option # 210226-1547 - Added Copy Phone link # 210306-0902 - Changes for new QC module +# 210707-0730 - Added header links for timezones, phone codes and postal codes # $stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails,level_8_disable_add,allow_chats,enable_languages,admin_row_click,admin_screen_colors,user_new_lead_limit,user_territories_active,qc_features_active,agent_soundboards,enable_drop_lists,allow_ip_lists from system_settings;"; @@ -1738,7 +1739,7 @@ background:rgb(102,255,51); font-family:HELVETICA; font-size:11; color:BLACK; - { + } --> @@ -2683,13 +2684,21 @@ if ($SSenable_languages == '1') >     |     |     |   25) { + +if ( ($ADD=='999988') or ($ADD=='999987') or ($ADD=='999986') ) + { ?> ->   - - - + >     |     |     + 25) { + ?> + >   + >