Visitors Traffic Real Time Statistics - Version 2.6

Version Description

  1. Track logged in users (admin user)
  2. css enhancements
Download this release

Release Info

Developer osamaesh
Plugin Icon 128x128 Visitors Traffic Real Time Statistics
Version 2.6
Comparing to
See all releases

Code changes from version 1.21 to 2.6

Files changed (84) hide show
  1. Visitors-Traffic-Real-Time-Statistics.php +145 -142
  2. WPHitsCounter.php +1128 -1080
  3. ahc_about.php +36 -0
  4. ahc_help.php +48 -0
  5. ahc_settings.php +174 -5
  6. ajaxpages/getUsersOnline.php +13 -0
  7. css/ar_stylesheet.css +73 -0
  8. css/{style-review.css → css-review.css} +0 -0
  9. css/datepicker.css +1311 -0
  10. css/leaflet.css +635 -0
  11. css/vtrtspro_css_stylesheet.css +408 -0
  12. functions.php +3536 -2567
  13. geoip/.gitignore +9 -0
  14. geoip/.travis.yml +31 -0
  15. geoip/ChangeLog.md +137 -0
  16. geoip/LICENSE +502 -0
  17. geoip/README.md +98 -0
  18. geoip/admin/build_geoipregionvars.php +35 -0
  19. geoip/composer.json +29 -0
  20. geoip/data/GeoIP.dat +0 -0
  21. geoip/examples/asn-v6.php +17 -0
  22. geoip/examples/benchmark.php +70 -0
  23. geoip/examples/city-v6.php +33 -0
  24. geoip/examples/city.php +33 -0
  25. geoip/examples/country-v6.php +32 -0
  26. geoip/examples/country.php +20 -0
  27. geoip/examples/domain.php +16 -0
  28. geoip/examples/netspeed.php +29 -0
  29. geoip/examples/netspeedcell.php +14 -0
  30. geoip/examples/org.php +22 -0
  31. geoip/examples/region.php +20 -0
  32. geoip/phpunit.xml.dist +28 -0
  33. geoip/src/geoip.inc +767 -0
  34. geoip/src/geoipcity.inc +171 -0
  35. geoip/src/geoipregionvars.php +4630 -0
  36. geoip/src/timezone.php +2235 -0
  37. geoip/tests/CityTest.php +34 -0
  38. geoip/tests/CountryTest.php +29 -0
  39. geoip/tests/DomainTest.php +15 -0
  40. geoip/tests/NetspeedcellTest.php +14 -0
  41. geoip/tests/OrgTest.php +14 -0
  42. geoip/tests/RegionTest.php +23 -0
  43. geoip/tests/bootstrap.php +5 -0
  44. geoip/tests/data/GeoIP.dat +0 -0
  45. geoip/tests/data/GeoIPASNum.dat +0 -0
  46. geoip/tests/data/GeoIPCity.dat +0 -0
  47. geoip/tests/data/GeoIPDomain.dat +0 -0
  48. geoip/tests/data/GeoIPISP.dat +0 -0
  49. geoip/tests/data/GeoIPNetSpeedCell.dat +0 -0
  50. geoip/tests/data/GeoIPOrg.dat +0 -0
  51. geoip/tests/data/GeoIPRegion.dat +0 -0
  52. geoip/tests/data/GeoIPv6.dat +0 -0
  53. geoip/tests/data/GeoLiteCityIPv6.dat +0 -0
  54. geoip/timezone/make_time_zone_php_code.pl +57 -0
  55. geoip/timezone/test_timezone.php +5 -0
  56. images/browsers/mozilla.png +0 -0
  57. images/layers-2x.png +0 -0
  58. images/layers.png +0 -0
  59. images/loading.gif +0 -0
  60. images/loadinggif.gif +0 -0
  61. images/map_pro.jpg +0 -0
  62. images/marker-icon-2x.png +0 -0
  63. images/marker-icon.png +0 -0
  64. images/marker-shadow.png +0 -0
  65. images/online_upgrade_to_pro.jpg +0 -0
  66. images/today_traffic_by_country_pro.jpg +0 -0
  67. images/top_refferring_countries_pro.jpg +0 -0
  68. images/traffic_by_country_pro.jpg +0 -0
  69. images/ui-icons_444444_256x240.png +0 -0
  70. images/ui-icons_555555_256x240.png +0 -0
  71. images/ui-icons_777620_256x240.png +0 -0
  72. images/ui-icons_777777_256x240.png +0 -0
  73. images/ui-icons_cc0000_256x240.png +0 -0
  74. images/ui-icons_ffffff_256x240.png +0 -0
  75. images/upgrade_now.png +0 -0
  76. init.php +79 -78
  77. js/FileSaver.js +2 -0
  78. js/ahcfree_js_scripts.js +906 -0
  79. js/buttons.html5.min.js +35 -0
  80. js/dataTables.buttons.min.js +45 -0
  81. js/front.js +9 -11
  82. js/jhxlsx.js +168 -0
  83. js/jquery.dataTables.min.js +166 -0
  84. js/jquery.jqplot.min.js +4 -7
Visitors-Traffic-Real-Time-Statistics.php CHANGED
@@ -1,142 +1,145 @@
1
- <?php
2
- /*
3
- Plugin Name: Visitor Traffic Real Time Statistics
4
- Description: Hits counter that shows analytical numbers of your WordPress site visitors and hits.
5
- Author: wp-buy
6
- Author URI: https://www.wp-buy.com/
7
- Version: 1.21
8
- Text Domain: vtrts-free
9
- Domain Path: /languages
10
- */
11
-
12
-
13
-
14
-
15
- define('AHCFREE_PLUGIN_MAIN_FILE', __FILE__);
16
- define('AHCFREE_PLUGIN_ROOT_DIR', dirname(__FILE__));
17
-
18
- require_once(AHCFREE_PLUGIN_ROOT_DIR. "/functions.php");
19
- require_once(AHCFREE_PLUGIN_ROOT_DIR."/init.php");
20
-
21
- if( !function_exists('get_plugin_data') ){
22
- include_once(ABSPATH . 'wp-includes/pluggable.php');
23
-
24
- }
25
- include_once("notifications.php");
26
-
27
- function ahcfree_plugin_action_links( $links ) {
28
-
29
- $links = array_merge( array(
30
- '<a href="' . esc_url( admin_url( '/admin.php?page=ahc_hits_counter_settings' ) ) . '">' . __( 'Settings', 'ahcfree' ) . '</a>',
31
- '<a href="' . esc_url( admin_url( '/admin.php?page=ahc_hits_counter_menu_free' ) ) . '">' . __( 'Dashboard', 'ahcfree' ) . '</a>',
32
- '<a target="_blank" href="' . esc_url('https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/' ) . '"><b style="color:green">' . __( 'Upgrade to PRO', 'ahcfree' ) . '</b></a>'
33
-
34
- ), $links );
35
-
36
- return $links;
37
-
38
- }
39
- add_action( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'ahcfree_plugin_action_links' );
40
-
41
-
42
- if ( function_exists('get_plugin_data') ) {
43
- $woodhl_detail = get_plugin_data( __FILE__ );
44
- $installed_version = get_option( 'visitors-traffic-real-time-statistics-free-version' );
45
- if( $installed_version != $woodhl_detail['Version'] ){
46
- add_action( 'plugins_loaded', 'ahcfix_init' );
47
- update_option( 'visitors-traffic-real-time-statistics-free-version', $woodhl_detail['Version'] );
48
- }
49
- }
50
-
51
-
52
- function ahcfree_HideMessageAjaxFunction()
53
- {
54
- add_option( 'ahcfree_upgrade_message','yes');
55
- }
56
-
57
-
58
- function ahcfree_after_plugin_row($plugin_file, $plugin_data, $status) {
59
-
60
- if(get_option('ahcfree_upgrade_message') !='yes')
61
- {
62
- $class_name = $plugin_data['slug'];
63
-
64
- $upgradeMsg = '<tr id="' .$class_name. '-plugin-update-tr" class="plugin-update-tr active">';
65
- $upgradeMsg .= '<td colspan="3" class="plugin-update">';
66
- $upgradeMsg .= '<div id="' .$class_name. '-upgradeMsg" class="update-message" style="background:#FFF8E5; padding-left:10px; border-left:#FFB900 solid 4px" >';
67
-
68
- $upgradeMsg .= 'You are running visitor traffic free. To get more features (<b style="color:red">Online users, GEO locations and visitors on the map</b>), you can <a href="https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/#plugins-page" target="_blank"><strong>upgrade now</strong></a> or ';
69
-
70
- $upgradeMsg .= '<span id="HideMe" style="cursor:pointer" ><a href="javascript:void(0)"><strong>dismiss</strong></a> this message</span>';
71
- $upgradeMsg .= '</div>';
72
- $upgradeMsg .= '</td>';
73
- $upgradeMsg .= '</tr>';
74
-
75
-
76
- echo $upgradeMsg;
77
- ?>
78
-
79
- <script type="text/javascript">
80
- jQuery(document).ready(function() {
81
- var row = jQuery('#<?php echo $class_name;?>-plugin-update-tr').closest('tr').prev();
82
- jQuery(row).addClass('update');
83
-
84
-
85
- jQuery("#HideMe").click(function(){
86
-
87
- jQuery("#<?php echo $class_name;?>-upgradeMsg").empty();
88
- jQuery("#<?php echo $class_name;?>-upgradeMsg").removeAttr("style");
89
-
90
- localStorage.setItem("vtrts_hide_upgrade_message", "hide_msg");
91
-
92
-
93
- });
94
-
95
- if(localStorage.getItem("vtrts_hide_upgrade_message") == "hide_msg")
96
- {
97
-
98
- jQuery("#<?php echo $class_name;?>-upgradeMsg").empty();
99
- jQuery("#<?php echo $class_name;?>-upgradeMsg").removeAttr("style");
100
- }
101
-
102
- });
103
- </script>
104
-
105
-
106
- <?php
107
-
108
- }
109
- }
110
-
111
- function ahcfree_row_meta( $meta_fields, $file ) {
112
-
113
- if ( strpos($file,'Visitors-Traffic-Real-Time-Statistics.php') == false) {
114
-
115
- return $meta_fields;
116
- }
117
-
118
- echo "<style>.pluginrows-rate-stars { display: inline-block; color: #ffb900; position: relative; top: 3px; }.pluginrows-rate-stars svg{ fill:#ffb900; } .pluginrows-rate-stars svg:hover{ fill:#ffb900 } .pluginrows-rate-stars svg:hover ~ svg{ fill:none; } </style>";
119
-
120
- $plugin_rate = "https://wordpress.org/support/plugin/visitors-traffic-real-time-statistics/reviews/?rate=5#new-post";
121
- $plugin_filter = "https://wordpress.org/support/plugin/visitors-traffic-real-time-statistics/reviews/?filter=5";
122
- $svg_xmlns = "https://www.w3.org/2000/svg";
123
- $svg_icon = '';
124
-
125
- for ( $i = 0; $i < 5; $i++ ) {
126
- $svg_icon .= "<svg xmlns='" . esc_url( $svg_xmlns ) . "' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>";
127
- }
128
-
129
- $meta_fields[] = '<a href="' . esc_url( $plugin_filter ) . '" target="_blank"><span class="dashicons dashicons-thumbs-up"></span>' . __( 'Vote!', 'pluginrows' ) . '</a>';
130
- $meta_fields[] = "<a href='" . esc_url( $plugin_rate ) . "' target='_blank' title='" . esc_html__( 'Rate', 'pluginrows' ) . "'><i class='pluginrows-rate-stars'>" . $svg_icon . "</i></a>";
131
-
132
- return $meta_fields;
133
- }
134
-
135
-
136
- $path = plugin_basename( __FILE__ );
137
- add_action("after_plugin_row_{$path}", 'ahcfree_after_plugin_row', 10, 3);
138
- add_action( 'wp_ajax_ahcfree_HideMessageAjaxFunction', 'ahcfree_HideMessageAjaxFunction' );
139
- add_filter( 'plugin_row_meta', 'ahcfree_row_meta', 10, 4 );
140
-
141
- //--------------------------------------------
142
- ?>
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Visitor Traffic Real Time Statistics
4
+ Description: Hits counter that shows analytical numbers of your WordPress site visitors and hits.
5
+ Author: wp-buy
6
+ Author URI: https://www.wp-buy.com/
7
+ Version: 2.6
8
+ Text Domain: vtrts-free
9
+ Domain Path: /languages
10
+ */
11
+
12
+
13
+
14
+
15
+ define('AHCFREE_PLUGIN_MAIN_FILE', __FILE__);
16
+ define('AHCFREE_PLUGIN_ROOT_DIR', dirname(__FILE__));
17
+
18
+ require_once(AHCFREE_PLUGIN_ROOT_DIR. "/functions.php");
19
+ require_once(AHCFREE_PLUGIN_ROOT_DIR."/init.php");
20
+
21
+ if( !function_exists('get_plugin_data') or !function_exists('wp_get_current_user')){
22
+ include_once(ABSPATH . 'wp-includes/pluggable.php');
23
+ }
24
+
25
+
26
+ include_once("notifications.php");
27
+
28
+
29
+ if ( function_exists('get_plugin_data') ) {
30
+ $woodhl_detail = get_plugin_data( __FILE__ );
31
+ $installed_version = get_option( 'visitors-traffic-real-time-statistics-pro-version' );
32
+ if( $installed_version != $woodhl_detail['Version'] ){
33
+ add_action( 'plugins_loaded', 'ahcfree_init' );
34
+ update_option( 'visitors-traffic-real-time-statistics-pro-version', $woodhl_detail['Version'] );
35
+ }
36
+ }
37
+
38
+ if(ahcfree_GetWPTimezoneString() !='')
39
+ {
40
+ date_default_timezone_set('UTC');
41
+ //date_default_timezone_set(ahcfree_GetWPTimezoneString());
42
+ }
43
+
44
+
45
+ function ahcfree_HideMessageAjaxFunction()
46
+ {
47
+ add_option( 'ahcfree_upgrade_message','yes');
48
+ }
49
+
50
+
51
+ function ahcfree_after_plugin_row($plugin_file, $plugin_data, $status) {
52
+
53
+ if(get_option('ahcfree_upgrade_message') !='yes')
54
+ {
55
+ $class_name = $plugin_data['slug'];
56
+
57
+ $upgradeMsg = '<tr id="' .$class_name. '-plugin-update-tr" class="plugin-update-tr active">';
58
+ $upgradeMsg .= '<td colspan="3" class="plugin-update">';
59
+ $upgradeMsg .= '<div id="' .$class_name. '-upgradeMsg" class="update-message" style="background:#FFF8E5; padding-left:10px; border-left:#FFB900 solid 4px" >';
60
+
61
+ $upgradeMsg .= 'You are running visitor traffic free. To get more features (<b style="color:red">Online users, GEO locations and visitors on the map</b>), you can <a href="https://www.wp-buy.com/product/visitors-traffic-real-time-statistics-pro/#plugins-page" target="_blank"><strong>upgrade now</strong></a> or ';
62
+
63
+ $upgradeMsg .= '<span id="HideMe" style="cursor:pointer" ><a href="javascript:void(0)"><strong>dismiss</strong></a> this message</span>';
64
+ $upgradeMsg .= '</div>';
65
+ $upgradeMsg .= '</td>';
66
+ $upgradeMsg .= '</tr>';
67
+
68
+
69
+ echo $upgradeMsg;
70
+ ?>
71
+
72
+ <script type="text/javascript">
73
+ jQuery(document).ready(function() {
74
+ var row = jQuery('#<?php echo $class_name;?>-plugin-update-tr').closest('tr').prev();
75
+ jQuery(row).addClass('update');
76
+
77
+
78
+ jQuery("#HideMe").click(function(){
79
+
80
+ jQuery("#<?php echo $class_name;?>-upgradeMsg").empty();
81
+ jQuery("#<?php echo $class_name;?>-upgradeMsg").removeAttr("style");
82
+
83
+ localStorage.setItem("vtrts_hide_upgrade_message", "hide_msg");
84
+
85
+
86
+ });
87
+
88
+ if(localStorage.getItem("vtrts_hide_upgrade_message") == "hide_msg")
89
+ {
90
+
91
+ jQuery("#<?php echo $class_name;?>-upgradeMsg").empty();
92
+ jQuery("#<?php echo $class_name;?>-upgradeMsg").removeAttr("style");
93
+ }
94
+
95
+ });
96
+ </script>
97
+
98
+
99
+ <?php
100
+
101
+ }
102
+ }
103
+
104
+ function ahcfree_action_links( $links ) {
105
+ $links = array_merge( array(
106
+ '<a href="' . esc_url( admin_url( '/admin.php?page=ahc_hits_counter_menu_free' ) ) . '">' . __( 'Dashboard', 'textdomain' ) . '</a>',
107
+ '<a href="' . esc_url( admin_url( '/admin.php?page=ahc_hits_counter_settings' ) ) . '">' . __( 'Settings', 'textdomain' ) . '</a>'
108
+ ), $links );
109
+ return $links;
110
+ }
111
+
112
+ function ahcfree_row_meta( $meta_fields, $file ) {
113
+
114
+ if ( strpos($file,'Visitors-Traffic-Real-Time-Statistics.php') == false) {
115
+
116
+ return $meta_fields;
117
+ }
118
+
119
+ echo "<style>.pluginrows-rate-stars { display: inline-block; color: #ffb900; position: relative; top: 3px; }.pluginrows-rate-stars svg{ fill:#ffb900; } .pluginrows-rate-stars svg:hover{ fill:#ffb900 } .pluginrows-rate-stars svg:hover ~ svg{ fill:none; } </style>";
120
+
121
+ $plugin_rate = "https://wordpress.org/support/plugin/visitors-traffic-real-time-statistics/reviews/?rate=5#new-post";
122
+ $plugin_filter = "https://wordpress.org/support/plugin/visitors-traffic-real-time-statistics/reviews/?filter=5";
123
+ $svg_xmlns = "https://www.w3.org/2000/svg";
124
+ $svg_icon = '';
125
+
126
+ for ( $i = 0; $i < 5; $i++ ) {
127
+ $svg_icon .= "<svg xmlns='" . esc_url( $svg_xmlns ) . "' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-star'><polygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/></svg>";
128
+ }
129
+
130
+ $meta_fields[] = '<a href="' . esc_url( $plugin_filter ) . '" target="_blank"><span class="dashicons dashicons-thumbs-up"></span>' . __( 'Vote!', 'pluginrows' ) . '</a>';
131
+ $meta_fields[] = "<a href='" . esc_url( $plugin_rate ) . "' target='_blank' title='" . esc_html__( 'Rate', 'pluginrows' ) . "'><i class='pluginrows-rate-stars'>" . $svg_icon . "</i></a>";
132
+
133
+ return $meta_fields;
134
+ }
135
+
136
+
137
+ $path = plugin_basename( __FILE__ );
138
+ add_action("after_plugin_row_{$path}", 'ahcfree_after_plugin_row', 10, 3);
139
+ add_action( 'wp_ajax_ahcfree_HideMessageAjaxFunction', 'ahcfree_HideMessageAjaxFunction' );
140
+ add_filter( 'plugin_row_meta', 'ahcfree_row_meta', 10, 4 );
141
+ add_action( 'plugin_action_links_' . $path, 'ahcfree_action_links' );
142
+ add_option( 'ahcfree_new_updates', date('Y-m-d', time()));
143
+
144
+ //--------------------------------------------
145
+ ?>
WPHitsCounter.php CHANGED
@@ -1,1080 +1,1128 @@
1
- <?php
2
-
3
- class AHCFree_WPHitsCounterPro {
4
-
5
- var $pageId;
6
- var $pageTitle;
7
- var $postType;
8
- var $ipAddress;
9
- var $ipIsUnknown;
10
- var $userAgent;
11
- var $referer;
12
- var $refererSite;
13
- var $browser;
14
- var $searchEngine;
15
- var $countryInternetCode;
16
- var $countryId;
17
- var $keyWords;
18
- var $requestUri;
19
-
20
- /**
21
-
22
- * Constructor
23
-
24
- *
25
-
26
- * @param integer $page_id
27
-
28
- * @param string $page_title Optional
29
-
30
- * @param string $post_type Optional
31
-
32
- */
33
- public function __construct($page_id, $page_title = NULL, $post_type = NULL) {
34
-
35
- global $_SERVER;
36
-
37
- $this->ipAddress = ahcfree_get_client_ip_address();
38
-
39
-
40
- if ($this->ipAddress == 'UNKNOWN') {
41
-
42
- $this->ipIsUnknown = true;
43
-
44
- $this->ipAddress = 'UNKNOWN' . uniqid();
45
- } else {
46
-
47
- $this->ipIsUnknown = false;
48
- }
49
-
50
-
51
-
52
- $this->userAgent = $_SERVER['HTTP_USER_AGENT'];
53
-
54
- $this->pageId = (isset($page_id)) ? $page_id : $_GET['page_id'];
55
-
56
- $this->pageTitle = $page_title;
57
-
58
- $this->postType = $post_type;
59
-
60
- $this->requestUri = trim($_SERVER['REQUEST_URI'], '/');
61
-
62
- //$post_permalink = get_the_permalink($this->pageId);
63
- //$protocol_arr = array('http://','https://','www.');
64
- //$link = str_replace($protocol_arr,'',$post_permalink);
65
- //$this->requestUri = trim(str_replace($_SERVER['HTTP_HOST'],'',$link),'/');
66
-
67
- if (isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER'])) {
68
-
69
- $hostName = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
70
-
71
- if ($hostName != $_SERVER['SERVER_NAME']) {
72
-
73
- $this->referer = $_SERVER['HTTP_REFERER'];
74
-
75
- $this->refererSite = $hostName;
76
- }
77
- }
78
-
79
- $this->searchEngine = NULL;
80
-
81
- $this->keyWords = NULL;
82
-
83
- $this->countryId = NULL;
84
- }
85
-
86
- //--------------------------------------------
87
- //--------------------------------------------
88
-
89
- /**
90
-
91
- * Trace visitor hit
92
-
93
- *
94
-
95
- * @return void
96
-
97
- */
98
- public function traceVisitorHit() {
99
-
100
- //$this->cleanUnwantedRecords();
101
-
102
- $this->cleanHitsTable();
103
-
104
- if (!$this->isHitRecorded()) {
105
-
106
- $visitorRecorded = $this->isVisitorRecorded();
107
-
108
- $this->getBrowser();
109
-
110
- usleep(1000);
111
-
112
- if (!empty($this->refererSite)) {
113
-
114
- $this->getSearchEngine();
115
- }
116
-
117
-
118
- /*
119
- if (!$this->isTodayPreparedInDb()) {
120
-
121
- $this->PrepareForTodayInDb();
122
- }*/
123
-
124
-
125
-
126
- if (!$visitorRecorded) {
127
-
128
- $this->updateVisitsTime(1, 1);
129
-
130
- $this->updateVisitors(1, 1);
131
- } else {
132
-
133
- $this->updateVisitsTime(0, 1);
134
-
135
- $this->updateVisitors(0, 1);
136
- }
137
-
138
-
139
- if (!empty($this->pageId) && !empty($this->pageTitle) && ($this->postType == 'post' or $this->postType == 'product' or $this->postType == 'page')) {
140
-
141
-
142
-
143
- $this->updateTitleTraffic($this->pageId, $this->pageTitle);
144
- }
145
-
146
-
147
-
148
- if (!empty($this->keyWords) && !empty($this->searchEngine)) {
149
-
150
- $this->updateKeywords($this->ipAddress, $this->keyWords, $this->referer, $this->searchEngine, $this->browser, $this->countryId);
151
- }
152
-
153
-
154
-
155
- if (!empty($this->refererSite)) {
156
-
157
- $this->updateReferingSites($this->refererSite);
158
- }
159
-
160
-
161
-
162
- if (!empty($this->searchEngine)) {
163
-
164
- $this->updateSearchingVisits($this->searchEngine);
165
- }
166
-
167
-
168
-
169
- if (!empty($this->countryId)) {
170
-
171
- if ($visitorRecorded) {
172
-
173
- $this->updateCountries($this->countryId, 0, 1);
174
- } else {
175
-
176
- $this->updateCountries($this->countryId, 1, 1);
177
- }
178
- }
179
-
180
- $this->updateBrowsers($this->browser);
181
-
182
-
183
-
184
- if (!$visitorRecorded) {
185
-
186
- $this->updateRecentVisitors($this->ipAddress, $this->referer, $this->searchEngine, $this->browser, $this->countryId);
187
- }
188
-
189
-
190
-
191
- $this->recordThisHits();
192
- }
193
- }
194
-
195
- //--------------------------------------------
196
-
197
- /**
198
-
199
- * Is visit is already recorded
200
-
201
- *
202
-
203
- * @return boolean
204
-
205
- */
206
- protected function isHitRecorded() {
207
-
208
- global $wpdb;
209
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
210
-
211
- $wpdb->insert(
212
- 'ahc_online_users',
213
- array(
214
- 'date' => date('Y-m-d H:i:s'),
215
- 'hit_ip_address' => $this->ipAddress,
216
- 'hit_page_id' => $this->pageId,
217
- )
218
- );
219
-
220
- $sql = "SELECT COUNT(`hit_id`) AS ct FROM `ahc_hits` WHERE DATE(`hit_date`) = '". date("Y-m-d") ."' AND `hit_ip_address` = %s AND `hit_page_id` = %s";
221
-
222
- //$sql = "SELECT COUNT(`hit_id`) AS ct FROM `ahc_hits` WHERE DATE(CONVERT_TZ(CONCAT_WS(' ',hit_date,hit_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = DATE(CONVERT_TZ(NOW( ),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) AND `hit_ip_address` = %s AND `hit_page_id` = %s";
223
-
224
- $result = $wpdb->get_results($wpdb->prepare($sql, $this->ipAddress, $this->pageId), OBJECT);
225
-
226
- if ($result !== false) {
227
-
228
- return ((int) $result[0]->ct > 0);
229
- }
230
- }
231
-
232
- //--------------------------------------------
233
-
234
- /**
235
-
236
- * Is visitor is already recorded
237
-
238
- *
239
-
240
- * @return boolean
241
-
242
- */
243
- protected function isVisitorRecorded() {
244
-
245
- global $wpdb;
246
-
247
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
248
-
249
- $sql = "SELECT COUNT(`hit_id`) AS ct FROM `ahc_hits` WHERE DATE(`hit_date`) = '". date("Y-m-d") ."' AND `hit_ip_address` = %s";
250
-
251
- //$sql = "SELECT COUNT(`hit_id`) AS ct FROM `ahc_hits` WHERE DATE(CONVERT_TZ(CONCAT_WS(' ',hit_date,hit_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = DATE(CONVERT_TZ(NOW( ),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) AND `hit_ip_address` = %s";
252
-
253
- $result = $wpdb->get_results($wpdb->prepare($sql, $this->ipAddress), OBJECT);
254
- if ($result !== false) {
255
-
256
- return ((int) $result[0]->ct > 0);
257
- }
258
- }
259
-
260
- //--------------------------------------------
261
-
262
- /**
263
-
264
- * Detect client browser
265
-
266
- *
267
-
268
- * @return void
269
-
270
- */
271
- protected function getBrowser() {
272
-
273
- if (strpos($this->userAgent, 'MSIE') !== false) {
274
-
275
- $this->browser = 1;
276
- } elseif (strpos($this->userAgent, 'Trident') !== false) {
277
-
278
- $this->browser = 1;
279
- } elseif (strpos($this->userAgent, 'Gecko') !== false) {
280
-
281
- if (strpos($this->userAgent, 'Firefox') !== false) {
282
-
283
- $this->browser = 2;
284
- } elseif (strpos($this->userAgent, 'Netscape') !== false) {
285
-
286
- $this->browser = 3;
287
- } elseif (strpos($this->userAgent, 'Chrome') !== false) {
288
-
289
- $this->browser = 4;
290
- } else {
291
-
292
- $this->browser = 5;
293
- }
294
- } elseif (strpos($this->userAgent, 'Opera Mini') !== false) {
295
-
296
- $this->browser = 6;
297
- } elseif (strpos($this->userAgent, 'Opera') !== false) {
298
-
299
- $this->browser = 7;
300
- } elseif (strpos($this->userAgent, 'Safari') !== false) {
301
-
302
- $this->browser = 8;
303
- } elseif (strpos($this->userAgent, 'iPad') !== false) {
304
-
305
- $this->browser = 9;
306
- } elseif (strpos($this->userAgent, 'Android') !== false) {
307
-
308
- $this->browser = 10;
309
- } elseif (strpos($this->userAgent, 'AIR') !== false) {
310
-
311
- $this->browser = 11;
312
- } elseif (strpos($this->userAgent, 'Fluid') !== false) {
313
-
314
- $this->browser = 12;
315
- } elseif (strpos($this->userAgent, 'Maxthon') !== false) {
316
-
317
- $this->browser = 13;
318
- } else {
319
-
320
- $this->browser = 14;
321
- }
322
- }
323
-
324
- //--------------------------------------------
325
-
326
- /**
327
-
328
- * Detect country internet code
329
-
330
- *
331
-
332
- * @return void
333
-
334
- */
335
- protected function getCountryInternetCode() {
336
-
337
- if (!$this->ipIsUnknown) {
338
-
339
- $gi = geoip_open(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . "geoip" . AHCFREE_DS . "data" . AHCFREE_DS . "GeoIP.dat", GEOIP_STANDARD);
340
-
341
- $this->countryInternetCode = geoip_country_code_by_addr($gi, $this->ipAddress);
342
-
343
- geoip_close($gi);
344
- }
345
-
346
- if (empty($this->countryInternetCode)) {
347
-
348
- $this->countryInternetCode = 'XX';
349
- }
350
- }
351
-
352
- //--------------------------------------------
353
-
354
- /**
355
-
356
- * Detect country ID
357
-
358
- *
359
-
360
- * @uses wpdb::prepare()
361
-
362
- * @uses wpdb::get_results()
363
-
364
- *
365
-
366
- * @return void
367
-
368
- */
369
-
370
-
371
- //--------------------------------------------
372
-
373
- /**
374
-
375
- * Detect search engine
376
-
377
- *
378
-
379
- * @uses wpdb::prepare()
380
-
381
- * @uses wpdb::get_results()
382
-
383
- *
384
-
385
- * @return void
386
-
387
- */
388
- protected function getSearchEngine() {
389
-
390
- global $wpdb;
391
-
392
- $sql = "SELECT `srh_id`, `srh_query_parameter`, `srh_identifier` FROM `ahc_search_engines`";
393
-
394
- $results = $wpdb->get_results($sql, OBJECT);
395
-
396
- if ($results !== false) {
397
-
398
- foreach ($results as $s) {
399
-
400
- if (strpos($this->referer, $s->srh_identifier . '.') !== false) {
401
-
402
- $this->searchEngine = $s->srh_id;
403
-
404
- $this->getKeyWords($s->srh_query_parameter);
405
- }
406
- }
407
- }
408
- }
409
-
410
- //--------------------------------------------
411
-
412
- /**
413
-
414
- * Detect search engine
415
-
416
- *
417
-
418
- * @uses wpdb::prepare()
419
-
420
- * @uses wpdb::get_results()
421
-
422
- *
423
-
424
- * @return void
425
-
426
- */
427
- protected function getKeyWords($query_param) {
428
-
429
- $query = parse_url($this->referer, PHP_URL_QUERY);
430
-
431
- $query = rawurldecode($query);
432
-
433
- $arr = array();
434
-
435
- parse_str($query, $arr);
436
-
437
- if (isset($arr[$query_param])) {
438
-
439
- $this->keyWords = $arr[$query_param];
440
- }
441
- }
442
-
443
- //--------------------------------------------
444
-
445
- /**
446
-
447
- * Is there a record prepared for today's visits
448
-
449
- *
450
-
451
- * @uses wpdb::get_results()
452
-
453
- *
454
-
455
- * @return boolean
456
-
457
- */
458
- protected function isTodayPreparedInDb() {
459
-
460
- global $wpdb;
461
-
462
- $del_sql = "DELETE v1 FROM ahc_visitors v1, ahc_visitors v2 WHERE v1.`vst_id` > v2.`vst_id` AND v1.`vst_date` = v2.`vst_date`";
463
-
464
- //$del_sql = "DELETE v1 FROM ahc_visitors v1, ahc_visitors v2 WHERE v1.`vst_id` > v2.`vst_id` AND CONVERT_TZ(v1.vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') = CONVERT_TZ(v2.vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') ";
465
-
466
- $del_result = $wpdb->get_results($del_sql, OBJECT);
467
-
468
-
469
- $sql = "SELECT COUNT(`vst_id`) AS ct FROM `ahc_visitors` WHERE DATE(`vst_date`) = '".date("Y-m-d")."'";
470
-
471
- //$sql = "SELECT COUNT(`vst_id`) AS ct FROM `ahc_visitors` WHERE DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = DATE(CONVERT_TZ(NOW( ),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'))";
472
-
473
- $result = $wpdb->get_results($sql, OBJECT);
474
-
475
- if ($result !== false) {
476
-
477
- return ((int) $result[0]->ct > 0);
478
- }
479
- }
480
-
481
- //--------------------------------------------
482
-
483
- /**
484
-
485
- * Prepared a record for today's visits
486
-
487
- *
488
-
489
- * @uses wpdb::query()
490
-
491
- *
492
-
493
- * @return boolean
494
-
495
- */
496
- protected function PrepareForTodayInDb() {
497
-
498
- global $wpdb;
499
-
500
- $sql = "INSERT INTO `ahc_visitors` (`vst_date`, `vst_visitors`, `vst_visits`) VALUES ('".date("Y-m-d H:i:s")."', 0, 0)";
501
-
502
- if ($wpdb->query($sql) !== false) {
503
-
504
- return true;
505
- }
506
-
507
- return false;
508
- }
509
-
510
- //--------------------------------------------
511
-
512
- /**
513
-
514
- * Clean daily hits table
515
-
516
- *
517
-
518
- * @uses wpdb::query()
519
-
520
- *
521
-
522
- * @return boolean
523
-
524
- */
525
- protected function cleanHitsTable() {
526
-
527
- global $wpdb;
528
-
529
- $sql = "DELETE FROM ahc_online_users WHERE DATE(`date`) <> '".date("Y-m-d")."'";
530
- $wpdb->query($sql);
531
-
532
- $sql = "DELETE FROM `ahc_hits` WHERE DATE(`hit_date`) <> '".date("Y-m-d")."'";
533
-
534
- if ($wpdb->query($sql) !== false) {
535
-
536
- return true;
537
- } else {
538
-
539
- return false;
540
- }
541
- }
542
-
543
- //--------------------------------------------
544
-
545
- /**
546
-
547
- * Update browser visits
548
-
549
- *
550
-
551
- * @uses wpdb::prepare()
552
-
553
- * @uses wpdb::query()
554
-
555
- *
556
-
557
- * @param integer $bsr_id
558
-
559
- * @return boolean
560
-
561
- */
562
- protected function updateBrowsers($bsr_id) {
563
-
564
- global $wpdb;
565
-
566
- $sql = "UPDATE `ahc_browsers` SET bsr_visits = bsr_visits + 1 WHERE bsr_id = %d";
567
-
568
- if ($wpdb->query($wpdb->prepare($sql, $bsr_id)) !== false) {
569
-
570
- return true;
571
- }
572
-
573
- return false;
574
- }
575
-
576
- //--------------------------------------------
577
-
578
- /**
579
-
580
- * Update country visits
581
-
582
- *
583
-
584
- * @uses wpdb::prepare()
585
-
586
- * @uses wpdb::query()
587
-
588
- *
589
-
590
- * @param integer $ctr_id
591
-
592
- * @param integer $visitors Optional
593
-
594
- * @param integer $visits Optional
595
-
596
- * @return boolean
597
-
598
- */
599
- protected function updateCountries($ctr_id, $visitors = 0, $visits = 0) {
600
-
601
- global $wpdb;
602
-
603
- $sql = "UPDATE `ahc_countries` SET ctr_visitors = ctr_visitors + %d, ctr_visits = ctr_visits + %d WHERE ctr_id = %d";
604
-
605
- return ($wpdb->query($wpdb->prepare($sql, $visitors, $visits, $ctr_id)) !== false);
606
- }
607
-
608
- //--------------------------------------------
609
-
610
- /**
611
-
612
- * Update visits sum order by search engine
613
-
614
- *
615
-
616
- * @uses wpdb::prepare()
617
-
618
- * @uses wpdb::get_results()
619
-
620
- * @uses wpdb::query()
621
-
622
- *
623
-
624
- * @param integer $srh_id
625
-
626
- * @return boolean
627
-
628
- */
629
- protected function updateSearchingVisits($srh_id) {
630
-
631
- global $wpdb;
632
-
633
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
634
-
635
- $sql = "SELECT vtsh_id FROM `ahc_searching_visits` WHERE srh_id = %d AND DATE(vtsh_date) = '".date("Y-m-d")."'";
636
- //$sql = "SELECT vtsh_id FROM `ahc_searching_visits` WHERE srh_id = %d AND DATE(CONVERT_TZ(vtsh_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = DATE(CONVERT_TZ(NOW( ),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'))";
637
-
638
- $result = $wpdb->get_results($wpdb->prepare($sql, $srh_id), OBJECT);
639
-
640
- if ($result !== false) {
641
-
642
- if ($wpdb->num_rows > 0) {
643
-
644
- $sql2 = "UPDATE `ahc_searching_visits` SET vtsh_visits = vtsh_visits + 1 WHERE vtsh_id = %d";
645
-
646
- return ($wpdb->query($wpdb->prepare($sql2, $result[0]->vtsh_id)) !== false);
647
- } else {
648
-
649
- $sql2 = "INSERT INTO `ahc_searching_visits` (srh_id, vtsh_date, vtsh_visits)
650
-
651
- VALUES (%d, %s, 1)";
652
-
653
- return ($wpdb->query($wpdb->prepare($sql2, $srh_id, date("Y-m-d H:i:s"))) !== false);
654
- }
655
- } else {
656
-
657
- return false;
658
- }
659
- }
660
-
661
- //--------------------------------------------
662
-
663
- /**
664
-
665
- * Update visitors count
666
-
667
- *
668
-
669
- * @uses wpdb::prepare()
670
-
671
- * @uses wpdb::query()
672
-
673
- *
674
-
675
- * @param integer $visitors Optional
676
-
677
- * @param integer $visits Optional
678
-
679
- * @return boolean
680
-
681
- */
682
- protected function updateVisitors($visitors = 0, $visits = 0) {
683
-
684
- global $wpdb;
685
-
686
-
687
- $sql = "INSERT INTO `ahc_daily_visitors_stats` (vst_date, vst_visitors, vst_visits) values(%s, %d, %d )";
688
-
689
- $wpdb->query($wpdb->prepare($sql, date("Y-m-d H:i:s"), $visitors, $visits));
690
-
691
- $sql = "INSERT INTO `ahc_visitors` (vst_date, vst_visitors, vst_visits) values(%s, %d, %d )";
692
- //$sql = "UPDATE `ahc_visitors` SET vst_visitors = vst_visitors + %d, vst_visits = vst_visits + %d WHERE DATE(vst_date) = DATE(NOW())";
693
-
694
- return ($wpdb->query($wpdb->prepare($sql, date("Y-m-d H:i:s"), $visitors, $visits)) !== false);
695
- }
696
-
697
- //--------------------------------------------
698
-
699
- /**
700
-
701
- * Update referring sites visits table
702
-
703
- *
704
-
705
- * @uses wpdb::prepare()
706
-
707
- * @uses wpdb::query()
708
-
709
- * @uses wpdb::get_results()
710
-
711
- *
712
-
713
- * @param string $rfr_site_name. referring site name
714
-
715
- * @return boolean
716
-
717
- */
718
- protected function updateReferingSites($rfr_site_name) {
719
-
720
- global $wpdb;
721
-
722
- $sql = "SELECT rfr_id FROM `ahc_refering_sites` where rfr_site_name = %s";
723
-
724
- $result = $wpdb->get_results($wpdb->prepare($sql, $rfr_site_name), OBJECT);
725
-
726
- if ($result !== false) {
727
-
728
- if (!empty($result)) {
729
-
730
- $sql2 = "UPDATE `ahc_refering_sites` SET rfr_visits = rfr_visits + 1 WHERE rfr_id = %d";
731
-
732
- return ($wpdb->query($wpdb->prepare($sql2, $result[0]->rfr_id)) !== false);
733
- } else {
734
-
735
- $sql2 = "INSERT INTO `ahc_refering_sites` (rfr_site_name, rfr_visits)
736
-
737
- VALUES(%s, 1)";
738
-
739
- return ($wpdb->query($wpdb->prepare($sql2, $rfr_site_name)) !== false);
740
- }
741
- } else {
742
-
743
- return false;
744
- }
745
- }
746
-
747
- //--------------------------------------------
748
-
749
- /**
750
-
751
- * Update recent visitors table
752
-
753
- *
754
-
755
- * @uses wpdb::prepare()
756
-
757
- * @uses wpdb::query()
758
-
759
- *
760
-
761
- * @param string $vtr_ip_address. IP address
762
-
763
- * @param string $vtr_referer Optional. Referring site name
764
-
765
- * @param integer $srh_id Optional. Search engine ID
766
-
767
- * @param integer $bsr_id Optional. Browser ID
768
-
769
- * @param integer $ctr_id Optional. Country ID
770
-
771
- * @return boolean
772
-
773
- */
774
- protected function updateRecentVisitors($vtr_ip_address, $vtr_referer = '', $srh_id = NULL, $bsr_id = NULL, $ctr_id = NULL) {
775
-
776
- global $wpdb;
777
-
778
-
779
-
780
-
781
- /* $ip_data = (ahcfree_advanced_get_link("http://ip-api.com/json/".$vtr_ip_address));
782
- $ip_data = json_decode($ip_data['body']);
783
-
784
- if($ip_data->city != '')
785
- {
786
-
787
- $ahc_city = $ip_data->city;
788
- $ahc_region = $ip_data->regionName;
789
- }
790
-
791
- if(empty($ip_data->city) or empty($ip_data->regionName))
792
- {
793
- $ip_data = (ahcfree_advanced_get_link("http://api.db-ip.com/v2/c425dbfb764da5017d283d8a2d53360be0869a4b/".$vtr_ip_address));
794
- $ip_data = json_decode($ip_data['body']);
795
-
796
- $ahc_city = $ip_data->city;
797
- $ahc_region = $ip_data->stateProv;
798
- }
799
-
800
- */
801
-
802
-
803
-
804
- $ip_data = (ahcfree_advanced_get_link("http://www.geoplugin.net/json.gp?ip=" . $vtr_ip_address));
805
- $ip_data = json_decode($ip_data['body']);
806
-
807
-
808
- if ($ip_data->geoplugin_city != '') {
809
-
810
- $ahc_city = $ip_data->geoplugin_countryName;
811
- $ahc_region = $ip_data->geoplugin_city;
812
- }
813
-
814
- if (empty($ip_data->geoplugin_city) or empty($ip_data->geoplugin_city)) {
815
- $ip_data = (ahcfree_advanced_get_link("http://ip-api.com/json/" . $vtr_ip_address));
816
- $ip_data = json_decode($ip_data['body']);
817
-
818
- $ahc_city = $ip_data->city;
819
- $ahc_region = $ip_data->regionName;
820
- }
821
-
822
-
823
- $sql = "INSERT INTO `ahc_recent_visitors` (vtr_ip_address, vtr_referer, srh_id, bsr_id, ctr_id, ahc_city, ahc_region, vtr_date, vtr_time) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)";
824
-
825
-
826
-
827
- return ($wpdb->query($wpdb->prepare($sql, $vtr_ip_address, $vtr_referer, $srh_id, $bsr_id, $ctr_id, $ahc_city, $ahc_region, date("Y-m-d"), date("H:i:s") )) !== false);
828
- }
829
-
830
- //--------------------------------------------
831
-
832
- /**
833
-
834
- * Update key words table
835
-
836
- *
837
-
838
- * @uses wpdb::prepare()
839
-
840
- * @uses wpdb::query()
841
-
842
- *
843
-
844
- * @param string $vtr_ip_address. IP address
845
-
846
- * @param string $kwd_keywords. Key word
847
-
848
- * @param string $kwd_referer. Referring site name.
849
-
850
- * @param integer $srh_id. Search engine ID
851
-
852
- * @param integer $bsr_id. Browser ID
853
-
854
- * @param integer $ctr_id Optional. Country ID
855
-
856
- * @return boolean
857
-
858
- */
859
- protected function updateKeywords($kwd_ip_address, $kwd_keywords, $kwd_referer, $srh_id, $bsr_id, $ctr_id = NULL) {
860
-
861
- global $wpdb;
862
-
863
- $sql = "INSERT INTO `ahc_keywords` (kwd_ip_address, kwd_keywords, kwd_referer, srh_id, ctr_id, bsr_id, kwd_date, kwd_time)
864
-
865
- VALUES (%s, %s, %s, %d, %d, %d, %s, %s)";
866
-
867
- return ($wpdb->query($wpdb->prepare($sql, $kwd_ip_address, $kwd_keywords, $kwd_referer, $srh_id, $ctr_id, $bsr_id, date("Y-m-d"), date("H:i:s"))) !== false);
868
- }
869
-
870
- //--------------------------------------------
871
-
872
- /**
873
-
874
- * Clean unwanted records. Only keeping a limit of fresh records. Limit is set by AHC_RECENT_VISITORS_LIMIT
875
-
876
- *
877
-
878
- * @uses wpdb::prepare()
879
-
880
- * @uses wpdb::get_results()
881
-
882
- * @uses wpdb::query()
883
-
884
- *
885
-
886
- * @return boolean
887
-
888
- */
889
- protected function cleanUnwantedRecords() {
890
-
891
- global $wpdb;
892
-
893
- $sql11 = "SELECT vtr_id FROM `ahc_recent_visitors` ORDER BY vtr_id LIMIT %d";
894
-
895
- $result = $wpdb->get_results($wpdb->prepare($sql11, AHC_RECENT_VISITORS_LIMIT), OBJECT);
896
-
897
- if ($result !== false) {
898
-
899
- $ids1 = array();
900
-
901
- $length = count($result);
902
-
903
- foreach ($result as $r) {
904
-
905
- $ids1[] = $r->vtr_id;
906
- }
907
-
908
- $ids1 = implode(',', $ids1);
909
-
910
- $sql12 = "DELETE FROM `ahc_recent_visitors`" . ((!empty($ids1)) ? " WHERE vtr_id NOT IN (" . $ids1 . ")" : "");
911
-
912
-
913
-
914
- $sql21 = "SELECT kwd_id FROM `ahc_keywords` ORDER BY kwd_id LIMIT %d";
915
-
916
- $result2 = $wpdb->get_results($wpdb->prepare($sql21, AHCFREE_RECENT_KEYWORDS_LIMIT), OBJECT);
917
-
918
- if ($result2 !== false) {
919
-
920
- $ids2 = array();
921
-
922
- foreach ($result2 as $r) {
923
-
924
- $ids2[] = $r->kwd_id;
925
- }
926
-
927
- $ids2 = implode(',', $ids2);
928
-
929
- $sql22 = "DELETE FROM `ahc_keywords`" . ((!empty($ids2)) ? " WHERE kwd_id NOT IN (" . $ids2 . ")" : "");
930
-
931
-
932
-
933
- if ($wpdb->query($sql12) !== false) {
934
-
935
- return ($wpdb->query($sql22) !== false);
936
- }
937
- }
938
- }
939
-
940
- return false;
941
- }
942
-
943
- //--------------------------------------------
944
-
945
- /**
946
-
947
- * Update traffic by title table
948
-
949
- *
950
-
951
- * @uses wpdb::prepare()
952
-
953
- * @uses wpdb::get_results()
954
-
955
- * @uses wpdb::query()
956
-
957
- *
958
-
959
- * @param integer $til_page_id
960
-
961
- * @param string $til_page_title
962
-
963
- * @return boolean
964
-
965
- */
966
- protected function updateTitleTraffic($til_page_id, $til_page_title) {
967
-
968
- global $wpdb;
969
-
970
- $sql = "SELECT til_id FROM `ahc_title_traffic` where til_page_id = %s";
971
-
972
- $result = $wpdb->get_results($wpdb->prepare($sql, $til_page_id), OBJECT);
973
-
974
- if ($result !== false) {
975
-
976
- if (!empty($result)) {
977
-
978
- $sql2 = "UPDATE `ahc_title_traffic`
979
-
980
- SET til_hits = til_hits + 1, til_page_title = %s
981
-
982
- WHERE til_id = %d";
983
-
984
- return ($wpdb->query($wpdb->prepare($sql2, $til_page_title, $result[0]->til_id)) !== false);
985
- } else {
986
-
987
- $sql2 = "INSERT INTO `ahc_title_traffic` (til_page_id, til_page_title, til_hits)
988
-
989
- VALUES(%s, %s, 1)";
990
-
991
- return ($wpdb->query($wpdb->prepare($sql2, $til_page_id, $til_page_title)) !== false);
992
- }
993
- } else {
994
-
995
- return false;
996
- }
997
- }
998
-
999
- //--------------------------------------------
1000
-
1001
- /**
1002
-
1003
- * Update visitor's & visits' times table
1004
-
1005
- *
1006
-
1007
- * @uses wpdb::prepare()
1008
-
1009
- * @uses wpdb::query()
1010
-
1011
- *
1012
-
1013
- * @param integer $visitors Optional
1014
-
1015
- * @param integer $visits Optional
1016
-
1017
- * @return boolean
1018
-
1019
- */
1020
- protected function updateVisitsTime($visitors = 0, $visits = 0) {
1021
-
1022
- global $wpdb;
1023
- $time = date('H:i:s');
1024
- $sql = "UPDATE `ahc_visits_time` SET vtm_visitors = vtm_visitors + %d, vtm_visits = vtm_visits + %d
1025
-
1026
- WHERE TIME(vtm_time_from) <= '$time' AND TIME(vtm_time_to) >= '$time'";
1027
- $query = $wpdb->prepare($sql, $visitors, $visits);
1028
- $result = ($wpdb->query($query) !== false);
1029
-
1030
- $sql = "UPDATE `ahc_visits_time` SET vtm_visitors = 1
1031
-
1032
- WHERE vtm_visitors = 0 AND TIME(vtm_time_from) <= '$time' AND TIME(vtm_time_to) >= '$time'";
1033
- $query = $wpdb->query($sql);
1034
-
1035
- $sql = "UPDATE `ahc_visits_time` SET vtm_visits = 1
1036
-
1037
- WHERE vtm_visits = 0 AND TIME(vtm_time_from) <= '$time' AND TIME(vtm_time_to) >= '$time'";
1038
- $query = $wpdb->query($sql);
1039
-
1040
- return $result;
1041
- }
1042
-
1043
- //--------------------------------------------
1044
-
1045
- /**
1046
-
1047
- * Record (insert) the visit
1048
-
1049
- *
1050
-
1051
- * @uses wpdb::prepare()
1052
-
1053
- * @uses wpdb::query()
1054
-
1055
- *
1056
-
1057
- * @return boolean
1058
-
1059
- */
1060
- protected function recordThisHits() {
1061
-
1062
- global $wpdb;
1063
-
1064
- $sql = "INSERT INTO `ahc_hits`
1065
-
1066
- (`hit_ip_address`, `hit_user_agent`, `hit_request_uri`, `hit_page_id`, `hit_page_title`, `ctr_id`, `hit_referer`, `hit_referer_site`,
1067
-
1068
- `srh_id`, `hit_search_words`, `bsr_id`, `hit_date`, `hit_time`)
1069
-
1070
- VALUES (%s, %s, %s, %s, %s, %d, %s, %s, %d, %s, %d, %s, %s)";
1071
-
1072
- $result = $wpdb->query($wpdb->prepare($sql, $this->ipAddress, $this->userAgent, $this->requestUri, $this->pageId, $this->pageTitle, $this->countryId, $this->referer, $this->refererSite, $this->searchEngine, $this->keyWords, $this->browser, date("Y-m-d"), date("H:i:s") ));
1073
-
1074
- return ($result !== false);
1075
- }
1076
-
1077
- //--------------------------------------------
1078
- }
1079
-
1080
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPHitsCounter {
4
+
5
+ var $pageId;
6
+ var $pageTitle;
7
+ var $postType;
8
+ var $ipAddress;
9
+ var $ipIsUnknown;
10
+ var $userAgent;
11
+ var $referer;
12
+ var $refererSite;
13
+ var $browser;
14
+ var $searchEngine;
15
+ var $countryInternetCode;
16
+ var $countryId;
17
+ var $keyWords;
18
+ var $requestUri;
19
+
20
+ /**
21
+
22
+ * Constructor
23
+
24
+ *
25
+
26
+ * @param integer $page_id
27
+
28
+ * @param string $page_title Optional
29
+
30
+ * @param string $post_type Optional
31
+
32
+ */
33
+ public function __construct($page_id, $page_title = NULL, $post_type = NULL) {
34
+
35
+ global $_SERVER;
36
+
37
+ $this->ipAddress = ahcfree_get_client_ip_address();
38
+
39
+
40
+ if ($this->ipAddress == 'UNKNOWN') {
41
+
42
+ $this->ipIsUnknown = true;
43
+
44
+ $this->ipAddress = 'UNKNOWN' . uniqid();
45
+ } else {
46
+
47
+ $this->ipIsUnknown = false;
48
+ }
49
+
50
+
51
+
52
+ $this->userAgent = $_SERVER['HTTP_USER_AGENT'];
53
+
54
+ $this->pageId = (isset($page_id)) ? $page_id : $_GET['page_id'];
55
+
56
+ $this->pageTitle = $page_title;
57
+
58
+ $this->postType = $post_type;
59
+
60
+ $this->requestUri = trim($_SERVER['REQUEST_URI'], '/');
61
+
62
+ //$post_permalink = get_the_permalink($this->pageId);
63
+ //$protocol_arr = array('http://','https://','www.');
64
+ //$link = str_replace($protocol_arr,'',$post_permalink);
65
+ //$this->requestUri = trim(str_replace($_SERVER['HTTP_HOST'],'',$link),'/');
66
+
67
+ if (isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER'])) {
68
+
69
+ $hostName = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
70
+
71
+ if ($hostName != $_SERVER['SERVER_NAME']) {
72
+
73
+ $this->referer = $_SERVER['HTTP_REFERER'];
74
+
75
+ $this->refererSite = $hostName;
76
+ }
77
+ }
78
+
79
+ $this->searchEngine = NULL;
80
+
81
+ $this->keyWords = NULL;
82
+
83
+ $this->countryId = NULL;
84
+ }
85
+
86
+ //--------------------------------------------
87
+ //--------------------------------------------
88
+
89
+ /**
90
+
91
+ * Trace visitor hit
92
+
93
+ *
94
+
95
+ * @return void
96
+
97
+ */
98
+ public function traceVisitorHit() {
99
+
100
+
101
+
102
+ //$this->cleanUnwantedRecords();
103
+
104
+ $this->cleanHitsTable();
105
+
106
+ if (!$this->isHitRecorded()) {
107
+
108
+ $visitorRecorded = $this->isVisitorRecorded();
109
+
110
+ $this->getBrowser();
111
+
112
+ $this->getCountryId();
113
+
114
+ usleep(10000);
115
+
116
+ if (!empty($this->refererSite)) {
117
+
118
+ $this->getSearchEngine();
119
+ }
120
+
121
+
122
+ /*
123
+ if (!$this->isTodayPreparedInDb()) {
124
+
125
+ $this->PrepareForTodayInDb();
126
+ }*/
127
+
128
+
129
+
130
+ if (!$visitorRecorded) {
131
+
132
+ $this->updateVisitsTime(1, 1);
133
+
134
+ $this->updateVisitors(1, 1);
135
+ } else {
136
+
137
+ $this->updateVisitsTime(0, 1);
138
+
139
+ $this->updateVisitors(0, 1);
140
+ }
141
+
142
+
143
+ if (!empty($this->pageId) && !empty($this->pageTitle) && ($this->postType == 'post' or $this->postType == 'product' or $this->postType == 'page')) {
144
+
145
+
146
+
147
+ $this->updateTitleTraffic($this->pageId, $this->pageTitle);
148
+ }
149
+
150
+
151
+
152
+ if (!empty($this->keyWords) && !empty($this->searchEngine)) {
153
+
154
+ $this->updateKeywords($this->ipAddress, $this->keyWords, $this->referer, $this->searchEngine, $this->browser, $this->countryId);
155
+ }
156
+
157
+
158
+
159
+ if (!empty($this->refererSite)) {
160
+
161
+ $this->updateReferingSites($this->refererSite);
162
+ }
163
+
164
+
165
+
166
+ if (!empty($this->searchEngine)) {
167
+
168
+ $this->updateSearchingVisits($this->searchEngine);
169
+ }
170
+
171
+
172
+
173
+ if (!empty($this->countryId)) {
174
+
175
+ if ($visitorRecorded) {
176
+
177
+ $this->updateCountries($this->countryId, 0, 1);
178
+ } else {
179
+
180
+ $this->updateCountries($this->countryId, 1, 1);
181
+ }
182
+ }
183
+
184
+ $this->updateBrowsers($this->browser);
185
+
186
+
187
+
188
+ if (!$visitorRecorded) {
189
+
190
+ $this->updateRecentVisitors($this->ipAddress, $this->referer, $this->searchEngine, $this->browser, $this->countryId);
191
+ }
192
+
193
+
194
+
195
+ $this->recordThisHits();
196
+
197
+
198
+ }
199
+ }
200
+
201
+ //--------------------------------------------
202
+
203
+ /**
204
+
205
+ * Is visit is already recorded
206
+
207
+ *
208
+
209
+ * @return boolean
210
+
211
+ */
212
+ protected function isHitRecorded() {
213
+
214
+ global $wpdb;
215
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
216
+
217
+ $wpdb->insert(
218
+ 'ahc_online_users',
219
+ array(
220
+ 'date' => ahcfree_localtime('Y-m-d H:i:s'),
221
+ 'hit_ip_address' => $this->ipAddress,
222
+ 'hit_page_id' => $this->pageId,
223
+ )
224
+ );
225
+
226
+ //$sql = "SELECT COUNT(`hit_id`) AS ct FROM `ahc_hits` WHERE DATE(`hit_date`) = '". ahcfree_localtime("Y-m-d") ."' AND `hit_ip_address` = %s AND `hit_page_id` = %s";
227
+
228
+ $sql = "SELECT COUNT(`hit_id`) AS ct FROM `ahc_hits` WHERE DATE(CONVERT_TZ(CONCAT_WS(' ',hit_date,hit_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = '".ahcfree_localtime("Y-m-d")."' AND `hit_ip_address` = %s AND `hit_page_id` = %s";
229
+
230
+ $result = $wpdb->get_results($wpdb->prepare($sql, $this->ipAddress, $this->pageId), OBJECT);
231
+
232
+ if ($result !== false) {
233
+
234
+ return ((int) $result[0]->ct > 0);
235
+ }
236
+ }
237
+
238
+ //--------------------------------------------
239
+
240
+ /**
241
+
242
+ * Is visitor is already recorded
243
+
244
+ *
245
+
246
+ * @return boolean
247
+
248
+ */
249
+ protected function isVisitorRecorded() {
250
+
251
+ global $wpdb;
252
+
253
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
254
+
255
+ /*$sql = "SELECT COUNT(`hit_id`) AS ct FROM `ahc_hits` WHERE DATE(`hit_date`) = '". gmdate("Y-m-d") ."' AND `hit_ip_address` = %s";*/
256
+
257
+ $sql = "SELECT COUNT(`hit_id`) AS ct FROM `ahc_hits` WHERE DATE(CONVERT_TZ(CONCAT_WS(' ',hit_date,hit_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = '".ahcfree_localtime("Y-m-d")."' AND `hit_ip_address` = %s";
258
+
259
+ $result = $wpdb->get_results($wpdb->prepare($sql, $this->ipAddress), OBJECT);
260
+ if ($result !== false) {
261
+
262
+ return ((int) $result[0]->ct > 0);
263
+ }
264
+ }
265
+
266
+ //--------------------------------------------
267
+
268
+ /**
269
+
270
+ * Detect client browser
271
+
272
+ *
273
+
274
+ * @return void
275
+
276
+ */
277
+ protected function getBrowser() {
278
+
279
+ if (strpos($this->userAgent, 'MSIE') !== false) {
280
+
281
+ $this->browser = 1;
282
+ } elseif (strpos($this->userAgent, 'Trident') !== false) {
283
+
284
+ $this->browser = 1;
285
+ } elseif (strpos($this->userAgent, 'Gecko') !== false) {
286
+
287
+ if (strpos($this->userAgent, 'Firefox') !== false) {
288
+
289
+ $this->browser = 2;
290
+ } elseif (strpos($this->userAgent, 'Netscape') !== false) {
291
+
292
+ $this->browser = 3;
293
+ } elseif (strpos($this->userAgent, 'Chrome') !== false) {
294
+
295
+ $this->browser = 4;
296
+ } else {
297
+
298
+ $this->browser = 5;
299
+ }
300
+ } elseif (strpos($this->userAgent, 'Opera Mini') !== false) {
301
+
302
+ $this->browser = 6;
303
+ } elseif (strpos($this->userAgent, 'Opera') !== false) {
304
+
305
+ $this->browser = 7;
306
+ } elseif (strpos($this->userAgent, 'Safari') !== false) {
307
+
308
+ $this->browser = 8;
309
+ } elseif (strpos($this->userAgent, 'iPad') !== false) {
310
+
311
+ $this->browser = 9;
312
+ } elseif (strpos($this->userAgent, 'Android') !== false) {
313
+
314
+ $this->browser = 10;
315
+ } elseif (strpos($this->userAgent, 'AIR') !== false) {
316
+
317
+ $this->browser = 11;
318
+ } elseif (strpos($this->userAgent, 'Fluid') !== false) {
319
+
320
+ $this->browser = 12;
321
+ } elseif (strpos($this->userAgent, 'Maxthon') !== false) {
322
+
323
+ $this->browser = 13;
324
+ } else {
325
+
326
+ $this->browser = 14;
327
+ }
328
+ }
329
+
330
+ //--------------------------------------------
331
+
332
+ /**
333
+
334
+ * Detect country internet code
335
+
336
+ *
337
+
338
+ * @return void
339
+
340
+ */
341
+ /* protected function getCountryInternetCode() {
342
+
343
+ if (!$this->ipIsUnknown) {
344
+
345
+ $gi = geoip_open(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . "geoip" . AHCFREE_DS . "data" . AHCFREE_DS . "GeoIP.dat", GEOIP_STANDARD);
346
+
347
+ $this->countryInternetCode = geoip_country_code_by_addr($gi, $this->ipAddress);
348
+
349
+ geoip_close($gi);
350
+ }
351
+
352
+ if (empty($this->countryInternetCode)) {
353
+
354
+ $this->countryInternetCode = 'XX';
355
+ }
356
+ }*/
357
+
358
+ protected function getCountryInternetCode() {
359
+ //https://nominatim.openstreetmap.org/reverse?format=json&lat=31.354675&lon=34.308826&zoom=18&addressdetails=1
360
+ if (!$this->ipIsUnknown) {
361
+
362
+ $ip_data = ahcfree_advanced_get_link("https://geoip-db.com/json/".$this->ipAddress);
363
+ $ip_data = json_decode($ip_data['body']);
364
+
365
+
366
+ if(trim($ip_data->country_code) != '' && strlen($ip_data->country_code) == 2)
367
+ {
368
+ $this->countryInternetCode = $ip_data->country_code;
369
+
370
+ }else{
371
+
372
+
373
+ $gi = geoip_open(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . "geoip" . AHCFREE_DS . "data" . AHCFREE_DS . "GeoIP.dat", GEOIP_STANDARD);
374
+
375
+ $this->countryInternetCode = geoip_country_code_by_addr($gi, $this->ipAddress);
376
+
377
+ geoip_close($gi);
378
+ }
379
+ }
380
+
381
+ if (empty($this->countryInternetCode)) {
382
+
383
+ $this->countryInternetCode = 'XX';
384
+ }
385
+ }
386
+
387
+ //--------------------------------------------
388
+
389
+ /**
390
+
391
+ * Detect country ID
392
+
393
+ *
394
+
395
+ * @uses wpdb::prepare()
396
+
397
+ * @uses wpdb::get_results()
398
+
399
+ *
400
+
401
+ * @return void
402
+
403
+ */
404
+ protected function getCountryId() {
405
+
406
+ global $wpdb;
407
+
408
+ $this->getCountryInternetCode();
409
+
410
+ if (!empty($this->countryInternetCode)) {
411
+
412
+ $sql = "SELECT `ctr_id` FROM `ahc_countries` WHERE `ctr_internet_code` = %s ";
413
+
414
+ $results = $wpdb->get_results($wpdb->prepare($sql, $this->countryInternetCode), OBJECT);
415
+
416
+ if ($results !== false && !empty($results)) {
417
+
418
+ $this->countryId = $results[0]->ctr_id;
419
+
420
+ return;
421
+ }
422
+ }
423
+ }
424
+
425
+ //--------------------------------------------
426
+
427
+ /**
428
+
429
+ * Detect search engine
430
+
431
+ *
432
+
433
+ * @uses wpdb::prepare()
434
+
435
+ * @uses wpdb::get_results()
436
+
437
+ *
438
+
439
+ * @return void
440
+
441
+ */
442
+ protected function getSearchEngine() {
443
+
444
+ global $wpdb;
445
+
446
+ $sql = "SELECT `srh_id`, `srh_query_parameter`, `srh_identifier` FROM `ahc_search_engines`";
447
+
448
+ $results = $wpdb->get_results($sql, OBJECT);
449
+
450
+ if ($results !== false) {
451
+
452
+ foreach ($results as $s) {
453
+
454
+ if (strpos($this->referer, $s->srh_identifier . '.') !== false) {
455
+
456
+ $this->searchEngine = $s->srh_id;
457
+
458
+ $this->getKeyWords($s->srh_query_parameter);
459
+ }
460
+ }
461
+ }
462
+ }
463
+
464
+ //--------------------------------------------
465
+
466
+ /**
467
+
468
+ * Detect search engine
469
+
470
+ *
471
+
472
+ * @uses wpdb::prepare()
473
+
474
+ * @uses wpdb::get_results()
475
+
476
+ *
477
+
478
+ * @return void
479
+
480
+ */
481
+ protected function getKeyWords($query_param) {
482
+
483
+ $query = parse_url($this->referer, PHP_URL_QUERY);
484
+
485
+ $query = rawurldecode($query);
486
+
487
+ $arr = array();
488
+
489
+ parse_str($query, $arr);
490
+
491
+ if (isset($arr[$query_param])) {
492
+
493
+ $this->keyWords = $arr[$query_param];
494
+ }
495
+ }
496
+
497
+ //--------------------------------------------
498
+
499
+ /**
500
+
501
+ * Is there a record prepared for today's visits
502
+
503
+ *
504
+
505
+ * @uses wpdb::get_results()
506
+
507
+ *
508
+
509
+ * @return boolean
510
+
511
+ */
512
+ protected function isTodayPreparedInDb() {
513
+
514
+ global $wpdb;
515
+
516
+ $del_sql = "DELETE v1 FROM ahc_visitors v1, ahc_visitors v2 WHERE v1.`vst_id` > v2.`vst_id` AND v1.`vst_date` = v2.`vst_date`";
517
+
518
+ //$del_sql = "DELETE v1 FROM ahc_visitors v1, ahc_visitors v2 WHERE v1.`vst_id` > v2.`vst_id` AND CONVERT_TZ(v1.vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') = CONVERT_TZ(v2.vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') ";
519
+
520
+ $del_result = $wpdb->get_results($del_sql, OBJECT);
521
+
522
+
523
+ $sql = "SELECT COUNT(`vst_id`) AS ct FROM `ahc_visitors` WHERE DATE(`vst_date`) = '".gmdate("Y-m-d")."'";
524
+
525
+ //$sql = "SELECT COUNT(`vst_id`) AS ct FROM `ahc_visitors` WHERE DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = DATE(CONVERT_TZ(NOW( ),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'))";
526
+
527
+ $result = $wpdb->get_results($sql, OBJECT);
528
+
529
+ if ($result !== false) {
530
+
531
+ return ((int) $result[0]->ct > 0);
532
+ }
533
+ }
534
+
535
+ //--------------------------------------------
536
+
537
+ /**
538
+
539
+ * Prepared a record for today's visits
540
+
541
+ *
542
+
543
+ * @uses wpdb::query()
544
+
545
+ *
546
+
547
+ * @return boolean
548
+
549
+ */
550
+ protected function PrepareForTodayInDb() {
551
+
552
+ global $wpdb;
553
+
554
+ $sql = "INSERT INTO `ahc_visitors` (`vst_date`, `vst_visitors`, `vst_visits`) VALUES ('".gmdate("Y-m-d H:i:s")."', 0, 0)";
555
+
556
+ if ($wpdb->query($sql) !== false) {
557
+
558
+ return true;
559
+ }
560
+
561
+ return false;
562
+ }
563
+
564
+ //--------------------------------------------
565
+
566
+ /**
567
+
568
+ * Clean daily hits table
569
+
570
+ *
571
+
572
+ * @uses wpdb::query()
573
+
574
+ *
575
+
576
+ * @return boolean
577
+
578
+ */
579
+ protected function cleanHitsTable() {
580
+
581
+ global $wpdb;
582
+
583
+ $sql = "DELETE FROM ahc_online_users WHERE DATE(`date`) <> '".gmdate("Y-m-d")."'";
584
+ $wpdb->query($sql);
585
+
586
+ $sql = "DELETE FROM `ahc_hits` WHERE DATE(`hit_date`) <> '".gmdate("Y-m-d")."'";
587
+
588
+
589
+ if ($wpdb->query($sql) !== false) {
590
+
591
+ return true;
592
+ } else {
593
+
594
+ return false;
595
+ }
596
+ }
597
+
598
+ //--------------------------------------------
599
+
600
+ /**
601
+
602
+ * Update browser visits
603
+
604
+ *
605
+
606
+ * @uses wpdb::prepare()
607
+
608
+ * @uses wpdb::query()
609
+
610
+ *
611
+
612
+ * @param integer $bsr_id
613
+
614
+ * @return boolean
615
+
616
+ */
617
+ protected function updateBrowsers($bsr_id) {
618
+
619
+ global $wpdb;
620
+
621
+ $sql = "UPDATE `ahc_browsers` SET bsr_visits = bsr_visits + 1 WHERE bsr_id = %d";
622
+
623
+ if ($wpdb->query($wpdb->prepare($sql, $bsr_id)) !== false) {
624
+
625
+ return true;
626
+ }
627
+
628
+ return false;
629
+ }
630
+
631
+ //--------------------------------------------
632
+
633
+ /**
634
+
635
+ * Update country visits
636
+
637
+ *
638
+
639
+ * @uses wpdb::prepare()
640
+
641
+ * @uses wpdb::query()
642
+
643
+ *
644
+
645
+ * @param integer $ctr_id
646
+
647
+ * @param integer $visitors Optional
648
+
649
+ * @param integer $visits Optional
650
+
651
+ * @return boolean
652
+
653
+ */
654
+ protected function updateCountries($ctr_id, $visitors = 0, $visits = 0) {
655
+
656
+ global $wpdb;
657
+
658
+ $sql = "UPDATE `ahc_countries` SET ctr_visitors = ctr_visitors + %d, ctr_visits = ctr_visits + %d WHERE ctr_id = %d";
659
+
660
+ return ($wpdb->query($wpdb->prepare($sql, $visitors, $visits, $ctr_id)) !== false);
661
+ }
662
+
663
+ //--------------------------------------------
664
+
665
+ /**
666
+
667
+ * Update visits sum order by search engine
668
+
669
+ *
670
+
671
+ * @uses wpdb::prepare()
672
+
673
+ * @uses wpdb::get_results()
674
+
675
+ * @uses wpdb::query()
676
+
677
+ *
678
+
679
+ * @param integer $srh_id
680
+
681
+ * @return boolean
682
+
683
+ */
684
+ protected function updateSearchingVisits($srh_id) {
685
+
686
+ global $wpdb;
687
+
688
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
689
+
690
+ $sql = "SELECT vtsh_id FROM `ahc_searching_visits` WHERE srh_id = %d AND DATE(vtsh_date) = '".gmdate("Y-m-d")."'";
691
+ //$sql = "SELECT vtsh_id FROM `ahc_searching_visits` WHERE srh_id = %d AND DATE(CONVERT_TZ(vtsh_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = DATE(CONVERT_TZ(NOW( ),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'))";
692
+
693
+ $result = $wpdb->get_results($wpdb->prepare($sql, $srh_id), OBJECT);
694
+
695
+ if ($result !== false) {
696
+
697
+ if ($wpdb->num_rows > 0) {
698
+
699
+ $sql2 = "UPDATE `ahc_searching_visits` SET vtsh_visits = vtsh_visits + 1 WHERE vtsh_id = %d";
700
+
701
+ return ($wpdb->query($wpdb->prepare($sql2, $result[0]->vtsh_id)) !== false);
702
+ } else {
703
+
704
+ $sql2 = "INSERT INTO `ahc_searching_visits` (srh_id, vtsh_date, vtsh_visits)
705
+
706
+ VALUES (%d, %s, 1)";
707
+
708
+ return ($wpdb->query($wpdb->prepare($sql2, $srh_id, gmdate("Y-m-d H:i:s"))) !== false);
709
+ }
710
+ } else {
711
+
712
+ return false;
713
+ }
714
+ }
715
+
716
+ //--------------------------------------------
717
+
718
+ /**
719
+
720
+ * Update visitors count
721
+
722
+ *
723
+
724
+ * @uses wpdb::prepare()
725
+
726
+ * @uses wpdb::query()
727
+
728
+ *
729
+
730
+ * @param integer $visitors Optional
731
+
732
+ * @param integer $visits Optional
733
+
734
+ * @return boolean
735
+
736
+ */
737
+ protected function updateVisitors($visitors = 0, $visits = 0) {
738
+
739
+ global $wpdb;
740
+
741
+
742
+ $sql = "INSERT INTO `ahc_daily_visitors_stats` (vst_date, vst_visitors, vst_visits) values(%s, %d, %d )";
743
+
744
+ $wpdb->query($wpdb->prepare($sql, gmdate("Y-m-d H:i:s"), $visitors, $visits));
745
+
746
+ $sql = "INSERT INTO `ahc_visitors` (vst_date, vst_visitors, vst_visits) values(%s, %d, %d )";
747
+ //$sql = "UPDATE `ahc_visitors` SET vst_visitors = vst_visitors + %d, vst_visits = vst_visits + %d WHERE DATE(vst_date) = DATE(NOW())";
748
+
749
+ return ($wpdb->query($wpdb->prepare($sql, gmdate("Y-m-d H:i:s"), $visitors, $visits)) !== false);
750
+ }
751
+
752
+ //--------------------------------------------
753
+
754
+ /**
755
+
756
+ * Update referring sites visits table
757
+
758
+ *
759
+
760
+ * @uses wpdb::prepare()
761
+
762
+ * @uses wpdb::query()
763
+
764
+ * @uses wpdb::get_results()
765
+
766
+ *
767
+
768
+ * @param string $rfr_site_name. referring site name
769
+
770
+ * @return boolean
771
+
772
+ */
773
+ protected function updateReferingSites($rfr_site_name) {
774
+
775
+ global $wpdb;
776
+
777
+ $sql = "SELECT rfr_id FROM `ahc_refering_sites` where rfr_site_name = %s";
778
+
779
+ $result = $wpdb->get_results($wpdb->prepare($sql, $rfr_site_name), OBJECT);
780
+
781
+ if ($result !== false) {
782
+
783
+ if (!empty($result)) {
784
+
785
+ $sql2 = "UPDATE `ahc_refering_sites` SET rfr_visits = rfr_visits + 1 WHERE rfr_id = %d";
786
+
787
+ return ($wpdb->query($wpdb->prepare($sql2, $result[0]->rfr_id)) !== false);
788
+ } else {
789
+
790
+ $sql2 = "INSERT INTO `ahc_refering_sites` (rfr_site_name, rfr_visits)
791
+
792
+ VALUES(%s, 1)";
793
+
794
+ return ($wpdb->query($wpdb->prepare($sql2, $rfr_site_name)) !== false);
795
+ }
796
+ } else {
797
+
798
+ return false;
799
+ }
800
+ }
801
+
802
+ //--------------------------------------------
803
+
804
+ /**
805
+
806
+ * Update recent visitors table
807
+
808
+ *
809
+
810
+ * @uses wpdb::prepare()
811
+
812
+ * @uses wpdb::query()
813
+
814
+ *
815
+
816
+ * @param string $vtr_ip_address. IP address
817
+
818
+ * @param string $vtr_referer Optional. Referring site name
819
+
820
+ * @param integer $srh_id Optional. Search engine ID
821
+
822
+ * @param integer $bsr_id Optional. Browser ID
823
+
824
+ * @param integer $ctr_id Optional. Country ID
825
+
826
+ * @return boolean
827
+
828
+ */
829
+ protected function updateRecentVisitors($vtr_ip_address, $vtr_referer = '', $srh_id = NULL, $bsr_id = NULL, $ctr_id = NULL) {
830
+
831
+ global $wpdb;
832
+
833
+
834
+ $ahc_city = 'UNKNOWN';
835
+ $ahc_region = 'UNKNOWN';
836
+
837
+
838
+
839
+ $ip_data = (ahcfree_advanced_get_link("https://ip-api.com/json/".$vtr_ip_address));
840
+ $ip_data = json_decode($ip_data['body']);
841
+
842
+
843
+ $ahc_city = $ip_data->city;
844
+ $ahc_region = $ip_data->regionName;
845
+
846
+ if(trim($ip_data->city) == '' or trim($ip_data->city) == null or trim($ip_data->city) == 'null' or empty($ip_data->city) or strlen($ip_data->city) <=2)
847
+ {
848
+ $ip_data = ahcfree_advanced_get_link("https://geoip-db.com/json/".$vtr_ip_address);
849
+ $ip_data = json_decode($ip_data['body']);
850
+
851
+ if(trim($ip_data->city) != '')
852
+ {
853
+
854
+ $ahc_city = $ip_data->city;
855
+ $ahc_region = $ip_data->state;
856
+ }
857
+ else{
858
+
859
+
860
+ $ip_data = (ahcfree_advanced_get_link("http://www.geoplugin.net/json.gp?ip=".$vtr_ip_address));
861
+ $ip_data = json_decode($ip_data['body']);
862
+
863
+ $ahc_city = $ip_data->geoplugin_city;
864
+ $ahc_region = $ip_data->geoplugin_region;
865
+
866
+
867
+ }
868
+
869
+ }
870
+
871
+ $sql = "INSERT INTO `ahc_recent_visitors` (vtr_ip_address, vtr_referer, srh_id, bsr_id, ctr_id, ahc_city, ahc_region, vtr_date, vtr_time) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)";
872
+
873
+
874
+
875
+ return ($wpdb->query($wpdb->prepare($sql, $vtr_ip_address, $vtr_referer, $srh_id, $bsr_id, $ctr_id, $ahc_city, $ahc_region, gmdate("Y-m-d"), gmdate("H:i:s") )) !== false);
876
+ }
877
+
878
+ //--------------------------------------------
879
+
880
+ /**
881
+
882
+ * Update key words table
883
+
884
+ *
885
+
886
+ * @uses wpdb::prepare()
887
+
888
+ * @uses wpdb::query()
889
+
890
+ *
891
+
892
+ * @param string $vtr_ip_address. IP address
893
+
894
+ * @param string $kwd_keywords. Key word
895
+
896
+ * @param string $kwd_referer. Referring site name.
897
+
898
+ * @param integer $srh_id. Search engine ID
899
+
900
+ * @param integer $bsr_id. Browser ID
901
+
902
+ * @param integer $ctr_id Optional. Country ID
903
+
904
+ * @return boolean
905
+
906
+ */
907
+ protected function updateKeywords($kwd_ip_address, $kwd_keywords, $kwd_referer, $srh_id, $bsr_id, $ctr_id = NULL) {
908
+
909
+ global $wpdb;
910
+
911
+ $sql = "INSERT INTO `ahc_keywords` (kwd_ip_address, kwd_keywords, kwd_referer, srh_id, ctr_id, bsr_id, kwd_date, kwd_time)
912
+
913
+ VALUES (%s, %s, %s, %d, %d, %d, %s, %s)";
914
+
915
+ return ($wpdb->query($wpdb->prepare($sql, $kwd_ip_address, $kwd_keywords, $kwd_referer, $srh_id, $ctr_id, $bsr_id, gmdate("Y-m-d"), gmdate("H:i:s"))) !== false);
916
+ }
917
+
918
+ //--------------------------------------------
919
+
920
+ /**
921
+
922
+ * Clean unwanted records. Only keeping a limit of fresh records. Limit is set by AHCFREE_RECENT_VISITORS_LIMIT
923
+
924
+ *
925
+
926
+ * @uses wpdb::prepare()
927
+
928
+ * @uses wpdb::get_results()
929
+
930
+ * @uses wpdb::query()
931
+
932
+ *
933
+
934
+ * @return boolean
935
+
936
+ */
937
+ protected function cleanUnwantedRecords() {
938
+
939
+ global $wpdb;
940
+
941
+ $sql11 = "SELECT vtr_id FROM `ahc_recent_visitors` ORDER BY vtr_id LIMIT %d";
942
+
943
+ $result = $wpdb->get_results($wpdb->prepare($sql11, AHCFREE_RECENT_VISITORS_LIMIT), OBJECT);
944
+
945
+ if ($result !== false) {
946
+
947
+ $ids1 = array();
948
+
949
+ $length = count($result);
950
+
951
+ foreach ($result as $r) {
952
+
953
+ $ids1[] = $r->vtr_id;
954
+ }
955
+
956
+ $ids1 = implode(',', $ids1);
957
+
958
+ $sql12 = "DELETE FROM `ahc_recent_visitors`" . ((!empty($ids1)) ? " WHERE vtr_id NOT IN (" . $ids1 . ")" : "");
959
+
960
+
961
+
962
+ $sql21 = "SELECT kwd_id FROM `ahc_keywords` ORDER BY kwd_id LIMIT %d";
963
+
964
+ $result2 = $wpdb->get_results($wpdb->prepare($sql21, AHCFREE_RECENT_KEYWORDS_LIMIT), OBJECT);
965
+
966
+ if ($result2 !== false) {
967
+
968
+ $ids2 = array();
969
+
970
+ foreach ($result2 as $r) {
971
+
972
+ $ids2[] = $r->kwd_id;
973
+ }
974
+
975
+ $ids2 = implode(',', $ids2);
976
+
977
+ $sql22 = "DELETE FROM `ahc_keywords`" . ((!empty($ids2)) ? " WHERE kwd_id NOT IN (" . $ids2 . ")" : "");
978
+
979
+
980
+
981
+ if ($wpdb->query($sql12) !== false) {
982
+
983
+ return ($wpdb->query($sql22) !== false);
984
+ }
985
+ }
986
+ }
987
+
988
+ return false;
989
+ }
990
+
991
+ //--------------------------------------------
992
+
993
+ /**
994
+
995
+ * Update traffic by title table
996
+
997
+ *
998
+
999
+ * @uses wpdb::prepare()
1000
+
1001
+ * @uses wpdb::get_results()
1002
+
1003
+ * @uses wpdb::query()
1004
+
1005
+ *
1006
+
1007
+ * @param integer $til_page_id
1008
+
1009
+ * @param string $til_page_title
1010
+
1011
+ * @return boolean
1012
+
1013
+ */
1014
+ protected function updateTitleTraffic($til_page_id, $til_page_title) {
1015
+
1016
+ global $wpdb;
1017
+
1018
+ $sql = "SELECT til_id FROM `ahc_title_traffic` where til_page_id = %s";
1019
+
1020
+ $result = $wpdb->get_results($wpdb->prepare($sql, $til_page_id), OBJECT);
1021
+
1022
+ if ($result !== false) {
1023
+
1024
+ if (!empty($result)) {
1025
+
1026
+ $sql2 = "UPDATE `ahc_title_traffic`
1027
+
1028
+ SET til_hits = til_hits + 1, til_page_title = %s
1029
+
1030
+ WHERE til_id = %d";
1031
+
1032
+ return ($wpdb->query($wpdb->prepare($sql2, $til_page_title, $result[0]->til_id)) !== false);
1033
+ } else {
1034
+
1035
+ $sql2 = "INSERT INTO `ahc_title_traffic` (til_page_id, til_page_title, til_hits)
1036
+
1037
+ VALUES(%s, %s, 1)";
1038
+
1039
+ return ($wpdb->query($wpdb->prepare($sql2, $til_page_id, $til_page_title)) !== false);
1040
+ }
1041
+ } else {
1042
+
1043
+ return false;
1044
+ }
1045
+ }
1046
+
1047
+ //--------------------------------------------
1048
+
1049
+ /**
1050
+
1051
+ * Update visitor's & visits' times table
1052
+
1053
+ *
1054
+
1055
+ * @uses wpdb::prepare()
1056
+
1057
+ * @uses wpdb::query()
1058
+
1059
+ *
1060
+
1061
+ * @param integer $visitors Optional
1062
+
1063
+ * @param integer $visits Optional
1064
+
1065
+ * @return boolean
1066
+
1067
+ */
1068
+ protected function updateVisitsTime($visitors = 0, $visits = 0) {
1069
+
1070
+ global $wpdb;
1071
+ $time = gmdate('H:i:s');
1072
+ $sql = "UPDATE `ahc_visits_time` SET vtm_visitors = vtm_visitors + %d, vtm_visits = vtm_visits + %d
1073
+
1074
+ WHERE TIME(vtm_time_from) <= '$time' AND TIME(vtm_time_to) >= '$time'";
1075
+ $query = $wpdb->prepare($sql, $visitors, $visits);
1076
+ $result = ($wpdb->query($query) !== false);
1077
+
1078
+ $sql = "UPDATE `ahc_visits_time` SET vtm_visitors = 1
1079
+
1080
+ WHERE vtm_visitors = 0 AND TIME(vtm_time_from) <= '$time' AND TIME(vtm_time_to) >= '$time'";
1081
+ $query = $wpdb->query($sql);
1082
+
1083
+ $sql = "UPDATE `ahc_visits_time` SET vtm_visits = 1
1084
+
1085
+ WHERE vtm_visits = 0 AND TIME(vtm_time_from) <= '$time' AND TIME(vtm_time_to) >= '$time'";
1086
+ $query = $wpdb->query($sql);
1087
+
1088
+ return $result;
1089
+ }
1090
+
1091
+ //--------------------------------------------
1092
+
1093
+ /**
1094
+
1095
+ * Record (insert) the visit
1096
+
1097
+ *
1098
+
1099
+ * @uses wpdb::prepare()
1100
+
1101
+ * @uses wpdb::query()
1102
+
1103
+ *
1104
+
1105
+ * @return boolean
1106
+
1107
+ */
1108
+ protected function recordThisHits() {
1109
+
1110
+ global $wpdb;
1111
+
1112
+ $sql = "INSERT INTO `ahc_hits`
1113
+
1114
+ (`hit_ip_address`, `hit_user_agent`, `hit_request_uri`, `hit_page_id`, `hit_page_title`, `ctr_id`, `hit_referer`, `hit_referer_site`,
1115
+
1116
+ `srh_id`, `hit_search_words`, `bsr_id`, `hit_date`, `hit_time`)
1117
+
1118
+ VALUES (%s, %s, %s, %s, %s, %d, %s, %s, %d, %s, %d, %s, %s)";
1119
+
1120
+ $result = $wpdb->query($wpdb->prepare($sql, $this->ipAddress, $this->userAgent, $this->requestUri, $this->pageId, $this->pageTitle, $this->countryId, $this->referer, $this->refererSite, $this->searchEngine, $this->keyWords, $this->browser, gmdate("Y-m-d"), gmdate("H:i:s") ));
1121
+
1122
+ return ($result !== false);
1123
+ }
1124
+
1125
+ //--------------------------------------------
1126
+ }
1127
+
1128
+ ?>
ahc_about.php CHANGED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
2
+
3
+ <!-- Latest compiled and minified JavaScript -->
4
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
5
+
6
+ <script language="javascript" type="text/javascript">
7
+ function imgFlagError(image){
8
+ image.onerror = "";
9
+ image.src = "<?php echo plugins_url('/images/flags/noFlag.png', AHCFREE_PLUGIN_MAIN_FILE) ?>";
10
+ return true;
11
+ }
12
+ </script>
13
+
14
+ <?php
15
+ ahcfree_include_scripts();
16
+ ?>
17
+
18
+ <div class="ahc_main_container">
19
+
20
+ <div style="width:97%; margin-top:10px; margin-left:16px;" >
21
+ <?php echo ahcfree_rate_us('https://wordpress.org/support/view/plugin-reviews/visitors-traffic-real-time-statistics?rate=5#postform', '#191E23')?>
22
+ </div>
23
+ <h1><img src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics Free <a title="change settings" href="admin.php?page=ahc_hits_counter_settings"><img src="<?php echo plugins_url('/images/settings.jpg', AHCFREE_PLUGIN_MAIN_FILE) ?>" /></a></h1><br />
24
+ <div class="row">
25
+ <div class="col-md-6">
26
+ <h3>Premium WordPress Plugins !</h3>
27
+ <p>We are a team working part-time at wp-buy.com and dishing out absolute awesomeness in the form of WordPress plugins and themes</p>
28
+ </div>
29
+
30
+
31
+ </div>
32
+ <p style="margin-top:50px; "></p>
33
+
34
+ You can find more premium plguins <a href="https://www.wp-buy.com">here</a>
35
+
36
+ </div>
ahc_help.php CHANGED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
2
+
3
+ <!-- Latest compiled and minified JavaScript -->
4
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
5
+
6
+ <script language="javascript" type="text/javascript">
7
+ function imgFlagError(image){
8
+ image.onerror = "";
9
+ image.src = "<?php echo plugins_url('/images/flags/noFlag.png', AHCFREE_PLUGIN_MAIN_FILE) ?>";
10
+ return true;
11
+ }
12
+ </script>
13
+
14
+ <?php
15
+ ahcfree_include_scripts();
16
+
17
+
18
+
19
+ ?>
20
+
21
+ <div class="ahc_main_container">
22
+ <div style="width:97%; margin-top:10px; margin-left:16px;" >
23
+ <?php echo ahcfree_rate_us('https://wordpress.org/support/view/plugin-reviews/visitors-traffic-real-time-statistics?rate=5#postform', '#191E23')?>
24
+ </div>
25
+ <h1><img src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics Free <a title="change settings" href="admin.php?page=ahc_hits_counter_settings"><img src="<?php echo plugins_url('/images/settings.jpg', AHCFREE_PLUGIN_MAIN_FILE) ?>" /></a></h1><br />
26
+ <div class="row">
27
+ <div class="col-md-6">
28
+ <h3>Welcme to wp-buy.com !</h3>
29
+ <p>wp-buy is a software development company that provides IT solutions to successfully improving your business performance.<br> We are a team working at wp-buy.com and dishing out absolute awesomeness in the form of WordPress plugins and themes.<br>Our brains are plump with theme & plugin ideas.</p>
30
+ </div>
31
+
32
+ <div class="col-md-4">
33
+ <img style="float:right" height="150px" src="<?php echo plugins_url('/images/24_7.ico', AHCFREE_PLUGIN_MAIN_FILE) ?>" />
34
+ </div>
35
+ </div>
36
+
37
+
38
+ <p><h3>Frequently Asked Questions</h3></p>
39
+ <p><a href="https://wordpress.org/plugins/visitors-traffic-real-time-statistics/#faq" target="_blank">Click here to view our FAQ</a></p>
40
+
41
+
42
+ <p><h3>Have your own issue? Create A New Ticket</h3></p>
43
+ <p><a href="https://www.wp-buy.com/support-center/" target="_blank"><img title="create new ticket" border="0" src="<?php echo plugins_url('/images/newticket.png', AHCFREE_PLUGIN_MAIN_FILE) ?>" /></a></p>
44
+
45
+
46
+
47
+ </div>
48
+
ahc_settings.php CHANGED
@@ -1,5 +1,174 @@
1
- <?php
2
  i{
3
  }
4
- if (!empty($_POST['save'])) {
5
  if (ahcfree_savesettings()) {
6
- }
7
  <h1><img width="40px" src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics <a title="change settings" href="admin.php?page=ahc_hits_counter_settings"><img src="<?php echo plugins_url('/images/settings.jpg', AHCFREE_PLUGIN_MAIN_FILE) ?>" /></a></h1><br />
8
  <div class="panel">
9
  <h2 style="height:35px !important; font-size:13px !important">Settings</h2>
10
  <option value="<?php echo $value; ?>" <?php echo ( $value == $custom_timezone_offset ) ? 'selected' : ''; ?>><?php echo $value; ?></option>
11
  global $wp_roles;
12
  if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles();
13
  $available_roles_names = $wp_roles->get_names();//we get all roles names
14
  $available_roles_capable = array();
15
  foreach ($available_roles_names as $role_key => $role_name) { //we iterate all the names
16
  $role_object = get_role( $role_key );//we get the Role Object
17
  $array_of_capabilities = $role_object->capabilities;//we get the array of capabilities for this role
18
  // if($array_of_capabilities['update_plugins'] == 1 || $array_of_capabilities['manage_links'] == 1 || $array_of_capabilities['manage_sites'] == 1 ){ //we check if the upload_files capability is present, and if its present check if its 0 (FALSE in Php)
19
  $available_roles_capable[$role_key] = $role_name; //we populate the array of capable roles
20
  // }
21
  }
22
 
23
- </div>
24
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  i{
2
  }
 
3
  if (ahcfree_savesettings()) {
 
4
  <h1><img width="40px" src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics <a title="change settings" href="admin.php?page=ahc_hits_counter_settings"><img src="<?php echo plugins_url('/images/settings.jpg', AHCFREE_PLUGIN_MAIN_FILE) ?>" /></a></h1><br />
5
  <div class="panel">
6
  <h2 style="height:35px !important; font-size:13px !important">Settings</h2>
7
  <option value="<?php echo $value; ?>" <?php echo ( $value == $custom_timezone_offset ) ? 'selected' : ''; ?>><?php echo $value; ?></option>
8
  global $wp_roles;
9
  if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles();
10
  $available_roles_names = $wp_roles->get_names();//we get all roles names
11
  $available_roles_capable = array();
12
  foreach ($available_roles_names as $role_key => $role_name) { //we iterate all the names
13
  $role_object = get_role( $role_key );//we get the Role Object
14
  $array_of_capabilities = $role_object->capabilities;//we get the array of capabilities for this role
15
  // if($array_of_capabilities['update_plugins'] == 1 || $array_of_capabilities['manage_links'] == 1 || $array_of_capabilities['manage_sites'] == 1 ){ //we check if the upload_files capability is present, and if its present check if its 0 (FALSE in Php)
16
  $available_roles_capable[$role_key] = $role_name; //we populate the array of capable roles
17
  // }
18
  }
19
 
20
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
21
+ <!-- Latest compiled and minified JavaScript -->
22
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
23
+
24
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/slim-select/1.25.0/slimselect.min.js"></script>
25
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/slim-select/1.25.0/slimselect.min.css" rel="stylesheet"></link>
26
+
27
+ <?php
28
+ if(!current_user_can('manage_options'))
29
+ {
30
+ die('Sorry, you are not allowed to access this page.' );
31
+ return;
32
+ }
33
+ ?>
34
+ <script language="javascript" type="text/javascript">
35
+
36
+
37
+ function imgFlagError(image) {
38
+ image.onerror = "";
39
+ image.src = "<?php echo plugins_url('/images/flags/noFlag.png', AHCFREE_PLUGIN_MAIN_FILE) ?>";
40
+ return true;
41
+ }
42
+
43
+
44
+ </script>
45
+ <style type="text/css">
46
+ i{
47
+ color:#999
48
+ }
49
+ </style>
50
+ <?php
51
+ ahcfree_include_scripts();
52
+ $msg = '';
53
+ if (!empty($_POST['save'])) {
54
+ if (ahcfree_savesettings()) {
55
+ $msg =('<br /><b style="color:green; margin-left:30px; float:left">settings saved successfully</b><br /><b style=" margin-left:30px; float:left"><a href="admin.php?page=ahc_hits_counter_settings">back to settings</a> | <a href="admin.php?page=ahc_hits_counter_menu_free">back to dashboard</a></b>');
56
+ }
57
+ }
58
+ $ahcfree_get_save_settings = ahcfree_get_save_settings();
59
+ $hits_days = $ahcfree_get_save_settings[0]->set_hits_days;
60
+ $ajax_check = ($ahcfree_get_save_settings[0]->set_ajax_check * 1000);
61
+ $set_ips = $ahcfree_get_save_settings[0]->set_ips;
62
+
63
+ $delete_plugin_data = get_option('ahcfree_delete_plugin_data_on_uninstall');
64
+ $ahcfree_save_ips = get_option('ahcfree_save_ips_opn');
65
+ $ahcproUserRoles = get_option('ahcproUserRoles');
66
+ $ahcproRobots = get_option('ahcproRobots');
67
+ ?>
68
+ <div class="ahc_main_container" >
69
+ <h1><img width="40px" src="<?php echo plugins_url('/images/logo.png', AHCFREE_PLUGIN_MAIN_FILE) ?>">&nbsp;Visitor Traffic Real Time Statistics Free <a title="change settings" href="admin.php?page=ahc_hits_counter_settings"><img src="<?php echo plugins_url('/images/settings.jpg', AHCFREE_PLUGIN_MAIN_FILE) ?>" /></a></h1><br />
70
+ <div class="panel">
71
+ <h2 class="box-heading">Settings</h2>
72
+ <div class="panelcontent">
73
+ <form method="post" enctype="multipart/form-data" name="myform">
74
+
75
+ <div class="row">
76
+ <div class="form-group col-md-6">
77
+
78
+ <label for="exampleInput">show hits in last</label>
79
+ <input type="text" value="<?php echo $hits_days ?>" class="form-control" id="set_hits_days" name="set_hits_days" placeholder="Enter number of days">
80
+ <small id="Help" class="form-text text-muted">this will affect the chart in the statistics page. default: 14 day</small>
81
+ </div>
82
+
83
+ <div class="form-group col-md-2">
84
+ <label for="exampleFormControlSelect1">Select Timezone</label>
85
+ <select class="form-control" id="set_custom_timezone" name="set_custom_timezone">
86
+
87
+ <?php
88
+ $custom_timezone_offset = get_option('ahcfree_custom_timezone');
89
+ $timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
90
+ foreach ($timezones as $key => $value) {
91
+ ?>
92
+ <option value="<?php echo $value; ?>" <?php echo ( $value == $custom_timezone_offset ) ? 'selected' : ''; ?>><?php echo $value; ?></option>
93
+ <?php
94
+ }
95
+ ?>
96
+ </select>
97
+ </div>
98
+ <div class="form-group col-md-4">
99
+ <br><span style="color:red; font-size:13px; ">Please select the same timezone in your</span> <a style="font-size:13px; " href="options-general.php" target="_blank">general settings page</a>
100
+ </div>
101
+
102
+ </div>
103
+
104
+
105
+
106
+ <div class="row">
107
+
108
+
109
+ <div class="form-group col-md-6">
110
+
111
+ <label for="exampleInput">check for online users every</label>
112
+ <input type="text" value="<?php echo ($ajax_check / 1000) ?>" class="form-control" id="set_ajax_check" name="set_ajax_check" placeholder="Enter number of days">
113
+ <small id="Help" class="form-text text-muted">Enter total seconds. default: 10 seconds</small>
114
+
115
+ </div>
116
+ <div class="form-group col-md-6">
117
+ <label for="exampleInput">IP's to exclude</label>
118
+ <textarea placeholder='192.168.0.1' name="set_ips" id="set_ips" rows="3" class="form-control" ><?php echo $set_ips ?></textarea>
119
+ <small id="Help" class="form-text text-muted">Excluded IPs will not be tracked by your counter, enter IP per line</small>
120
+ </div>
121
+
122
+ </div>
123
+
124
+ <div class="row">
125
+ <div class="form-group col-md-6">
126
+ <label for='exampleInput'>Plugin Accessibility</label><br>
127
+ <?php
128
+ $html = '';
129
+
130
+ global $wp_roles;
131
+ if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles();
132
+ $capabilites = array();
133
+ $available_roles_names = $wp_roles->get_names();//we get all roles names
134
+ $available_roles_capable = array();
135
+ foreach ($available_roles_names as $role_key => $role_name) { //we iterate all the names
136
+ $role_object = get_role( $role_key );//we get the Role Object
137
+ $array_of_capabilities = $role_object->capabilities;//we get the array of capabilities for this role
138
+
139
+ $available_roles_capable[$role_key] = $role_name; //we populate the array of capable roles
140
+
141
+ }
142
+
143
+ $html .= '';
144
+ $UserRoles = get_option('ahcproUserRoles');
145
+
146
+ $UserRoles_arr = explode(',',$UserRoles);
147
+ $html .="<select id='ahcproUserRoles' name='ahcproUserRoles[]' multiple='true' style='width:50%;'>";
148
+ foreach($available_roles_capable as $role)
149
+ {
150
+ $translated_role_name = $role;
151
+ if(in_array($translated_role_name, $UserRoles_arr) or $translated_role_name == 'Administrator' or $translated_role_name == 'Super Admin')
152
+ {
153
+ $selected_value = 'selected=selected';
154
+ }else{
155
+ $selected_value = '';
156
+ }
157
+ $html .="<option ".$selected_value." value='".$translated_role_name."'>".$translated_role_name."</option>";
158
+ }
159
+
160
+ $html .='</select>';
161
+
162
+
163
+ echo $html;
164
+ ?>
165
+
166
+ <script language="javascript" type="text/javascript">
167
+ new SlimSelect({
168
+ select: '#ahcproUserRoles'
169
+ })
170
+
171
+ </script>
172
+ </div></div>
173
+
174
+
175
+ <div class="row">
176
+ <div class="form-group col-md-6">
177
+ <label for="exampleInput">Stats Data</label>
178
+ <p> <label style="color:red"><input type="checkbox" value="1" name="delete_plugin_data" <?php echo ($delete_plugin_data == 1) ? 'checked=checked' : ''; ?> > If checked, all the stats will be deleted on deleting plugin. </label></p>
179
+ <br />
180
+ </div>
181
+
182
+
183
+ </div>
184
+ </div>
185
+ </div>
186
+ <input type="submit" name="save" value="save settings" style="font-size:15px" />
187
+ <input type="button" name="cancel" value="back to dashboard" onclick="javascript:window.location.href = 'admin.php?page=ahc_hits_counter_menu_free'" style="font-size:15px" />
188
+ </div>
189
+ <?php
190
+ echo $msg;
191
+ ?>
192
+ </form>
193
+
ajaxpages/getUsersOnline.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php ob_start(); session_start();
2
+ header ('Content-Type: text/html; charset=utf-8');
3
+ header("Cache-Control: no-cache, must-revalidate");
4
+
5
+ require_once('../../../../wp-load.php');
6
+ $ahcfree_countOnlineusers = ahcfree_countOnlineusers();
7
+ if(strlen($ahcfree_countOnlineusers) > 10)
8
+ {
9
+ echo 'x';
10
+ }else{
11
+ echo $ahcfree_countOnlineusers;
12
+ }
13
+ ?>
css/ar_stylesheet.css ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ html {height: 100%}
3
+ body {height: 100%; margin:0; padding:0; overflow-x:hidden; font: 10px verdana;}
4
+
5
+ .ahc_main_container{
6
+ direction: rtl; /* ## */
7
+ padding: 60px 20px;
8
+ }
9
+ .rightPanelsContainer{float: right; /* ## */ margin: 0; padding: 0;}
10
+ .leftPanelsContainer{float: left; /* ## */ margin: 0; padding: 0;}
11
+ .cleaner{clear: both;}
12
+ .panel, .panelcollapsed{
13
+ background: #eee;
14
+ margin: 10px 0px;
15
+ padding: 0px 0px 5px;
16
+ -moz-border-radius: 4px;
17
+ -webkit-border-radius: 4px;
18
+ }
19
+ .panel h2, .panelcollapsed h2{
20
+ font-size: 18px;
21
+ font-weight: normal;
22
+ margin: 0px;
23
+ padding: 4px;
24
+ background: #FFF url(../images/arrow_up.png) no-repeat 1% 50%; /* ## */
25
+ border-bottom: 1px solid #CCC;
26
+ -moz-border-radius: 3px;
27
+ -webkit-border-radius: 3px;
28
+ border-top: 1px solid #FFF;
29
+ border-right: 1px solid #FFF;
30
+ border-left: 1px solid #FFF;
31
+ }
32
+ .panelcollapsed h2{
33
+ background: #FFF url(../images/arrow_down.png) no-repeat 1% 50%; /* ## */
34
+ border-color: #CCC;
35
+ }
36
+ .panelcontent{
37
+ padding: 10px;
38
+ background: #FFF;
39
+ }
40
+ .panelcollapsed .panelcontent {display: none;}
41
+ .panelcontent td, .panelcontent th{font-size: 14px; font-weight: 0; padding: 5px;}
42
+ .panelcontent td.values{text-align: center; color: #395A7C; font-size: 14px;}
43
+
44
+ .fineFont{font-size: 12px !important}
45
+
46
+ .lastVisitorsDetails{border-bottom: solid 1px #dad6ca; direction: ltr; padding: 5px;}
47
+ .lastVisitorsDetails span{margin-right: 3px;}
48
+ .lastVisitorsDetails img{vertical-align: middle;}
49
+ .ipAddress{float: left; font-size: 14px; color: #3B9EF9; margin-bottom: 10px; margin-bottom: 10px;}
50
+ .referingSite{color: #3B9EF9; margin-left: 5px; font-size: 12px;}
51
+ .visitDateTime{float: right; color: #3B9EF9; font-size: 12px;}
52
+
53
+ .lastSearchKeyWords, .visitorMarker{border-bottom: solid 1px #dad6ca; direction: ltr; padding: 5px;}
54
+ .lastSearchKeyWords span, .countryMarker span{margin-right: 3px;}
55
+ .lastSearchKeyWords img{vertical-align: middle;}
56
+ .countryMarker{direction: ltr; padding: 5px;}
57
+ .searchKeyWords{font-size: 14px;}
58
+
59
+ .languageChanger{direction: ltr; /* ## */ font-size: 18px;}
60
+
61
+ .countryMarker span.countryName, .visitorMarker span.ipAddress{margin-left: 5px;}
62
+
63
+ .visitorMarker{border-bottom: dashed 1px #dad6ca;}
64
+ .countryMarker span.countryName{font-size: 12px;}
65
+ .countryMarker img{vertical-align: middle;}
66
+ .visitorMarker span.ipAddress{font-size: 12px;}
67
+ .visitorMarker span{float: left;}
68
+
69
+ /* visitors graph begin */
70
+ div.visitorsGraphContainer{float: right; width: 70%} /* ### */
71
+ div.visitorsGraphContainer div.visitorsGraph{float: right; background-color: #82CE69; border-radius: 2px;}
72
+ div.visitorsPercent{float: right; width: 25%; margin-right: 5px;} /* ### */
73
+ /* visitors graph end */
css/{style-review.css → css-review.css} RENAMED
File without changes
css/datepicker.css ADDED
@@ -0,0 +1,1311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.12.1 - 2016-09-14
2
+ * http://jqueryui.com
3
+ * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&fwDefault=normal&cornerRadius=3px&bgColorHeader=e9e9e9&bgTextureHeader=flat&borderColorHeader=dddddd&fcHeader=333333&iconColorHeader=444444&bgColorContent=ffffff&bgTextureContent=flat&borderColorContent=dddddd&fcContent=333333&iconColorContent=444444&bgColorDefault=f6f6f6&bgTextureDefault=flat&borderColorDefault=c5c5c5&fcDefault=454545&iconColorDefault=777777&bgColorHover=ededed&bgTextureHover=flat&borderColorHover=cccccc&fcHover=2b2b2b&iconColorHover=555555&bgColorActive=007fff&bgTextureActive=flat&borderColorActive=003eff&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=fffa90&bgTextureHighlight=flat&borderColorHighlight=dad55e&fcHighlight=777620&iconColorHighlight=777620&bgColorError=fddfdf&bgTextureError=flat&borderColorError=f1a899&fcError=5f3f3f&iconColorError=cc0000&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=666666&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=5px&offsetTopShadow=0px&offsetLeftShadow=0px&cornerRadiusShadow=8px
5
+ * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden {
10
+ display: none;
11
+ }
12
+ .ui-helper-hidden-accessible {
13
+ border: 0;
14
+ clip: rect(0 0 0 0);
15
+ height: 1px;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ padding: 0;
19
+ position: absolute;
20
+ width: 1px;
21
+ }
22
+ .ui-helper-reset {
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0;
26
+ outline: 0;
27
+ line-height: 1.3;
28
+ text-decoration: none;
29
+ font-size: 100%;
30
+ list-style: none;
31
+ }
32
+ .ui-helper-clearfix:before,
33
+ .ui-helper-clearfix:after {
34
+ content: "";
35
+ display: table;
36
+ border-collapse: collapse;
37
+ }
38
+ .ui-helper-clearfix:after {
39
+ clear: both;
40
+ }
41
+ .ui-helper-zfix {
42
+ width: 100%;
43
+ height: 100%;
44
+ top: 0;
45
+ left: 0;
46
+ position: absolute;
47
+ opacity: 0;
48
+ filter:Alpha(Opacity=0); /* support: IE8 */
49
+ }
50
+
51
+ .ui-front {
52
+ z-index: 100;
53
+ }
54
+
55
+
56
+ /* Interaction Cues
57
+ ----------------------------------*/
58
+ .ui-state-disabled {
59
+ cursor: default !important;
60
+ pointer-events: none;
61
+ }
62
+
63
+
64
+ /* Icons
65
+ ----------------------------------*/
66
+ .ui-icon {
67
+ display: inline-block;
68
+ vertical-align: middle;
69
+ margin-top: -.25em;
70
+ position: relative;
71
+ text-indent: -99999px;
72
+ overflow: hidden;
73
+ background-repeat: no-repeat;
74
+ }
75
+
76
+ .ui-widget-icon-block {
77
+ left: 50%;
78
+ margin-left: -8px;
79
+ display: block;
80
+ }
81
+
82
+ /* Misc visuals
83
+ ----------------------------------*/
84
+
85
+ /* Overlays */
86
+ .ui-widget-overlay {
87
+ position: fixed;
88
+ top: 0;
89
+ left: 0;
90
+ width: 100%;
91
+ height: 100%;
92
+ }
93
+ .ui-accordion .ui-accordion-header {
94
+ display: block;
95
+ cursor: pointer;
96
+ position: relative;
97
+ margin: 2px 0 0 0;
98
+ padding: .5em .5em .5em .7em;
99
+ font-size: 100%;
100
+ }
101
+ .ui-accordion .ui-accordion-content {
102
+ padding: 1em 2.2em;
103
+ border-top: 0;
104
+ overflow: auto;
105
+ }
106
+ .ui-autocomplete {
107
+ position: absolute;
108
+ top: 0;
109
+ left: 0;
110
+ cursor: default;
111
+ }
112
+ .ui-menu {
113
+ list-style: none;
114
+ padding: 0;
115
+ margin: 0;
116
+ display: block;
117
+ outline: 0;
118
+ }
119
+ .ui-menu .ui-menu {
120
+ position: absolute;
121
+ }
122
+ .ui-menu .ui-menu-item {
123
+ margin: 0;
124
+ cursor: pointer;
125
+ /* support: IE10, see #8844 */
126
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
127
+ }
128
+ .ui-menu .ui-menu-item-wrapper {
129
+ position: relative;
130
+ padding: 3px 1em 3px .4em;
131
+ }
132
+ .ui-menu .ui-menu-divider {
133
+ margin: 5px 0;
134
+ height: 0;
135
+ font-size: 0;
136
+ line-height: 0;
137
+ border-width: 1px 0 0 0;
138
+ }
139
+ .ui-menu .ui-state-focus,
140
+ .ui-menu .ui-state-active {
141
+ margin: -1px;
142
+ }
143
+
144
+ /* icon support */
145
+ .ui-menu-icons {
146
+ position: relative;
147
+ }
148
+ .ui-menu-icons .ui-menu-item-wrapper {
149
+ padding-left: 2em;
150
+ }
151
+
152
+ /* left-aligned */
153
+ .ui-menu .ui-icon {
154
+ position: absolute;
155
+ top: 0;
156
+ bottom: 0;
157
+ left: .2em;
158
+ margin: auto 0;
159
+ }
160
+
161
+ /* right-aligned */
162
+ .ui-menu .ui-menu-icon {
163
+ left: auto;
164
+ right: 0;
165
+ }
166
+ .ui-button {
167
+ padding: .4em 1em;
168
+ display: inline-block;
169
+ position: relative;
170
+ line-height: normal;
171
+ margin-right: .1em;
172
+ cursor: pointer;
173
+ vertical-align: middle;
174
+ text-align: center;
175
+ -webkit-user-select: none;
176
+ -moz-user-select: none;
177
+ -ms-user-select: none;
178
+ user-select: none;
179
+
180
+ /* Support: IE <= 11 */
181
+ overflow: visible;
182
+ }
183
+
184
+ .ui-button,
185
+ .ui-button:link,
186
+ .ui-button:visited,
187
+ .ui-button:hover,
188
+ .ui-button:active {
189
+ text-decoration: none;
190
+ }
191
+
192
+ /* to make room for the icon, a width needs to be set here */
193
+ .ui-button-icon-only {
194
+ width: 2em;
195
+ box-sizing: border-box;
196
+ text-indent: -9999px;
197
+ white-space: nowrap;
198
+ }
199
+
200
+ /* no icon support for input elements */
201
+ input.ui-button.ui-button-icon-only {
202
+ text-indent: 0;
203
+ }
204
+
205
+ /* button icon element(s) */
206
+ .ui-button-icon-only .ui-icon {
207
+ position: absolute;
208
+ top: 50%;
209
+ left: 50%;
210
+ margin-top: -8px;
211
+ margin-left: -8px;
212
+ }
213
+
214
+ .ui-button.ui-icon-notext .ui-icon {
215
+ padding: 0;
216
+ width: 2.1em;
217
+ height: 2.1em;
218
+ text-indent: -9999px;
219
+ white-space: nowrap;
220
+
221
+ }
222
+
223
+ input.ui-button.ui-icon-notext .ui-icon {
224
+ width: auto;
225
+ height: auto;
226
+ text-indent: 0;
227
+ white-space: normal;
228
+ padding: .4em 1em;
229
+ }
230
+
231
+ /* workarounds */
232
+ /* Support: Firefox 5 - 40 */
233
+ input.ui-button::-moz-focus-inner,
234
+ button.ui-button::-moz-focus-inner {
235
+ border: 0;
236
+ padding: 0;
237
+ }
238
+ .ui-controlgroup {
239
+ vertical-align: middle;
240
+ display: inline-block;
241
+ }
242
+ .ui-controlgroup > .ui-controlgroup-item {
243
+ float: left;
244
+ margin-left: 0;
245
+ margin-right: 0;
246
+ }
247
+ .ui-controlgroup > .ui-controlgroup-item:focus,
248
+ .ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
249
+ z-index: 9999;
250
+ }
251
+ .ui-controlgroup-vertical > .ui-controlgroup-item {
252
+ display: block;
253
+ float: none;
254
+ width: 100%;
255
+ margin-top: 0;
256
+ margin-bottom: 0;
257
+ text-align: left;
258
+ }
259
+ .ui-controlgroup-vertical .ui-controlgroup-item {
260
+ box-sizing: border-box;
261
+ }
262
+ .ui-controlgroup .ui-controlgroup-label {
263
+ padding: .4em 1em;
264
+ }
265
+ .ui-controlgroup .ui-controlgroup-label span {
266
+ font-size: 80%;
267
+ }
268
+ .ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
269
+ border-left: none;
270
+ }
271
+ .ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
272
+ border-top: none;
273
+ }
274
+ .ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
275
+ border-right: none;
276
+ }
277
+ .ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
278
+ border-bottom: none;
279
+ }
280
+
281
+ /* Spinner specific style fixes */
282
+ .ui-controlgroup-vertical .ui-spinner-input {
283
+
284
+ /* Support: IE8 only, Android < 4.4 only */
285
+ width: 75%;
286
+ width: calc( 100% - 2.4em );
287
+ }
288
+ .ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
289
+ border-top-style: solid;
290
+ }
291
+
292
+ .ui-checkboxradio-label .ui-icon-background {
293
+ box-shadow: inset 1px 1px 1px #ccc;
294
+ border-radius: .12em;
295
+ border: none;
296
+ }
297
+ .ui-checkboxradio-radio-label .ui-icon-background {
298
+ width: 16px;
299
+ height: 16px;
300
+ border-radius: 1em;
301
+ overflow: visible;
302
+ border: none;
303
+ }
304
+ .ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
305
+ .ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
306
+ background-image: none;
307
+ width: 8px;
308
+ height: 8px;
309
+ border-width: 4px;
310
+ border-style: solid;
311
+ }
312
+ .ui-checkboxradio-disabled {
313
+ pointer-events: none;
314
+ }
315
+ .ui-datepicker {
316
+ width: 17em;
317
+ padding: .2em .2em 0;
318
+ display: none;
319
+ }
320
+ .ui-datepicker .ui-datepicker-header {
321
+ position: relative;
322
+ padding: .2em 0;
323
+ }
324
+ .ui-datepicker .ui-datepicker-prev,
325
+ .ui-datepicker .ui-datepicker-next {
326
+ position: absolute;
327
+ top: 2px;
328
+ width: 1.8em;
329
+ height: 1.8em;
330
+ }
331
+ .ui-datepicker .ui-datepicker-prev-hover,
332
+ .ui-datepicker .ui-datepicker-next-hover {
333
+ top: 1px;
334
+ }
335
+ .ui-datepicker .ui-datepicker-prev {
336
+ left: 2px;
337
+ }
338
+ .ui-datepicker .ui-datepicker-next {
339
+ right: 2px;
340
+ }
341
+ .ui-datepicker .ui-datepicker-prev-hover {
342
+ left: 1px;
343
+ }
344
+ .ui-datepicker .ui-datepicker-next-hover {
345
+ right: 1px;
346
+ }
347
+ .ui-datepicker .ui-datepicker-prev span,
348
+ .ui-datepicker .ui-datepicker-next span {
349
+ display: block;
350
+ position: absolute;
351
+ left: 50%;
352
+ margin-left: -8px;
353
+ top: 50%;
354
+ margin-top: -8px;
355
+ }
356
+ .ui-datepicker .ui-datepicker-title {
357
+ margin: 0 2.3em;
358
+ line-height: 1.8em;
359
+ text-align: center;
360
+ }
361
+ .ui-datepicker .ui-datepicker-title select {
362
+ font-size: 1em;
363
+ margin: 1px 0;
364
+ }
365
+ .ui-datepicker select.ui-datepicker-month,
366
+ .ui-datepicker select.ui-datepicker-year {
367
+ width: 45%;
368
+ }
369
+ .ui-datepicker table {
370
+ width: 100%;
371
+ font-size: .9em;
372
+ border-collapse: collapse;
373
+ margin: 0 0 .4em;
374
+ }
375
+ .ui-datepicker th {
376
+ padding: .7em .3em;
377
+ text-align: center;
378
+ font-weight: bold;
379
+ border: 0;
380
+ }
381
+ .ui-datepicker td {
382
+ border: 0;
383
+ padding: 1px;
384
+ }
385
+ .ui-datepicker td span,
386
+ .ui-datepicker td a {
387
+ display: block;
388
+ padding: .2em;
389
+ text-align: right;
390
+ text-decoration: none;
391
+ }
392
+ .ui-datepicker .ui-datepicker-buttonpane {
393
+ background-image: none;
394
+ margin: .7em 0 0 0;
395
+ padding: 0 .2em;
396
+ border-left: 0;
397
+ border-right: 0;
398
+ border-bottom: 0;
399
+ }
400
+ .ui-datepicker .ui-datepicker-buttonpane button {
401
+ float: right;
402
+ margin: .5em .2em .4em;
403
+ cursor: pointer;
404
+ padding: .2em .6em .3em .6em;
405
+ width: auto;
406
+ overflow: visible;
407
+ }
408
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
409
+ float: left;
410
+ }
411
+
412
+ /* with multiple calendars */
413
+ .ui-datepicker.ui-datepicker-multi {
414
+ width: auto;
415
+ }
416
+ .ui-datepicker-multi .ui-datepicker-group {
417
+ float: left;
418
+ }
419
+ .ui-datepicker-multi .ui-datepicker-group table {
420
+ width: 95%;
421
+ margin: 0 auto .4em;
422
+ }
423
+ .ui-datepicker-multi-2 .ui-datepicker-group {
424
+ width: 50%;
425
+ }
426
+ .ui-datepicker-multi-3 .ui-datepicker-group {
427
+ width: 33.3%;
428
+ }
429
+ .ui-datepicker-multi-4 .ui-datepicker-group {
430
+ width: 25%;
431
+ }
432
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
433
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
434
+ border-left-width: 0;
435
+ }
436
+ .ui-datepicker-multi .ui-datepicker-buttonpane {
437
+ clear: left;
438
+ }
439
+ .ui-datepicker-row-break {
440
+ clear: both;
441
+ width: 100%;
442
+ font-size: 0;
443
+ }
444
+
445
+ /* RTL support */
446
+ .ui-datepicker-rtl {
447
+ direction: rtl;
448
+ }
449
+ .ui-datepicker-rtl .ui-datepicker-prev {
450
+ right: 2px;
451
+ left: auto;
452
+ }
453
+ .ui-datepicker-rtl .ui-datepicker-next {
454
+ left: 2px;
455
+ right: auto;
456
+ }
457
+ .ui-datepicker-rtl .ui-datepicker-prev:hover {
458
+ right: 1px;
459
+ left: auto;
460
+ }
461
+ .ui-datepicker-rtl .ui-datepicker-next:hover {
462
+ left: 1px;
463
+ right: auto;
464
+ }
465
+ .ui-datepicker-rtl .ui-datepicker-buttonpane {
466
+ clear: right;
467
+ }
468
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button {
469
+ float: left;
470
+ }
471
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
472
+ .ui-datepicker-rtl .ui-datepicker-group {
473
+ float: right;
474
+ }
475
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
476
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
477
+ border-right-width: 0;
478
+ border-left-width: 1px;
479
+ }
480
+
481
+ /* Icons */
482
+ .ui-datepicker .ui-icon {
483
+ display: block;
484
+ text-indent: -99999px;
485
+ overflow: hidden;
486
+ background-repeat: no-repeat;
487
+ left: .5em;
488
+ top: .3em;
489
+ }
490
+ .ui-dialog {
491
+ position: absolute;
492
+ top: 0;
493
+ left: 0;
494
+ padding: .2em;
495
+ outline: 0;
496
+ }
497
+ .ui-dialog .ui-dialog-titlebar {
498
+ padding: .4em 1em;
499
+ position: relative;
500
+ }
501
+ .ui-dialog .ui-dialog-title {
502
+ float: left;
503
+ margin: .1em 0;
504
+ white-space: nowrap;
505
+ width: 90%;
506
+ overflow: hidden;
507
+ text-overflow: ellipsis;
508
+ }
509
+ .ui-dialog .ui-dialog-titlebar-close {
510
+ position: absolute;
511
+ right: .3em;
512
+ top: 50%;
513
+ width: 20px;
514
+ margin: -10px 0 0 0;
515
+ padding: 1px;
516
+ height: 20px;
517
+ }
518
+ .ui-dialog .ui-dialog-content {
519
+ position: relative;
520
+ border: 0;
521
+ padding: .5em 1em;
522
+ background: none;
523
+ overflow: auto;
524
+ }
525
+ .ui-dialog .ui-dialog-buttonpane {
526
+ text-align: left;
527
+ border-width: 1px 0 0 0;
528
+ background-image: none;
529
+ margin-top: .5em;
530
+ padding: .3em 1em .5em .4em;
531
+ }
532
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
533
+ float: right;
534
+ }
535
+ .ui-dialog .ui-dialog-buttonpane button {
536
+ margin: .5em .4em .5em 0;
537
+ cursor: pointer;
538
+ }
539
+ .ui-dialog .ui-resizable-n {
540
+ height: 2px;
541
+ top: 0;
542
+ }
543
+ .ui-dialog .ui-resizable-e {
544
+ width: 2px;
545
+ right: 0;
546
+ }
547
+ .ui-dialog .ui-resizable-s {
548
+ height: 2px;
549
+ bottom: 0;
550
+ }
551
+ .ui-dialog .ui-resizable-w {
552
+ width: 2px;
553
+ left: 0;
554
+ }
555
+ .ui-dialog .ui-resizable-se,
556
+ .ui-dialog .ui-resizable-sw,
557
+ .ui-dialog .ui-resizable-ne,
558
+ .ui-dialog .ui-resizable-nw {
559
+ width: 7px;
560
+ height: 7px;
561
+ }
562
+ .ui-dialog .ui-resizable-se {
563
+ right: 0;
564
+ bottom: 0;
565
+ }
566
+ .ui-dialog .ui-resizable-sw {
567
+ left: 0;
568
+ bottom: 0;
569
+ }
570
+ .ui-dialog .ui-resizable-ne {
571
+ right: 0;
572
+ top: 0;
573
+ }
574
+ .ui-dialog .ui-resizable-nw {
575
+ left: 0;
576
+ top: 0;
577
+ }
578
+ .ui-draggable .ui-dialog-titlebar {
579
+ cursor: move;
580
+ }
581
+ .ui-draggable-handle {
582
+ -ms-touch-action: none;
583
+ touch-action: none;
584
+ }
585
+ .ui-resizable {
586
+ position: relative;
587
+ }
588
+ .ui-resizable-handle {
589
+ position: absolute;
590
+ font-size: 0.1px;
591
+ display: block;
592
+ -ms-touch-action: none;
593
+ touch-action: none;
594
+ }
595
+ .ui-resizable-disabled .ui-resizable-handle,
596
+ .ui-resizable-autohide .ui-resizable-handle {
597
+ display: none;
598
+ }
599
+ .ui-resizable-n {
600
+ cursor: n-resize;
601
+ height: 7px;
602
+ width: 100%;
603
+ top: -5px;
604
+ left: 0;
605
+ }
606
+ .ui-resizable-s {
607
+ cursor: s-resize;
608
+ height: 7px;
609
+ width: 100%;
610
+ bottom: -5px;
611
+ left: 0;
612
+ }
613
+ .ui-resizable-e {
614
+ cursor: e-resize;
615
+ width: 7px;
616
+ right: -5px;
617
+ top: 0;
618
+ height: 100%;
619
+ }
620
+ .ui-resizable-w {
621
+ cursor: w-resize;
622
+ width: 7px;
623
+ left: -5px;
624
+ top: 0;
625
+ height: 100%;
626
+ }
627
+ .ui-resizable-se {
628
+ cursor: se-resize;
629
+ width: 12px;
630
+ height: 12px;
631
+ right: 1px;
632
+ bottom: 1px;
633
+ }
634
+ .ui-resizable-sw {
635
+ cursor: sw-resize;
636
+ width: 9px;
637
+ height: 9px;
638
+ left: -5px;
639
+ bottom: -5px;
640
+ }
641
+ .ui-resizable-nw {
642
+ cursor: nw-resize;
643
+ width: 9px;
644
+ height: 9px;
645
+ left: -5px;
646
+ top: -5px;
647
+ }
648
+ .ui-resizable-ne {
649
+ cursor: ne-resize;
650
+ width: 9px;
651
+ height: 9px;
652
+ right: -5px;
653
+ top: -5px;
654
+ }
655
+ .ui-progressbar {
656
+ height: 2em;
657
+ text-align: left;
658
+ overflow: hidden;
659
+ }
660
+ .ui-progressbar .ui-progressbar-value {
661
+ margin: -1px;
662
+ height: 100%;
663
+ }
664
+ .ui-progressbar .ui-progressbar-overlay {
665
+ background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
666
+ height: 100%;
667
+ filter: alpha(opacity=25); /* support: IE8 */
668
+ opacity: 0.25;
669
+ }
670
+ .ui-progressbar-indeterminate .ui-progressbar-value {
671
+ background-image: none;
672
+ }
673
+ .ui-selectable {
674
+ -ms-touch-action: none;
675
+ touch-action: none;
676
+ }
677
+ .ui-selectable-helper {
678
+ position: absolute;
679
+ z-index: 100;
680
+ border: 1px dotted black;
681
+ }
682
+ .ui-selectmenu-menu {
683
+ padding: 0;
684
+ margin: 0;
685
+ position: absolute;
686
+ top: 0;
687
+ left: 0;
688
+ display: none;
689
+ }
690
+ .ui-selectmenu-menu .ui-menu {
691
+ overflow: auto;
692
+ overflow-x: hidden;
693
+ padding-bottom: 1px;
694
+ }
695
+ .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
696
+ font-size: 1em;
697
+ font-weight: bold;
698
+ line-height: 1.5;
699
+ padding: 2px 0.4em;
700
+ margin: 0.5em 0 0 0;
701
+ height: auto;
702
+ border: 0;
703
+ }
704
+ .ui-selectmenu-open {
705
+ display: block;
706
+ }
707
+ .ui-selectmenu-text {
708
+ display: block;
709
+ margin-right: 20px;
710
+ overflow: hidden;
711
+ text-overflow: ellipsis;
712
+ }
713
+ .ui-selectmenu-button.ui-button {
714
+ text-align: left;
715
+ white-space: nowrap;
716
+ width: 14em;
717
+ }
718
+ .ui-selectmenu-icon.ui-icon {
719
+ float: right;
720
+ margin-top: 0;
721
+ }
722
+ .ui-slider {
723
+ position: relative;
724
+ text-align: left;
725
+ }
726
+ .ui-slider .ui-slider-handle {
727
+ position: absolute;
728
+ z-index: 2;
729
+ width: 1.2em;
730
+ height: 1.2em;
731
+ cursor: default;
732
+ -ms-touch-action: none;
733
+ touch-action: none;
734
+ }
735
+ .ui-slider .ui-slider-range {
736
+ position: absolute;
737
+ z-index: 1;
738
+ font-size: .7em;
739
+ display: block;
740
+ border: 0;
741
+ background-position: 0 0;
742
+ }
743
+
744
+ /* support: IE8 - See #6727 */
745
+ .ui-slider.ui-state-disabled .ui-slider-handle,
746
+ .ui-slider.ui-state-disabled .ui-slider-range {
747
+ filter: inherit;
748
+ }
749
+
750
+ .ui-slider-horizontal {
751
+ height: .8em;
752
+ }
753
+ .ui-slider-horizontal .ui-slider-handle {
754
+ top: -.3em;
755
+ margin-left: -.6em;
756
+ }
757
+ .ui-slider-horizontal .ui-slider-range {
758
+ top: 0;
759
+ height: 100%;
760
+ }
761
+ .ui-slider-horizontal .ui-slider-range-min {
762
+ left: 0;
763
+ }
764
+ .ui-slider-horizontal .ui-slider-range-max {
765
+ right: 0;
766
+ }
767
+
768
+ .ui-slider-vertical {
769
+ width: .8em;
770
+ height: 100px;
771
+ }
772
+ .ui-slider-vertical .ui-slider-handle {
773
+ left: -.3em;
774
+ margin-left: 0;
775
+ margin-bottom: -.6em;
776
+ }
777
+ .ui-slider-vertical .ui-slider-range {
778
+ left: 0;
779
+ width: 100%;
780
+ }
781
+ .ui-slider-vertical .ui-slider-range-min {
782
+ bottom: 0;
783
+ }
784
+ .ui-slider-vertical .ui-slider-range-max {
785
+ top: 0;
786
+ }
787
+ .ui-sortable-handle {
788
+ -ms-touch-action: none;
789
+ touch-action: none;
790
+ }
791
+ .ui-spinner {
792
+ position: relative;
793
+ display: inline-block;
794
+ overflow: hidden;
795
+ padding: 0;
796
+ vertical-align: middle;
797
+ }
798
+ .ui-spinner-input {
799
+ border: none;
800
+ background: none;
801
+ color: inherit;
802
+ padding: .222em 0;
803
+ margin: .2em 0;
804
+ vertical-align: middle;
805
+ margin-left: .4em;
806
+ margin-right: 2em;
807
+ }
808
+ .ui-spinner-button {
809
+ width: 1.6em;
810
+ height: 50%;
811
+ font-size: .5em;
812
+ padding: 0;
813
+ margin: 0;
814
+ text-align: center;
815
+ position: absolute;
816
+ cursor: default;
817
+ display: block;
818
+ overflow: hidden;
819
+ right: 0;
820
+ }
821
+ /* more specificity required here to override default borders */
822
+ .ui-spinner a.ui-spinner-button {
823
+ border-top-style: none;
824
+ border-bottom-style: none;
825
+ border-right-style: none;
826
+ }
827
+ .ui-spinner-up {
828
+ top: 0;
829
+ }
830
+ .ui-spinner-down {
831
+ bottom: 0;
832
+ }
833
+ .ui-tabs {
834
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
835
+ padding: .2em;
836
+ }
837
+ .ui-tabs .ui-tabs-nav {
838
+ margin: 0;
839
+ padding: .2em .2em 0;
840
+ }
841
+ .ui-tabs .ui-tabs-nav li {
842
+ list-style: none;
843
+ float: left;
844
+ position: relative;
845
+ top: 0;
846
+ margin: 1px .2em 0 0;
847
+ border-bottom-width: 0;
848
+ padding: 0;
849
+ white-space: nowrap;
850
+ }
851
+ .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
852
+ float: left;
853
+ padding: .5em 1em;
854
+ text-decoration: none;
855
+ }
856
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active {
857
+ margin-bottom: -1px;
858
+ padding-bottom: 1px;
859
+ }
860
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
861
+ .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
862
+ .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
863
+ cursor: text;
864
+ }
865
+ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
866
+ cursor: pointer;
867
+ }
868
+ .ui-tabs .ui-tabs-panel {
869
+ display: block;
870
+ border-width: 0;
871
+ padding: 1em 1.4em;
872
+ background: none;
873
+ }
874
+ .ui-tooltip {
875
+ padding: 8px;
876
+ position: absolute;
877
+ z-index: 9999;
878
+ max-width: 300px;
879
+ }
880
+ body .ui-tooltip {
881
+ border-width: 2px;
882
+ }
883
+ /* Component containers
884
+ ----------------------------------*/
885
+ .ui-widget {
886
+ font-family: Arial,Helvetica,sans-serif;
887
+ font-size: 1em;
888
+ }
889
+ .ui-widget .ui-widget {
890
+ font-size: 1em;
891
+ }
892
+ .ui-widget input,
893
+ .ui-widget select,
894
+ .ui-widget textarea,
895
+ .ui-widget button {
896
+ font-family: Arial,Helvetica,sans-serif;
897
+ font-size: 1em;
898
+ }
899
+ .ui-widget.ui-widget-content {
900
+ border: 1px solid #c5c5c5;
901
+ }
902
+ .ui-widget-content {
903
+ border: 1px solid #dddddd;
904
+ background: #ffffff;
905
+ color: #333333;
906
+ }
907
+ .ui-widget-content a {
908
+ color: #333333;
909
+ }
910
+ .ui-widget-header {
911
+ border: 1px solid #dddddd;
912
+ background: #e9e9e9;
913
+ color: #333333;
914
+ font-weight: bold;
915
+ }
916
+ .ui-widget-header a {
917
+ color: #333333;
918
+ }
919
+
920
+ /* Interaction states
921
+ ----------------------------------*/
922
+ .ui-state-default,
923
+ .ui-widget-content .ui-state-default,
924
+ .ui-widget-header .ui-state-default,
925
+ .ui-button,
926
+
927
+ /* We use html here because we need a greater specificity to make sure disabled
928
+ works properly when clicked or hovered */
929
+ html .ui-button.ui-state-disabled:hover,
930
+ html .ui-button.ui-state-disabled:active {
931
+ border: 1px solid #c5c5c5;
932
+ background: #f6f6f6;
933
+ font-weight: normal;
934
+ color: #454545;
935
+ }
936
+ .ui-state-default a,
937
+ .ui-state-default a:link,
938
+ .ui-state-default a:visited,
939
+ a.ui-button,
940
+ a:link.ui-button,
941
+ a:visited.ui-button,
942
+ .ui-button {
943
+ color: #454545;
944
+ text-decoration: none;
945
+ }
946
+ .ui-state-hover,
947
+ .ui-widget-content .ui-state-hover,
948
+ .ui-widget-header .ui-state-hover,
949
+ .ui-state-focus,
950
+ .ui-widget-content .ui-state-focus,
951
+ .ui-widget-header .ui-state-focus,
952
+ .ui-button:hover,
953
+ .ui-button:focus {
954
+ border: 1px solid #cccccc;
955
+ background: #ededed;
956
+ font-weight: normal;
957
+ color: #2b2b2b;
958
+ }
959
+ .ui-state-hover a,
960
+ .ui-state-hover a:hover,
961
+ .ui-state-hover a:link,
962
+ .ui-state-hover a:visited,
963
+ .ui-state-focus a,
964
+ .ui-state-focus a:hover,
965
+ .ui-state-focus a:link,
966
+ .ui-state-focus a:visited,
967
+ a.ui-button:hover,
968
+ a.ui-button:focus {
969
+ color: #2b2b2b;
970
+ text-decoration: none;
971
+ }
972
+
973
+ .ui-visual-focus {
974
+ box-shadow: 0 0 3px 1px rgb(94, 158, 214);
975
+ }
976
+ .ui-state-active,
977
+ .ui-widget-content .ui-state-active,
978
+ .ui-widget-header .ui-state-active,
979
+ a.ui-button:active,
980
+ .ui-button:active,
981
+ .ui-button.ui-state-active:hover {
982
+ border: 1px solid #003eff;
983
+ background: #007fff;
984
+ font-weight: normal;
985
+ color: #ffffff;
986
+ }
987
+ .ui-icon-background,
988
+ .ui-state-active .ui-icon-background {
989
+ border: #003eff;
990
+ background-color: #ffffff;
991
+ }
992
+ .ui-state-active a,
993
+ .ui-state-active a:link,
994
+ .ui-state-active a:visited {
995
+ color: #ffffff;
996
+ text-decoration: none;
997
+ }
998
+
999
+ /* Interaction Cues
1000
+ ----------------------------------*/
1001
+ .ui-state-highlight,
1002
+ .ui-widget-content .ui-state-highlight,
1003
+ .ui-widget-header .ui-state-highlight {
1004
+ border: 1px solid #dad55e;
1005
+ background: #fffa90;
1006
+ color: #777620;
1007
+ }
1008
+ .ui-state-checked {
1009
+ border: 1px solid #dad55e;
1010
+ background: #fffa90;
1011
+ }
1012
+ .ui-state-highlight a,
1013
+ .ui-widget-content .ui-state-highlight a,
1014
+ .ui-widget-header .ui-state-highlight a {
1015
+ color: #777620;
1016
+ }
1017
+ .ui-state-error,
1018
+ .ui-widget-content .ui-state-error,
1019
+ .ui-widget-header .ui-state-error {
1020
+ border: 1px solid #f1a899;
1021
+ background: #fddfdf;
1022
+ color: #5f3f3f;
1023
+ }
1024
+ .ui-state-error a,
1025
+ .ui-widget-content .ui-state-error a,
1026
+ .ui-widget-header .ui-state-error a {
1027
+ color: #5f3f3f;
1028
+ }
1029
+ .ui-state-error-text,
1030
+ .ui-widget-content .ui-state-error-text,
1031
+ .ui-widget-header .ui-state-error-text {
1032
+ color: #5f3f3f;
1033
+ }
1034
+ .ui-priority-primary,
1035
+ .ui-widget-content .ui-priority-primary,
1036
+ .ui-widget-header .ui-priority-primary {
1037
+ font-weight: bold;
1038
+ }
1039
+ .ui-priority-secondary,
1040
+ .ui-widget-content .ui-priority-secondary,
1041
+ .ui-widget-header .ui-priority-secondary {
1042
+ opacity: .7;
1043
+ filter:Alpha(Opacity=70); /* support: IE8 */
1044
+ font-weight: normal;
1045
+ }
1046
+ .ui-state-disabled,
1047
+ .ui-widget-content .ui-state-disabled,
1048
+ .ui-widget-header .ui-state-disabled {
1049
+ opacity: .35;
1050
+ filter:Alpha(Opacity=35); /* support: IE8 */
1051
+ background-image: none;
1052
+ }
1053
+ .ui-state-disabled .ui-icon {
1054
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
1055
+ }
1056
+
1057
+ /* Icons
1058
+ ----------------------------------*/
1059
+
1060
+ /* states and images */
1061
+ .ui-icon {
1062
+ width: 16px;
1063
+ height: 16px;
1064
+ }
1065
+ .ui-icon,
1066
+ .ui-widget-content .ui-icon {
1067
+ background-image: url("../images/ui-icons_444444_256x240.png");
1068
+ }
1069
+ .ui-widget-header .ui-icon {
1070
+ background-image: url("../images/ui-icons_444444_256x240.png");
1071
+ }
1072
+ .ui-state-hover .ui-icon,
1073
+ .ui-state-focus .ui-icon,
1074
+ .ui-button:hover .ui-icon,
1075
+ .ui-button:focus .ui-icon {
1076
+ background-image: url("../images/ui-icons_555555_256x240.png");
1077
+ }
1078
+ .ui-state-active .ui-icon,
1079
+ .ui-button:active .ui-icon {
1080
+ background-image: url("../images/ui-icons_ffffff_256x240.png");
1081
+ }
1082
+ .ui-state-highlight .ui-icon,
1083
+ .ui-button .ui-state-highlight.ui-icon {
1084
+ background-image: url("../images/ui-icons_777620_256x240.png");
1085
+ }
1086
+ .ui-state-error .ui-icon,
1087
+ .ui-state-error-text .ui-icon {
1088
+ background-image: url("../images/ui-icons_cc0000_256x240.png");
1089
+ }
1090
+ .ui-button .ui-icon {
1091
+ background-image: url("../images/ui-icons_777777_256x240.png");
1092
+ }
1093
+
1094
+ /* positioning */
1095
+ .ui-icon-blank { background-position: 16px 16px; }
1096
+ .ui-icon-caret-1-n { background-position: 0 0; }
1097
+ .ui-icon-caret-1-ne { background-position: -16px 0; }
1098
+ .ui-icon-caret-1-e { background-position: -32px 0; }
1099
+ .ui-icon-caret-1-se { background-position: -48px 0; }
1100
+ .ui-icon-caret-1-s { background-position: -65px 0; }
1101
+ .ui-icon-caret-1-sw { background-position: -80px 0; }
1102
+ .ui-icon-caret-1-w { background-position: -96px 0; }
1103
+ .ui-icon-caret-1-nw { background-position: -112px 0; }
1104
+ .ui-icon-caret-2-n-s { background-position: -128px 0; }
1105
+ .ui-icon-caret-2-e-w { background-position: -144px 0; }
1106
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
1107
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
1108
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
1109
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
1110
+ .ui-icon-triangle-1-s { background-position: -65px -16px; }
1111
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
1112
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
1113
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
1114
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
1115
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
1116
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
1117
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
1118
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
1119
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
1120
+ .ui-icon-arrow-1-s { background-position: -65px -32px; }
1121
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
1122
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
1123
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
1124
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
1125
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
1126
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
1127
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
1128
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
1129
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
1130
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
1131
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
1132
+ .ui-icon-arrowthick-1-n { background-position: 1px -48px; }
1133
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
1134
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
1135
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
1136
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
1137
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
1138
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
1139
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
1140
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
1141
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
1142
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
1143
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
1144
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
1145
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
1146
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
1147
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
1148
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
1149
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
1150
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
1151
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
1152
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
1153
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
1154
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
1155
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
1156
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
1157
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
1158
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
1159
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
1160
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
1161
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
1162
+ .ui-icon-extlink { background-position: -32px -80px; }
1163
+ .ui-icon-newwin { background-position: -48px -80px; }
1164
+ .ui-icon-refresh { background-position: -64px -80px; }
1165
+ .ui-icon-shuffle { background-position: -80px -80px; }
1166
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
1167
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
1168
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
1169
+ .ui-icon-folder-open { background-position: -16px -96px; }
1170
+ .ui-icon-document { background-position: -32px -96px; }
1171
+ .ui-icon-document-b { background-position: -48px -96px; }
1172
+ .ui-icon-note { background-position: -64px -96px; }
1173
+ .ui-icon-mail-closed { background-position: -80px -96px; }
1174
+ .ui-icon-mail-open { background-position: -96px -96px; }
1175
+ .ui-icon-suitcase { background-position: -112px -96px; }
1176
+ .ui-icon-comment { background-position: -128px -96px; }
1177
+ .ui-icon-person { background-position: -144px -96px; }
1178
+ .ui-icon-print { background-position: -160px -96px; }
1179
+ .ui-icon-trash { background-position: -176px -96px; }
1180
+ .ui-icon-locked { background-position: -192px -96px; }
1181
+ .ui-icon-unlocked { background-position: -208px -96px; }
1182
+ .ui-icon-bookmark { background-position: -224px -96px; }
1183
+ .ui-icon-tag { background-position: -240px -96px; }
1184
+ .ui-icon-home { background-position: 0 -112px; }
1185
+ .ui-icon-flag { background-position: -16px -112px; }
1186
+ .ui-icon-calendar { background-position: -32px -112px; }
1187
+ .ui-icon-cart { background-position: -48px -112px; }
1188
+ .ui-icon-pencil { background-position: -64px -112px; }
1189
+ .ui-icon-clock { background-position: -80px -112px; }
1190
+ .ui-icon-disk { background-position: -96px -112px; }
1191
+ .ui-icon-calculator { background-position: -112px -112px; }
1192
+ .ui-icon-zoomin { background-position: -128px -112px; }
1193
+ .ui-icon-zoomout { background-position: -144px -112px; }
1194
+ .ui-icon-search { background-position: -160px -112px; }
1195
+ .ui-icon-wrench { background-position: -176px -112px; }
1196
+ .ui-icon-gear { background-position: -192px -112px; }
1197
+ .ui-icon-heart { background-position: -208px -112px; }
1198
+ .ui-icon-star { background-position: -224px -112px; }
1199
+ .ui-icon-link { background-position: -240px -112px; }
1200
+ .ui-icon-cancel { background-position: 0 -128px; }
1201
+ .ui-icon-plus { background-position: -16px -128px; }
1202
+ .ui-icon-plusthick { background-position: -32px -128px; }
1203
+ .ui-icon-minus { background-position: -48px -128px; }
1204
+ .ui-icon-minusthick { background-position: -64px -128px; }
1205
+ .ui-icon-close { background-position: -80px -128px; }
1206
+ .ui-icon-closethick { background-position: -96px -128px; }
1207
+ .ui-icon-key { background-position: -112px -128px; }
1208
+ .ui-icon-lightbulb { background-position: -128px -128px; }
1209
+ .ui-icon-scissors { background-position: -144px -128px; }
1210
+ .ui-icon-clipboard { background-position: -160px -128px; }
1211
+ .ui-icon-copy { background-position: -176px -128px; }
1212
+ .ui-icon-contact { background-position: -192px -128px; }
1213
+ .ui-icon-image { background-position: -208px -128px; }
1214
+ .ui-icon-video { background-position: -224px -128px; }
1215
+ .ui-icon-script { background-position: -240px -128px; }
1216
+ .ui-icon-alert { background-position: 0 -144px; }
1217
+ .ui-icon-info { background-position: -16px -144px; }
1218
+ .ui-icon-notice { background-position: -32px -144px; }
1219
+ .ui-icon-help { background-position: -48px -144px; }
1220
+ .ui-icon-check { background-position: -64px -144px; }
1221
+ .ui-icon-bullet { background-position: -80px -144px; }
1222
+ .ui-icon-radio-on { background-position: -96px -144px; }
1223
+ .ui-icon-radio-off { background-position: -112px -144px; }
1224
+ .ui-icon-pin-w { background-position: -128px -144px; }
1225
+ .ui-icon-pin-s { background-position: -144px -144px; }
1226
+ .ui-icon-play { background-position: 0 -160px; }
1227
+ .ui-icon-pause { background-position: -16px -160px; }
1228
+ .ui-icon-seek-next { background-position: -32px -160px; }
1229
+ .ui-icon-seek-prev { background-position: -48px -160px; }
1230
+ .ui-icon-seek-end { background-position: -64px -160px; }
1231
+ .ui-icon-seek-start { background-position: -80px -160px; }
1232
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1233
+ .ui-icon-seek-first { background-position: -80px -160px; }
1234
+ .ui-icon-stop { background-position: -96px -160px; }
1235
+ .ui-icon-eject { background-position: -112px -160px; }
1236
+ .ui-icon-volume-off { background-position: -128px -160px; }
1237
+ .ui-icon-volume-on { background-position: -144px -160px; }
1238
+ .ui-icon-power { background-position: 0 -176px; }
1239
+ .ui-icon-signal-diag { background-position: -16px -176px; }
1240
+ .ui-icon-signal { background-position: -32px -176px; }
1241
+ .ui-icon-battery-0 { background-position: -48px -176px; }
1242
+ .ui-icon-battery-1 { background-position: -64px -176px; }
1243
+ .ui-icon-battery-2 { background-position: -80px -176px; }
1244
+ .ui-icon-battery-3 { background-position: -96px -176px; }
1245
+ .ui-icon-circle-plus { background-position: 0 -192px; }
1246
+ .ui-icon-circle-minus { background-position: -16px -192px; }
1247
+ .ui-icon-circle-close { background-position: -32px -192px; }
1248
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
1249
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
1250
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
1251
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
1252
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
1253
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
1254
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
1255
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
1256
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
1257
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
1258
+ .ui-icon-circle-check { background-position: -208px -192px; }
1259
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
1260
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
1261
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
1262
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
1263
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
1264
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
1265
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
1266
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
1267
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
1268
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
1269
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
1270
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
1271
+
1272
+
1273
+ /* Misc visuals
1274
+ ----------------------------------*/
1275
+
1276
+ /* Corner radius */
1277
+ .ui-corner-all,
1278
+ .ui-corner-top,
1279
+ .ui-corner-left,
1280
+ .ui-corner-tl {
1281
+ border-top-left-radius: 3px;
1282
+ }
1283
+ .ui-corner-all,
1284
+ .ui-corner-top,
1285
+ .ui-corner-right,
1286
+ .ui-corner-tr {
1287
+ border-top-right-radius: 3px;
1288
+ }
1289
+ .ui-corner-all,
1290
+ .ui-corner-bottom,
1291
+ .ui-corner-left,
1292
+ .ui-corner-bl {
1293
+ border-bottom-left-radius: 3px;
1294
+ }
1295
+ .ui-corner-all,
1296
+ .ui-corner-bottom,
1297
+ .ui-corner-right,
1298
+ .ui-corner-br {
1299
+ border-bottom-right-radius: 3px;
1300
+ }
1301
+
1302
+ /* Overlays */
1303
+ .ui-widget-overlay {
1304
+ background: #aaaaaa;
1305
+ opacity: .3;
1306
+ filter: Alpha(Opacity=30); /* support: IE8 */
1307
+ }
1308
+ .ui-widget-shadow {
1309
+ -webkit-box-shadow: 0px 0px 5px #666666;
1310
+ box-shadow: 0px 0px 5px #666666;
1311
+ }
css/leaflet.css ADDED
@@ -0,0 +1,635 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* required styles */
2
+
3
+ .leaflet-pane,
4
+ .leaflet-tile,
5
+ .leaflet-marker-icon,
6
+ .leaflet-marker-shadow,
7
+ .leaflet-tile-container,
8
+ .leaflet-pane > svg,
9
+ .leaflet-pane > canvas,
10
+ .leaflet-zoom-box,
11
+ .leaflet-image-layer,
12
+ .leaflet-layer {
13
+ position: absolute;
14
+ left: 0;
15
+ top: 0;
16
+ }
17
+ .leaflet-container {
18
+ overflow: hidden;
19
+ }
20
+ .leaflet-tile,
21
+ .leaflet-marker-icon,
22
+ .leaflet-marker-shadow {
23
+ -webkit-user-select: none;
24
+ -moz-user-select: none;
25
+ user-select: none;
26
+ -webkit-user-drag: none;
27
+ }
28
+ /* Safari renders non-retina tile on retina better with this, but Chrome is worse */
29
+ .leaflet-safari .leaflet-tile {
30
+ image-rendering: -webkit-optimize-contrast;
31
+ }
32
+ /* hack that prevents hw layers "stretching" when loading new tiles */
33
+ .leaflet-safari .leaflet-tile-container {
34
+ width: 1600px;
35
+ height: 1600px;
36
+ -webkit-transform-origin: 0 0;
37
+ }
38
+ .leaflet-marker-icon,
39
+ .leaflet-marker-shadow {
40
+ display: block;
41
+ }
42
+ /* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
43
+ /* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
44
+ .leaflet-container .leaflet-overlay-pane svg,
45
+ .leaflet-container .leaflet-marker-pane img,
46
+ .leaflet-container .leaflet-shadow-pane img,
47
+ .leaflet-container .leaflet-tile-pane img,
48
+ .leaflet-container img.leaflet-image-layer,
49
+ .leaflet-container .leaflet-tile {
50
+ max-width: none !important;
51
+ max-height: none !important;
52
+ }
53
+
54
+ .leaflet-container.leaflet-touch-zoom {
55
+ -ms-touch-action: pan-x pan-y;
56
+ touch-action: pan-x pan-y;
57
+ }
58
+ .leaflet-container.leaflet-touch-drag {
59
+ -ms-touch-action: pinch-zoom;
60
+ /* Fallback for FF which doesn't support pinch-zoom */
61
+ touch-action: none;
62
+ touch-action: pinch-zoom;
63
+ }
64
+ .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
65
+ -ms-touch-action: none;
66
+ touch-action: none;
67
+ }
68
+ .leaflet-container {
69
+ -webkit-tap-highlight-color: transparent;
70
+ }
71
+ .leaflet-container a {
72
+ -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
73
+ }
74
+ .leaflet-tile {
75
+ filter: inherit;
76
+ visibility: hidden;
77
+ }
78
+ .leaflet-tile-loaded {
79
+ visibility: inherit;
80
+ }
81
+ .leaflet-zoom-box {
82
+ width: 0;
83
+ height: 0;
84
+ -moz-box-sizing: border-box;
85
+ box-sizing: border-box;
86
+ z-index: 800;
87
+ }
88
+ /* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
89
+ .leaflet-overlay-pane svg {
90
+ -moz-user-select: none;
91
+ }
92
+
93
+ .leaflet-pane { z-index: 400; }
94
+
95
+ .leaflet-tile-pane { z-index: 200; }
96
+ .leaflet-overlay-pane { z-index: 400; }
97
+ .leaflet-shadow-pane { z-index: 500; }
98
+ .leaflet-marker-pane { z-index: 600; }
99
+ .leaflet-tooltip-pane { z-index: 650; }
100
+ .leaflet-popup-pane { z-index: 700; }
101
+
102
+ .leaflet-map-pane canvas { z-index: 100; }
103
+ .leaflet-map-pane svg { z-index: 200; }
104
+
105
+ .leaflet-vml-shape {
106
+ width: 1px;
107
+ height: 1px;
108
+ }
109
+ .lvml {
110
+ behavior: url(#default#VML);
111
+ display: inline-block;
112
+ position: absolute;
113
+ }
114
+
115
+
116
+ /* control positioning */
117
+
118
+ .leaflet-control {
119
+ position: relative;
120
+ z-index: 800;
121
+ pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
122
+ pointer-events: auto;
123
+ }
124
+ .leaflet-top,
125
+ .leaflet-bottom {
126
+ position: absolute;
127
+ z-index: 1000;
128
+ pointer-events: none;
129
+ }
130
+ .leaflet-top {
131
+ top: 0;
132
+ }
133
+ .leaflet-right {
134
+ right: 0;
135
+ }
136
+ .leaflet-bottom {
137
+ bottom: 0;
138
+ }
139
+ .leaflet-left {
140
+ left: 0;
141
+ }
142
+ .leaflet-control {
143
+ float: left;
144
+ clear: both;
145
+ }
146
+ .leaflet-right .leaflet-control {
147
+ float: right;
148
+ }
149
+ .leaflet-top .leaflet-control {
150
+ margin-top: 10px;
151
+ }
152
+ .leaflet-bottom .leaflet-control {
153
+ margin-bottom: 10px;
154
+ }
155
+ .leaflet-left .leaflet-control {
156
+ margin-left: 10px;
157
+ }
158
+ .leaflet-right .leaflet-control {
159
+ margin-right: 10px;
160
+ }
161
+
162
+
163
+ /* zoom and fade animations */
164
+
165
+ .leaflet-fade-anim .leaflet-tile {
166
+ will-change: opacity;
167
+ }
168
+ .leaflet-fade-anim .leaflet-popup {
169
+ opacity: 0;
170
+ -webkit-transition: opacity 0.2s linear;
171
+ -moz-transition: opacity 0.2s linear;
172
+ transition: opacity 0.2s linear;
173
+ }
174
+ .leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
175
+ opacity: 1;
176
+ }
177
+ .leaflet-zoom-animated {
178
+ -webkit-transform-origin: 0 0;
179
+ -ms-transform-origin: 0 0;
180
+ transform-origin: 0 0;
181
+ }
182
+ .leaflet-zoom-anim .leaflet-zoom-animated {
183
+ will-change: transform;
184
+ }
185
+ .leaflet-zoom-anim .leaflet-zoom-animated {
186
+ -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
187
+ -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
188
+ transition: transform 0.25s cubic-bezier(0,0,0.25,1);
189
+ }
190
+ .leaflet-zoom-anim .leaflet-tile,
191
+ .leaflet-pan-anim .leaflet-tile {
192
+ -webkit-transition: none;
193
+ -moz-transition: none;
194
+ transition: none;
195
+ }
196
+
197
+ .leaflet-zoom-anim .leaflet-zoom-hide {
198
+ visibility: hidden;
199
+ }
200
+
201
+
202
+ /* cursors */
203
+
204
+ .leaflet-interactive {
205
+ cursor: pointer;
206
+ }
207
+ .leaflet-grab {
208
+ cursor: -webkit-grab;
209
+ cursor: -moz-grab;
210
+ cursor: grab;
211
+ }
212
+ .leaflet-crosshair,
213
+ .leaflet-crosshair .leaflet-interactive {
214
+ cursor: crosshair;
215
+ }
216
+ .leaflet-popup-pane,
217
+ .leaflet-control {
218
+ cursor: auto;
219
+ }
220
+ .leaflet-dragging .leaflet-grab,
221
+ .leaflet-dragging .leaflet-grab .leaflet-interactive,
222
+ .leaflet-dragging .leaflet-marker-draggable {
223
+ cursor: move;
224
+ cursor: -webkit-grabbing;
225
+ cursor: -moz-grabbing;
226
+ cursor: grabbing;
227
+ }
228
+
229
+ /* marker & overlays interactivity */
230
+ .leaflet-marker-icon,
231
+ .leaflet-marker-shadow,
232
+ .leaflet-image-layer,
233
+ .leaflet-pane > svg path,
234
+ .leaflet-tile-container {
235
+ pointer-events: none;
236
+ }
237
+
238
+ .leaflet-marker-icon.leaflet-interactive,
239
+ .leaflet-image-layer.leaflet-interactive,
240
+ .leaflet-pane > svg path.leaflet-interactive {
241
+ pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
242
+ pointer-events: auto;
243
+ }
244
+
245
+ /* visual tweaks */
246
+
247
+ .leaflet-container {
248
+ background: #ddd;
249
+ outline: 0;
250
+ }
251
+ .leaflet-container a {
252
+ color: #0078A8;
253
+ }
254
+ .leaflet-container a.leaflet-active {
255
+ outline: 2px solid orange;
256
+ }
257
+ .leaflet-zoom-box {
258
+ border: 2px dotted #38f;
259
+ background: rgba(255,255,255,0.5);
260
+ }
261
+
262
+
263
+ /* general typography */
264
+ .leaflet-container {
265
+ font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
266
+ }
267
+
268
+
269
+ /* general toolbar styles */
270
+
271
+ .leaflet-bar {
272
+ box-shadow: 0 1px 5px rgba(0,0,0,0.65);
273
+ border-radius: 4px;
274
+ }
275
+ .leaflet-bar a,
276
+ .leaflet-bar a:hover {
277
+ background-color: #fff;
278
+ border-bottom: 1px solid #ccc;
279
+ width: 26px;
280
+ height: 26px;
281
+ line-height: 26px;
282
+ display: block;
283
+ text-align: center;
284
+ text-decoration: none;
285
+ color: black;
286
+ }
287
+ .leaflet-bar a,
288
+ .leaflet-control-layers-toggle {
289
+ background-position: 50% 50%;
290
+ background-repeat: no-repeat;
291
+ display: block;
292
+ }
293
+ .leaflet-bar a:hover {
294
+ background-color: #f4f4f4;
295
+ }
296
+ .leaflet-bar a:first-child {
297
+ border-top-left-radius: 4px;
298
+ border-top-right-radius: 4px;
299
+ }
300
+ .leaflet-bar a:last-child {
301
+ border-bottom-left-radius: 4px;
302
+ border-bottom-right-radius: 4px;
303
+ border-bottom: none;
304
+ }
305
+ .leaflet-bar a.leaflet-disabled {
306
+ cursor: default;
307
+ background-color: #f4f4f4;
308
+ color: #bbb;
309
+ }
310
+
311
+ .leaflet-touch .leaflet-bar a {
312
+ width: 30px;
313
+ height: 30px;
314
+ line-height: 30px;
315
+ }
316
+ .leaflet-touch .leaflet-bar a:first-child {
317
+ border-top-left-radius: 2px;
318
+ border-top-right-radius: 2px;
319
+ }
320
+ .leaflet-touch .leaflet-bar a:last-child {
321
+ border-bottom-left-radius: 2px;
322
+ border-bottom-right-radius: 2px;
323
+ }
324
+
325
+ /* zoom control */
326
+
327
+ .leaflet-control-zoom-in,
328
+ .leaflet-control-zoom-out {
329
+ font: bold 18px 'Lucida Console', Monaco, monospace;
330
+ text-indent: 1px;
331
+ }
332
+
333
+ .leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
334
+ font-size: 22px;
335
+ }
336
+
337
+
338
+ /* layers control */
339
+
340
+ .leaflet-control-layers {
341
+ box-shadow: 0 1px 5px rgba(0,0,0,0.4);
342
+ background: #fff;
343
+ border-radius: 5px;
344
+ }
345
+ .leaflet-control-layers-toggle {
346
+ background-image: url(../images/layers.png);
347
+ width: 36px;
348
+ height: 36px;
349
+ }
350
+ .leaflet-retina .leaflet-control-layers-toggle {
351
+ background-image: url(../images/layers-2x.png);
352
+ background-size: 26px 26px;
353
+ }
354
+ .leaflet-touch .leaflet-control-layers-toggle {
355
+ width: 44px;
356
+ height: 44px;
357
+ }
358
+ .leaflet-control-layers .leaflet-control-layers-list,
359
+ .leaflet-control-layers-expanded .leaflet-control-layers-toggle {
360
+ display: none;
361
+ }
362
+ .leaflet-control-layers-expanded .leaflet-control-layers-list {
363
+ display: block;
364
+ position: relative;
365
+ }
366
+ .leaflet-control-layers-expanded {
367
+ padding: 6px 10px 6px 6px;
368
+ color: #333;
369
+ background: #fff;
370
+ }
371
+ .leaflet-control-layers-scrollbar {
372
+ overflow-y: scroll;
373
+ overflow-x: hidden;
374
+ padding-right: 5px;
375
+ }
376
+ .leaflet-control-layers-selector {
377
+ margin-top: 2px;
378
+ position: relative;
379
+ top: 1px;
380
+ }
381
+ .leaflet-control-layers label {
382
+ display: block;
383
+ }
384
+ .leaflet-control-layers-separator {
385
+ height: 0;
386
+ border-top: 1px solid #ddd;
387
+ margin: 5px -10px 5px -6px;
388
+ }
389
+
390
+ /* Default icon URLs */
391
+ .leaflet-default-icon-path {
392
+ background-image: url(../images/marker-icon.png);
393
+ }
394
+
395
+
396
+ /* attribution and scale controls */
397
+
398
+ .leaflet-container .leaflet-control-attribution {
399
+ background: #fff;
400
+ background: rgba(255, 255, 255, 0.7);
401
+ margin: 0;
402
+ }
403
+ .leaflet-control-attribution,
404
+ .leaflet-control-scale-line {
405
+ padding: 0 5px;
406
+ color: #333;
407
+ }
408
+ .leaflet-control-attribution a {
409
+ text-decoration: none;
410
+ }
411
+ .leaflet-control-attribution a:hover {
412
+ text-decoration: underline;
413
+ }
414
+ .leaflet-container .leaflet-control-attribution,
415
+ .leaflet-container .leaflet-control-scale {
416
+ font-size: 11px;
417
+ }
418
+ .leaflet-left .leaflet-control-scale {
419
+ margin-left: 5px;
420
+ }
421
+ .leaflet-bottom .leaflet-control-scale {
422
+ margin-bottom: 5px;
423
+ }
424
+ .leaflet-control-scale-line {
425
+ border: 2px solid #777;
426
+ border-top: none;
427
+ line-height: 1.1;
428
+ padding: 2px 5px 1px;
429
+ font-size: 11px;
430
+ white-space: nowrap;
431
+ overflow: hidden;
432
+ -moz-box-sizing: border-box;
433
+ box-sizing: border-box;
434
+
435
+ background: #fff;
436
+ background: rgba(255, 255, 255, 0.5);
437
+ }
438
+ .leaflet-control-scale-line:not(:first-child) {
439
+ border-top: 2px solid #777;
440
+ border-bottom: none;
441
+ margin-top: -2px;
442
+ }
443
+ .leaflet-control-scale-line:not(:first-child):not(:last-child) {
444
+ border-bottom: 2px solid #777;
445
+ }
446
+
447
+ .leaflet-touch .leaflet-control-attribution,
448
+ .leaflet-touch .leaflet-control-layers,
449
+ .leaflet-touch .leaflet-bar {
450
+ box-shadow: none;
451
+ }
452
+ .leaflet-touch .leaflet-control-layers,
453
+ .leaflet-touch .leaflet-bar {
454
+ border: 2px solid rgba(0,0,0,0.2);
455
+ background-clip: padding-box;
456
+ }
457
+
458
+
459
+ /* popup */
460
+
461
+ .leaflet-popup {
462
+ position: absolute;
463
+ text-align: center;
464
+ margin-bottom: 20px;
465
+ }
466
+ .leaflet-popup-content-wrapper {
467
+ padding: 1px;
468
+ text-align: left;
469
+ border-radius: 12px;
470
+ }
471
+ .leaflet-popup-content {
472
+ margin: 13px 19px;
473
+ line-height: 1.4;
474
+ }
475
+ .leaflet-popup-content p {
476
+ margin: 18px 0;
477
+ }
478
+ .leaflet-popup-tip-container {
479
+ width: 40px;
480
+ height: 20px;
481
+ position: absolute;
482
+ left: 50%;
483
+ margin-left: -20px;
484
+ overflow: hidden;
485
+ pointer-events: none;
486
+ }
487
+ .leaflet-popup-tip {
488
+ width: 17px;
489
+ height: 17px;
490
+ padding: 1px;
491
+
492
+ margin: -10px auto 0;
493
+
494
+ -webkit-transform: rotate(45deg);
495
+ -moz-transform: rotate(45deg);
496
+ -ms-transform: rotate(45deg);
497
+ transform: rotate(45deg);
498
+ }
499
+ .leaflet-popup-content-wrapper,
500
+ .leaflet-popup-tip {
501
+ background: white;
502
+ color: #333;
503
+ box-shadow: 0 3px 14px rgba(0,0,0,0.4);
504
+ }
505
+ .leaflet-container a.leaflet-popup-close-button {
506
+ position: absolute;
507
+ top: 0;
508
+ right: 0;
509
+ padding: 4px 4px 0 0;
510
+ border: none;
511
+ text-align: center;
512
+ width: 18px;
513
+ height: 14px;
514
+ font: 16px/14px Tahoma, Verdana, sans-serif;
515
+ color: #c3c3c3;
516
+ text-decoration: none;
517
+ font-weight: bold;
518
+ background: transparent;
519
+ }
520
+ .leaflet-container a.leaflet-popup-close-button:hover {
521
+ color: #999;
522
+ }
523
+ .leaflet-popup-scrolled {
524
+ overflow: auto;
525
+ border-bottom: 1px solid #ddd;
526
+ border-top: 1px solid #ddd;
527
+ }
528
+
529
+ .leaflet-oldie .leaflet-popup-content-wrapper {
530
+ zoom: 1;
531
+ }
532
+ .leaflet-oldie .leaflet-popup-tip {
533
+ width: 24px;
534
+ margin: 0 auto;
535
+
536
+ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
537
+ filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
538
+ }
539
+ .leaflet-oldie .leaflet-popup-tip-container {
540
+ margin-top: -1px;
541
+ }
542
+
543
+ .leaflet-oldie .leaflet-control-zoom,
544
+ .leaflet-oldie .leaflet-control-layers,
545
+ .leaflet-oldie .leaflet-popup-content-wrapper,
546
+ .leaflet-oldie .leaflet-popup-tip {
547
+ border: 1px solid #999;
548
+ }
549
+
550
+
551
+ /* div icon */
552
+
553
+ .leaflet-div-icon {
554
+ background: #fff;
555
+ border: 1px solid #666;
556
+ }
557
+
558
+
559
+ /* Tooltip */
560
+ /* Base styles for the element that has a tooltip */
561
+ .leaflet-tooltip {
562
+ position: absolute;
563
+ padding: 6px;
564
+ background-color: #fff;
565
+ border: 1px solid #fff;
566
+ border-radius: 3px;
567
+ color: #222;
568
+ white-space: nowrap;
569
+ -webkit-user-select: none;
570
+ -moz-user-select: none;
571
+ -ms-user-select: none;
572
+ user-select: none;
573
+ pointer-events: none;
574
+ box-shadow: 0 1px 3px rgba(0,0,0,0.4);
575
+ }
576
+ .leaflet-tooltip.leaflet-clickable {
577
+ cursor: pointer;
578
+ pointer-events: auto;
579
+ }
580
+ .leaflet-tooltip-top:before,
581
+ .leaflet-tooltip-bottom:before,
582
+ .leaflet-tooltip-left:before,
583
+ .leaflet-tooltip-right:before {
584
+ position: absolute;
585
+ pointer-events: none;
586
+ border: 6px solid transparent;
587
+ background: transparent;
588
+ content: "";
589
+ }
590
+
591
+ /* Directions */
592
+
593
+ .leaflet-tooltip-bottom {
594
+ margin-top: 6px;
595
+ }
596
+ .leaflet-tooltip-top {
597
+ margin-top: -6px;
598
+ }
599
+ .leaflet-tooltip-bottom:before,
600
+ .leaflet-tooltip-top:before {
601
+ left: 50%;
602
+ margin-left: -6px;
603
+ }
604
+ .leaflet-tooltip-top:before {
605
+ bottom: 0;
606
+ margin-bottom: -12px;
607
+ border-top-color: #fff;
608
+ }
609
+ .leaflet-tooltip-bottom:before {
610
+ top: 0;
611
+ margin-top: -12px;
612
+ margin-left: -6px;
613
+ border-bottom-color: #fff;
614
+ }
615
+ .leaflet-tooltip-left {
616
+ margin-left: -6px;
617
+ }
618
+ .leaflet-tooltip-right {
619
+ margin-left: 6px;
620
+ }
621
+ .leaflet-tooltip-left:before,
622
+ .leaflet-tooltip-right:before {
623
+ top: 50%;
624
+ margin-top: -6px;
625
+ }
626
+ .leaflet-tooltip-left:before {
627
+ right: 0;
628
+ margin-right: -12px;
629
+ border-left-color: #fff;
630
+ }
631
+ .leaflet-tooltip-right:before {
632
+ left: 0;
633
+ margin-left: -12px;
634
+ border-right-color: #fff;
635
+ }
css/vtrtspro_css_stylesheet.css ADDED
@@ -0,0 +1,408 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body { background:#F1F1F1 !important}
2
+
3
+
4
+ #ahcfree_currenttime{
5
+ color:gray;
6
+ font-size:20px !important;
7
+ float:right !important;
8
+ vertical-align:middle
9
+ }
10
+
11
+ .box_widget{
12
+ height:130px;
13
+ font-family:'Open Sans', sans-serif;
14
+ color:#FFF;
15
+ font-size:40px;
16
+ text-align:right;
17
+ padding-right:10px;
18
+ padding-top:10px;
19
+
20
+ }
21
+ .smallinputs{
22
+ width:40px !important;
23
+ background:#333
24
+ }
25
+ .txt
26
+ {
27
+ font-size:20px;
28
+ }
29
+
30
+ .blueBox{
31
+ background:url("../images/visits.png") no-repeat;
32
+ background-position:bottom left;
33
+ background-color:#578ebe;
34
+ }
35
+
36
+ .redBox{
37
+ background:url("../images/visitors.png") no-repeat;
38
+ background-position:bottom left;
39
+ background-color:#e35b5a;
40
+
41
+ }
42
+
43
+ .greenBox{
44
+ background:url("../images/online.png") no-repeat;
45
+ background-position:bottom left;
46
+ background-color:#44b6ae;
47
+ }
48
+
49
+ .movBox{
50
+ background:url("../images/searchengin.png") no-repeat;
51
+ background-position:bottom left;
52
+ background-color:#8775a7;
53
+ }
54
+
55
+
56
+ .legendsContainer{ border: solid 1px #CCCCCC; border-radius: 5px; width:auto !important; height:auto; padding: 10px; background-color: #F1F1F1;}
57
+ .legendsContainer div.legend{float: left;display:inline; height: 15px; width:180px !important; margin: 0 10px 10px 0;}
58
+ div.legend span{font-size: 11px; line-height: 0.9;}
59
+ div.legend span.color{display: block; float: left; width: 15px; height: 95%; margin-right: 8px;}
60
+ div.legend span.name{margin-right: 5px;}
61
+ div.legend span.value{color: #D34E4E;}
62
+
63
+ .panel{
64
+ margin-left:20px;
65
+ font-size:16px;
66
+ }
67
+
68
+ .disabled_panel{
69
+ background:#666;
70
+ position:absolute
71
+
72
+ }
73
+
74
+ .ahc_main_container{
75
+ direction: ltr; /* ## */
76
+ font-family:Verdana, Geneva, sans-serif; font-size:8px !important;
77
+ width:98%;
78
+ }
79
+ .ahc_main_container h1{
80
+ font-size:20px;
81
+ font-weight:normal;
82
+ color:#657f97;
83
+
84
+ }
85
+ .hitsLogo{
86
+ background:url(../images/hitslogo.png) left no-repeat;
87
+ height:55px;
88
+ width:55px;
89
+ display:inline;
90
+ float:left;
91
+ }
92
+ .rightPanelsContainer{float: left; /* ## */ margin: 0; padding: 0;}
93
+ .leftPanelsContainer{float: right; /* ## */ margin: 0; padding: 0;}
94
+ .cleaner{clear: both;}
95
+ .panel, .panelcollapsed{
96
+ background: #eee;
97
+ border:#dfdfdf solid 1px;
98
+ margin: 10px 0px;
99
+ /*padding: 0px 0px 5px;*/
100
+ -moz-border-radius: 4px;
101
+ -webkit-border-radius: 4px;
102
+
103
+ }
104
+ .panel h2, .panelcollapsed h2{
105
+ font-size: 12px !important;
106
+ font-weight: normal !important;
107
+ margin: 0px !important;
108
+ padding: 4px !important;
109
+ background: url(../images/headerbg.png) repeat-x !important; /* ## */
110
+ border-bottom:#dfdfdf solid 1px !important;;
111
+ -moz-border-radius: 3px !important;
112
+ -webkit-border-radius: 3px !important;
113
+ height:23px !important;
114
+ background-color:#FFF !important;
115
+ padding-top:10px !important;
116
+ padding-left:7px !important;
117
+ color: #657f97 !important;
118
+ font-weight:bold !important;
119
+ }
120
+ .panel .box-heading{
121
+ color: #000 !important;
122
+ padding: 10px !important;
123
+ display: inline-block !important;
124
+ width: 100% !important;
125
+ font-weight: 600 !important;
126
+ margin: 0 !important;
127
+ font-size: 14px !important;
128
+ background: #fff !important;
129
+ height: auto !important;
130
+ border-bottom: 1px solid #dddddd !important;
131
+ border-radius: 0 !important;
132
+ }
133
+ .panel{
134
+ border-radius:0 !important;
135
+ border: 1px solid #e5e5e5 !important;
136
+ box-shadow: 0 1px 1px rgba(0,0,0,.04) !important;
137
+ }
138
+
139
+ .panelcollapsed h2{
140
+ background: #FFF url(../images/arrow_down.png) no-repeat 99% 50% !important;; /* ## */
141
+ border-color: #CCC !important;;
142
+ }
143
+ .panelcontent{
144
+ padding: 10px !important;
145
+ background: #FFF;
146
+ }
147
+ .panelcontent table {
148
+ width: 100% !important;
149
+ }
150
+ .panelcollapsed .panelcontent {display: none;}
151
+ .panelcontent th{font-size: 12px; color: #333333 /*#657f97*/; font-weight: 0; padding: 5px; text-align: left; /*border-bottom:#CCC solid 1px;*/ }
152
+ .panelcontent td, .panelcontent td.values{text-align: left; font-size:12px; font-weight: 0; padding: 8px 10px; text-align: left; border-bottom:#EFEFEF solid 1px;}
153
+ .panelcontent tr:hover{
154
+ background:#F5F5F5
155
+ }
156
+ .panelcontent tr:first-child:hover{
157
+ background:none;
158
+ }
159
+ .fineFont{font-size: 10px !important}
160
+
161
+ .lastVisitorsDetails{border-bottom: solid 1px #dad6ca; direction: ltr; padding: 5px;}
162
+ .lastVisitorsDetails span{margin-right: 3px;}
163
+ .lastVisitorsDetails img{vertical-align: middle;}
164
+ .ipAddress{float: left; font-size: 14px; color: #3B9EF9; margin-bottom: 10px; margin-bottom: 10px; width:150px;}
165
+ .referingSite{color: #3B9EF9; margin-left: 5px; font-size: 12px;}
166
+ .visitDateTime{float: right; color: #3B9EF9; font-size: 12px;}
167
+
168
+ .lastSearchKeyWords, .visitorMarker{border-bottom: solid 1px #dad6ca; direction: ltr; padding: 5px;}
169
+ .lastSearchKeyWords span, .countryMarker span{margin-right: 3px;}
170
+ .lastSearchKeyWords img{vertical-align: middle;}
171
+ .countryMarker{direction: ltr; padding: 5px;}
172
+ .searchKeyWords{font-size: 12px;}
173
+
174
+ .languageChanger{direction: rtl; /* ## */ font-size: 18px;}
175
+
176
+ .countryMarker span.countryName, .visitorMarker span.ipAddress{margin-left: 5px;}
177
+
178
+ .visitorMarker{border-bottom: dashed 1px #dad6ca;}
179
+ .countryMarker span.countryName{font-size: 12px;}
180
+ .countryMarker img{vertical-align: middle;}
181
+ .visitorMarker span.ipAddress{font-size: 12px;}
182
+ .visitorMarker span{float: left;}
183
+
184
+ /* visitors graph begin */
185
+ div.visitorsGraphContainer{float: left; width: 70%} /* ### */
186
+ div.visitorsGraphContainer div.visitorsGraph{float: left; background-color:#9F6; border-radius: 2px;}
187
+ div.visitorsGraphContainer div.visitorsGraph2{float: left; background-color:#393; border-radius: 2px;}
188
+ div.visitorsGraphContainer div.visitorsGraph3{float: left; background-color:#060; border-radius: 2px;}
189
+ div.visitorsPercent{float: left; width: 25%; margin-left: 5px;} /* ### */
190
+ /* visitors graph end */
191
+
192
+ h2{
193
+ text-align:left !important;
194
+ font-size:14px !important;
195
+ height:30px !important;
196
+ }
197
+
198
+
199
+ .recentv tr td{
200
+ font-size:11px !important;
201
+ padding: 10px 5px;
202
+ }
203
+
204
+ /*************************************/
205
+
206
+ .increase_counter{
207
+ background-image:url('../images/increase.png');
208
+ }
209
+
210
+ .decrease_counter{
211
+ background-image:url('../images/decrease.png');
212
+ }
213
+ span#up-down {
214
+ display: inline-block;
215
+ width: 50px;
216
+ height: 30px;
217
+ background-repeat: no-repeat;
218
+ background-position: center center;
219
+ }
220
+
221
+ .hits_duration_select{
222
+ padding-top: 10px;
223
+ padding-left: 10px;
224
+ height:45px
225
+ }
226
+ #visitors_graph_stats{
227
+ position:relative;
228
+ }
229
+ .panelcontent.loader:after {
230
+ content: "";
231
+ background-image: url(../images/Spinner-1s-200px.svg);
232
+ background-repeat: no-repeat;
233
+ width: 100%;
234
+ height: 100%;
235
+ position: absolute;
236
+ left: 0;
237
+ top: 0;
238
+ background-position: center;
239
+ z-index: 9999;
240
+ background-color: rgba(255,255,255,0.6);
241
+ }
242
+
243
+ .dataTables_wrapper .dataTables_paginate{
244
+ padding: 10px 0 0;
245
+ display: block;
246
+ width: 100%;
247
+ text-align: center;
248
+ }
249
+
250
+ .dataTables_wrapper .dataTables_paginate a{
251
+ padding: 3px;
252
+ background: #fff;
253
+ color: #23282d;
254
+ text-decoration: none;
255
+ min-width: 30px !important;
256
+ display: inline-block;
257
+ margin: 0 3px;
258
+ cursor:pointer;
259
+ font-size: 12px;
260
+ }
261
+ .dataTables_wrapper .dataTables_paginate a.current{
262
+ background: #0073aa;
263
+ color: #fff;
264
+ text-decoration:none;
265
+ cursor:pointer;
266
+ }
267
+
268
+ .dataTables_wrapper .dataTables_paginate a:hover{
269
+ background: #23282d;
270
+ color: #fff;
271
+ text-decoration:none;
272
+ cursor:pointer;
273
+ }
274
+ .panelcontent .jqplot-table-legend{
275
+ width: auto !important;
276
+ }
277
+ .panelcontent .jqplot-table-legend td{
278
+ border:none !important;
279
+ }
280
+ span.export_data {
281
+ float: right;
282
+ margin-right: 5px;
283
+ }
284
+ .export_data a{
285
+ color: #000;
286
+ }
287
+ .export_data a:hover,.export_data a:focus,.export_data a:active{
288
+ background: #000;
289
+ color:#fff;
290
+ text-decoration:none;
291
+ }
292
+ .dataTables_wrapper .dt-buttons{
293
+ display:none;
294
+ }
295
+ .search-panel{
296
+ padding: 10px;
297
+ font-size: 14px;
298
+ color: #fff;
299
+ display: block;
300
+ background: #333;
301
+ }
302
+ .search-panel label {
303
+ font-size: 12px;
304
+ }
305
+ .search-panel input[type='text'] {
306
+ max-width: 90px;
307
+ font-size:12px;
308
+ height: 26px;
309
+ padding: 3px !important;
310
+ }
311
+
312
+ .no-record{
313
+ text-align: center;
314
+ font-size:14px;
315
+ padding:10px;
316
+ }
317
+
318
+ .search-panel .button.button-primary {
319
+ padding: 0 5px;
320
+ height: 25px;
321
+ }
322
+ span.search_data {
323
+ float: right;
324
+ margin-right: 5px;
325
+ }
326
+ .search_data a{
327
+ color:#000;
328
+ }
329
+
330
+ .search_data a:hover,.search_data a:focus,.search_data a:active{
331
+ background: #000;
332
+ color:#fff;
333
+ text-decoration:none;
334
+ }
335
+ .search-panel{
336
+ display:none;
337
+ }
338
+ .dataTables_processing{
339
+ text-align:center;
340
+ }
341
+ .dataTables_filter{
342
+ padding: 10px;
343
+ font-size: 14px;
344
+ color: #fff;
345
+ display: none;
346
+ background: #333;
347
+ margin-right: -10px;
348
+ margin-left: -10px;
349
+ margin-top: -10px;
350
+ }
351
+ .dataTables_filter label {
352
+ font-size: 12px;
353
+ }
354
+ .dataTables_filter input[type="search"] {
355
+ max-width: 150px;
356
+ font-size:12px;
357
+ height: 26px;
358
+ margin-left: 5px;
359
+ padding: 3px !important;
360
+ }
361
+ .dataTables_empty{
362
+ text-align:center !important;
363
+ }
364
+
365
+ #lasest_search_words td span {
366
+ margin-right: 5px;
367
+ }
368
+
369
+ .search-panel.open {
370
+ display: block;
371
+ }
372
+
373
+ .dataTables_processing span.loader{
374
+ background:url("../images/loadinggif.gif");
375
+ height:16px;
376
+ width:16px;
377
+ display: inline-block;
378
+ }
379
+ .ui-widget.ui-widget-content {
380
+ z-index: 999 !important;
381
+ }
382
+
383
+ @media (min-width:1025px)
384
+ {
385
+ .ahc_main_container {
386
+ display: block;
387
+ }
388
+ .ahc_main_container .row {
389
+ display: flex;
390
+ align-items: stretch;
391
+ }
392
+
393
+ .ahc_main_container .row > div {
394
+ display: block;
395
+ margin-bottom: 20px;
396
+ }
397
+
398
+ .ahc_main_container .row:after, .ahc_main_container .row:before {
399
+ display: none;
400
+ }
401
+
402
+ .ahc_main_container .row > div > div {
403
+ display: block;
404
+ height: 100%;
405
+ margin-bottom: 0;
406
+ }
407
+ }
408
+
functions.php CHANGED
@@ -1,2567 +1,3536 @@
1
- <?php
2
-
3
- /**
4
- * Called when plugin is activated or upgraded
5
- *
6
- * @uses add_option()
7
- * @uses get_option()
8
- *
9
- * @return void
10
- */
11
- function ahcfree_getVisitsTime() {
12
- global $wpdb;
13
- $result = $wpdb->get_results("SELECT COUNT( `vtm_id` ) cnt FROM ahc_visits_time", OBJECT);
14
- if ($result !== false) {
15
- return $result[0]->cnt;
16
- }
17
- return false;
18
- }
19
-
20
-
21
-
22
- /**
23
- * change plugin settings
24
- * @return void
25
- */
26
- function ahcfree_savesettings() {
27
- global $wpdb;
28
-
29
- $set_hits_days = intval($_POST['set_hits_days']);
30
- $set_ajax_check = 15;
31
- $posts_type = '';
32
- $set_ips = esc_html($_POST['set_ips']);
33
- $set_google_map = '';
34
- $delete_plugin_data = isset($_POST['delete_plugin_data']) ? intval($_POST['delete_plugin_data']) : '';
35
-
36
- $custom_timezone_offset = sanitize_text_field($_POST['set_custom_timezone']);
37
- if ($custom_timezone_offset && $custom_timezone_offset != '') {
38
- update_option('ahcfree_custom_timezone', $custom_timezone_offset);
39
- }
40
-
41
- $delete_plugin_data = (isset($delete_plugin_data)) ? intval($delete_plugin_data) : 0;
42
- update_option('ahcfree_delete_plugin_data_on_uninstall', $delete_plugin_data);
43
-
44
-
45
- $ahcUserRoles = '';
46
- foreach ($_POST['ahcUserRoles'] as $v)
47
- {
48
- $ahcUserRoles .= $v.",";
49
- }
50
-
51
-
52
-
53
- $wsmUserRoles = substr($ahcUserRoles,0,-1);
54
-
55
- update_option('ahcUserRoles',$ahcUserRoles);
56
-
57
-
58
-
59
-
60
- $sql = $wpdb->prepare("UPDATE `ahc_settings` set `set_hits_days` = %s, `set_ajax_check` = %s, `set_ips` = %s, `set_google_map` = %s ", $set_hits_days, $set_ajax_check, $set_ips, $set_google_map);
61
-
62
- if ($wpdb->query($sql) !== false) {
63
-
64
- return true;
65
- }
66
-
67
- return false;
68
- }
69
-
70
-
71
-
72
-
73
-
74
- function ahcfree_get_save_settings() {
75
- global $wpdb;
76
- $table_exist = ahcfree_check_table_exists('ahc_settings');
77
- if( $table_exist ){
78
- $result = $wpdb->get_results("SELECT set_hits_days, set_ajax_check, set_ips, set_google_map FROM ahc_settings", OBJECT);
79
- if ($result !== false) {
80
- return $result;
81
- }
82
- }
83
-
84
- return false;
85
- }
86
-
87
- function ahcfree_get_timezone_string() {
88
- $custom_timezone = get_option('ahcfree_custom_timezone');
89
- if (!$custom_timezone) {
90
- $wsmTimeZone=get_option('timezone_string' );
91
- if(is_null($wsmTimeZone) || $wsmTimeZone==''){
92
- $wsmTimeZone=ahcfree_GetWPTimezoneString();
93
- }
94
- $custom_timezone= ahcfree_CleanupTimeZoneString($wsmTimeZone);
95
-
96
- /*
97
- $custom_timezone = get_option( 'timezone_string' );
98
-
99
- if ( ! empty( $custom_timezone ) ) {
100
- return $custom_timezone;
101
- }
102
-
103
- $offset = get_option( 'gmt_offset' );
104
- $hours = (int) $offset;
105
- $minutes = ( $offset - floor( $offset ) ) * 60;
106
- if( $hours < 10 ){
107
- $hours = '0'+$hours;
108
- }
109
- echo $custom_timezone = sprintf( '%s:%s', $hours, $minutes );*/
110
-
111
- }
112
- return $custom_timezone;
113
- }
114
-
115
-
116
- function ahcfree_CleanupTimeZoneString($tzString){
117
- $offset=$tzString;
118
-
119
- if (preg_match('/^UTC[+-]/', $tzString)) {
120
- $tzString= preg_replace('/UTC\+?/', '', $tzString);
121
- }
122
- if(is_numeric($tzString)){
123
- $offset=sprintf('%02d:%02d', (int) $tzString, fmod(abs($tzString), 1) * 60);
124
- if((int) $tzString>0){
125
- $offset='+'.$offset;
126
- }
127
- }
128
- return $offset;
129
- }
130
- function ahcfree_GetWPTimezoneString() {
131
- // if site timezone string exists, return it
132
- if ( $timezone = get_option( 'timezone_string' ) )
133
- return $timezone;
134
-
135
- // get UTC offset, if it isn't set then return UTC
136
- if ( 0 === ( $utc_offset = get_option( 'gmt_offset', 0 ) ) )
137
- return 'UTC';
138
-
139
- // adjust UTC offset from hours to seconds
140
- $utc_offset *= 3600;
141
-
142
- // attempt to guess the timezone string from the UTC offset
143
- if ( $timezone = timezone_name_from_abbr( '', $utc_offset, 0 ) ) {
144
- return $timezone;
145
- }
146
-
147
- // last try, guess timezone string manually
148
- $is_dst = date( 'I' );
149
-
150
- foreach ( timezone_abbreviations_list() as $abbr ) {
151
- foreach ( $abbr as $city ) {
152
- if ( $city['dst'] == $is_dst && $city['offset'] == $utc_offset )
153
- return $city['timezone_id'];
154
- }
155
- }
156
-
157
- // fallback to UTC
158
- return 'UTC';
159
- }
160
-
161
- function ahcfree_get_current_timezone_offset() {
162
- $tz = ahcfree_get_timezone_string();
163
- try {
164
- $timeZone = new DateTimeZone($tz);
165
- $date = new DateTime('now', $timeZone);
166
- $date->setTimezone($timeZone);
167
- } catch (Exception $e) {
168
- $date = new DateTime('now');
169
- }
170
- return '+00:00';
171
- // return $date->format('P');
172
- }
173
-
174
- function ahcfree_last_hit_date() {
175
- global $wpdb;
176
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
177
- $sql = "SELECT max(CONVERT_TZ(vtr_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) as last_date FROM ahc_recent_visitors";
178
- //echo $sql = "SELECT max(vtr_date)) as last_date FROM ahc_recent_visitors";
179
- $result = $wpdb->get_results($sql, OBJECT);
180
- if ($result !== false) {
181
- return $result[0]->last_date;
182
- }
183
- return date('Y-m-d', time());
184
- }
185
-
186
- function ahcfree_getCountriesCount() {
187
- global $wpdb;
188
- $result = $wpdb->get_results("SELECT COUNT( `ctr_id` ) cnt FROM ahc_countries", OBJECT);
189
- if ($result !== false) {
190
- return $result[0]->cnt;
191
- }
192
- return false;
193
- }
194
-
195
- function ahcfree_getBrowsersCount() {
196
- global $wpdb;
197
- $result = $wpdb->get_results("SELECT COUNT( `bsr_id` ) cnt FROM ahc_browsers", OBJECT);
198
- if ($result !== false) {
199
- return $result[0]->cnt;
200
- }
201
- return false;
202
- }
203
-
204
- function ahcfree_getSearchEnginesCount() {
205
- global $wpdb;
206
- $result = $wpdb->get_results("SELECT COUNT( `srh_id` ) cnt FROM ahc_search_engines", OBJECT);
207
- if ($result !== false) {
208
- return $result[0]->cnt;
209
- }
210
- return false;
211
- }
212
-
213
- function ahcfree_set_default_options() {
214
- // plugin activation
215
-
216
- require_once("database_basics_data.php");
217
- if (get_option('ahcfree_wp_hits_counter_options') === false) {
218
-
219
-
220
- $plugin_options = array();
221
- $plugin_options['ahcfree_version'] = '1.0';
222
- $plugin_options['available_languages'] = array('ar' => 'عربي', 'en' => 'English');
223
- $plugin_options['ahcfree_lang'] = 'en';
224
- $plugin_options['user_roles_to_not_track'] = array('administrator' => true, 'editor' => true, 'author' => true, 'contributor' => true, 'subscriber' => false);
225
- add_option('ahcfree_wp_hits_counter_options', $plugin_options);
226
- }
227
- set_time_limit(300);
228
- if (ahcfree_create_database_tables()) {
229
-
230
- if (ahcfree_getVisitsTime() > 25) {
231
- global $wpdb;
232
- $result = $wpdb->get_results("DELETE FROM ahc_visits_time where `vtm_id` > 24", OBJECT);
233
- }
234
-
235
- if (ahcfree_getCountriesCount() == 0) {
236
- ahcfree_insert_countries_into_table($internetCountryCodes, $contriesLatLng);
237
- }
238
-
239
- if (ahcfree_getVisitsTime() == 0) {
240
- ahcfree_insert_visit_times_into_table($dayHours);
241
- }
242
-
243
- if (ahcfree_getSearchEnginesCount() == 0) {
244
- ahcfree_insert_search_engines_into_table($searchEngines);
245
- }
246
-
247
- if (ahcfree_getBrowsersCount() == 0) {
248
- ahcfree_insert_browsers_into_table($browsers);
249
- }
250
- }
251
-
252
-
253
- ahcfree_update_tables();
254
- }
255
-
256
- //--------------------------------------------
257
- /**
258
- * Called when plugin is deactivated
259
- *
260
- * @return void
261
- */
262
- function ahcfree_unset_default_options() {
263
-
264
- }
265
-
266
- //--------------------------------------------
267
- /**
268
- * Creates plugin page link in the admin menu
269
- *
270
- * @uses add_menu_page()
271
- * @uses plugins_url()
272
- *
273
- * @return void
274
- */
275
- function ahcfree_create_admin_menu_link() {
276
-
277
- global $current_user;
278
- $ahcUserRole = explode(',',get_option('ahcUserRoles'));
279
-
280
- $roles_arr = array();
281
-
282
- foreach($ahcUserRole as $v) {
283
- $roles_arr[] = strtolower($v);
284
- }
285
-
286
- $current_use_roles = strtolower(array_shift($current_user->roles));
287
- if (! in_array( $current_use_roles, $roles_arr )) {
288
-
289
- if(!(current_user_can('manage_options')))
290
- {
291
- return;
292
- }
293
- }
294
-
295
- add_menu_page('Visitor Traffic Real Time Statistics', 'Visitor Traffic', 'read', 'ahc_hits_counter_menu_free', 'ahcfree_create_plugin_overview_page', plugins_url('/images/vtrts.png', AHCFREE_PLUGIN_MAIN_FILE));
296
- add_submenu_page('ahc_hits_counter_menu_free', 'Visitor Traffic Real Time Statistics Settings', 'Settings', 'read', 'ahc_hits_counter_settings', 'ahcfree_create_plugin_settings_page');
297
- $ahcfree_custom_timezone = get_option( 'ahcfree_custom_timezone', false );
298
- if( !$ahcfree_custom_timezone ){
299
- add_action('admin_notices', 'ahcfree_admin_notice_to_set_timezone');
300
- }
301
- $page = isset($_GET['page']) ? ahcfree_sanitizing($_GET['page']) : '';
302
-
303
- if( $page == 'ahc_hits_counter_settings' ){
304
- remove_action('admin_notices', 'ahcfree_admin_notice_to_set_timezone');
305
- }
306
- }
307
-
308
- //--------------------------------------------
309
- /**
310
- * Format numbers
311
- *
312
- * @return number
313
- */
314
- function ahcfree_free_NumFormat($num) {
315
- if ($num > 1000) {
316
- return number_format($num, 0, ',', ',');
317
- } else {
318
- return $num;
319
- }
320
- }
321
-
322
- //------
323
- function ahcfree_countOnlineusers() {
324
- global $wpdb;
325
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
326
-
327
- $sql = "SELECT id FROM ahc_online_users WHERE `date` >= '". date("Y-m-d H:i:s", strtotime('-1 minute') ) ."' GROUP BY hit_ip_address";
328
- $result = $wpdb->get_results($sql, OBJECT);
329
- $online_users = "0";
330
- if ($result !== false) {
331
- $online_users = count($result);
332
- //return $result[0]->onlineusers;
333
- //echo json_encode($result[0]->onlineusers);
334
- }
335
- if( is_admin() ){
336
- echo json_encode($online_users);
337
- die;
338
- }else{
339
- return $online_users;
340
- }
341
-
342
- //return '0';
343
-
344
- }
345
-
346
- function ahcfree_init()
347
- {
348
-
349
- add_action('wp_ajax_ahcfree_track_visitor','ahcfree_track_visitor');
350
- add_action('wp_ajax_nopriv_ahcfree_track_visitor','ahcfree_track_visitor');
351
- }
352
- add_action('admin_init','ahcfree_init');
353
-
354
- function ahcfree_enqueue_scripts()
355
- {
356
- global $post, $wp_query;
357
- $post_id = "HOMEPAGE";
358
- $page_title = '';
359
- $post_type = '';
360
- if(is_singular() || is_page() )
361
- {
362
- $post_id = $post->ID;
363
- $page_title = get_the_title($post->ID);
364
- $post_type = get_post_type($post->ID);
365
- }
366
- if ( is_home() ) {
367
- $post_id = "BLOGPAGE";
368
- }
369
- if( is_archive() ){
370
- $post_id = get_the_archive_title();
371
- }
372
-
373
-
374
- wp_register_script('ahcfree_front_js', plugins_url('/js/front.js', AHCFREE_PLUGIN_MAIN_FILE),'jquery', '', false);
375
- wp_enqueue_script('ahcfree_front_js');
376
-
377
- wp_localize_script('ahcfree_front_js', 'ahcfree_ajax_front', array('ajax_url' => admin_url('admin-ajax.php'),
378
- 'page_id' => $post_id,
379
- 'page_title'=> $page_title,
380
- 'post_type'=> $post_type
381
- ));
382
- }
383
- add_action('wp_enqueue_scripts','ahcfree_enqueue_scripts', 1);
384
- //--------------------------------------------
385
- /**
386
- * Creates the main overview page
387
- *
388
- * @return void
389
- */
390
- function ahcfree_create_plugin_overview_page() {
391
- require_once(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . 'lang' . AHCFREE_DS . Globalsahcfree::$lang . '_lang.php');
392
- include("overview.php");
393
- }
394
-
395
- //--------------------------------------------
396
- /**
397
- * Creates the plugin settings
398
- *
399
- * @return void
400
- */
401
- function ahcfree_create_plugin_settings_page() {
402
-
403
- require_once(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . 'lang' . AHCFREE_DS . Globalsahcfree::$lang . '_lang.php');
404
- include("ahc_settings.php");
405
- }
406
-
407
- //--------------------------------------------
408
- /**
409
- * Creates the plugin help page
410
- *
411
- * @return void
412
- */
413
- function ahcfree_create_plugin_help_page() {
414
-
415
- require_once(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . 'lang' . AHCFREE_DS . Globalsahcfree::$lang . '_lang.php');
416
- include("ahcfree_help.php");
417
- }
418
-
419
- //--------------------------------------------
420
- /**
421
- * Creates the plugin help page
422
- *
423
- * @return void
424
- */
425
- function ahcfree_create_plugin_about_page() {
426
-
427
- require_once(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . 'lang' . AHCFREE_DS . Globalsahcfree::$lang . '_lang.php');
428
- include("ahcfree_about.php");
429
- }
430
-
431
- //--------------------------------------------
432
- /**
433
- * Returns links array of available languages
434
- *
435
- * @uses get_option()
436
- * @uses add_query_arg()
437
- *
438
- * @return array
439
- */
440
- function ahcfree_get_change_lang_links() {
441
- $plugin_options = get_option('ahcfree_wp_hits_counter_options');
442
- $links = array();
443
- $i = 0;
444
- foreach ($plugin_options['available_languages'] as $key => $value) {
445
- if (Globalsahcfree::$lang != $key) {
446
- $links[$i]['name'] = $value;
447
- $links[$i]['href'] = add_query_arg('ahcfree_lang', $key);
448
- $i++;
449
- }
450
- }
451
- unset($plugin_options);
452
- unset($i);
453
- return $links;
454
- }
455
-
456
- //--------------------------------------------
457
- /**
458
- * Decides whether or not should track the current visitor
459
- *
460
- * @uses is_user_logged_in()
461
- * @uses WP_User::$roles
462
- *
463
- * @return boolean
464
- */
465
- function ahcfree_should_track_visitor() {
466
- global $current_user;
467
- $allow = true;
468
- if (is_user_logged_in()) {
469
- $user = new WP_User($current_user->ID);
470
- if (!empty($user->roles) && is_array($user->roles)) {
471
- foreach ($user->roles as $role) {
472
- $found = (isset(Globalsahcfree::$plugin_options['user_roles_to_not_track'][$role])) ? Globalsahcfree::$plugin_options['user_roles_to_not_track'][$role] : false;
473
- if ($found) {
474
- $allow = false;
475
- break;
476
- }
477
- }
478
- }
479
- }
480
- return $allow;
481
- }
482
-
483
- //--------------------------------------------
484
- /**
485
- * Returns true if the current user has administrator role
486
- *
487
- * @uses is_user_logged_in()
488
- * @uses WP_User::$roles
489
- *
490
- * @return boolean
491
- */
492
- function ahcfree_has_administrator_role() {
493
- global $user_ID;
494
- $is_admin = false;
495
- if (is_user_logged_in()) {
496
- $user = new WP_User($user_ID);
497
- if (!empty($user->roles) && is_array($user->roles)) {
498
- foreach ($user->roles as $role) {
499
- if ($role == 'administrator') {
500
- $is_admin = true;
501
- break;
502
- }
503
- }
504
- }
505
- }
506
- return $is_admin;
507
- }
508
-
509
- //--------------------------------------------
510
- /**
511
- * Check if column exist or not
512
- *
513
- * @uses wpdb::query()
514
- *
515
- * @return boolean
516
- */
517
- function ahcfree_check_table_column_exists($table_name, $column_name) {
518
- global $wpdb;
519
- $column = $wpdb->get_row($wpdb->prepare("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s AND COLUMN_NAME = %s ", DB_NAME, $table_name, $column_name));
520
-
521
- if (!empty($column)) {
522
- return true;
523
- }
524
- return false;
525
- }
526
-
527
- //--------------------------------------------
528
- /**
529
- * Check if Table exist or not
530
- *
531
- * @uses wpdb::query()
532
- *
533
- * @return boolean
534
- */
535
- function ahcfree_check_table_exists($table_name) {
536
- global $wpdb;
537
- $table_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s", DB_NAME, $table_name));
538
-
539
- if (!empty($table_data)) {
540
- return true;
541
- }
542
- return false;
543
- }
544
-
545
-
546
- //--------------------------------------------
547
- /**
548
- * Creates database updates plugin tables
549
- *
550
- * @uses wpdb::query()
551
- *
552
- * @return boolean
553
- */
554
- function ahcfree_update_tables() {
555
- global $wpdb;
556
- $sqlQueries = array();
557
-
558
- $sqlQueries[] = " drop table IF EXISTS `ahc_settings` ";
559
- $sqlQueries[] = "
560
- CREATE TABLE IF NOT EXISTS `ahc_settings` (
561
- `set_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
562
- `set_hits_days` int(10) unsigned NOT NULL DEFAULT '30',
563
- `set_ajax_check` int(10) unsigned NOT NULL DEFAULT '10',
564
- `set_ips` text DEFAULT NULL,
565
- `set_google_map` varchar(100) NOT NULL DEFAULT 'today_visitors',
566
-
567
- PRIMARY KEY (`set_id`)
568
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
569
-
570
- //$sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_city` varchar(230) NULL";
571
- //$sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_region` varchar(230) NULL";
572
-
573
- /* code for error handling : "duplicate column name" : Taslim -Prism */
574
- if ( ahcfree_check_table_exists('ahc_recent_visitors') === true && ahcfree_check_table_column_exists('ahc_recent_visitors', 'ahc_city') === false ) {
575
- $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_city` varchar(230) NULL";
576
- }
577
-
578
- if ( ahcfree_check_table_exists('ahc_recent_visitors') === true && ahcfree_check_table_column_exists('ahc_recent_visitors', 'ahc_region') === false ) {
579
- $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_region` varchar(230) NULL";
580
- }
581
-
582
- foreach ($sqlQueries as $sql) {
583
- if ($wpdb->query($sql) === false) {
584
- return false;
585
- }
586
- }
587
-
588
-
589
- return true;
590
- }
591
-
592
- function ahcfix_init(){
593
- global $wpdb;
594
- $sqlQueries = array();
595
- if ( ahcfree_check_table_exists('ahc_visitors') === true && ahcfree_check_table_column_exists('ahc_visitors', 'vst_date') ) {
596
- $sqlQueries[] = "ALTER TABLE `ahc_visitors` CHANGE `vst_date` `vst_date` DATETIME NOT NULL";
597
- }
598
-
599
- if ( ahcfree_check_table_exists('ahc_searching_visits') === true && ahcfree_check_table_column_exists('ahc_searching_visits', 'vtsh_date') ) {
600
- $sqlQueries[] = "ALTER TABLE `ahc_searching_visits` CHANGE `vtsh_date` `vtsh_date` DATETIME NOT NULL";
601
- }
602
-
603
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_online_users`
604
- (
605
- `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
606
- PRIMARY KEY(`id`),
607
- `hit_ip_address` VARCHAR(50) NOT NULL,
608
- `hit_page_id` VARCHAR(30) NOT NULL,
609
- `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
610
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
611
-
612
-
613
- if( count($sqlQueries) ){
614
- foreach ($sqlQueries as $sql) {
615
- $wpdb->query($sql);
616
- }
617
- }
618
- }
619
-
620
- function ahcfree_add_settings() {
621
-
622
- global $wpdb;
623
- ahcfree_update_tables();
624
-
625
- $sql1 = "truncate table `ahc_settings`";
626
- $wpdb->query($sql1);
627
-
628
- $sql = "insert into `ahc_settings` (set_id, set_hits_days, set_ajax_check, set_ips, set_google_map) values (1, 14, 15, null, 'today_visitors')";
629
-
630
-
631
- if ($wpdb->query($sql) === false) {
632
- return false;
633
- }
634
- return true;
635
- }
636
-
637
- //--------------------------------------------
638
- /**
639
- * Creates database plugin tables
640
- *
641
- * @uses wpdb::query()
642
- *
643
- * @return boolean
644
- */
645
- function ahcfree_create_database_tables() {
646
- global $wpdb;
647
- $sqlQueries = array();
648
-
649
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_online_users`
650
- (
651
- `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
652
- PRIMARY KEY(`id`),
653
- `hit_ip_address` VARCHAR(50) NOT NULL,
654
- `hit_page_id` VARCHAR(30) NOT NULL,
655
- `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
656
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
657
-
658
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_hits`
659
- (
660
- `hit_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
661
- PRIMARY KEY(`hit_id`),
662
- `hit_ip_address` VARCHAR(50) NOT NULL,
663
- `hit_user_agent` VARCHAR(200) NOT NULL,
664
- `hit_request_uri` VARCHAR(200) NULL,
665
- `hit_page_id` VARCHAR(30) NOT NULL,
666
- `hit_page_title` VARCHAR(200) NULL,
667
- `ctr_id` INT(3) UNSIGNED NULL,
668
- `hit_referer` VARCHAR(300) NULL,
669
- `hit_referer_site` VARCHAR(100) NULL,
670
- `srh_id` INT(3) UNSIGNED NULL,
671
- `hit_search_words` VARCHAR(200) NULL,
672
- `bsr_id` INT(3) UNSIGNED NOT NULL,
673
- `hit_date` DATE NOT NULL,
674
- `hit_time` TIME NOT NULL
675
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
676
-
677
-
678
- $sqlQueries[] = "
679
- CREATE TABLE IF NOT EXISTS `ahc_settings` (
680
- `set_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
681
- `set_hits_days` int(10) unsigned NOT NULL DEFAULT '30',
682
- `set_ajax_check` int(10) unsigned NOT NULL DEFAULT '10',
683
- `set_ips` text DEFAULT NULL,
684
- `set_google_map` varchar(100) NOT NULL DEFAULT 'today_visitors',
685
-
686
- PRIMARY KEY (`set_id`)
687
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
688
-
689
-
690
-
691
-
692
-
693
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_browsers`
694
- (
695
- `bsr_id` INT(3) UNSIGNED NOT NULL,
696
- PRIMARY KEY(`bsr_id`),
697
- `bsr_name` VARCHAR(100) NOT NULL,
698
- `bsr_icon` VARCHAR(50),
699
- `bsr_visits` INT(11) NOT NULL DEFAULT 0
700
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
701
-
702
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_search_engines`
703
- (
704
- `srh_id` INT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
705
- PRIMARY KEY(`srh_id`),
706
- `srh_name` VARCHAR(100) NOT NULL,
707
- `srh_query_parameter` VARCHAR(10) NOT NULL,
708
- `srh_icon` VARCHAR(50),
709
- `srh_identifier` VARCHAR(50)
710
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
711
-
712
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_search_engine_crawlers`
713
- (
714
- `bot_name` VARCHAR(50) NOT NULL,
715
- `srh_id` INT(3) UNSIGNED NOT NULL
716
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
717
-
718
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_countries`
719
- (
720
- `ctr_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
721
- PRIMARY KEY(`ctr_id`),
722
- `ctr_name` VARCHAR(100) NOT NULL,
723
- `ctr_internet_code` VARCHAR(5) NOT NULL,
724
- `ctr_latitude` VARCHAR(30) NULL,
725
- `ctr_longitude` VARCHAR(30) NULL,
726
- `ctr_visitors` INT(11) NOT NULL DEFAULT 0,
727
- `ctr_visits` INT(11) NOT NULL DEFAULT 0
728
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
729
-
730
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_visitors`
731
- (
732
- `vst_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
733
- PRIMARY KEY (`vst_id`),
734
- `vst_date` DATE NOT NULL,
735
- `vst_visitors` INT(11) UNSIGNED NULL DEFAULT 0,
736
- `vst_visits` INT(11) UNSIGNED NULL DEFAULT 0
737
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
738
-
739
- $sqlQueries[] = "ALTER TABLE `ahc_visitors` CHANGE `vst_date` `vst_date` DATETIME NOT NULL";
740
-
741
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_daily_visitors_stats`
742
- (
743
- `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
744
- PRIMARY KEY (`id`),
745
- `vst_date` DATETIME NOT NULL,
746
- `vst_visitors` INT(11) UNSIGNED NULL DEFAULT 0,
747
- `vst_visits` INT(11) UNSIGNED NULL DEFAULT 0
748
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
749
-
750
-
751
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_searching_visits`
752
- (
753
- `vtsh_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
754
- PRIMARY KEY (`vtsh_id`),
755
- `srh_id` INT(3) UNSIGNED NOT NULL,
756
- `vtsh_date` DATE NOT NULL,
757
- `vtsh_visits` INT(11) UNSIGNED NOT NULL DEFAULT 0
758
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
759
-
760
- $sqlQueries[] = "ALTER TABLE `ahc_searching_visits` CHANGE `vtsh_date` `vtsh_date` DATETIME NOT NULL";
761
-
762
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_refering_sites`
763
- (
764
- `rfr_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
765
- PRIMARY KEY (`rfr_id`),
766
- `rfr_site_name` VARCHAR(100) NOT NULL,
767
- `rfr_visits` INT(11) UNSIGNED NULL DEFAULT 0
768
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
769
-
770
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_recent_visitors`
771
- (
772
- `vtr_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
773
- PRIMARY KEY (`vtr_id`),
774
- `vtr_ip_address` VARCHAR(50) NOT NULL,
775
- `vtr_referer` VARCHAR(300) NULL,
776
- `srh_id` INT(3) UNSIGNED NULL,
777
- `bsr_id` INT(3) UNSIGNED NOT NULL,
778
- `ctr_id` INT(5) UNSIGNED NULL,
779
- `vtr_date` DATE NOT NULL,
780
- `vtr_time` TIME NOT NULL
781
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
782
-
783
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_keywords`
784
- (
785
- `kwd_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
786
- PRIMARY KEY (`kwd_id`),
787
- `kwd_ip_address` VARCHAR(50) NOT NULL,
788
- `kwd_keywords` VARCHAR(200) NOT NULL,
789
- `kwd_referer` VARCHAR(300) NOT NULL,
790
- `srh_id` INT(3) UNSIGNED NOT NULL,
791
- `ctr_id` INT(5) UNSIGNED NULL,
792
- `bsr_id` INT(3) UNSIGNED NOT NULL,
793
- `kwd_date` DATE NOT NULL,
794
- `kwd_time` TIME NOT NULL
795
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
796
-
797
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_title_traffic`
798
- (
799
- `til_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
800
- PRIMARY KEY (`til_id`),
801
- `til_page_id` VARCHAR(30) NOT NULL,
802
- `til_page_title` VARCHAR(100),
803
- `til_hits` INT(11) UNSIGNED NOT NULL
804
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
805
-
806
- $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_visits_time`
807
- (
808
- `vtm_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
809
- PRIMARY KEY (`vtm_id`),
810
- `vtm_time_from` TIME NOT NULL,
811
- `vtm_time_to` TIME NOT NULL,
812
- `vtm_visitors` INT(11) UNSIGNED NOT NULL DEFAULT 0,
813
- `vtm_visits` INT(11) UNSIGNED NOT NULL DEFAULT 0
814
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8";
815
-
816
-
817
- /* $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_city` varchar(230) NULL";
818
-
819
- $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_region` varchar(230) NULL";
820
- */
821
-
822
-
823
- foreach ($sqlQueries as $sql) {
824
- if ($wpdb->query($sql) === false) {
825
- return false;
826
- }
827
- }
828
- return true;
829
- }
830
-
831
- //--------------------------------------------
832
- /**
833
- * Inserts countries into ahcfree_countroes table
834
- *
835
- * @uses wpdb::insert()
836
- *
837
- * @param array $internetCountryCodes. internet codes and names of countries
838
- * @param array $contriesLatLng. LatLng of countries
839
- * @return boolean
840
- */
841
- function ahcfree_insert_countries_into_table($internetCountryCodes, $contriesLatLng) {
842
- global $wpdb;
843
- $c = 1;
844
- $length = count($internetCountryCodes);
845
- foreach ($internetCountryCodes as $internetCode => $countryName) {
846
- $ctr_latitude = $ctr_longitude = NULL;
847
- if (isset($contriesLatLng[$internetCode])) {
848
- $ctr_latitude = $contriesLatLng[$internetCode][0];
849
- $ctr_longitude = $contriesLatLng[$internetCode][1];
850
- }
851
- $result = $wpdb->insert('ahc_countries', array(
852
- 'ctr_name' => $countryName,
853
- 'ctr_internet_code' => $internetCode,
854
- 'ctr_latitude' => $ctr_latitude,
855
- 'ctr_longitude' => $ctr_longitude
856
- ), array(
857
- '%s', '%s', '%s', '%s'
858
- )
859
- );
860
- if ($result === false) {
861
- return false;
862
- }
863
- }
864
- return true;
865
- }
866
-
867
- //--------------------------------------------
868
- /**
869
- * Inserts search engines into ahc_search_engines table
870
- *
871
- * @uses wpdb::insert()
872
- * @uses wpdb::$insert_id
873
- *
874
- * @param array $searchEngines.
875
- * @return boolean
876
- */
877
- function ahcfree_insert_search_engines_into_table($searchEngines) {
878
- global $wpdb;
879
- foreach ($searchEngines as $se) {
880
- $result = $wpdb->insert('ahc_search_engines', array(
881
- 'srh_name' => $se['srh_name'],
882
- 'srh_query_parameter' => $se['srh_query_parameter'],
883
- 'srh_icon' => $se['srh_icon'],
884
- 'srh_identifier' => $se['srh_identifier']
885
- ), array(
886
- '%s', '%s', '%s', '%s'
887
- )
888
- );
889
- if ($result !== false) {
890
- $srh_id = $wpdb->insert_id;
891
- foreach ($se['crawlers'] as $crawler) {
892
- $result2 = $wpdb->insert('ahc_search_engine_crawlers', array(
893
- 'bot_name' => $crawler,
894
- 'srh_id' => $srh_id
895
- ), array(
896
- '%s', '%d'
897
- )
898
- );
899
- if ($result2 === false) {
900
- return false;
901
- }
902
- }
903
- } else {
904
- return false;
905
- }
906
- }
907
- return true;
908
- }
909
-
910
- //--------------------------------------------
911
- /**
912
- * Inserts browsers into ahc_browsers table
913
- *
914
- * @uses wpdb::insert()
915
- *
916
- * @param array $browsers
917
- * @return boolean
918
- */
919
- function ahcfree_insert_browsers_into_table($browsers) {
920
- global $wpdb;
921
- foreach ($browsers as $browser) {
922
- $result = $wpdb->insert('ahc_browsers', array(
923
- 'bsr_id' => $browser['bsr_id'],
924
- 'bsr_name' => $browser['bsr_name'],
925
- 'bsr_icon' => $browser['bsr_icon']
926
- ), array(
927
- '%d', '%s', '%s'
928
- )
929
- );
930
- if ($result === false) {
931
- return false;
932
- }
933
- }
934
- return true;
935
- }
936
-
937
- //--------------------------------------------
938
- /**
939
- * Inserts periods into ahc_visits_time table
940
- *
941
- * @uses wpdb::insert()
942
- *
943
- * @param array $dayHours
944
- * @return boolean
945
- */
946
- function ahcfree_insert_visit_times_into_table($dayHours) {
947
- global $wpdb;
948
- foreach ($dayHours as $t) {
949
- $result = $wpdb->insert('ahc_visits_time', array(
950
- 'vtm_time_from' => $t['vtm_time_from'],
951
- 'vtm_time_to' => $t['vtm_time_to'],
952
- 'vtm_visitors' => 0
953
- ), array(
954
- '%s', '%s', '%d'
955
- )
956
- );
957
- if ($result === false) {
958
- return false;
959
- }
960
- }
961
- return true;
962
- }
963
-
964
- //--------------------------------------------
965
- /**
966
- * Returns the first and last days of the week of the date you pass
967
- *
968
- * @param string $date
969
- * @param string $format Optional
970
- * @return array
971
- */
972
- function ahcfree_get_week_limits($date, $format = 'Y-m-d') {
973
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
974
- $beginingDay = new DateTime($date);
975
- $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
976
- $endingDay = new DateTime($date);
977
- $date = new DateTime($date);
978
- switch ($date->format('w')) {
979
- case 0: // sun
980
- //$beginingDay->modify('-1 day');
981
- $endingDay->modify('+6 day');
982
- break;
983
-
984
- case 1: // mon
985
- $beginingDay->modify('-1 day');
986
- $endingDay->modify('+5 day');
987
- break;
988
-
989
- case 2: // Tue
990
- $beginingDay->modify('-2 day');
991
- $endingDay->modify('+4 day');
992
- break;
993
-
994
- case 3: // Wed
995
- $beginingDay->modify('-3 day');
996
- $endingDay->modify('+3 day');
997
- break;
998
-
999
- case 4: // Thu
1000
- $beginingDay->modify('-4 day');
1001
- $endingDay->modify('+2 day');
1002
- break;
1003
-
1004
- case 6: // Fri
1005
- $beginingDay->modify('-5 day');
1006
- $endingDay->modify('+1 day');
1007
- break;
1008
- }
1009
- $day = date('w');
1010
-
1011
- $beginingDay->modify('-'.$day.' days');
1012
- $endingDay->modify('+'.(6-$day).' days');
1013
- return array(0 => $beginingDay->format($format), 1 => $endingDay->format($format));
1014
- }
1015
-
1016
- //--------------------------------------------
1017
- /**
1018
- * Return summary statistics of visitors and visits
1019
- *
1020
- * @return array
1021
- */
1022
- function ahcfree_get_summary_statistics() {
1023
- $arr = array();
1024
- $arr['today'] = ahcfree_get_visitors_visits_in_period('today');
1025
- $arr['yesterday'] = ahcfree_get_visitors_visits_in_period('yesterday');
1026
- $arr['week'] = ahcfree_get_visitors_visits_in_period('week');
1027
- $arr['month'] = ahcfree_get_visitors_visits_in_period('month');
1028
- $arr['year'] = ahcfree_get_visitors_visits_in_period('year');
1029
- $arr['total'] = ahcfree_get_visitors_visits_in_period();
1030
- return $arr;
1031
- }
1032
-
1033
- //--------------------------------------------
1034
- /**
1035
- * Return counts visitors and visits in certain day (today|yesterday), certain period(last week, last month, last year) or total
1036
- *
1037
- * @uses wpdb::prepare()
1038
- * @uses wpdb::get_results()
1039
- *
1040
- * @param string $period Optional
1041
- * @return mixed
1042
- */
1043
- function ahcfree_get_visitors_visits_in_period($period = 'total') {
1044
- global $wpdb;
1045
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1046
- $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1047
- $date = new DateTime();
1048
- $date->setTimezone($custom_timezone);
1049
- $sql = "SELECT SUM(vst_visitors) AS vst_visitors, SUM(vst_visits) AS vst_visits
1050
- FROM `ahc_visitors`
1051
- WHERE 1 = 1";
1052
- $results = false;
1053
- switch ($period) {
1054
- case 'today':
1055
- $sql .= " AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) = '". date("Y-m-d") ."'";
1056
- //$sql .= " AND DATE(vst_date) = DATE(NOW())";
1057
- $results = $wpdb->get_results($sql, OBJECT);
1058
- break;
1059
-
1060
- case 'yesterday':
1061
- $date->modify('-1 day');
1062
- $sql .= " AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) = %s";
1063
- $results = $wpdb->get_results($wpdb->prepare($sql, $date->format('Y-m-d')), OBJECT);
1064
- break;
1065
-
1066
- case 'week':
1067
- $limits = ahcfree_get_week_limits($date->format('Y-m-d'));
1068
- $sql .= " AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= %s AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= %s";
1069
- $results = $wpdb->get_results($wpdb->prepare($sql, $limits[0], $limits[1]), OBJECT);
1070
- break;
1071
-
1072
- case 'month':
1073
- $sql .= " AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= %s AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= %s";
1074
- $results = $wpdb->get_results($wpdb->prepare($sql, $date->format('Y-m-01'), $date->format('Y-m-d')), OBJECT);
1075
- break;
1076
-
1077
- case 'year':
1078
- $sql .= " AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= %s AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= %s";
1079
- $results = $wpdb->get_results($wpdb->prepare($sql, $date->format('Y-01-01'), $date->format('Y-12-31')), OBJECT);
1080
- break;
1081
-
1082
- default:
1083
- $results = $wpdb->get_results($sql, OBJECT);
1084
- }
1085
- //echo $wpdb->last_query.'<br />';
1086
- if ($results !== false) {
1087
- return array(
1088
- 'visitors' => (empty($results[0]->vst_visitors) ? 0 : $results[0]->vst_visitors),
1089
- 'visits' => (empty($results[0]->vst_visits) ? 0 : $results[0]->vst_visits)
1090
- );
1091
- } else {
1092
- return false;
1093
- }
1094
- }
1095
-
1096
- //--------------------------------------------
1097
- /**
1098
- * Return visits in a period from today
1099
- *
1100
- * @uses wpdb::prepare()
1101
- * @uses wpdb::get_results()
1102
- *
1103
- * @return array
1104
- */
1105
- function ahcfree_get_visitors_visits_by_date() {
1106
- global $wpdb;
1107
- $lastDays = AHC_VISITORS_VISITS_LIMIT - 1;
1108
- $response = array();
1109
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1110
- $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1111
- $beginning = new DateTime();
1112
- $beginning->setTimezone($custom_timezone);
1113
- $beginning->modify('-' . $lastDays . ' day');
1114
-
1115
- $sql = "SELECT DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) as vst_date, vst_visitors, vst_visits
1116
- FROM ahc_visitors
1117
- WHERE DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1118
-
1119
- $results = $wpdb->get_results($wpdb->prepare($sql, $beginning->format('Y-m-d')), OBJECT);
1120
- if ($results !== false) {
1121
- $response['success'] = true;
1122
- $response['date'] = array();
1123
- for ($i = count($results); $i < $lastDays; $i++) {
1124
- $beginning->modify('+1 day');
1125
- $response['data']['dates'][] = $beginning->format('d/m');
1126
- $response['data']['visitors'][] = 0;
1127
- $response['data']['visits'][] = 0;
1128
- }
1129
-
1130
- foreach ($results as $r) {
1131
- $hitDate = new DateTime($r->vst_date);
1132
- //$hitDate->setTimezone($custom_timezone);
1133
- $response['data']['dates'][] = $hitDate->format('d/m');
1134
- $response['data']['visitors'][] = $r->vst_visitors;
1135
- $response['data']['visits'][] = $r->vst_visits;
1136
- }
1137
- } else {
1138
- $response['success'] = false;
1139
- }
1140
- return $response;
1141
- }
1142
-
1143
- function ahcfree_get_visitors_by_date() {
1144
- global $wpdb;
1145
- $lastDays = AHC_VISITORS_VISITS_LIMIT;
1146
- $response = array();
1147
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1148
- $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1149
- $beginning = new DateTime();
1150
- $beginning->setTimezone($custom_timezone);
1151
- $beginning->modify('-' . $lastDays . ' day');
1152
-
1153
-
1154
- $sql = "SELECT DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) as vst_date, vst_visitors
1155
- FROM ahc_visitors
1156
- WHERE DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1157
-
1158
- $results = $wpdb->get_results($wpdb->prepare($sql, $beginning->format('Y-m-d')), OBJECT);
1159
-
1160
- if ($results !== false) {
1161
- for ($i = count($results); $i < $lastDays; $i++) {
1162
- $beginning->modify('+1 day');
1163
- $xx .= "['" . $beginning->format('Y-m-d') . "', 0], ";
1164
- }
1165
- foreach ($results as $r) {
1166
-
1167
- $hitDate = new DateTime($r->vst_date);
1168
- //$hitDate->setTimezone($custom_timezone);
1169
- $xx .= "['" . $hitDate->format('Y-m-d') . "', " . $r->vst_visitors . "], ";
1170
- }
1171
- }
1172
- return '[' . $xx . ']';
1173
- }
1174
-
1175
- function ahcfree_get_visits_by_date() {
1176
- global $wpdb;
1177
- $lastDays = AHC_VISITORS_VISITS_LIMIT;
1178
- $response = array();
1179
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1180
- $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1181
- $beginning = new DateTime();
1182
- $beginning->setTimezone($custom_timezone);
1183
- $beginning->modify('-' . $lastDays . ' day');
1184
-
1185
- $sql = "SELECT DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) as vst_date, vst_visits
1186
- FROM ahc_visitors
1187
- WHERE DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1188
-
1189
-
1190
- $results = $wpdb->get_results($wpdb->prepare($sql, $beginning->format('Y-m-d')), OBJECT);
1191
- if ($results !== false) {
1192
- for ($i = count($results); $i < $lastDays; $i++) {
1193
- $beginning->modify('+1 day');
1194
- $x .= "['" . $beginning->format('Y-m-d') . "', 0], ";
1195
- }
1196
- foreach ($results as $r) {
1197
- $hitDate = new DateTime($r->vst_date);
1198
- //$hitDate->setTimezone($custom_timezone);
1199
- $x .= "['" . $hitDate->format('Y-m-d') . "', " . $r->vst_visits . "], ";
1200
- }
1201
- }
1202
- return '[' . $x . ']';
1203
- }
1204
-
1205
-
1206
-
1207
- //--------------------------------------------
1208
- /**
1209
- * Returns the total visits by search engines
1210
- *
1211
- * @uses wpdb::get_results()
1212
- *
1213
- * @return mixed
1214
- */
1215
- function ahcfree_get_total_visits_by_search_engines() {
1216
- global $wpdb;
1217
- $result = $wpdb->get_results("SELECT SUM(vtsh_visits) AS total FROM ahc_searching_visits", OBJECT);
1218
- if ($result !== false) {
1219
- return $result[0]->total;
1220
- }
1221
- return false;
1222
- }
1223
-
1224
- //--------------------------------------------
1225
- /**
1226
- * Return counts visits happened by search engine result in certain day (today|yesterday), certain period(last week, last month, last year) or total
1227
- *
1228
- * @uses wpdb::prepare()
1229
- * @uses wpdb::get_results()
1230
- *
1231
- * @param string $period Optional
1232
- * @return mixed
1233
- */
1234
- function ahcfree_get_hits_search_engines_referers($period = 'total') {
1235
- global $wpdb;
1236
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1237
- $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1238
- $date = new DateTime();
1239
- $date->setTimezone($custom_timezone);
1240
- $sql = "SELECT srh_id, vtsh_visits
1241
- FROM `ahc_searching_visits`";
1242
- $results = false;
1243
- switch ($period) {
1244
- case 'today':
1245
- $sql .= " WHERE DATE(CONVERT_TZ(vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) = DATE(CONVERT_TZ('". date('Y-m-d H:i:s') ."', '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1246
- $results = $wpdb->get_results($sql, OBJECT);
1247
- break;
1248
-
1249
- case 'yesterday':
1250
- $date->modify('-1 day');
1251
- $sql .= " WHERE DATE(CONVERT_TZ(vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) = DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1252
- $results = $wpdb->get_results($wpdb->prepare($sql, $date->format('Y-m-d')), OBJECT);
1253
- break;
1254
-
1255
- case 'week':
1256
- $limits = ahcfree_get_week_limits($date->format('Y-m-d'));
1257
- $sql .= " WHERE DATE(CONVERT_TZ(vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) AND DATE(CONVERT_TZ(vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1258
- $results = $wpdb->get_results($wpdb->prepare($sql, $limits[0], $limits[1]), OBJECT);
1259
- break;
1260
-
1261
- case 'month':
1262
- $sql .= " WHERE DATE(CONVERT_TZ(vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ('" . $date->format('Y-m-01') . "', '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) AND DATE(CONVERT_TZ(vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= DATE(CONVERT_TZ('" . $date->format('Y-m-t') . "', '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1263
- $results = $wpdb->get_results($wpdb->prepare($sql, $limits[0], $limits[1]), OBJECT);
1264
- break;
1265
-
1266
- case 'year':
1267
- $sql .= " WHERE DATE(CONVERT_TZ(vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) AND DATE(CONVERT_TZ(vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1268
- $results = $wpdb->get_results($wpdb->prepare($sql, $date->format('Y-01-01'), $date->format('Y-12-31')), OBJECT);
1269
- break;
1270
-
1271
- default:
1272
- }
1273
-
1274
- $hitsReferers = array();
1275
- if ($results !== false) {
1276
- foreach ($results as $r) {
1277
- $hitsReferers[$r->srh_id] = $r->vtsh_visits;
1278
- }
1279
- return $hitsReferers;
1280
- }
1281
- return false;
1282
- }
1283
-
1284
- //--------------------------------------------
1285
- /**
1286
- * Retrieves all search engines
1287
- *
1288
- * @uses wpdb::get_results()
1289
- *
1290
- * @return mixed
1291
- */
1292
- function ahcfree_get_all_search_engines() {
1293
- global $wpdb;
1294
- $sql = "SELECT `srh_id`, `srh_name`, `srh_icon` FROM `ahc_search_engines`";
1295
- $searchEngines = array();
1296
- $c = 0;
1297
- $results = $wpdb->get_results($sql, OBJECT);
1298
- if ($results !== false) {
1299
- foreach ($results as $re) {
1300
- $searchEngines[$c]['srh_id'] = $re->srh_id;
1301
- $searchEngines[$c]['srh_name'] = $re->srh_name;
1302
- $searchEngines[$c]['srh_icon'] = $re->srh_icon;
1303
- $c++;
1304
- }
1305
- return $searchEngines;
1306
- }
1307
- return false;
1308
- }
1309
-
1310
- //--------------------------------------------
1311
- /**
1312
- * Retrieves count of visits order by browsers
1313
- *
1314
- * @uses wpdb::get_results()
1315
- *
1316
- * @return array
1317
- */
1318
- function ahcfree_get_browsers_hits_counts() {
1319
- global $wpdb;
1320
- $sql = "SELECT `bsr_id`, `bsr_name`, `bsr_visits`
1321
- FROM `ahc_browsers`
1322
- WHERE `bsr_visits` > 0";
1323
- $results = $wpdb->get_results($sql, OBJECT);
1324
- $response = array();
1325
- if ($results !== false) {
1326
- $response['success'] = true;
1327
- $response['data'] = array();
1328
- $c = 0;
1329
- foreach ($results as $bsr) {
1330
- $response['data'][$c]['bsr_id'] = $bsr->bsr_id;
1331
- $response['data'][$c]['bsr_name'] = $bsr->bsr_name;
1332
- $response['data'][$c]['hits'] = $bsr->bsr_visits;
1333
- $c++;
1334
- }
1335
- } else {
1336
- $response['success'] = false;
1337
- }
1338
- return $response;
1339
- }
1340
-
1341
- //--------------------------------------------
1342
- /**
1343
- * Return visitors visits that came from search engine in a period from today
1344
- *
1345
- * @uses wpdb::prepare()
1346
- * @uses wpdb::get_results()
1347
- *
1348
- * @return array
1349
- */
1350
-
1351
-
1352
- function ahcfree_get_serch_visits_by_date() {
1353
- global $wpdb;
1354
-
1355
- $sql = "SELECT srh_name, sum(vtsh_visits) as vtsh_visits, ase.srh_id FROM ahc_searching_visits asv, ahc_search_engines ase where asv.srh_id = ase.srh_id group by ase.srh_id";
1356
-
1357
-
1358
-
1359
- $results = $wpdb->get_results($sql, OBJECT);
1360
- $response = array();
1361
- if ($results !== false) {
1362
- $response['success'] = true;
1363
- $response['data'] = array();
1364
- $c = 0;
1365
- foreach ($results as $bsr) {
1366
- $response['data'][$c]['bsr_id'] = $bsr->srh_id;
1367
- $response['data'][$c]['bsr_name'] = $bsr->srh_name;
1368
- $response['data'][$c]['hits'] = $bsr->vtsh_visits;
1369
- $c++;
1370
- }
1371
- } else {
1372
- $response['success'] = false;
1373
- }
1374
-
1375
- return $response;
1376
- }
1377
-
1378
- //--------------------------------------------
1379
- /**
1380
- * Retrieves top referring sites
1381
- *
1382
- * @uses wpdb::prepare()
1383
- * @uses wpdb::get_results()
1384
- *
1385
- * @return mixed
1386
- */
1387
- function ahcfree_get_top_refering_sites() {
1388
- global $wpdb;
1389
- $sql = "SELECT rfr_site_name, rfr_visits
1390
- FROM `ahc_refering_sites`
1391
- ORDER BY rfr_visits DESC
1392
- LIMIT %d OFFSET 0";
1393
- $results = $wpdb->get_results($wpdb->prepare($sql, AHCFREE_TOP_REFERING_SITES_LIMIT), OBJECT);
1394
- if ($results !== false) {
1395
- $arr = array();
1396
- $c = 0;
1397
- foreach ($results as $referer) {
1398
- $arr[$c]['site_name'] = $referer->rfr_site_name;
1399
- $arr[$c]['total_hits'] = $referer->rfr_visits;
1400
- $c++;
1401
- }
1402
- return $arr;
1403
- } else {
1404
- return false;
1405
- }
1406
- }
1407
-
1408
- //--------------------------------------------
1409
- /**
1410
- * Retrieves countries related to visits
1411
- *
1412
- * @uses wpdb::prepare()
1413
- * @uses wpdb::get_results()
1414
- *
1415
- * @return mixed
1416
- */
1417
- function ahcfree_get_top_countries( $limit = 0 ) {
1418
- global $wpdb;
1419
- if( $limit == 0 ){
1420
- $limit = AHCFREE_TOP_COUNTRIES_LIMIT;
1421
- }
1422
-
1423
- $sql = "SELECT ctr_name, ctr_internet_code, ctr_visitors, ctr_visits
1424
- FROM `ahc_countries` WHERE ctr_visits > 0
1425
- ORDER BY ctr_visitors DESC
1426
- LIMIT %d OFFSET 0";
1427
-
1428
- $results = $wpdb->get_results($wpdb->prepare($sql, $limit), OBJECT);
1429
- $response = array();
1430
- if ($results !== false) {
1431
- $response['success'] = true;
1432
- $response['data'] = array();
1433
- $c = 0;
1434
- foreach ($results as $ctr) {
1435
- $response['data'][$c]['ctr_name'] = $ctr->ctr_name;
1436
- $response['data'][$c]['ctr_internet_code'] = $ctr->ctr_internet_code;
1437
- $response['data'][$c]['visitors'] = $ctr->ctr_visitors;
1438
- $response['data'][$c]['visits'] = $ctr->ctr_visits;
1439
- $c++;
1440
- }
1441
- } else {
1442
- $response['success'] = false;
1443
- }
1444
-
1445
- return $response;
1446
- }
1447
-
1448
- //--------------------------------------------
1449
- /**
1450
- * Retrieves countries related to visits
1451
- *
1452
- * @uses wpdb::prepare()
1453
- * @uses wpdb::get_results()
1454
- *
1455
- * @return mixed
1456
- */
1457
- function ahcfree_get_vsitors_by_country() {
1458
- global $wpdb;
1459
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1460
- $sql = "select tot.ctr_name, tot.ctr_internet_code, tot.total from (SELECT c.ctr_name, c.ctr_internet_code, count(1) as total
1461
- FROM ahc_recent_visitors v, ahc_countries c where v.ctr_id = c.ctr_id and DATE(CONVERT_TZ(vtr_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = DATE(CONVERT_TZ(NOW(),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) group by ctr_name) as tot order by tot.total desc";
1462
-
1463
- $results = $wpdb->get_results($wpdb->prepare($sql, AHCFREE_TOP_COUNTRIES_LIMIT), OBJECT);
1464
- if ($results !== false) {
1465
- $arr = array();
1466
- $c = 0;
1467
- foreach ($results as $ctr) {
1468
- if ($ctr->total > 1) {
1469
- $arr[$c]['ctr_name'] = $ctr->ctr_name;
1470
- $arr[$c]['ctr_internet_code'] = $ctr->ctr_internet_code;
1471
- $arr[$c]['total'] = $ctr->total;
1472
- } else {
1473
- $arr[9999]['ctr_name'] = 'others';
1474
- $arr[9999]['ctr_internet_code'] = 'XX';
1475
- $arr[9999]['total'] += 1;
1476
- }
1477
- $c++;
1478
- }
1479
- return $arr;
1480
- } else {
1481
- return false;
1482
- }
1483
- }
1484
-
1485
- //--------------------------------------------
1486
- /**
1487
- * Retrieves recent visitors
1488
- *
1489
- * @uses wpdb::prepare()
1490
- * @uses wpdb::get_results()
1491
- *
1492
- * @return mixed
1493
- */
1494
- function ahcfree_get_recent_visitors() {
1495
- global $wpdb, $_SERVER;
1496
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1497
- $sql_query = "SELECT v.vtr_id, v.vtr_ip_address, v.vtr_referer, DATE_FORMAT(CONVERT_TZ(CONCAT_WS(' ',v.vtr_date,v.vtr_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'), '%Y-%m-%d') as vtr_date, DATE_FORMAT(CONVERT_TZ(CONCAT_WS(' ',v.vtr_date,v.vtr_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'), '%H:%i:%s') as vtr_time, v.ahc_city, v.ahc_region,
1498
- c.ctr_name, c.ctr_internet_code, b.bsr_name, b.bsr_icon
1499
- FROM `ahc_recent_visitors` AS v
1500
- LEFT JOIN `ahc_countries` AS c ON v.ctr_id = c.ctr_id
1501
- LEFT JOIN `ahc_browsers` AS b ON v.bsr_id = b.bsr_id
1502
- WHERE v.vtr_ip_address NOT LIKE 'UNKNOWN%%'
1503
- ORDER BY v.vtr_id DESC
1504
- LIMIT " . AHC_RECENT_VISITORS_LIMIT . " OFFSET 0";
1505
-
1506
- /* $sql_query = "SELECT v.vtr_id, v.vtr_ip_address, v.vtr_referer, DATE_FORMAT(CONVERT_TZ(v.vtr_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'), '%Y-%m-%d') as vtr_date, DATE_FORMAT(CONVERT_TZ(v.vtr_time,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'), '%H:%i:%s') as vtr_time, v.ahc_city, v.ahc_region,
1507
- c.ctr_name, c.ctr_internet_code, b.bsr_name, b.bsr_icon
1508
- FROM `ahc_recent_visitors` AS v
1509
- LEFT JOIN `ahc_countries` AS c ON v.ctr_id = c.ctr_id
1510
- LEFT JOIN `ahc_browsers` AS b ON v.bsr_id = b.bsr_id
1511
- WHERE v.vtr_ip_address NOT LIKE 'UNKNOWN%%'
1512
- ORDER BY v.vtr_id DESC
1513
- LIMIT " . AHC_RECENT_VISITORS_LIMIT . " OFFSET 0"; */
1514
-
1515
- $results = $wpdb->get_results($sql_query);
1516
- if ($results !== false) {
1517
- $arr = array();
1518
- $c = 0;
1519
- if (is_array($results)) {
1520
- foreach ($results as $hit) {
1521
- if (strlen($hit->vtr_ip_address) < 17) {
1522
- $arr[$c]['hit_id'] = $hit->vtr_id;
1523
- $arr[$c]['hit_ip_address'] = $hit->vtr_ip_address;
1524
- $arr[$c]['hit_referer'] = (parse_url($hit->vtr_referer, PHP_URL_HOST) == $_SERVER['SERVER_NAME']) ? '' : rawurldecode($hit->vtr_referer);
1525
- $arr[$c]['hit_date'] = $hit->vtr_date;
1526
- $arr[$c]['hit_time'] = $hit->vtr_time;
1527
- $arr[$c]['ctr_name'] = $hit->ctr_name;
1528
- $arr[$c]['ctr_internet_code'] = $hit->ctr_internet_code;
1529
- $arr[$c]['bsr_name'] = $hit->bsr_name;
1530
- $arr[$c]['bsr_icon'] = $hit->bsr_icon;
1531
- $arr[$c]['ahc_city'] = $hit->ahc_city;
1532
- $arr[$c]['ahc_region'] = $hit->ahc_region;
1533
-
1534
- $c++;
1535
- }
1536
- }
1537
- }
1538
- return $arr;
1539
- } else {
1540
- return false;
1541
- }
1542
- }
1543
-
1544
- //--------------------------------------------
1545
- /**
1546
- * Retrieves latest of key words used in search
1547
- *
1548
- * @uses wpdb::prepare()
1549
- * @uses wpdb::get_results()
1550
- *
1551
- * @return mixed
1552
- */
1553
- function ahcfree_get_latest_search_key_words_used() {
1554
- global $wpdb;
1555
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1556
- $sql = "SELECT k.kwd_ip_address, k.kwd_referer, k.kwd_keywords, CONVERT_TZ(CONCAT_WS(' ',k.kwd_date,k.kwd_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') as kwd_date, CONVERT_TZ(k.kwd_time,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') as kwd_time, k.ctr_id,
1557
- c.ctr_name, c.ctr_internet_code, b.bsr_name, b.bsr_icon, s.srh_name, s.srh_icon
1558
- FROM `ahc_keywords` AS k
1559
- LEFT JOIN `ahc_countries` AS c ON k.ctr_id = c.ctr_id
1560
- JOIN `ahc_browsers` AS b ON k.bsr_id = b.bsr_id
1561
- JOIN `ahc_search_engines` AS s on k.srh_id = s.srh_id
1562
- WHERE k.kwd_ip_address != 'UNKNOWN'
1563
- ORDER BY k.kwd_date DESC, k.kwd_time DESC
1564
- LIMIT %d OFFSET 0";
1565
-
1566
- $results = $wpdb->get_results($wpdb->prepare($sql, AHCFREE_RECENT_KEYWORDS_LIMIT), OBJECT);
1567
- if ($results !== false) {
1568
- $arr = array();
1569
- $c = 0;
1570
- foreach ($results as $re) {
1571
-
1572
- $arr[$c]['hit_referer'] = rawurldecode($re->kwd_referer);
1573
- $arr[$c]['hit_search_words'] = $re->kwd_keywords;
1574
- $arr[$c]['hit_date'] = $re->kwd_date;
1575
- $arr[$c]['hit_time'] = $re->kwd_time;
1576
- $arr[$c]['hit_ip_address'] = $re->kwd_ip_address;
1577
- $arr[$c]['ctr_name'] = $re->ctr_name;
1578
- $arr[$c]['ctr_internet_code'] = $re->ctr_internet_code;
1579
- $arr[$c]['bsr_name'] = $re->bsr_name;
1580
- $arr[$c]['bsr_icon'] = $re->bsr_icon;
1581
- $arr[$c]['srh_name'] = $re->srh_name;
1582
- $arr[$c]['srh_icon'] = $re->srh_icon;
1583
- $c++;
1584
- }
1585
- return $arr;
1586
- } else {
1587
- return false;
1588
- }
1589
- }
1590
-
1591
- //--------------------------------------------
1592
- /**
1593
- * Is in login page
1594
- *
1595
- * @return boolean
1596
- */
1597
- function ahcfree_is_login_page() {
1598
- global $Globalsahcfree;
1599
-
1600
- return in_array($Globalsahcfree['pagenow'], array('wp-login.php', 'wp-register.php'));
1601
- }
1602
-
1603
- //--------------------------------------------
1604
- /**
1605
- * Retrieves today visitors data, for google map
1606
- *
1607
- * @uses wpdb::get_results()
1608
- *
1609
- * @return array
1610
- */
1611
- function ahcfree_get_today_visitors_for_map() {
1612
- global $wpdb;
1613
- $sql = "SELECT hits.visitors, hits.ctr_id,
1614
- c.ctr_name, c.ctr_internet_code, c.ctr_latitude, c.ctr_longitude FROM (
1615
- SELECT COUNT(v.visitor) AS visitors, v.ctr_id FROM (
1616
- SELECT ctr_id, 1 AS visitor FROM `ahc_hits`
1617
- WHERE ctr_id IS NOT NULL AND hit_ip_address NOT LIKE 'UNKNOWN%'
1618
- GROUP BY hit_ip_address
1619
- ) AS v
1620
- GROUP BY ctr_id) AS hits
1621
- JOIN `ahc_countries` AS c ON hits.ctr_id = c.ctr_id
1622
- WHERE c.ctr_latitude IS NOT NULL AND c.ctr_latitude <> 0 AND c.ctr_longitude IS NOT NULL AND c.ctr_longitude <> 0";
1623
-
1624
- $results = $wpdb->get_results($sql, OBJECT);
1625
- $response = array();
1626
- if ($results !== false) {
1627
- $response['success'] = true;
1628
- $response['data'] = array();
1629
- if (is_array($results) && isset($results[0]->visitors) && !empty($results[0]->visitors)) {
1630
- foreach ($results as $r) {
1631
- $response['data'][$r->ctr_id]['visitors'] = $r->visitors;
1632
- $response['data'][$r->ctr_id]['ctr_name'] = $r->ctr_name;
1633
- $response['data'][$r->ctr_id]['ctr_internet_code'] = $r->ctr_internet_code;
1634
- $response['data'][$r->ctr_id]['ctr_latitude'] = $r->ctr_latitude;
1635
- $response['data'][$r->ctr_id]['ctr_longitude'] = $r->ctr_longitude;
1636
- }
1637
- }
1638
- } else {
1639
- $response['success'] = false;
1640
- }
1641
- return $response;
1642
- }
1643
-
1644
- /**
1645
- * Retrieves online visitors data, for google map
1646
- *
1647
- * @uses wpdb::get_results()
1648
- *
1649
- * @return array
1650
- */
1651
- function ahcfree_get_online_visitors_for_map() {
1652
- global $wpdb;
1653
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1654
- $sql = "SELECT hits.visitors, hits.ctr_id,
1655
- c.ctr_name, c.ctr_internet_code, c.ctr_latitude, c.ctr_longitude FROM (
1656
- SELECT COUNT(v.visitor) AS visitors, v.ctr_id FROM (
1657
- SELECT ctr_id, 1 AS visitor FROM `ahc_hits`
1658
- WHERE ctr_id IS NOT NULL AND hit_ip_address NOT LIKE 'UNKNOWN%' and hit_date = DATE( CONVERT_TZ( '". date("Y-m-d H:i:s") ."' ,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') ) and TIME( CONVERT_TZ(hit_time,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') ) between TIME(CONVERT_TZ('". date("Y-m-d H:i:s") ."','" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') - INTERVAL 60 SECOND) and TIME( CONVERT_TZ('". date("Y-m-d H:i:s") ."','" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') )
1659
- GROUP BY hit_ip_address
1660
- ) AS v
1661
- GROUP BY ctr_id) AS hits
1662
- JOIN `ahc_countries` AS c ON hits.ctr_id = c.ctr_id
1663
- WHERE c.ctr_latitude IS NOT NULL AND c.ctr_latitude <> 0 AND c.ctr_longitude IS NOT NULL AND c.ctr_longitude <> 0 ";
1664
-
1665
- $results = $wpdb->get_results($sql, OBJECT);
1666
- $response = array();
1667
- if ($results !== false) {
1668
- $response['success'] = true;
1669
- $response['data'] = array();
1670
- if (is_array($results) && isset($results[0]->visitors) && !empty($results[0]->visitors)) {
1671
- foreach ($results as $r) {
1672
- $response['data'][$r->ctr_id]['visitors'] = $r->visitors;
1673
- $response['data'][$r->ctr_id]['ctr_name'] = $r->ctr_name;
1674
- $response['data'][$r->ctr_id]['ctr_internet_code'] = $r->ctr_internet_code;
1675
- $response['data'][$r->ctr_id]['ctr_latitude'] = $r->ctr_latitude;
1676
- $response['data'][$r->ctr_id]['ctr_longitude'] = $r->ctr_longitude;
1677
- }
1678
- }
1679
- } else {
1680
- $response['success'] = false;
1681
- }
1682
- return $response;
1683
- }
1684
-
1685
- //--------------------------------------------
1686
- /**
1687
- * Detect if the visitor is search engine bot
1688
- *
1689
- * @uses wpdb::get_results()
1690
- *
1691
- * @return boolean
1692
- */
1693
- function ahcfree_is_search_engine_bot() {
1694
- global $wpdb, $_SERVER;
1695
- $results = $wpdb->get_results("SELECT `bot_name` FROM `ahc_search_engine_crawlers`", OBJECT);
1696
- foreach ($results as $crawler) {
1697
- if (stripos($_SERVER['HTTP_USER_AGENT'], $crawler->bot_name) !== false) {
1698
- return true;
1699
- }
1700
- }
1701
-
1702
- if (stripos($_SERVER['REQUEST_URI'], 'robots.txt') !== false) {
1703
- return true;
1704
- }
1705
-
1706
- if (stripos($_SERVER['REQUEST_URI'], 'Bot') !== false) {
1707
- return true;
1708
- }
1709
-
1710
- if (stripos($_SERVER['REQUEST_URI'], 'bot') !== false) {
1711
- return true;
1712
- }
1713
- return false;
1714
- }
1715
-
1716
- //--------------------------------------------
1717
- /**
1718
- * Detect if the visitor is WordPress bot
1719
- *
1720
- * @return boolean
1721
- */
1722
- function ahcfree_is_wordpress_bot() {
1723
- global $_SERVER;
1724
- if (stripos($_SERVER['HTTP_USER_AGENT'], 'WordPress') !== false) {
1725
- return true;
1726
- }
1727
- return false;
1728
- }
1729
-
1730
- //--------------------------------------------
1731
- /**
1732
- * Detects post id, post title and post type of current page
1733
- *
1734
- * @uses wpdb::prepare()
1735
- * @uses wpdb::get_results()
1736
- *
1737
- * @param object $query. this object is passed to the callback function of "parse_query" hooked action
1738
- * @return mixed
1739
- */
1740
- function ahcfree_detect_requested_page($query) {
1741
- global $wpdb;
1742
- $vars = $query->query_vars;
1743
- if (isset($vars['p']) && !empty($vars['p'])) {
1744
- $result = $wpdb->get_results($wpdb->prepare("SELECT post_title FROM " . $wpdb->prefix . "posts WHERE ID = %d ", $vars['p']));
1745
- if ($result !== false && $wpdb->num_rows > 0) {
1746
- return array('page_id' => $vars['p'], 'page_title' => $result[0]->post_title, 'post_type' => 'post');
1747
- }
1748
- } else if (isset($vars['name']) && !empty($vars['name'])) {
1749
- $result = $wpdb->get_results($wpdb->prepare("SELECT ID, post_title FROM " . $wpdb->prefix . "posts WHERE post_name = %s ", $vars['name']));
1750
- if ($result !== false && $wpdb->num_rows > 0) {
1751
- return array('page_id' => $result[0]->ID, 'page_title' => $result[0]->post_title, 'post_type' => 'post');
1752
- }
1753
- } else if (isset($vars['pagename']) && !empty($vars['pagename'])) {
1754
- $result = $wpdb->get_results($wpdb->prepare("SELECT ID, post_title FROM " . $wpdb->prefix . "posts WHERE post_name = %s AND post_type = %s", ahcfree_get_subpage_name($vars['pagename']), 'page'));
1755
- if ($result !== false && $wpdb->num_rows > 0) {
1756
- return array('page_id' => $result[0]->ID, 'page_title' => $result[0]->post_title, 'post_type' => 'page');
1757
- }
1758
- } else if (isset($vars['page_id']) && !empty($vars['page_id'])) {
1759
- $result = $wpdb->get_results($wpdb->prepare("SELECT post_title FROM " . $wpdb->prefix . "posts WHERE ID = %s AND post_type = %s", $vars['page_id'], 'page'));
1760
- if ($result !== false && $wpdb->num_rows > 0) {
1761
- return array('page_id' => $page_id, 'page_title' => $result[0]->post_title, 'post_type' => 'page');
1762
- }
1763
- } else {
1764
- return array('page_id' => 'HOMEPAGE', 'page_title' => NULL, 'post_type' => NULL);
1765
- }
1766
- }
1767
-
1768
- function ahcfree_get_subpage_name($page_name) {
1769
- $sub_name = strrchr($page_name, '/');
1770
- if (!$sub_name) {
1771
- return $page_name;
1772
- }
1773
- return substr($sub_name, 1);
1774
- }
1775
-
1776
- //--------------------------------------------
1777
- function ahcfree_sanitizing($unsafe_val,$type='text')
1778
- {
1779
-
1780
-
1781
- switch ($type) {
1782
- case 'text': return sanitize_text_field($unsafe_val);
1783
- break;
1784
-
1785
- case 'int': return intval($unsafe_val);
1786
- break;
1787
-
1788
- case 'email': return sanitize_email($unsafe_val);
1789
- break;
1790
-
1791
- case 'filename': return sanitize_file_name($unsafe_val);
1792
- break;
1793
-
1794
- case 'title': return sanitize_title($unsafe_val);
1795
- break;
1796
-
1797
- case 'url': return esc_url($unsafe_val);
1798
- break;
1799
-
1800
- default:
1801
- return sanitize_text_field($unsafe_val);
1802
-
1803
- }
1804
- }
1805
-
1806
-
1807
- function ahcfree_track_visitor()
1808
- {
1809
- $exclude_ips = AHCFREE_EXCLUDE_IPS;
1810
- if ($exclude_ips == '' or $exclude_ips == '') {
1811
- $exclude_ips = array();
1812
- }
1813
- if (AHCFREE_EXCLUDE_IPS != NULL && AHCFREE_EXCLUDE_IPS != '') {
1814
- $exclude_ips = explode("\n", $exclude_ips);
1815
- }
1816
-
1817
- if (ahcfree_should_track_visitor() && !ahcfree_is_login_page() && !ahcfree_is_search_engine_bot() && !ahcfree_is_wordpress_bot()) {
1818
- if (!in_array(ahcfree_get_client_ip_address(), $exclude_ips)) {
1819
-
1820
- $page_id = ahcfree_sanitizing($_POST['page_id'], 'int');
1821
- $page_title = ahcfree_sanitizing($_POST['page_title']);
1822
- $post_type = ahcfree_sanitizing($_POST['post_type']);
1823
- $_SERVER['HTTP_REFERER'] = ahcfree_sanitizing($_POST['referer']);
1824
- $_SERVER['HTTP_USER_AGENT'] = ahcfree_sanitizing($_POST['useragent']);
1825
- $_SERVER['SERVER_NAME'] = ahcfree_sanitizing($_POST['servername']);
1826
- $_SERVER['HTTP_HOST'] = ahcfree_sanitizing($_POST['hostname']);
1827
- $_SERVER['REQUEST_URI'] = ahcfree_sanitizing($_POST['request_uri']);
1828
-
1829
- $hitsCounter = new AHCFree_WPHitsCounterPro($page_id, $page_title, $post_type);
1830
- $hitsCounter->traceVisitorHit();
1831
- }
1832
- }
1833
-
1834
- die;
1835
- }
1836
-
1837
-
1838
-
1839
- //--------------------------------------------
1840
- /**
1841
- * Ceil for decimal numbers with precision
1842
- *
1843
- * @param float $number
1844
- * @param integer $precision
1845
- * @param string $separator
1846
- * @return float
1847
- */
1848
- function ahcfree_ceil_dec($number, $precision, $separator) {
1849
- if (strpos($number, '.') !== false) {
1850
- $numberpart = explode($separator, $number);
1851
- $numberpart[1] = substr_replace($numberpart[1], $separator, $precision, 0);
1852
- if ($numberpart[0] >= 0) {
1853
- $numberpart[1] = ceil($numberpart[1]);
1854
- } else {
1855
- $numberpart[1] = floor($numberpart[1]);
1856
- }
1857
-
1858
- $ceil_number = array($numberpart[0], $numberpart[1]);
1859
- return implode($separator, $ceil_number);
1860
- }
1861
- return $number;
1862
- }
1863
-
1864
- //--------------------------------------------
1865
- /**
1866
- * Retrieve sum visits by post title
1867
- *
1868
- * @uses wpdb::prepare()
1869
- * @uses wpdb::get_results()
1870
- *
1871
- * @return mixed
1872
- */
1873
- function ahcfree_get_traffic_by_title() {
1874
- global $wpdb;
1875
- $sql1 = "SELECT SUM(hits) AS sm FROM (
1876
- SELECT SUM(til_hits) AS hits
1877
- FROM ahc_title_traffic
1878
- GROUP BY til_page_id
1879
- ) myTable";
1880
-
1881
- $sql2 = "SELECT til_page_id, til_page_title, til_hits
1882
- FROM ahc_title_traffic
1883
- GROUP BY til_page_id
1884
- ORDER BY til_hits DESC
1885
- LIMIT %d OFFSET 0";
1886
-
1887
- $result1 = $wpdb->get_results($sql1);
1888
- if ($result1 !== false) {
1889
- $total = $result1[0]->sm;
1890
- $result2 = $wpdb->get_results($wpdb->prepare($sql2, AHCFREE_TRAFFIC_BY_TITLE_LIMIT));
1891
- if ($result2 !== false) {
1892
- $arr = array();
1893
- if ($wpdb->num_rows > 0) {
1894
- $c = 0;
1895
- foreach ($result2 as $r) {
1896
- $arr[$c]['rank'] = $c + 1;
1897
- $arr[$c]['til_page_id'] = $r->til_page_id;
1898
- $arr[$c]['til_page_title'] = $r->til_page_title;
1899
- $arr[$c]['til_hits'] = $r->til_hits;
1900
- $arr[$c]['percent'] = ($total > 0) ? ahcfree_ceil_dec((($r->til_hits / $total) * 100), 2, ".") . ' %' : 0;
1901
- $c++;
1902
- }
1903
- }
1904
- return $arr;
1905
- }
1906
- }
1907
- return false;
1908
- }
1909
-
1910
- //--------------------------------------------
1911
- /**
1912
- * Retrieves sum of visits order by time
1913
- *
1914
- * @uses wpdb::get_results()
1915
- *
1916
- * @return mixed
1917
- */
1918
- function ahcfree_get_time_visits() {
1919
- global $wpdb;
1920
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1921
-
1922
- $vst_date = "CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')";
1923
- $sql1 = "SELECT SUM(vtm_visitors) AS sm FROM ahc_visits_time WHERE DATE($vst_date) = '".date('Y-m-d')."'";
1924
- $sql2 = "SELECT hour($vst_date) AS hour, SUM(vst_visitors) AS vst_visitors, SUM(vst_visits) AS vst_visits FROM `ahc_visitors`
1925
- WHERE DATE($vst_date) = '".date('Y-m-d')."' GROUP BY hour($vst_date) ";
1926
- //$result1 = $wpdb->get_results($sql1);
1927
- //if ($result1 !== false) {
1928
- $total = 0;
1929
- $result2 = $wpdb->get_results($sql2);
1930
- //asort($result2);
1931
- $utc_data = array();
1932
-
1933
- if ($result2 !== false) {
1934
- $arr = array();
1935
- $hourDetails = array();
1936
- foreach ($result2 as $r) {
1937
- $hourDetails[ $r->hour ] = array(
1938
- 'visitor' => $r->vst_visitors,
1939
- 'visits' => $r->vst_visits,
1940
- );
1941
- $total += $r->vst_visitors;
1942
- }
1943
- for( $i = 0; $i < 24; $i++ ){
1944
- $vtm_visitors = 0;
1945
- $vtm_visits = 0;
1946
- if( isset( $hourDetails[$i] ) ){
1947
- $vtm_visitors = $hourDetails[$i]['visitor'];
1948
- $vtm_visits = $hourDetails[$i]['visits'];
1949
- }
1950
- if( $i < 10 ){
1951
- $timeTo = $timeFrom = '0'.$i;
1952
- }else{
1953
- $timeTo = $timeFrom = $i;
1954
- }
1955
- $arr[$i]['vtm_time_from'] = $timeFrom.':00';
1956
- $arr[$i]['vtm_time_to'] = $timeTo.':59';
1957
- $arr[$i]['vtm_visitors'] = $vtm_visitors;
1958
- $arr[$i]['vtm_visits'] = $vtm_visits;
1959
- $arr[$i]['percent'] = ($total > 0) ? ahcfree_ceil_dec((($vtm_visitors / $total) * 100), 2, ".") : 0;
1960
- }
1961
- return $arr;
1962
- }
1963
- //}
1964
- return false;
1965
-
1966
- }
1967
-
1968
- function ahcfree_advanced_get_link($url, $followRedirects = true) {
1969
- $url_parsed = @parse_url($url);
1970
- $header = '';
1971
- $body = '';
1972
-
1973
- if (empty($url_parsed['scheme'])) {
1974
- $url_parsed = @parse_url($url);
1975
- }
1976
- $rtn['url'] = $url_parsed;
1977
-
1978
- $port = $url_parsed["port"];
1979
- if (!$port) {
1980
- $port = 80;
1981
- }
1982
- $rtn['url']['port'] = $port;
1983
-
1984
- $path = $url_parsed["path"];
1985
- if (empty($path)) {
1986
- $path = "/";
1987
- }
1988
- if (!empty($url_parsed["query"])) {
1989
- $path .= "?" . $url_parsed["query"];
1990
- }
1991
- $rtn['url']['path'] = $path;
1992
-
1993
- $host = $url_parsed["host"];
1994
- $foundBody = false;
1995
-
1996
- $out = "GET $path HTTP/1.0\r\n";
1997
- $out .= "Host: $host\r\n";
1998
- $out .= "Connection: Close\r\n\r\n";
1999
-
2000
- if (!$fp = @fsockopen($host, $port, $errno, $errstr, 30)) {
2001
- $rtn['errornumber'] = $errno;
2002
- $rtn['errorstring'] = $errstr;
2003
- return $rtn;
2004
- }
2005
- fwrite($fp, $out);
2006
- while (!feof($fp)) {
2007
- $s = fgets($fp, 128);
2008
- if ($s == "\r\n") {
2009
- $foundBody = true;
2010
- continue;
2011
- }
2012
- if ($foundBody) {
2013
- $body .= $s;
2014
- } else {
2015
- if (($followRedirects) && (stristr($s, "location:") != false)) {
2016
- $redirect = preg_replace("/location:/i", "", $s);
2017
- return ffl_HttpGet(trim($redirect));
2018
- }
2019
- $header .= $s;
2020
- }
2021
- }
2022
- fclose($fp);
2023
-
2024
- $rtn['header'] = trim($header);
2025
- $rtn['body'] = trim($body);
2026
- return $rtn;
2027
- }
2028
-
2029
- //--------------------------------------------
2030
- /**
2031
- * Returns client IP address
2032
- *
2033
- * @return string
2034
- */
2035
- function ahcfree_get_client_ip_address() {
2036
- global $_SERVER;
2037
- $ipAddress = '';
2038
- if (isset($_SERVER['REMOTE_ADDR']) && !empty($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR']!='127.0.0.1') {
2039
- $ipAddress = $_SERVER['REMOTE_ADDR'];
2040
- }else if (isset($_SERVER['HTTP_CLIENT_IP']) && !empty($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP']!='127.0.0.1') {
2041
- $ipAddress = $_SERVER['HTTP_CLIENT_IP'];
2042
- } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']!='127.0.0.1') {
2043
- $ipAddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
2044
- } else if (isset($_SERVER['HTTP_X_FORWARDED']) && !empty($_SERVER['HTTP_X_FORWARDED']) && $_SERVER['HTTP_X_FORWARDED']!='127.0.0.1') {
2045
- $ipAddress = $_SERVER['HTTP_X_FORWARDED'];
2046
- } else if (isset($_SERVER['HTTP_FORWARDED_FOR']) && !empty($_SERVER['HTTP_FORWARDED_FOR']) && $_SERVER['HTTP_FORWARDED_FOR']!='127.0.0.1') {
2047
- $ipAddress = $_SERVER['HTTP_FORWARDED_FOR'];
2048
- } else if (isset($_SERVER['HTTP_FORWARDED']) && !empty($_SERVER['HTTP_FORWARDED']) && $_SERVER['HTTP_FORWARDED']!='127.0.0.1') {
2049
- $ipAddress = $_SERVER['HTTP_FORWARDED'];
2050
- } else {
2051
- $ipAddress = 'UNKNOWN';
2052
- }
2053
-
2054
- $ipAddress = explode(',', $ipAddress);
2055
-
2056
- return $ipAddress[0];
2057
- }
2058
-
2059
- //--------------------------------------------
2060
- /**
2061
- * To include scripts and styles tags into the head
2062
- *
2063
- * @uses wp_register_style()
2064
- * @uses wp_enqueue_style()
2065
- * @uses wp_register_script()
2066
- * @uses wp_enqueue_script()
2067
- *
2068
- * @return void
2069
- */
2070
- function ahcfree_include_scripts() {
2071
-
2072
-
2073
- wp_register_style('ahcfree_lang_css', plugins_url('/css/engl_css.css', AHCFREE_PLUGIN_MAIN_FILE));
2074
- wp_enqueue_style('ahcfree_lang_css');
2075
-
2076
- if(get_locale() == 'ar')
2077
- {
2078
- wp_register_style('ahcfree_bootstrap_ar_css', plugins_url('/lib/bootstrap/css/bootstrap-rtl.min.css',AHCFREE_PLUGIN_MAIN_FILE));
2079
- wp_enqueue_style('ahcfree_bootstrap_ar_css');
2080
- }else{
2081
- wp_register_style('ahcfree_bootstrap_css', plugins_url('/lib/bootstrap/css/bootstrap.min.css',AHCFREE_PLUGIN_MAIN_FILE));
2082
- wp_enqueue_style('ahcfree_bootstrap_css');
2083
- }
2084
-
2085
-
2086
- wp_enqueue_script('jquery');
2087
-
2088
- wp_register_script('ahcfree_bootstrap_js', plugins_url('/lib/bootstrap/js/bootstrap.min.js',AHCFREE_PLUGIN_MAIN_FILE));
2089
- wp_enqueue_script('ahcfree_bootstrap_js');
2090
-
2091
- wp_register_script('ahcfree_lang_js', plugins_url('/lang/js/' . Globalsahcfree::$lang . '_lang.js', AHCFREE_PLUGIN_MAIN_FILE));
2092
- wp_enqueue_script('ahcfree_lang_js');
2093
-
2094
- wp_register_script('ahcfree_main_js', plugins_url('/js/ahc_jqscripts.js', AHCFREE_PLUGIN_MAIN_FILE), false, '1.28');
2095
- wp_enqueue_script('ahcfree_main_js');
2096
-
2097
- wp_localize_script('ahcfree_main_js', 'ahcfree_ajax', array('ajax_url' => admin_url('admin-ajax.php')));
2098
-
2099
- wp_register_script('ahcfree_Chart_js', plugins_url('/lib/Chart_js/Chart.min.js', AHCFREE_PLUGIN_MAIN_FILE));
2100
- wp_enqueue_script('ahcfree_Chart_js');
2101
-
2102
- wp_register_script('utils_js', plugins_url('/lib/Chart_js/utils.js', AHCFREE_PLUGIN_MAIN_FILE));
2103
- wp_enqueue_script('utils_js');
2104
-
2105
-
2106
- /* wp_register_script('ahcfree_GoogleChart_js', 'https://www.gstatic.com/charts/loader.js');
2107
- wp_enqueue_script('ahcfree_GoogleChart_js');
2108
-
2109
- */
2110
- // jqplot
2111
- wp_register_style('jqueryjqplotmincss', plugins_url('/css/jquery.jqplot.min.css?ver=1.0.8', AHCFREE_PLUGIN_MAIN_FILE));
2112
- wp_enqueue_style('jqueryjqplotmincss');
2113
-
2114
- wp_register_script('jqueryjqplotmin', plugins_url('/js/jquery.jqplot.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE));
2115
- wp_enqueue_script('jqueryjqplotmin');
2116
-
2117
- wp_register_script('jqplotdateAxisRenderermin', plugins_url('/js/jqplot.dateAxisRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE));
2118
- wp_enqueue_script('jqplotdateAxisRenderermin');
2119
-
2120
- wp_register_script('jqplotcanvasAxisTickRenderermin', plugins_url('/js/jqplot.canvasAxisTickRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE));
2121
- wp_enqueue_script('jqplotcanvasAxisTickRenderermin');
2122
-
2123
- wp_register_script('jqplotcanvasAxisLabelRenderermin', plugins_url('/js/jqplot.canvasAxisLabelRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE));
2124
- wp_enqueue_script('jqplotcanvasAxisLabelRenderermin');
2125
-
2126
- wp_register_script('jqplot.canvasTextRenderer.min', plugins_url('/js/jqplot.canvasTextRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE));
2127
- wp_enqueue_script('jqplot.canvasTextRenderer.min');
2128
-
2129
-
2130
-
2131
- wp_register_script('jqplothighlightermin', plugins_url('/js/jqplot.highlighter.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE));
2132
- wp_enqueue_script('jqplothighlightermin');
2133
-
2134
- wp_register_script('jqplot.pieRenderer.min', plugins_url('/js/jqplot.pieRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE));
2135
- wp_enqueue_script('jqplot.pieRenderer.min');
2136
-
2137
- wp_register_script('jqplot.enhancedLegendRenderer.min', plugins_url('/js/jqplot.enhancedLegendRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE));
2138
- wp_enqueue_script('jqplot.enhancedLegendRenderer.min');
2139
-
2140
- wp_enqueue_script('sweetalert', plugins_url('/js/sweetalert.min.js', AHCFREE_PLUGIN_MAIN_FILE));
2141
- wp_enqueue_style( 'sweetalert', plugins_url('/css/sweetalerts.css', AHCFREE_PLUGIN_MAIN_FILE));
2142
-
2143
-
2144
-
2145
-
2146
- }
2147
-
2148
- //--------------------------------------------
2149
- //---------------------------------------------Add button to the admin bar
2150
- function ahcfree_vtrts_add_items($admin_bar) {
2151
- global $pluginsurl;
2152
-
2153
- $wccpadminurl = get_admin_url();
2154
- //The properties of the new item. Read More about the missing 'parent' parameter below
2155
- $args = array(
2156
- 'id' => 'visitorstraffic',
2157
- 'title' => __('<img src="' . plugins_url('/images/vtrtspro.png', AHCFREE_PLUGIN_MAIN_FILE) . '" style="vertical-align:middle;margin-right:5px;" alt="visitor traffic" title="visitor traffic" />'),
2158
- 'href' => $wccpadminurl . 'admin.php?page=ahc_hits_counter_menu_free',
2159
- 'meta' => array('title' => __('Visitor Traffic Real Time Statistics'),)
2160
- );
2161
-
2162
- //This is where the magic works.
2163
- $admin_bar->add_menu($args);
2164
- }
2165
-
2166
- //---------------------------------------- Add plugin settings link to Plugins page
2167
- function ahcfree_vtrtsp_plugin_add_settings_link($links) {
2168
- $settings_link = '<a href="admin.php?page=ahc_hits_counter_menu_pro">' . __('visitor traffic') . '</a>';
2169
- array_push($links, $settings_link);
2170
- return $links;
2171
- }
2172
-
2173
- //------------------------------------------------------------------------
2174
- // --------------------------------------- Create front-end widget
2175
- // Creating the widget
2176
- class vtrtsfree_widget extends WP_Widget {
2177
-
2178
- function __construct() {
2179
- parent::__construct(
2180
- // Base ID of your widget
2181
- 'vtrtsfree_widget',
2182
- // Widget name will appear in UI
2183
- __('Visitor Traffic', 'wpb_widget_domain'),
2184
- // Widget description
2185
- array('description' => __('Display your site statistics', 'wpb_widget_domain'),)
2186
- );
2187
- }
2188
-
2189
- // Creating widget front-end
2190
- // This is where the action happens
2191
- public function widget($args, $instance) {
2192
- $title = apply_filters('widget_title', $instance['title']);
2193
- // before and after widget arguments are defined by themes
2194
- echo $args['before_widget'];
2195
- if (!empty($title))
2196
- echo $args['before_title'] . $title . $args['after_title'];
2197
-
2198
-
2199
- $ahcfree_sum_stats = ahcfree_get_summary_statistics();
2200
-
2201
-
2202
- // This is where you run the code and display the output
2203
- echo '<ul style="list-style:none; ' . $instance['fontTypeCombo'] . '; font-size:' . $instance['fontSizeCombo'] . 'px">';
2204
- if ($instance['display_onlineusers'] == 1 or $instance['display_onlineusers'] == '1') {
2205
- $online_img_path = plugins_url('/images/live.gif', AHCFREE_PLUGIN_MAIN_FILE);
2206
- echo '<li><b style="color:#' . $instance['display_titlecolor'] . '">Users online: </b><span style="color:#' . $instance['display_valuescolor'] . '">' . ahcfree_countOnlineusers() . '</span>&nbsp;<img src="' . $online_img_path . '" /></li>';
2207
- }
2208
- if ($instance['display_visitorstoday'] == 1 or $instance['display_visitorstoday'] == '1') {
2209
- echo '<li><b style="color:#' . $instance['display_titlecolor'] . '">Visitors today : </b><span style="color:#' . $instance['display_valuescolor'] . '">' . ahcfree_free_NumFormat($ahcfree_sum_stats['today']['visitors']) . '</span></li>';
2210
- }
2211
- if ($instance['display_pageviewtoday'] == 1 or $instance['display_pageviewtoday'] == '1') {
2212
- echo '<li><b style="color:#' . $instance['display_titlecolor'] . '">Page views today : </b><span style="color:#' . $instance['display_valuescolor'] . '">' . ahcfree_free_NumFormat($ahcfree_sum_stats['today']['visits']) . '</span></li>';
2213
- }
2214
-
2215
- if ($instance['display_totalvisitors'] == 1 or $instance['display_totalvisitors'] == '1') {
2216
- echo '<li><b style="color:#' . $instance['display_titlecolor'] . '">Total visitors : </b><span style="color:#' . $instance['display_valuescolor'] . '">' . ahcfree_free_NumFormat($ahcfree_sum_stats['total']['visitors']) . '</span></li>';
2217
- }
2218
-
2219
- if ($instance['display_totalpageview'] == 1 or $instance['display_totalpageview'] == '1') {
2220
- echo '<li><b style="color:#' . $instance['display_titlecolor'] . '">Total page view: </b><span style="color:#' . $instance['display_valuescolor'] . '">' . ahcfree_free_NumFormat($ahcfree_sum_stats['total']['visits']) . '</span></li>';
2221
- }
2222
-
2223
-
2224
- echo '</ul>';
2225
- echo $args['after_widget'];
2226
- }
2227
-
2228
- // Widget Backend
2229
- public function form($instance) {
2230
- extract($instance);
2231
-
2232
- if (isset($instance['title'])) {
2233
- $title = $instance['title'];
2234
- } else {
2235
- $title = __('Site Statistics', 'wpb_widget_domain');
2236
- }
2237
- // Widget admin form
2238
- $fontTypeCombo = (isset($fontTypeCombo)) ? $fontTypeCombo : '';
2239
- $fontSizeCombo = (isset($fontSizeCombo)) ? $fontSizeCombo : '14';
2240
- ?>
2241
-
2242
-
2243
- <p>
2244
- <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget Title:'); ?></label>
2245
- <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo (isset($title) ? esc_attr($title) : ''); ?>" />
2246
- </p>
2247
-
2248
- <p>
2249
- <label for="<?php echo $this->get_field_id('display_titlecolor'); ?>"><?php _e('Title Color:'); ?></label>
2250
- <input class="color widefat" id="<?php echo $this->get_field_id('display_titlecolor'); ?>" name="<?php echo $this->get_field_name('display_titlecolor'); ?>" style="border:#CCC solid 1px" value="<?php echo (isset($display_titlecolor) ? esc_attr($display_titlecolor) : ''); ?>" >
2251
- </p>
2252
-
2253
- <p>
2254
- <label for="<?php echo $this->get_field_id('display_valuescolor'); ?>"><?php _e('Value Color:'); ?></label>
2255
- <input class="color widefat" style="border:#CCC solid 1px" id="<?php echo $this->get_field_id('display_valuescolor'); ?>" name="<?php echo $this->get_field_name('display_valuescolor'); ?>" value="<?php echo (isset($display_valuescolor) ? esc_attr($display_valuescolor) : ''); ?>" >
2256
- </p>
2257
-
2258
-
2259
- <p>
2260
- <label for="<?php echo $this->get_field_id('fontTypeCombo'); ?>"><?php _e('Font Type:'); ?></label>
2261
- <select class="widefat" id="<?php echo $this->get_field_id('fontTypeCombo'); ?>" name="<?php echo $this->get_field_name('fontTypeCombo'); ?>">
2262
- <optgroup class='verdana'>
2263
- <option <?php selected($fontTypeCombo, 'font-family:Verdana, Geneva, sans-serif'); ?> value="font-family:Verdana, Geneva, sans-serif">Verdana</option>
2264
- </optgroup>
2265
-
2266
- <optgroup class='TimesNew'>
2267
- <option <?php selected($fontTypeCombo, "font-family:'Times New Roman', Times, serif"); ?> value="font-family:'Times New Roman', Times, serif">Times New Roman</option>
2268
- </optgroup>
2269
-
2270
- <optgroup class='Arial'>
2271
- <option <?php selected($fontTypeCombo, "font-family:Arial, Helvetica, sans-serif"); ?> value="font-family:Arial, Helvetica, sans-serif">Arial</option>
2272
- </optgroup>
2273
-
2274
- <optgroup class='Tahoma'>
2275
- <option <?php selected($fontTypeCombo, "font-family:Tahoma, Geneva, sans-serif"); ?> value="font-family:Tahoma, Geneva, sans-serif">Tahoma</option>
2276
- </optgroup>
2277
-
2278
- <optgroup class='Courier'>
2279
- <option <?php selected($fontTypeCombo, "font-family:'Courier New', Courier, monospace"); ?> value="font-family:'Courier New', Courier, monospace">Courier</option>
2280
- </optgroup>
2281
-
2282
- <optgroup class='TrebuchetMS'>
2283
- <option <?php selected($fontTypeCombo, "font-family:'Trebuchet MS', Arial, Helvetica, sans-serif"); ?> value="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif">Trebuchet MS</option>
2284
- </optgroup>
2285
-
2286
-
2287
- </select>
2288
-
2289
- </p>
2290
- <label for="<?php echo $this->get_field_id('fontSizeCombo'); ?>"><?php _e('Font Size:'); ?></label>
2291
- <select class="widefat" id="<?php echo $this->get_field_id('fontSizeCombo'); ?>" name="<?php echo $this->get_field_name('fontSizeCombo'); ?>">
2292
- <?php
2293
- for ($fs = 8; $fs <= 22; $fs++) {
2294
- ?>
2295
- <option value="<?php echo $fs ?>" <?php selected($fontSizeCombo, $fs); ?>><?php echo $fs; ?>px</option>
2296
- <?php } ?>
2297
- </select>
2298
- <p>
2299
-
2300
- </p>
2301
-
2302
- <p><em>Display :</em></p>
2303
-
2304
-
2305
- <p>
2306
- <input class="widefat" id="<?php echo $this->get_field_id('display_onlineusers'); ?>" name="<?php echo $this->get_field_name('display_onlineusers'); ?>" type="checkbox" value="1" <?php isset($display_onlineusers) ? checked($display_onlineusers, '1') : ''; ?> />&nbsp;<label for="<?php echo $this->get_field_id('display_onlineusers'); ?>">Users Online</label>
2307
- </p>
2308
- <p>
2309
- <input class="widefat" id="<?php echo $this->get_field_id('display_visitorstoday'); ?>" name="<?php echo $this->get_field_name('display_visitorstoday'); ?>" type="checkbox" value="1" <?php isset($display_onlineusers) ? checked($display_visitorstoday, '1') : ''; ?>/>&nbsp;<label for="<?php echo $this->get_field_id('display_visitorstoday'); ?>">Visitors Today</label>
2310
- </p>
2311
- <p>
2312
- <input class="widefat" id="<?php echo $this->get_field_id('display_pageviewtoday'); ?>" name="<?php echo $this->get_field_name('display_pageviewtoday'); ?>" type="checkbox" value="1" <?php isset($display_onlineusers) ? checked($display_pageviewtoday, '1') : ''; ?>/>&nbsp;<label for="<?php echo $this->get_field_id('display_pageviewtoday'); ?>">Page Views Today</label>
2313
- </p>
2314
- <p>
2315
- <input class="widefat" id="<?php echo $this->get_field_id('display_totalpageview'); ?>" name="<?php echo $this->get_field_name('display_totalpageview'); ?>" type="checkbox" value="1" <?php isset($display_onlineusers) ? checked($display_totalpageview, '1') : ''; ?> />&nbsp;<label for="<?php echo $this->get_field_id('display_totalpageview'); ?>">Total Page Views</label>
2316
- </p>
2317
- <p>
2318
- <input class="widefat" id="<?php echo $this->get_field_id('display_totalvisitors'); ?>" name="<?php echo $this->get_field_name('display_totalvisitors'); ?>" type="checkbox" value="1" <?php isset($display_onlineusers) ? checked($display_totalvisitors, '1') : ''; ?>/>&nbsp;<label for="<?php echo $this->get_field_id('display_totalvisitors'); ?>">Total Visitors</label>
2319
- </p>
2320
- </p>
2321
- <?php
2322
- }
2323
-
2324
- // Updating widget replacing old instances with new
2325
- public function update($new_instance, $old_instance) {
2326
-
2327
- return $new_instance;
2328
- }
2329
-
2330
- }
2331
-
2332
- // Class vtrtsfree_widget ends here
2333
- // Register and load the widget
2334
- function ahcfree_wpb_load_widget() {
2335
- register_widget('vtrtsfree_widget');
2336
- }
2337
-
2338
- add_action('widgets_init', 'ahcfree_wpb_load_widget');
2339
-
2340
- function ahcfree_get_hits_by_custom_duration_callback(){
2341
- $hits_duration = $_POST['hits_duration'];
2342
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
2343
- $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
2344
-
2345
- $myend_date = new DateTime();
2346
- $myend_date->setTimezone($custom_timezone);
2347
-
2348
- $end_date = $myend_date->format('Y-m-d');
2349
- $full_end_date = $myend_date->format('Y-m-d 23:59:59');
2350
-
2351
- $mystart_date = new DateTime();
2352
- $mystart_date->setTimezone($custom_timezone);
2353
- $stat = '';
2354
- switch ($hits_duration){
2355
-
2356
- case '7':
2357
- $mystart_date->modify('-7 days');
2358
- $start_date = $mystart_date->format('Y-m-d');
2359
- $full_start_date = $mystart_date->format('Y-m-d 00:00:00');
2360
- $interval = '1 day';
2361
-
2362
- break;
2363
-
2364
- case 'current_month':
2365
- //$mystart_date->modify('0:00 first day of curent month');
2366
- $start_date = $mystart_date->format('Y-m-01');
2367
- $end_date = $mystart_date->format('Y-m-t');
2368
- $full_start_date = $mystart_date->format('Y-m-01');
2369
- $full_end_date = $mystart_date->format('Y-m-t');
2370
- $interval = '1 day';
2371
- $stat = 'current_month';
2372
- break;
2373
-
2374
- case 'last_month':
2375
- $mystart_date->modify('0:00 first day of previous month');
2376
- $start_date = $mystart_date->format('Y-m-d');
2377
- $end_date = $mystart_date->format('Y-m-t');
2378
- $full_start_date = $mystart_date->format('Y-m-d');
2379
- $full_end_date = $mystart_date->format('Y-m-t');
2380
- $interval = '1 day';
2381
- $stat = 'last_month';
2382
- break;
2383
-
2384
- case '30':
2385
- /*$mystart_date->modify('first day of previous month');
2386
- $start_date = $mystart_date->format('Y-m-d');
2387
- $full_start_date = $mystart_date->format('Y-m-d H:i:s');
2388
-
2389
- $myend_date->modify('last day of previous month');
2390
- $end_date = $myend_date->format('Y-m-d');
2391
- $full_end_date = $myend_date->format('Y-m-d H:i:s');*/
2392
-
2393
- $mystart_date->modify('-30 days');
2394
- $start_date = $mystart_date->format('Y-m-d');
2395
- $full_start_date = $mystart_date->format('Y-m-d 00:00:00');
2396
-
2397
- $interval = '1 week';
2398
- break;
2399
-
2400
- /* case '365':
2401
- //$mystart_date->modify(' - 1 year');
2402
- $start_date = (new DateTime(date("Y")."-01-01"))->format('Y-m-d');
2403
- $full_start_date = (new DateTime(date("Y")."-01-01"))->format('Y-m-d 00:00:00');
2404
- $end_date = $mystart_date->format('Y-m-t');
2405
- $full_end_date = $mystart_date->format('Y-m-t 23:59:59');
2406
- $interval = '1 month';
2407
- $stat = 'year';
2408
- break;
2409
- */
2410
-
2411
- case '0':
2412
- $full_start_date = $full_end_date = '';
2413
- $stat = 'all';
2414
- break;
2415
-
2416
- default :
2417
- $mystart_date->modify(' - ' . (AHC_VISITORS_VISITS_LIMIT - 1) . ' days');
2418
- $start_date = $mystart_date->format('Y-m-d');
2419
- $full_start_date = $mystart_date->format('Y-m-d 00:00:00');
2420
- $interval = '1 day';
2421
- break;
2422
- }
2423
-
2424
- $visits_visitors_data = ahcfree_get_visits_by_custom_duration_callback($full_start_date,$full_end_date,$stat);
2425
- //print_r($visits_visitors_data);
2426
- $response = array( 'mystart_date' => $start_date,
2427
- 'myend_date' => $end_date,
2428
- 'full_start_date' => $full_start_date,
2429
- 'full_end_date' => $full_end_date,
2430
- 'interval' => $interval,
2431
- 'visitors_data' => json_encode($visits_visitors_data['visitors']),
2432
- 'visits_data' => json_encode($visits_visitors_data['visits'])
2433
- );
2434
-
2435
- echo json_encode( $response );
2436
- die;
2437
- }
2438
-
2439
-
2440
- function ahcfree_get_visits_by_custom_duration_callback( $start_date,$end_date,$stat){
2441
- global $wpdb;
2442
- $visits_arr = array();
2443
- $custom_timezone_offset = ahcfree_get_current_timezone_offset();
2444
- $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
2445
-
2446
- $results = false;
2447
-
2448
- $mystart_date = new DateTime($start_date);
2449
- $myend_date = new DateTime($end_date);
2450
-
2451
- $total_days = date_diff( $mystart_date, $myend_date );
2452
- $total_days = $total_days->format("%a");
2453
-
2454
- $cond = "DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE('". $start_date ." 00:00:00') AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= DATE('". $end_date ." 23:59:59')";
2455
-
2456
- if($stat == 'year')
2457
- {
2458
- $sql = "SELECT DATE_FORMAT(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'),'%Y-%m') as group_date,DATE_FORMAT(CONVERT_TZ(vst_date,'".AHCFREE_SERVER_CURRENT_TIMEZONE."','".$custom_timezone_offset."'),'%Y-%m-01') as vst_date,SUM(vst_visitors) as vst_visitors,SUM(vst_visits) as vst_visits FROM ahc_visitors WHERE ". $cond." GROUP BY group_date";
2459
- }
2460
- if($stat == 'all')
2461
- {
2462
- $sql = "SELECT DATE_FORMAT(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'),'%Y-%m') as group_date,DATE_FORMAT(CONVERT_TZ(vst_date,'".AHCFREE_SERVER_CURRENT_TIMEZONE."','".$custom_timezone_offset."'),'%Y-%m-01') as vst_date,SUM(vst_visitors) as vst_visitors,SUM(vst_visits) as vst_visits FROM ahc_visitors GROUP BY group_date ORDER BY vst_date ASC";
2463
-
2464
- }
2465
- if($stat == '' || $stat == 'current_month' || $stat == 'last_month' )
2466
- {
2467
- $sql = "SELECT DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) as vst_date, SUM(vst_visits) AS vst_visits,SUM(vst_visitors) as vst_visitors FROM ahc_visitors WHERE ". $cond ." GROUP BY DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'))";
2468
- }
2469
- //echo $sql;
2470
- $results = $wpdb->get_results($sql, OBJECT);
2471
- if ($results !== false) {
2472
-
2473
- if($stat == 'year')
2474
- {
2475
- for ($i = 1; $i <= date('n'); $i++) {
2476
- $month = $mystart_date->format('m');
2477
- $year = $mystart_date->format('Y');
2478
- $total_days = cal_days_in_month(CAL_GREGORIAN, $month ,$year);
2479
-
2480
- $visits_arr['visits'][] = array($mystart_date->format('Y-m-d'), 0);
2481
- $visits_arr['visitors'][] = array($mystart_date->format('Y-m-d'), 0);
2482
- $mystart_date->modify( '+'.$total_days.' days' );
2483
- }
2484
- }
2485
- elseif($stat == 'all')
2486
- {
2487
- foreach($results as $key =>$element) {
2488
- reset($results);
2489
- if ($key === key($results)){
2490
- $first_date = $element->vst_date;
2491
- }
2492
-
2493
- end($results);
2494
- if ($key === key($results)){
2495
- $last_date = $element->vst_date;
2496
- }
2497
- }
2498
-
2499
- $d1 = new DateTime($first_date);
2500
- $d2 = new DateTime($last_date);
2501
-
2502
- if(count($results) == 1 )
2503
- {
2504
- $pre_d1 = new DateTime($first_date);
2505
- $pre_d1->modify( 'first day of previous month' );
2506
- $visits_arr['visits'][] = array($pre_d1->format( 'Y-m-d' ), 0);
2507
- $visits_arr['visitors'][] = array($pre_d1->format( 'Y-m-d' ), 0);
2508
- }
2509
-
2510
- $diff = $d1->diff($d2)->m + 1;
2511
-
2512
- for ($i = 1; $i <= $diff; $i++) {
2513
- $visits_arr['visits'][] = array($d1->format('Y-m-d'), 0);
2514
- $visits_arr['visitors'][] = array($d1->format('Y-m-d'), 0);
2515
- $d1->modify( '+1 Month' );
2516
- }
2517
- }
2518
- else
2519
- {
2520
- if($stat == 'current_month'){
2521
- $total_days = date('t');
2522
- $total_days--;
2523
- }
2524
- if($stat == 'last_month'){
2525
- $total_days = date('t', strtotime('first day of previous month'));
2526
- $total_days--;
2527
- }
2528
- $visits_arr['visits'][] = array($mystart_date->format('Y-m-d'), 0);
2529
- $visits_arr['visitors'][] = array($mystart_date->format('Y-m-d'), 0);
2530
- for ($i = 1; $i <= $total_days; $i++) {
2531
- $mystart_date->modify( '+1 Day' );
2532
- $visits_arr['visits'][] = array($mystart_date->format('Y-m-d'), 0);
2533
- $visits_arr['visitors'][] = array($mystart_date->format('Y-m-d'), 0);
2534
- }
2535
- }
2536
- //print_r($visits_arr['visits']);
2537
- foreach( $visits_arr['visits'] as $key=>$visits ){
2538
- foreach ($results as $r) {
2539
- if( $visits[0] == $r->vst_date )
2540
- {
2541
- $visits_arr['visits'][$key][1] = $r->vst_visits;
2542
- }
2543
- }
2544
- }
2545
-
2546
- foreach( $visits_arr['visitors'] as $key=>$visits ){
2547
- foreach ($results as $r) {
2548
- if( $visits[0] == $r->vst_date )
2549
- {
2550
- $visits_arr['visitors'][$key][1] = $r->vst_visitors;
2551
- }
2552
- }
2553
- }
2554
- }
2555
- //echo $wpdb->last_query;
2556
- return $visits_arr;
2557
-
2558
- }
2559
- function ahcfree_admin_notice_to_set_timezone(){
2560
- $class = 'notice notice-error';
2561
- $name = 'Visitor Traffic Real Time Statistics free';
2562
- $message = sprintf( __( 'Please set timezone from <a href="%s">here</a>' ), site_url('wp-admin/admin.php?page=ahc_hits_counter_settings') );
2563
-
2564
- printf( '<div class="%1$s"><h3>%2$s</h3><p>%3$s</p></div>', esc_attr( $class ), $name, $message );
2565
-
2566
- }
2567
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Called when plugin is activated or upgraded
5
+ *
6
+ * @uses add_option()
7
+ * @uses get_option()
8
+ *
9
+ * @return void
10
+ */
11
+
12
+
13
+ function ahcfree_localtime($dateformat)
14
+ {
15
+ if(function_exists('date_i18n'))
16
+ {
17
+
18
+ return date_i18n($dateformat);
19
+ }else{
20
+ return gmdate($dateformat);
21
+ }
22
+ }
23
+
24
+
25
+
26
+ function ahcfree_getVisitsTime() {
27
+ global $wpdb;
28
+ $result = $wpdb->get_results("SELECT COUNT( `vtm_id` ) cnt FROM ahc_visits_time", OBJECT);
29
+ if ($result !== false) {
30
+ return $result[0]->cnt;
31
+ }
32
+ return false;
33
+ }
34
+
35
+ function ahcfree_google_map($map_option) {
36
+ ahcfree_include_scripts();
37
+
38
+ global $wpdb;
39
+
40
+ $ahcfree_get_save_settings = ahcfree_get_save_settings();
41
+ $map_status = $ahcfree_get_save_settings[0]->set_google_map;
42
+
43
+ if ($map_status == 'online') {
44
+ $ctrArr = ahcfree_get_online_visitors_for_map();
45
+
46
+ } else if ($map_status == 'all') { // top 10 coutries
47
+ $ctrArr = ahcfree_get_all_visitors_for_map();
48
+
49
+ } else if($map_status == 'this_month') // this month visitors
50
+ {
51
+ $ctrArr = ahcfree_get_today_visitors_for_map('this_month'); // today visitors
52
+ }else if($map_status == 'past_month') // this month visitors
53
+ {
54
+ $ctrArr = ahcfree_get_today_visitors_for_map('past_month'); // today visitors
55
+ }else{
56
+ $ctrArr = ahcfree_get_today_visitors_for_map(); // default : today visitors
57
+ }
58
+
59
+ $ret = '<div id="OSMap" style="width: 100%; height:540px;"></div>
60
+ <script language="javascript" type="text/javascript">
61
+ jQuery(document).ready(function(){
62
+ var map = L.map( "OSMap", {
63
+ center: [34.307144, -8.789062],
64
+ minZoom: 2,
65
+ zoom: 2
66
+ });
67
+ L.tileLayer( "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
68
+ attribution: "&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>",
69
+ subdomains: ["a","b","c"]
70
+ }).addTo( map );
71
+ ';
72
+
73
+
74
+
75
+ $counter = 1;
76
+ if ($ctrArr['success'] && isset($ctrArr['data']) && count($ctrArr['data']) > 0) {
77
+
78
+ foreach ($ctrArr['data'] as $vc) {
79
+ $info = '<div style="overflow: auto;">';
80
+ $info .= '<div class="countryMarker"><img src="' .
81
+ plugins_url('/images/flags/' . strtolower($vc['ctr_internet_code']) . '.png', AHCFREE_PLUGIN_MAIN_FILE) .
82
+ '" border="0" width="20" height="16" onerror="imgFlagError(this)" /></span><span class="countryName">' . str_replace("'", "", $vc['ctr_name']) . '&nbsp;&nbsp;<span class="countryName">(' . str_replace("'", "", $vc['visitors']) . ')</span></div>';
83
+ $info .= '</div>';
84
+
85
+ $ret .='L.marker( ['.$vc['ctr_latitude'].', '.$vc['ctr_longitude'].'] )
86
+ .bindPopup( \''.$info.'\').addTo( map ).openPopup();';
87
+
88
+
89
+ $counter++;
90
+ }
91
+ }
92
+ $ret .= '
93
+ });
94
+ </script>';
95
+
96
+
97
+
98
+ echo $ret;
99
+ }
100
+
101
+ /**
102
+ * change plugin settings
103
+ * @return void
104
+ */
105
+
106
+ function ahcfree_savesettings() {
107
+ global $wpdb;
108
+
109
+ $set_hits_days = intval($_POST['set_hits_days']);
110
+ $set_ajax_check = intval($_POST['set_ajax_check']);
111
+ $posts_type = '';
112
+ $set_ips = esc_html($_POST['set_ips']);
113
+ $set_google_map = '';
114
+ $delete_plugin_data = isset($_POST['delete_plugin_data']) ? intval($_POST['delete_plugin_data']) : '';
115
+
116
+ $custom_timezone_offset = sanitize_text_field($_POST['set_custom_timezone']);
117
+ if ($custom_timezone_offset && $custom_timezone_offset != '') {
118
+ update_option('ahcfree_custom_timezone', $custom_timezone_offset);
119
+ }
120
+
121
+ $delete_plugin_data = (isset($delete_plugin_data)) ? intval($delete_plugin_data) : 0;
122
+ update_option('ahcfree_delete_plugin_data_on_uninstall', $delete_plugin_data);
123
+
124
+
125
+
126
+ $ahcproUserRoles = isset($_POST['ahcproUserRoles']) ? $_POST['ahcproUserRoles'] : '';
127
+ if(isset($ahcproUserRoles))
128
+ {
129
+ foreach ($ahcproUserRoles as $v)
130
+ {
131
+ $ahcproUserRoles .= sanitize_text_field($v).",";
132
+ }
133
+
134
+
135
+
136
+ $ahcproUserRoles = substr($ahcproUserRoles,0,-1);
137
+
138
+ update_option('ahcproUserRoles',$ahcproUserRoles);
139
+ }
140
+
141
+
142
+ $sql = $wpdb->prepare("UPDATE `ahc_settings` set `set_hits_days` = %s, `set_ajax_check` = %s, `set_ips` = %s, `set_google_map` = %s ", $set_hits_days, $set_ajax_check, $set_ips, $set_google_map);
143
+
144
+ if ($wpdb->query($sql) !== false) {
145
+
146
+ return true;
147
+ }
148
+
149
+ return false;
150
+ }
151
+
152
+ //--------------------------------------------
153
+ function ahcfree_sanitizing($unsafe_val,$type='text')
154
+ {
155
+
156
+
157
+ switch ($type) {
158
+ case 'text': return sanitize_text_field($unsafe_val);
159
+ break;
160
+
161
+ case 'int': return intval($unsafe_val);
162
+ break;
163
+
164
+ case 'email': return sanitize_email($unsafe_val);
165
+ break;
166
+
167
+ case 'filename': return sanitize_file_name($unsafe_val);
168
+ break;
169
+
170
+ case 'title': return sanitize_title($unsafe_val);
171
+ break;
172
+
173
+ case 'url': return esc_url($unsafe_val);
174
+ break;
175
+
176
+ default:
177
+ return sanitize_text_field($unsafe_val);
178
+
179
+ }
180
+ }
181
+
182
+
183
+ function ahcfree_rate_us($plugin_url, $box_color = '#1D1F21') {
184
+
185
+ $ret = '
186
+
187
+ <script language="javascript">
188
+ setTimeout(function() {
189
+ $(\'#ratingdiv\').hide();
190
+ }, 1000);
191
+ </script>
192
+
193
+ <style type="text/css">
194
+
195
+ .rate_box{
196
+
197
+ background-color:' . $box_color . ';
198
+ color:#ffffff;
199
+
200
+
201
+
202
+ }
203
+ .rating {
204
+ unicode-bidi: bidi-override;
205
+ direction: rtl;
206
+
207
+
208
+ }
209
+ .link_wp{
210
+
211
+ color:#EDAE42 !important
212
+ }
213
+ .rating > span {
214
+ display: inline-block;
215
+ position: relative;
216
+ width: 1.1em;
217
+ font-size:40px;
218
+ color:yellow;
219
+ content: "\2605";
220
+ }
221
+ .rating > span:hover:before,
222
+ .rating > span:hover ~ span:before {
223
+ content: "\2605";
224
+ position: absolute;
225
+ color:yellow;
226
+ }
227
+ </style>';
228
+
229
+ $ret .= '<div class="row rate_box" id="ratingdiv">
230
+ <div class="col-md-6">
231
+ <br />
232
+ <p>
233
+ <strong>Do you like this plugin?</strong><br /> Please take a few seconds to <a class="link_wp" href="' . $plugin_url . '" target="_blank">rate it on WordPress.org!</a></p>
234
+ </div>
235
+ <div class="col-md-6">
236
+ <div class="rating">';
237
+
238
+ for ($r = 1; $r <= 5; $r++) {
239
+
240
+ $ret .= '<span onclick="window.open(\'' . $plugin_url . '\',\'_blank\')">☆</span>';
241
+ }
242
+
243
+ $ret .= '</div>
244
+ </div>
245
+ </div>';
246
+ return $ret;
247
+ }
248
+
249
+ function ahcfree_get_save_settings() {
250
+ global $wpdb;
251
+ $table_exist = ahcfree_check_table_exists('ahc_settings');
252
+ if( $table_exist ){
253
+ $result = $wpdb->get_results("SELECT set_hits_days, set_ajax_check, set_ips, set_google_map FROM ahc_settings", OBJECT);
254
+ if ($result !== false) {
255
+ return $result;
256
+ }
257
+ }
258
+
259
+ return false;
260
+ }
261
+
262
+ function ahcfree_get_timezone_string() {
263
+ $custom_timezone = get_option('ahcfree_custom_timezone');
264
+ if (!$custom_timezone) {
265
+ $wsmTimeZone=get_option('timezone_string' );
266
+ if(is_null($wsmTimeZone) || $wsmTimeZone==''){
267
+ $wsmTimeZone=ahcfree_GetWPTimezoneString();
268
+ }
269
+ $custom_timezone= ahcfree_CleanupTimeZoneString($wsmTimeZone);
270
+
271
+ /*
272
+ $custom_timezone = get_option( 'timezone_string' );
273
+
274
+ if ( ! empty( $custom_timezone ) ) {
275
+ return $custom_timezone;
276
+ }
277
+
278
+ $offset = get_option( 'gmt_offset' );
279
+ $hours = (int) $offset;
280
+ $minutes = ( $offset - floor( $offset ) ) * 60;
281
+ if( $hours < 10 ){
282
+ $hours = '0'+$hours;
283
+ }
284
+ echo $custom_timezone = sprintf( '%s:%s', $hours, $minutes );*/
285
+
286
+ }
287
+ return $custom_timezone;
288
+ }
289
+
290
+
291
+ function ahcfree_CleanupTimeZoneString($tzString){
292
+ $time = new DateTime('now',new DateTimeZone($tzString));
293
+ return $time->format('P');
294
+
295
+ /*$offset=$tzString;
296
+
297
+
298
+ if (preg_match('/^UTC[+-]/', $tzString)) {
299
+ $tzString= preg_replace('/UTC\+?/', '', $tzString);
300
+ }
301
+ if(is_numeric($tzString)){
302
+ $offset=sprintf('%02d:%02d', (int) $tzString, fmod(abs($tzString), 1) * 60);
303
+ if((int) $tzString>0){
304
+ $offset='+'.$offset;
305
+ }
306
+ }
307
+ return $offset;*/
308
+ }
309
+
310
+
311
+ function ahcfree_GetWPTimezoneString() {
312
+ // if site timezone string exists, return it
313
+ if ( $timezone = get_option( 'timezone_string' ) )
314
+ return $timezone;
315
+
316
+ // get UTC offset, if it isn't set then return UTC
317
+ if ( 0 === ( $utc_offset = get_option( 'gmt_offset', 0 ) ) )
318
+ return 'UTC';
319
+
320
+ // adjust UTC offset from hours to seconds
321
+ $utc_offset *= 3600;
322
+
323
+ // attempt to guess the timezone string from the UTC offset
324
+ if ( $timezone = timezone_name_from_abbr( '', $utc_offset, 0 ) ) {
325
+ return $timezone;
326
+ }
327
+
328
+ // last try, guess timezone string manually
329
+ $is_dst = date( 'I' );
330
+
331
+ foreach ( timezone_abbreviations_list() as $abbr ) {
332
+ foreach ( $abbr as $city ) {
333
+ if ( $city['dst'] == $is_dst && $city['offset'] == $utc_offset )
334
+ return $city['timezone_id'];
335
+ }
336
+ }
337
+
338
+ // fallback to UTC
339
+ return 'UTC';
340
+ }
341
+
342
+ function ahcfree_get_current_timezone_offset() {
343
+ $tz = ahcfree_get_timezone_string();
344
+ try {
345
+ $timeZone = new DateTimeZone($tz);
346
+ $date = new DateTime('now', $timeZone);
347
+ $date->setTimezone($timeZone);
348
+ } catch (Exception $e) {
349
+ $date = new DateTime('now');
350
+ }
351
+ return $date->format('P');
352
+ }
353
+
354
+ function ahcfree_last_hit_date() {
355
+ global $wpdb;
356
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
357
+ $sql = "SELECT max(CONVERT_TZ(vtr_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) as last_date FROM ahc_recent_visitors";
358
+ //echo $sql = "SELECT max(vtr_date)) as last_date FROM ahc_recent_visitors";
359
+ $result = $wpdb->get_results($sql, OBJECT);
360
+ if ($result !== false) {
361
+ return $result[0]->last_date;
362
+ }
363
+ return ahcfree_localtime('Y-m-d', time());
364
+ }
365
+
366
+ function ahcfree_getCountriesCount() {
367
+ global $wpdb;
368
+ $result = $wpdb->get_results("SELECT COUNT( `ctr_id` ) cnt FROM ahc_countries", OBJECT);
369
+ if ($result !== false) {
370
+ return $result[0]->cnt;
371
+ }
372
+ return false;
373
+ }
374
+
375
+ function ahcfree_getBrowsersCount() {
376
+ global $wpdb;
377
+ $result = $wpdb->get_results("SELECT COUNT( `bsr_id` ) cnt FROM ahc_browsers", OBJECT);
378
+ if ($result !== false) {
379
+ return $result[0]->cnt;
380
+ }
381
+ return false;
382
+ }
383
+
384
+ function ahcfree_getSearchEnginesCount() {
385
+ global $wpdb;
386
+ $result = $wpdb->get_results("SELECT COUNT( `srh_id` ) cnt FROM ahc_search_engines", OBJECT);
387
+ if ($result !== false) {
388
+ return $result[0]->cnt;
389
+ }
390
+ return false;
391
+ }
392
+
393
+ function ahcfree_set_default_options() {
394
+ // plugin activation
395
+
396
+ if ( is_plugin_active( 'visitors-traffic-real-time-statistics-pro/visitors-traffic-real-time-statistics-pro.php' ) ) {
397
+ deactivate_plugins('visitors-traffic-real-time-statistics-pro/visitors-traffic-real-time-statistics-pro.php');
398
+ }
399
+ require_once("database_basics_data.php");
400
+ if (get_option('ahcfree_wp_hits_counter_options') === false) {
401
+
402
+
403
+ $plugin_options = array();
404
+ $plugin_options['ahc_version'] = '1.0';
405
+ $plugin_options['available_languages'] = array('ar' => 'عربي', 'en' => 'English');
406
+ $plugin_options['ahc_lang'] = 'en';
407
+ $plugin_options['user_roles_to_not_track'] = array('administrator' => true, 'editor' => true, 'author' => true, 'contributor' => true, 'subscriber' => false);
408
+ add_option('ahcfree_wp_hits_counter_options', $plugin_options);
409
+ }
410
+ set_time_limit(300);
411
+ if (ahcfree_create_database_tables()) {
412
+
413
+ if (ahcfree_getVisitsTime() > 25) {
414
+ global $wpdb;
415
+ $result = $wpdb->get_results("DELETE FROM ahc_visits_time where `vtm_id` > 24", OBJECT);
416
+ }
417
+
418
+ if (ahcfree_getCountriesCount() == 0) {
419
+ ahcfree_insert_countries_into_table($internetCountryCodes, $contriesLatLng);
420
+ }
421
+
422
+ if (ahcfree_getVisitsTime() == 0) {
423
+ ahcfree_insert_visit_times_into_table($dayHours);
424
+ }
425
+
426
+ if (ahcfree_getSearchEnginesCount() == 0) {
427
+ ahcfree_insert_search_engines_into_table($searchEngines);
428
+ }
429
+
430
+ if (ahcfree_getBrowsersCount() == 0) {
431
+ ahcfree_insert_browsers_into_table($browsers);
432
+ }
433
+ }
434
+
435
+
436
+ ahcfree_update_tables();
437
+ }
438
+
439
+ //--------------------------------------------
440
+ /**
441
+ * Called when plugin is deactivated
442
+ *
443
+ * @return void
444
+ */
445
+ function ahcfree_unset_default_options() {
446
+
447
+ }
448
+
449
+ //--------------------------------------------
450
+ /**
451
+ * Creates plugin page link in the admin menu
452
+ *
453
+ * @uses add_menu_page()
454
+ * @uses plugins_url()
455
+ *
456
+ * @return void
457
+ */
458
+ function ahcfree_create_admin_menu_link() {
459
+
460
+ global $current_user;
461
+ $ahcproUserRole = explode(',',get_option('ahcproUserRoles'));
462
+
463
+ $roles_arr = array();
464
+
465
+ foreach($ahcproUserRole as $v) {
466
+ $roles_arr[] = $v;
467
+ }
468
+
469
+ $current_use_roles_ = $current_user->roles;
470
+ if (! in_array( $current_use_roles_, $roles_arr )) {
471
+
472
+ if(!(current_user_can('manage_options')))
473
+ {
474
+ return;
475
+ }
476
+ }
477
+
478
+
479
+
480
+ add_menu_page('Visitor Traffic Real Time Statistics Free', 'Visitor Traffic', 'read', 'ahc_hits_counter_menu_free', 'ahcfree_create_plugin_overview_page', plugins_url('/images/vtrts.png', AHCFREE_PLUGIN_MAIN_FILE));
481
+ add_submenu_page('ahc_hits_counter_menu_free', 'Visitor Traffic Real Time Statistics Settings', 'Settings', 'read', 'ahc_hits_counter_settings', 'ahcfree_create_plugin_settings_page');
482
+ add_submenu_page('ahc_hits_counter_menu_free', 'Visitor Traffic Real Time Statistics Support', 'Help', 'read', 'ahc_hits_counter_help', 'ahcfree_create_plugin_help_page');
483
+ add_submenu_page('ahc_hits_counter_menu_free', 'Visitor Traffic Real Time Statistics Support', 'More Products', 'read', 'ahc_hits_counter_about', 'ahcfree_create_plugin_about_page');
484
+ $ahcfree_custom_timezone = get_option( 'ahcfree_custom_timezone', false );
485
+ if( !$ahcfree_custom_timezone ){
486
+ add_action('admin_notices', 'ahcfree_admin_notice_to_set_timezone');
487
+ }
488
+ $page = isset($_GET['page']) ? ahcfree_sanitizing($_GET['page']) : '';
489
+
490
+
491
+
492
+ if($page == 'ahc_hits_counter_settings' ){
493
+ remove_action('admin_notices', 'ahcfree_admin_notice_to_set_timezone');
494
+ }
495
+ }
496
+
497
+ //--------------------------------------------
498
+ /**
499
+ * Format numbers
500
+ *
501
+ * @return number
502
+ */
503
+ function ahc_free_NumFormat($num) {
504
+ if ($num > 1000) {
505
+ return number_format($num, 0, ',', ',');
506
+ } else {
507
+ return $num;
508
+ }
509
+ }
510
+
511
+ //------
512
+ function ahcfree_countOnlineusers() {
513
+ global $wpdb;
514
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
515
+
516
+
517
+ //$sql = "SELECT id FROM ahc_online_users WHERE `date` >= '". ahcfree_localtime("Y-m-d H:i:s", strtotime('-1 minute') ) ."' GROUP BY hit_ip_address";
518
+
519
+ $sql = "SELECT DISTINCT hit_ip_address FROM `ahc_online_users` WHERE `date` >= DATE_ADD('". ahcfree_localtime("Y-m-d H:i:s" ) ."', INTERVAL -2 MINUTE) ";
520
+
521
+
522
+ $result = $wpdb->get_results($sql, OBJECT);
523
+ $online_users = "0";
524
+ if ($result !== false) {
525
+ $online_users = count($result);
526
+ //return $result[0]->onlineusers;
527
+ //echo json_encode($result[0]->onlineusers);
528
+ }
529
+ if( is_admin() ){
530
+ echo json_encode($online_users);
531
+ die;
532
+ }else{
533
+ return $online_users;
534
+ }
535
+
536
+ //return '0';
537
+
538
+ }
539
+
540
+ function ahcfree_init()
541
+ {
542
+ add_action('wp_ajax_ahcfree_countOnlineusers','ahcfree_countOnlineusers');
543
+ add_action('wp_ajax_ahcfree_track_visitor','ahcfree_track_visitor');
544
+ add_action('wp_ajax_nopriv_ahcfree_track_visitor','ahcfree_track_visitor');
545
+ }
546
+ add_action('admin_init','ahcfree_init');
547
+
548
+ function ahcfree_enqueue_scripts()
549
+ {
550
+ global $post, $wp_query;
551
+ $post_id = "HOMEPAGE";
552
+ $page_title = '';
553
+ $post_type = '';
554
+ if(is_singular() || is_page() )
555
+ {
556
+ $post_id = $post->ID;
557
+ $page_title = get_the_title($post->ID);
558
+ $post_type = get_post_type($post->ID);
559
+ }
560
+ if ( is_home() ) {
561
+ $post_id = "BLOGPAGE";
562
+ }
563
+ if( is_archive() ){
564
+ $post_id = get_the_archive_title();
565
+ }
566
+ wp_register_script('ahc_front_js', plugins_url('/js/front.js', AHCFREE_PLUGIN_MAIN_FILE),'jquery', '', false);
567
+ wp_enqueue_script('ahc_front_js');
568
+
569
+ wp_localize_script('ahc_front_js', 'ahc_ajax_front', array('ajax_url' => admin_url('admin-ajax.php'),
570
+ 'page_id' => $post_id,
571
+ 'page_title'=> $page_title,
572
+ 'post_type'=> $post_type
573
+ ));
574
+ }
575
+ add_action('wp_enqueue_scripts','ahcfree_enqueue_scripts', 1);
576
+ //--------------------------------------------
577
+ /**
578
+ * Creates the main overview page
579
+ *
580
+ * @return void
581
+ */
582
+ function ahcfree_create_plugin_overview_page() {
583
+ require_once(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . 'lang' . AHCFREE_DS . GlobalsAHC::$lang . '_lang.php');
584
+ include("overview.php");
585
+ }
586
+
587
+ //--------------------------------------------
588
+ /**
589
+ * Creates the plugin settings
590
+ *
591
+ * @return void
592
+ */
593
+ function ahcfree_create_plugin_settings_page() {
594
+
595
+ require_once(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . 'lang' . AHCFREE_DS . GlobalsAHC::$lang . '_lang.php');
596
+ include("ahc_settings.php");
597
+ }
598
+
599
+ //--------------------------------------------
600
+ /**
601
+ * Creates the plugin help page
602
+ *
603
+ * @return void
604
+ */
605
+ function ahcfree_create_plugin_help_page() {
606
+
607
+ require_once(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . 'lang' . AHCFREE_DS . GlobalsAHC::$lang . '_lang.php');
608
+ include("ahc_help.php");
609
+ }
610
+
611
+ //--------------------------------------------
612
+ /**
613
+ * Creates the plugin help page
614
+ *
615
+ * @return void
616
+ */
617
+ function ahcfree_create_plugin_about_page() {
618
+
619
+ require_once(AHCFREE_PLUGIN_ROOT_DIR . AHCFREE_DS . 'lang' . AHCFREE_DS . GlobalsAHC::$lang . '_lang.php');
620
+ include("ahc_about.php");
621
+ }
622
+
623
+ //--------------------------------------------
624
+ /**
625
+ * Returns links array of available languages
626
+ *
627
+ * @uses get_option()
628
+ * @uses add_query_arg()
629
+ *
630
+ * @return array
631
+ */
632
+ function ahcfree_get_change_lang_links() {
633
+ $plugin_options = get_option('ahcfree_wp_hits_counter_options');
634
+ $links = array();
635
+ $i = 0;
636
+ foreach ($plugin_options['available_languages'] as $key => $value) {
637
+ if (GlobalsAHC::$lang != $key) {
638
+ $links[$i]['name'] = $value;
639
+ $links[$i]['href'] = add_query_arg('ahc_lang', $key);
640
+ $i++;
641
+ }
642
+ }
643
+ unset($plugin_options);
644
+ unset($i);
645
+ return $links;
646
+ }
647
+
648
+ //--------------------------------------------
649
+ /**
650
+ * Decides whether or not should track the current visitor
651
+ *
652
+ * @uses is_user_logged_in()
653
+ * @uses WP_User::$roles
654
+ *
655
+ * @return boolean
656
+ */
657
+ function ahcfree_should_track_visitor() {
658
+ global $current_user;
659
+ $allow = true;
660
+ if (is_user_logged_in()) {
661
+ $user = new WP_User($current_user->ID);
662
+ if (!empty($user->roles) && is_array($user->roles)) {
663
+ foreach ($user->roles as $role) {
664
+ $found = (isset(GlobalsAHC::$plugin_options['user_roles_to_not_track'][$role])) ? GlobalsAHC::$plugin_options['user_roles_to_not_track'][$role] : false;
665
+ if ($found) {
666
+ $allow = false;
667
+ break;
668
+ }
669
+ }
670
+ }
671
+ }
672
+ return $allow;
673
+ }
674
+
675
+ //--------------------------------------------
676
+ /**
677
+ * Returns true if the current user has administrator role
678
+ *
679
+ * @uses is_user_logged_in()
680
+ * @uses WP_User::$roles
681
+ *
682
+ * @return boolean
683
+ */
684
+ function ahcfree_has_administrator_role() {
685
+ global $user_ID;
686
+ $is_admin = false;
687
+ if (is_user_logged_in()) {
688
+ $user = new WP_User($user_ID);
689
+ if (!empty($user->roles) && is_array($user->roles)) {
690
+ foreach ($user->roles as $role) {
691
+ if ($role == 'administrator') {
692
+ $is_admin = true;
693
+ break;
694
+ }
695
+ }
696
+ }
697
+ }
698
+ return $is_admin;
699
+ }
700
+
701
+ //--------------------------------------------
702
+ /**
703
+ * Check if column exist or not
704
+ *
705
+ * @uses wpdb::query()
706
+ *
707
+ * @return boolean
708
+ */
709
+ function ahcfree_check_table_column_exists($table_name, $column_name) {
710
+ global $wpdb;
711
+ $column = $wpdb->get_row($wpdb->prepare("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s AND COLUMN_NAME = %s ", DB_NAME, $table_name, $column_name));
712
+
713
+ if (!empty($column)) {
714
+ return true;
715
+ }
716
+ return false;
717
+ }
718
+
719
+ //--------------------------------------------
720
+ /**
721
+ * Check if Table exist or not
722
+ *
723
+ * @uses wpdb::query()
724
+ *
725
+ * @return boolean
726
+ */
727
+ function ahcfree_check_table_exists($table_name) {
728
+ global $wpdb;
729
+ $table_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s", DB_NAME, $table_name));
730
+
731
+ if (!empty($table_data)) {
732
+ return true;
733
+ }
734
+ return false;
735
+ }
736
+
737
+
738
+ //--------------------------------------------
739
+ /**
740
+ * Creates database updates plugin tables
741
+ *
742
+ * @uses wpdb::query()
743
+ *
744
+ * @return boolean
745
+ */
746
+ function ahcfree_update_tables() {
747
+ global $wpdb;
748
+ $sqlQueries = array();
749
+
750
+ $sqlQueries[] = " drop table IF EXISTS `ahc_settings` ";
751
+ $sqlQueries[] = "
752
+ CREATE TABLE IF NOT EXISTS `ahc_settings` (
753
+ `set_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
754
+ `set_hits_days` int(10) unsigned NOT NULL DEFAULT '14',
755
+ `set_ajax_check` int(10) unsigned NOT NULL DEFAULT '10',
756
+ `set_ips` text DEFAULT NULL,
757
+ `set_google_map` varchar(100) NOT NULL DEFAULT 'today_visitors',
758
+
759
+ PRIMARY KEY (`set_id`)
760
+ ) DEFAULT CHARSET=utf8";
761
+
762
+ //$sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_city` varchar(230) NULL";
763
+ //$sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_region` varchar(230) NULL";
764
+
765
+ /* code for error handling : "duplicate column name" : Taslim -Prism */
766
+ if ( ahcfree_check_table_exists('ahc_recent_visitors') === true && ahcfree_check_table_column_exists('ahc_recent_visitors', 'ahc_city') === false ) {
767
+ $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_city` varchar(230) NULL";
768
+ }
769
+
770
+ if ( ahcfree_check_table_exists('ahc_recent_visitors') === true && ahcfree_check_table_column_exists('ahc_recent_visitors', 'ahc_region') === false ) {
771
+ $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_region` varchar(230) NULL";
772
+ }
773
+
774
+ foreach ($sqlQueries as $sql) {
775
+ if ($wpdb->query($sql) === false) {
776
+ return false;
777
+ }
778
+ }
779
+
780
+
781
+ return true;
782
+ }
783
+
784
+
785
+ function ahcfree_add_settings() {
786
+
787
+ global $wpdb;
788
+ ahcfree_update_tables();
789
+
790
+ $sql1 = "truncate table `ahc_settings`";
791
+ $wpdb->query($sql1);
792
+
793
+ $sql = "insert into `ahc_settings` (set_id, set_hits_days, set_ajax_check, set_ips, set_google_map) values (1, 14, 15, null, 'today_visitors')";
794
+
795
+
796
+ if ($wpdb->query($sql) === false) {
797
+ return false;
798
+ }
799
+ return true;
800
+ }
801
+
802
+ //--------------------------------------------
803
+ /**
804
+ * Creates database plugin tables
805
+ *
806
+ * @uses wpdb::query()
807
+ *
808
+ * @return boolean
809
+ */
810
+ function ahcfree_create_database_tables() {
811
+ global $wpdb;
812
+ $sqlQueries = array();
813
+
814
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_online_users`
815
+ (
816
+ `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
817
+ PRIMARY KEY(`id`),
818
+ `hit_ip_address` VARCHAR(50) NOT NULL,
819
+ `hit_page_id` VARCHAR(30) NOT NULL,
820
+ `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
821
+ ) DEFAULT CHARSET=utf8";
822
+
823
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_hits`
824
+ (
825
+ `hit_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
826
+ PRIMARY KEY(`hit_id`),
827
+ `hit_ip_address` VARCHAR(50) NOT NULL,
828
+ `hit_user_agent` VARCHAR(200) NOT NULL,
829
+ `hit_request_uri` VARCHAR(200) NULL,
830
+ `hit_page_id` VARCHAR(30) NOT NULL,
831
+ `hit_page_title` VARCHAR(200) NULL,
832
+ `ctr_id` INT(3) UNSIGNED NULL,
833
+ `hit_referer` VARCHAR(300) NULL,
834
+ `hit_referer_site` VARCHAR(100) NULL,
835
+ `srh_id` INT(3) UNSIGNED NULL,
836
+ `hit_search_words` VARCHAR(200) NULL,
837
+ `bsr_id` INT(3) UNSIGNED NOT NULL,
838
+ `hit_date` DATE NOT NULL,
839
+ `hit_time` TIME NOT NULL
840
+ ) DEFAULT CHARSET=utf8";
841
+
842
+
843
+ $sqlQueries[] = "
844
+ CREATE TABLE IF NOT EXISTS `ahc_settings` (
845
+ `set_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
846
+ `set_hits_days` int(10) unsigned NOT NULL DEFAULT '14',
847
+ `set_ajax_check` int(10) unsigned NOT NULL DEFAULT '10',
848
+ `set_ips` text DEFAULT NULL,
849
+ `set_google_map` varchar(100) NOT NULL DEFAULT 'today_visitors',
850
+
851
+ PRIMARY KEY (`set_id`)
852
+ ) DEFAULT CHARSET=utf8";
853
+
854
+
855
+
856
+
857
+
858
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_browsers`
859
+ (
860
+ `bsr_id` INT(3) UNSIGNED NOT NULL,
861
+ PRIMARY KEY(`bsr_id`),
862
+ `bsr_name` VARCHAR(100) NOT NULL,
863
+ `bsr_icon` VARCHAR(50),
864
+ `bsr_visits` INT(11) NOT NULL DEFAULT 0
865
+ ) DEFAULT CHARSET=utf8";
866
+
867
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_search_engines`
868
+ (
869
+ `srh_id` INT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
870
+ PRIMARY KEY(`srh_id`),
871
+ `srh_name` VARCHAR(100) NOT NULL,
872
+ `srh_query_parameter` VARCHAR(10) NOT NULL,
873
+ `srh_icon` VARCHAR(50),
874
+ `srh_identifier` VARCHAR(50)
875
+ ) DEFAULT CHARSET=utf8";
876
+
877
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_search_engine_crawlers`
878
+ (
879
+ `bot_name` VARCHAR(50) NOT NULL,
880
+ `srh_id` INT(3) UNSIGNED NOT NULL
881
+ ) DEFAULT CHARSET=utf8";
882
+
883
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_countries`
884
+ (
885
+ `ctr_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
886
+ PRIMARY KEY(`ctr_id`),
887
+ `ctr_name` VARCHAR(100) NOT NULL,
888
+ `ctr_internet_code` VARCHAR(5) NOT NULL,
889
+ `ctr_latitude` VARCHAR(30) NULL,
890
+ `ctr_longitude` VARCHAR(30) NULL,
891
+ `ctr_visitors` INT(11) NOT NULL DEFAULT 0,
892
+ `ctr_visits` INT(11) NOT NULL DEFAULT 0
893
+ ) DEFAULT CHARSET=utf8";
894
+
895
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_visitors`
896
+ (
897
+ `vst_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
898
+ PRIMARY KEY (`vst_id`),
899
+ `vst_date` DATE NOT NULL,
900
+ `vst_visitors` INT(11) UNSIGNED NULL DEFAULT 0,
901
+ `vst_visits` INT(11) UNSIGNED NULL DEFAULT 0
902
+ ) DEFAULT CHARSET=utf8";
903
+
904
+ $sqlQueries[] = "ALTER TABLE `ahc_visitors` CHANGE `vst_date` `vst_date` DATETIME NOT NULL";
905
+
906
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_daily_visitors_stats`
907
+ (
908
+ `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
909
+ PRIMARY KEY (`id`),
910
+ `vst_date` DATETIME NOT NULL,
911
+ `vst_visitors` INT(11) UNSIGNED NULL DEFAULT 0,
912
+ `vst_visits` INT(11) UNSIGNED NULL DEFAULT 0
913
+ ) DEFAULT CHARSET=utf8";
914
+
915
+
916
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_searching_visits`
917
+ (
918
+ `vtsh_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
919
+ PRIMARY KEY (`vtsh_id`),
920
+ `srh_id` INT(3) UNSIGNED NOT NULL,
921
+ `vtsh_date` DATE NOT NULL,
922
+ `vtsh_visits` INT(11) UNSIGNED NOT NULL DEFAULT 0
923
+ ) DEFAULT CHARSET=utf8";
924
+
925
+ $sqlQueries[] = "ALTER TABLE `ahc_searching_visits` CHANGE `vtsh_date` `vtsh_date` DATETIME NOT NULL";
926
+
927
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_refering_sites`
928
+ (
929
+ `rfr_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
930
+ PRIMARY KEY (`rfr_id`),
931
+ `rfr_site_name` VARCHAR(100) NOT NULL,
932
+ `rfr_visits` INT(11) UNSIGNED NULL DEFAULT 0
933
+ ) DEFAULT CHARSET=utf8";
934
+
935
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_recent_visitors`
936
+ (
937
+ `vtr_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
938
+ PRIMARY KEY (`vtr_id`),
939
+ `vtr_ip_address` VARCHAR(50) NOT NULL,
940
+ `vtr_referer` VARCHAR(300) NULL,
941
+ `srh_id` INT(3) UNSIGNED NULL,
942
+ `bsr_id` INT(3) UNSIGNED NOT NULL,
943
+ `ctr_id` INT(5) UNSIGNED NULL,
944
+ `vtr_date` DATE NOT NULL,
945
+ `vtr_time` TIME NOT NULL
946
+ ) DEFAULT CHARSET=utf8";
947
+
948
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_keywords`
949
+ (
950
+ `kwd_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
951
+ PRIMARY KEY (`kwd_id`),
952
+ `kwd_ip_address` VARCHAR(50) NOT NULL,
953
+ `kwd_keywords` VARCHAR(200) NOT NULL,
954
+ `kwd_referer` VARCHAR(300) NOT NULL,
955
+ `srh_id` INT(3) UNSIGNED NOT NULL,
956
+ `ctr_id` INT(5) UNSIGNED NULL,
957
+ `bsr_id` INT(3) UNSIGNED NOT NULL,
958
+ `kwd_date` DATE NOT NULL,
959
+ `kwd_time` TIME NOT NULL
960
+ ) DEFAULT CHARSET=utf8";
961
+
962
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_title_traffic`
963
+ (
964
+ `til_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
965
+ PRIMARY KEY (`til_id`),
966
+ `til_page_id` VARCHAR(30) NOT NULL,
967
+ `til_page_title` VARCHAR(100),
968
+ `til_hits` INT(11) UNSIGNED NOT NULL
969
+ ) DEFAULT CHARSET=utf8";
970
+
971
+ $sqlQueries[] = "CREATE TABLE IF NOT EXISTS `ahc_visits_time`
972
+ (
973
+ `vtm_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
974
+ PRIMARY KEY (`vtm_id`),
975
+ `vtm_time_from` TIME NOT NULL,
976
+ `vtm_time_to` TIME NOT NULL,
977
+ `vtm_visitors` INT(11) UNSIGNED NOT NULL DEFAULT 0,
978
+ `vtm_visits` INT(11) UNSIGNED NOT NULL DEFAULT 0
979
+ ) DEFAULT CHARSET=utf8";
980
+
981
+
982
+ /* $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_city` varchar(230) NULL";
983
+
984
+ $sqlQueries[] = "alter table `ahc_recent_visitors` add COLUMN `ahc_region` varchar(230) NULL";
985
+ */
986
+
987
+
988
+ foreach ($sqlQueries as $sql) {
989
+ if ($wpdb->query($sql) === false) {
990
+ return false;
991
+ }
992
+ }
993
+ return true;
994
+ }
995
+
996
+ //--------------------------------------------
997
+ /**
998
+ * Inserts countries into ahc_countroes table
999
+ *
1000
+ * @uses wpdb::insert()
1001
+ *
1002
+ * @param array $internetCountryCodes. internet codes and names of countries
1003
+ * @param array $contriesLatLng. LatLng of countries
1004
+ * @return boolean
1005
+ */
1006
+ function ahcfree_insert_countries_into_table($internetCountryCodes, $contriesLatLng) {
1007
+ global $wpdb;
1008
+ $c = 1;
1009
+ $length = count($internetCountryCodes);
1010
+ foreach ($internetCountryCodes as $internetCode => $countryName) {
1011
+ $ctr_latitude = $ctr_longitude = NULL;
1012
+ if (isset($contriesLatLng[$internetCode])) {
1013
+ $ctr_latitude = $contriesLatLng[$internetCode][0];
1014
+ $ctr_longitude = $contriesLatLng[$internetCode][1];
1015
+ }
1016
+ $result = $wpdb->insert('ahc_countries', array(
1017
+ 'ctr_name' => $countryName,
1018
+ 'ctr_internet_code' => $internetCode,
1019
+ 'ctr_latitude' => $ctr_latitude,
1020
+ 'ctr_longitude' => $ctr_longitude
1021
+ ), array(
1022
+ '%s', '%s', '%s', '%s'
1023
+ )
1024
+ );
1025
+ if ($result === false) {
1026
+ return false;
1027
+ }
1028
+ }
1029
+ return true;
1030
+ }
1031
+
1032
+ //--------------------------------------------
1033
+ /**
1034
+ * Inserts search engines into ahc_search_engines table
1035
+ *
1036
+ * @uses wpdb::insert()
1037
+ * @uses wpdb::$insert_id
1038
+ *
1039
+ * @param array $searchEngines.
1040
+ * @return boolean
1041
+ */
1042
+ function ahcfree_insert_search_engines_into_table($searchEngines) {
1043
+ global $wpdb;
1044
+ foreach ($searchEngines as $se) {
1045
+ $result = $wpdb->insert('ahc_search_engines', array(
1046
+ 'srh_name' => $se['srh_name'],
1047
+ 'srh_query_parameter' => $se['srh_query_parameter'],
1048
+ 'srh_icon' => $se['srh_icon'],
1049
+ 'srh_identifier' => $se['srh_identifier']
1050
+ ), array(
1051
+ '%s', '%s', '%s', '%s'
1052
+ )
1053
+ );
1054
+ if ($result !== false) {
1055
+ $srh_id = $wpdb->insert_id;
1056
+ foreach ($se['crawlers'] as $crawler) {
1057
+ $result2 = $wpdb->insert('ahc_search_engine_crawlers', array(
1058
+ 'bot_name' => $crawler,
1059
+ 'srh_id' => $srh_id
1060
+ ), array(
1061
+ '%s', '%d'
1062
+ )
1063
+ );
1064
+ if ($result2 === false) {
1065
+ return false;
1066
+ }
1067
+ }
1068
+ } else {
1069
+ return false;
1070
+ }
1071
+ }
1072
+ return true;
1073
+ }
1074
+
1075
+ //--------------------------------------------
1076
+ /**
1077
+ * Inserts browsers into ahc_browsers table
1078
+ *
1079
+ * @uses wpdb::insert()
1080
+ *
1081
+ * @param array $browsers
1082
+ * @return boolean
1083
+ */
1084
+ function ahcfree_insert_browsers_into_table($browsers) {
1085
+ global $wpdb;
1086
+ foreach ($browsers as $browser) {
1087
+ $result = $wpdb->insert('ahc_browsers', array(
1088
+ 'bsr_id' => $browser['bsr_id'],
1089
+ 'bsr_name' => $browser['bsr_name'],
1090
+ 'bsr_icon' => $browser['bsr_icon']
1091
+ ), array(
1092
+ '%d', '%s', '%s'
1093
+ )
1094
+ );
1095
+ if ($result === false) {
1096
+ return false;
1097
+ }
1098
+ }
1099
+ return true;
1100
+ }
1101
+
1102
+ //--------------------------------------------
1103
+ /**
1104
+ * Inserts periods into ahc_visits_time table
1105
+ *
1106
+ * @uses wpdb::insert()
1107
+ *
1108
+ * @param array $dayHours
1109
+ * @return boolean
1110
+ */
1111
+ function ahcfree_insert_visit_times_into_table($dayHours) {
1112
+ global $wpdb;
1113
+ foreach ($dayHours as $t) {
1114
+ $result = $wpdb->insert('ahc_visits_time', array(
1115
+ 'vtm_time_from' => $t['vtm_time_from'],
1116
+ 'vtm_time_to' => $t['vtm_time_to'],
1117
+ 'vtm_visitors' => 0
1118
+ ), array(
1119
+ '%s', '%s', '%d'
1120
+ )
1121
+ );
1122
+ if ($result === false) {
1123
+ return false;
1124
+ }
1125
+ }
1126
+ return true;
1127
+ }
1128
+
1129
+ //--------------------------------------------
1130
+ /**
1131
+ * Returns the first and last days of the week of the date you pass
1132
+ *
1133
+ * @param string $date
1134
+ * @param string $format Optional
1135
+ * @return array
1136
+ */
1137
+ function ahcfree_get_week_limits($date, $format = 'Y-m-d') {
1138
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1139
+ $beginingDay = new DateTime($date);
1140
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1141
+ $endingDay = new DateTime($date);
1142
+ $date = new DateTime($date);
1143
+ /*
1144
+ switch ($date->format('w')) {
1145
+ case 0: // sun
1146
+ //$beginingDay->modify('-1 day');
1147
+ $endingDay->modify('+6 day');
1148
+ break;
1149
+
1150
+ case 1: // mon
1151
+ $beginingDay->modify('-1 day');
1152
+ $endingDay->modify('+5 day');
1153
+ break;
1154
+
1155
+ case 2: // Tue
1156
+ $beginingDay->modify('-2 day');
1157
+ $endingDay->modify('+4 day');
1158
+ break;
1159
+
1160
+ case 3: // Wed
1161
+ $beginingDay->modify('-3 day');
1162
+ $endingDay->modify('+3 day');
1163
+ break;
1164
+
1165
+ case 4: // Thu
1166
+ $beginingDay->modify('-4 day');
1167
+ $endingDay->modify('+2 day');
1168
+ break;
1169
+
1170
+ case 6: // Fri
1171
+ $beginingDay->modify('-5 day');
1172
+ $endingDay->modify('+1 day');
1173
+ break;
1174
+ }*/
1175
+
1176
+ $beginingDay->modify('-6 day');
1177
+ //$endingDay->modify();
1178
+
1179
+ $day = ahcfree_localtime('w');
1180
+
1181
+ //$beginingDay->modify('-'.$day.' days');
1182
+ //$endingDay->modify('+'.(6-$day).' days');
1183
+ return array(0 => $beginingDay->format($format), 1 => $endingDay->format($format));
1184
+ }
1185
+
1186
+ //--------------------------------------------
1187
+ /**
1188
+ * Return summary statistics of visitors and visits
1189
+ *
1190
+ * @return array
1191
+ */
1192
+ function ahcfree_get_summary_statistics() {
1193
+ $arr = array();
1194
+ $arr['today'] = ahcfree_get_visitors_visits_in_period('today');
1195
+ $arr['yesterday'] = ahcfree_get_visitors_visits_in_period('yesterday');
1196
+ $arr['week'] = ahcfree_get_visitors_visits_in_period('week'); // last 7 days
1197
+ $arr['month'] = ahcfree_get_visitors_visits_in_period('month');
1198
+ $arr['year'] = ahcfree_get_visitors_visits_in_period('year');
1199
+ $arr['total'] = ahcfree_get_visitors_visits_in_period();
1200
+ return $arr;
1201
+ }
1202
+
1203
+ //--------------------------------------------
1204
+ /**
1205
+ * Return counts visitors and visits in certain day (today|yesterday), certain period(last week, last month, last year) or total
1206
+ *
1207
+ * @uses wpdb::prepare()
1208
+ * @uses wpdb::get_results()
1209
+ *
1210
+ * @param string $period Optional
1211
+ * @return mixed
1212
+ */
1213
+ function ahcfree_get_visitors_visits_in_period($period = 'total') {
1214
+ global $wpdb;
1215
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1216
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1217
+ // echo AHCFREE_SERVER_CURRENT_TIMEZONE;
1218
+
1219
+ $current_date = new DateTime();
1220
+ $current_date->setTimezone($custom_timezone);
1221
+
1222
+
1223
+ $date = new DateTime();
1224
+ $date->setTimezone($custom_timezone);
1225
+
1226
+
1227
+ $sql = "SELECT SUM(vst_visitors) AS vst_visitors, SUM(vst_visits) AS vst_visits
1228
+ FROM `ahc_visitors`
1229
+ WHERE 1 = 1";
1230
+ $results = false;
1231
+ switch ($period) {
1232
+ case 'today':
1233
+
1234
+
1235
+ $sql .= " AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) = '". ahcfree_localtime('Y-m-d') ."'";
1236
+
1237
+
1238
+ //$sql .= " AND DATE(vst_date) = DATE(NOW())";
1239
+ $results = $wpdb->get_results($sql, OBJECT);
1240
+ break;
1241
+
1242
+ case 'yesterday':
1243
+ $date->modify('-1 day');
1244
+ $sql .= " AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) = %s";
1245
+ $results = $wpdb->get_results($wpdb->prepare($sql, $date->format('Y-m-d')), OBJECT);
1246
+ break;
1247
+
1248
+ case 'week': // last 7 days
1249
+ $limits = ahcfree_get_week_limits($date->format('Y-m-d'));
1250
+
1251
+ $sql .= " AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= %s AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= %s";
1252
+ $results = $wpdb->get_results($wpdb->prepare($sql, $limits[0], $limits[1]), OBJECT);
1253
+
1254
+ break;
1255
+
1256
+ case 'month':
1257
+
1258
+ $sql .= " AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= %s AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= %s";
1259
+ $results = $wpdb->get_results($wpdb->prepare($sql, $date->modify('-30 day')->format('Y-m-d'), $current_date->format('Y-m-d')), OBJECT);
1260
+
1261
+
1262
+ break;
1263
+
1264
+ case 'year':
1265
+ $sql .= " AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= %s AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= %s";
1266
+ //$results = $wpdb->get_results($wpdb->prepare($sql, $date->format('Y-01-01'), $date->format('Y-12-31')), OBJECT);
1267
+ $results = $wpdb->get_results($wpdb->prepare($sql, $date->modify('-365 day')->format('Y-m-d'), $current_date->format('Y-m-d')), OBJECT);
1268
+ break;
1269
+
1270
+ default:
1271
+ $results = $wpdb->get_results($sql, OBJECT);
1272
+ }
1273
+ //echo $wpdb->last_query.'<br />';
1274
+ if ($results !== false) {
1275
+ return array(
1276
+ 'visitors' => (empty($results[0]->vst_visitors) ? 0 : $results[0]->vst_visitors),
1277
+ 'visits' => (empty($results[0]->vst_visits) ? 0 : $results[0]->vst_visits)
1278
+ );
1279
+ } else {
1280
+ return false;
1281
+ }
1282
+ }
1283
+
1284
+ //--------------------------------------------
1285
+ /**
1286
+ * Return visits in a period from today
1287
+ *
1288
+ * @uses wpdb::prepare()
1289
+ * @uses wpdb::get_results()
1290
+ *
1291
+ * @return array
1292
+ */
1293
+ function ahcfree_get_visitors_visits_by_date() {
1294
+ global $wpdb;
1295
+ $lastDays = AHCFREE_VISITORS_VISITS_LIMIT - 1;
1296
+ $response = array();
1297
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1298
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1299
+ $beginning = new DateTime();
1300
+ $beginning->setTimezone($custom_timezone);
1301
+ $beginning->modify('-' . $lastDays . ' day');
1302
+
1303
+ $sql = "SELECT DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) as vst_date, vst_visitors, vst_visits
1304
+ FROM ahc_visitors
1305
+ WHERE DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1306
+
1307
+ $results = $wpdb->get_results($wpdb->prepare($sql, $beginning->format('Y-m-d')), OBJECT);
1308
+ if ($results !== false) {
1309
+ $response['success'] = true;
1310
+ $response['date'] = array();
1311
+ for ($i = count($results); $i < $lastDays; $i++) {
1312
+ $beginning->modify('+1 day');
1313
+ $response['data']['dates'][] = $beginning->format('d/m');
1314
+ $response['data']['visitors'][] = 0;
1315
+ $response['data']['visits'][] = 0;
1316
+ }
1317
+
1318
+ foreach ($results as $r) {
1319
+ $hitDate = new DateTime($r->vst_date);
1320
+ //$hitDate->setTimezone($custom_timezone);
1321
+ $response['data']['dates'][] = $hitDate->format('d/m');
1322
+ $response['data']['visitors'][] = $r->vst_visitors;
1323
+ $response['data']['visits'][] = $r->vst_visits;
1324
+ }
1325
+ } else {
1326
+ $response['success'] = false;
1327
+ }
1328
+ return $response;
1329
+ }
1330
+
1331
+ function ahcfree_get_visitors_by_date() {
1332
+ global $wpdb;
1333
+ $lastDays = AHCFREE_VISITORS_VISITS_LIMIT;
1334
+ $response = array();
1335
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1336
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1337
+ $beginning = new DateTime();
1338
+ $beginning->setTimezone($custom_timezone);
1339
+ $beginning->modify('-' . $lastDays . ' day');
1340
+
1341
+
1342
+ $sql = "SELECT DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) as vst_date, vst_visitors
1343
+ FROM ahc_visitors
1344
+ WHERE DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1345
+
1346
+ $results = $wpdb->get_results($wpdb->prepare($sql, $beginning->format('Y-m-d')), OBJECT);
1347
+
1348
+ if ($results !== false) {
1349
+ for ($i = count($results); $i < $lastDays; $i++) {
1350
+ $beginning->modify('+1 day');
1351
+ $xx .= "['" . $beginning->format('Y-m-d') . "', 0], ";
1352
+ }
1353
+ foreach ($results as $r) {
1354
+
1355
+ $hitDate = new DateTime($r->vst_date);
1356
+ //$hitDate->setTimezone($custom_timezone);
1357
+ $xx .= "['" . $hitDate->format('Y-m-d') . "', " . $r->vst_visitors . "], ";
1358
+ }
1359
+ }
1360
+ return '[' . $xx . ']';
1361
+ }
1362
+
1363
+ function ahcfree_get_visits_by_date() {
1364
+ global $wpdb;
1365
+ $lastDays = AHCFREE_VISITORS_VISITS_LIMIT;
1366
+ $response = array();
1367
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1368
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1369
+ $beginning = new DateTime();
1370
+ $beginning->setTimezone($custom_timezone);
1371
+ $beginning->modify('-' . $lastDays . ' day');
1372
+
1373
+ $sql = "SELECT DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) as vst_date, vst_visits
1374
+ FROM ahc_visitors
1375
+ WHERE DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1376
+
1377
+
1378
+ $results = $wpdb->get_results($wpdb->prepare($sql, $beginning->format('Y-m-d')), OBJECT);
1379
+ if ($results !== false) {
1380
+ for ($i = count($results); $i < $lastDays; $i++) {
1381
+ $beginning->modify('+1 day');
1382
+ $x .= "['" . $beginning->format('Y-m-d') . "', 0], ";
1383
+ }
1384
+ foreach ($results as $r) {
1385
+ $hitDate = new DateTime($r->vst_date);
1386
+ //$hitDate->setTimezone($custom_timezone);
1387
+ $x .= "['" . $hitDate->format('Y-m-d') . "', " . $r->vst_visits . "], ";
1388
+ }
1389
+ }
1390
+ return '[' . $x . ']';
1391
+ }
1392
+
1393
+ //--------------------------------------------
1394
+ /**
1395
+ * Return visitors visits that came from search engine in a period from today
1396
+ *
1397
+ * @uses wpdb::prepare()
1398
+ * @uses wpdb::get_results()
1399
+ *
1400
+ * @return array
1401
+ */
1402
+
1403
+
1404
+
1405
+
1406
+ function ahcfree_get_serch_visits_by_date() {
1407
+ global $wpdb;
1408
+
1409
+ $response = array();
1410
+ $sql = "SELECT ase.srh_name, asv.vtsh_date, asv.srh_id, SUM(asv.vtsh_visits) as vtsh_visits FROM `ahc_searching_visits` asv, `ahc_search_engines` ase where asv.srh_id = ase.srh_id GROUP by asv.srh_id order by SUM(asv.vtsh_visits) DESC";
1411
+
1412
+
1413
+ $results = $wpdb->get_results($sql, OBJECT);
1414
+
1415
+
1416
+ if ($results !== false) {
1417
+
1418
+ $response['success'] = true;
1419
+ $response['data']['dates'] = array();
1420
+
1421
+ foreach ($results as $r) {
1422
+
1423
+ $response['data']['search_engines'][$r->srh_name][] = $r->vtsh_visits;
1424
+
1425
+ }
1426
+ } else {
1427
+ $response['success'] = false;
1428
+ }
1429
+
1430
+ return $response;
1431
+ }
1432
+
1433
+
1434
+ //--------------------------------------------
1435
+ /**
1436
+ * Returns the total visits by search engines
1437
+ *
1438
+ * @uses wpdb::get_results()
1439
+ *
1440
+ * @return mixed
1441
+ */
1442
+ function ahcfree_get_total_visits_by_search_engines() {
1443
+ global $wpdb;
1444
+ $result = $wpdb->get_results("SELECT SUM(vtsh_visits) AS total FROM ahc_searching_visits", OBJECT);
1445
+ if ($result !== false) {
1446
+ return $result[0]->total;
1447
+ }
1448
+ return false;
1449
+ }
1450
+
1451
+ //--------------------------------------------
1452
+ /**
1453
+ * Return counts visits happened by search engine result in certain day (today|yesterday), certain period(last week, last month, last year) or total
1454
+ *
1455
+ * @uses wpdb::prepare()
1456
+ * @uses wpdb::get_results()
1457
+ *
1458
+ * @param string $period Optional
1459
+ * @return mixed
1460
+ */
1461
+ function ahcfree_get_hits_search_engines_referers($period = 'total') {
1462
+ global $wpdb;
1463
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1464
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
1465
+ $date = new DateTime();
1466
+ $date->setTimezone($custom_timezone);
1467
+ $sql = "SELECT ase.srh_name, asv.vtsh_date, asv.srh_id, SUM(asv.vtsh_visits) as vtsh_visits FROM `ahc_searching_visits` asv, `ahc_search_engines` ase where asv.srh_id = ase.srh_id ";
1468
+ $results = false;
1469
+ switch ($period) {
1470
+ case 'today':
1471
+ $sql .= " AND DATE(CONVERT_TZ(asv.vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) = '". ahcfree_localtime('Y-m-d') ."'";
1472
+
1473
+ $results = $wpdb->get_results($sql, OBJECT);
1474
+ break;
1475
+
1476
+ case 'yesterday':
1477
+ $date->modify('-1 day');
1478
+ $sql .= " AND DATE(CONVERT_TZ(asv.vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) = DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1479
+ $results = $wpdb->get_results($wpdb->prepare($sql, $date->format('Y-m-d')), OBJECT);
1480
+ break;
1481
+
1482
+ case 'week':
1483
+ $limits = ahcfree_get_week_limits($date->format('Y-m-d'));
1484
+ $sql .= " AND DATE(CONVERT_TZ(asv.vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) AND DATE(CONVERT_TZ(asv.vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1485
+ $results = $wpdb->get_results($wpdb->prepare($sql, $limits[0], $limits[1]), OBJECT);
1486
+ break;
1487
+
1488
+ case 'month':
1489
+ $sql .= " AND DATE(CONVERT_TZ(asv.vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ('" . $date->format('Y-m-01') . "', '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) AND DATE(CONVERT_TZ(asv.vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= DATE(CONVERT_TZ('" . $date->format('Y-m-t') . "', '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1490
+ $results = $wpdb->get_results($sql, $limits[0], $limits[1], OBJECT);
1491
+ break;
1492
+
1493
+ case 'year':
1494
+ $sql .= " AND DATE(CONVERT_TZ(asv.vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) AND DATE(CONVERT_TZ(asv.vtsh_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= DATE(CONVERT_TZ(%s, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'))";
1495
+ $results = $wpdb->get_results($wpdb->prepare($sql, $date->format('Y-01-01'), $date->format('Y-12-31')), OBJECT);
1496
+ break;
1497
+
1498
+ case 'alltime':
1499
+
1500
+ $sql .= " GROUP by asv.srh_id order by SUM(asv.vtsh_visits) DESC";
1501
+
1502
+ $results = $wpdb->get_results($sql, OBJECT);
1503
+ break;
1504
+
1505
+ default:
1506
+ }
1507
+
1508
+ $hitsReferers = array();
1509
+ if ($results !== false) {
1510
+ foreach ($results as $r) {
1511
+
1512
+ $hitsReferers[$r->srh_name] = $r->vtsh_visits;
1513
+ }
1514
+ return $hitsReferers;
1515
+ }
1516
+ return false;
1517
+ }
1518
+
1519
+ //--------------------------------------------
1520
+ /**
1521
+ * Retrieves all search engines
1522
+ *
1523
+ * @uses wpdb::get_results()
1524
+ *
1525
+ * @return mixed
1526
+ */
1527
+ function ahcfree_get_all_search_engines() {
1528
+ global $wpdb;
1529
+ $sql = "SELECT `srh_id`, `srh_name`, `srh_icon` FROM `ahc_search_engines`";
1530
+ $searchEngines = array();
1531
+ $c = 0;
1532
+ $results = $wpdb->get_results($sql, OBJECT);
1533
+ if ($results !== false) {
1534
+ foreach ($results as $re) {
1535
+ $searchEngines[$c]['srh_id'] = $re->srh_id;
1536
+ $searchEngines[$c]['srh_name'] = $re->srh_name;
1537
+ $searchEngines[$c]['srh_icon'] = $re->srh_icon;
1538
+ $c++;
1539
+ }
1540
+ return $searchEngines;
1541
+ }
1542
+ return false;
1543
+ }
1544
+
1545
+ //--------------------------------------------
1546
+ /**
1547
+ * Retrieves count of visits order by browsers
1548
+ *
1549
+ * @uses wpdb::get_results()
1550
+ *
1551
+ * @return array
1552
+ */
1553
+ function ahcfree_get_browsers_hits_counts() {
1554
+ global $wpdb;
1555
+ $sql = "SELECT `bsr_id`, `bsr_name`, `bsr_visits`
1556
+ FROM `ahc_browsers`
1557
+ WHERE `bsr_visits` > 0";
1558
+ $results = $wpdb->get_results($sql, OBJECT);
1559
+ $response = array();
1560
+ if ($results !== false) {
1561
+ $response['success'] = true;
1562
+ $response['data'] = array();
1563
+ $c = 0;
1564
+ foreach ($results as $bsr) {
1565
+ $response['data'][$c]['bsr_id'] = $bsr->bsr_id;
1566
+ $response['data'][$c]['bsr_name'] = $bsr->bsr_name;
1567
+ $response['data'][$c]['hits'] = $bsr->bsr_visits;
1568
+ $c++;
1569
+ }
1570
+ } else {
1571
+ $response['success'] = false;
1572
+ }
1573
+ return $response;
1574
+ }
1575
+
1576
+ //--------------------------------------------
1577
+ /**
1578
+ * Retrieves top referring sites
1579
+ *
1580
+ * @uses wpdb::prepare()
1581
+ * @uses wpdb::get_results()
1582
+ *
1583
+ * @return mixed
1584
+ */
1585
+ function ahcfree_get_top_refering_sites($start='',$limit='') {
1586
+ global $wpdb;
1587
+ $limitCond="";
1588
+ if($start!='' && $limit!='')
1589
+ {
1590
+ $sql = "SELECT rfr_site_name, rfr_visits
1591
+ FROM `ahc_refering_sites`
1592
+ ORDER BY rfr_visits DESC LIMIT %d, %d ";
1593
+
1594
+ $results = $wpdb->get_results($wpdb->prepare($sql, $start, $limit), OBJECT);
1595
+ }else{
1596
+ $sql = "SELECT rfr_site_name, rfr_visits
1597
+ FROM `ahc_refering_sites`
1598
+ ORDER BY rfr_visits DESC LIMIT 20 ";
1599
+ $results = $wpdb->get_results($sql, OBJECT);
1600
+ }
1601
+
1602
+
1603
+
1604
+
1605
+ if ($results !== false) {
1606
+ $arr = array();
1607
+ $c = 0;
1608
+ foreach ($results as $referer) {
1609
+ $arr[$c]['site_name'] = $referer->rfr_site_name;
1610
+ $arr[$c]['total_hits'] = $referer->rfr_visits;
1611
+ $c++;
1612
+ }
1613
+ return $arr;
1614
+ } else {
1615
+ return false;
1616
+ }
1617
+ }
1618
+
1619
+ //--------------------------------------------
1620
+ /**
1621
+ * Retrieves countries related to visits
1622
+ *
1623
+ * @uses wpdb::prepare()
1624
+ * @uses wpdb::get_results()
1625
+ *
1626
+ * @return mixed
1627
+ */
1628
+ function ahcfree_get_top_countries( $limit = 0,$start='',$pagelimit='' ,$all='',$cnt=true) {
1629
+ global $wpdb;
1630
+ if( $limit == 0 ){
1631
+ $limit = AHCFREE_TOP_COUNTRIES_LIMIT;
1632
+ }
1633
+
1634
+ if($cnt==true)
1635
+ {
1636
+ $sql = "SELECT count(*) FROM `ahc_countries` WHERE ctr_visits > 0 ORDER BY ctr_visitors DESC";
1637
+ $count = $wpdb->get_var($sql);
1638
+ return $count;
1639
+
1640
+ }
1641
+
1642
+ $limitCond = "";
1643
+ if($start !='' && $pagelimit!='')
1644
+ {
1645
+ $limitCond = " LIMIT $start,$pagelimit";
1646
+ }
1647
+
1648
+
1649
+ if($limit > 0 && $pagelimit == "" )
1650
+ {
1651
+ $sql = "SELECT ctr_name, ctr_internet_code, ctr_visitors, ctr_visits
1652
+ FROM `ahc_countries` WHERE ctr_visits > 0
1653
+ ORDER BY ctr_visitors DESC
1654
+ LIMIT %d OFFSET 0";
1655
+
1656
+ $results = $wpdb->get_results($wpdb->prepare($sql, $limit), OBJECT);
1657
+ }
1658
+ else
1659
+ {
1660
+ $sql = "SELECT ctr_name, ctr_internet_code, ctr_visitors, ctr_visits
1661
+ FROM `ahc_countries` WHERE ctr_visits > 0
1662
+ ORDER BY ctr_visitors DESC $limitCond";
1663
+ $results = $wpdb->get_results($sql, OBJECT);
1664
+ }
1665
+
1666
+ $response = array();
1667
+ if ($results !== false) {
1668
+ $new=array();
1669
+ $response['success'] = true;
1670
+ $response['data'] = array();
1671
+ $c = 0;
1672
+ if($start=="")
1673
+ $start = 0;
1674
+ $rank=$start+1;
1675
+ foreach ($results as $ctr) {
1676
+ $response['data'][$c]['rank'] = $rank;
1677
+ $furl = plugins_url('/images/flags/' . strtolower( $ctr->ctr_internet_code) . '.png', AHCFREE_PLUGIN_MAIN_FILE);
1678
+ $flag ='<img src="'.$furl.'" border="0" alt="'.$ctr->ctr_name.'" width="30" height="20" onerror="imgFlagError(this)" />';
1679
+ $response['data'][$c]['flag'] = $flag;
1680
+ $response['data'][$c]['ctr_name'] = $ctr->ctr_name;
1681
+ //$response['data'][$c]['ctr_internet_code'] = $ctr->ctr_internet_code;
1682
+ $response['data'][$c]['visitors'] = $ctr->ctr_visitors;
1683
+ $response['data'][$c]['visits'] = $ctr->ctr_visits;
1684
+
1685
+ if($all==1)
1686
+ {
1687
+ $new[$c]['rank'] = $rank;
1688
+ $new[$c]['ctr_name'] = $ctr->ctr_name;
1689
+ $new[$c]['visitors'] = $ctr->ctr_visitors;
1690
+ $new[$c]['visits'] = $ctr->ctr_visits;
1691
+ }
1692
+ $c++;
1693
+ $rank++;
1694
+ }
1695
+ } else {
1696
+ $response['success'] = false;
1697
+ }
1698
+ if($all==1)
1699
+ {
1700
+ return $new;
1701
+ }
1702
+ return $response;
1703
+ }
1704
+
1705
+ //--------------------------------------------
1706
+ /**
1707
+ * Retrieves countries related to visits
1708
+ *
1709
+ * @uses wpdb::prepare()
1710
+ * @uses wpdb::get_results()
1711
+ *
1712
+ * @return mixed
1713
+ */
1714
+ function ahcfree_get_vsitors_by_country($all,$cnt=true,$start='',$limit='',$fdt='',$tdt='') {
1715
+ global $wpdb;
1716
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1717
+ $vtr_date = "CONVERT_TZ(concat(vtr_date,' ',vtr_time), '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')";
1718
+ $cond="";
1719
+ if(isset($_POST['t_from_dt']) && $_POST['t_from_dt']!='' && isset($_POST['t_to_dt']) && $_POST['t_to_dt']!='' && isset($_POST['section']) && $_POST['section']=="traffic_index_country")
1720
+ {
1721
+ $fdt = $_POST['t_from_dt'];
1722
+ $tdt = $_POST['t_to_dt'];
1723
+ }
1724
+ else if(isset($_POST['t_from_dt']) && $_POST['t_from_dt']!='' && isset($_POST['section']) && $_POST['section']=="traffic_index_country")
1725
+ {
1726
+ $fdt = $_POST['t_from_dt'];
1727
+ $fromdt = ahcfree_getFormattedDate($_POST['t_from_dt'],'yymmdd');
1728
+ $cond =" and vtr_date ='$fromdt'";
1729
+ }
1730
+
1731
+ if($fdt!='' && $tdt!='')
1732
+ {
1733
+ $fromdt = ahcfree_getFormattedDate($fdt,'yymmdd');
1734
+ $todt = ahcfree_getFormattedDate($tdt,'yymmdd');
1735
+ $cond = "and (DATE($vtr_date) between '".$fromdt."' and '$todt')";
1736
+ //$cond =" and (vtr_date between '$fromdt' and '$todt')";
1737
+ }
1738
+ else if($fdt!='')
1739
+ {
1740
+ $fromdt = ahcfree_getFormattedDate($fdt,'yymmdd');
1741
+ $cond = "and DATE($vtr_date) = '".$fromdt."'";
1742
+ //$cond =" and vtr_date ='$fromdt'";
1743
+ }
1744
+ else
1745
+ {
1746
+ $cond ="and DATE(CONVERT_TZ(concat(vtr_date,' ',vtr_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = '". ahcfree_localtime('Y-m-d') ."'";
1747
+ }
1748
+
1749
+ if($cnt==true)
1750
+ {
1751
+ /*$sql = "select tot.ctr_name, tot.ctr_internet_code, tot.total from (SELECT c.ctr_name, c.ctr_internet_code, count(1) as total FROM ahc_recent_visitors v, ahc_countries c where v.ctr_id = c.ctr_id $cond group by ctr_name) as tot order by tot.total desc";
1752
+ $results = $wpdb->get_results($sql, OBJECT);*/
1753
+ $sql = "select count(*) as cnt from (SELECT c.ctr_name, c.ctr_internet_code, count(1) as total FROM ahc_recent_visitors v, ahc_countries c where v.ctr_id = c.ctr_id $cond group by ctr_name ) as tot order by tot.total desc";
1754
+
1755
+ return $wpdb->get_var($sql);
1756
+ }
1757
+
1758
+ $limitCond="";
1759
+ if($start!='' && $limit!='')
1760
+ {
1761
+ $limitCond=" limit $start,$limit";
1762
+
1763
+ }
1764
+ if($all==1)
1765
+ {
1766
+ $limitCond = "";
1767
+ }
1768
+
1769
+ $sql = "select tot.ctr_name, tot.ctr_internet_code, tot.total from (SELECT c.ctr_name, c.ctr_internet_code, count(1) as total FROM ahc_recent_visitors v, ahc_countries c where v.ctr_id = c.ctr_id $cond group by ctr_name ) as tot order by tot.total desc $limitCond";
1770
+ $results = $wpdb->get_results($sql, OBJECT);
1771
+ //echo $sql;
1772
+ if ($results !== false) {
1773
+ $arr = array();
1774
+ $new = array();
1775
+ $c = 0;
1776
+ if($start=="")
1777
+ $start = 0;
1778
+ $no =$start+1;
1779
+ $sum=0;
1780
+ foreach ($results as $ctr) {
1781
+
1782
+ /*if ($ctr->total > 1) {*/
1783
+ $imgurl = plugins_url('/images/flags/' . strtolower($ctr->ctr_internet_code) . '.png', AHCFREE_PLUGIN_MAIN_FILE);
1784
+ $arr[$c]['no'] = $no;
1785
+ $arr[$c]['country'] ='<img src="'.$imgurl.'" border="0" alt="'.$ctr->ctr_name.'" width="30" height="20" onerror="imgFlagError(this)" />';
1786
+ $arr[$c]['ctr_name'] = $ctr->ctr_name;
1787
+ $arr[$c]['ctr_internet_code'] = $ctr->ctr_internet_code;
1788
+ $arr[$c]['total'] = $ctr->total;
1789
+
1790
+ if($all==1)
1791
+ {
1792
+ $new[$c]['no'] =$no;
1793
+ $new[$c]['ctr_name'] = $ctr->ctr_name;
1794
+ $new[$c]['total'] = $ctr->total;
1795
+ }
1796
+
1797
+ $c++;
1798
+ $no++;
1799
+
1800
+
1801
+ /*} else {
1802
+
1803
+ $sum += 1;
1804
+ }*/
1805
+
1806
+
1807
+ }
1808
+
1809
+ if($sum>0)
1810
+ {
1811
+ $k = count($arr);
1812
+ $arr[$k]['no'] =$no;
1813
+ $imgurl = plugins_url('/images/flags/xx.png', AHCFREE_PLUGIN_MAIN_FILE);
1814
+ $arr[$k]['country'] = '<img src="'.$imgurl.'" border="0" alt="'.$ctr->ctr_name.'" width="30" height="20" onerror="imgFlagError(this)" />';
1815
+ $arr[$k]['ctr_name'] = 'others';
1816
+ $arr[$k]['ctr_internet_code'] = 'XX';
1817
+ $arr[$k]['total'] = $sum;
1818
+
1819
+ if($all==1)
1820
+ {
1821
+ $new[$k]['no'] =$no;
1822
+ $new[$k]['ctr_name'] = 'others';
1823
+ $new[$k]['total'] = $sum;
1824
+ }
1825
+
1826
+ }
1827
+ if($all==1)
1828
+ {
1829
+ return $new;
1830
+ }
1831
+
1832
+
1833
+
1834
+ return $arr;
1835
+ } else {
1836
+ return false;
1837
+ }
1838
+ }
1839
+
1840
+ //--------------------------------------------
1841
+ /**
1842
+ * Retrieves recent visitors
1843
+ *
1844
+ * @uses wpdb::prepare()
1845
+ * @uses wpdb::get_results()
1846
+ *
1847
+ * @return mixed
1848
+ */
1849
+
1850
+ function ahcfree_get_recent_visitors($all,$cnt=true,$start='',$limit='',$fdt='',$tdt='',$ip='') {
1851
+ global $wpdb, $_SERVER;
1852
+ $cond="";
1853
+ $cond1="";
1854
+ $ahcfree_save_ips = get_option('ahcfree_save_ips_opn');
1855
+
1856
+ if(isset($_POST['r_from_dt']) && $_POST['r_from_dt']!='' && isset($_POST['r_to_dt']) && $_POST['r_to_dt']!='' && isset($_POST['section']) && $_POST['section']=='recent_visitor_by_ip')
1857
+ {
1858
+ $fdt = $_POST['r_from_dt'];
1859
+ $tdt = $_POST['r_to_dt'];
1860
+ }
1861
+ else if(isset($_POST['r_from_dt']) && $_POST['r_from_dt']!='')
1862
+ {
1863
+ $fdt = $_POST['r_from_dt'];
1864
+
1865
+ }
1866
+ if(isset($_POST['ip_addr']) && $_POST['ip_addr']!='' && isset($_POST['section']) && $_POST['section']=='recent_visitor_by_ip')
1867
+ {
1868
+ $ip =$_POST['ip_addr'];
1869
+ }
1870
+
1871
+ if($ip!='')
1872
+ {
1873
+ $cond .=" and vtr_ip_address='".$ip."'";
1874
+ $cond1 .=" and vtr_ip_address='".$ip."'";
1875
+ }
1876
+
1877
+ if($fdt!='' && $tdt!='')
1878
+ {
1879
+ $fromdt = ahcfree_getFormattedDate($fdt,'yymmdd');
1880
+ $todt = ahcfree_getFormattedDate($tdt,'yymmdd');
1881
+ $cond .=" having (dt between '$fromdt' and '$todt')";
1882
+ $cond1 .=" and (vtr_date between '$fromdt' and '$todt')";
1883
+ }
1884
+ else if($fdt!='' && $tdt='')
1885
+ {
1886
+ $fromdt = ahcfree_getFormattedDate($fdt,'yymmdd');
1887
+ $cond .=" and dt ='$fromdt'";
1888
+ $cond1 .=" and dt ='$fromdt'";
1889
+ }
1890
+
1891
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1892
+ if($cnt==true)
1893
+ {
1894
+ $sql_query = "SELECT count(*) from (Select DATE_FORMAT(CONVERT_TZ(CONCAT_WS(' ',v.vtr_date,v.vtr_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'), '%Y-%m-%d') as dt FROM `ahc_recent_visitors` AS v LEFT JOIN `ahc_countries` AS c ON v.ctr_id = c.ctr_id LEFT JOIN `ahc_browsers` AS b ON v.bsr_id = b.bsr_id WHERE 1=1 and v.vtr_ip_address NOT LIKE 'UNKNOWN%%' $cond ORDER BY v.vtr_id DESC) as res";
1895
+ $count = $wpdb->get_var($sql_query);
1896
+ return $count;
1897
+ }
1898
+
1899
+ $limitCond="";
1900
+ if($start !='' && $limit!='')
1901
+ {
1902
+ $limitCond =" LIMIT $start, $limit";
1903
+ }
1904
+
1905
+ if($all==1)
1906
+ {
1907
+ $limitCond="";
1908
+ }
1909
+
1910
+ $sql_query = "SELECT v.vtr_id, v.vtr_ip_address, v.vtr_referer, DATE_FORMAT(CONVERT_TZ(CONCAT_WS(' ',v.vtr_date,v.vtr_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'), '%Y-%m-%d') as dt ,DATE_FORMAT(CONVERT_TZ(CONCAT_WS(' ',v.vtr_date,v.vtr_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'), '%Y-%m-%d') as vtr_date, DATE_FORMAT(CONVERT_TZ(CONCAT_WS(' ',v.vtr_date,v.vtr_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'), '%H:%i:%s') as vtr_time, v.ahc_city, v.ahc_region,
1911
+ c.ctr_name, c.ctr_internet_code, b.bsr_name, b.bsr_icon
1912
+ FROM `ahc_recent_visitors` AS v
1913
+ LEFT JOIN `ahc_countries` AS c ON v.ctr_id = c.ctr_id
1914
+ LEFT JOIN `ahc_browsers` AS b ON v.bsr_id = b.bsr_id
1915
+ WHERE 1=1 and v.vtr_ip_address NOT LIKE 'UNKNOWN%%' $cond
1916
+ ORDER BY v.vtr_id DESC $limitCond";
1917
+
1918
+ $results = $wpdb->get_results($sql_query);
1919
+
1920
+ if ($results !== false) {
1921
+ $arr = array();
1922
+ $new = array();
1923
+ $c = 0;
1924
+ if (is_array($results)) {
1925
+ foreach ($results as $hit) {
1926
+ if (strlen($hit->vtr_ip_address) < 17) {
1927
+ $visitDate = new DateTime($hit->vtr_date. ' ' . $hit->vtr_time);
1928
+
1929
+ $arr[$c]['hit_id'] = $hit->vtr_id;
1930
+ $hit_referer = (parse_url($hit->vtr_referer, PHP_URL_HOST) == $_SERVER['SERVER_NAME']) ? '' : rawurldecode($hit->vtr_referer);
1931
+ $hitip = (!empty($hit->hit_referer) ? '<a href="'.$hit_referer.'" target="_blank"><img src="'.plugins_url('/images/openW.jpg', AHCFREE_PLUGIN_MAIN_FILE).'" title="'.ahc_view_referer.'"></a>' : '');
1932
+ $arr[$c]['hit_ip_address'] = $hit->vtr_ip_address ."&nbsp;". $hitip;
1933
+ $img="";
1934
+ if ( $hit->ctr_internet_code != '')
1935
+ {
1936
+ $imgurl = plugins_url('/images/flags/' . strtolower($hit->ctr_internet_code) . '.png', AHCFREE_PLUGIN_MAIN_FILE);
1937
+ $img = "<img src='".$imgurl."' border='0' width='22' height='18' title='".$hit->ctr_name."' onerror='imgFlagError(this)' />&nbsp;";
1938
+ }
1939
+
1940
+ $bimgurl = plugins_url('/images/browsers/' . $hit->bsr_icon, AHCFREE_PLUGIN_MAIN_FILE);
1941
+ // $bimg = '<img src="'.$bimgurl.'" border="0" width="20" height="20" title="'.$hit->bsr_name.'" />&nbsp;';
1942
+ $arr[$c]['hit_date'] = $hit->vtr_date;
1943
+ $arr[$c]['hit_time'] = $hit->vtr_time;
1944
+
1945
+ $arr[$c]['ctr_internet_code'] = $hit->ctr_internet_code;
1946
+ $arr[$c]['bsr_name'] = $bimg.$hit->bsr_name;
1947
+ $arr[$c]['bsr_icon'] = $hit->bsr_icon;
1948
+
1949
+ if (strpos($hit->ahc_region, '}')) {
1950
+ $arr[$c]['ahc_region'] = "-";
1951
+ } else {
1952
+ $arr[$c]['ahc_region'] = $hit->ahc_region;
1953
+ }
1954
+
1955
+ if (strpos($hit->ahc_city, 'charset')) {
1956
+ $arr[$c]['ahc_city']='-';
1957
+ } else {
1958
+ $arr[$c]['ahc_city'] = $hit->ahc_city;
1959
+ }
1960
+
1961
+ $arr[$c]['ctr_name'] = $img.$hit->ctr_name.", ".$hit->ahc_city.", ".$hit->ahc_region;
1962
+
1963
+ $arr[$c]['time'] = $visitDate->format('d M Y @ h:i a');
1964
+
1965
+ if($all==1)
1966
+ {
1967
+ $new[$c]['hit_ip_address'] = $hit->vtr_ip_address;
1968
+ $new[$c]['ctr_name'] = $hit->ctr_name.", ".$hit->ahc_city.", ".$hit->ahc_region;
1969
+ $new[$c]['time'] = $visitDate->format('d M Y @ h:i a');
1970
+ }
1971
+
1972
+ $c++;
1973
+ }
1974
+ }
1975
+ }
1976
+ if($all==1)
1977
+ return $new;
1978
+ return $arr;
1979
+ } else {
1980
+ return false;
1981
+ }
1982
+ }
1983
+
1984
+ //--------------------------------------------
1985
+ /**
1986
+ * Retrieves latest of key words used in search
1987
+ *
1988
+ * @uses wpdb::prepare()
1989
+ * @uses wpdb::get_results()
1990
+ *
1991
+ * @return mixed
1992
+ */
1993
+ function ahcfree_get_latest_search_key_words_used($all,$cnt=true,$start='',$limit='',$fdt='',$tdt='') {
1994
+ global $wpdb;
1995
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
1996
+ $cond="";
1997
+ $cond1="";
1998
+
1999
+ if(isset($_POST['from_dt']) && $_POST['from_dt']!='' && isset($_POST['to_dt']) && $_POST['to_dt']!='' && isset($_POST['section']) && $_POST['section']=="lastest_search")
2000
+ {
2001
+ $fdt = $_POST['from_dt'];
2002
+ $tdt = $_POST['to_dt'];
2003
+ }
2004
+
2005
+ if($fdt!='' && $tdt!='')
2006
+ {
2007
+ $fromdt = ahcfree_getFormattedDate($fdt,'yymmdd');
2008
+ $todt = ahcfree_getFormattedDate($tdt,'yymmdd');
2009
+ //$cond =" and (k.kwd_date between '$fromdt' and '$todt')";
2010
+ $cond =" having (dt between '$fromdt' and '$todt')";
2011
+ $cond1 =" and (kwd_date between '$fromdt' and '$todt')";
2012
+ }
2013
+
2014
+ if($cnt==true)
2015
+ {
2016
+ $sql = "SELECT count(*) FROM `ahc_keywords` AS k LEFT JOIN `ahc_countries` AS c ON k.ctr_id = c.ctr_id JOIN `ahc_browsers` AS b ON k.bsr_id = b.bsr_id JOIN `ahc_search_engines` AS s on k.srh_id = s.srh_id WHERE k.kwd_ip_address != 'UNKNOWN' and k.kwd_keywords !='amazon' and c.ctr_id IS NOT NULL $cond1 ORDER BY k.kwd_date DESC, k.kwd_time DESC ";
2017
+ $count = $wpdb->get_var($sql);
2018
+ return $count;
2019
+ }
2020
+
2021
+ $limitCond="";
2022
+ if($start !='' && $limit!='')
2023
+ {
2024
+ $limitCond =" LIMIT $start, $limit";
2025
+ }
2026
+
2027
+ if($all==1)
2028
+ {
2029
+ $limitCond="";
2030
+ }
2031
+
2032
+ $sql = "SELECT k.kwd_date as dt,k.kwd_ip_address, k.kwd_referer, k.kwd_keywords, CONVERT_TZ(CONCAT_WS(' ',k.kwd_date,k.kwd_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') as kwd_date, CONVERT_TZ(k.kwd_time,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') as kwd_time, k.ctr_id,
2033
+ c.ctr_name, c.ctr_internet_code, b.bsr_name, b.bsr_icon, s.srh_name, s.srh_icon
2034
+ FROM `ahc_keywords` AS k
2035
+ LEFT JOIN `ahc_countries` AS c ON k.ctr_id = c.ctr_id
2036
+ JOIN `ahc_browsers` AS b ON k.bsr_id = b.bsr_id
2037
+ JOIN `ahc_search_engines` AS s on k.srh_id = s.srh_id
2038
+ WHERE k.kwd_ip_address != 'UNKNOWN' and k.kwd_keywords !='amazon' and c.ctr_id IS NOT NULL $cond
2039
+ ORDER BY k.kwd_date DESC, k.kwd_time DESC $limitCond";
2040
+ $results = $wpdb->get_results($sql, OBJECT);
2041
+
2042
+ if ($results !== false) {
2043
+ $arr = array();
2044
+ $new = array();
2045
+ $c = 0;
2046
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
2047
+ $custom_timezone_string = ahcfree_get_timezone_string();
2048
+ $ahcfree_save_ips = get_option('ahcfree_save_ips_opn');
2049
+ if ($custom_timezone_string) {
2050
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
2051
+ }
2052
+ foreach ($results as $re) {
2053
+
2054
+ $arr[$c]['hit_referer'] = rawurldecode($re->kwd_referer);
2055
+ $arr[$c]['hit_search_words'] = $re->kwd_keywords;
2056
+ $arr[$c]['hit_date'] = $re->kwd_date;
2057
+ $arr[$c]['hit_time'] = $re->kwd_time;
2058
+ $arr[$c]['hit_ip_address'] = $re->kwd_ip_address;
2059
+ $arr[$c]['ctr_name'] = $re->ctr_name;
2060
+ $arr[$c]['ctr_internet_code'] = $re->ctr_internet_code;
2061
+ $arr[$c]['bsr_name'] = $re->bsr_name;
2062
+ $arr[$c]['bsr_icon'] = $re->bsr_icon;
2063
+ $arr[$c]['srh_name'] = $re->srh_name;
2064
+ $arr[$c]['srh_icon'] = $re->srh_icon;
2065
+
2066
+ $img='<span>';
2067
+ if ($re->ctr_internet_code != '') {
2068
+ $imgurl = plugins_url('/images/flags/' . strtolower( $re->ctr_internet_code) . '.png', AHCFREE_PLUGIN_MAIN_FILE);
2069
+ $img .= '<img src="'.$imgurl.'" border="0" width="22" height="18" title="'.$re->ctr_name.'" onerror="imgFlagError(this)" />';
2070
+ }
2071
+ $img.='</span>';
2072
+ $eurl=plugins_url('/images/search_engines/' . $re->srh_icon, AHCFREE_PLUGIN_MAIN_FILE);
2073
+ $img.='<span><img src="'.$eurl.'" border="0" width="22" height="22" title="'.$re->srh_name.'" /></span>';
2074
+
2075
+ $burl=plugins_url('/images/browsers/' . $re->bsr_icon, AHCFREE_PLUGIN_MAIN_FILE);
2076
+ $img.='<span><img src="'.$burl.'" border="0" width="20" height="20" title="'.$re->bsr_name.'" /></span>';
2077
+
2078
+ $arr[$c]['img']=$img;
2079
+ $arr[$c]['csb']=$re->ctr_name."/".$re->srh_name."/".$re->bsr_name;
2080
+
2081
+ $arr[$c]['keyword'] = '<span class="searchKeyWords"><a href="'.rawurldecode($re->kwd_referer).'" target="_blank">'.$re->kwd_keywords.'</a></span>';
2082
+
2083
+ $visitDate = new DateTime($re->kwd_date);
2084
+ $visitDate->setTimezone($custom_timezone);
2085
+ //$arr[$c]['dt'] = '<span class="visitDateTime">'.$visitDate->format('d/m/Y').'</span>';
2086
+ $arr[$c]['dt'] = $visitDate->format('d/m/Y');
2087
+
2088
+ if($all==1)
2089
+ {
2090
+ $new[$c]['csb']=$re->ctr_name."/".$re->srh_name."/".$re->bsr_name;
2091
+ $new[$c]['keyword'] = $re->kwd_keywords;
2092
+ $new[$c]['dt'] = $visitDate->format('d/m/Y');
2093
+ }
2094
+ $c++;
2095
+ }
2096
+ if($all==1)
2097
+ return $new;
2098
+ return $arr;
2099
+ } else {
2100
+ return false;
2101
+ }
2102
+ }
2103
+
2104
+ //--------------------------------------------
2105
+ /**
2106
+ * Is in login page
2107
+ *
2108
+ * @return boolean
2109
+ */
2110
+ function ahcfree_is_login_page() {
2111
+ global $GlobalsAHC;
2112
+
2113
+ return in_array($GlobalsAHC['pagenow'], array('wp-login.php', 'wp-register.php'));
2114
+ }
2115
+
2116
+ //--------------------------------------------
2117
+ /**
2118
+ * Retrieves today visitors data, for google map
2119
+ *
2120
+ * @uses wpdb::get_results()
2121
+ *
2122
+ * @return array
2123
+ */
2124
+ function ahcfree_get_today_visitors_for_map($map_status = '') {
2125
+ global $wpdb;
2126
+ $whr = '';
2127
+
2128
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
2129
+
2130
+ $current_month = ahcfree_localtime("m");
2131
+ $current_year = ahcfree_localtime("Y");
2132
+ $past_year = ahcfree_localtime("Y")-1;
2133
+ $past_month = date('m', strtotime('last month'));
2134
+
2135
+
2136
+ if($map_status == 'this_month')
2137
+ {
2138
+ $whr = " and month(CONVERT_TZ(concat(vtr_date, ' ', vtr_time),'+00:00','+02:00')) = ".$current_month." and year(CONVERT_TZ(concat(vtr_date, ' ', vtr_time),'+00:00','+02:00')) = ".$current_year;
2139
+ }else if($map_status == 'past_month')
2140
+ {
2141
+ $whr = " and month(CONVERT_TZ(concat(vtr_date, ' ', vtr_time),'+00:00','+02:00')) = ".$past_month." and year(CONVERT_TZ(concat(vtr_date, ' ', vtr_time),'+00:00','+02:00')) = ".$past_year;
2142
+ }else{
2143
+ $whr = " and DATE(CONVERT_TZ(concat(vtr_date, ' ', vtr_time),'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) = '".ahcfree_localtime("Y-m-d")."'";
2144
+ }
2145
+
2146
+ $sql = "select count(vtr_id) as visitors, c.* from `ahc_recent_visitors` recent, `ahc_countries` c where recent.ctr_id = c.ctr_id
2147
+ and c.ctr_latitude IS NOT NULL AND c.ctr_latitude <> 0 AND c.ctr_longitude IS NOT NULL AND c.ctr_longitude <> 0 ".$whr." GROUP by ctr_id";
2148
+
2149
+
2150
+ $results = $wpdb->get_results($sql, OBJECT);
2151
+ $response = array();
2152
+ if ($results !== false) {
2153
+ $response['success'] = true;
2154
+ $response['data'] = array();
2155
+ if (is_array($results) && isset($results[0]->visitors) && !empty($results[0]->visitors)) {
2156
+ foreach ($results as $r) {
2157
+ $response['data'][$r->ctr_id]['visitors'] = $r->visitors;
2158
+ $response['data'][$r->ctr_id]['ctr_name'] = $r->ctr_name;
2159
+ $response['data'][$r->ctr_id]['ctr_internet_code'] = $r->ctr_internet_code;
2160
+ $response['data'][$r->ctr_id]['ctr_latitude'] = $r->ctr_latitude;
2161
+ $response['data'][$r->ctr_id]['ctr_longitude'] = $r->ctr_longitude;
2162
+ }
2163
+ }
2164
+ } else {
2165
+ $response['success'] = false;
2166
+ }
2167
+ return $response;
2168
+ }
2169
+ function ahcfree_get_all_visitors_for_map() {
2170
+ global $wpdb;
2171
+ $sql = "SELECT c.`ctr_visitors` as visitors, c.ctr_id, c.ctr_name, c.ctr_internet_code, c.ctr_latitude, c.ctr_longitude from `ahc_countries` c where c.ctr_latitude IS NOT NULL AND c.ctr_latitude <> 0 AND c.ctr_longitude IS NOT NULL AND c.ctr_longitude <> 0 group by `ctr_name` ORDER BY ctr_visitors desc LIMIT 10";
2172
+
2173
+ $results = $wpdb->get_results($sql, OBJECT);
2174
+ $response = array();
2175
+ if ($results !== false) {
2176
+ $response['success'] = true;
2177
+ $response['data'] = array();
2178
+ if (is_array($results) && isset($results[0]->visitors) && !empty($results[0]->visitors)) {
2179
+ foreach ($results as $r) {
2180
+ $response['data'][$r->ctr_id]['visitors'] = $r->visitors;
2181
+ $response['data'][$r->ctr_id]['ctr_name'] = $r->ctr_name;
2182
+ $response['data'][$r->ctr_id]['ctr_internet_code'] = $r->ctr_internet_code;
2183
+ $response['data'][$r->ctr_id]['ctr_latitude'] = $r->ctr_latitude;
2184
+ $response['data'][$r->ctr_id]['ctr_longitude'] = $r->ctr_longitude;
2185
+ }
2186
+ }
2187
+ } else {
2188
+ $response['success'] = false;
2189
+ }
2190
+ return $response;
2191
+ }
2192
+
2193
+ /**
2194
+ * Retrieves online visitors data, for google map
2195
+ *
2196
+ * @uses wpdb::get_results()
2197
+ *
2198
+ * @return array
2199
+ */
2200
+ function ahcfree_get_online_visitors_for_map() {
2201
+ global $wpdb;
2202
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
2203
+ $sql = "SELECT hits.visitors, hits.ctr_id,
2204
+ c.ctr_name, c.ctr_internet_code, c.ctr_latitude, c.ctr_longitude FROM (
2205
+ SELECT COUNT(v.visitor) AS visitors, v.ctr_id FROM (
2206
+ SELECT ctr_id, 1 AS visitor FROM `ahc_hits`
2207
+ WHERE ctr_id IS NOT NULL AND hit_ip_address NOT LIKE 'UNKNOWN%' and hit_date = DATE( CONVERT_TZ( '". ahcfree_localtime("Y-m-d H:i:s") ."' ,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') ) and TIME( CONVERT_TZ(hit_time,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') ) between TIME(CONVERT_TZ('". date("Y-m-d H:i:s") ."','" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') - INTERVAL 60 SECOND) and TIME( CONVERT_TZ('". date("Y-m-d H:i:s") ."','" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "') )
2208
+ GROUP BY hit_ip_address
2209
+ ) AS v
2210
+ GROUP BY ctr_id) AS hits
2211
+ JOIN `ahc_countries` AS c ON hits.ctr_id = c.ctr_id
2212
+ WHERE c.ctr_latitude IS NOT NULL AND c.ctr_latitude <> 0 AND c.ctr_longitude IS NOT NULL AND c.ctr_longitude <> 0 ";
2213
+
2214
+ $results = $wpdb->get_results($sql, OBJECT);
2215
+ $response = array();
2216
+ if ($results !== false) {
2217
+ $response['success'] = true;
2218
+ $response['data'] = array();
2219
+ if (is_array($results) && isset($results[0]->visitors) && !empty($results[0]->visitors)) {
2220
+ foreach ($results as $r) {
2221
+ $response['data'][$r->ctr_id]['visitors'] = $r->visitors;
2222
+ $response['data'][$r->ctr_id]['ctr_name'] = $r->ctr_name;
2223
+ $response['data'][$r->ctr_id]['ctr_internet_code'] = $r->ctr_internet_code;
2224
+ $response['data'][$r->ctr_id]['ctr_latitude'] = $r->ctr_latitude;
2225
+ $response['data'][$r->ctr_id]['ctr_longitude'] = $r->ctr_longitude;
2226
+ }
2227
+ }
2228
+ } else {
2229
+ $response['success'] = false;
2230
+ }
2231
+ return $response;
2232
+ }
2233
+
2234
+ //--------------------------------------------
2235
+ /**
2236
+ * Detect if the visitor is search engine bot
2237
+ *
2238
+ * @uses wpdb::get_results()
2239
+ *
2240
+ * @return boolean
2241
+ */
2242
+ function ahcfree_is_search_engine_bot() {
2243
+ global $wpdb, $_SERVER;
2244
+ $results = $wpdb->get_results("SELECT `bot_name` FROM `ahc_search_engine_crawlers`", OBJECT);
2245
+ foreach ($results as $crawler) {
2246
+ if (stripos($_SERVER['HTTP_USER_AGENT'], $crawler->bot_name) !== false) {
2247
+ return true;
2248
+ }
2249
+ }
2250
+
2251
+ if (stripos($_SERVER['REQUEST_URI'], 'robots.txt') !== false) {
2252
+ return true;
2253
+ }
2254
+
2255
+ if (stripos($_SERVER['REQUEST_URI'], 'Bot') !== false) {
2256
+ return true;
2257
+ }
2258
+
2259
+ if (stripos($_SERVER['REQUEST_URI'], 'bot') !== false) {
2260
+ return true;
2261
+ }
2262
+ return false;
2263
+ }
2264
+
2265
+ //--------------------------------------------
2266
+ /**
2267
+ * Detect if the visitor is WordPress bot
2268
+ *
2269
+ * @return boolean
2270
+ */
2271
+ function ahcfree_is_wordpress_bot() {
2272
+ global $_SERVER;
2273
+ if (stripos($_SERVER['HTTP_USER_AGENT'], 'WordPress') !== false) {
2274
+ return true;
2275
+ }
2276
+ return false;
2277
+ }
2278
+
2279
+ //--------------------------------------------
2280
+ /**
2281
+ * Detects post id, post title and post type of current page
2282
+ *
2283
+ * @uses wpdb::prepare()
2284
+ * @uses wpdb::get_results()
2285
+ *
2286
+ * @param object $query. this object is passed to the callback function of "parse_query" hooked action
2287
+ * @return mixed
2288
+ */
2289
+ function ahcfree_detect_requested_page($query) {
2290
+ global $wpdb;
2291
+ $vars = $query->query_vars;
2292
+ if (isset($vars['p']) && !empty($vars['p'])) {
2293
+ $result = $wpdb->get_results($wpdb->prepare("SELECT post_title FROM " . $wpdb->prefix . "posts WHERE ID = %d ", $vars['p']));
2294
+ if ($result !== false && $wpdb->num_rows > 0) {
2295
+ return array('page_id' => $vars['p'], 'page_title' => $result[0]->post_title, 'post_type' => 'post');
2296
+ }
2297
+ } else if (isset($vars['name']) && !empty($vars['name'])) {
2298
+ $result = $wpdb->get_results($wpdb->prepare("SELECT ID, post_title FROM " . $wpdb->prefix . "posts WHERE post_name = %s ", $vars['name']));
2299
+ if ($result !== false && $wpdb->num_rows > 0) {
2300
+ return array('page_id' => $result[0]->ID, 'page_title' => $result[0]->post_title, 'post_type' => 'post');
2301
+ }
2302
+ } else if (isset($vars['pagename']) && !empty($vars['pagename'])) {
2303
+ $result = $wpdb->get_results($wpdb->prepare("SELECT ID, post_title FROM " . $wpdb->prefix . "posts WHERE post_name = %s AND post_type = %s", ahcfree_get_subpage_name($vars['pagename']), 'page'));
2304
+ if ($result !== false && $wpdb->num_rows > 0) {
2305
+ return array('page_id' => $result[0]->ID, 'page_title' => $result[0]->post_title, 'post_type' => 'page');
2306
+ }
2307
+ } else if (isset($vars['page_id']) && !empty($vars['page_id'])) {
2308
+ $result = $wpdb->get_results($wpdb->prepare("SELECT post_title FROM " . $wpdb->prefix . "posts WHERE ID = %s AND post_type = %s", $vars['page_id'], 'page'));
2309
+ if ($result !== false && $wpdb->num_rows > 0) {
2310
+ return array('page_id' => $page_id, 'page_title' => $result[0]->post_title, 'post_type' => 'page');
2311
+ }
2312
+ } else {
2313
+ return array('page_id' => 'HOMEPAGE', 'page_title' => NULL, 'post_type' => NULL);
2314
+ }
2315
+ }
2316
+
2317
+ function ahcfree_get_subpage_name($page_name) {
2318
+ $sub_name = strrchr($page_name, '/');
2319
+ if (!$sub_name) {
2320
+ return $page_name;
2321
+ }
2322
+ return substr($sub_name, 1);
2323
+ }
2324
+
2325
+ //--------------------------------------------
2326
+ /**
2327
+ * Initiates tracking process
2328
+ *
2329
+ * @param object $query. this object is passed to this callback function of "parse_request" hooked action
2330
+ * @return void
2331
+ */
2332
+ /*function ahcfree_track_visitor($query) {
2333
+
2334
+ $exclude_ips = EXCLUDE_IPS;
2335
+ if ($exclude_ips == '' or $exclude_ips == '') {
2336
+ $exclude_ips = array();
2337
+ }
2338
+ if (EXCLUDE_IPS != NULL && EXCLUDE_IPS != '') {
2339
+ $exclude_ips = explode("\n", $exclude_ips);
2340
+ }
2341
+
2342
+ if (ahcfree_should_track_visitor() && !ahcfree_is_login_page() && !ahcfree_is_search_engine_bot() && !ahcfree_is_wordpress_bot()) {
2343
+ if (!in_array(ahcfree_get_client_ip_address(), $exclude_ips)) {
2344
+
2345
+ $page = ahcfree_detect_requested_page($query);
2346
+ if (is_array($page)) {
2347
+ GlobalsAHC::$page_id = $page['page_id'];
2348
+ GlobalsAHC::$page_title = $page['page_title'];
2349
+ GlobalsAHC::$post_type = $page['post_type'];
2350
+ } else {
2351
+ return;
2352
+ }
2353
+ $hitsCounter = new WPHitsCounter(GlobalsAHC::$page_id, GlobalsAHC::$page_title, GlobalsAHC::$post_type);
2354
+ $hitsCounter->traceVisitorHit();
2355
+ }
2356
+ }
2357
+ }*/
2358
+
2359
+
2360
+ function ahcfree_track_visitor()
2361
+ {
2362
+ $exclude_ips_arr = array();
2363
+ $exclude_ips = EXCLUDE_IPS;
2364
+ if ($exclude_ips == '' or empty($exclude_ips)) {
2365
+ $exclude_ips = array();
2366
+ }else{
2367
+
2368
+ $exclude_ips = explode("\n", $exclude_ips);
2369
+ }
2370
+
2371
+
2372
+ $client_ip_address = trim(ahcfree_get_client_ip_address());
2373
+ foreach($exclude_ips as $k=>$v)
2374
+ {
2375
+
2376
+ if($v!='')
2377
+ {
2378
+
2379
+ $exclude_ips_arr[] = trim($v);
2380
+ }
2381
+ }
2382
+
2383
+
2384
+
2385
+ if (!ahcfree_is_login_page() && !ahcfree_is_search_engine_bot() && !ahcfree_is_wordpress_bot()) {
2386
+ if (!in_array($client_ip_address, $exclude_ips_arr)) {
2387
+
2388
+ $page_id = $_POST['page_id'];
2389
+ $page_title = $_POST['page_title'];
2390
+ $post_type = $_POST['post_type'];
2391
+ $_SERVER['HTTP_REFERER'] = $_POST['referer'];
2392
+ $_SERVER['HTTP_USER_AGENT'] = $_POST['useragent'];
2393
+ $_SERVER['SERVER_NAME'] = $_POST['servername'];
2394
+ $_SERVER['HTTP_HOST'] = $_POST['hostname'];
2395
+ $_SERVER['REQUEST_URI'] = $_POST['request_uri'];
2396
+
2397
+ $hitsCounter = new WPHitsCounter($page_id, $page_title, $post_type);
2398
+ $hitsCounter->traceVisitorHit();
2399
+ }
2400
+ }
2401
+
2402
+ die;
2403
+ }
2404
+
2405
+ //--------------------------------------------
2406
+ /**
2407
+ * Ceil for decimal numbers with precision
2408
+ *
2409
+ * @param float $number
2410
+ * @param integer $precision
2411
+ * @param string $separator
2412
+ * @return float
2413
+ */
2414
+ function ahcfree_ceil_dec($number, $precision, $separator) {
2415
+ if (strpos($number, '.') !== false) {
2416
+ $numberpart = explode($separator, $number);
2417
+ $numberpart[1] = substr_replace($numberpart[1], $separator, $precision, 0);
2418
+ if ($numberpart[0] >= 0) {
2419
+ $numberpart[1] = ceil($numberpart[1]);
2420
+ } else {
2421
+ $numberpart[1] = floor($numberpart[1]);
2422
+ }
2423
+
2424
+ $ceil_number = array($numberpart[0], $numberpart[1]);
2425
+ return implode($separator, $ceil_number);
2426
+ }
2427
+ return $number;
2428
+ }
2429
+
2430
+ //--------------------------------------------
2431
+ /**
2432
+ * Retrieve sum visits by post title
2433
+ *
2434
+ * @uses wpdb::prepare()
2435
+ * @uses wpdb::get_results()
2436
+ *
2437
+ * @return mixed
2438
+ */
2439
+ function ahcfree_get_traffic_by_title($all,$cnt=false, $start='0', $limit='10',$search='') {
2440
+
2441
+ global $wpdb;
2442
+ $sql1 = "SELECT SUM(hits) AS sm FROM (
2443
+ SELECT SUM(til_hits) AS hits
2444
+ FROM ahc_title_traffic
2445
+ GROUP BY til_page_id
2446
+ ) myTable";
2447
+
2448
+
2449
+ $cond ="";
2450
+ if($search!='')
2451
+ {
2452
+ $cond =" and til_page_title like '%".$search."%'";
2453
+ }
2454
+
2455
+ if($cnt==true)
2456
+ {
2457
+ $sql2 = "SELECT sum(cnt) from (SELECT count(*) as cnt FROM ahc_title_traffic where 1=1 $cond GROUP BY til_page_id ORDER BY til_hits DESC) as res";
2458
+ $count = $wpdb->get_var($sql2);
2459
+ return $count;
2460
+ }
2461
+
2462
+ $limitCond = "";
2463
+ if($start !='' && $limit!='')
2464
+ {
2465
+ $sql2 = "SELECT til_page_id, til_page_title, til_hits
2466
+ FROM ahc_title_traffic where 1=1 $cond
2467
+ GROUP BY til_page_id
2468
+ ORDER BY til_hits DESC limit %d, %d";
2469
+ }
2470
+
2471
+
2472
+
2473
+
2474
+
2475
+ $result1 = $wpdb->get_results($sql1);
2476
+ if ($result1 !== false) {
2477
+ $total = $result1[0]->sm;
2478
+
2479
+ $result2 = $wpdb->get_results($wpdb->prepare($sql2, $start, $limit));
2480
+ if ($result2 !== false) {
2481
+ $arr = array();
2482
+ if ($wpdb->num_rows > 0) {
2483
+ $c = 0;
2484
+ if($start=="")
2485
+ $start = 0;
2486
+ $no =$start;
2487
+ foreach ($result2 as $r) {
2488
+ $ans=0;
2489
+ $arr[$c]['rank'] = $no + 1;
2490
+ //$arr[$c]['til_page_id'] = $r->til_page_id;
2491
+ if($all==1)
2492
+ $arr[$c]['til_page_title'] = $r->til_page_title;
2493
+ else
2494
+ $arr[$c]['til_page_title'] = "<a href='".get_permalink($r->til_page_id)."' target='_blank'>".$r->til_page_title."</a>";
2495
+ $arr[$c]['til_hits'] = $r->til_hits;
2496
+ $ans = ($total > 0) ? ahcfree_ceil_dec((($r->til_hits / $total) * 100), 2, ".") . ' %' : 0;
2497
+ $arr[$c]['percent'] = ahc_free_NumFormat($ans);
2498
+ $c++;
2499
+ $no++;
2500
+ }
2501
+ }
2502
+ return $arr;
2503
+ }
2504
+ }
2505
+ return false;
2506
+ }
2507
+
2508
+ //--------------------------------------------
2509
+ /**
2510
+ * Retrieves sum of visits order by time
2511
+ *
2512
+ * @uses wpdb::get_results()
2513
+ *
2514
+ * @return mixed
2515
+ */
2516
+ function ahcfree_get_time_visits($all,$start='',$limit='',$fdt='',$tdt='') {
2517
+ global $wpdb;
2518
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
2519
+ $vst_date = "CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')";
2520
+
2521
+ $cond="";
2522
+
2523
+ if(isset($_POST['vfrom_dt']) && $_POST['vfrom_dt']!='' && isset($_POST['vto_dt']) && $_POST['vto_dt']!='' && isset($_POST['section']) && $_POST['section']=="visit_time")
2524
+ {
2525
+ $fdt = $_POST['vfrom_dt'];
2526
+ $tdt = $_POST['vto_dt'];
2527
+ }
2528
+ else if(isset($_POST['vfrom_dt']) && $_POST['vfrom_dt']!='' && isset($_POST['section']) && $_POST['section']=="visit_time")
2529
+ {
2530
+ $fdt = $_POST['vfrom_dt'];
2531
+ }
2532
+ if($fdt!='' && $tdt!='')
2533
+ {
2534
+ $fromdt = ahcfree_getFormattedDate($fdt,'yymmdd');
2535
+ $todt = ahcfree_getFormattedDate($tdt,'yymmdd');
2536
+ $cond = "(DATE($vst_date) between '".$fromdt."' and '$todt')";
2537
+ $groupby = " hour";
2538
+ }
2539
+ else if($fdt!='')
2540
+ {
2541
+ $fromdt = ahcfree_getFormattedDate($fdt,'yymmdd');
2542
+ $cond = "DATE($vst_date) = '".$fromdt."'";
2543
+ $groupby = " hour($vst_date)";
2544
+ }
2545
+ else
2546
+ {
2547
+ $cond = "DATE($vst_date) = '".ahcfree_localtime('Y-m-d')."'";
2548
+ $groupby = " hour($vst_date)";
2549
+ }
2550
+
2551
+ $sql1 = "SELECT SUM(vtm_visitors) AS sm FROM ahc_visits_time WHERE DATE($vst_date) = '".ahcfree_localtime('Y-m-d')."'";
2552
+
2553
+
2554
+ $sql2 = "SELECT date(vst_date) as dt,hour($vst_date) AS hour, SUM(vst_visitors) AS vst_visitors, SUM(vst_visits) AS vst_visits FROM `ahc_visitors`
2555
+ WHERE $cond GROUP BY $groupby";
2556
+
2557
+ //echo $sql2;
2558
+ //$result1 = $wpdb->get_results($sql1);
2559
+ //if ($result1 !== false) {
2560
+ $total = 0;
2561
+ $result2 = $wpdb->get_results($sql2);
2562
+ //asort($result2);
2563
+ $utc_data = array();
2564
+
2565
+ if ($result2 !== false) {
2566
+ $arr = array();
2567
+ $new = array();
2568
+ $hourDetails = array();
2569
+ foreach ($result2 as $r) {
2570
+
2571
+ if(isset($hourDetails[ $r->hour ]))
2572
+ {
2573
+ $hourDetails[ $r->hour ]['visitor'] +=$r->vst_visitors;
2574
+ $hourDetails[ $r->hour ]['visits'] +=$r->vst_visits;
2575
+ $hourDetails[ $r->hour ]['counter'] += 1;
2576
+ }
2577
+ else
2578
+ {
2579
+ $hourDetails[ $r->hour ] = array(
2580
+ 'visitor' => $r->vst_visitors,
2581
+ 'visits' => $r->vst_visits,
2582
+ 'counter' => 1
2583
+ );
2584
+ }
2585
+ //$dtArr[]= $hourDetails;
2586
+ $total += $r->vst_visitors;
2587
+ }
2588
+
2589
+ if($start=='')
2590
+ $start = 0;
2591
+ if($limit!='' && $start == 20)
2592
+ $end = 24;
2593
+ else if($limit=="")
2594
+ $end = 24;
2595
+ else
2596
+ $end = $limit+$start;
2597
+
2598
+ if($all==1)
2599
+ {
2600
+ $start=0;
2601
+ $end=24;
2602
+ }
2603
+ $k=0;
2604
+ $avgtotal = 0;
2605
+ for( $i = $start; $i < $end; $i++ ){
2606
+
2607
+ $vtm_visitors = 0;
2608
+ $vtm_visits = 0;
2609
+ $totalDt = count($hourDetails);
2610
+
2611
+ if( isset( $hourDetails[$i] ) ){
2612
+ $vtm_visitors = $hourDetails[$i]['visitor']/$hourDetails[$i]['counter'];
2613
+ $avgtotal +=$vtm_visitors;
2614
+ $vtm_visits = $hourDetails[$i]['visits']/$hourDetails[$i]['counter'];
2615
+ }
2616
+ if( $i < 10 ){
2617
+ $timeTo = $timeFrom = '0'.$i;
2618
+ }else{
2619
+ $timeTo = $timeFrom = $i;
2620
+ }
2621
+ $arr[$k]['vtm_time_from'] = $timeFrom.':00';
2622
+ $arr[$k]['vtm_time_to'] = $timeTo.':59';
2623
+ // $arr[$k]['percent'] = ($total > 0) ? ahcfree_ceil_dec((($vtm_visitors / $total) * 100), 2, ".") : 0;
2624
+
2625
+ $arr[$k]['time'] = $timeFrom.':00 - '.$timeTo.':59';
2626
+
2627
+ $arr[$k]['vtm_visitors'] = ceil($vtm_visitors);
2628
+ $arr[$k]['vtm_visits'] = ceil($vtm_visits);
2629
+
2630
+ if($all==1)
2631
+ {
2632
+ $new[$k]['time'] = $timeFrom.':00 - '.$timeTo.':59';
2633
+ $new[$k]['vtm_visitors'] = ceil($vtm_visitors);
2634
+ $new[$k]['vtm_visits'] = ceil($vtm_visits);
2635
+ }
2636
+ $k++;
2637
+ }
2638
+ $avgtotal = $total;
2639
+
2640
+ $j=0;
2641
+ for( $i = $start; $i < $end; $i++ )
2642
+ {
2643
+ if( isset( $hourDetails[$i] ) )
2644
+ {
2645
+ $vtm_visitors = $hourDetails[$i]['visitor']/$hourDetails[$i]['counter'];
2646
+ }else{
2647
+ $vtm_visitors = 0;
2648
+ }
2649
+
2650
+ $arr[$j]['percent'] = ($avgtotal > 0) ? ahcfree_ceil_dec((($vtm_visitors / $total) * 100), 2, ".") : 0;
2651
+ $per = ($avgtotal > 0) ? ahcfree_ceil_dec((($vtm_visitors / $avgtotal) * 100), 2, ".") : 0;
2652
+
2653
+ if($all==1)
2654
+ $new[$j]['percent'] = $per;
2655
+
2656
+ if(ceil($per) > 25 && ceil($per) < 50)
2657
+ {
2658
+ $cls= 'visitorsGraph2';
2659
+ }
2660
+ else if (ceil($per) > 50)
2661
+ {
2662
+ $cls= 'visitorsGraph3';
2663
+ }
2664
+ else {
2665
+ $cls= 'visitorsGraph';
2666
+ }
2667
+ $css = (!empty($per)) ? 'style="width: ' . ceil($per) . '%;"' : '';
2668
+ $arr[$j]['graph'] = '<div class="visitorsGraphContainer"><div class="'.$cls.'" '.$css.'>&nbsp;</div><div class="cleaner"></div></div><div class="visitorsPercent">('. ceil($per).')%</div>';
2669
+ $j++;
2670
+ $cls = '';
2671
+ $per = 0;
2672
+ }
2673
+ if($all==1)
2674
+ return $new;
2675
+ return $arr;
2676
+ }
2677
+ //}
2678
+ return false;
2679
+
2680
+ }
2681
+
2682
+ function ahcfree_advanced_get_link($url, $followRedirects = true) {
2683
+ $url_parsed = @parse_url($url);
2684
+ $header = '';
2685
+ $body = '';
2686
+ $port = '';
2687
+
2688
+ if (empty($url_parsed['scheme'])) {
2689
+ $url_parsed = @parse_url($url);
2690
+ }
2691
+ $rtn['url'] = $url_parsed;
2692
+
2693
+ $port = $url_parsed["port"];
2694
+ if (!$port) {
2695
+ $port = 80;
2696
+ }
2697
+ $rtn['url']['port'] = $port;
2698
+
2699
+ $path = $url_parsed["path"];
2700
+ if (empty($path)) {
2701
+ $path = "/";
2702
+ }
2703
+ if (!empty($url_parsed["query"])) {
2704
+ $path .= "?" . $url_parsed["query"];
2705
+ }
2706
+ $rtn['url']['path'] = $path;
2707
+
2708
+ $host = $url_parsed["host"];
2709
+ $foundBody = false;
2710
+
2711
+ $out = "GET $path HTTP/1.0\r\n";
2712
+ $out .= "Host: $host\r\n";
2713
+ $out .= "Connection: Close\r\n\r\n";
2714
+
2715
+ if (!$fp = @fsockopen($host, $port, $errno, $errstr, 30)) {
2716
+ $rtn['errornumber'] = $errno;
2717
+ $rtn['errorstring'] = $errstr;
2718
+ return $rtn;
2719
+ }
2720
+ fwrite($fp, $out);
2721
+ while (!feof($fp)) {
2722
+ $s = fgets($fp, 128);
2723
+ if ($s == "\r\n") {
2724
+ $foundBody = true;
2725
+ continue;
2726
+ }
2727
+ if ($foundBody) {
2728
+ $body .= $s;
2729
+ } else {
2730
+ if (($followRedirects) && (stristr($s, "location:") != false)) {
2731
+ $redirect = preg_replace("/location:/i", "", $s);
2732
+ return ffl_HttpGet(trim($redirect));
2733
+ }
2734
+ $header .= $s;
2735
+ }
2736
+ }
2737
+ fclose($fp);
2738
+
2739
+ $rtn['header'] = trim($header);
2740
+ $rtn['body'] = trim($body);
2741
+ return $rtn;
2742
+ }
2743
+
2744
+ //--------------------------------------------
2745
+ /**
2746
+ * Returns client IP address
2747
+ *
2748
+ * @return string
2749
+ */
2750
+ function ahcfree_get_client_ip_address() {
2751
+ global $_SERVER;
2752
+ $ipAddress = '';
2753
+ if (isset($_SERVER['HTTP_X_REAL_IP']) && !empty($_SERVER['HTTP_X_REAL_IP']) && $_SERVER['HTTP_X_REAL_IP']!='127.0.0.1') {
2754
+ $ipAddress = $_SERVER['HTTP_X_REAL_IP'];
2755
+ }else if (isset($_SERVER['HTTP_CLIENT_IP']) && !empty($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP']!='127.0.0.1') {
2756
+ $ipAddress = $_SERVER['HTTP_CLIENT_IP'];
2757
+ } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']!='127.0.0.1') {
2758
+ $ipAddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
2759
+ } else if (isset($_SERVER['HTTP_X_FORWARDED']) && !empty($_SERVER['HTTP_X_FORWARDED']) && $_SERVER['HTTP_X_FORWARDED']!='127.0.0.1') {
2760
+ $ipAddress = $_SERVER['HTTP_X_FORWARDED'];
2761
+ } else if (isset($_SERVER['HTTP_FORWARDED_FOR']) && !empty($_SERVER['HTTP_FORWARDED_FOR']) && $_SERVER['HTTP_FORWARDED_FOR']!='127.0.0.1') {
2762
+ $ipAddress = $_SERVER['HTTP_FORWARDED_FOR'];
2763
+ } else if (isset($_SERVER['HTTP_FORWARDED']) && !empty($_SERVER['HTTP_FORWARDED']) && $_SERVER['HTTP_FORWARDED']!='127.0.0.1') {
2764
+ $ipAddress = $_SERVER['HTTP_FORWARDED'];
2765
+ } else if (isset($_SERVER['REMOTE_ADDR']) && !empty($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR']!='127.0.0.1') {
2766
+ $ipAddress = $_SERVER['REMOTE_ADDR'];
2767
+ } else {
2768
+ $ipAddress = 'UNKNOWN';
2769
+ }
2770
+
2771
+ $ipAddress = explode(',', $ipAddress);
2772
+
2773
+ return $ipAddress[0];
2774
+ }
2775
+
2776
+ //--------------------------------------------
2777
+ /**
2778
+ * To include scripts and styles tags into the head
2779
+ *
2780
+ * @uses wp_register_style()
2781
+ * @uses wp_enqueue_style()
2782
+ * @uses wp_register_script()
2783
+ * @uses wp_enqueue_script()
2784
+ *
2785
+ * @return void
2786
+ */
2787
+ function ahcfree_include_scripts() {
2788
+ wp_register_style('ahc_lang_css', plugins_url('/css/vtrtspro_css_stylesheet.css', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2789
+ wp_enqueue_style('ahc_lang_css');
2790
+
2791
+ wp_register_style('ahc_bootstrap_css', plugins_url('/lib/bootstrap/css/bootstrap.min.css',AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2792
+ wp_enqueue_style('ahc_bootstrap_css');
2793
+
2794
+ wp_enqueue_script('jquery');
2795
+
2796
+ wp_register_script('ahc_bootstrap_js', plugins_url('/lib/bootstrap/js/bootstrap.min.js',AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2797
+ wp_enqueue_script('ahc_bootstrap_js');
2798
+
2799
+ wp_register_script('ahc_lang_js', plugins_url('/lang/js/' . GlobalsAHC::$lang . '_lang.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2800
+ wp_enqueue_script('ahc_lang_js');
2801
+
2802
+ /* Pagination and export */
2803
+ wp_register_script('ahc_datatable_js', plugins_url('/js/jquery.dataTables.min.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2804
+ wp_enqueue_script('ahc_datatable_js');
2805
+ wp_register_script('ahc_tableexport_js', plugins_url('/js/dataTables.buttons.min.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2806
+ wp_enqueue_script('ahc_tableexport_js');
2807
+ wp_register_script('ahc_jzip_js', plugins_url('/js/jszip.min.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2808
+ wp_enqueue_script('ahc_jzip_js');
2809
+ wp_register_script('ahc_tableexportbutton_js', plugins_url('/js/buttons.html5.min.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2810
+ wp_enqueue_script('ahc_tableexportbutton_js');
2811
+
2812
+ wp_register_script('ahc_xlscore_js', plugins_url('/js/xlsx.core.min.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2813
+ wp_enqueue_script('ahc_xlscore_js');
2814
+ wp_register_script('ahc_filesave_js', plugins_url('/js/FileSaver.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2815
+ wp_enqueue_script('ahc_filesave_js');
2816
+ wp_register_script('ahc_xls_js', plugins_url('/js/jhxlsx.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2817
+ wp_enqueue_script('ahc_xls_js');
2818
+
2819
+ wp_register_style('jquery_date_css', plugins_url('/css/datepicker.css', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2820
+ wp_enqueue_style('jquery_date_css');
2821
+
2822
+ /* map */
2823
+ wp_register_style('jquery_leaflet_css', plugins_url('/css/leaflet.css', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2824
+ wp_enqueue_style('jquery_leaflet_css');
2825
+ wp_register_script('ahc_leaflet_js', plugins_url('/js/leaflet.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2826
+ wp_enqueue_script('ahc_leaflet_js');
2827
+
2828
+ wp_enqueue_script( 'jquery-ui-datepicker', array( 'jquery' ) );
2829
+ wp_register_script('ahc_main_js', plugins_url('/js/ahcfree_js_scripts.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2830
+ wp_enqueue_script('ahc_main_js');
2831
+
2832
+ wp_localize_script('ahc_main_js', 'ahc_ajax', array('ajax_url' => admin_url('admin-ajax.php')));
2833
+
2834
+ wp_register_script('ahc_Chart_js', plugins_url('/lib/Chart_js/Chart.min.js', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2835
+ wp_enqueue_script('ahc_Chart_js');
2836
+
2837
+ /*wp_register_script('ahc_google_maps', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyB0fRgC_3Wmp1PY5ZsuzK8VEooiUvVQq3Q&sensor=false');
2838
+ wp_enqueue_script('ahc_google_maps');*/
2839
+
2840
+
2841
+ // jqplot
2842
+ wp_register_style('jqueryjqplotmincss', plugins_url('/css/jquery.jqplot.min.css?ver=1.0.8', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2843
+ wp_enqueue_style('jqueryjqplotmincss');
2844
+
2845
+ wp_register_script('jqueryjqplotmin', plugins_url('/js/jquery.jqplot.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2846
+ wp_enqueue_script('jqueryjqplotmin');
2847
+
2848
+ wp_register_script('jqplotdateAxisRenderermin', plugins_url('/js/jqplot.dateAxisRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2849
+ wp_enqueue_script('jqplotdateAxisRenderermin');
2850
+
2851
+ wp_register_script('jqplotcanvasAxisTickRenderermin', plugins_url('/js/jqplot.canvasAxisTickRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2852
+ wp_enqueue_script('jqplotcanvasAxisTickRenderermin');
2853
+
2854
+ wp_register_script('jqplotcanvasAxisLabelRenderermin', plugins_url('/js/jqplot.canvasAxisLabelRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2855
+ wp_enqueue_script('jqplotcanvasAxisLabelRenderermin');
2856
+
2857
+ wp_register_script('jqplot.canvasTextRenderer.min', plugins_url('/js/jqplot.canvasTextRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2858
+ wp_enqueue_script('jqplot.canvasTextRenderer.min');
2859
+
2860
+
2861
+
2862
+ wp_register_script('jqplothighlightermin', plugins_url('/js/jqplot.highlighter.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2863
+ wp_enqueue_script('jqplothighlightermin');
2864
+
2865
+ wp_register_script('jqplot.pieRenderer.min', plugins_url('/js/jqplot.pieRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2866
+ wp_enqueue_script('jqplot.pieRenderer.min');
2867
+
2868
+ wp_register_script('jqplot.enhancedLegendRenderer.min', plugins_url('/js/jqplot.enhancedLegendRenderer.min.js?ver=0.8.3', AHCFREE_PLUGIN_MAIN_FILE), '', '1.21');
2869
+ wp_enqueue_script('jqplot.enhancedLegendRenderer.min');
2870
+ }
2871
+
2872
+ //--------------------------------------------
2873
+ //---------------------------------------------Add button to the admin bar
2874
+ function ahcfree_vtrts_add_items($admin_bar) {
2875
+ global $pluginsurl;
2876
+
2877
+ $wccpadminurl = get_admin_url();
2878
+ //The properties of the new item. Read More about the missing 'parent' parameter below
2879
+ $args = array(
2880
+ 'id' => 'visitorstraffic',
2881
+ 'title' => __('<img src="' . plugins_url('/images/vtrtspro.png', AHCFREE_PLUGIN_MAIN_FILE) . '" style="vertical-align:middle;margin-right:5px;" alt="visitor traffic" title="visitor traffic" />'),
2882
+ 'href' => $wccpadminurl . 'admin.php?page=ahc_hits_counter_menu_free',
2883
+ 'meta' => array('title' => __('Visitor Traffic Real Time Statistics'),)
2884
+ );
2885
+
2886
+ //This is where the magic works.
2887
+ $admin_bar->add_menu($args);
2888
+ }
2889
+
2890
+ //---------------------------------------- Add plugin settings link to Plugins page
2891
+ function ahcfree_vtrtsp_plugin_add_settings_link($links) {
2892
+ $settings_link = '<a href="admin.php?page=ahc_hits_counter_menu_free">' . __('visitor traffic') . '</a>';
2893
+ array_push($links, $settings_link);
2894
+ return $links;
2895
+ }
2896
+
2897
+ //------------------------------------------------------------------------
2898
+ // --------------------------------------- Create front-end widget
2899
+ // Creating the widget
2900
+ class vtrtsfree_widget extends WP_Widget {
2901
+
2902
+ function __construct() {
2903
+ parent::__construct(
2904
+ // Base ID of your widget
2905
+ 'vtrtsfree_widget',
2906
+ // Widget name will appear in UI
2907
+ __('Visitor Traffic', 'wpb_widget_domain'),
2908
+ // Widget description
2909
+ array('description' => __('Display your site statistics', 'wpb_widget_domain'),)
2910
+ );
2911
+ }
2912
+
2913
+ // Creating widget front-end
2914
+ // This is where the action happens
2915
+ public function widget($args, $instance) {
2916
+ $title = apply_filters('widget_title', $instance['title']);
2917
+ // before and after widget arguments are defined by themes
2918
+ echo $args['before_widget'];
2919
+ if (!empty($title))
2920
+ echo $args['before_title'] . $title . $args['after_title'];
2921
+
2922
+
2923
+ $ahc_sum_stats = ahcfree_get_summary_statistics();
2924
+
2925
+
2926
+ // This is where you run the code and display the output
2927
+ echo '<ul style="list-style:none; ' . $instance['fontTypeCombo'] . '; font-size:' . $instance['fontSizeCombo'] . 'px">';
2928
+ if ($instance['display_onlineusers'] == 1 or $instance['display_onlineusers'] == '1') {
2929
+ $online_img_path = plugins_url('/images/live.gif', AHCFREE_PLUGIN_MAIN_FILE);
2930
+ echo '<li><b style="color:#' . $instance['display_titlecolor'] . '">Users online: </b><span style="color:#' . $instance['display_valuescolor'] . '">' . ahcfree_countOnlineusers() . '</span>&nbsp;<img src="' . $online_img_path . '" /></li>';
2931
+ }
2932
+ if ($instance['display_visitorstoday'] == 1 or $instance['display_visitorstoday'] == '1') {
2933
+ echo '<li><b style="color:#' . $instance['display_titlecolor'] . '">Visitors today : </b><span style="color:#' . $instance['display_valuescolor'] . '">' . ahc_free_NumFormat($ahc_sum_stats['today']['visitors']) . '</span></li>';
2934
+ }
2935
+ if ($instance['display_pageviewtoday'] == 1 or $instance['display_pageviewtoday'] == '1') {
2936
+ echo '<li><b style="color:#' . $instance['display_titlecolor'] . '">Page views today : </b><span style="color:#' . $instance['display_valuescolor'] . '">' . ahc_free_NumFormat($ahc_sum_stats['today']['visits']) . '</span></li>';
2937
+ }
2938
+
2939
+ if ($instance['display_totalvisitors'] == 1 or $instance['display_totalvisitors'] == '1') {
2940
+ echo '<li><b style="color:#' . $instance['display_titlecolor'] . '">Total visitors : </b><span style="color:#' . $instance['display_valuescolor'] . '">' . ahc_free_NumFormat($ahc_sum_stats['total']['visitors']) . '</span></li>';
2941
+ }
2942
+
2943
+ if ($instance['display_totalpageview'] == 1 or $instance['display_totalpageview'] == '1') {
2944
+ echo '<li><b style="color:#' . $instance['display_titlecolor'] . '">Total page view: </b><span style="color:#' . $instance['display_valuescolor'] . '">' . ahc_free_NumFormat($ahc_sum_stats['total']['visits']) . '</span></li>';
2945
+ }
2946
+
2947
+
2948
+ echo '</ul>';
2949
+ echo $args['after_widget'];
2950
+ }
2951
+
2952
+ // Widget Backend
2953
+ public function form($instance) {
2954
+ extract($instance);
2955
+
2956
+ if (isset($instance['title'])) {
2957
+ $title = $instance['title'];
2958
+ } else {
2959
+ $title = __('Site Statistics', 'wpb_widget_domain');
2960
+ }
2961
+ // Widget admin form
2962
+
2963
+
2964
+ $fontTypeCombo = (isset($fontTypeCombo)) ? $fontTypeCombo : '';
2965
+ $display_valuescolor = (isset($display_valuescolor)) ? $display_valuescolor : '';
2966
+ $display_titlecolor = (isset($display_titlecolor)) ? $display_titlecolor : '';
2967
+
2968
+
2969
+ ?>
2970
+
2971
+ <link href='https://fonts.googleapis.com/css?family=Allura' rel='stylesheet' type='text/css'>
2972
+ <link href='https://fonts.googleapis.com/css?family=Dynalight' rel='stylesheet' type='text/css'>
2973
+
2974
+ <script src="//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js"></script>
2975
+ <script type="text/javascript" src="<?php echo plugins_url('/lib/jscolor/jscolor.js', AHCFREE_PLUGIN_MAIN_FILE) ?>"></script>
2976
+ <script>
2977
+ WebFont.load({
2978
+ google: {
2979
+ families: ['Allura', 'Dynalight']
2980
+ }
2981
+ });
2982
+
2983
+
2984
+
2985
+ </script>
2986
+
2987
+ <style type="text/css">
2988
+ .Allura { font-family: Allura, cursive ; }
2989
+ .Dynalight { font-family: Dynalight, cursive; }
2990
+ .verdana{ font-family:Verdana, Geneva, sans-serif;}
2991
+ .TimesNew{ font-family:"Times New Roman", Times, serif;}
2992
+ .Arial{font-family:Arial, Helvetica, sans-serif;}
2993
+ .Courier{font-family:"Courier New", Courier, monospace;}
2994
+ .TrebuchetMS{font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;}
2995
+ .Tahoma{font-family:Tahoma, Geneva, sans-serif}
2996
+
2997
+ #picker {
2998
+ margin:0;
2999
+ padding:0;
3000
+ border:0;
3001
+ width:70px;
3002
+ height:20px;
3003
+ border-right:20px solid green;
3004
+ line-height:20px;
3005
+ }
3006
+
3007
+ </style>
3008
+ <p>
3009
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget Title:'); ?></label>
3010
+ <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" />
3011
+ </p>
3012
+
3013
+ <p>
3014
+ <label for="<?php echo $this->get_field_id('display_titlecolor'); ?>"><?php _e('Title Color:'); ?></label>
3015
+ <input class="color widefat" id="<?php echo $this->get_field_id('display_titlecolor'); ?>" name="<?php echo $this->get_field_name('display_titlecolor'); ?>" style="border:#CCC solid 1px" value="<?php echo esc_attr($display_titlecolor); ?>" >
3016
+ </p>
3017
+
3018
+ <p>
3019
+ <label for="<?php echo $this->get_field_id('display_valuescolor'); ?>"><?php _e('Value Color:'); ?></label>
3020
+ <input class="color widefat" style="border:#CCC solid 1px" id="<?php echo $this->get_field_id('display_valuescolor'); ?>" name="<?php echo $this->get_field_name('display_valuescolor'); ?>" value="<?php echo esc_attr($display_valuescolor); ?>" >
3021
+ </p>
3022
+
3023
+
3024
+ <p>
3025
+ <label for="<?php echo $this->get_field_id('fontTypeCombo'); ?>"><?php _e('Font Type:'); ?></label>
3026
+ <select class="widefat" id="<?php echo $this->get_field_id('fontTypeCombo'); ?>" name="<?php echo $this->get_field_name('fontTypeCombo'); ?>">
3027
+ <optgroup class='verdana'>
3028
+ <option <?php selected($fontTypeCombo, 'font-family:Verdana, Geneva, sans-serif'); ?> value="font-family:Verdana, Geneva, sans-serif">Verdana</option>
3029
+ </optgroup>
3030
+
3031
+ <optgroup class='TimesNew'>
3032
+ <option <?php selected($fontTypeCombo, "font-family:'Times New Roman', Times, serif"); ?> value="font-family:'Times New Roman', Times, serif">Times New Roman</option>
3033
+ </optgroup>
3034
+
3035
+ <optgroup class='Arial'>
3036
+ <option <?php selected($fontTypeCombo, "font-family:Arial, Helvetica, sans-serif"); ?> value="font-family:Arial, Helvetica, sans-serif">Arial</option>
3037
+ </optgroup>
3038
+
3039
+ <optgroup class='Tahoma'>
3040
+ <option <?php selected($fontTypeCombo, "font-family:Tahoma, Geneva, sans-serif"); ?> value="font-family:Tahoma, Geneva, sans-serif">Tahoma</option>
3041
+ </optgroup>
3042
+
3043
+ <optgroup class='Courier'>
3044
+ <option <?php selected($fontTypeCombo, "font-family:'Courier New', Courier, monospace"); ?> value="font-family:'Courier New', Courier, monospace">Courier</option>
3045
+ </optgroup>
3046
+
3047
+ <optgroup class='TrebuchetMS'>
3048
+ <option <?php selected($fontTypeCombo, "font-family:'Trebuchet MS', Arial, Helvetica, sans-serif"); ?> value="font-family:'Trebuchet MS', Arial, Helvetica, sans-serif">Trebuchet MS</option>
3049
+ </optgroup>
3050
+
3051
+
3052
+ </select>
3053
+
3054
+ </p>
3055
+ <label for="<?php echo $this->get_field_id('fontSizeCombo'); ?>"><?php _e('Font Size:'); ?></label>
3056
+ <select class="widefat" id="<?php echo $this->get_field_id('fontSizeCombo'); ?>" name="<?php echo $this->get_field_name('fontSizeCombo'); ?>">
3057
+ <?php
3058
+ for ($fs = 8; $fs <= 22; $fs++) {
3059
+ $fontSizeCombo = (isset($fontSizeCombo)) ? $fontSizeCombo : '';
3060
+ ?>
3061
+ <option value="<?php echo $fs ?>" <?php selected($fontSizeCombo, $fs); ?>><?php echo $fs; ?>px</option>
3062
+ <?php } ?>
3063
+ </select>
3064
+ <p>
3065
+
3066
+ </p>
3067
+
3068
+ <p><em>Display :</em></p>
3069
+ <?php
3070
+ $display_onlineusers = isset($display_onlineusers) ? $display_onlineusers : '0';
3071
+ $display_visitorstoday = isset($display_visitorstoday) ? $display_visitorstoday : '0';
3072
+ $display_pageviewtoday = isset($display_pageviewtoday) ? $display_pageviewtoday : '0';
3073
+ $display_totalpageview = isset($display_totalpageview) ? $display_totalpageview : '0';
3074
+ $display_totalvisitors = isset($display_totalvisitors) ? $display_totalvisitors : '0';
3075
+ ?>
3076
+
3077
+ <p>
3078
+ <input class="widefat" id="<?php echo $this->get_field_id('display_onlineusers'); ?>" name="<?php echo $this->get_field_name('display_onlineusers'); ?>" type="checkbox" value="1" <?php checked($display_onlineusers, '1'); ?> />&nbsp;<label for="<?php echo $this->get_field_id('display_onlineusers'); ?>">Users Online</label>
3079
+ </p>
3080
+ <p>
3081
+ <input class="widefat" id="<?php echo $this->get_field_id('display_visitorstoday'); ?>" name="<?php echo $this->get_field_name('display_visitorstoday'); ?>" type="checkbox" value="1" <?php checked($display_visitorstoday, '1'); ?>/>&nbsp;<label for="<?php echo $this->get_field_id('display_visitorstoday'); ?>">Visitors Today</label>
3082
+ </p>
3083
+ <p>
3084
+ <input class="widefat" id="<?php echo $this->get_field_id('display_pageviewtoday'); ?>" name="<?php echo $this->get_field_name('display_pageviewtoday'); ?>" type="checkbox" value="1" <?php checked($display_pageviewtoday, '1'); ?>/>&nbsp;<label for="<?php echo $this->get_field_id('display_pageviewtoday'); ?>">Page Views Today</label>
3085
+ </p>
3086
+ <p>
3087
+ <input class="widefat" id="<?php echo $this->get_field_id('display_totalpageview'); ?>" name="<?php echo $this->get_field_name('display_totalpageview'); ?>" type="checkbox" value="1" <?php checked($display_totalpageview, '1'); ?> />&nbsp;<label for="<?php echo $this->get_field_id('display_totalpageview'); ?>">Total Page Views</label>
3088
+ </p>
3089
+ <p>
3090
+ <input class="widefat" id="<?php echo $this->get_field_id('display_totalvisitors'); ?>" name="<?php echo $this->get_field_name('display_totalvisitors'); ?>" type="checkbox" value="1" <?php checked($display_totalvisitors, '1'); ?>/>&nbsp;<label for="<?php echo $this->get_field_id('display_totalvisitors'); ?>">Total Visitors</label>
3091
+ </p>
3092
+ </p>
3093
+ <?php
3094
+ }
3095
+
3096
+ // Updating widget replacing old instances with new
3097
+ public function update($new_instance, $old_instance) {
3098
+
3099
+ return $new_instance;
3100
+ }
3101
+
3102
+ }
3103
+
3104
+ // Class vtrtsfree_widget ends here
3105
+ // Register and load the widget
3106
+ function ahcfree_wpb_load_widget() {
3107
+ register_widget('vtrtsfree_widget');
3108
+ }
3109
+
3110
+ add_action('widgets_init', 'ahcfree_wpb_load_widget');
3111
+
3112
+ function ahcfree_get_hits_by_custom_duration_callback(){
3113
+ $hits_duration = intval($_POST['hits_duration']);
3114
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
3115
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
3116
+
3117
+ $myend_date = new DateTime();
3118
+ $myend_date->setTimezone($custom_timezone);
3119
+
3120
+ $end_date = $myend_date->format('Y-m-d');
3121
+ $full_end_date = $myend_date->format('Y-m-d 23:59:59');
3122
+
3123
+ $mystart_date = new DateTime();
3124
+ $mystart_date->setTimezone($custom_timezone);
3125
+ $stat = '';
3126
+ switch ($hits_duration){
3127
+
3128
+ case '7':
3129
+ $mystart_date->modify('-6 days');
3130
+ $start_date = $mystart_date->format('Y-m-d');
3131
+ $full_start_date = $mystart_date->format('Y-m-d 00:00:00');
3132
+ $interval = '1 day';
3133
+
3134
+ break;
3135
+
3136
+ case 'current_month':
3137
+ //$mystart_date->modify('0:00 first day of curent month');
3138
+ $start_date = $mystart_date->format('Y-m-01');
3139
+ $end_date = $mystart_date->format('Y-m-t');
3140
+ $full_start_date = $mystart_date->format('Y-m-01');
3141
+ $full_end_date = $mystart_date->format('Y-m-t');
3142
+ $interval = '1 day';
3143
+ $stat = 'current_month';
3144
+ break;
3145
+
3146
+ case 'last_month':
3147
+ $mystart_date->modify('0:00 first day of previous month');
3148
+ $start_date = $mystart_date->format('Y-m-d');
3149
+ $end_date = $mystart_date->format('Y-m-t');
3150
+ $full_start_date = $mystart_date->format('Y-m-d');
3151
+ $full_end_date = $mystart_date->format('Y-m-t');
3152
+ $interval = '1 day';
3153
+ $stat = 'last_month';
3154
+ break;
3155
+
3156
+ case '30':
3157
+ /*$mystart_date->modify('first day of previous month');
3158
+ $start_date = $mystart_date->format('Y-m-d');
3159
+ $full_start_date = $mystart_date->format('Y-m-d H:i:s');
3160
+
3161
+ $myend_date->modify('last day of previous month');
3162
+ $end_date = $myend_date->format('Y-m-d');
3163
+ $full_end_date = $myend_date->format('Y-m-d H:i:s');*/
3164
+
3165
+ $mystart_date->modify('-30 days');
3166
+ $start_date = $mystart_date->format('Y-m-d');
3167
+ $full_start_date = $mystart_date->format('Y-m-d 00:00:00');
3168
+
3169
+ $interval = '1 week';
3170
+ break;
3171
+
3172
+
3173
+
3174
+ case '0':
3175
+ $full_start_date = $full_end_date = '';
3176
+ $stat = 'all';
3177
+ break;
3178
+
3179
+ case 'range':
3180
+ $full_start_date = $start_date = $_POST['hits_duration_from'];
3181
+ $full_end_date = $_POST['hits_duration_to'];
3182
+ $interval = '1 day';
3183
+ break;
3184
+
3185
+ default :
3186
+ $mystart_date->modify(' - ' . (AHCFREE_VISITORS_VISITS_LIMIT - 1) . ' days');
3187
+ $start_date = $mystart_date->format('Y-m-d');
3188
+ $full_start_date = $mystart_date->format('Y-m-d 00:00:00');
3189
+ $interval = '1 day';
3190
+ break;
3191
+ }
3192
+
3193
+ $visits_visitors_data = ahcfree_get_visits_by_custom_duration_callback($full_start_date,$full_end_date,$stat);
3194
+ //print_r($visits_visitors_data);
3195
+
3196
+ $response = array( 'mystart_date' => $start_date,
3197
+ 'myend_date' => $end_date,
3198
+ 'full_start_date' => $full_start_date,
3199
+ 'full_end_date' => $full_end_date,
3200
+ 'interval' => $interval,
3201
+ 'visitors_data' => json_encode($visits_visitors_data['visitors']),
3202
+ 'visits_data' => json_encode($visits_visitors_data['visits'])
3203
+ );
3204
+
3205
+ echo json_encode( $response );
3206
+ die;
3207
+ }
3208
+
3209
+
3210
+ function ahcfree_get_visits_by_custom_duration_callback( $start_date,$end_date,$stat){
3211
+ global $wpdb;
3212
+ $visits_arr = array();
3213
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
3214
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
3215
+
3216
+ $results = false;
3217
+
3218
+ $mystart_date = new DateTime($start_date);
3219
+ $myend_date = new DateTime($end_date);
3220
+
3221
+ $total_days = date_diff( $mystart_date, $myend_date );
3222
+ $total_days = $total_days->format("%a");
3223
+
3224
+ $cond = "DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) >= DATE('". $start_date ." 00:00:00') AND DATE(CONVERT_TZ(vst_date, '" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "')) <= DATE('". $end_date ." 23:59:59')";
3225
+
3226
+ if($stat == 'year')
3227
+ {
3228
+ $sql = "SELECT DATE_FORMAT(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'),'%Y-%m') as group_date,DATE_FORMAT(CONVERT_TZ(vst_date,'".AHCFREE_SERVER_CURRENT_TIMEZONE."','".$custom_timezone_offset."'),'%Y-%m-01') as vst_date,SUM(vst_visitors) as vst_visitors,SUM(vst_visits) as vst_visits FROM ahc_visitors WHERE ". $cond." GROUP BY group_date";
3229
+ }
3230
+ if($stat == 'all')
3231
+ {
3232
+ $sql = "SELECT DATE_FORMAT(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "', '" . $custom_timezone_offset . "'),'%Y-%m') as group_date,DATE_FORMAT(CONVERT_TZ(vst_date,'".AHCFREE_SERVER_CURRENT_TIMEZONE."','".$custom_timezone_offset."'),'%Y-%m-01') as vst_date,SUM(vst_visitors) as vst_visitors,SUM(vst_visits) as vst_visits FROM ahc_visitors GROUP BY group_date ORDER BY vst_date ASC";
3233
+
3234
+ }
3235
+ if($stat == '' || $stat == 'current_month' || $stat == 'last_month' )
3236
+ {
3237
+ $sql = "SELECT DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "')) as vst_date, SUM(vst_visits) AS vst_visits,SUM(vst_visitors) as vst_visitors FROM ahc_visitors WHERE ". $cond ." GROUP BY DATE(CONVERT_TZ(vst_date,'" . AHCFREE_SERVER_CURRENT_TIMEZONE . "','" . $custom_timezone_offset . "'))";
3238
+ }
3239
+ //echo $sql;
3240
+ $results = $wpdb->get_results($sql, OBJECT);
3241
+ if ($results !== false) {
3242
+
3243
+ if($stat == 'year')
3244
+ {
3245
+ for ($i = 1; $i <= ahcfree_localtime('n'); $i++) {
3246
+ $month = $mystart_date->format('m');
3247
+ $year = $mystart_date->format('Y');
3248
+ $total_days = cal_days_in_month(CAL_GREGORIAN, $month ,$year);
3249
+
3250
+ $visits_arr['visits'][] = array($mystart_date->format('Y-m-d'), 0);
3251
+ $visits_arr['visitors'][] = array($mystart_date->format('Y-m-d'), 0);
3252
+ $mystart_date->modify( '+'.$total_days.' days' );
3253
+ }
3254
+ }
3255
+ elseif($stat == 'all')
3256
+ {
3257
+ foreach($results as $key =>$element) {
3258
+ reset($results);
3259
+ if ($key === key($results)){
3260
+ $first_date = $element->vst_date;
3261
+ }
3262
+
3263
+ end($results);
3264
+ if ($key === key($results)){
3265
+ $last_date = $element->vst_date;
3266
+ }
3267
+ }
3268
+
3269
+ $d1 = new DateTime($first_date);
3270
+ $d2 = new DateTime($last_date);
3271
+
3272
+ if(count($results) == 1 )
3273
+ {
3274
+ $pre_d1 = new DateTime($first_date);
3275
+ $pre_d1->modify( 'first day of previous month' );
3276
+ $visits_arr['visits'][] = array($pre_d1->format( 'Y-m-d' ), 0);
3277
+ $visits_arr['visitors'][] = array($pre_d1->format( 'Y-m-d' ), 0);
3278
+ }
3279
+
3280
+ $diff = $d1->diff($d2)->m + 1;
3281
+
3282
+ for ($i = 1; $i <= $diff; $i++) {
3283
+ $visits_arr['visits'][] = array($d1->format('Y-m-d'), 0);
3284
+ $visits_arr['visitors'][] = array($d1->format('Y-m-d'), 0);
3285
+ $d1->modify( '+1 Month' );
3286
+ }
3287
+ }
3288
+ else
3289
+ {
3290
+ if($stat == 'current_month'){
3291
+ $total_days = ahcfree_localtime('t');
3292
+ $total_days--;
3293
+ }
3294
+ if($stat == 'last_month'){
3295
+ $total_days = ahcfree_localtime('t', strtotime('first day of previous month'));
3296
+ $total_days--;
3297
+ }
3298
+ $visits_arr['visits'][] = array($mystart_date->format('Y-m-d'), 0);
3299
+ $visits_arr['visitors'][] = array($mystart_date->format('Y-m-d'), 0);
3300
+ for ($i = 1; $i <= $total_days; $i++) {
3301
+ $mystart_date->modify( '+1 Day' );
3302
+ $visits_arr['visits'][] = array($mystart_date->format('Y-m-d'), 0);
3303
+ $visits_arr['visitors'][] = array($mystart_date->format('Y-m-d'), 0);
3304
+ }
3305
+ }
3306
+ //print_r($visits_arr['visits']);
3307
+ foreach( $visits_arr['visits'] as $key=>$visits ){
3308
+ foreach ($results as $r) {
3309
+ if( $visits[0] == $r->vst_date )
3310
+ {
3311
+ $visits_arr['visits'][$key][1] = $r->vst_visits;
3312
+ }
3313
+ }
3314
+ }
3315
+
3316
+ foreach( $visits_arr['visitors'] as $key=>$visits ){
3317
+ foreach ($results as $r) {
3318
+ if( $visits[0] == $r->vst_date )
3319
+ {
3320
+ $visits_arr['visitors'][$key][1] = $r->vst_visitors;
3321
+ }
3322
+ }
3323
+ }
3324
+ }
3325
+ //echo $wpdb->last_query;
3326
+ return $visits_arr;
3327
+
3328
+ }
3329
+ function ahcfree_admin_notice_to_set_timezone(){
3330
+ $class = 'notice notice-error';
3331
+ $name = 'Visitor Traffic Real Time Statistics Free';
3332
+ $message = sprintf( __( 'Please set timezone from <a href="%s">here</a>' ), site_url('wp-admin/admin.php?page=ahc_hits_counter_settings') );
3333
+
3334
+ printf( '<div class="%1$s"><h3>%2$s</h3><p>%3$s</p></div>', esc_attr( $class ), $name, $message );
3335
+
3336
+ }
3337
+ /*function ahcfree_get_visitors_by_custom_duration_callback( $start_date,$end_date ){
3338
+
3339
+ global $wpdb;
3340
+ $visitors_arr = array();
3341
+ $custom_timezone_offset = ahcfree_get_current_timezone_offset();
3342
+ $custom_timezone = new DateTimeZone(ahcfree_get_timezone_string());
3343
+
3344
+ $results = false;
3345
+
3346
+ $mystart_date = new DateTime($start_date);
3347
+ $myend_date = new DateTime($end_date);
3348
+
3349
+ $total_days = date_diff( $mystart_date, $myend_date );
3350
+ $total_days = $total_days->format("%a");
3351
+
3352
+
3353
+ if($start_date == 'all'){
3354
+
3355
+ $cond = "DATE(CONVERT_TZ(vst_date, " . AHCFREE_SERVER_CURRENT_TIMEZONE . ", '" . $custom_timezone_offset . "')) <= DATE('". $end_date ."')";
3356
+
3357
+ }
3358
+ else{
3359
+
3360
+ $cond = "DATE(CONVERT_TZ(vst_date, " . AHCFREE_SERVER_CURRENT_TIMEZONE . ", '" . $custom_timezone_offset . "')) <= DATE('". $end_date ."') AND DATE(CONVERT_TZ(vst_date, " . AHCFREE_SERVER_CURRENT_TIMEZONE . ", '" . $custom_timezone_offset . "')) >= DATE('". $start_date ."')";
3361
+
3362
+ }
3363
+
3364
+
3365
+ $sql = "SELECT DATE(CONVERT_TZ(vst_date," . AHCFREE_SERVER_CURRENT_TIMEZONE . ",'" . $custom_timezone_offset . "')) as vst_date, vst_visitors
3366
+ FROM ahc_visitors
3367
+ WHERE ". $cond;
3368
+
3369
+ $results = $wpdb->get_results($sql, OBJECT);
3370
+
3371
+ if ($results !== false) {
3372
+ $mystart_date->modify( '-1 Day' );
3373
+ for ($i = count($results); $i < $total_days; $i++) {
3374
+ $visitors_arr[] = array($mystart_date->format('Y-m-d') , 0 );
3375
+ $mystart_date->modify( '+1 Day' );
3376
+ }
3377
+ foreach ($results as $r) {
3378
+
3379
+ $hitDate = new DateTime($r->vst_date);
3380
+ $visitors_arr[] = array($hitDate->format('Y-m-d'), $r->vst_visitors);
3381
+ }
3382
+ }
3383
+ return $visitors_arr;
3384
+
3385
+ }*/
3386
+
3387
+ function ahcfree_getFormattedDate($date,$format="")
3388
+ {
3389
+ if($date!='')
3390
+ {
3391
+ if($format=="yymmdd")
3392
+ return DateTime::createFromFormat('m-d-Y', $date)->format('Y-m-d');
3393
+ else
3394
+ return DateTime::createFromFormat('m-d-Y', $date)->format('m/d/Y');
3395
+
3396
+ }
3397
+
3398
+ }
3399
+ add_action("wp_ajax_traffic_by_title","ahcfree_traffic_by_title_callback");
3400
+ function ahcfree_traffic_by_title_callback()
3401
+ {
3402
+ if(isset($_REQUEST['page']) &&$_REQUEST['page']=="all")
3403
+ {
3404
+ $res =ahcfree_get_traffic_by_title(1,false,"","",$_REQUEST['search']['value']);
3405
+ echo json_encode($res);
3406
+ exit;
3407
+ }
3408
+ else
3409
+ {
3410
+ $cnt = ahcfree_get_traffic_by_title("",true,"","",$_REQUEST['search']['value']);
3411
+ $tTitles = ahcfree_get_traffic_by_title("",false,$_REQUEST['start'],$_REQUEST['length'],$_REQUEST['search']['value']);
3412
+
3413
+ $arr["draw"]= 0;
3414
+ $arr["recordsTotal"]= $cnt;
3415
+ $arr["recordsFiltered"]= $cnt;
3416
+ $arr['data'] = $tTitles;
3417
+ echo json_encode($arr);
3418
+ exit;
3419
+ }
3420
+ }
3421
+ //add_action("wp_ajax_traffic_by_countries","ahcfree_traffic_by_countries_callback");
3422
+ function ahcfree_traffic_by_countries_callback()
3423
+ {
3424
+
3425
+ if(isset($_REQUEST['page']) &&$_REQUEST['page']=="all")
3426
+ {
3427
+ $res =ahcfree_get_top_countries(0,"","",1,false);
3428
+ echo json_encode($res);
3429
+ exit;
3430
+ }
3431
+ else
3432
+ {
3433
+ $tTitles = ahcfree_get_top_countries(0,$_REQUEST['start'],$_REQUEST['length'],"",false);
3434
+ $cnt = ahcfree_get_top_countries(0,"","","",true);
3435
+
3436
+ $arr["draw"]= 0;
3437
+ $arr["recordsTotal"]= $cnt;
3438
+ $arr["recordsFiltered"]= $cnt;
3439
+ $arr['data'] = $tTitles['data'];
3440
+ echo json_encode($arr);
3441
+ exit;
3442
+ }
3443
+ }
3444
+
3445
+ add_action("wp_ajax_recent_visitor_by_ip","ahcfree_recent_visitor_by_ip_callback");
3446
+ function ahcfree_recent_visitor_by_ip_callback()
3447
+ {
3448
+ if(isset($_REQUEST['page']) && $_REQUEST['page']=="all")
3449
+ {
3450
+ $res = ahcfree_get_recent_visitors(1,false,"","",$_REQUEST['fdt'],$_REQUEST['tdt'],$_REQUEST['ip']);
3451
+ echo json_encode($res);
3452
+ exit;
3453
+ }
3454
+ else
3455
+ {
3456
+ $cnt = ahcfree_get_recent_visitors("",true,"","",$_REQUEST['fdt'],$_REQUEST['tdt'],$_REQUEST['ip']);
3457
+ $recentVisitors = ahcfree_get_recent_visitors("",false,$_REQUEST['start'],$_REQUEST['length'],$_REQUEST['fdt'],$_REQUEST['tdt'],$_REQUEST['ip']);
3458
+
3459
+
3460
+ $arr["draw"]= 0;
3461
+ $arr["recordsTotal"]= $cnt;
3462
+ $arr["recordsFiltered"]= $cnt;
3463
+ $arr['data'] = $recentVisitors;
3464
+ echo json_encode($arr);
3465
+ exit;
3466
+ }
3467
+ }
3468
+ add_action("wp_ajax_latest_search_words","ahcfree_latest_search_words_callback");
3469
+ function ahcfree_latest_search_words_callback()
3470
+ {
3471
+ if(isset($_REQUEST['page']) && $_REQUEST['page']=="all")
3472
+ {
3473
+ $res = ahcfree_get_latest_search_key_words_used(1,false,"","",$_REQUEST['fdt'],$_REQUEST['tdt']);
3474
+ echo json_encode($res);
3475
+ exit;
3476
+ }
3477
+ else
3478
+ {
3479
+ $cnt = ahcfree_get_latest_search_key_words_used("",true,"","",$_REQUEST['fdt'],$_REQUEST['tdt']);
3480
+ $recentVisitors = ahcfree_get_latest_search_key_words_used("",false,$_REQUEST['start'],$_REQUEST['length'],$_REQUEST['fdt'],$_REQUEST['tdt']);
3481
+
3482
+ $arr["draw"]= 0;
3483
+ $arr["recordsTotal"]= $cnt;
3484
+ $arr["recordsFiltered"]= $cnt;
3485
+ $arr['data'] = $recentVisitors;
3486
+ echo json_encode($arr);
3487
+ exit;
3488
+ }
3489
+ }
3490
+ add_action("wp_ajax_today_traffic_index","ahcfree_today_traffic_index_callback");
3491
+ function ahcfree_today_traffic_index_callback()
3492
+ {
3493
+ if(isset($_REQUEST['page']) && $_REQUEST['page']=="all")
3494
+ {
3495
+ $res = ahcfree_get_vsitors_by_country(1,false,"","",$_REQUEST['fdt'],$_REQUEST['tdt']);
3496
+ echo json_encode($res);
3497
+ exit;
3498
+ }
3499
+ else
3500
+ {
3501
+ $cnt = ahcfree_get_vsitors_by_country("",true,"","",$_REQUEST['fdt'],$_REQUEST['tdt']);
3502
+ $countries = ahcfree_get_vsitors_by_country("",false,$_REQUEST['start'],$_REQUEST['length'],$_REQUEST['fdt'],$_REQUEST['tdt']);
3503
+
3504
+ $arr["draw"]= 0;
3505
+ $arr["recordsTotal"]= $cnt;
3506
+ $arr["recordsFiltered"]= $cnt;
3507
+ $arr['data'] = $countries;
3508
+ echo json_encode($arr);
3509
+ exit;
3510
+ }
3511
+ }
3512
+ add_action("wp_ajax_visits_time_graph","ahcfree_visits_time_graph_callback");
3513
+ function ahcfree_visits_time_graph_callback()
3514
+ {
3515
+ if(isset($_REQUEST['page']) && $_REQUEST['page']=="all")
3516
+ {
3517
+
3518
+ $times = ahcfree_get_time_visits(1,"","",$_REQUEST['fdt'],$_REQUEST['tdt']);
3519
+ echo json_encode($times);
3520
+ exit;
3521
+ }
3522
+ else
3523
+ {
3524
+
3525
+ $times = ahcfree_get_time_visits("",$_REQUEST['start'],$_REQUEST['length'],$_REQUEST['fdt'],$_REQUEST['tdt']);
3526
+ //$res = ahcfree_get_time_visits("","","",$_REQUEST['fdt'],$_REQUEST['tdt']);
3527
+ $cnt = 24;
3528
+ $arr["draw"]= 0;
3529
+ $arr["recordsTotal"]= $cnt;
3530
+ $arr["recordsFiltered"]= $cnt;
3531
+ $arr['data'] = $times;
3532
+ echo json_encode($arr);
3533
+ exit;
3534
+ }
3535
+ }
3536
+ ?>
geoip/.gitignore ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ _site
2
+ .gh-pages
3
+ composer.lock
4
+ composer.phar
5
+ phpunit.xml
6
+ vendor/
7
+ *.sw?
8
+ t.php
9
+ *.old
geoip/.travis.yml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ language: php
2
+
3
+ php:
4
+ - 5.3
5
+ - 5.4
6
+ - 5.5
7
+ - 5.6
8
+ - hhvm
9
+
10
+ matrix:
11
+ allow_failures:
12
+ - php: hhvm
13
+
14
+ before_install:
15
+ - composer self-update
16
+ - composer install --dev -n --prefer-source
17
+ - phpenv rehash
18
+ - mkdir -p build/logs
19
+
20
+ script:
21
+ - phpunit -c phpunit.xml.dist
22
+
23
+ after_script:
24
+ - php vendor/bin/coveralls
25
+
26
+ notifications:
27
+ email:
28
+ recipients:
29
+ - dev@maxmind.com
30
+ on_success: change
31
+ on_failure: always
geoip/ChangeLog.md ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Change Log #
2
+
3
+ ## 1.15 (2014-??-??)
4
+
5
+ * Removed broken distributed queries code.
6
+
7
+ ## 1.14 (2013-11-05)
8
+
9
+ * Fix lookup issues with some domain databases ( Boris Zentner )
10
+ * Reorganize and clean up code ( Gregory Oschwald )
11
+ * Fix for module when mbstring extension is missing ( Gregory Oschwald )
12
+ * Update time zones ( Boris Zentner )
13
+
14
+ ## 1.13 (2013-05-27)
15
+
16
+ * Composer support ( Maksim Kotlyar )
17
+ * Remove duplicate key - A placeholder for unused countries.
18
+ ( Boris Zentner )
19
+
20
+ ## 1.12 (2013-02-20)
21
+
22
+ * Update FIPS Codes ( Boris Zentner )
23
+ * Add South Sudan ( Boris Zentner )
24
+ * Remove trailing space ( Boris Zentner )
25
+
26
+ ## 1.11 (2012-07-08)
27
+
28
+ * Update Time Zones ( Boris Zentner )
29
+ * Update FIPS codes ( Boris Zentner )
30
+
31
+ ## 1.10 (2012-03-26)
32
+
33
+ * Update time zones and country codes ( Boris Zentner )
34
+ * Add example for netspeedcell databases. ( Boris Zentner )
35
+
36
+ ## 1.9 (2011-08-23)
37
+
38
+ * Add new datatypes
39
+ GEOIP_COUNTRY_EDITION_V6, GEOIP_CITY_EDITION_REV1_V6
40
+ GEOIP_CITY_EDITION_REV0_V6, GEOIP_NETSPEED_EDITION_REV1,
41
+ GEOIP_NETSPEED_EDITION_REV1_V6, GEOIP_ASNUM_EDITION_V6,
42
+ GEOIP_ORG_EDITION_V6, GEOIP_DOMAIN_EDITION_V6,
43
+ GEOIP_ISP_EDITION_V6 ( Boris Zentner )
44
+ * Add new functions
45
+ geoip_country_id_by_name_v6
46
+ geoip_country_code_by_name_v6
47
+ geoip_country_name_by_name_v6
48
+ geoip_country_id_by_addr_v6
49
+ geoip_country_code_by_addr_v6
50
+ geoip_country_name_by_addr_v6
51
+ geoip_name_by_addr_v6
52
+ GeoIP_record_by_addr_v6 ( Boris Zentner )
53
+ * Add new examples sample-v6.php, sample_city-v6.php and
54
+ sample_asn-v6.php ( Boris Zentner )
55
+ * Replace ereg with substr ( Boris Zentner )
56
+ * replace split by explode ( Boris Zentner )
57
+ * Add all missing timezones ( Boris Zentner )
58
+ * Fix some 3letter codes ( Boris Zentner )
59
+ * Fix some continent codes ( Boris Zentner )
60
+ * Update FIPS codes 20100810 ( Boris Zentner )
61
+ * Add new database types GEOIP_LOCATIONA_EDITION, GEOIP_DOMAIN_EDITION
62
+ and GEOIP_ACCURACYRADIUS_EDITION ( Boris Zentner )
63
+ * Workaround php's broken usage of mb_substr instead of substr with
64
+ mbstring.func_overload and mbstring.internal_encoding ( Boris Zentner )
65
+ * Change Turkey's continent code from AS to EU ( Boris Zentner )
66
+ * Update FIPS codes 20090723 ( Boris Zentner )
67
+
68
+ ## 1.8 (2009-04-02)
69
+
70
+ * Add continent_code to the city record. See: sample_city.php ( Boris Zentner )
71
+ * Update FIPS codes 20090401 ( Boris Zentner )
72
+ * Fixed spelling of Kazakhstan, was Kazakstan
73
+ * Fix TN FIPS codes and add two new TH79 and TH80 ( Boris Zentner )
74
+ * Fix geoip_country_code_by_addr when used with a city database for unknown or private records ( cpw )
75
+ * Update timezone.php
76
+ * Sync geoipregionvars.php with fips codes from Jan, 14th 2009 ( Boris Zentner )
77
+ * use metro_code in sample_city.php ( Boris Zentner )
78
+ * replace the depreciated dma_code field with metro_code ( Boris Zentner )
79
+ * remove wrong but unreferenced Singapur SG fips regions codes ( Boris Zentner )
80
+ * update regions ( geoipregionvars.php ) ( Boris Zentner )
81
+ * Die when the database file is not found or readable ( Boris Zentner )
82
+
83
+ ## 1.7 (2008-1-8)
84
+
85
+ * Added BL/Saint Barthelemy, MF/Saint Martin (ISO-3166-1 additions)
86
+ * fixed bug with newlines in Country Name
87
+ * replaced $s_array[size] with $s_array['size'] (Daniel Horchner)
88
+ * Fix bug where PHP API didn't work with new edition of GeoIP ISP
89
+ 1.6 2007-1-10
90
+ * Added AX/Aland Islands, GG/Guernsey, IM/Isle of Man, JE/Jersey (ISO-3166-1 changes)
91
+ * Replaced CS/Serbia and Montenegro with RS/Serbia, removed ZR/Zaire, added ME/Montenegro
92
+ * geoip_country_(code|name)_by_addr now work against Geo(IP|Lite) City (Frank Mather)
93
+ * Added code to lookup zoneinfo timezone given country and region (Frank Mather)
94
+ * TP/East Timor changed to TL/Timor-Leste, reflecting changes in ISO-3166
95
+
96
+ ## 1.5 (2005-11-01)
97
+
98
+ * Added Shared Memory support for GeoIP City (Frank Mather)
99
+ * Replaced Yugoslavia with Serbia and Montenegro
100
+ * Removed global declaration for $GEOIP_COUNTRY_CODE_TO_NUMBER, $GEOIP_COUNTRY_CODES,
101
+ and $GEOIP_COUNTRY_CODES3
102
+
103
+ ## 1.4 (2005-01-13)
104
+
105
+ * Andrew Hill, Awarez Ltd. (http://www.awarez.net):
106
+ * Formatted file according to PEAR library standards.
107
+ * Moved $GEOIP_COUNTRY_CODE_TO_NUMBER, $GEOIP_COUNTRY_CODES,
108
+ $GEOIP_COUNTRY_CODES3 and $GEOIP_COUNTRY_NAMES into the
109
+ GeoIP class, so that library will still work even when
110
+ not included in the $GLOBAL context.
111
+ * Updated geoip_country_code_by_addr to work with PHP5 (Eric of Host Ultra)
112
+ * Replaced bit operators (| and &) with logical operators (|| and &&)
113
+ * Defined GEOIP_ISP_EDITION
114
+
115
+ ## 1.3 (2004-08-04)
116
+
117
+ * Changed license from GPL to LGPL so code can be included in PEAR
118
+ * added global definitions to prevent undefined variables error when including
119
+ from function (C�dric Dufour)
120
+ * Updated country names
121
+ * Added support for GeoIP City, version 1 with DMA and Area codes
122
+
123
+ ## 1.2 (2003-10-28)
124
+
125
+ * Added support for Shared Memory (Jason Priebe)
126
+ * Added support for Distributed queries
127
+ * Added support for GeoIP Region, version 1
128
+ * Added Anonymous Proxy and Satellite Provider code/labels
129
+ * Changed Taiwan, Province of China to Taiwan
130
+
131
+ ## 1.1 (2003-01-15)
132
+
133
+ * Added support for GeoIP Region and GeoIP City
134
+
135
+ ## 1.0 (2002-11-21)
136
+
137
+ * Initial checkin to CVS
geoip/LICENSE ADDED
@@ -0,0 +1,502 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 2.1, February 1999
3
+
4
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ [This is the first released version of the Lesser GPL. It also counts
10
+ as the successor of the GNU Library Public License, version 2, hence
11
+ the version number 2.1.]
12
+
13
+ Preamble
14
+
15
+ The licenses for most software are designed to take away your
16
+ freedom to share and change it. By contrast, the GNU General Public
17
+ Licenses are intended to guarantee your freedom to share and change
18
+ free software--to make sure the software is free for all its users.
19
+
20
+ This license, the Lesser General Public License, applies to some
21
+ specially designated software packages--typically libraries--of the
22
+ Free Software Foundation and other authors who decide to use it. You
23
+ can use it too, but we suggest you first think carefully about whether
24
+ this license or the ordinary General Public License is the better
25
+ strategy to use in any particular case, based on the explanations below.
26
+
27
+ When we speak of free software, we are referring to freedom of use,
28
+ not price. Our General Public Licenses are designed to make sure that
29
+ you have the freedom to distribute copies of free software (and charge
30
+ for this service if you wish); that you receive source code or can get
31
+ it if you want it; that you can change the software and use pieces of
32
+ it in new free programs; and that you are informed that you can do
33
+ these things.
34
+
35
+ To protect your rights, we need to make restrictions that forbid
36
+ distributors to deny you these rights or to ask you to surrender these
37
+ rights. These restrictions translate to certain responsibilities for
38
+ you if you distribute copies of the library or if you modify it.
39
+
40
+ For example, if you distribute copies of the library, whether gratis
41
+ or for a fee, you must give the recipients all the rights that we gave
42
+ you. You must make sure that they, too, receive or can get the source
43
+ code. If you link other code with the library, you must provide
44
+ complete object files to the recipients, so that they can relink them
45
+ with the library after making changes to the library and recompiling
46
+ it. And you must show them these terms so they know their rights.
47
+
48
+ We protect your rights with a two-step method: (1) we copyright the
49
+ library, and (2) we offer you this license, which gives you legal
50
+ permission to copy, distribute and/or modify the library.
51
+
52
+ To protect each distributor, we want to make it very clear that
53
+ there is no warranty for the free library. Also, if the library is
54
+ modified by someone else and passed on, the recipients should know
55
+ that what they have is not the original version, so that the original
56
+ author's reputation will not be affected by problems that might be
57
+ introduced by others.
58
+
59
+ Finally, software patents pose a constant threat to the existence of
60
+ any free program. We wish to make sure that a company cannot
61
+ effectively restrict the users of a free program by obtaining a
62
+ restrictive license from a patent holder. Therefore, we insist that
63
+ any patent license obtained for a version of the library must be
64
+ consistent with the full freedom of use specified in this license.
65
+
66
+ Most GNU software, including some libraries, is covered by the
67
+ ordinary GNU General Public License. This license, the GNU Lesser
68
+ General Public License, applies to certain designated libraries, and
69
+ is quite different from the ordinary General Public License. We use
70
+ this license for certain libraries in order to permit linking those
71
+ libraries into non-free programs.
72
+
73
+ When a program is linked with a library, whether statically or using
74
+ a shared library, the combination of the two is legally speaking a
75
+ combined work, a derivative of the original library. The ordinary
76
+ General Public License therefore permits such linking only if the
77
+ entire combination fits its criteria of freedom. The Lesser General
78
+ Public License permits more lax criteria for linking other code with
79
+ the library.
80
+
81
+ We call this license the "Lesser" General Public License because it
82
+ does Less to protect the user's freedom than the ordinary General
83
+ Public License. It also provides other free software developers Less
84
+ of an advantage over competing non-free programs. These disadvantages
85
+ are the reason we use the ordinary General Public License for many
86
+ libraries. However, the Lesser license provides advantages in certain
87
+ special circumstances.
88
+
89
+ For example, on rare occasions, there may be a special need to
90
+ encourage the widest possible use of a certain library, so that it becomes
91
+ a de-facto standard. To achieve this, non-free programs must be
92
+ allowed to use the library. A more frequent case is that a free
93
+ library does the same job as widely used non-free libraries. In this
94
+ case, there is little to gain by limiting the free library to free
95
+ software only, so we use the Lesser General Public License.
96
+
97
+ In other cases, permission to use a particular library in non-free
98
+ programs enables a greater number of people to use a large body of
99
+ free software. For example, permission to use the GNU C Library in
100
+ non-free programs enables many more people to use the whole GNU
101
+ operating system, as well as its variant, the GNU/Linux operating
102
+ system.
103
+
104
+ Although the Lesser General Public License is Less protective of the
105
+ users' freedom, it does ensure that the user of a program that is
106
+ linked with the Library has the freedom and the wherewithal to run
107
+ that program using a modified version of the Library.
108
+
109
+ The precise terms and conditions for copying, distribution and
110
+ modification follow. Pay close attention to the difference between a
111
+ "work based on the library" and a "work that uses the library". The
112
+ former contains code derived from the library, whereas the latter must
113
+ be combined with the library in order to run.
114
+
115
+ GNU LESSER GENERAL PUBLIC LICENSE
116
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
+
118
+ 0. This License Agreement applies to any software library or other
119
+ program which contains a notice placed by the copyright holder or
120
+ other authorized party saying it may be distributed under the terms of
121
+ this Lesser General Public License (also called "this License").
122
+ Each licensee is addressed as "you".
123
+
124
+ A "library" means a collection of software functions and/or data
125
+ prepared so as to be conveniently linked with application programs
126
+ (which use some of those functions and data) to form executables.
127
+
128
+ The "Library", below, refers to any such software library or work
129
+ which has been distributed under these terms. A "work based on the
130
+ Library" means either the Library or any derivative work under
131
+ copyright law: that is to say, a work containing the Library or a
132
+ portion of it, either verbatim or with modifications and/or translated
133
+ straightforwardly into another language. (Hereinafter, translation is
134
+ included without limitation in the term "modification".)
135
+
136
+ "Source code" for a work means the preferred form of the work for
137
+ making modifications to it. For a library, complete source code means
138
+ all the source code for all modules it contains, plus any associated
139
+ interface definition files, plus the scripts used to control compilation
140
+ and installation of the library.
141
+
142
+ Activities other than copying, distribution and modification are not
143
+ covered by this License; they are outside its scope. The act of
144
+ running a program using the Library is not restricted, and output from
145
+ such a program is covered only if its contents constitute a work based
146
+ on the Library (independent of the use of the Library in a tool for
147
+ writing it). Whether that is true depends on what the Library does
148
+ and what the program that uses the Library does.
149
+
150
+ 1. You may copy and distribute verbatim copies of the Library's
151
+ complete source code as you receive it, in any medium, provided that
152
+ you conspicuously and appropriately publish on each copy an
153
+ appropriate copyright notice and disclaimer of warranty; keep intact
154
+ all the notices that refer to this License and to the absence of any
155
+ warranty; and distribute a copy of this License along with the
156
+ Library.
157
+
158
+ You may charge a fee for the physical act of transferring a copy,
159
+ and you may at your option offer warranty protection in exchange for a
160
+ fee.
161
+
162
+ 2. You may modify your copy or copies of the Library or any portion
163
+ of it, thus forming a work based on the Library, and copy and
164
+ distribute such modifications or work under the terms of Section 1
165
+ above, provided that you also meet all of these conditions:
166
+
167
+ a) The modified work must itself be a software library.
168
+
169
+ b) You must cause the files modified to carry prominent notices
170
+ stating that you changed the files and the date of any change.
171
+
172
+ c) You must cause the whole of the work to be licensed at no
173
+ charge to all third parties under the terms of this License.
174
+
175
+ d) If a facility in the modified Library refers to a function or a
176
+ table of data to be supplied by an application program that uses
177
+ the facility, other than as an argument passed when the facility
178
+ is invoked, then you must make a good faith effort to ensure that,
179
+ in the event an application does not supply such function or
180
+ table, the facility still operates, and performs whatever part of
181
+ its purpose remains meaningful.
182
+
183
+ (For example, a function in a library to compute square roots has
184
+ a purpose that is entirely well-defined independent of the
185
+ application. Therefore, Subsection 2d requires that any
186
+ application-supplied function or table used by this function must
187
+ be optional: if the application does not supply it, the square
188
+ root function must still compute square roots.)
189
+
190
+ These requirements apply to the modified work as a whole. If
191
+ identifiable sections of that work are not derived from the Library,
192
+ and can be reasonably considered independent and separate works in
193
+ themselves, then this License, and its terms, do not apply to those
194
+ sections when you distribute them as separate works. But when you
195
+ distribute the same sections as part of a whole which is a work based
196
+ on the Library, the distribution of the whole must be on the terms of
197
+ this License, whose permissions for other licensees extend to the
198
+ entire whole, and thus to each and every part regardless of who wrote
199
+ it.
200
+
201
+ Thus, it is not the intent of this section to claim rights or contest
202
+ your rights to work written entirely by you; rather, the intent is to
203
+ exercise the right to control the distribution of derivative or
204
+ collective works based on the Library.
205
+
206
+ In addition, mere aggregation of another work not based on the Library
207
+ with the Library (or with a work based on the Library) on a volume of
208
+ a storage or distribution medium does not bring the other work under
209
+ the scope of this License.
210
+
211
+ 3. You may opt to apply the terms of the ordinary GNU General Public
212
+ License instead of this License to a given copy of the Library. To do
213
+ this, you must alter all the notices that refer to this License, so
214
+ that they refer to the ordinary GNU General Public License, version 2,
215
+ instead of to this License. (If a newer version than version 2 of the
216
+ ordinary GNU General Public License has appeared, then you can specify
217
+ that version instead if you wish.) Do not make any other change in
218
+ these notices.
219
+
220
+ Once this change is made in a given copy, it is irreversible for
221
+ that copy, so the ordinary GNU General Public License applies to all
222
+ subsequent copies and derivative works made from that copy.
223
+
224
+ This option is useful when you wish to copy part of the code of
225
+ the Library into a program that is not a library.
226
+
227
+ 4. You may copy and distribute the Library (or a portion or
228
+ derivative of it, under Section 2) in object code or executable form
229
+ under the terms of Sections 1 and 2 above provided that you accompany
230
+ it with the complete corresponding machine-readable source code, which
231
+ must be distributed under the terms of Sections 1 and 2 above on a
232
+ medium customarily used for software interchange.
233
+
234
+ If distribution of object code is made by offering access to copy
235
+ from a designated place, then offering equivalent access to copy the
236
+ source code from the same place satisfies the requirement to
237
+ distribute the source code, even though third parties are not
238
+ compelled to copy the source along with the object code.
239
+
240
+ 5. A program that contains no derivative of any portion of the
241
+ Library, but is designed to work with the Library by being compiled or
242
+ linked with it, is called a "work that uses the Library". Such a
243
+ work, in isolation, is not a derivative work of the Library, and
244
+ therefore falls outside the scope of this License.
245
+
246
+ However, linking a "work that uses the Library" with the Library
247
+ creates an executable that is a derivative of the Library (because it
248
+ contains portions of the Library), rather than a "work that uses the
249
+ library". The executable is therefore covered by this License.
250
+ Section 6 states terms for distribution of such executables.
251
+
252
+ When a "work that uses the Library" uses material from a header file
253
+ that is part of the Library, the object code for the work may be a
254
+ derivative work of the Library even though the source code is not.
255
+ Whether this is true is especially significant if the work can be
256
+ linked without the Library, or if the work is itself a library. The
257
+ threshold for this to be true is not precisely defined by law.
258
+
259
+ If such an object file uses only numerical parameters, data
260
+ structure layouts and accessors, and small macros and small inline
261
+ functions (ten lines or less in length), then the use of the object
262
+ file is unrestricted, regardless of whether it is legally a derivative
263
+ work. (Executables containing this object code plus portions of the
264
+ Library will still fall under Section 6.)
265
+
266
+ Otherwise, if the work is a derivative of the Library, you may
267
+ distribute the object code for the work under the terms of Section 6.
268
+ Any executables containing that work also fall under Section 6,
269
+ whether or not they are linked directly with the Library itself.
270
+
271
+ 6. As an exception to the Sections above, you may also combine or
272
+ link a "work that uses the Library" with the Library to produce a
273
+ work containing portions of the Library, and distribute that work
274
+ under terms of your choice, provided that the terms permit
275
+ modification of the work for the customer's own use and reverse
276
+ engineering for debugging such modifications.
277
+
278
+ You must give prominent notice with each copy of the work that the
279
+ Library is used in it and that the Library and its use are covered by
280
+ this License. You must supply a copy of this License. If the work
281
+ during execution displays copyright notices, you must include the
282
+ copyright notice for the Library among them, as well as a reference
283
+ directing the user to the copy of this License. Also, you must do one
284
+ of these things:
285
+
286
+ a) Accompany the work with the complete corresponding
287
+ machine-readable source code for the Library including whatever
288
+ changes were used in the work (which must be distributed under
289
+ Sections 1 and 2 above); and, if the work is an executable linked
290
+ with the Library, with the complete machine-readable "work that
291
+ uses the Library", as object code and/or source code, so that the
292
+ user can modify the Library and then relink to produce a modified
293
+ executable containing the modified Library. (It is understood
294
+ that the user who changes the contents of definitions files in the
295
+ Library will not necessarily be able to recompile the application
296
+ to use the modified definitions.)
297
+
298
+ b) Use a suitable shared library mechanism for linking with the
299
+ Library. A suitable mechanism is one that (1) uses at run time a
300
+ copy of the library already present on the user's computer system,
301
+ rather than copying library functions into the executable, and (2)
302
+ will operate properly with a modified version of the library, if
303
+ the user installs one, as long as the modified version is
304
+ interface-compatible with the version that the work was made with.
305
+
306
+ c) Accompany the work with a written offer, valid for at
307
+ least three years, to give the same user the materials
308
+ specified in Subsection 6a, above, for a charge no more
309
+ than the cost of performing this distribution.
310
+
311
+ d) If distribution of the work is made by offering access to copy
312
+ from a designated place, offer equivalent access to copy the above
313
+ specified materials from the same place.
314
+
315
+ e) Verify that the user has already received a copy of these
316
+ materials or that you have already sent this user a copy.
317
+
318
+ For an executable, the required form of the "work that uses the
319
+ Library" must include any data and utility programs needed for
320
+ reproducing the executable from it. However, as a special exception,
321
+ the materials to be distributed need not include anything that is
322
+ normally distributed (in either source or binary form) with the major
323
+ components (compiler, kernel, and so on) of the operating system on
324
+ which the executable runs, unless that component itself accompanies
325
+ the executable.
326
+
327
+ It may happen that this requirement contradicts the license
328
+ restrictions of other proprietary libraries that do not normally
329
+ accompany the operating system. Such a contradiction means you cannot
330
+ use both them and the Library together in an executable that you
331
+ distribute.
332
+
333
+ 7. You may place library facilities that are a work based on the
334
+ Library side-by-side in a single library together with other library
335
+ facilities not covered by this License, and distribute such a combined
336
+ library, provided that the separate distribution of the work based on
337
+ the Library and of the other library facilities is otherwise
338
+ permitted, and provided that you do these two things:
339
+
340
+ a) Accompany the combined library with a copy of the same work
341
+ based on the Library, uncombined with any other library
342
+ facilities. This must be distributed under the terms of the
343
+ Sections above.
344
+
345
+ b) Give prominent notice with the combined library of the fact
346
+ that part of it is a work based on the Library, and explaining
347
+ where to find the accompanying uncombined form of the same work.
348
+
349
+ 8. You may not copy, modify, sublicense, link with, or distribute
350
+ the Library except as expressly provided under this License. Any
351
+ attempt otherwise to copy, modify, sublicense, link with, or
352
+ distribute the Library is void, and will automatically terminate your
353
+ rights under this License. However, parties who have received copies,
354
+ or rights, from you under this License will not have their licenses
355
+ terminated so long as such parties remain in full compliance.
356
+
357
+ 9. You are not required to accept this License, since you have not
358
+ signed it. However, nothing else grants you permission to modify or
359
+ distribute the Library or its derivative works. These actions are
360
+ prohibited by law if you do not accept this License. Therefore, by
361
+ modifying or distributing the Library (or any work based on the
362
+ Library), you indicate your acceptance of this License to do so, and
363
+ all its terms and conditions for copying, distributing or modifying
364
+ the Library or works based on it.
365
+
366
+ 10. Each time you redistribute the Library (or any work based on the
367
+ Library), the recipient automatically receives a license from the
368
+ original licensor to copy, distribute, link with or modify the Library
369
+ subject to these terms and conditions. You may not impose any further
370
+ restrictions on the recipients' exercise of the rights granted herein.
371
+ You are not responsible for enforcing compliance by third parties with
372
+ this License.
373
+
374
+ 11. If, as a consequence of a court judgment or allegation of patent
375
+ infringement or for any other reason (not limited to patent issues),
376
+ conditions are imposed on you (whether by court order, agreement or
377
+ otherwise) that contradict the conditions of this License, they do not
378
+ excuse you from the conditions of this License. If you cannot
379
+ distribute so as to satisfy simultaneously your obligations under this
380
+ License and any other pertinent obligations, then as a consequence you
381
+ may not distribute the Library at all. For example, if a patent
382
+ license would not permit royalty-free redistribution of the Library by
383
+ all those who receive copies directly or indirectly through you, then
384
+ the only way you could satisfy both it and this License would be to
385
+ refrain entirely from distribution of the Library.
386
+
387
+ If any portion of this section is held invalid or unenforceable under any
388
+ particular circumstance, the balance of the section is intended to apply,
389
+ and the section as a whole is intended to apply in other circumstances.
390
+
391
+ It is not the purpose of this section to induce you to infringe any
392
+ patents or other property right claims or to contest validity of any
393
+ such claims; this section has the sole purpose of protecting the
394
+ integrity of the free software distribution system which is
395
+ implemented by public license practices. Many people have made
396
+ generous contributions to the wide range of software distributed
397
+ through that system in reliance on consistent application of that
398
+ system; it is up to the author/donor to decide if he or she is willing
399
+ to distribute software through any other system and a licensee cannot
400
+ impose that choice.
401
+
402
+ This section is intended to make thoroughly clear what is believed to
403
+ be a consequence of the rest of this License.
404
+
405
+ 12. If the distribution and/or use of the Library is restricted in
406
+ certain countries either by patents or by copyrighted interfaces, the
407
+ original copyright holder who places the Library under this License may add
408
+ an explicit geographical distribution limitation excluding those countries,
409
+ so that distribution is permitted only in or among countries not thus
410
+ excluded. In such case, this License incorporates the limitation as if
411
+ written in the body of this License.
412
+
413
+ 13. The Free Software Foundation may publish revised and/or new
414
+ versions of the Lesser General Public License from time to time.
415
+ Such new versions will be similar in spirit to the present version,
416
+ but may differ in detail to address new problems or concerns.
417
+
418
+ Each version is given a distinguishing version number. If the Library
419
+ specifies a version number of this License which applies to it and
420
+ "any later version", you have the option of following the terms and
421
+ conditions either of that version or of any later version published by
422
+ the Free Software Foundation. If the Library does not specify a
423
+ license version number, you may choose any version ever published by
424
+ the Free Software Foundation.
425
+
426
+ 14. If you wish to incorporate parts of the Library into other free
427
+ programs whose distribution conditions are incompatible with these,
428
+ write to the author to ask for permission. For software which is
429
+ copyrighted by the Free Software Foundation, write to the Free
430
+ Software Foundation; we sometimes make exceptions for this. Our
431
+ decision will be guided by the two goals of preserving the free status
432
+ of all derivatives of our free software and of promoting the sharing
433
+ and reuse of software generally.
434
+
435
+ NO WARRANTY
436
+
437
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438
+ WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439
+ EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440
+ OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441
+ KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444
+ LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445
+ THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
+
447
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449
+ AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450
+ FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452
+ LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453
+ RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454
+ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455
+ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456
+ DAMAGES.
457
+
458
+ END OF TERMS AND CONDITIONS
459
+
460
+ How to Apply These Terms to Your New Libraries
461
+
462
+ If you develop a new library, and you want it to be of the greatest
463
+ possible use to the public, we recommend making it free software that
464
+ everyone can redistribute and change. You can do so by permitting
465
+ redistribution under these terms (or, alternatively, under the terms of the
466
+ ordinary General Public License).
467
+
468
+ To apply these terms, attach the following notices to the library. It is
469
+ safest to attach them to the start of each source file to most effectively
470
+ convey the exclusion of warranty; and each file should have at least the
471
+ "copyright" line and a pointer to where the full notice is found.
472
+
473
+ <one line to give the library's name and a brief idea of what it does.>
474
+ Copyright (C) <year> <name of author>
475
+
476
+ This library is free software; you can redistribute it and/or
477
+ modify it under the terms of the GNU Lesser General Public
478
+ License as published by the Free Software Foundation; either
479
+ version 2.1 of the License, or (at your option) any later version.
480
+
481
+ This library is distributed in the hope that it will be useful,
482
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
483
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484
+ Lesser General Public License for more details.
485
+
486
+ You should have received a copy of the GNU Lesser General Public
487
+ License along with this library; if not, write to the Free Software
488
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
489
+
490
+ Also add information on how to contact you by electronic and paper mail.
491
+
492
+ You should also get your employer (if you work as a programmer) or your
493
+ school, if any, to sign a "copyright disclaimer" for the library, if
494
+ necessary. Here is a sample; alter the names:
495
+
496
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
497
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498
+
499
+ <signature of Ty Coon>, 1 April 1990
500
+ Ty Coon, President of Vice
501
+
502
+ That's all there is to it!
geoip/README.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MaxMind GeoIP Legacy PHP API #
2
+
3
+ ## Important Note ##
4
+
5
+ This API is for the GeoIP Legacy format (dat). To read the MaxMind DB format
6
+ (mmdb) used by GeoIP2, please see
7
+ [our GeoIP2 PHP API](https://github.com/maxmind/GeoIP2-php).
8
+
9
+ ## Requirements ##
10
+
11
+ This module has no external dependencies. You only need a MaxMind GeoIP
12
+ database. To download a free GeoLite Legacy Country database, please see
13
+ our [GeoLite Legacy page](http://dev.maxmind.com/geoip/legacy/geolite).
14
+
15
+ ## Install via Composer ##
16
+
17
+ We recommend installing this package with [Composer](http://getcomposer.org/).
18
+
19
+ ### Download Composer ###
20
+
21
+ To download Composer, run in the root directory of your project:
22
+
23
+ ```bash
24
+ curl -sS https://getcomposer.org/installer | php
25
+ ```
26
+
27
+ You should now have the file `composer.phar` in your project directory.
28
+
29
+ ### Install Dependencies ###
30
+
31
+ Run in your project root:
32
+
33
+ ```
34
+ php composer.phar require geoip/geoip:~1.14
35
+ ```
36
+
37
+ You should now have the files `composer.json` and `composer.lock` as well as
38
+ the directory `vendor` in your project directory. If you use a version control
39
+ system, `composer.json` should be added to it.
40
+
41
+ ### Require Autoloader ###
42
+
43
+ After installing the dependencies, you need to require the Composer autoloader
44
+ from your code:
45
+
46
+ ```php
47
+ require 'vendor/autoload.php';
48
+ ```
49
+
50
+ ## Install without Composer ##
51
+
52
+ Place the 'geoip.inc' file in the `include_path` as specified in your
53
+ `php.ini` file or place it in the same directory as your PHP scripts.
54
+
55
+ ## Usage ##
56
+
57
+ Gets country name by hostname :
58
+
59
+ ```php
60
+ <?php
61
+
62
+ require 'vendor/autoload.php';
63
+
64
+ $gi = geoip_open("/usr/local/share/GeoIP/GeoIP.dat",GEOIP_STANDARD);
65
+
66
+ echo geoip_country_code_by_addr($gi, "24.24.24.24") . "\t" .
67
+ geoip_country_name_by_addr($gi, "24.24.24.24") . "\n";
68
+ echo geoip_country_code_by_addr($gi, "80.24.24.24") . "\t" .
69
+ geoip_country_name_by_addr($gi, "80.24.24.24") . "\n";
70
+
71
+ geoip_close($gi);
72
+ ```
73
+
74
+ ## Memory Caching ##
75
+
76
+ To enable memory caching, pass `GEOIP_SHARED_MEMORY` or `GEOIP_MEMORY_CACHE`
77
+ as the second argument of `geoip_open`.
78
+
79
+ `GEOIP_SHARED_MEMORY` requires php >= 4.0.4 compiled with `--enable-shmop`
80
+ configure time. See (http://us2.php.net/manual/en/ref.shmop.php).
81
+ In addition, you should call `geoip_load_shared_mem` before calling
82
+ `geoip_open`. See `sample_city.php` for an example of shared memory caching.
83
+
84
+ ## Support ##
85
+
86
+ For help with this API or our databases, please see [our support page]
87
+ (http://www.maxmind.com/en/support).
88
+
89
+ ## Copyright and License ##
90
+
91
+ This software is Copyright (c) 2014 by MaxMind, Inc.
92
+
93
+ This is free software, licensed under the GNU Lesser General Public License
94
+ version 2.1 or later.
95
+
96
+ ## Thanks ##
97
+
98
+ Thanks to Jim Winstead.
geoip/admin/build_geoipregionvars.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ function downloadAndOpen($url)
5
+ {
6
+ $file = basename($url);
7
+ if (!file_exists(sprintf('%s/%s', __DIR__, $file))) {
8
+ $ch = curl_init();
9
+ $timeout = 5;
10
+ curl_setopt($ch, CURLOPT_URL, $url);
11
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
12
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
13
+ $data = curl_exec($ch);
14
+ curl_close($ch);
15
+ file_put_contents($file, $data);
16
+ }
17
+ return file($file);
18
+ }
19
+
20
+ $countries = downloadAndOpen('https://www.maxmind.com/download/geoip/misc/region_codes.csv');
21
+
22
+ $array = array();
23
+ foreach ($countries as $line) {
24
+ $datas = explode(',', $line);
25
+ $array[$datas[0]][trim(preg_replace('/"/im', '', $datas[2]))] = sprintf("%s", $datas[1]);
26
+ }
27
+ $array = array_map('array_flip', $array);
28
+ //date_default_timezone_set(date_default_timezone_get());
29
+ //date_default_timezone_set("UTC");
30
+ $output = "<?php\n";
31
+ $output .= sprintf("// Copyright %s MaxMind, Inc. All Rights Reserved\n", ahcpro_localtime('Y'));
32
+ $output .= "global \$GEOIP_REGION_NAME;\n";
33
+ $output .= "\$GEOIP_REGION_NAME = " . var_export($array, true) . ";\n";
34
+
35
+ file_put_contents(__DIR__ . '/../src/geoipregionvars.php', $output);
geoip/composer.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "geoip/geoip",
3
+ "description": "MaxMind GeoIP PHP API",
4
+ "keywords": [ "geoip", "geolocation", "maxmind" ],
5
+ "homepage": "http://dev.maxmind.com/geoip/legacy/downloadable",
6
+ "type": "library",
7
+ "license": "LGPL 2.1+",
8
+ "authors": [
9
+ {
10
+ "name": "MaxMind, Inc.",
11
+ "email": "support@maxmind.com",
12
+ "homepage": "http://www.maxmind.com/"
13
+ }
14
+ ],
15
+ "autoload": {
16
+ "files": [
17
+ "src/geoip.inc",
18
+ "src/geoipcity.inc",
19
+ "src/timezone.php"
20
+ ]
21
+ },
22
+ "conflict": {
23
+ "ext-geoip": "*"
24
+ },
25
+ "require-dev": {
26
+ "phpunit/phpunit": "3.7.*",
27
+ "satooshi/php-coveralls": "dev-master"
28
+ }
29
+ }
geoip/data/GeoIP.dat ADDED
Binary file
geoip/examples/asn-v6.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ // This code demonstrates how to lookup the country and region by IP Address
5
+ // It is designed to work with GeoIP Organization or GeoIP ISP available from MaxMind
6
+
7
+ include("../src/geoip.inc");
8
+
9
+ $giasn = geoip_open("/usr/local/share/GeoIP/GeoIPASNumv6.dat", GEOIP_STANDARD);
10
+
11
+ $ip = '2001:4860:0:1001::68';
12
+ $asn = geoip_name_by_addr_v6($giasn, $ip);
13
+ print "$ip has asn " . $asn . "\n";
14
+
15
+ geoip_close($giasn);
16
+
17
+ ?>
geoip/examples/benchmark.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ set_time_limit('300');
5
+
6
+ include("../src/geoip.inc");
7
+ include("../src/geoipcity.inc");
8
+ define("GEOIP_COUNTRY_DATABASE", 0);
9
+ define("GEOIP_REGION_DATABASE", 1);
10
+ define("GEOIP_CITY_DATABASE", 2);
11
+
12
+ class mainappc
13
+ {
14
+ public $dbfilename = array(
15
+ "/usr/local/share/GeoIP/GeoIP.dat",
16
+ "/usr/local/share/GeoIP/GeoIPRegion.dat",
17
+ "/usr/local/share/GeoIP/GeoIPCity.dat"
18
+ );
19
+
20
+ public function randomipaddress()
21
+ {
22
+ $result = "";
23
+ for ($a = 0; $a < 4; $a++) {
24
+ if ($a > 0) {
25
+ $result = $result . ".";
26
+ }
27
+ $a2 = rand(1, 254);
28
+ $result = $result . $a2;
29
+ }
30
+ return $result;
31
+ }
32
+
33
+ public function testgeoipdatabase($type, $flags, $msg, $numlookups)
34
+ {
35
+ $gi = geoip_open($this->dbfilename[$type], $flags);
36
+ if ($gi == null) {
37
+ print "error: " . $this->dbfilename[$type] . " does not exist\n";
38
+ return;
39
+ }
40
+ $startTime = microtime(true);
41
+ for ($i2 = 0; $i2 < $numlookups; $i2++) {
42
+ switch ($type) {
43
+ case GEOIP_COUNTRY_DATABASE:
44
+ geoip_country_code_by_addr($gi, $this->randomipaddress());
45
+ break;
46
+ case GEOIP_REGION_DATABASE:
47
+ geoip_region_by_addr($gi, $this->randomipaddress());
48
+ break;
49
+ case GEOIP_CITY_DATABASE:
50
+ GeoIP_record_by_addr($gi, $this->randomipaddress());
51
+ break;
52
+ }
53
+ }
54
+ $duration = microtime(true) - $startTime;
55
+ print $msg . "\n";
56
+ print $numlookups . " lookups made in " . $duration . " seconds \n";
57
+ geoip_close($gi);
58
+ }
59
+ }
60
+
61
+
62
+ $mainapp = new mainappc();
63
+
64
+
65
+ $mainapp->testgeoipdatabase(GEOIP_COUNTRY_DATABASE, GEOIP_STANDARD, "Geoip Country ", 10000);
66
+ $mainapp->testgeoipdatabase(GEOIP_COUNTRY_DATABASE, GEOIP_MEMORY_CACHE, "Geoip Country with memory cache", 10000);
67
+ $mainapp->testgeoipdatabase(GEOIP_REGION_DATABASE, GEOIP_STANDARD, "Geoip Region ", 10000);
68
+ $mainapp->testgeoipdatabase(GEOIP_REGION_DATABASE, GEOIP_MEMORY_CACHE, "Geoip Region with memory cache", 10000);
69
+ $mainapp->testgeoipdatabase(GEOIP_CITY_DATABASE, GEOIP_STANDARD, "Geoip City ", 10000);
70
+ $mainapp->testgeoipdatabase(GEOIP_CITY_DATABASE, GEOIP_MEMORY_CACHE, "Geoip City with memory cache", 10000);
geoip/examples/city-v6.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ // This code demonstrates how to lookup the country, region, city,
5
+ // postal code, latitude, and longitude by IP Address.
6
+ // It is designed to work with GeoIP/GeoLite City
7
+
8
+ // Note that you must download the New Format of GeoIP City (GEO-133).
9
+ // The old format (GEO-132) will not work.
10
+
11
+ include("../src/geoipcity.inc");
12
+ include("../src/geoipregionvars.php");
13
+
14
+ // uncomment for Shared Memory support
15
+ // geoip_load_shared_mem("/usr/local/share/GeoIP/GeoIPCity.dat");
16
+ // $gi = geoip_open("/usr/local/share/GeoIP/GeoIPCity.dat",GEOIP_SHARED_MEMORY);
17
+
18
+ $gi = geoip_open("/usr/local/share/GeoIP/GeoLiteCityv6.dat", GEOIP_STANDARD);
19
+
20
+ $record = geoip_record_by_addr_v6($gi, "::24.24.24.24");
21
+ print $record->country_code . " " . $record->country_code3 . " " . $record->country_name . "\n";
22
+ print $record->region . " " . $GEOIP_REGION_NAME[$record->country_code][$record->region] . "\n";
23
+ print $record->city . "\n";
24
+ print $record->postal_code . "\n";
25
+ print $record->latitude . "\n";
26
+ print $record->longitude . "\n";
27
+ print $record->metro_code . "\n";
28
+ print $record->area_code . "\n";
29
+ print $record->continent_code . "\n";
30
+
31
+ geoip_close($gi);
32
+
33
+ ?>
geoip/examples/city.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ // This code demonstrates how to lookup the country, region, city,
5
+ // postal code, latitude, and longitude by IP Address.
6
+ // It is designed to work with GeoIP/GeoLite City
7
+
8
+ // Note that you must download the New Format of GeoIP City (GEO-133).
9
+ // The old format (GEO-132) will not work.
10
+
11
+ include("../src/geoipcity.inc");
12
+ include("../src/geoipregionvars.php");
13
+
14
+ // uncomment for Shared Memory support
15
+ // geoip_load_shared_mem("/usr/local/share/GeoIP/GeoIPCity.dat");
16
+ // $gi = geoip_open("/usr/local/share/GeoIP/GeoIPCity.dat",GEOIP_SHARED_MEMORY);
17
+
18
+ $gi = geoip_open("/usr/local/share/GeoIP/GeoIPCity.dat", GEOIP_STANDARD);
19
+
20
+ $record = geoip_record_by_addr($gi, "24.24.24.24");
21
+ print $record->country_code . " " . $record->country_code3 . " " . $record->country_name . "\n";
22
+ print $record->region . " " . $GEOIP_REGION_NAME[$record->country_code][$record->region] . "\n";
23
+ print $record->city . "\n";
24
+ print $record->postal_code . "\n";
25
+ print $record->latitude . "\n";
26
+ print $record->longitude . "\n";
27
+ print $record->metro_code . "\n";
28
+ print $record->area_code . "\n";
29
+ print $record->continent_code . "\n";
30
+
31
+ geoip_close($gi);
32
+
33
+ ?>
geoip/examples/country-v6.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ // This code demonstrates how to lookup the country by IP Address
5
+
6
+ include("../src/geoip.inc");
7
+
8
+ // Uncomment if querying against GeoIP/Lite City.
9
+ // include("geoipcity.inc");
10
+
11
+ $gi = geoip_open("/usr/local/share/GeoIP/GeoIPv6.dat", GEOIP_STANDARD);
12
+
13
+ echo geoip_country_code_by_addr_v6($gi, "::24.24.24.24") . "\t" .
14
+ geoip_country_name_by_addr_v6($gi, "::24.24.24.24") . "\n";
15
+ echo geoip_country_code_by_addr_v6($gi, "::80.24.24.24") . "\t" .
16
+ geoip_country_name_by_addr_v6($gi, "::80.24.24.24") . "\n";
17
+
18
+ echo geoip_country_code_by_addr_v6($gi, "2001:4860:0:1001::68") . "\t" .
19
+ geoip_country_name_by_addr_v6($gi, "2001:4860:0:1001::68") . "\n";
20
+
21
+ echo geoip_country_code_by_addr_v6($gi, "2001:67c:26c::") . "\t" .
22
+ geoip_country_name_by_addr_v6($gi, "2001:67c:26c::") . "\n";
23
+
24
+ echo geoip_country_code_by_addr_v6($gi, "2001:67c:3a0:ffff:ffff:ffff:ffff:ffff") . "\t" .
25
+ geoip_country_name_by_addr_v6($gi, "2001:67c:3a0:ffff:ffff:ffff:ffff:ffff") . "\n";
26
+
27
+ echo ahc_geoip_country_code_by_name_v6($gi, "ipv6.google.com") . "\t" .
28
+ geoip_country_name_by_name_v6($gi, "ipv6.google.com") . "\n";
29
+
30
+ geoip_close($gi);
31
+
32
+ ?>
geoip/examples/country.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ // This code demonstrates how to lookup the country by IP Address
5
+
6
+ include("../src/geoip.inc");
7
+
8
+ // Uncomment if querying against GeoIP/Lite City.
9
+ // include("geoipcity.inc");
10
+
11
+ $gi = geoip_open("/usr/local/share/GeoIP/GeoIP.dat", GEOIP_STANDARD);
12
+
13
+ echo geoip_country_code_by_addr($gi, "24.24.24.24") . "\t" .
14
+ geoip_country_name_by_addr($gi, "24.24.24.24") . "\n";
15
+ echo geoip_country_code_by_addr($gi, "80.24.24.24") . "\t" .
16
+ geoip_country_name_by_addr($gi, "80.24.24.24") . "\n";
17
+
18
+ geoip_close($gi);
19
+
20
+ ?>
geoip/examples/domain.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ // This code demonstrates how to lookup the country and region by IP Address
5
+ // It is designed to work with GeoIP Organization or GeoIP ISP available from MaxMind
6
+
7
+ include("../src/geoip.inc");
8
+
9
+ $gi = geoip_open("/usr/local/share/GeoIP/GeoIPDomain.dat", GEOIP_STANDARD);
10
+
11
+ $domain = geoip_org_by_addr($gi, "80.24.24.24");
12
+ print "80.24.24.24 belongs to " . $domain . "\n";
13
+
14
+ geoip_close($gi);
15
+
16
+ ?>
geoip/examples/netspeed.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ include("../src/geoip.inc");
5
+
6
+ $gi = geoip_open("/usr/local/share/GeoIP/GeoIPNetSpeed.dat", GEOIP_STANDARD);
7
+
8
+ $netspeed = geoip_country_id_by_addr($gi, "24.24.24.24");
9
+
10
+ //print $n . "\n";
11
+ if ($netspeed == GEOIP_UNKNOWN_SPEED) {
12
+ print "Unknown\n";
13
+ } else {
14
+ if ($netspeed == GEOIP_DIALUP_SPEED) {
15
+ print "Dailup\n";
16
+ } else {
17
+ if ($netspeed == GEOIP_CABLEDSL_SPEED) {
18
+ print "Cable/DSL\n";
19
+ } else {
20
+ if ($netspeed == GEOIP_CORPORATE_SPEED) {
21
+ print "Corporate\n";
22
+ }
23
+ }
24
+ }
25
+ }
26
+
27
+ geoip_close($gi);
28
+
29
+ ?>
geoip/examples/netspeedcell.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ include("../src/geoip.inc");
5
+
6
+ $gi = geoip_open("/usr/local/share/GeoIP/GeoIPNetSpeedCell.dat", GEOIP_STANDARD);
7
+
8
+ $netspeed = geoip_name_by_addr($gi, "24.24.24.24");
9
+
10
+ print $netspeed . "\n";
11
+
12
+ geoip_close($gi);
13
+
14
+ ?>
geoip/examples/org.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ // This code demonstrates how to lookup the country and region by IP Address
5
+ // It is designed to work with GeoIP Organization or GeoIP ISP available from MaxMind
6
+
7
+ include("../src/geoip.inc");
8
+
9
+ $giorg = geoip_open("/usr/local/share/GeoIP/GeoIPOrg.dat", GEOIP_STANDARD);
10
+
11
+ $org = geoip_org_by_addr($giorg, "80.24.24.24");
12
+ print "80.24.24.24 belongs to " . $org . "\n";
13
+
14
+ $giisp = geoip_open("/usr/local/share/GeoIP/GeoIPISP.dat", GEOIP_STANDARD);
15
+
16
+ $isp = geoip_org_by_addr($giisp, "80.24.24.24");
17
+ print "80.24.24.24 has isp " . $isp . "\n";
18
+
19
+ geoip_close($giorg);
20
+ geoip_close($giisp);
21
+
22
+ ?>
geoip/examples/region.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+
4
+ // This code demonstrates how to lookup the country and region by IP Address
5
+ // It is designed to work with GeoIP Region available from MaxMind
6
+
7
+ include("../src/geoip.inc");
8
+ include("../src/geoipregionvars.php");
9
+
10
+ $gi = geoip_open("/usr/local/share/GeoIP/GeoIPRegion.dat", GEOIP_STANDARD);
11
+
12
+ list ($countrycode, $region) = geoip_region_by_addr($gi, "24.24.24.24");
13
+ print $countrycode . " " . $region . " " . $GEOIP_REGION_NAME[$countrycode][$region] . "\n";
14
+ list ($countrycode, $region) = geoip_region_by_addr($gi, "80.24.24.24");
15
+ print $countrycode . " " . $region . " " . $GEOIP_REGION_NAME[$countrycode][$region] . "\n";
16
+ list ($countrycode, $region) = geoip_region_by_addr($gi, "199.243.137.184");
17
+ print $countrycode . " " . $region . " " . $GEOIP_REGION_NAME[$countrycode][$region] . "\n";
18
+ geoip_close($gi);
19
+
20
+ ?>
geoip/phpunit.xml.dist ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <phpunit bootstrap="./tests/bootstrap.php" colors="true">
4
+ <testsuites>
5
+ <testsuite name="GeoIP Test Suite">
6
+ <directory suffix="Test.php">./tests</directory>
7
+ </testsuite>
8
+ </testsuites>
9
+
10
+ <filter>
11
+ <whitelist>
12
+ <directory suffix=".inc">./src</directory>
13
+ <directory suffix=".php">./src</directory>
14
+ </whitelist>
15
+ <blacklist>
16
+ <directory>./build</directory>
17
+ <directory>./composer</directory>
18
+ <directory>./tests</directory>
19
+ <directory>./travis</directory>
20
+ <directory>./vendor</directory>
21
+ </blacklist>
22
+ </filter>
23
+
24
+ <logging>
25
+ <log type="coverage-clover" target="build/logs/clover.xml"/>
26
+ </logging>
27
+
28
+ </phpunit>
geoip/src/geoip.inc ADDED
@@ -0,0 +1,767 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
4
+ /* geoip.inc
5
+ *
6
+ * Copyright (C) 2007 MaxMind LLC
7
+ *
8
+ * This library is free software; you can redistribute it and/or
9
+ * modify it under the terms of the GNU Lesser General Public
10
+ * License as published by the Free Software Foundation; either
11
+ * version 2.1 of the License, or (at your option) any later version.
12
+ *
13
+ * This library is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
+ * Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public
19
+ * License along with this library; if not, write to the Free Software
20
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
+ */
22
+ if(! class_exists('ahcGeoIP')){
23
+ define("GEOIP_COUNTRY_BEGIN", 16776960);
24
+ define("GEOIP_STATE_BEGIN_REV0", 16700000);
25
+ define("GEOIP_STATE_BEGIN_REV1", 16000000);
26
+ define("GEOIP_STANDARD", 0);
27
+ define("GEOIP_MEMORY_CACHE", 1);
28
+ define("GEOIP_SHARED_MEMORY", 2);
29
+ define("STRUCTURE_INFO_MAX_SIZE", 20);
30
+ define("DATABASE_INFO_MAX_SIZE", 100);
31
+ define("GEOIP_COUNTRY_EDITION", 106);
32
+ define("GEOIP_PROXY_EDITION", 8);
33
+ define("GEOIP_ASNUM_EDITION", 9);
34
+ define("GEOIP_NETSPEED_EDITION", 10);
35
+ define("GEOIP_REGION_EDITION_REV0", 112);
36
+ define("GEOIP_REGION_EDITION_REV1", 3);
37
+ define("GEOIP_CITY_EDITION_REV0", 111);
38
+ define("GEOIP_CITY_EDITION_REV1", 2);
39
+ define("GEOIP_ORG_EDITION", 110);
40
+ define("GEOIP_ISP_EDITION", 4);
41
+ define("SEGMENT_RECORD_LENGTH", 3);
42
+ define("STANDARD_RECORD_LENGTH", 3);
43
+ define("ORG_RECORD_LENGTH", 4);
44
+ define("MAX_RECORD_LENGTH", 4);
45
+ define("MAX_ORG_RECORD_LENGTH", 300);
46
+ define("GEOIP_SHM_KEY", 0x4f415401);
47
+ define("US_OFFSET", 1);
48
+ define("CANADA_OFFSET", 677);
49
+ define("WORLD_OFFSET", 1353);
50
+ define("FIPS_RANGE", 360);
51
+ define("GEOIP_UNKNOWN_SPEED", 0);
52
+ define("GEOIP_DIALUP_SPEED", 1);
53
+ define("GEOIP_CABLEDSL_SPEED", 2);
54
+ define("GEOIP_CORPORATE_SPEED", 3);
55
+ define("GEOIP_DOMAIN_EDITION", 11);
56
+ define("GEOIP_COUNTRY_EDITION_V6", 12);
57
+ define("GEOIP_LOCATIONA_EDITION", 13);
58
+ define("GEOIP_ACCURACYRADIUS_EDITION", 14);
59
+ define("GEOIP_CITYCOMBINED_EDITION", 15);
60
+ define("GEOIP_CITY_EDITION_REV1_V6", 30);
61
+ define("GEOIP_CITY_EDITION_REV0_V6",31);
62
+ define("GEOIP_NETSPEED_EDITION_REV1",32);
63
+ define("GEOIP_NETSPEED_EDITION_REV1_V6",33);
64
+ define("GEOIP_USERTYPE_EDITION",28);
65
+ define("GEOIP_USERTYPE_EDITION_V6",29);
66
+ define("GEOIP_ASNUM_EDITION_V6",21);
67
+ define("GEOIP_ISP_EDITION_V6",22);
68
+ define("GEOIP_ORG_EDITION_V6",23);
69
+ define("GEOIP_DOMAIN_EDITION_V6",24);
70
+
71
+ define("CITYCOMBINED_FIXED_RECORD", 7 );
72
+
73
+ class ahcGeoIP {
74
+ var $flags;
75
+ var $filehandle;
76
+ var $memory_buffer;
77
+ var $databaseType;
78
+ var $databaseSegments;
79
+ var $record_length;
80
+ var $shmid;
81
+ var $GEOIP_COUNTRY_CODE_TO_NUMBER = array(
82
+ "" => 0, "AP" => 1, "EU" => 2, "AD" => 3, "AE" => 4, "AF" => 5,
83
+ "AG" => 6, "AI" => 7, "AL" => 8, "AM" => 9, "CW" => 10, "AO" => 11,
84
+ "AQ" => 12, "AR" => 13, "AS" => 14, "AT" => 15, "AU" => 16, "AW" => 17,
85
+ "AZ" => 18, "BA" => 19, "BB" => 20, "BD" => 21, "BE" => 22, "BF" => 23,
86
+ "BG" => 24, "BH" => 25, "BI" => 26, "BJ" => 27, "BM" => 28, "BN" => 29,
87
+ "BO" => 30, "BR" => 31, "BS" => 32, "BT" => 33, "BV" => 34, "BW" => 35,
88
+ "BY" => 36, "BZ" => 37, "CA" => 38, "CC" => 39, "CD" => 40, "CF" => 41,
89
+ "CG" => 42, "CH" => 43, "CI" => 44, "CK" => 45, "CL" => 46, "CM" => 47,
90
+ "CN" => 48, "CO" => 49, "CR" => 50, "CU" => 51, "CV" => 52, "CX" => 53,
91
+ "CY" => 54, "CZ" => 55, "DE" => 56, "DJ" => 57, "DK" => 58, "DM" => 59,
92
+ "DO" => 60, "DZ" => 61, "EC" => 62, "EE" => 63, "EG" => 64, "EH" => 65,
93
+ "ER" => 66, "ES" => 67, "ET" => 68, "FI" => 69, "FJ" => 70, "FK" => 71,
94
+ "FM" => 72, "FO" => 73, "FR" => 74, "SX" => 75, "GA" => 76, "GB" => 77,
95
+ "GD" => 78, "GE" => 79, "GF" => 80, "GH" => 81, "GI" => 82, "GL" => 83,
96
+ "GM" => 84, "GN" => 85, "GP" => 86, "GQ" => 87, "GR" => 88, "GS" => 89,
97
+ "GT" => 90, "GU" => 91, "GW" => 92, "GY" => 93, "HK" => 94, "HM" => 95,
98
+ "HN" => 96, "HR" => 97, "HT" => 98, "HU" => 99, "ID" => 100, "IE" => 101,
99
+ "IL" => 102, "IN" => 103, "IO" => 104, "IQ" => 105, "IR" => 106, "IS" => 107,
100
+ "IT" => 108, "JM" => 109, "JO" => 110, "JP" => 111, "KE" => 112, "KG" => 113,
101
+ "KH" => 114, "KI" => 115, "KM" => 116, "KN" => 117, "KP" => 118, "KR" => 119,
102
+ "KW" => 120, "KY" => 121, "KZ" => 122, "LA" => 123, "LB" => 124, "LC" => 125,
103
+ "LI" => 126, "LK" => 127, "LR" => 128, "LS" => 129, "LT" => 130, "LU" => 131,
104
+ "LV" => 132, "LY" => 133, "MA" => 134, "MC" => 135, "MD" => 136, "MG" => 137,
105
+ "MH" => 138, "MK" => 139, "ML" => 140, "MM" => 141, "MN" => 142, "MO" => 143,
106
+ "MP" => 144, "MQ" => 145, "MR" => 146, "MS" => 147, "MT" => 148, "MU" => 149,
107
+ "MV" => 150, "MW" => 151, "MX" => 152, "MY" => 153, "MZ" => 154, "NA" => 155,
108
+ "NC" => 156, "NE" => 157, "NF" => 158, "NG" => 159, "NI" => 160, "NL" => 161,
109
+ "NO" => 162, "NP" => 163, "NR" => 164, "NU" => 165, "NZ" => 166, "OM" => 167,
110
+ "PA" => 168, "PE" => 169, "PF" => 170, "PG" => 171, "PH" => 172, "PK" => 173,
111
+ "PL" => 174, "PM" => 175, "PN" => 176, "PR" => 177, "PS" => 178, "PT" => 179,
112
+ "PW" => 180, "PY" => 181, "QA" => 182, "RE" => 183, "RO" => 184, "RU" => 185,
113
+ "RW" => 186, "SA" => 187, "SB" => 188, "SC" => 189, "SD" => 190, "SE" => 191,
114
+ "SG" => 192, "SH" => 193, "SI" => 194, "SJ" => 195, "SK" => 196, "SL" => 197,
115
+ "SM" => 198, "SN" => 199, "SO" => 200, "SR" => 201, "ST" => 202, "SV" => 203,
116
+ "SY" => 204, "SZ" => 205, "TC" => 206, "TD" => 207, "TF" => 208, "TG" => 209,
117
+ "TH" => 210, "TJ" => 211, "TK" => 212, "TM" => 213, "TN" => 214, "TO" => 215,
118
+ "TL" => 216, "TR" => 217, "TT" => 218, "TV" => 219, "TW" => 220, "TZ" => 221,
119
+ "UA" => 222, "UG" => 223, "UM" => 224, "US" => 225, "UY" => 226, "UZ" => 227,
120
+ "VA" => 228, "VC" => 229, "VE" => 230, "VG" => 231, "VI" => 232, "VN" => 233,
121
+ "VU" => 234, "WF" => 235, "WS" => 236, "YE" => 237, "YT" => 238, "RS" => 239,
122
+ "ZA" => 240, "ZM" => 241, "ME" => 242, "ZW" => 243, "A1" => 244, "A2" => 245,
123
+ "O1" => 246, "AX" => 247, "GG" => 248, "IM" => 249, "JE" => 250, "BL" => 251,
124
+ "MF" => 252, "BQ" => 253,
125
+ );
126
+ var $GEOIP_COUNTRY_CODES = array(
127
+ "","AP","EU","AD","AE","AF","AG","AI","AL","AM","CW",
128
+ "AO","AQ","AR","AS","AT","AU","AW","AZ","BA","BB",
129
+ "BD","BE","BF","BG","BH","BI","BJ","BM","BN","BO",
130
+ "BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD",
131
+ "CF","CG","CH","CI","CK","CL","CM","CN","CO","CR",
132
+ "CU","CV","CX","CY","CZ","DE","DJ","DK","DM","DO",
133
+ "DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ",
134
+ "FK","FM","FO","FR","SX","GA","GB","GD","GE","GF",
135
+ "GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT",
136
+ "GU","GW","GY","HK","HM","HN","HR","HT","HU","ID",
137
+ "IE","IL","IN","IO","IQ","IR","IS","IT","JM","JO",
138
+ "JP","KE","KG","KH","KI","KM","KN","KP","KR","KW",
139
+ "KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT",
140
+ "LU","LV","LY","MA","MC","MD","MG","MH","MK","ML",
141
+ "MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV",
142
+ "MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI",
143
+ "NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF",
144
+ "PG","PH","PK","PL","PM","PN","PR","PS","PT","PW",
145
+ "PY","QA","RE","RO","RU","RW","SA","SB","SC","SD",
146
+ "SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO",
147
+ "SR","ST","SV","SY","SZ","TC","TD","TF","TG","TH",
148
+ "TJ","TK","TM","TN","TO","TL","TR","TT","TV","TW",
149
+ "TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE",
150
+ "VG","VI","VN","VU","WF","WS","YE","YT","RS","ZA",
151
+ "ZM","ME","ZW","A1","A2","O1","AX","GG","IM","JE",
152
+ "BL","MF", "BQ");
153
+ var $GEOIP_COUNTRY_CODES3 = array(
154
+ "","AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","CUW",
155
+ "AGO","ATA","ARG","ASM","AUT","AUS","ABW","AZE","BIH","BRB",
156
+ "BGD","BEL","BFA","BGR","BHR","BDI","BEN","BMU","BRN","BOL",
157
+ "BRA","BHS","BTN","BVT","BWA","BLR","BLZ","CAN","CCK","COD",
158
+ "CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI",
159
+ "CUB","CPV","CXR","CYP","CZE","DEU","DJI","DNK","DMA","DOM",
160
+ "DZA","ECU","EST","EGY","ESH","ERI","ESP","ETH","FIN","FJI",
161
+ "FLK","FSM","FRO","FRA","SXM","GAB","GBR","GRD","GEO","GUF",
162
+ "GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","SGS","GTM",
163
+ "GUM","GNB","GUY","HKG","HMD","HND","HRV","HTI","HUN","IDN",
164
+ "IRL","ISR","IND","IOT","IRQ","IRN","ISL","ITA","JAM","JOR",
165
+ "JPN","KEN","KGZ","KHM","KIR","COM","KNA","PRK","KOR","KWT",
166
+ "CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU",
167
+ "LUX","LVA","LBY","MAR","MCO","MDA","MDG","MHL","MKD","MLI",
168
+ "MMR","MNG","MAC","MNP","MTQ","MRT","MSR","MLT","MUS","MDV",
169
+ "MWI","MEX","MYS","MOZ","NAM","NCL","NER","NFK","NGA","NIC",
170
+ "NLD","NOR","NPL","NRU","NIU","NZL","OMN","PAN","PER","PYF",
171
+ "PNG","PHL","PAK","POL","SPM","PCN","PRI","PSE","PRT","PLW",
172
+ "PRY","QAT","REU","ROU","RUS","RWA","SAU","SLB","SYC","SDN",
173
+ "SWE","SGP","SHN","SVN","SJM","SVK","SLE","SMR","SEN","SOM",
174
+ "SUR","STP","SLV","SYR","SWZ","TCA","TCD","ATF","TGO","THA",
175
+ "TJK","TKL","TKM","TUN","TON","TLS","TUR","TTO","TUV","TWN",
176
+ "TZA","UKR","UGA","UMI","USA","URY","UZB","VAT","VCT","VEN",
177
+ "VGB","VIR","VNM","VUT","WLF","WSM","YEM","MYT","SRB","ZAF",
178
+ "ZMB","MNE","ZWE","A1","A2","O1","ALA","GGY","IMN","JEY",
179
+ "BLM","MAF", "BES"
180
+ );
181
+ var $GEOIP_COUNTRY_NAMES = array(
182
+ "","Asia/Pacific Region","Europe","Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Curacao",
183
+ "Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina","Barbados",
184
+ "Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain","Burundi","Benin","Bermuda","Brunei Darussalam","Bolivia",
185
+ "Brazil","Bahamas","Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada","Cocos (Keeling) Islands","Congo, The Democratic Republic of the",
186
+ "Central African Republic","Congo","Switzerland","Cote D'Ivoire","Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica",
187
+ "Cuba","Cape Verde","Christmas Island","Cyprus","Czech Republic","Germany","Djibouti","Denmark","Dominica","Dominican Republic",
188
+ "Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland","Fiji",
189
+ "Falkland Islands (Malvinas)","Micronesia, Federated States of","Faroe Islands","France","Sint Maarten (Dutch part)","Gabon","United Kingdom","Grenada","Georgia","French Guiana",
190
+ "Ghana","Gibraltar","Greenland","Gambia","Guinea","Guadeloupe","Equatorial Guinea","Greece","South Georgia and the South Sandwich Islands","Guatemala",
191
+ "Guam","Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands","Honduras","Croatia","Haiti","Hungary","Indonesia",
192
+ "Ireland","Israel","India","British Indian Ocean Territory","Iraq","Iran, Islamic Republic of","Iceland","Italy","Jamaica","Jordan",
193
+ "Japan","Kenya","Kyrgyzstan","Cambodia","Kiribati","Comoros","Saint Kitts and Nevis","Korea, Democratic People's Republic of","Korea, Republic of","Kuwait",
194
+ "Cayman Islands","Kazakhstan","Lao People's Democratic Republic","Lebanon","Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania",
195
+ "Luxembourg","Latvia","Libya","Morocco","Monaco","Moldova, Republic of","Madagascar","Marshall Islands","Macedonia","Mali",
196
+ "Myanmar","Mongolia","Macau","Northern Mariana Islands","Martinique","Mauritania","Montserrat","Malta","Mauritius","Maldives",
197
+ "Malawi","Mexico","Malaysia","Mozambique","Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua",
198
+ "Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama","Peru","French Polynesia",
199
+ "Papua New Guinea","Philippines","Pakistan","Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","Palestinian Territory","Portugal","Palau",
200
+ "Paraguay","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saudi Arabia","Solomon Islands","Seychelles","Sudan",
201
+ "Sweden","Singapore","Saint Helena","Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino","Senegal","Somalia","Suriname",
202
+ "Sao Tome and Principe","El Salvador","Syrian Arab Republic","Swaziland","Turks and Caicos Islands","Chad","French Southern Territories","Togo","Thailand",
203
+ "Tajikistan","Tokelau","Turkmenistan","Tunisia","Tonga","Timor-Leste","Turkey","Trinidad and Tobago","Tuvalu","Taiwan",
204
+ "Tanzania, United Republic of","Ukraine","Uganda","United States Minor Outlying Islands","United States","Uruguay","Uzbekistan","Holy See (Vatican City State)","Saint Vincent and the Grenadines","Venezuela",
205
+ "Virgin Islands, British","Virgin Islands, U.S.","Vietnam","Vanuatu","Wallis and Futuna","Samoa","Yemen","Mayotte","Serbia","South Africa",
206
+ "Zambia","Montenegro","Zimbabwe","Anonymous Proxy","Satellite Provider","Other","Aland Islands","Guernsey","Isle of Man","Jersey",
207
+ "Saint Barthelemy","Saint Martin", "Bonaire, Saint Eustatius and Saba"
208
+ );
209
+
210
+ var $GEOIP_CONTINENT_CODES = array(
211
+ "--", "AS","EU","EU","AS","AS","NA","NA","EU","AS","NA",
212
+ "AF","AN","SA","OC","EU","OC","NA","AS","EU","NA",
213
+ "AS","EU","AF","EU","AS","AF","AF","NA","AS","SA",
214
+ "SA","NA","AS","AN","AF","EU","NA","NA","AS","AF",
215
+ "AF","AF","EU","AF","OC","SA","AF","AS","SA","NA",
216
+ "NA","AF","AS","AS","EU","EU","AF","EU","NA","NA",
217
+ "AF","SA","EU","AF","AF","AF","EU","AF","EU","OC",
218
+ "SA","OC","EU","EU","NA","AF","EU","NA","AS","SA",
219
+ "AF","EU","NA","AF","AF","NA","AF","EU","AN","NA",
220
+ "OC","AF","SA","AS","AN","NA","EU","NA","EU","AS",
221
+ "EU","AS","AS","AS","AS","AS","EU","EU","NA","AS",
222
+ "AS","AF","AS","AS","OC","AF","NA","AS","AS","AS",
223
+ "NA","AS","AS","AS","NA","EU","AS","AF","AF","EU",
224
+ "EU","EU","AF","AF","EU","EU","AF","OC","EU","AF",
225
+ "AS","AS","AS","OC","NA","AF","NA","EU","AF","AS",
226
+ "AF","NA","AS","AF","AF","OC","AF","OC","AF","NA",
227
+ "EU","EU","AS","OC","OC","OC","AS","NA","SA","OC",
228
+ "OC","AS","AS","EU","NA","OC","NA","AS","EU","OC",
229
+ "SA","AS","AF","EU","EU","AF","AS","OC","AF","AF",
230
+ "EU","AS","AF","EU","EU","EU","AF","EU","AF","AF",
231
+ "SA","AF","NA","AS","AF","NA","AF","AN","AF","AS",
232
+ "AS","OC","AS","AF","OC","AS","EU","NA","OC","AS",
233
+ "AF","EU","AF","OC","NA","SA","AS","EU","NA","SA",
234
+ "NA","NA","AS","OC","OC","OC","AS","AF","EU","AF",
235
+ "AF","EU","AF","--","--","--","EU","EU","EU","EU",
236
+ "NA","NA","NA"
237
+ );
238
+
239
+ }
240
+ if(! function_exists('geoip_load_shared_mem')){
241
+ function geoip_load_shared_mem ($file) {
242
+
243
+ $fp = fopen($file, "rb");
244
+ if (!$fp) {
245
+ print "error opening $file: $php_errormsg\n";
246
+ exit;
247
+ }
248
+ $s_array = fstat($fp);
249
+ $size = $s_array['size'];
250
+ if ($shmid = @shmop_open (GEOIP_SHM_KEY, "w", 0, 0)) {
251
+ shmop_delete ($shmid);
252
+ shmop_close ($shmid);
253
+ }
254
+ $shmid = shmop_open (GEOIP_SHM_KEY, "c", 0644, $size);
255
+ shmop_write ($shmid, fread($fp, $size), 0);
256
+ shmop_close ($shmid);
257
+ }
258
+ }
259
+
260
+ if(! function_exists('_setup_segments')){
261
+ function _setup_segments($gi){
262
+ $gi->databaseType = GEOIP_COUNTRY_EDITION;
263
+ $gi->record_length = STANDARD_RECORD_LENGTH;
264
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
265
+ $offset = @shmop_size ($gi->shmid) - 3;
266
+ for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
267
+ $delim = @shmop_read ($gi->shmid, $offset, 3);
268
+ $offset += 3;
269
+ if ($delim == (chr(255).chr(255).chr(255))) {
270
+ $gi->databaseType = ord(@shmop_read ($gi->shmid, $offset, 1));
271
+ $offset++;
272
+
273
+ if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
274
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
275
+ } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){
276
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
277
+ } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)||
278
+ ($gi->databaseType == GEOIP_CITY_EDITION_REV1)
279
+ || ($gi->databaseType == GEOIP_ORG_EDITION)
280
+ || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
281
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION)
282
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
283
+ || ($gi->databaseType == GEOIP_ISP_EDITION)
284
+ || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
285
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION)
286
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION_V6)
287
+ || ($gi->databaseType == GEOIP_LOCATIONA_EDITION)
288
+ || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION)
289
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
290
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
291
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1)
292
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1_V6)
293
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION)
294
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION_V6)){
295
+ $gi->databaseSegments = 0;
296
+ $buf = @shmop_read ($gi->shmid, $offset, SEGMENT_RECORD_LENGTH);
297
+ for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){
298
+ $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
299
+ }
300
+ if (($gi->databaseType == GEOIP_ORG_EDITION)
301
+ || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
302
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION)
303
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
304
+ || ($gi->databaseType == GEOIP_ISP_EDITION)
305
+ || ($gi->databaseType == GEOIP_ISP_EDITION_V6)) {
306
+ $gi->record_length = ORG_RECORD_LENGTH;
307
+ }
308
+ }
309
+ break;
310
+ } else {
311
+ $offset -= 4;
312
+ }
313
+ }
314
+ if (($gi->databaseType == GEOIP_COUNTRY_EDITION)||
315
+ ($gi->databaseType == GEOIP_COUNTRY_EDITION_V6)||
316
+ ($gi->databaseType == GEOIP_PROXY_EDITION)||
317
+ ($gi->databaseType == GEOIP_NETSPEED_EDITION)){
318
+ $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
319
+ }
320
+ } else {
321
+ $filepos = ftell($gi->filehandle);
322
+ fseek($gi->filehandle, -3, SEEK_END);
323
+ for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
324
+ $delim = fread($gi->filehandle,3);
325
+ if ($delim == (chr(255).chr(255).chr(255))){
326
+ $gi->databaseType = ord(fread($gi->filehandle,1));
327
+ if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
328
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
329
+ }
330
+ else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){
331
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
332
+ } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)
333
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV1)
334
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
335
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
336
+ || ($gi->databaseType == GEOIP_ORG_EDITION)
337
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION)
338
+ || ($gi->databaseType == GEOIP_ISP_EDITION)
339
+ || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
340
+ || ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
341
+ || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
342
+ || ($gi->databaseType == GEOIP_LOCATIONA_EDITION)
343
+ || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION)
344
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
345
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
346
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1)
347
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1_V6)
348
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION)
349
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION_V6)
350
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION)
351
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION_V6)){
352
+ $gi->databaseSegments = 0;
353
+ $buf = fread($gi->filehandle,SEGMENT_RECORD_LENGTH);
354
+ for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){
355
+ $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
356
+ }
357
+ if ( ( $gi->databaseType == GEOIP_ORG_EDITION )
358
+ || ( $gi->databaseType == GEOIP_DOMAIN_EDITION )
359
+ || ( $gi->databaseType == GEOIP_ISP_EDITION )
360
+ || ( $gi->databaseType == GEOIP_ORG_EDITION_V6 )
361
+ || ( $gi->databaseType == GEOIP_DOMAIN_EDITION_V6 )
362
+ || ( $gi->databaseType == GEOIP_ISP_EDITION_V6 )) {
363
+ $gi->record_length = ORG_RECORD_LENGTH;
364
+ }
365
+ }
366
+ break;
367
+ } else {
368
+ fseek($gi->filehandle, -4, SEEK_CUR);
369
+ }
370
+ }
371
+ if (($gi->databaseType == GEOIP_COUNTRY_EDITION)||
372
+ ($gi->databaseType == GEOIP_COUNTRY_EDITION_V6)||
373
+ ($gi->databaseType == GEOIP_PROXY_EDITION)||
374
+ ($gi->databaseType == GEOIP_NETSPEED_EDITION)){
375
+ $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
376
+ }
377
+ fseek($gi->filehandle,$filepos,SEEK_SET);
378
+
379
+ }
380
+ return $gi;
381
+ }
382
+ }
383
+
384
+ if(! function_exists('geoip_open')){
385
+ function geoip_open($filename, $flags) {
386
+ $gi = new ahcGeoIP;
387
+ $gi->flags = $flags;
388
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
389
+ $gi->shmid = @shmop_open (GEOIP_SHM_KEY, "a", 0, 0);
390
+ } else {
391
+ $gi->filehandle = fopen($filename,"rb") or die( "Can not open $filename\n" );
392
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
393
+ $s_array = fstat($gi->filehandle);
394
+ $gi->memory_buffer = fread($gi->filehandle, $s_array['size']);
395
+ }
396
+ }
397
+
398
+ $gi = _setup_segments($gi);
399
+ return $gi;
400
+ }
401
+ }
402
+
403
+ if(! function_exists('geoip_close')){
404
+ function geoip_close($gi) {
405
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
406
+ return true;
407
+ }
408
+
409
+ return fclose($gi->filehandle);
410
+ }
411
+ }
412
+
413
+ if(! function_exists('geoip_country_id_by_name_v6')){
414
+ function geoip_country_id_by_name_v6($gi, $name) {
415
+ $rec = dns_get_record($name, DNS_AAAA);
416
+ if ( !$rec ) {
417
+ return false;
418
+ }
419
+ $addr = $rec[0]["ipv6"];
420
+ if (!$addr || $addr == $name) {
421
+ return false;
422
+ }
423
+ return geoip_country_id_by_addr_v6($gi, $addr);
424
+ }
425
+ }
426
+
427
+ if(! function_exists('geoip_country_id_by_name')){
428
+ function geoip_country_id_by_name($gi, $name) {
429
+ $addr = gethostbyname($name);
430
+ if (!$addr || $addr == $name) {
431
+ return false;
432
+ }
433
+ return geoip_country_id_by_addr($gi, $addr);
434
+ }
435
+ }
436
+
437
+ if(! function_exists('geoip_country_id_by_name')){
438
+ function geoip_country_code_by_name_v6($gi, $name) {
439
+ $country_id = geoip_country_id_by_name_v6($gi,$name);
440
+ if ($country_id !== false) {
441
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
442
+ }
443
+ return false;
444
+ }
445
+ }
446
+
447
+ if(! function_exists('geoip_country_code_by_name')){
448
+ function geoip_country_code_by_name($gi, $name) {
449
+ $country_id = geoip_country_id_by_name($gi,$name);
450
+ if ($country_id !== false) {
451
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
452
+ }
453
+ return false;
454
+ }
455
+ }
456
+
457
+ if(! function_exists('geoip_country_name_by_name_v6')){
458
+ function geoip_country_name_by_name_v6($gi, $name) {
459
+ $country_id = geoip_country_id_by_name_v6($gi,$name);
460
+ if ($country_id !== false) {
461
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
462
+ }
463
+ return false;
464
+ }
465
+ }
466
+
467
+ if(! function_exists('geoip_country_name_by_name')){
468
+ function geoip_country_name_by_name($gi, $name) {
469
+ $country_id = geoip_country_id_by_name($gi,$name);
470
+ if ($country_id !== false) {
471
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
472
+ }
473
+ return false;
474
+ }
475
+ }
476
+
477
+ if(! function_exists('geoip_country_id_by_addr_v6')){
478
+ function geoip_country_id_by_addr_v6($gi, $addr) {
479
+ $ipnum = inet_pton($addr);
480
+ return _geoip_seek_country_v6($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
481
+ }
482
+ }
483
+
484
+ if(! function_exists('geoip_country_id_by_addr')){
485
+ function geoip_country_id_by_addr($gi, $addr) {
486
+ $ipnum = ip2long($addr);
487
+ return _geoip_seek_country($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
488
+ }
489
+ }
490
+
491
+ if(! function_exists('geoip_country_code_by_addr_v6')){
492
+ function geoip_country_code_by_addr_v6($gi, $addr) {
493
+ $country_id = geoip_country_id_by_addr_v6($gi,$addr);
494
+ if ($country_id !== false) {
495
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
496
+ }
497
+ return false;
498
+ }
499
+ }
500
+
501
+ if(! function_exists('geoip_country_code_by_addr')){
502
+ function geoip_country_code_by_addr($gi, $addr) {
503
+ if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
504
+ $record = geoip_record_by_addr($gi,$addr);
505
+ if ( $record !== false ) {
506
+ return $record->country_code;
507
+ }
508
+ } else {
509
+ $country_id = geoip_country_id_by_addr($gi,$addr);
510
+ if ($country_id !== false) {
511
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
512
+ }
513
+ }
514
+ return false;
515
+ }
516
+ }
517
+
518
+ if(! function_exists('geoip_country_name_by_addr_v6')){
519
+ function geoip_country_name_by_addr_v6($gi, $addr) {
520
+ $country_id = geoip_country_id_by_addr_v6($gi,$addr);
521
+ if ($country_id !== false) {
522
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
523
+ }
524
+ return false;
525
+ }
526
+ }
527
+
528
+ if(! function_exists('geoip_country_name_by_addr')){
529
+ function geoip_country_name_by_addr($gi, $addr) {
530
+ if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
531
+ $record = geoip_record_by_addr($gi,$addr);
532
+ return $record->country_name;
533
+ } else {
534
+ $country_id = geoip_country_id_by_addr($gi,$addr);
535
+ if ($country_id !== false) {
536
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
537
+ }
538
+ }
539
+ return false;
540
+ }
541
+ }
542
+
543
+ if(! function_exists('_geoip_seek_country_v6')){
544
+ function _geoip_seek_country_v6($gi, $ipnum) {
545
+
546
+ # arrays from unpack start with offset 1
547
+ # yet another php mystery. array_merge work around
548
+ # this broken behaviour
549
+ $v6vec = array_merge(unpack( "C16", $ipnum));
550
+
551
+ $offset = 0;
552
+ for ($depth = 127; $depth >= 0; --$depth) {
553
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
554
+ // workaround php's broken substr, strpos, etc handling with
555
+ // mbstring.func_overload and mbstring.internal_encoding
556
+ $enc = mb_internal_encoding();
557
+ mb_internal_encoding('ISO-8859-1');
558
+
559
+ $buf = substr($gi->memory_buffer,
560
+ 2 * $gi->record_length * $offset,
561
+ 2 * $gi->record_length);
562
+
563
+ mb_internal_encoding($enc);
564
+ } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
565
+ $buf = @shmop_read ($gi->shmid,
566
+ 2 * $gi->record_length * $offset,
567
+ 2 * $gi->record_length );
568
+ } else {
569
+ fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
570
+ or die("fseek failed");
571
+ $buf = fread($gi->filehandle, 2 * $gi->record_length);
572
+ }
573
+ $x = array(0,0);
574
+ for ($i = 0; $i < 2; ++$i) {
575
+ for ($j = 0; $j < $gi->record_length; ++$j) {
576
+ $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
577
+ }
578
+ }
579
+
580
+ $bnum = 127 - $depth;
581
+ $idx = $bnum >> 3;
582
+ $b_mask = 1 << ( $bnum & 7 ^ 7 );
583
+ if (($v6vec[$idx] & $b_mask) > 0) {
584
+ if ($x[1] >= $gi->databaseSegments) {
585
+ return $x[1];
586
+ }
587
+ $offset = $x[1];
588
+ } else {
589
+ if ($x[0] >= $gi->databaseSegments) {
590
+ return $x[0];
591
+ }
592
+ $offset = $x[0];
593
+ }
594
+ }
595
+ trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
596
+ return false;
597
+ }
598
+ }
599
+
600
+ if(! function_exists('_geoip_seek_country')){
601
+ function _geoip_seek_country($gi, $ipnum) {
602
+ $offset = 0;
603
+ for ($depth = 31; $depth >= 0; --$depth) {
604
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
605
+ // workaround php's broken substr, strpos, etc handling with
606
+ // mbstring.func_overload and mbstring.internal_encoding
607
+ $enc = mb_internal_encoding();
608
+ mb_internal_encoding('ISO-8859-1');
609
+
610
+ $buf = substr($gi->memory_buffer,
611
+ 2 * $gi->record_length * $offset,
612
+ 2 * $gi->record_length);
613
+
614
+ mb_internal_encoding($enc);
615
+ } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
616
+ $buf = @shmop_read ($gi->shmid,
617
+ 2 * $gi->record_length * $offset,
618
+ 2 * $gi->record_length );
619
+ } else {
620
+ fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
621
+ or die("fseek failed");
622
+ $buf = fread($gi->filehandle, 2 * $gi->record_length);
623
+ }
624
+ $x = array(0,0);
625
+ for ($i = 0; $i < 2; ++$i) {
626
+ for ($j = 0; $j < $gi->record_length; ++$j) {
627
+ $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
628
+ }
629
+ }
630
+ if ($ipnum & (1 << $depth)) {
631
+ if ($x[1] >= $gi->databaseSegments) {
632
+ return $x[1];
633
+ }
634
+ $offset = $x[1];
635
+ } else {
636
+ if ($x[0] >= $gi->databaseSegments) {
637
+ return $x[0];
638
+ }
639
+ $offset = $x[0];
640
+ }
641
+ }
642
+ trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
643
+ return false;
644
+ }
645
+ }
646
+
647
+ if(! function_exists('_common_get_org')){
648
+ function _common_get_org($gi, $seek_org){
649
+ $record_pointer = $seek_org + (2 * $gi->record_length - 1) * $gi->databaseSegments;
650
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
651
+ $org_buf = @shmop_read ($gi->shmid, $record_pointer, MAX_ORG_RECORD_LENGTH);
652
+ } else {
653
+ fseek($gi->filehandle, $record_pointer, SEEK_SET);
654
+ $org_buf = fread($gi->filehandle,MAX_ORG_RECORD_LENGTH);
655
+
656
+ }
657
+ // workaround php's broken substr, strpos, etc handling with
658
+ // mbstring.func_overload and mbstring.internal_encoding
659
+ $enc = mb_internal_encoding();
660
+ mb_internal_encoding('ISO-8859-1');
661
+ $org_buf = substr($org_buf, 0, strpos($org_buf, "\0"));
662
+ mb_internal_encoding($enc);
663
+ return $org_buf;
664
+ }
665
+ }
666
+
667
+ if(! function_exists('_get_org_v6')){
668
+ function _get_org_v6($gi,$ipnum){
669
+ $seek_org = _geoip_seek_country_v6($gi,$ipnum);
670
+ if ($seek_org == $gi->databaseSegments) {
671
+ return NULL;
672
+ }
673
+ return _common_get_org($gi, $seek_org);
674
+ }
675
+ }
676
+
677
+ if(! function_exists('_get_org')){
678
+ function _get_org($gi,$ipnum){
679
+ $seek_org = _geoip_seek_country($gi,$ipnum);
680
+ if ($seek_org == $gi->databaseSegments) {
681
+ return NULL;
682
+ }
683
+ return _common_get_org($gi, $seek_org);
684
+ }
685
+ }
686
+
687
+ if(! function_exists('geoip_name_by_addr_v6')){
688
+ function geoip_name_by_addr_v6 ($gi,$addr) {
689
+ if ($addr == NULL) {
690
+ return 0;
691
+ }
692
+ $ipnum = inet_pton($addr);
693
+ return _get_org_v6($gi, $ipnum);
694
+ }
695
+ }
696
+
697
+ if(! function_exists('geoip_name_by_addr')){
698
+ function geoip_name_by_addr ($gi,$addr) {
699
+ if ($addr == NULL) {
700
+ return 0;
701
+ }
702
+ $ipnum = ip2long($addr);
703
+ return _get_org($gi, $ipnum);
704
+ }
705
+ }
706
+
707
+ if(! function_exists('geoip_org_by_addr')){
708
+ function geoip_org_by_addr ($gi,$addr) {
709
+ return geoip_name_by_addr($gi, $addr);
710
+ }
711
+ }
712
+
713
+ if(! function_exists('_get_region')){
714
+ function _get_region($gi,$ipnum){
715
+ if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
716
+ $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV0;
717
+ if ($seek_region >= 1000){
718
+ $country_code = "US";
719
+ $region = chr(($seek_region - 1000)/26 + 65) . chr(($seek_region - 1000)%26 + 65);
720
+ } else {
721
+ $country_code = $gi->GEOIP_COUNTRY_CODES[$seek_region];
722
+ $region = "";
723
+ }
724
+ return array ($country_code,$region);
725
+ } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1) {
726
+ $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV1;
727
+ //print $seek_region;
728
+ if ($seek_region < US_OFFSET){
729
+ $country_code = "";
730
+ $region = "";
731
+ } else if ($seek_region < CANADA_OFFSET) {
732
+ $country_code = "US";
733
+ $region = chr(($seek_region - US_OFFSET)/26 + 65) . chr(($seek_region - US_OFFSET)%26 + 65);
734
+ } else if ($seek_region < WORLD_OFFSET) {
735
+ $country_code = "CA";
736
+ $region = chr(($seek_region - CANADA_OFFSET)/26 + 65) . chr(($seek_region - CANADA_OFFSET)%26 + 65);
737
+ } else {
738
+ $country_code = $gi->GEOIP_COUNTRY_CODES[($seek_region - WORLD_OFFSET) / FIPS_RANGE];
739
+ $region = "";
740
+ }
741
+ return array ($country_code,$region);
742
+ }
743
+ }
744
+ }
745
+
746
+ if(! function_exists('geoip_region_by_addr')){
747
+ function geoip_region_by_addr ($gi,$addr) {
748
+ if ($addr == NULL) {
749
+ return 0;
750
+ }
751
+ $ipnum = ip2long($addr);
752
+ return _get_region($gi, $ipnum);
753
+ }
754
+ }
755
+
756
+ if(! function_exists('getdnsattributes')){
757
+ function getdnsattributes ($l,$ip){
758
+ $r = new Net_DNS_Resolver();
759
+ $r->nameservers = array("ws1.maxmind.com");
760
+ $p = $r->search($l."." . $ip .".s.maxmind.com","TXT","IN");
761
+ $str = is_object($p->answer[0])?$p->answer[0]->string():'';
762
+ $str = substr( $str, 1, -1 );
763
+ return $str;
764
+ }
765
+ }
766
+ }
767
+ ?>
geoip/src/geoipcity.inc ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* geoipcity.inc
4
+ *
5
+ * Copyright (C) 2013 MaxMind, Inc.
6
+ *
7
+ * This library is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * This library is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with this library; if not, write to the Free Software
19
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
+ */
21
+
22
+
23
+ define("FULL_RECORD_LENGTH", 50);
24
+
25
+ require_once 'geoip.inc';
26
+ require_once 'geoipregionvars.php';
27
+
28
+ class geoiprecord
29
+ {
30
+ public $country_code;
31
+ public $country_code3;
32
+ public $country_name;
33
+ public $region;
34
+ public $city;
35
+ public $postal_code;
36
+ public $latitude;
37
+ public $longitude;
38
+ public $area_code;
39
+ public $dma_code; # metro and dma code are the same. use metro_code
40
+ public $metro_code;
41
+ public $continent_code;
42
+ }
43
+
44
+ function _get_record_v6($gi, $ipnum)
45
+ {
46
+ $seek_country = _geoip_seek_country_v6($gi, $ipnum);
47
+ if ($seek_country == $gi->databaseSegments) {
48
+ return null;
49
+ }
50
+ return _common_get_record($gi, $seek_country);
51
+ }
52
+
53
+ function _common_get_record($gi, $seek_country)
54
+ {
55
+ // workaround php's broken substr, strpos, etc handling with
56
+ // mbstring.func_overload and mbstring.internal_encoding
57
+ $mbExists = extension_loaded('mbstring');
58
+ if ($mbExists) {
59
+ $enc = mb_internal_encoding();
60
+ mb_internal_encoding('ISO-8859-1');
61
+ }
62
+
63
+ $record_pointer = $seek_country + (2 * $gi->record_length - 1) * $gi->databaseSegments;
64
+
65
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
66
+ $record_buf = substr($gi->memory_buffer, $record_pointer, FULL_RECORD_LENGTH);
67
+ } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
68
+ $record_buf = @shmop_read($gi->shmid, $record_pointer, FULL_RECORD_LENGTH);
69
+ } else {
70
+ fseek($gi->filehandle, $record_pointer, SEEK_SET);
71
+ $record_buf = fread($gi->filehandle, FULL_RECORD_LENGTH);
72
+ }
73
+ $record = new geoiprecord;
74
+ $record_buf_pos = 0;
75
+ $char = ord(substr($record_buf, $record_buf_pos, 1));
76
+ $record->country_code = $gi->GEOIP_COUNTRY_CODES[$char];
77
+ $record->country_code3 = $gi->GEOIP_COUNTRY_CODES3[$char];
78
+ $record->country_name = $gi->GEOIP_COUNTRY_NAMES[$char];
79
+ $record->continent_code = $gi->GEOIP_CONTINENT_CODES[$char];
80
+ $record_buf_pos++;
81
+ $str_length = 0;
82
+
83
+ // Get region
84
+ $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
85
+ while ($char != 0) {
86
+ $str_length++;
87
+ $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
88
+ }
89
+ if ($str_length > 0) {
90
+ $record->region = substr($record_buf, $record_buf_pos, $str_length);
91
+ }
92
+ $record_buf_pos += $str_length + 1;
93
+ $str_length = 0;
94
+ // Get city
95
+ $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
96
+ while ($char != 0) {
97
+ $str_length++;
98
+ $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
99
+ }
100
+ if ($str_length > 0) {
101
+ $record->city = substr($record_buf, $record_buf_pos, $str_length);
102
+ }
103
+ $record_buf_pos += $str_length + 1;
104
+ $str_length = 0;
105
+ // Get postal code
106
+ $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
107
+ while ($char != 0) {
108
+ $str_length++;
109
+ $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
110
+ }
111
+ if ($str_length > 0) {
112
+ $record->postal_code = substr($record_buf, $record_buf_pos, $str_length);
113
+ }
114
+ $record_buf_pos += $str_length + 1;
115
+ $str_length = 0;
116
+ // Get latitude and longitude
117
+ $latitude = 0;
118
+ $longitude = 0;
119
+ for ($j = 0; $j < 3; ++$j) {
120
+ $char = ord(substr($record_buf, $record_buf_pos++, 1));
121
+ $latitude += ($char << ($j * 8));
122
+ }
123
+ $record->latitude = ($latitude / 10000) - 180;
124
+ for ($j = 0; $j < 3; ++$j) {
125
+ $char = ord(substr($record_buf, $record_buf_pos++, 1));
126
+ $longitude += ($char << ($j * 8));
127
+ }
128
+ $record->longitude = ($longitude / 10000) - 180;
129
+ if (GEOIP_CITY_EDITION_REV1 == $gi->databaseType) {
130
+ $metroarea_combo = 0;
131
+ if ($record->country_code == "US") {
132
+ for ($j = 0; $j < 3; ++$j) {
133
+ $char = ord(substr($record_buf, $record_buf_pos++, 1));
134
+ $metroarea_combo += ($char << ($j * 8));
135
+ }
136
+ $record->metro_code = $record->dma_code = floor($metroarea_combo / 1000);
137
+ $record->area_code = $metroarea_combo % 1000;
138
+ }
139
+ }
140
+ if ($mbExists) {
141
+ mb_internal_encoding($enc);
142
+ }
143
+ return $record;
144
+ }
145
+
146
+ function GeoIP_record_by_addr_v6($gi, $addr)
147
+ {
148
+ if ($addr == null) {
149
+ return 0;
150
+ }
151
+ $ipnum = inet_pton($addr);
152
+ return _get_record_v6($gi, $ipnum);
153
+ }
154
+
155
+ function _get_record($gi, $ipnum)
156
+ {
157
+ $seek_country = _geoip_seek_country($gi, $ipnum);
158
+ if ($seek_country == $gi->databaseSegments) {
159
+ return null;
160
+ }
161
+ return _common_get_record($gi, $seek_country);
162
+ }
163
+
164
+ function GeoIP_record_by_addr($gi, $addr)
165
+ {
166
+ if ($addr == null) {
167
+ return 0;
168
+ }
169
+ $ipnum = ip2long($addr);
170
+ return _get_record($gi, $ipnum);
171
+ }
geoip/src/geoipregionvars.php ADDED
@@ -0,0 +1,4630 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Copyright 2014 MaxMind, Inc. All Rights Reserved
3
+ global $GEOIP_REGION_NAME;
4
+ $GEOIP_REGION_NAME = array (
5
+ 'AD' =>
6
+ array (
7
+ '02' => 'Canillo',
8
+ '03' => 'Encamp',
9
+ '04' => 'La Massana',
10
+ '05' => 'Ordino',
11
+ '06' => 'Sant Julia de Loria',
12
+ '07' => 'Andorra la Vella',
13
+ '08' => 'Escaldes-Engordany',
14
+ ),
15
+ 'AE' =>
16
+ array (
17
+ '01' => 'Abu Dhabi',
18
+ '02' => 'Ajman',
19
+ '03' => 'Dubai',
20
+ '04' => 'Fujairah',
21
+ '05' => 'Ras Al Khaimah',
22
+ '06' => 'Sharjah',
23
+ '07' => 'Umm Al Quwain',
24
+ ),
25
+ 'AF' =>
26
+ array (
27
+ '01' => 'Badakhshan',
28
+ '02' => 'Badghis',
29
+ '03' => 'Baghlan',
30
+ '05' => 'Bamian',
31
+ '06' => 'Farah',
32
+ '07' => 'Faryab',
33
+ '08' => 'Ghazni',
34
+ '09' => 'Ghowr',
35
+ 10 => 'Helmand',
36
+ 11 => 'Herat',
37
+ 13 => 'Kabol',
38
+ 14 => 'Kapisa',
39
+ 17 => 'Lowgar',
40
+ 18 => 'Nangarhar',
41
+ 19 => 'Nimruz',
42
+ 23 => 'Kandahar',
43
+ 24 => 'Kondoz',
44
+ 26 => 'Takhar',
45
+ 27 => 'Vardak',
46
+ 28 => 'Zabol',
47
+ 29 => 'Paktika',
48
+ 30 => 'Balkh',
49
+ 31 => 'Jowzjan',
50
+ 32 => 'Samangan',
51
+ 33 => 'Sar-e Pol',
52
+ 34 => 'Konar',
53
+ 35 => 'Laghman',
54
+ 36 => 'Paktia',
55
+ 37 => 'Khowst',
56
+ 38 => 'Nurestan',
57
+ 39 => 'Oruzgan',
58
+ 40 => 'Parvan',
59
+ 41 => 'Daykondi',
60
+ 42 => 'Panjshir',
61
+ ),
62
+ 'AG' =>
63
+ array (
64
+ '01' => 'Barbuda',
65
+ '03' => 'Saint George',
66
+ '04' => 'Saint John',
67
+ '05' => 'Saint Mary',
68
+ '06' => 'Saint Paul',
69
+ '07' => 'Saint Peter',
70
+ '08' => 'Saint Philip',
71
+ '09' => 'Redonda',
72
+ ),
73
+ 'AL' =>
74
+ array (
75
+ 40 => 'Berat',
76
+ 41 => 'Diber',
77
+ 42 => 'Durres',
78
+ 43 => 'Elbasan',
79
+ 44 => 'Fier',
80
+ 45 => 'Gjirokaster',
81
+ 46 => 'Korce',
82
+ 47 => 'Kukes',
83
+ 48 => 'Lezhe',
84
+ 49 => 'Shkoder',
85
+ 50 => 'Tirane',
86
+ 51 => 'Vlore',
87
+ ),
88
+ 'AM' =>
89
+ array (
90
+ '01' => 'Aragatsotn',
91
+ '02' => 'Ararat',
92
+ '03' => 'Armavir',
93
+ '04' => 'Geghark\'unik\'',
94
+ '05' => 'Kotayk\'',
95
+ '06' => 'Lorri',
96
+ '07' => 'Shirak',
97
+ '08' => 'Syunik\'',
98
+ '09' => 'Tavush',
99
+ 10 => 'Vayots\' Dzor',
100
+ 11 => 'Yerevan',
101
+ ),
102
+ 'AO' =>
103
+ array (
104
+ '01' => 'Benguela',
105
+ '02' => 'Bie',
106
+ '03' => 'Cabinda',
107
+ '04' => 'Cuando Cubango',
108
+ '05' => 'Cuanza Norte',
109
+ '06' => 'Cuanza Sul',
110
+ '07' => 'Cunene',
111
+ '08' => 'Huambo',
112
+ '09' => 'Huila',
113
+ 12 => 'Malanje',
114
+ 13 => 'Namibe',
115
+ 14 => 'Moxico',
116
+ 15 => 'Uige',
117
+ 16 => 'Zaire',
118
+ 17 => 'Lunda Norte',
119
+ 18 => 'Lunda Sul',
120
+ 19 => 'Bengo',
121
+ 20 => 'Luanda',
122
+ ),
123
+ 'AR' =>
124
+ array (
125
+ '01' => 'Buenos Aires',
126
+ '02' => 'Catamarca',
127
+ '03' => 'Chaco',
128
+ '04' => 'Chubut',
129
+ '05' => 'Cordoba',
130
+ '06' => 'Corrientes',
131
+ '07' => 'Distrito Federal',
132
+ '08' => 'Entre Rios',
133
+ '09' => 'Formosa',
134
+ 10 => 'Jujuy',
135
+ 11 => 'La Pampa',
136
+ 12 => 'La Rioja',
137
+ 13 => 'Mendoza',
138
+ 14 => 'Misiones',
139
+ 15 => 'Neuquen',
140
+ 16 => 'Rio Negro',
141
+ 17 => 'Salta',
142
+ 18 => 'San Juan',
143
+ 19 => 'San Luis',
144
+ 20 => 'Santa Cruz',
145
+ 21 => 'Santa Fe',
146
+ 22 => 'Santiago del Estero',
147
+ 23 => 'Tierra del Fuego',
148
+ 24 => 'Tucuman',
149
+ ),
150
+ 'AT' =>
151
+ array (
152
+ '01' => 'Burgenland',
153
+ '02' => 'Karnten',
154
+ '03' => 'Niederosterreich',
155
+ '04' => 'Oberosterreich',
156
+ '05' => 'Salzburg',
157
+ '06' => 'Steiermark',
158
+ '07' => 'Tirol',
159
+ '08' => 'Vorarlberg',
160
+ '09' => 'Wien',
161
+ ),
162
+ 'AU' =>
163
+ array (
164
+ '01' => 'Australian Capital Territory',
165
+ '02' => 'New South Wales',
166
+ '03' => 'Northern Territory',
167
+ '04' => 'Queensland',
168
+ '05' => 'South Australia',
169
+ '06' => 'Tasmania',
170
+ '07' => 'Victoria',
171
+ '08' => 'Western Australia',
172
+ ),
173
+ 'AZ' =>
174
+ array (
175
+ '01' => 'Abseron',
176
+ '02' => 'Agcabadi',
177
+ '03' => 'Agdam',
178
+ '04' => 'Agdas',
179
+ '05' => 'Agstafa',
180
+ '06' => 'Agsu',
181
+ '07' => 'Ali Bayramli',
182
+ '08' => 'Astara',
183
+ '09' => 'Baki',
184
+ 10 => 'Balakan',
185
+ 11 => 'Barda',
186
+ 12 => 'Beylaqan',
187
+ 13 => 'Bilasuvar',
188
+ 14 => 'Cabrayil',
189
+ 15 => 'Calilabad',
190
+ 16 => 'Daskasan',
191
+ 17 => 'Davaci',
192
+ 18 => 'Fuzuli',
193
+ 19 => 'Gadabay',
194
+ 20 => 'Ganca',
195
+ 21 => 'Goranboy',
196
+ 22 => 'Goycay',
197
+ 23 => 'Haciqabul',
198
+ 24 => 'Imisli',
199
+ 25 => 'Ismayilli',
200
+ 26 => 'Kalbacar',
201
+ 27 => 'Kurdamir',
202
+ 28 => 'Lacin',
203
+ 30 => 'Lankaran',
204
+ 31 => 'Lerik',
205
+ 32 => 'Masalli',
206
+ 33 => 'Mingacevir',
207
+ 34 => 'Naftalan',
208
+ 35 => 'Naxcivan',
209
+ 36 => 'Neftcala',
210
+ 37 => 'Oguz',
211
+ 38 => 'Qabala',
212
+ 39 => 'Qax',
213
+ 40 => 'Qazax',
214
+ 41 => 'Qobustan',
215
+ 42 => 'Quba',
216
+ 43 => 'Qubadli',
217
+ 44 => 'Qusar',
218
+ 45 => 'Saatli',
219
+ 46 => 'Sabirabad',
220
+ 48 => 'Saki',
221
+ 49 => 'Salyan',
222
+ 50 => 'Samaxi',
223
+ 51 => 'Samkir',
224
+ 52 => 'Samux',
225
+ 53 => 'Siyazan',
226
+ 54 => 'Sumqayit',
227
+ 56 => 'Susa',
228
+ 57 => 'Tartar',
229
+ 58 => 'Tovuz',
230
+ 59 => 'Ucar',
231
+ 60 => 'Xacmaz',
232
+ 61 => 'Xankandi',
233
+ 62 => 'Xanlar',
234
+ 63 => 'Xizi',
235
+ 64 => 'Xocali',
236
+ 65 => 'Xocavand',
237
+ 66 => 'Yardimli',
238
+ 68 => 'Yevlax',
239
+ 69 => 'Zangilan',
240
+ 70 => 'Zaqatala',
241
+ 71 => 'Zardab',
242
+ ),
243
+ 'BA' =>
244
+ array (
245
+ '01' => 'Federation of Bosnia and Herzegovina',
246
+ '03' => 'Brcko District',
247
+ '02' => 'Republika Srpska',
248
+ ),
249
+ 'BB' =>
250
+ array (
251
+ '01' => 'Christ Church',
252
+ '02' => 'Saint Andrew',
253
+ '03' => 'Saint George',
254
+ '04' => 'Saint James',
255
+ '05' => 'Saint John',
256
+ '06' => 'Saint Joseph',
257
+ '07' => 'Saint Lucy',
258
+ '08' => 'Saint Michael',
259
+ '09' => 'Saint Peter',
260
+ 10 => 'Saint Philip',
261
+ 11 => 'Saint Thomas',
262
+ ),
263
+ 'BD' =>
264
+ array (
265
+ 81 => 'Dhaka',
266
+ 82 => 'Khulna',
267
+ 83 => 'Rajshahi',
268
+ 84 => 'Chittagong',
269
+ 85 => 'Barisal',
270
+ 86 => 'Sylhet',
271
+ 87 => 'Rangpur',
272
+ ),
273
+ 'BE' =>
274
+ array (
275
+ '01' => 'Antwerpen',
276
+ '03' => 'Hainaut',
277
+ '04' => 'Liege',
278
+ '05' => 'Limburg',
279
+ '06' => 'Luxembourg',
280
+ '07' => 'Namur',
281
+ '08' => 'Oost-Vlaanderen',
282
+ '09' => 'West-Vlaanderen',
283
+ 10 => 'Brabant Wallon',
284
+ 11 => 'Brussels Hoofdstedelijk Gewest',
285
+ 12 => 'Vlaams-Brabant',
286
+ 13 => 'Flanders',
287
+ 14 => 'Wallonia',
288
+ ),
289
+ 'BF' =>
290
+ array (
291
+ 15 => 'Bam',
292
+ 19 => 'Boulkiemde',
293
+ 20 => 'Ganzourgou',
294
+ 21 => 'Gnagna',
295
+ 28 => 'Kouritenga',
296
+ 33 => 'Oudalan',
297
+ 34 => 'Passore',
298
+ 36 => 'Sanguie',
299
+ 40 => 'Soum',
300
+ 42 => 'Tapoa',
301
+ 44 => 'Zoundweogo',
302
+ 45 => 'Bale',
303
+ 46 => 'Banwa',
304
+ 47 => 'Bazega',
305
+ 48 => 'Bougouriba',
306
+ 49 => 'Boulgou',
307
+ 50 => 'Gourma',
308
+ 51 => 'Houet',
309
+ 52 => 'Ioba',
310
+ 53 => 'Kadiogo',
311
+ 54 => 'Kenedougou',
312
+ 55 => 'Komoe',
313
+ 56 => 'Komondjari',
314
+ 57 => 'Kompienga',
315
+ 58 => 'Kossi',
316
+ 59 => 'Koulpelogo',
317
+ 60 => 'Kourweogo',
318
+ 61 => 'Leraba',
319
+ 62 => 'Loroum',
320
+ 63 => 'Mouhoun',
321
+ 64 => 'Namentenga',
322
+ 65 => 'Naouri',
323
+ 66 => 'Nayala',
324
+ 67 => 'Noumbiel',
325
+ 68 => 'Oubritenga',
326
+ 69 => 'Poni',
327
+ 70 => 'Sanmatenga',
328
+ 71 => 'Seno',
329
+ 72 => 'Sissili',
330
+ 73 => 'Sourou',
331
+ 74 => 'Tuy',
332
+ 75 => 'Yagha',
333
+ 76 => 'Yatenga',
334
+ 77 => 'Ziro',
335
+ 78 => 'Zondoma',
336
+ ),
337
+ 'BG' =>
338
+ array (
339
+ 33 => 'Mikhaylovgrad',
340
+ 38 => 'Blagoevgrad',
341
+ 39 => 'Burgas',
342
+ 40 => 'Dobrich',
343
+ 41 => 'Gabrovo',
344
+ 42 => 'Grad Sofiya',
345
+ 43 => 'Khaskovo',
346
+ 44 => 'Kurdzhali',
347
+ 45 => 'Kyustendil',
348
+ 46 => 'Lovech',
349
+ 47 => 'Montana',
350
+ 48 => 'Pazardzhik',
351
+ 49 => 'Pernik',
352
+ 50 => 'Pleven',
353
+ 51 => 'Plovdiv',
354
+ 52 => 'Razgrad',
355
+ 53 => 'Ruse',
356
+ 54 => 'Shumen',
357
+ 55 => 'Silistra',
358
+ 56 => 'Sliven',
359
+ 57 => 'Smolyan',
360
+ 58 => 'Sofiya',
361
+ 59 => 'Stara Zagora',
362
+ 60 => 'Turgovishte',
363
+ 61 => 'Varna',
364
+ 62 => 'Veliko Turnovo',
365
+ 63 => 'Vidin',
366
+ 64 => 'Vratsa',
367
+ 65 => 'Yambol',
368
+ ),
369
+ 'BH' =>
370
+ array (
371
+ '01' => 'Al Hadd',
372
+ '02' => 'Al Manamah',
373
+ '05' => 'Jidd Hafs',
374
+ '06' => 'Sitrah',
375
+ '08' => 'Al Mintaqah al Gharbiyah',
376
+ '09' => 'Mintaqat Juzur Hawar',
377
+ 10 => 'Al Mintaqah ash Shamaliyah',
378
+ 11 => 'Al Mintaqah al Wusta',
379
+ 12 => 'Madinat',
380
+ 13 => 'Ar Rifa',
381
+ 14 => 'Madinat Hamad',
382
+ 15 => 'Al Muharraq',
383
+ 16 => 'Al Asimah',
384
+ 17 => 'Al Janubiyah',
385
+ 18 => 'Ash Shamaliyah',
386
+ 19 => 'Al Wusta',
387
+ ),
388
+ 'BI' =>
389
+ array (
390
+ '02' => 'Bujumbura',
391
+ '09' => 'Bubanza',
392
+ 10 => 'Bururi',
393
+ 11 => 'Cankuzo',
394
+ 12 => 'Cibitoke',
395
+ 13 => 'Gitega',
396
+ 14 => 'Karuzi',
397
+ 15 => 'Kayanza',
398
+ 16 => 'Kirundo',
399
+ 17 => 'Makamba',
400
+ 18 => 'Muyinga',
401
+ 19 => 'Ngozi',
402
+ 20 => 'Rutana',
403
+ 21 => 'Ruyigi',
404
+ 22 => 'Muramvya',
405
+ 23 => 'Mwaro',
406
+ ),
407
+ 'BJ' =>
408
+ array (
409
+ '07' => 'Alibori',
410
+ '08' => 'Atakora',
411
+ '09' => 'Atlanyique',
412
+ 10 => 'Borgou',
413
+ 11 => 'Collines',
414
+ 12 => 'Kouffo',
415
+ 13 => 'Donga',
416
+ 14 => 'Littoral',
417
+ 15 => 'Mono',
418
+ 16 => 'Oueme',
419
+ 17 => 'Plateau',
420
+ 18 => 'Zou',
421
+ ),
422
+ 'BM' =>
423
+ array (
424
+ '01' => 'Devonshire',
425
+ '03' => 'Hamilton',
426
+ '04' => 'Paget',
427
+ '05' => 'Pembroke',
428
+ '06' => 'Saint George',
429
+ '07' => 'Saint George\'s',
430
+ '08' => 'Sandys',
431
+ '09' => 'Smiths',
432
+ 10 => 'Southampton',
433
+ 11 => 'Warwick',
434
+ ),
435
+ 'BN' =>
436
+ array (
437
+ '07' => 'Alibori',
438
+ '08' => 'Belait',
439
+ '09' => 'Brunei and Muara',
440
+ 10 => 'Temburong',
441
+ 11 => 'Collines',
442
+ 12 => 'Kouffo',
443
+ 13 => 'Donga',
444
+ 14 => 'Littoral',
445
+ 15 => 'Tutong',
446
+ 16 => 'Oueme',
447
+ 17 => 'Plateau',
448
+ 18 => 'Zou',
449
+ ),
450
+ 'BO' =>
451
+ array (
452
+ '01' => 'Chuquisaca',
453
+ '02' => 'Cochabamba',
454
+ '03' => 'El Beni',
455
+ '04' => 'La Paz',
456
+ '05' => 'Oruro',
457
+ '06' => 'Pando',
458
+ '07' => 'Potosi',
459
+ '08' => 'Santa Cruz',
460
+ '09' => 'Tarija',
461
+ ),
462
+ 'BR' =>
463
+ array (
464
+ '01' => 'Acre',
465
+ '02' => 'Alagoas',
466
+ '03' => 'Amapa',
467
+ '04' => 'Amazonas',
468
+ '05' => 'Bahia',
469
+ '06' => 'Ceara',
470
+ '07' => 'Distrito Federal',
471
+ '08' => 'Espirito Santo',
472
+ 11 => 'Mato Grosso do Sul',
473
+ 13 => 'Maranhao',
474
+ 14 => 'Mato Grosso',
475
+ 15 => 'Minas Gerais',
476
+ 16 => 'Para',
477
+ 17 => 'Paraiba',
478
+ 18 => 'Parana',
479
+ 20 => 'Piaui',
480
+ 21 => 'Rio de Janeiro',
481
+ 22 => 'Rio Grande do Norte',
482
+ 23 => 'Rio Grande do Sul',
483
+ 24 => 'Rondonia',
484
+ 25 => 'Roraima',
485
+ 26 => 'Santa Catarina',
486
+ 27 => 'Sao Paulo',
487
+ 28 => 'Sergipe',
488
+ 29 => 'Goias',
489
+ 30 => 'Pernambuco',
490
+ 31 => 'Tocantins',
491
+ ),
492
+ 'BS' =>
493
+ array (
494
+ '05' => 'Bimini',
495
+ '06' => 'Cat Island',
496
+ 10 => 'Exuma',
497
+ 13 => 'Inagua',
498
+ 15 => 'Long Island',
499
+ 16 => 'Mayaguana',
500
+ 18 => 'Ragged Island',
501
+ 22 => 'Harbour Island',
502
+ 23 => 'New Providence',
503
+ 24 => 'Acklins and Crooked Islands',
504
+ 25 => 'Freeport',
505
+ 26 => 'Fresh Creek',
506
+ 27 => 'Governor\'s Harbour',
507
+ 28 => 'Green Turtle Cay',
508
+ 29 => 'High Rock',
509
+ 30 => 'Kemps Bay',
510
+ 31 => 'Marsh Harbour',
511
+ 32 => 'Nichollstown and Berry Islands',
512
+ 33 => 'Rock Sound',
513
+ 34 => 'Sandy Point',
514
+ 35 => 'San Salvador and Rum Cay',
515
+ ),
516
+ 'BT' =>
517
+ array (
518
+ '05' => 'Bumthang',
519
+ '06' => 'Chhukha',
520
+ '07' => 'Chirang',
521
+ '08' => 'Daga',
522
+ '09' => 'Geylegphug',
523
+ 10 => 'Ha',
524
+ 11 => 'Lhuntshi',
525
+ 12 => 'Mongar',
526
+ 13 => 'Paro',
527
+ 14 => 'Pemagatsel',
528
+ 15 => 'Punakha',
529
+ 16 => 'Samchi',
530
+ 17 => 'Samdrup',
531
+ 18 => 'Shemgang',
532
+ 19 => 'Tashigang',
533
+ 20 => 'Thimphu',
534
+ 21 => 'Tongsa',
535
+ 22 => 'Wangdi Phodrang',
536
+ ),
537
+ 'BW' =>
538
+ array (
539
+ '01' => 'Central',
540
+ '03' => 'Ghanzi',
541
+ '04' => 'Kgalagadi',
542
+ '05' => 'Kgatleng',
543
+ '06' => 'Kweneng',
544
+ '08' => 'North-East',
545
+ '09' => 'South-East',
546
+ 10 => 'Southern',
547
+ 11 => 'North-West',
548
+ ),
549
+ 'BY' =>
550
+ array (
551
+ '01' => 'Brestskaya Voblasts\'',
552
+ '02' => 'Homyel\'skaya Voblasts\'',
553
+ '03' => 'Hrodzyenskaya Voblasts\'',
554
+ '04' => 'Minsk',
555
+ '05' => 'Minskaya Voblasts\'',
556
+ '06' => 'Mahilyowskaya Voblasts\'',
557
+ '07' => 'Vitsyebskaya Voblasts\'',
558
+ ),
559
+ 'BZ' =>
560
+ array (
561
+ '01' => 'Belize',
562
+ '02' => 'Cayo',
563
+ '03' => 'Corozal',
564
+ '04' => 'Orange Walk',
565
+ '05' => 'Stann Creek',
566
+ '06' => 'Toledo',
567
+ ),
568
+ 'CA' =>
569
+ array (
570
+ 'AB' => 'Alberta',
571
+ 'BC' => 'British Columbia',
572
+ 'MB' => 'Manitoba',
573
+ 'NB' => 'New Brunswick',
574
+ 'NL' => 'Newfoundland',
575
+ 'NS' => 'Nova Scotia',
576
+ 'NT' => 'Northwest Territories',
577
+ 'NU' => 'Nunavut',
578
+ 'ON' => 'Ontario',
579
+ 'PE' => 'Prince Edward Island',
580
+ 'QC' => 'Quebec',
581
+ 'SK' => 'Saskatchewan',
582
+ 'YT' => 'Yukon Territory',
583
+ ),
584
+ 'CD' =>
585
+ array (
586
+ '01' => 'Bandundu',
587
+ '02' => 'Equateur',
588
+ '04' => 'Kasai-Oriental',
589
+ '05' => 'Katanga',
590
+ '06' => 'Kinshasa',
591
+ '08' => 'Bas-Congo',
592
+ '09' => 'Orientale',
593
+ 10 => 'Maniema',
594
+ 11 => 'Nord-Kivu',
595
+ 12 => 'Sud-Kivu',
596
+ ),
597
+ 'CF' =>
598
+ array (
599
+ '01' => 'Bamingui-Bangoran',
600
+ '02' => 'Basse-Kotto',
601
+ '03' => 'Haute-Kotto',
602
+ '04' => 'Mambere-Kadei',
603
+ '05' => 'Haut-Mbomou',
604
+ '06' => 'Kemo',
605
+ '07' => 'Lobaye',
606
+ '08' => 'Mbomou',
607
+ '09' => 'Nana-Mambere',
608
+ 11 => 'Ouaka',
609
+ 12 => 'Ouham',
610
+ 13 => 'Ouham-Pende',
611
+ 14 => 'Cuvette-Ouest',
612
+ 15 => 'Nana-Grebizi',
613
+ 16 => 'Sangha-Mbaere',
614
+ 17 => 'Ombella-Mpoko',
615
+ 18 => 'Bangui',
616
+ ),
617
+ 'CG' =>
618
+ array (
619
+ '01' => 'Bouenza',
620
+ '04' => 'Kouilou',
621
+ '05' => 'Lekoumou',
622
+ '06' => 'Likouala',
623
+ '07' => 'Niari',
624
+ '08' => 'Plateaux',
625
+ 10 => 'Sangha',
626
+ 11 => 'Pool',
627
+ 12 => 'Brazzaville',
628
+ 13 => 'Cuvette',
629
+ 14 => 'Cuvette-Ouest',
630
+ ),
631
+ 'CH' =>
632
+ array (
633
+ '01' => 'Aargau',
634
+ '02' => 'Ausser-Rhoden',
635
+ '03' => 'Basel-Landschaft',
636
+ '04' => 'Basel-Stadt',
637
+ '05' => 'Bern',
638
+ '06' => 'Fribourg',
639
+ '07' => 'Geneve',
640
+ '08' => 'Glarus',
641
+ '09' => 'Graubunden',
642
+ 10 => 'Inner-Rhoden',
643
+ 11 => 'Luzern',
644
+ 12 => 'Neuchatel',
645
+ 13 => 'Nidwalden',
646
+ 14 => 'Obwalden',
647
+ 15 => 'Sankt Gallen',
648
+ 16 => 'Schaffhausen',
649
+ 17 => 'Schwyz',
650
+ 18 => 'Solothurn',
651
+ 19 => 'Thurgau',
652
+ 20 => 'Ticino',
653
+ 21 => 'Uri',
654
+ 22 => 'Valais',
655
+ 23 => 'Vaud',
656
+ 24 => 'Zug',
657
+ 25 => 'Zurich',
658
+ 26 => 'Jura',
659
+ ),
660
+ 'CI' =>
661
+ array (
662
+ 74 => 'Agneby',
663
+ 75 => 'Bafing',
664
+ 76 => 'Bas-Sassandra',
665
+ 77 => 'Denguele',
666
+ 78 => 'Dix-Huit Montagnes',
667
+ 79 => 'Fromager',
668
+ 80 => 'Haut-Sassandra',
669
+ 81 => 'Lacs',
670
+ 82 => 'Lagunes',
671
+ 83 => 'Marahoue',
672
+ 84 => 'Moyen-Cavally',
673
+ 85 => 'Moyen-Comoe',
674
+ 86 => 'N\'zi-Comoe',
675
+ 87 => 'Savanes',
676
+ 88 => 'Sud-Bandama',
677
+ 89 => 'Sud-Comoe',
678
+ 90 => 'Vallee du Bandama',
679
+ 91 => 'Worodougou',
680
+ 92 => 'Zanzan',
681
+ ),
682
+ 'CL' =>
683
+ array (
684
+ '01' => 'Valparaiso',
685
+ '02' => 'Aisen del General Carlos Ibanez del Campo',
686
+ '03' => 'Antofagasta',
687
+ '04' => 'Araucania',
688
+ '05' => 'Atacama',
689
+ '06' => 'Bio-Bio',
690
+ '07' => 'Coquimbo',
691
+ '08' => 'Libertador General Bernardo O\'Higgins',
692
+ 14 => 'Los Lagos',
693
+ 10 => 'Magallanes y de la Antartica Chilena',
694
+ 11 => 'Maule',
695
+ 12 => 'Region Metropolitana',
696
+ 15 => 'Tarapaca',
697
+ 16 => 'Arica y Parinacota',
698
+ 17 => 'Los Rios',
699
+ ),
700
+ 'CM' =>
701
+ array (
702
+ '04' => 'Est',
703
+ '05' => 'Littoral',
704
+ '07' => 'Nord-Ouest',
705
+ '08' => 'Ouest',
706
+ '09' => 'Sud-Ouest',
707
+ 10 => 'Adamaoua',
708
+ 11 => 'Centre',
709
+ 12 => 'Extreme-Nord',
710
+ 13 => 'Nord',
711
+ 14 => 'Sud',
712
+ ),
713
+ 'CN' =>
714
+ array (
715
+ '01' => 'Anhui',
716
+ '02' => 'Zhejiang',
717
+ '03' => 'Jiangxi',
718
+ '04' => 'Jiangsu',
719
+ '05' => 'Jilin',
720
+ '06' => 'Qinghai',
721
+ '07' => 'Fujian',
722
+ '08' => 'Heilongjiang',
723
+ '09' => 'Henan',
724
+ 10 => 'Hebei',
725
+ 11 => 'Hunan',
726
+ 12 => 'Hubei',
727
+ 13 => 'Xinjiang',
728
+ 14 => 'Xizang',
729
+ 15 => 'Gansu',
730
+ 16 => 'Guangxi',
731
+ 18 => 'Guizhou',
732
+ 19 => 'Liaoning',
733
+ 20 => 'Nei Mongol',
734
+ 21 => 'Ningxia',
735
+ 22 => 'Beijing',
736
+ 23 => 'Shanghai',
737
+ 24 => 'Shanxi',
738
+ 25 => 'Shandong',
739
+ 26 => 'Shaanxi',
740
+ 28 => 'Tianjin',
741
+ 29 => 'Yunnan',
742
+ 30 => 'Guangdong',
743
+ 31 => 'Hainan',
744
+ 32 => 'Sichuan',
745
+ 33 => 'Chongqing',
746
+ ),
747
+ 'CO' =>
748
+ array (
749
+ '01' => 'Amazonas',
750
+ '02' => 'Antioquia',
751
+ '03' => 'Arauca',
752
+ '04' => 'Atlantico',
753
+ '08' => 'Caqueta',
754
+ '09' => 'Cauca',
755
+ 10 => 'Cesar',
756
+ 11 => 'Choco',
757
+ 12 => 'Cordoba',
758
+ 14 => 'Guaviare',
759
+ 15 => 'Guainia',
760
+ 16 => 'Huila',
761
+ 17 => 'La Guajira',
762
+ 19 => 'Meta',
763
+ 20 => 'Narino',
764
+ 21 => 'Norte de Santander',
765
+ 22 => 'Putumayo',
766
+ 23 => 'Quindio',
767
+ 24 => 'Risaralda',
768
+ 25 => 'San Andres y Providencia',
769
+ 26 => 'Santander',
770
+ 27 => 'Sucre',
771
+ 28 => 'Tolima',
772
+ 29 => 'Valle del Cauca',
773
+ 30 => 'Vaupes',
774
+ 31 => 'Vichada',
775
+ 32 => 'Casanare',
776
+ 33 => 'Cundinamarca',
777
+ 34 => 'Distrito Especial',
778
+ 35 => 'Bolivar',
779
+ 36 => 'Boyaca',
780
+ 37 => 'Caldas',
781
+ 38 => 'Magdalena',
782
+ ),
783
+ 'CR' =>
784
+ array (
785
+ '01' => 'Alajuela',
786
+ '02' => 'Cartago',
787
+ '03' => 'Guanacaste',
788
+ '04' => 'Heredia',
789
+ '06' => 'Limon',
790
+ '07' => 'Puntarenas',
791
+ '08' => 'San Jose',
792
+ ),
793
+ 'CU' =>
794
+ array (
795
+ '01' => 'Pinar del Rio',
796
+ '02' => 'Ciudad de la Habana',
797
+ '03' => 'Matanzas',
798
+ '04' => 'Isla de la Juventud',
799
+ '05' => 'Camaguey',
800
+ '07' => 'Ciego de Avila',
801
+ '08' => 'Cienfuegos',
802
+ '09' => 'Granma',
803
+ 10 => 'Guantanamo',
804
+ 11 => 'La Habana',
805
+ 12 => 'Holguin',
806
+ 13 => 'Las Tunas',
807
+ 14 => 'Sancti Spiritus',
808
+ 15 => 'Santiago de Cuba',
809
+ 16 => 'Villa Clara',
810
+ ),
811
+ 'CV' =>
812
+ array (
813
+ '01' => 'Boa Vista',
814
+ '02' => 'Brava',
815
+ '04' => 'Maio',
816
+ '05' => 'Paul',
817
+ '07' => 'Ribeira Grande',
818
+ '08' => 'Sal',
819
+ 10 => 'Sao Nicolau',
820
+ 11 => 'Sao Vicente',
821
+ 13 => 'Mosteiros',
822
+ 14 => 'Praia',
823
+ 15 => 'Santa Catarina',
824
+ 16 => 'Santa Cruz',
825
+ 17 => 'Sao Domingos',
826
+ 18 => 'Sao Filipe',
827
+ 19 => 'Sao Miguel',
828
+ 20 => 'Tarrafal',
829
+ ),
830
+ 'CY' =>
831
+ array (
832
+ '01' => 'Famagusta',
833
+ '02' => 'Kyrenia',
834
+ '03' => 'Larnaca',
835
+ '04' => 'Nicosia',
836
+ '05' => 'Limassol',
837
+ '06' => 'Paphos',
838
+ ),
839
+ 'CZ' =>
840
+ array (
841
+ 52 => 'Hlavni mesto Praha',
842
+ 78 => 'Jihomoravsky kraj',
843
+ 79 => 'Jihocesky kraj',
844
+ 80 => 'Vysocina',
845
+ 81 => 'Karlovarsky kraj',
846
+ 82 => 'Kralovehradecky kraj',
847
+ 83 => 'Liberecky kraj',
848
+ 84 => 'Olomoucky kraj',
849
+ 85 => 'Moravskoslezsky kraj',
850
+ 86 => 'Pardubicky kraj',
851
+ 87 => 'Plzensky kraj',
852
+ 88 => 'Stredocesky kraj',
853
+ 89 => 'Ustecky kraj',
854
+ 90 => 'Zlinsky kraj',
855
+ ),
856
+ 'DE' =>
857
+ array (
858
+ '01' => 'Baden-Wurttemberg',
859
+ '02' => 'Bayern',
860
+ '03' => 'Bremen',
861
+ '04' => 'Hamburg',
862
+ '05' => 'Hessen',
863
+ '06' => 'Niedersachsen',
864
+ '07' => 'Nordrhein-Westfalen',
865
+ '08' => 'Rheinland-Pfalz',
866
+ '09' => 'Saarland',
867
+ 10 => 'Schleswig-Holstein',
868
+ 11 => 'Brandenburg',
869
+ 12 => 'Mecklenburg-Vorpommern',
870
+ 13 => 'Sachsen',
871
+ 14 => 'Sachsen-Anhalt',
872
+ 15 => 'Thuringen',
873
+ 16 => 'Berlin',
874
+ ),
875
+ 'DJ' =>
876
+ array (
877
+ '01' => 'Ali Sabieh',
878
+ '04' => 'Obock',
879
+ '05' => 'Tadjoura',
880
+ '06' => 'Dikhil',
881
+ '07' => 'Djibouti',
882
+ '08' => 'Arta',
883
+ ),
884
+ 'DK' =>
885
+ array (
886
+ 17 => 'Hovedstaden',
887
+ 18 => 'Midtjylland',
888
+ 19 => 'Nordjylland',
889
+ 20 => 'Sjelland',
890
+ 21 => 'Syddanmark',
891
+ ),
892
+ 'DM' =>
893
+ array (
894
+ '02' => 'Saint Andrew',
895
+ '03' => 'Saint David',
896
+ '04' => 'Saint George',
897
+ '05' => 'Saint John',
898
+ '06' => 'Saint Joseph',
899
+ '07' => 'Saint Luke',
900
+ '08' => 'Saint Mark',
901
+ '09' => 'Saint Patrick',
902
+ 10 => 'Saint Paul',
903
+ 11 => 'Saint Peter',
904
+ ),
905
+ 'DO' =>
906
+ array (
907
+ '01' => 'Azua',
908
+ '02' => 'Baoruco',
909
+ '03' => 'Barahona',
910
+ '04' => 'Dajabon',
911
+ 34 => 'Distrito Nacional',
912
+ '06' => 'Duarte',
913
+ '08' => 'Espaillat',
914
+ '09' => 'Independencia',
915
+ 10 => 'La Altagracia',
916
+ 11 => 'Elias Pina',
917
+ 12 => 'La Romana',
918
+ 14 => 'Maria Trinidad Sanchez',
919
+ 15 => 'Monte Cristi',
920
+ 16 => 'Pedernales',
921
+ 35 => 'Peravia',
922
+ 18 => 'Puerto Plata',
923
+ 19 => 'Salcedo',
924
+ 20 => 'Samana',
925
+ 21 => 'Sanchez Ramirez',
926
+ 23 => 'San Juan',
927
+ 24 => 'San Pedro De Macoris',
928
+ 25 => 'Santiago',
929
+ 26 => 'Santiago Rodriguez',
930
+ 27 => 'Valverde',
931
+ 28 => 'El Seibo',
932
+ 29 => 'Hato Mayor',
933
+ 30 => 'La Vega',
934
+ 31 => 'Monsenor Nouel',
935
+ 32 => 'Monte Plata',
936
+ 33 => 'San Cristobal',
937
+ 36 => 'San Jose de Ocoa',
938
+ 37 => 'Santo Domingo',
939
+ ),
940
+ 'DZ' =>
941
+ array (
942
+ '01' => 'Alger',
943
+ '03' => 'Batna',
944
+ '04' => 'Constantine',
945
+ '06' => 'Medea',
946
+ '07' => 'Mostaganem',
947
+ '09' => 'Oran',
948
+ 10 => 'Saida',
949
+ 12 => 'Setif',
950
+ 13 => 'Tiaret',
951
+ 14 => 'Tizi Ouzou',
952
+ 15 => 'Tlemcen',
953
+ 18 => 'Bejaia',
954
+ 19 => 'Biskra',
955
+ 20 => 'Blida',
956
+ 21 => 'Bouira',
957
+ 22 => 'Djelfa',
958
+ 23 => 'Guelma',
959
+ 24 => 'Jijel',
960
+ 25 => 'Laghouat',
961
+ 26 => 'Mascara',
962
+ 27 => 'M\'sila',
963
+ 29 => 'Oum el Bouaghi',
964
+ 30 => 'Sidi Bel Abbes',
965
+ 31 => 'Skikda',
966
+ 33 => 'Tebessa',
967
+ 34 => 'Adrar',
968
+ 35 => 'Ain Defla',
969
+ 36 => 'Ain Temouchent',
970
+ 37 => 'Annaba',
971
+ 38 => 'Bechar',
972
+ 39 => 'Bordj Bou Arreridj',
973
+ 40 => 'Boumerdes',
974
+ 41 => 'Chlef',
975
+ 42 => 'El Bayadh',
976
+ 43 => 'El Oued',
977
+ 44 => 'El Tarf',
978
+ 45 => 'Ghardaia',
979
+ 46 => 'Illizi',
980
+ 47 => 'Khenchela',
981
+ 48 => 'Mila',
982
+ 49 => 'Naama',
983
+ 50 => 'Ouargla',
984
+ 51 => 'Relizane',
985
+ 52 => 'Souk Ahras',
986
+ 53 => 'Tamanghasset',
987
+ 54 => 'Tindouf',
988
+ 55 => 'Tipaza',
989
+ 56 => 'Tissemsilt',
990
+ ),
991
+ 'EC' =>
992
+ array (
993
+ '01' => 'Galapagos',
994
+ '02' => 'Azuay',
995
+ '03' => 'Bolivar',
996
+ '04' => 'Canar',
997
+ '05' => 'Carchi',
998
+ '06' => 'Chimborazo',
999
+ '07' => 'Cotopaxi',
1000
+ '08' => 'El Oro',
1001
+ '09' => 'Esmeraldas',
1002
+ 10 => 'Guayas',
1003
+ 11 => 'Imbabura',
1004
+ 12 => 'Loja',
1005
+ 13 => 'Los Rios',
1006
+ 14 => 'Manabi',
1007
+ 15 => 'Morona-Santiago',
1008
+ 17 => 'Pastaza',
1009
+ 18 => 'Pichincha',
1010
+ 19 => 'Tungurahua',
1011
+ 20 => 'Zamora-Chinchipe',
1012
+ 22 => 'Sucumbios',
1013
+ 23 => 'Napo',
1014
+ 24 => 'Orellana',
1015
+ ),
1016
+ 'EE' =>
1017
+ array (
1018
+ '01' => 'Harjumaa',
1019
+ '02' => 'Hiiumaa',
1020
+ '03' => 'Ida-Virumaa',
1021
+ '04' => 'Jarvamaa',
1022
+ '05' => 'Jogevamaa',
1023
+ '06' => 'Kohtla-Jarve',
1024
+ '07' => 'Laanemaa',
1025
+ '08' => 'Laane-Virumaa',
1026
+ '09' => 'Narva',
1027
+ 10 => 'Parnu',
1028
+ 11 => 'Parnumaa',
1029
+ 12 => 'Polvamaa',
1030
+ 13 => 'Raplamaa',
1031
+ 14 => 'Saaremaa',
1032
+ 15 => 'Sillamae',
1033
+ 16 => 'Tallinn',
1034
+ 17 => 'Tartu',
1035
+ 18 => 'Tartumaa',
1036
+ 19 => 'Valgamaa',
1037
+ 20 => 'Viljandimaa',
1038
+ 21 => 'Vorumaa',
1039
+ ),
1040
+ 'EG' =>
1041
+ array (
1042
+ '01' => 'Ad Daqahliyah',
1043
+ '02' => 'Al Bahr al Ahmar',
1044
+ '03' => 'Al Buhayrah',
1045
+ '04' => 'Al Fayyum',
1046
+ '05' => 'Al Gharbiyah',
1047
+ '06' => 'Al Iskandariyah',
1048
+ '07' => 'Al Isma\'iliyah',
1049
+ '08' => 'Al Jizah',
1050
+ '09' => 'Al Minufiyah',
1051
+ 10 => 'Al Minya',
1052
+ 11 => 'Al Qahirah',
1053
+ 12 => 'Al Qalyubiyah',
1054
+ 13 => 'Al Wadi al Jadid',
1055
+ 14 => 'Ash Sharqiyah',
1056
+ 15 => 'As Suways',
1057
+ 16 => 'Aswan',
1058
+ 17 => 'Asyut',
1059
+ 18 => 'Bani Suwayf',
1060
+ 19 => 'Bur Sa\'id',
1061
+ 20 => 'Dumyat',
1062
+ 21 => 'Kafr ash Shaykh',
1063
+ 22 => 'Matruh',
1064
+ 23 => 'Qina',
1065
+ 24 => 'Suhaj',
1066
+ 26 => 'Janub Sina\'',
1067
+ 27 => 'Shamal Sina\'',
1068
+ 28 => 'Al Uqsur',
1069
+ ),
1070
+ 'ER' =>
1071
+ array (
1072
+ '01' => 'Anseba',
1073
+ '02' => 'Debub',
1074
+ '03' => 'Debubawi K\'eyih Bahri',
1075
+ '04' => 'Gash Barka',
1076
+ '05' => 'Ma\'akel',
1077
+ '06' => 'Semenawi K\'eyih Bahri',
1078
+ ),
1079
+ 'ES' =>
1080
+ array (
1081
+ '07' => 'Islas Baleares',
1082
+ 27 => 'La Rioja',
1083
+ 29 => 'Madrid',
1084
+ 31 => 'Murcia',
1085
+ 32 => 'Navarra',
1086
+ 34 => 'Asturias',
1087
+ 39 => 'Cantabria',
1088
+ 51 => 'Andalucia',
1089
+ 52 => 'Aragon',
1090
+ 53 => 'Canarias',
1091
+ 54 => 'Castilla-La Mancha',
1092
+ 55 => 'Castilla y Leon',
1093
+ 56 => 'Catalonia',
1094
+ 57 => 'Extremadura',
1095
+ 58 => 'Galicia',
1096
+ 59 => 'Pais Vasco',
1097
+ 60 => 'Comunidad Valenciana',
1098
+ ),
1099
+ 'ET' =>
1100
+ array (
1101
+ 44 => 'Adis Abeba',
1102
+ 45 => 'Afar',
1103
+ 46 => 'Amara',
1104
+ 47 => 'Binshangul Gumuz',
1105
+ 48 => 'Dire Dawa',
1106
+ 49 => 'Gambela Hizboch',
1107
+ 50 => 'Hareri Hizb',
1108
+ 51 => 'Oromiya',
1109
+ 52 => 'Sumale',
1110
+ 53 => 'Tigray',
1111
+ 54 => 'YeDebub Biheroch Bihereseboch na Hizboch',
1112
+ ),
1113
+ 'FI' =>
1114
+ array (
1115
+ '01' => 'Aland',
1116
+ '06' => 'Lapland',
1117
+ '08' => 'Oulu',
1118
+ 13 => 'Southern Finland',
1119
+ 14 => 'Eastern Finland',
1120
+ 15 => 'Western Finland',
1121
+ ),
1122
+ 'FJ' =>
1123
+ array (
1124
+ '01' => 'Central',
1125
+ '02' => 'Eastern',
1126
+ '03' => 'Northern',
1127
+ '04' => 'Rotuma',
1128
+ '05' => 'Western',
1129
+ ),
1130
+ 'FM' =>
1131
+ array (
1132
+ '01' => 'Kosrae',
1133
+ '02' => 'Pohnpei',
1134
+ '03' => 'Chuuk',
1135
+ '04' => 'Yap',
1136
+ ),
1137
+ 'FR' =>
1138
+ array (
1139
+ 97 => 'Aquitaine',
1140
+ 98 => 'Auvergne',
1141
+ 99 => 'Basse-Normandie',
1142
+ 'A1' => 'Bourgogne',
1143
+ 'A2' => 'Bretagne',
1144
+ 'A3' => 'Centre',
1145
+ 'A4' => 'Champagne-Ardenne',
1146
+ 'A5' => 'Corse',
1147
+ 'A6' => 'Franche-Comte',
1148
+ 'A7' => 'Haute-Normandie',
1149
+ 'A8' => 'Ile-de-France',
1150
+ 'A9' => 'Languedoc-Roussillon',
1151
+ 'B1' => 'Limousin',
1152
+ 'B2' => 'Lorraine',
1153
+ 'B3' => 'Midi-Pyrenees',
1154
+ 'B4' => 'Nord-Pas-de-Calais',
1155
+ 'B5' => 'Pays de la Loire',
1156
+ 'B6' => 'Picardie',
1157
+ 'B7' => 'Poitou-Charentes',
1158
+ 'B8' => 'Provence-Alpes-Cote d\'Azur',
1159
+ 'B9' => 'Rhone-Alpes',
1160
+ 'C1' => 'Alsace',
1161
+ ),
1162
+ 'GA' =>
1163
+ array (
1164
+ '01' => 'Estuaire',
1165
+ '02' => 'Haut-Ogooue',
1166
+ '03' => 'Moyen-Ogooue',
1167
+ '04' => 'Ngounie',
1168
+ '05' => 'Nyanga',
1169
+ '06' => 'Ogooue-Ivindo',
1170
+ '07' => 'Ogooue-Lolo',
1171
+ '08' => 'Ogooue-Maritime',
1172
+ '09' => 'Woleu-Ntem',
1173
+ ),
1174
+ 'GB' =>
1175
+ array (
1176
+ 'A1' => 'Barking and Dagenham',
1177
+ 'A2' => 'Barnet',
1178
+ 'A3' => 'Barnsley',
1179
+ 'A4' => 'Bath and North East Somerset',
1180
+ 'Z5' => 'Bedfordshire',
1181
+ 'A6' => 'Bexley',
1182
+ 'A7' => 'Birmingham',
1183
+ 'A8' => 'Blackburn with Darwen',
1184
+ 'A9' => 'Blackpool',
1185
+ 'B1' => 'Bolton',
1186
+ 'B2' => 'Bournemouth',
1187
+ 'B3' => 'Bracknell Forest',
1188
+ 'B4' => 'Bradford',
1189
+ 'B5' => 'Brent',
1190
+ 'B6' => 'Brighton and Hove',
1191
+ 'B7' => 'Bristol',
1192
+ 'B8' => 'Bromley',
1193
+ 'B9' => 'Buckinghamshire',
1194
+ 'C1' => 'Bury',
1195
+ 'C2' => 'Calderdale',
1196
+ 'C3' => 'Cambridgeshire',
1197
+ 'C4' => 'Camden',
1198
+ 'C5' => 'Cheshire',
1199
+ 'C6' => 'Cornwall',
1200
+ 'C7' => 'Coventry',
1201
+ 'C8' => 'Croydon',
1202
+ 'C9' => 'Cumbria',
1203
+ 'D1' => 'Darlington',
1204
+ 'D2' => 'Derby',
1205
+ 'D3' => 'Derbyshire',
1206
+ 'D4' => 'Devon',
1207
+ 'D5' => 'Doncaster',
1208
+ 'D6' => 'Dorset',
1209
+ 'D7' => 'Dudley',
1210
+ 'D8' => 'Durham',
1211
+ 'D9' => 'Ealing',
1212
+ 'E1' => 'East Riding of Yorkshire',
1213
+ 'E2' => 'East Sussex',
1214
+ 'E3' => 'Enfield',
1215
+ 'E4' => 'Essex',
1216
+ 'E5' => 'Gateshead',
1217
+ 'E6' => 'Gloucestershire',
1218
+ 'E7' => 'Greenwich',
1219
+ 'E8' => 'Hackney',
1220
+ 'E9' => 'Halton',
1221
+ 'F1' => 'Hammersmith and Fulham',
1222
+ 'F2' => 'Hampshire',
1223
+ 'F3' => 'Haringey',
1224
+ 'F4' => 'Harrow',
1225
+ 'F5' => 'Hartlepool',
1226
+ 'F6' => 'Havering',
1227
+ 'F7' => 'Herefordshire',
1228
+ 'F8' => 'Hertford',
1229
+ 'F9' => 'Hillingdon',
1230
+ 'G1' => 'Hounslow',
1231
+ 'G2' => 'Isle of Wight',
1232
+ 'G3' => 'Islington',
1233
+ 'G4' => 'Kensington and Chelsea',
1234
+ 'G5' => 'Kent',
1235
+ 'G6' => 'Kingston upon Hull',
1236
+ 'G7' => 'Kingston upon Thames',
1237
+ 'G8' => 'Kirklees',
1238
+ 'G9' => 'Knowsley',
1239
+ 'H1' => 'Lambeth',
1240
+ 'H2' => 'Lancashire',
1241
+ 'H3' => 'Leeds',
1242
+ 'H4' => 'Leicester',
1243
+ 'H5' => 'Leicestershire',
1244
+ 'H6' => 'Lewisham',
1245
+ 'H7' => 'Lincolnshire',
1246
+ 'H8' => 'Liverpool',
1247
+ 'H9' => 'London',
1248
+ 'I1' => 'Luton',
1249
+ 'I2' => 'Manchester',
1250
+ 'I3' => 'Medway',
1251
+ 'I4' => 'Merton',
1252
+ 'I5' => 'Middlesbrough',
1253
+ 'I6' => 'Milton Keynes',
1254
+ 'I7' => 'Newcastle upon Tyne',
1255
+ 'I8' => 'Newham',
1256
+ 'I9' => 'Norfolk',
1257
+ 'J1' => 'Northamptonshire',
1258
+ 'J2' => 'North East Lincolnshire',
1259
+ 'J3' => 'North Lincolnshire',
1260
+ 'J4' => 'North Somerset',
1261
+ 'J5' => 'North Tyneside',
1262
+ 'J6' => 'Northumberland',
1263
+ 'J7' => 'North Yorkshire',
1264
+ 'J8' => 'Nottingham',
1265
+ 'J9' => 'Nottinghamshire',
1266
+ 'K1' => 'Oldham',
1267
+ 'K2' => 'Oxfordshire',
1268
+ 'K3' => 'Peterborough',
1269
+ 'K4' => 'Plymouth',
1270
+ 'K5' => 'Poole',
1271
+ 'K6' => 'Portsmouth',
1272
+ 'K7' => 'Reading',
1273
+ 'K8' => 'Redbridge',
1274
+ 'K9' => 'Redcar and Cleveland',
1275
+ 'L1' => 'Richmond upon Thames',
1276
+ 'L2' => 'Rochdale',
1277
+ 'L3' => 'Rotherham',
1278
+ 'L4' => 'Rutland',
1279
+ 'L5' => 'Salford',
1280
+ 'L6' => 'Shropshire',
1281
+ 'L7' => 'Sandwell',
1282
+ 'L8' => 'Sefton',
1283
+ 'L9' => 'Sheffield',
1284
+ 'M1' => 'Slough',
1285
+ 'M2' => 'Solihull',
1286
+ 'M3' => 'Somerset',
1287
+ 'M4' => 'Southampton',
1288
+ 'M5' => 'Southend-on-Sea',
1289
+ 'M6' => 'South Gloucestershire',
1290
+ 'M7' => 'South Tyneside',
1291
+ 'M8' => 'Southwark',
1292
+ 'M9' => 'Staffordshire',
1293
+ 'N1' => 'St. Helens',
1294
+ 'N2' => 'Stockport',
1295
+ 'N3' => 'Stockton-on-Tees',
1296
+ 'N4' => 'Stoke-on-Trent',
1297
+ 'N5' => 'Suffolk',
1298
+ 'N6' => 'Sunderland',
1299
+ 'N7' => 'Surrey',
1300
+ 'N8' => 'Sutton',
1301
+ 'N9' => 'Swindon',
1302
+ 'O1' => 'Tameside',
1303
+ 'O2' => 'Telford and Wrekin',
1304
+ 'O3' => 'Thurrock',
1305
+ 'O4' => 'Torbay',
1306
+ 'O5' => 'Tower Hamlets',
1307
+ 'O6' => 'Trafford',
1308
+ 'O7' => 'Wakefield',
1309
+ 'O8' => 'Walsall',
1310
+ 'O9' => 'Waltham Forest',
1311
+ 'P1' => 'Wandsworth',
1312
+ 'P2' => 'Warrington',
1313
+ 'P3' => 'Warwickshire',
1314
+ 'P4' => 'West Berkshire',
1315
+ 'P5' => 'Westminster',
1316
+ 'P6' => 'West Sussex',
1317
+ 'P7' => 'Wigan',
1318
+ 'P8' => 'Wiltshire',
1319
+ 'P9' => 'Windsor and Maidenhead',
1320
+ 'Q1' => 'Wirral',
1321
+ 'Q2' => 'Wokingham',
1322
+ 'Q3' => 'Wolverhampton',
1323
+ 'Q4' => 'Worcestershire',
1324
+ 'Q5' => 'York',
1325
+ 'Q6' => 'Antrim',
1326
+ 'Q7' => 'Ards',
1327
+ 'Q8' => 'Armagh',
1328
+ 'Q9' => 'Ballymena',
1329
+ 'R1' => 'Ballymoney',
1330
+ 'R2' => 'Banbridge',
1331
+ 'R3' => 'Belfast',
1332
+ 'R4' => 'Carrickfergus',
1333
+ 'R5' => 'Castlereagh',
1334
+ 'R6' => 'Coleraine',
1335
+ 'R7' => 'Cookstown',
1336
+ 'R8' => 'Craigavon',
1337
+ 'R9' => 'Down',
1338
+ 'S1' => 'Dungannon',
1339
+ 'S2' => 'Fermanagh',
1340
+ 'S3' => 'Larne',
1341
+ 'S4' => 'Limavady',
1342
+ 'S5' => 'Lisburn',
1343
+ 'S6' => 'Derry',
1344
+ 'S7' => 'Magherafelt',
1345
+ 'S8' => 'Moyle',
1346
+ 'S9' => 'Newry and Mourne',
1347
+ 'T1' => 'Newtownabbey',
1348
+ 'T2' => 'North Down',
1349
+ 'T3' => 'Omagh',
1350
+ 'T4' => 'Strabane',
1351
+ 'T5' => 'Aberdeen City',
1352
+ 'T6' => 'Aberdeenshire',
1353
+ 'T7' => 'Angus',
1354
+ 'T8' => 'Argyll and Bute',
1355
+ 'T9' => 'Scottish Borders',
1356
+ 'U1' => 'Clackmannanshire',
1357
+ 'U2' => 'Dumfries and Galloway',
1358
+ 'U3' => 'Dundee City',
1359
+ 'U4' => 'East Ayrshire',
1360
+ 'U5' => 'East Dunbartonshire',
1361
+ 'U6' => 'East Lothian',
1362
+ 'U7' => 'East Renfrewshire',
1363
+ 'U8' => 'Edinburgh',
1364
+ 'U9' => 'Falkirk',
1365
+ 'V1' => 'Fife',
1366
+ 'V2' => 'Glasgow City',
1367
+ 'V3' => 'Highland',
1368
+ 'V4' => 'Inverclyde',
1369
+ 'V5' => 'Midlothian',
1370
+ 'V6' => 'Moray',
1371
+ 'V7' => 'North Ayrshire',
1372
+ 'V8' => 'North Lanarkshire',
1373
+ 'V9' => 'Orkney',
1374
+ 'W1' => 'Perth and Kinross',
1375
+ 'W2' => 'Renfrewshire',
1376
+ 'W3' => 'Shetland Islands',
1377
+ 'W4' => 'South Ayrshire',
1378
+ 'W5' => 'South Lanarkshire',
1379
+ 'W6' => 'Stirling',
1380
+ 'W7' => 'West Dunbartonshire',
1381
+ 'W8' => 'Eilean Siar',
1382
+ 'W9' => 'West Lothian',
1383
+ 'X1' => 'Isle of Anglesey',
1384
+ 'X2' => 'Blaenau Gwent',
1385
+ 'X3' => 'Bridgend',
1386
+ 'X4' => 'Caerphilly',
1387
+ 'X5' => 'Cardiff',
1388
+ 'X6' => 'Ceredigion',
1389
+ 'X7' => 'Carmarthenshire',
1390
+ 'X8' => 'Conwy',
1391
+ 'X9' => 'Denbighshire',
1392
+ 'Y1' => 'Flintshire',
1393
+ 'Y2' => 'Gwynedd',
1394
+ 'Y3' => 'Merthyr Tydfil',
1395
+ 'Y4' => 'Monmouthshire',
1396
+ 'Y5' => 'Neath Port Talbot',
1397
+ 'Y6' => 'Newport',
1398
+ 'Y7' => 'Pembrokeshire',
1399
+ 'Y8' => 'Powys',
1400
+ 'Y9' => 'Rhondda Cynon Taff',
1401
+ 'Z1' => 'Swansea',
1402
+ 'Z2' => 'Torfaen',
1403
+ 'Z3' => 'Vale of Glamorgan',
1404
+ 'Z4' => 'Wrexham',
1405
+ 'Z6' => 'Central Bedfordshire',
1406
+ 'Z7' => 'Cheshire East',
1407
+ 'Z8' => 'Cheshire West and Chester',
1408
+ 'Z9' => 'Isles of Scilly',
1409
+ ),
1410
+ 'GD' =>
1411
+ array (
1412
+ '01' => 'Saint Andrew',
1413
+ '02' => 'Saint David',
1414
+ '03' => 'Saint George',
1415
+ '04' => 'Saint John',
1416
+ '05' => 'Saint Mark',
1417
+ '06' => 'Saint Patrick',
1418
+ ),
1419
+ 'GE' =>
1420
+ array (
1421
+ '01' => 'Abashis Raioni',
1422
+ '02' => 'Abkhazia',
1423
+ '03' => 'Adigenis Raioni',
1424
+ '04' => 'Ajaria',
1425
+ '05' => 'Akhalgoris Raioni',
1426
+ '06' => 'Akhalk\'alak\'is Raioni',
1427
+ '07' => 'Akhalts\'ikhis Raioni',
1428
+ '08' => 'Akhmetis Raioni',
1429
+ '09' => 'Ambrolauris Raioni',
1430
+ 10 => 'Aspindzis Raioni',
1431
+ 11 => 'Baghdat\'is Raioni',
1432
+ 12 => 'Bolnisis Raioni',
1433
+ 13 => 'Borjomis Raioni',
1434
+ 14 => 'Chiat\'ura',
1435
+ 15 => 'Ch\'khorotsqus Raioni',
1436
+ 16 => 'Ch\'okhatauris Raioni',
1437
+ 17 => 'Dedop\'listsqaros Raioni',
1438
+ 18 => 'Dmanisis Raioni',
1439
+ 19 => 'Dushet\'is Raioni',
1440
+ 20 => 'Gardabanis Raioni',
1441
+ 21 => 'Gori',
1442
+ 22 => 'Goris Raioni',
1443
+ 23 => 'Gurjaanis Raioni',
1444
+ 24 => 'Javis Raioni',
1445
+ 25 => 'K\'arelis Raioni',
1446
+ 26 => 'Kaspis Raioni',
1447
+ 27 => 'Kharagaulis Raioni',
1448
+ 28 => 'Khashuris Raioni',
1449
+ 29 => 'Khobis Raioni',
1450
+ 30 => 'Khonis Raioni',
1451
+ 31 => 'K\'ut\'aisi',
1452
+ 32 => 'Lagodekhis Raioni',
1453
+ 33 => 'Lanch\'khut\'is Raioni',
1454
+ 34 => 'Lentekhis Raioni',
1455
+ 35 => 'Marneulis Raioni',
1456
+ 36 => 'Martvilis Raioni',
1457
+ 37 => 'Mestiis Raioni',
1458
+ 38 => 'Mts\'khet\'is Raioni',
1459
+ 39 => 'Ninotsmindis Raioni',
1460
+ 40 => 'Onis Raioni',
1461
+ 41 => 'Ozurget\'is Raioni',
1462
+ 42 => 'P\'ot\'i',
1463
+ 43 => 'Qazbegis Raioni',
1464
+ 44 => 'Qvarlis Raioni',
1465
+ 45 => 'Rust\'avi',
1466
+ 46 => 'Sach\'kheris Raioni',
1467
+ 47 => 'Sagarejos Raioni',
1468
+ 48 => 'Samtrediis Raioni',
1469
+ 49 => 'Senakis Raioni',
1470
+ 50 => 'Sighnaghis Raioni',
1471
+ 51 => 'T\'bilisi',
1472
+ 52 => 'T\'elavis Raioni',
1473
+ 53 => 'T\'erjolis Raioni',
1474
+ 54 => 'T\'et\'ritsqaros Raioni',
1475
+ 55 => 'T\'ianet\'is Raioni',
1476
+ 56 => 'Tqibuli',
1477
+ 57 => 'Ts\'ageris Raioni',
1478
+ 58 => 'Tsalenjikhis Raioni',
1479
+ 59 => 'Tsalkis Raioni',
1480
+ 60 => 'Tsqaltubo',
1481
+ 61 => 'Vanis Raioni',
1482
+ 62 => 'Zestap\'onis Raioni',
1483
+ 63 => 'Zugdidi',
1484
+ 64 => 'Zugdidis Raioni',
1485
+ ),
1486
+ 'GH' =>
1487
+ array (
1488
+ '01' => 'Greater Accra',
1489
+ '02' => 'Ashanti',
1490
+ '03' => 'Brong-Ahafo',
1491
+ '04' => 'Central',
1492
+ '05' => 'Eastern',
1493
+ '06' => 'Northern',
1494
+ '08' => 'Volta',
1495
+ '09' => 'Western',
1496
+ 10 => 'Upper East',
1497
+ 11 => 'Upper West',
1498
+ ),
1499
+ 'GL' =>
1500
+ array (
1501
+ '01' => 'Nordgronland',
1502
+ '02' => 'Ostgronland',
1503
+ '03' => 'Vestgronland',
1504
+ ),
1505
+ 'GM' =>
1506
+ array (
1507
+ '01' => 'Banjul',
1508
+ '02' => 'Lower River',
1509
+ '03' => 'Central River',
1510
+ '04' => 'Upper River',
1511
+ '05' => 'Western',
1512
+ '07' => 'North Bank',
1513
+ ),
1514
+ 'GN' =>
1515
+ array (
1516
+ '01' => 'Beyla',
1517
+ '02' => 'Boffa',
1518
+ '03' => 'Boke',
1519
+ '04' => 'Conakry',
1520
+ '05' => 'Dabola',
1521
+ '06' => 'Dalaba',
1522
+ '07' => 'Dinguiraye',
1523
+ '09' => 'Faranah',
1524
+ 10 => 'Forecariah',
1525
+ 11 => 'Fria',
1526
+ 12 => 'Gaoual',
1527
+ 13 => 'Gueckedou',
1528
+ 15 => 'Kerouane',
1529
+ 16 => 'Kindia',
1530
+ 17 => 'Kissidougou',
1531
+ 18 => 'Koundara',
1532
+ 19 => 'Kouroussa',
1533
+ 21 => 'Macenta',
1534
+ 22 => 'Mali',
1535
+ 23 => 'Mamou',
1536
+ 25 => 'Pita',
1537
+ 27 => 'Telimele',
1538
+ 28 => 'Tougue',
1539
+ 29 => 'Yomou',
1540
+ 30 => 'Coyah',
1541
+ 31 => 'Dubreka',
1542
+ 32 => 'Kankan',
1543
+ 33 => 'Koubia',
1544
+ 34 => 'Labe',
1545
+ 35 => 'Lelouma',
1546
+ 36 => 'Lola',
1547
+ 37 => 'Mandiana',
1548
+ 38 => 'Nzerekore',
1549
+ 39 => 'Siguiri',
1550
+ ),
1551
+ 'GQ' =>
1552
+ array (
1553
+ '03' => 'Annobon',
1554
+ '04' => 'Bioko Norte',
1555
+ '05' => 'Bioko Sur',
1556
+ '06' => 'Centro Sur',
1557
+ '07' => 'Kie-Ntem',
1558
+ '08' => 'Litoral',
1559
+ '09' => 'Wele-Nzas',
1560
+ ),
1561
+ 'GR' =>
1562
+ array (
1563
+ '01' => 'Evros',
1564
+ '02' => 'Rodhopi',
1565
+ '03' => 'Xanthi',
1566
+ '04' => 'Drama',
1567
+ '05' => 'Serrai',
1568
+ '06' => 'Kilkis',
1569
+ '07' => 'Pella',
1570
+ '08' => 'Florina',
1571
+ '09' => 'Kastoria',
1572
+ 10 => 'Grevena',
1573
+ 11 => 'Kozani',
1574
+ 12 => 'Imathia',
1575
+ 13 => 'Thessaloniki',
1576
+ 14 => 'Kavala',
1577
+ 15 => 'Khalkidhiki',
1578
+ 16 => 'Pieria',
1579
+ 17 => 'Ioannina',
1580
+ 18 => 'Thesprotia',
1581
+ 19 => 'Preveza',
1582
+ 20 => 'Arta',
1583
+ 21 => 'Larisa',
1584
+ 22 => 'Trikala',
1585
+ 23 => 'Kardhitsa',
1586
+ 24 => 'Magnisia',
1587
+ 25 => 'Kerkira',
1588
+ 26 => 'Levkas',
1589
+ 27 => 'Kefallinia',
1590
+ 28 => 'Zakinthos',
1591
+ 29 => 'Fthiotis',
1592
+ 30 => 'Evritania',
1593
+ 31 => 'Aitolia kai Akarnania',
1594
+ 32 => 'Fokis',
1595
+ 33 => 'Voiotia',
1596
+ 34 => 'Evvoia',
1597
+ 35 => 'Attiki',
1598
+ 36 => 'Argolis',
1599
+ 37 => 'Korinthia',
1600
+ 38 => 'Akhaia',
1601
+ 39 => 'Ilia',
1602
+ 40 => 'Messinia',
1603
+ 41 => 'Arkadhia',
1604
+ 42 => 'Lakonia',
1605
+ 43 => 'Khania',
1606
+ 44 => 'Rethimni',
1607
+ 45 => 'Iraklion',
1608
+ 46 => 'Lasithi',
1609
+ 47 => 'Dhodhekanisos',
1610
+ 48 => 'Samos',
1611
+ 49 => 'Kikladhes',
1612
+ 50 => 'Khios',
1613
+ 51 => 'Lesvos',
1614
+ ),
1615
+ 'GT' =>
1616
+ array (
1617
+ '01' => 'Alta Verapaz',
1618
+ '02' => 'Baja Verapaz',
1619
+ '03' => 'Chimaltenango',
1620
+ '04' => 'Chiquimula',
1621
+ '05' => 'El Progreso',
1622
+ '06' => 'Escuintla',
1623
+ '07' => 'Guatemala',
1624
+ '08' => 'Huehuetenango',
1625
+ '09' => 'Izabal',
1626
+ 10 => 'Jalapa',
1627
+ 11 => 'Jutiapa',
1628
+ 12 => 'Peten',
1629
+ 13 => 'Quetzaltenango',
1630
+ 14 => 'Quiche',
1631
+ 15 => 'Retalhuleu',
1632
+ 16 => 'Sacatepequez',
1633
+ 17 => 'San Marcos',
1634
+ 18 => 'Santa Rosa',
1635
+ 19 => 'Solola',
1636
+ 20 => 'Suchitepequez',
1637
+ 21 => 'Totonicapan',
1638
+ 22 => 'Zacapa',
1639
+ ),
1640
+ 'GW' =>
1641
+ array (
1642
+ '01' => 'Bafata',
1643
+ '02' => 'Quinara',
1644
+ '04' => 'Oio',
1645
+ '05' => 'Bolama',
1646
+ '06' => 'Cacheu',
1647
+ '07' => 'Tombali',
1648
+ 10 => 'Gabu',
1649
+ 11 => 'Bissau',
1650
+ 12 => 'Biombo',
1651
+ ),
1652
+ 'GY' =>
1653
+ array (
1654
+ 10 => 'Barima-Waini',
1655
+ 11 => 'Cuyuni-Mazaruni',
1656
+ 12 => 'Demerara-Mahaica',
1657
+ 13 => 'East Berbice-Corentyne',
1658
+ 14 => 'Essequibo Islands-West Demerara',
1659
+ 15 => 'Mahaica-Berbice',
1660
+ 16 => 'Pomeroon-Supenaam',
1661
+ 17 => 'Potaro-Siparuni',
1662
+ 18 => 'Upper Demerara-Berbice',
1663
+ 19 => 'Upper Takutu-Upper Essequibo',
1664
+ ),
1665
+ 'HN' =>
1666
+ array (
1667
+ '01' => 'Atlantida',
1668
+ '02' => 'Choluteca',
1669
+ '03' => 'Colon',
1670
+ '04' => 'Comayagua',
1671
+ '05' => 'Copan',
1672
+ '06' => 'Cortes',
1673
+ '07' => 'El Paraiso',
1674
+ '08' => 'Francisco Morazan',
1675
+ '09' => 'Gracias a Dios',
1676
+ 10 => 'Intibuca',
1677
+ 11 => 'Islas de la Bahia',
1678
+ 12 => 'La Paz',
1679
+ 13 => 'Lempira',
1680
+ 14 => 'Ocotepeque',
1681
+ 15 => 'Olancho',
1682
+ 16 => 'Santa Barbara',
1683
+ 17 => 'Valle',
1684
+ 18 => 'Yoro',
1685
+ ),
1686
+ 'HR' =>
1687
+ array (
1688
+ '01' => 'Bjelovarsko-Bilogorska',
1689
+ '02' => 'Brodsko-Posavska',
1690
+ '03' => 'Dubrovacko-Neretvanska',
1691
+ '04' => 'Istarska',
1692
+ '05' => 'Karlovacka',
1693
+ '06' => 'Koprivnicko-Krizevacka',
1694
+ '07' => 'Krapinsko-Zagorska',
1695
+ '08' => 'Licko-Senjska',
1696
+ '09' => 'Medimurska',
1697
+ 10 => 'Osjecko-Baranjska',
1698
+ 11 => 'Pozesko-Slavonska',
1699
+ 12 => 'Primorsko-Goranska',
1700
+ 13 => 'Sibensko-Kninska',
1701
+ 14 => 'Sisacko-Moslavacka',
1702
+ 15 => 'Splitsko-Dalmatinska',
1703
+ 16 => 'Varazdinska',
1704
+ 17 => 'Viroviticko-Podravska',
1705
+ 18 => 'Vukovarsko-Srijemska',
1706
+ 19 => 'Zadarska',
1707
+ 20 => 'Zagrebacka',
1708
+ 21 => 'Grad Zagreb',
1709
+ ),
1710
+ 'HT' =>
1711
+ array (
1712
+ '03' => 'Nord-Ouest',
1713
+ '06' => 'Artibonite',
1714
+ '07' => 'Centre',
1715
+ '09' => 'Nord',
1716
+ 10 => 'Nord-Est',
1717
+ 11 => 'Ouest',
1718
+ 12 => 'Sud',
1719
+ 13 => 'Sud-Est',
1720
+ 14 => 'Grand\' Anse',
1721
+ 15 => 'Nippes',
1722
+ ),
1723
+ 'HU' =>
1724
+ array (
1725
+ '01' => 'Bacs-Kiskun',
1726
+ '02' => 'Baranya',
1727
+ '03' => 'Bekes',
1728
+ '04' => 'Borsod-Abauj-Zemplen',
1729
+ '05' => 'Budapest',
1730
+ '06' => 'Csongrad',
1731
+ '07' => 'Debrecen',
1732
+ '08' => 'Fejer',
1733
+ '09' => 'Gyor-Moson-Sopron',
1734
+ 10 => 'Hajdu-Bihar',
1735
+ 11 => 'Heves',
1736
+ 12 => 'Komarom-Esztergom',
1737
+ 13 => 'Miskolc',
1738
+ 14 => 'Nograd',
1739
+ 15 => 'Pecs',
1740
+ 16 => 'Pest',
1741
+ 17 => 'Somogy',
1742
+ 18 => 'Szabolcs-Szatmar-Bereg',
1743
+ 19 => 'Szeged',
1744
+ 20 => 'Jasz-Nagykun-Szolnok',
1745
+ 21 => 'Tolna',
1746
+ 22 => 'Vas',
1747
+ 39 => 'Veszprem',
1748
+ 24 => 'Zala',
1749
+ 25 => 'Gyor',
1750
+ 26 => 'Bekescsaba',
1751
+ 27 => 'Dunaujvaros',
1752
+ 28 => 'Eger',
1753
+ 29 => 'Hodmezovasarhely',
1754
+ 30 => 'Kaposvar',
1755
+ 31 => 'Kecskemet',
1756
+ 32 => 'Nagykanizsa',
1757
+ 33 => 'Nyiregyhaza',
1758
+ 34 => 'Sopron',
1759
+ 35 => 'Szekesfehervar',
1760
+ 36 => 'Szolnok',
1761
+ 37 => 'Szombathely',
1762
+ 38 => 'Tatabanya',
1763
+ 40 => 'Zalaegerszeg',
1764
+ 41 => 'Salgotarjan',
1765
+ 42 => 'Szekszard',
1766
+ 43 => 'Erd',
1767
+ ),
1768
+ 'ID' =>
1769
+ array (
1770
+ '01' => 'Aceh',
1771
+ '02' => 'Bali',
1772
+ '03' => 'Bengkulu',
1773
+ '04' => 'Jakarta Raya',
1774
+ '05' => 'Jambi',
1775
+ '07' => 'Jawa Tengah',
1776
+ '08' => 'Jawa Timur',
1777
+ 10 => 'Yogyakarta',
1778
+ 11 => 'Kalimantan Barat',
1779
+ 12 => 'Kalimantan Selatan',
1780
+ 13 => 'Kalimantan Tengah',
1781
+ 14 => 'Kalimantan Timur',
1782
+ 15 => 'Lampung',
1783
+ 17 => 'Nusa Tenggara Barat',
1784
+ 18 => 'Nusa Tenggara Timur',
1785
+ 21 => 'Sulawesi Tengah',
1786
+ 22 => 'Sulawesi Tenggara',
1787
+ 24 => 'Sumatera Barat',
1788
+ 26 => 'Sumatera Utara',
1789
+ 28 => 'Maluku',
1790
+ 29 => 'Maluku Utara',
1791
+ 30 => 'Jawa Barat',
1792
+ 31 => 'Sulawesi Utara',
1793
+ 32 => 'Sumatera Selatan',
1794
+ 33 => 'Banten',
1795
+ 34 => 'Gorontalo',
1796
+ 35 => 'Kepulauan Bangka Belitung',
1797
+ 36 => 'Papua',
1798
+ 37 => 'Riau',
1799
+ 38 => 'Sulawesi Selatan',
1800
+ 39 => 'Irian Jaya Barat',
1801
+ 40 => 'Kepulauan Riau',
1802
+ 41 => 'Sulawesi Barat',
1803
+ ),
1804
+ 'IE' =>
1805
+ array (
1806
+ '01' => 'Carlow',
1807
+ '02' => 'Cavan',
1808
+ '03' => 'Clare',
1809
+ '04' => 'Cork',
1810
+ '06' => 'Donegal',
1811
+ '07' => 'Dublin',
1812
+ 10 => 'Galway',
1813
+ 11 => 'Kerry',
1814
+ 12 => 'Kildare',
1815
+ 13 => 'Kilkenny',
1816
+ 14 => 'Leitrim',
1817
+ 15 => 'Laois',
1818
+ 16 => 'Limerick',
1819
+ 18 => 'Longford',
1820
+ 19 => 'Louth',
1821
+ 20 => 'Mayo',
1822
+ 21 => 'Meath',
1823
+ 22 => 'Monaghan',
1824
+ 23 => 'Offaly',
1825
+ 24 => 'Roscommon',
1826
+ 25 => 'Sligo',
1827
+ 26 => 'Tipperary',
1828
+ 27 => 'Waterford',
1829
+ 29 => 'Westmeath',
1830
+ 30 => 'Wexford',
1831
+ 31 => 'Wicklow',
1832
+ ),
1833
+ 'IL' =>
1834
+ array (
1835
+ '01' => 'HaDarom',
1836
+ '02' => 'HaMerkaz',
1837
+ '03' => 'HaZafon',
1838
+ '04' => 'Hefa',
1839
+ '05' => 'Tel Aviv',
1840
+ '06' => 'Yerushalayim',
1841
+ ),
1842
+ 'IN' =>
1843
+ array (
1844
+ '01' => 'Andaman and Nicobar Islands',
1845
+ '02' => 'Andhra Pradesh',
1846
+ '03' => 'Assam',
1847
+ '05' => 'Chandigarh',
1848
+ '06' => 'Dadra and Nagar Haveli',
1849
+ '07' => 'Delhi',
1850
+ '09' => 'Gujarat',
1851
+ 10 => 'Haryana',
1852
+ 11 => 'Himachal Pradesh',
1853
+ 12 => 'Jammu and Kashmir',
1854
+ 13 => 'Kerala',
1855
+ 14 => 'Lakshadweep',
1856
+ 16 => 'Maharashtra',
1857
+ 17 => 'Manipur',
1858
+ 18 => 'Meghalaya',
1859
+ 19 => 'Karnataka',
1860
+ 20 => 'Nagaland',
1861
+ 21 => 'Orissa',
1862
+ 22 => 'Puducherry',
1863
+ 23 => 'Punjab',
1864
+ 24 => 'Rajasthan',
1865
+ 25 => 'Tamil Nadu',
1866
+ 26 => 'Tripura',
1867
+ 28 => 'West Bengal',
1868
+ 29 => 'Sikkim',
1869
+ 30 => 'Arunachal Pradesh',
1870
+ 31 => 'Mizoram',
1871
+ 32 => 'Daman and Diu',
1872
+ 33 => 'Goa',
1873
+ 34 => 'Bihar',
1874
+ 35 => 'Madhya Pradesh',
1875
+ 36 => 'Uttar Pradesh',
1876
+ 37 => 'Chhattisgarh',
1877
+ 38 => 'Jharkhand',
1878
+ 39 => 'Uttarakhand',
1879
+ ),
1880
+ 'IQ' =>
1881
+ array (
1882
+ '01' => 'Al Anbar',
1883
+ '02' => 'Al Basrah',
1884
+ '03' => 'Al Muthanna',
1885
+ '04' => 'Al Qadisiyah',
1886
+ '05' => 'As Sulaymaniyah',
1887
+ '06' => 'Babil',
1888
+ '07' => 'Baghdad',
1889
+ '08' => 'Dahuk',
1890
+ '09' => 'Dhi Qar',
1891
+ 10 => 'Diyala',
1892
+ 11 => 'Arbil',
1893
+ 12 => 'Karbala\'',
1894
+ 13 => 'At Ta\'mim',
1895
+ 14 => 'Maysan',
1896
+ 15 => 'Ninawa',
1897
+ 16 => 'Wasit',
1898
+ 17 => 'An Najaf',
1899
+ 18 => 'Salah ad Din',
1900
+ ),
1901
+ 'IR' =>
1902
+ array (
1903
+ '01' => 'Azarbayjan-e Bakhtari',
1904
+ '03' => 'Chahar Mahall va Bakhtiari',
1905
+ '04' => 'Sistan va Baluchestan',
1906
+ '05' => 'Kohkiluyeh va Buyer Ahmadi',
1907
+ '07' => 'Fars',
1908
+ '08' => 'Gilan',
1909
+ '09' => 'Hamadan',
1910
+ 10 => 'Ilam',
1911
+ 11 => 'Hormozgan',
1912
+ 29 => 'Kerman',
1913
+ 13 => 'Bakhtaran',
1914
+ 15 => 'Khuzestan',
1915
+ 16 => 'Kordestan',
1916
+ 35 => 'Mazandaran',
1917
+ 18 => 'Semnan Province',
1918
+ 34 => 'Markazi',
1919
+ 36 => 'Zanjan',
1920
+ 22 => 'Bushehr',
1921
+ 23 => 'Lorestan',
1922
+ 25 => 'Semnan',
1923
+ 26 => 'Tehran',
1924
+ 28 => 'Esfahan',
1925
+ 30 => 'Khorasan',
1926
+ 40 => 'Yazd',
1927
+ 32 => 'Ardabil',
1928
+ 33 => 'East Azarbaijan',
1929
+ 37 => 'Golestan',
1930
+ 38 => 'Qazvin',
1931
+ 39 => 'Qom',
1932
+ 41 => 'Khorasan-e Janubi',
1933
+ 42 => 'Khorasan-e Razavi',
1934
+ 43 => 'Khorasan-e Shemali',
1935
+ 44 => 'Alborz',
1936
+ ),
1937
+ 'IS' =>
1938
+ array (
1939
+ '03' => 'Arnessysla',
1940
+ '05' => 'Austur-Hunavatnssysla',
1941
+ '06' => 'Austur-Skaftafellssysla',
1942
+ '07' => 'Borgarfjardarsysla',
1943
+ '09' => 'Eyjafjardarsysla',
1944
+ 10 => 'Gullbringusysla',
1945
+ 15 => 'Kjosarsysla',
1946
+ 17 => 'Myrasysla',
1947
+ 20 => 'Nordur-Mulasysla',
1948
+ 21 => 'Nordur-Tingeyjarsysla',
1949
+ 23 => 'Rangarvallasysla',
1950
+ 28 => 'Skagafjardarsysla',
1951
+ 29 => 'Snafellsnes- og Hnappadalssysla',
1952
+ 30 => 'Strandasysla',
1953
+ 31 => 'Sudur-Mulasysla',
1954
+ 32 => 'Sudur-Tingeyjarsysla',
1955
+ 34 => 'Vestur-Bardastrandarsysla',
1956
+ 35 => 'Vestur-Hunavatnssysla',
1957
+ 36 => 'Vestur-Isafjardarsysla',
1958
+ 37 => 'Vestur-Skaftafellssysla',
1959
+ 38 => 'Austurland',
1960
+ 39 => 'Hofuoborgarsvaoio',
1961
+ 40 => 'Norourland Eystra',
1962
+ 41 => 'Norourland Vestra',
1963
+ 42 => 'Suourland',
1964
+ 43 => 'Suournes',
1965
+ 44 => 'Vestfiroir',
1966
+ 45 => 'Vesturland',
1967
+ ),
1968
+ 'IT' =>
1969
+ array (
1970
+ '01' => 'Abruzzi',
1971
+ '02' => 'Basilicata',
1972
+ '03' => 'Calabria',
1973
+ '04' => 'Campania',
1974
+ '05' => 'Emilia-Romagna',
1975
+ '06' => 'Friuli-Venezia Giulia',
1976
+ '07' => 'Lazio',
1977
+ '08' => 'Liguria',
1978
+ '09' => 'Lombardia',
1979
+ 10 => 'Marche',
1980
+ 11 => 'Molise',
1981
+ 12 => 'Piemonte',
1982
+ 13 => 'Puglia',
1983
+ 14 => 'Sardegna',
1984
+ 15 => 'Sicilia',
1985
+ 16 => 'Toscana',
1986
+ 17 => 'Trentino-Alto Adige',
1987
+ 18 => 'Umbria',
1988
+ 19 => 'Valle d\'Aosta',
1989
+ 20 => 'Veneto',
1990
+ ),
1991
+ 'JM' =>
1992
+ array (
1993
+ '01' => 'Clarendon',
1994
+ '02' => 'Hanover',
1995
+ '04' => 'Manchester',
1996
+ '07' => 'Portland',
1997
+ '08' => 'Saint Andrew',
1998
+ '09' => 'Saint Ann',
1999
+ 10 => 'Saint Catherine',
2000
+ 11 => 'Saint Elizabeth',
2001
+ 12 => 'Saint James',
2002
+ 13 => 'Saint Mary',
2003
+ 14 => 'Saint Thomas',
2004
+ 15 => 'Trelawny',
2005
+ 16 => 'Westmoreland',
2006
+ 17 => 'Kingston',
2007
+ ),
2008
+ 'JO' =>
2009
+ array (
2010
+ '02' => 'Al Balqa\'',
2011
+ '09' => 'Al Karak',
2012
+ 12 => 'At Tafilah',
2013
+ 15 => 'Al Mafraq',
2014
+ 16 => 'Amman',
2015
+ 17 => 'Az Zaraqa',
2016
+ 18 => 'Irbid',
2017
+ 19 => 'Ma\'an',
2018
+ 20 => 'Ajlun',
2019
+ 21 => 'Al Aqabah',
2020
+ 22 => 'Jarash',
2021
+ 23 => 'Madaba',
2022
+ ),
2023
+ 'JP' =>
2024
+ array (
2025
+ '01' => 'Aichi',
2026
+ '02' => 'Akita',
2027
+ '03' => 'Aomori',
2028
+ '04' => 'Chiba',
2029
+ '05' => 'Ehime',
2030
+ '06' => 'Fukui',
2031
+ '07' => 'Fukuoka',
2032
+ '08' => 'Fukushima',
2033
+ '09' => 'Gifu',
2034
+ 10 => 'Gumma',
2035
+ 11 => 'Hiroshima',
2036
+ 12 => 'Hokkaido',
2037
+ 13 => 'Hyogo',
2038
+ 14 => 'Ibaraki',
2039
+ 15 => 'Ishikawa',
2040
+ 16 => 'Iwate',
2041
+ 17 => 'Kagawa',
2042
+ 18 => 'Kagoshima',
2043
+ 19 => 'Kanagawa',
2044
+ 20 => 'Kochi',
2045
+ 21 => 'Kumamoto',
2046
+ 22 => 'Kyoto',
2047
+ 23 => 'Mie',
2048
+ 24 => 'Miyagi',
2049
+ 25 => 'Miyazaki',
2050
+ 26 => 'Nagano',
2051
+ 27 => 'Nagasaki',
2052
+ 28 => 'Nara',
2053
+ 29 => 'Niigata',
2054
+ 30 => 'Oita',
2055
+ 31 => 'Okayama',
2056
+ 32 => 'Osaka',
2057
+ 33 => 'Saga',
2058
+ 34 => 'Saitama',
2059
+ 35 => 'Shiga',
2060
+ 36 => 'Shimane',
2061
+ 37 => 'Shizuoka',
2062
+ 38 => 'Tochigi',
2063
+ 39 => 'Tokushima',
2064
+ 40 => 'Tokyo',
2065
+ 41 => 'Tottori',
2066
+ 42 => 'Toyama',
2067
+ 43 => 'Wakayama',
2068
+ 44 => 'Yamagata',
2069
+ 45 => 'Yamaguchi',
2070
+ 46 => 'Yamanashi',
2071
+ 47 => 'Okinawa',
2072
+ ),
2073
+ 'KE' =>
2074
+ array (
2075
+ '01' => 'Central',
2076
+ '02' => 'Coast',
2077
+ '03' => 'Eastern',
2078
+ '05' => 'Nairobi Area',
2079
+ '06' => 'North-Eastern',
2080
+ '07' => 'Nyanza',
2081
+ '08' => 'Rift Valley',
2082
+ '09' => 'Western',
2083
+ ),
2084
+ 'KG' =>
2085
+ array (
2086
+ '01' => 'Bishkek',
2087
+ '02' => 'Chuy',
2088
+ '03' => 'Jalal-Abad',
2089
+ '04' => 'Naryn',
2090
+ '08' => 'Osh',
2091
+ '06' => 'Talas',
2092
+ '07' => 'Ysyk-Kol',
2093
+ '09' => 'Batken',
2094
+ ),
2095
+ 'KH' =>
2096
+ array (
2097
+ 29 => 'Batdambang',
2098
+ '02' => 'Kampong Cham',
2099
+ '03' => 'Kampong Chhnang',
2100
+ '04' => 'Kampong Speu',
2101
+ '05' => 'Kampong Thum',
2102
+ '06' => 'Kampot',
2103
+ '07' => 'Kandal',
2104
+ '08' => 'Koh Kong',
2105
+ '09' => 'Kracheh',
2106
+ 10 => 'Mondulkiri',
2107
+ 22 => 'Phnum Penh',
2108
+ 12 => 'Pursat',
2109
+ 13 => 'Preah Vihear',
2110
+ 14 => 'Prey Veng',
2111
+ 15 => 'Ratanakiri Kiri',
2112
+ 16 => 'Siem Reap',
2113
+ 17 => 'Stung Treng',
2114
+ 18 => 'Svay Rieng',
2115
+ 19 => 'Takeo',
2116
+ 25 => 'Banteay Meanchey',
2117
+ 28 => 'Preah Seihanu',
2118
+ 30 => 'Pailin',
2119
+ ),
2120
+ 'KI' =>
2121
+ array (
2122
+ '01' => 'Gilbert Islands',
2123
+ '02' => 'Line Islands',
2124
+ '03' => 'Phoenix Islands',
2125
+ ),
2126
+ 'KM' =>
2127
+ array (
2128
+ '01' => 'Anjouan',
2129
+ '02' => 'Grande Comore',
2130
+ '03' => 'Moheli',
2131
+ ),
2132
+ 'KN' =>
2133
+ array (
2134
+ '01' => 'Christ Church Nichola Town',
2135
+ '02' => 'Saint Anne Sandy Point',
2136
+ '03' => 'Saint George Basseterre',
2137
+ '04' => 'Saint George Gingerland',
2138
+ '05' => 'Saint James Windward',
2139
+ '06' => 'Saint John Capisterre',
2140
+ '07' => 'Saint John Figtree',
2141
+ '08' => 'Saint Mary Cayon',
2142
+ '09' => 'Saint Paul Capisterre',
2143
+ 10 => 'Saint Paul Charlestown',
2144
+ 11 => 'Saint Peter Basseterre',
2145
+ 12 => 'Saint Thomas Lowland',
2146
+ 13 => 'Saint Thomas Middle Island',
2147
+ 15 => 'Trinity Palmetto Point',
2148
+ ),
2149
+ 'KP' =>
2150
+ array (
2151
+ '01' => 'Chagang-do',
2152
+ '03' => 'Hamgyong-namdo',
2153
+ '06' => 'Hwanghae-namdo',
2154
+ '07' => 'Hwanghae-bukto',
2155
+ '08' => 'Kaesong-si',
2156
+ '09' => 'Kangwon-do',
2157
+ 11 => 'P\'yongan-bukto',
2158
+ 12 => 'P\'yongyang-si',
2159
+ 13 => 'Yanggang-do',
2160
+ 14 => 'Namp\'o-si',
2161
+ 15 => 'P\'yongan-namdo',
2162
+ 17 => 'Hamgyong-bukto',
2163
+ 18 => 'Najin Sonbong-si',
2164
+ ),
2165
+ 'KR' =>
2166
+ array (
2167
+ '01' => 'Cheju-do',
2168
+ '03' => 'Cholla-bukto',
2169
+ '05' => 'Ch\'ungch\'ong-bukto',
2170
+ '06' => 'Kangwon-do',
2171
+ 10 => 'Pusan-jikhalsi',
2172
+ 11 => 'Seoul-t\'ukpyolsi',
2173
+ 12 => 'Inch\'on-jikhalsi',
2174
+ 13 => 'Kyonggi-do',
2175
+ 14 => 'Kyongsang-bukto',
2176
+ 15 => 'Taegu-jikhalsi',
2177
+ 16 => 'Cholla-namdo',
2178
+ 17 => 'Ch\'ungch\'ong-namdo',
2179
+ 18 => 'Kwangju-jikhalsi',
2180
+ 19 => 'Taejon-jikhalsi',
2181
+ 20 => 'Kyongsang-namdo',
2182
+ 21 => 'Ulsan-gwangyoksi',
2183
+ ),
2184
+ 'KW' =>
2185
+ array (
2186
+ '01' => 'Al Ahmadi',
2187
+ '02' => 'Al Kuwayt',
2188
+ '05' => 'Al Jahra',
2189
+ '07' => 'Al Farwaniyah',
2190
+ '08' => 'Hawalli',
2191
+ '09' => 'Mubarak al Kabir',
2192
+ ),
2193
+ 'KY' =>
2194
+ array (
2195
+ '01' => 'Creek',
2196
+ '02' => 'Eastern',
2197
+ '03' => 'Midland',
2198
+ '04' => 'South Town',
2199
+ '05' => 'Spot Bay',
2200
+ '06' => 'Stake Bay',
2201
+ '07' => 'West End',
2202
+ '08' => 'Western',
2203
+ ),
2204
+ 'KZ' =>
2205
+ array (
2206
+ '01' => 'Almaty',
2207
+ '02' => 'Almaty City',
2208
+ '03' => 'Aqmola',
2209
+ '04' => 'Aqtobe',
2210
+ '05' => 'Astana',
2211
+ '06' => 'Atyrau',
2212
+ '07' => 'West Kazakhstan',
2213
+ '08' => 'Bayqonyr',
2214
+ '09' => 'Mangghystau',
2215
+ 10 => 'South Kazakhstan',
2216
+ 11 => 'Pavlodar',
2217
+ 12 => 'Qaraghandy',
2218
+ 13 => 'Qostanay',
2219
+ 14 => 'Qyzylorda',
2220
+ 15 => 'East Kazakhstan',
2221
+ 16 => 'North Kazakhstan',
2222
+ 17 => 'Zhambyl',
2223
+ ),
2224
+ 'LA' =>
2225
+ array (
2226
+ '01' => 'Attapu',
2227
+ '02' => 'Champasak',
2228
+ '03' => 'Houaphan',
2229
+ '04' => 'Khammouan',
2230
+ '05' => 'Louang Namtha',
2231
+ '07' => 'Oudomxai',
2232
+ '08' => 'Phongsali',
2233
+ '09' => 'Saravan',
2234
+ 10 => 'Savannakhet',
2235
+ 11 => 'Vientiane',
2236
+ 13 => 'Xaignabouri',
2237
+ 14 => 'Xiangkhoang',
2238
+ 17 => 'Louangphrabang',
2239
+ ),
2240
+ 'LB' =>
2241
+ array (
2242
+ '08' => 'Beqaa',
2243
+ '02' => 'Al Janub',
2244
+ '09' => 'Liban-Nord',
2245
+ '04' => 'Beyrouth',
2246
+ '05' => 'Mont-Liban',
2247
+ '06' => 'Liban-Sud',
2248
+ '07' => 'Nabatiye',
2249
+ 10 => 'Aakk',
2250
+ 11 => 'Baalbek-Hermel',
2251
+ ),
2252
+ 'LC' =>
2253
+ array (
2254
+ '01' => 'Anse-la-Raye',
2255
+ '02' => 'Dauphin',
2256
+ '03' => 'Castries',
2257
+ '04' => 'Choiseul',
2258
+ '05' => 'Dennery',
2259
+ '06' => 'Gros-Islet',
2260
+ '07' => 'Laborie',
2261
+ '08' => 'Micoud',
2262
+ '09' => 'Soufriere',
2263
+ 10 => 'Vieux-Fort',
2264
+ 11 => 'Praslin',
2265
+ ),
2266
+ 'LI' =>
2267
+ array (
2268
+ '01' => 'Balzers',
2269
+ '02' => 'Eschen',
2270
+ '03' => 'Gamprin',
2271
+ '04' => 'Mauren',
2272
+ '05' => 'Planken',
2273
+ '06' => 'Ruggell',
2274
+ '07' => 'Schaan',
2275
+ '08' => 'Schellenberg',
2276
+ '09' => 'Triesen',
2277
+ 10 => 'Triesenberg',
2278
+ 11 => 'Vaduz',
2279
+ 21 => 'Gbarpolu',
2280
+ 22 => 'River Gee',
2281
+ ),
2282
+ 'LK' =>
2283
+ array (
2284
+ 29 => 'Central',
2285
+ 30 => 'North Central',
2286
+ 32 => 'North Western',
2287
+ 33 => 'Sabaragamuwa',
2288
+ 34 => 'Southern',
2289
+ 35 => 'Uva',
2290
+ 36 => 'Western',
2291
+ 37 => 'Eastern',
2292
+ 38 => 'Northern',
2293
+ ),
2294
+ 'LR' =>
2295
+ array (
2296
+ '01' => 'Bong',
2297
+ 12 => 'Grand Cape Mount',
2298
+ 20 => 'Lofa',
2299
+ 13 => 'Maryland',
2300
+ '07' => 'Monrovia',
2301
+ '09' => 'Nimba',
2302
+ 10 => 'Sino',
2303
+ 11 => 'Grand Bassa',
2304
+ 14 => 'Montserrado',
2305
+ 17 => 'Margibi',
2306
+ 18 => 'River Cess',
2307
+ 19 => 'Grand Gedeh',
2308
+ 21 => 'Gbarpolu',
2309
+ 22 => 'River Gee',
2310
+ ),
2311
+ 'LS' =>
2312
+ array (
2313
+ 10 => 'Berea',
2314
+ 11 => 'Butha-Buthe',
2315
+ 12 => 'Leribe',
2316
+ 13 => 'Mafeteng',
2317
+ 14 => 'Maseru',
2318
+ 15 => 'Mohales Hoek',
2319
+ 16 => 'Mokhotlong',
2320
+ 17 => 'Qachas Nek',
2321
+ 18 => 'Quthing',
2322
+ 19 => 'Thaba-Tseka',
2323
+ ),
2324
+ 'LT' =>
2325
+ array (
2326
+ 56 => 'Alytaus Apskritis',
2327
+ 57 => 'Kauno Apskritis',
2328
+ 58 => 'Klaipedos Apskritis',
2329
+ 59 => 'Marijampoles Apskritis',
2330
+ 60 => 'Panevezio Apskritis',
2331
+ 61 => 'Siauliu Apskritis',
2332
+ 62 => 'Taurages Apskritis',
2333
+ 63 => 'Telsiu Apskritis',
2334
+ 64 => 'Utenos Apskritis',
2335
+ 65 => 'Vilniaus Apskritis',
2336
+ ),
2337
+ 'LU' =>
2338
+ array (
2339
+ '01' => 'Diekirch',
2340
+ '02' => 'Grevenmacher',
2341
+ '03' => 'Luxembourg',
2342
+ ),
2343
+ 'LV' =>
2344
+ array (
2345
+ '01' => 'Aizkraukles',
2346
+ '02' => 'Aluksnes',
2347
+ '03' => 'Balvu',
2348
+ '04' => 'Bauskas',
2349
+ '05' => 'Cesu',
2350
+ '07' => 'Daugavpils',
2351
+ '08' => 'Dobeles',
2352
+ '09' => 'Gulbenes',
2353
+ 10 => 'Jekabpils',
2354
+ 11 => 'Jelgava',
2355
+ 12 => 'Jelgavas',
2356
+ 13 => 'Jurmala',
2357
+ 14 => 'Kraslavas',
2358
+ 15 => 'Kuldigas',
2359
+ 16 => 'Liepaja',
2360
+ 17 => 'Liepajas',
2361
+ 18 => 'Limbazu',
2362
+ 19 => 'Ludzas',
2363
+ 20 => 'Madonas',
2364
+ 21 => 'Ogres',
2365
+ 22 => 'Preilu',
2366
+ 23 => 'Rezekne',
2367
+ 24 => 'Rezeknes',
2368
+ 25 => 'Riga',
2369
+ 26 => 'Rigas',
2370
+ 27 => 'Saldus',
2371
+ 28 => 'Talsu',
2372
+ 29 => 'Tukuma',
2373
+ 30 => 'Valkas',
2374
+ 31 => 'Valmieras',
2375
+ 33 => 'Ventspils',
2376
+ ),
2377
+ 'LY' =>
2378
+ array (
2379
+ '03' => 'Al Aziziyah',
2380
+ '05' => 'Al Jufrah',
2381
+ '08' => 'Al Kufrah',
2382
+ 13 => 'Ash Shati\'',
2383
+ 30 => 'Murzuq',
2384
+ 34 => 'Sabha',
2385
+ 41 => 'Tarhunah',
2386
+ 42 => 'Tubruq',
2387
+ 45 => 'Zlitan',
2388
+ 47 => 'Ajdabiya',
2389
+ 48 => 'Al Fatih',
2390
+ 49 => 'Al Jabal al Akhdar',
2391
+ 50 => 'Al Khums',
2392
+ 51 => 'An Nuqat al Khams',
2393
+ 52 => 'Awbari',
2394
+ 53 => 'Az Zawiyah',
2395
+ 54 => 'Banghazi',
2396
+ 55 => 'Darnah',
2397
+ 56 => 'Ghadamis',
2398
+ 57 => 'Gharyan',
2399
+ 58 => 'Misratah',
2400
+ 59 => 'Sawfajjin',
2401
+ 60 => 'Surt',
2402
+ 61 => 'Tarabulus',
2403
+ 62 => 'Yafran',
2404
+ ),
2405
+ 'MA' =>
2406
+ array (
2407
+ 45 => 'Grand Casablanca',
2408
+ 46 => 'Fes-Boulemane',
2409
+ 47 => 'Marrakech-Tensift-Al Haouz',
2410
+ 48 => 'Meknes-Tafilalet',
2411
+ 49 => 'Rabat-Sale-Zemmour-Zaer',
2412
+ 50 => 'Chaouia-Ouardigha',
2413
+ 51 => 'Doukkala-Abda',
2414
+ 52 => 'Gharb-Chrarda-Beni Hssen',
2415
+ 53 => 'Guelmim-Es Smara',
2416
+ 54 => 'Oriental',
2417
+ 55 => 'Souss-Massa-Dr',
2418
+ 56 => 'Tadla-Azilal',
2419
+ 57 => 'Tanger-Tetouan',
2420
+ 58 => 'Taza-Al Hoceima-Taounate',
2421
+ 59 => 'La',
2422
+ ),
2423
+ 'MC' =>
2424
+ array (
2425
+ '01' => 'La Condamine',
2426
+ '02' => 'Monaco',
2427
+ '03' => 'Monte-Carlo',
2428
+ ),
2429
+ 'MD' =>
2430
+ array (
2431
+ 51 => 'Gagauzia',
2432
+ 57 => 'Chisinau',
2433
+ 58 => 'Stinga Nistrului',
2434
+ 59 => 'Anenii Noi',
2435
+ 60 => 'Balti',
2436
+ 61 => 'Basarabeasca',
2437
+ 62 => 'Bender',
2438
+ 63 => 'Briceni',
2439
+ 64 => 'Cahul',
2440
+ 65 => 'Cantemir',
2441
+ 66 => 'Calarasi',
2442
+ 67 => 'Causeni',
2443
+ 68 => 'Cimislia',
2444
+ 69 => 'Criuleni',
2445
+ 70 => 'Donduseni',
2446
+ 71 => 'Drochia',
2447
+ 72 => 'Dubasari',
2448
+ 73 => 'Edinet',
2449
+ 74 => 'Falesti',
2450
+ 75 => 'Floresti',
2451
+ 76 => 'Glodeni',
2452
+ 77 => 'Hincesti',
2453
+ 78 => 'Ialoveni',
2454
+ 79 => 'Leova',
2455
+ 80 => 'Nisporeni',
2456
+ 81 => 'Ocnita',
2457
+ 82 => 'Orhei',
2458
+ 83 => 'Rezina',
2459
+ 84 => 'Riscani',
2460
+ 85 => 'Singerei',
2461
+ 86 => 'Soldanesti',
2462
+ 87 => 'Soroca',
2463
+ 88 => 'Stefan-Voda',
2464
+ 89 => 'Straseni',
2465
+ 90 => 'Taraclia',
2466
+ 91 => 'Telenesti',
2467
+ 92 => 'Ungheni',
2468
+ ),
2469
+ 'MG' =>
2470
+ array (
2471
+ '01' => 'Antsiranana',
2472
+ '02' => 'Fianarantsoa',
2473
+ '03' => 'Mahajanga',
2474
+ '04' => 'Toamasina',
2475
+ '05' => 'Antananarivo',
2476
+ '06' => 'Toliara',
2477
+ ),
2478
+ 'MK' =>
2479
+ array (
2480
+ '01' => 'Aracinovo',
2481
+ '02' => 'Bac',
2482
+ '03' => 'Belcista',
2483
+ '04' => 'Berovo',
2484
+ '05' => 'Bistrica',
2485
+ '06' => 'Bitola',
2486
+ '07' => 'Blatec',
2487
+ '08' => 'Bogdanci',
2488
+ '09' => 'Bogomila',
2489
+ 10 => 'Bogovinje',
2490
+ 11 => 'Bosilovo',
2491
+ 12 => 'Brvenica',
2492
+ 'C8' => 'Cair',
2493
+ 14 => 'Capari',
2494
+ 'C9' => 'Caska',
2495
+ 16 => 'Cegrane',
2496
+ 17 => 'Centar',
2497
+ 18 => 'Centar Zupa',
2498
+ 19 => 'Cesinovo',
2499
+ 20 => 'Cucer-Sandevo',
2500
+ 'D2' => 'Debar',
2501
+ 22 => 'Delcevo',
2502
+ 23 => 'Delogozdi',
2503
+ 'D3' => 'Demir Hisar',
2504
+ 25 => 'Demir Kapija',
2505
+ 26 => 'Dobrusevo',
2506
+ 27 => 'Dolna Banjica',
2507
+ 28 => 'Dolneni',
2508
+ 29 => 'Dorce Petrov',
2509
+ 30 => 'Drugovo',
2510
+ 31 => 'Dzepciste',
2511
+ 32 => 'Gazi Baba',
2512
+ 33 => 'Gevgelija',
2513
+ 'D4' => 'Gostivar',
2514
+ 35 => 'Gradsko',
2515
+ 36 => 'Ilinden',
2516
+ 37 => 'Izvor',
2517
+ 38 => 'Jegunovce',
2518
+ 39 => 'Kamenjane',
2519
+ 40 => 'Karbinci',
2520
+ 41 => 'Karpos',
2521
+ 'D6' => 'Kavadarci',
2522
+ 43 => 'Kicevo',
2523
+ 44 => 'Kisela Voda',
2524
+ 45 => 'Klecevce',
2525
+ 46 => 'Kocani',
2526
+ 47 => 'Konce',
2527
+ 48 => 'Kondovo',
2528
+ 49 => 'Konopiste',
2529
+ 50 => 'Kosel',
2530
+ 51 => 'Kratovo',
2531
+ 52 => 'Kriva Palanka',
2532
+ 53 => 'Krivogastani',
2533
+ 54 => 'Krusevo',
2534
+ 55 => 'Kuklis',
2535
+ 56 => 'Kukurecani',
2536
+ 'D7' => 'Kumanovo',
2537
+ 58 => 'Labunista',
2538
+ 59 => 'Lipkovo',
2539
+ 60 => 'Lozovo',
2540
+ 61 => 'Lukovo',
2541
+ 62 => 'Makedonska Kamenica',
2542
+ 'D8' => 'Makedonski Brod',
2543
+ 64 => 'Mavrovi Anovi',
2544
+ 65 => 'Meseista',
2545
+ 66 => 'Miravci',
2546
+ 67 => 'Mogila',
2547
+ 68 => 'Murtino',
2548
+ 69 => 'Negotino',
2549
+ 70 => 'Negotino-Polosko',
2550
+ 71 => 'Novaci',
2551
+ 72 => 'Novo Selo',
2552
+ 73 => 'Oblesevo',
2553
+ 'E2' => 'Ohrid',
2554
+ 75 => 'Orasac',
2555
+ 76 => 'Orizari',
2556
+ 77 => 'Oslomej',
2557
+ 78 => 'Pehcevo',
2558
+ 79 => 'Petrovec',
2559
+ 80 => 'Plasnica',
2560
+ 81 => 'Podares',
2561
+ 'E3' => 'Prilep',
2562
+ 83 => 'Probistip',
2563
+ 84 => 'Radovis',
2564
+ 85 => 'Rankovce',
2565
+ 86 => 'Resen',
2566
+ 87 => 'Rosoman',
2567
+ 88 => 'Rostusa',
2568
+ 89 => 'Samokov',
2569
+ 90 => 'Saraj',
2570
+ 91 => 'Sipkovica',
2571
+ 92 => 'Sopiste',
2572
+ 93 => 'Sopotnica',
2573
+ 94 => 'Srbinovo',
2574
+ 95 => 'Staravina',
2575
+ 96 => 'Star Dojran',
2576
+ 97 => 'Staro Nagoricane',
2577
+ 98 => 'Stip',
2578
+ 'E6' => 'Struga',
2579
+ 'E7' => 'Strumica',
2580
+ 'A2' => 'Studenicani',
2581
+ 'A3' => 'Suto Orizari',
2582
+ 'A4' => 'Sveti Nikole',
2583
+ 'A5' => 'Tearce',
2584
+ 'E8' => 'Tetovo',
2585
+ 'A7' => 'Topolcani',
2586
+ 'E9' => 'Valandovo',
2587
+ 'A9' => 'Vasilevo',
2588
+ 'F1' => 'Veles',
2589
+ 'B2' => 'Velesta',
2590
+ 'B3' => 'Vevcani',
2591
+ 'B4' => 'Vinica',
2592
+ 'B5' => 'Vitoliste',
2593
+ 'B6' => 'Vranestica',
2594
+ 'B7' => 'Vrapciste',
2595
+ 'B8' => 'Vratnica',
2596
+ 'B9' => 'Vrutok',
2597
+ 'C1' => 'Zajas',
2598
+ 'C2' => 'Zelenikovo',
2599
+ 'C3' => 'Zelino',
2600
+ 'C4' => 'Zitose',
2601
+ 'C5' => 'Zletovo',
2602
+ 'C6' => 'Zrnovci',
2603
+ 'E5' => 'Dojran',
2604
+ 'F2' => 'Aerodrom',
2605
+ ),
2606
+ 'ML' =>
2607
+ array (
2608
+ '01' => 'Bamako',
2609
+ '03' => 'Kayes',
2610
+ '04' => 'Mopti',
2611
+ '05' => 'Segou',
2612
+ '06' => 'Sikasso',
2613
+ '07' => 'Koulikoro',
2614
+ '08' => 'Tombouctou',
2615
+ '09' => 'Gao',
2616
+ 10 => 'Kidal',
2617
+ ),
2618
+ 'MM' =>
2619
+ array (
2620
+ '01' => 'Rakhine State',
2621
+ '02' => 'Chin State',
2622
+ '03' => 'Irrawaddy',
2623
+ '04' => 'Kachin State',
2624
+ '05' => 'Karan State',
2625
+ '06' => 'Kayah State',
2626
+ '07' => 'Magwe',
2627
+ '08' => 'Mandalay',
2628
+ '09' => 'Pegu',
2629
+ 10 => 'Sagaing',
2630
+ 11 => 'Shan State',
2631
+ 12 => 'Tenasserim',
2632
+ 13 => 'Mon State',
2633
+ 14 => 'Rangoon',
2634
+ 17 => 'Yangon',
2635
+ ),
2636
+ 'MN' =>
2637
+ array (
2638
+ '01' => 'Arhangay',
2639
+ '02' => 'Bayanhongor',
2640
+ '03' => 'Bayan-Olgiy',
2641
+ '05' => 'Darhan',
2642
+ '06' => 'Dornod',
2643
+ '07' => 'Dornogovi',
2644
+ '08' => 'Dundgovi',
2645
+ '09' => 'Dzavhan',
2646
+ 10 => 'Govi-Altay',
2647
+ 11 => 'Hentiy',
2648
+ 12 => 'Hovd',
2649
+ 13 => 'Hovsgol',
2650
+ 14 => 'Omnogovi',
2651
+ 15 => 'Ovorhangay',
2652
+ 16 => 'Selenge',
2653
+ 17 => 'Suhbaatar',
2654
+ 18 => 'Tov',
2655
+ 19 => 'Uvs',
2656
+ 20 => 'Ulaanbaatar',
2657
+ 21 => 'Bulgan',
2658
+ 22 => 'Erdenet',
2659
+ 23 => 'Darhan-Uul',
2660
+ 24 => 'Govisumber',
2661
+ 25 => 'Orhon',
2662
+ ),
2663
+ 'MO' =>
2664
+ array (
2665
+ '01' => 'Ilhas',
2666
+ '02' => 'Macau',
2667
+ ),
2668
+ 'MR' =>
2669
+ array (
2670
+ '01' => 'Hodh Ech Chargui',
2671
+ '02' => 'Hodh El Gharbi',
2672
+ '03' => 'Assaba',
2673
+ '04' => 'Gorgol',
2674
+ '05' => 'Brakna',
2675
+ '06' => 'Trarza',
2676
+ '07' => 'Adrar',
2677
+ '08' => 'Dakhlet Nouadhibou',
2678
+ '09' => 'Tagant',
2679
+ 10 => 'Guidimaka',
2680
+ 11 => 'Tiris Zemmour',
2681
+ 12 => 'Inchiri',
2682
+ ),
2683
+ 'MS' =>
2684
+ array (
2685
+ '01' => 'Saint Anthony',
2686
+ '02' => 'Saint Georges',
2687
+ '03' => 'Saint Peter',
2688
+ ),
2689
+ 'MU' =>
2690
+ array (
2691
+ 12 => 'Black River',
2692
+ 13 => 'Flacq',
2693
+ 14 => 'Grand Port',
2694
+ 15 => 'Moka',
2695
+ 16 => 'Pamplemousses',
2696
+ 17 => 'Plaines Wilhems',
2697
+ 18 => 'Port Louis',
2698
+ 19 => 'Riviere du Rempart',
2699
+ 20 => 'Savanne',
2700
+ 21 => 'Agalega Islands',
2701
+ 22 => 'Cargados Carajos',
2702
+ 23 => 'Rodrigues',
2703
+ ),
2704
+ 'MV' =>
2705
+ array (
2706
+ '01' => 'Seenu',
2707
+ '05' => 'Laamu',
2708
+ 30 => 'Alifu',
2709
+ 31 => 'Baa',
2710
+ 32 => 'Dhaalu',
2711
+ 33 => 'Faafu',
2712
+ 34 => 'Gaafu Alifu',
2713
+ 35 => 'Gaafu Dhaalu',
2714
+ 36 => 'Haa Alifu',
2715
+ 37 => 'Haa Dhaalu',
2716
+ 38 => 'Kaafu',
2717
+ 39 => 'Lhaviyani',
2718
+ 40 => 'Maale',
2719
+ 41 => 'Meemu',
2720
+ 42 => 'Gnaviyani',
2721
+ 43 => 'Noonu',
2722
+ 44 => 'Raa',
2723
+ 45 => 'Shaviyani',
2724
+ 46 => 'Thaa',
2725
+ 47 => 'Vaavu',
2726
+ ),
2727
+ 'MW' =>
2728
+ array (
2729
+ '02' => 'Chikwawa',
2730
+ '03' => 'Chiradzulu',
2731
+ '04' => 'Chitipa',
2732
+ '05' => 'Thyolo',
2733
+ '06' => 'Dedza',
2734
+ '07' => 'Dowa',
2735
+ '08' => 'Karonga',
2736
+ '09' => 'Kasungu',
2737
+ 11 => 'Lilongwe',
2738
+ 12 => 'Mangochi',
2739
+ 13 => 'Mchinji',
2740
+ 15 => 'Mzimba',
2741
+ 16 => 'Ntcheu',
2742
+ 17 => 'Nkhata Bay',
2743
+ 18 => 'Nkhotakota',
2744
+ 19 => 'Nsanje',
2745
+ 20 => 'Ntchisi',
2746
+ 21 => 'Rumphi',
2747
+ 22 => 'Salima',
2748
+ 23 => 'Zomba',
2749
+ 24 => 'Blantyre',
2750
+ 25 => 'Mwanza',
2751
+ 26 => 'Balaka',
2752
+ 27 => 'Likoma',
2753
+ 28 => 'Machinga',
2754
+ 29 => 'Mulanje',
2755
+ 30 => 'Phalombe',
2756
+ ),
2757
+ 'MX' =>
2758
+ array (
2759
+ '01' => 'Aguascalientes',
2760
+ '02' => 'Baja California',
2761
+ '03' => 'Baja California Sur',
2762
+ '04' => 'Campeche',
2763
+ '05' => 'Chiapas',
2764
+ '06' => 'Chihuahua',
2765
+ '07' => 'Coahuila de Zaragoza',
2766
+ '08' => 'Colima',
2767
+ '09' => 'Distrito Federal',
2768
+ 10 => 'Durango',
2769
+ 11 => 'Guanajuato',
2770
+ 12 => 'Guerrero',
2771
+ 13 => 'Hidalgo',
2772
+ 14 => 'Jalisco',
2773
+ 15 => 'Mexico',
2774
+ 16 => 'Michoacan de Ocampo',
2775
+ 17 => 'Morelos',
2776
+ 18 => 'Nayarit',
2777
+ 19 => 'Nuevo Leon',
2778
+ 20 => 'Oaxaca',
2779
+ 21 => 'Puebla',
2780
+ 22 => 'Queretaro de Arteaga',
2781
+ 23 => 'Quintana Roo',
2782
+ 24 => 'San Luis Potosi',
2783
+ 25 => 'Sinaloa',
2784
+ 26 => 'Sonora',
2785
+ 27 => 'Tabasco',
2786
+ 28 => 'Tamaulipas',
2787
+ 29 => 'Tlaxcala',
2788
+ 30 => 'Veracruz-Llave',
2789
+ 31 => 'Yucatan',
2790
+ 32 => 'Zacatecas',
2791
+ ),
2792
+ 'MY' =>
2793
+ array (
2794
+ '01' => 'Johor',
2795
+ '02' => 'Kedah',
2796
+ '03' => 'Kelantan',
2797
+ '04' => 'Melaka',
2798
+ '05' => 'Negeri Sembilan',
2799
+ '06' => 'Pahang',
2800
+ '07' => 'Perak',
2801
+ '08' => 'Perlis',
2802
+ '09' => 'Pulau Pinang',
2803
+ 11 => 'Sarawak',
2804
+ 12 => 'Selangor',
2805
+ 13 => 'Terengganu',
2806
+ 14 => 'Kuala Lumpur',
2807
+ 15 => 'Labuan',
2808
+ 16 => 'Sabah',
2809
+ 17 => 'Putrajaya',
2810
+ ),
2811
+ 'MZ' =>
2812
+ array (
2813
+ '01' => 'Cabo Delgado',
2814
+ '02' => 'Gaza',
2815
+ '03' => 'Inhambane',
2816
+ 11 => 'Maputo',
2817
+ '05' => 'Sofala',
2818
+ '06' => 'Nampula',
2819
+ '07' => 'Niassa',
2820
+ '08' => 'Tete',
2821
+ '09' => 'Zambezia',
2822
+ 10 => 'Manica',
2823
+ ),
2824
+ 'NA' =>
2825
+ array (
2826
+ '01' => 'Bethanien',
2827
+ '02' => 'Caprivi Oos',
2828
+ '03' => 'Boesmanland',
2829
+ '04' => 'Gobabis',
2830
+ '05' => 'Grootfontein',
2831
+ '06' => 'Kaokoland',
2832
+ '07' => 'Karibib',
2833
+ '08' => 'Keetmanshoop',
2834
+ '09' => 'Luderitz',
2835
+ 10 => 'Maltahohe',
2836
+ 11 => 'Okahandja',
2837
+ 12 => 'Omaruru',
2838
+ 13 => 'Otjiwarongo',
2839
+ 14 => 'Outjo',
2840
+ 15 => 'Owambo',
2841
+ 16 => 'Rehoboth',
2842
+ 17 => 'Swakopmund',
2843
+ 18 => 'Tsumeb',
2844
+ 20 => 'Karasburg',
2845
+ 21 => 'Windhoek',
2846
+ 22 => 'Damaraland',
2847
+ 23 => 'Hereroland Oos',
2848
+ 24 => 'Hereroland Wes',
2849
+ 25 => 'Kavango',
2850
+ 26 => 'Mariental',
2851
+ 27 => 'Namaland',
2852
+ 28 => 'Caprivi',
2853
+ 29 => 'Erongo',
2854
+ 30 => 'Hardap',
2855
+ 31 => 'Karas',
2856
+ 32 => 'Kunene',
2857
+ 33 => 'Ohangwena',
2858
+ 34 => 'Okavango',
2859
+ 35 => 'Omaheke',
2860
+ 36 => 'Omusati',
2861
+ 37 => 'Oshana',
2862
+ 38 => 'Oshikoto',
2863
+ 39 => 'Otjozondjupa',
2864
+ ),
2865
+ 'NE' =>
2866
+ array (
2867
+ '01' => 'Agadez',
2868
+ '02' => 'Diffa',
2869
+ '03' => 'Dosso',
2870
+ '04' => 'Maradi',
2871
+ '08' => 'Niamey',
2872
+ '06' => 'Tahoua',
2873
+ '07' => 'Zinder',
2874
+ ),
2875
+ 'NG' =>
2876
+ array (
2877
+ '05' => 'Lagos',
2878
+ 11 => 'Federal Capital Territory',
2879
+ 16 => 'Ogun',
2880
+ 21 => 'Akwa Ibom',
2881
+ 22 => 'Cross River',
2882
+ 23 => 'Kaduna',
2883
+ 24 => 'Katsina',
2884
+ 25 => 'Anambra',
2885
+ 26 => 'Benue',
2886
+ 27 => 'Borno',
2887
+ 28 => 'Imo',
2888
+ 29 => 'Kano',
2889
+ 30 => 'Kwara',
2890
+ 31 => 'Niger',
2891
+ 32 => 'Oyo',
2892
+ 35 => 'Adamawa',
2893
+ 36 => 'Delta',
2894
+ 37 => 'Edo',
2895
+ 39 => 'Jigawa',
2896
+ 40 => 'Kebbi',
2897
+ 41 => 'Kogi',
2898
+ 42 => 'Osun',
2899
+ 43 => 'Taraba',
2900
+ 44 => 'Yobe',
2901
+ 45 => 'Abia',
2902
+ 46 => 'Bauchi',
2903
+ 47 => 'Enugu',
2904
+ 48 => 'Ondo',
2905
+ 49 => 'Plateau',
2906
+ 50 => 'Rivers',
2907
+ 51 => 'Sokoto',
2908
+ 52 => 'Bayelsa',
2909
+ 53 => 'Ebonyi',
2910
+ 54 => 'Ekiti',
2911
+ 55 => 'Gombe',
2912
+ 56 => 'Nassarawa',
2913
+ 57 => 'Zamfara',
2914
+ ),
2915
+ 'NI' =>
2916
+ array (
2917
+ '01' => 'Boaco',
2918
+ '02' => 'Carazo',
2919
+ '03' => 'Chinandega',
2920
+ '04' => 'Chontales',
2921
+ '05' => 'Esteli',
2922
+ '06' => 'Granada',
2923
+ '07' => 'Jinotega',
2924
+ '08' => 'Leon',
2925
+ '09' => 'Madriz',
2926
+ 10 => 'Managua',
2927
+ 11 => 'Masaya',
2928
+ 12 => 'Matagalpa',
2929
+ 13 => 'Nueva Segovia',
2930
+ 14 => 'Rio San Juan',
2931
+ 15 => 'Rivas',
2932
+ 16 => 'Zelaya',
2933
+ 17 => 'Autonoma Atlantico Norte',
2934
+ 18 => 'Region Autonoma Atlantico Sur',
2935
+ ),
2936
+ 'NL' =>
2937
+ array (
2938
+ '01' => 'Drenthe',
2939
+ '02' => 'Friesland',
2940
+ '03' => 'Gelderland',
2941
+ '04' => 'Groningen',
2942
+ '05' => 'Limburg',
2943
+ '06' => 'Noord-Brabant',
2944
+ '07' => 'Noord-Holland',
2945
+ '09' => 'Utrecht',
2946
+ 10 => 'Zeeland',
2947
+ 11 => 'Zuid-Holland',
2948
+ 15 => 'Overijssel',
2949
+ 16 => 'Flevoland',
2950
+ ),
2951
+ 'NO' =>
2952
+ array (
2953
+ '01' => 'Akershus',
2954
+ '02' => 'Aust-Agder',
2955
+ '04' => 'Buskerud',
2956
+ '05' => 'Finnmark',
2957
+ '06' => 'Hedmark',
2958
+ '07' => 'Hordaland',
2959
+ '08' => 'More og Romsdal',
2960
+ '09' => 'Nordland',
2961
+ 10 => 'Nord-Trondelag',
2962
+ 11 => 'Oppland',
2963
+ 12 => 'Oslo',
2964
+ 13 => 'Ostfold',
2965
+ 14 => 'Rogaland',
2966
+ 15 => 'Sogn og Fjordane',
2967
+ 16 => 'Sor-Trondelag',
2968
+ 17 => 'Telemark',
2969
+ 18 => 'Troms',
2970
+ 19 => 'Vest-Agder',
2971
+ 20 => 'Vestfold',
2972
+ ),
2973
+ 'NP' =>
2974
+ array (
2975
+ '01' => 'Bagmati',
2976
+ '02' => 'Bheri',
2977
+ '03' => 'Dhawalagiri',
2978
+ '04' => 'Gandaki',
2979
+ '05' => 'Janakpur',
2980
+ '06' => 'Karnali',
2981
+ '07' => 'Kosi',
2982
+ '08' => 'Lumbini',
2983
+ '09' => 'Mahakali',
2984
+ 10 => 'Mechi',
2985
+ 11 => 'Narayani',
2986
+ 12 => 'Rapti',
2987
+ 13 => 'Sagarmatha',
2988
+ 14 => 'Seti',
2989
+ ),
2990
+ 'NR' =>
2991
+ array (
2992
+ '01' => 'Aiwo',
2993
+ '02' => 'Anabar',
2994
+ '03' => 'Anetan',
2995
+ '04' => 'Anibare',
2996
+ '05' => 'Baiti',
2997
+ '06' => 'Boe',
2998
+ '07' => 'Buada',
2999
+ '08' => 'Denigomodu',
3000
+ '09' => 'Ewa',
3001
+ 10 => 'Ijuw',
3002
+ 11 => 'Meneng',
3003
+ 12 => 'Nibok',
3004
+ 13 => 'Uaboe',
3005
+ 14 => 'Yaren',
3006
+ ),
3007
+ 'NZ' =>
3008
+ array (
3009
+ 10 => 'Chatham Islands',
3010
+ 'E7' => 'Auckland',
3011
+ 'E8' => 'Bay of Plenty',
3012
+ 'E9' => 'Canterbury',
3013
+ 'F1' => 'Gisborne',
3014
+ 'F2' => 'Hawke\'s Bay',
3015
+ 'F3' => 'Manawatu-Wanganui',
3016
+ 'F4' => 'Marlborough',
3017
+ 'F5' => 'Nelson',
3018
+ 'F6' => 'Northland',
3019
+ 'F7' => 'Otago',
3020
+ 'F8' => 'Southland',
3021
+ 'F9' => 'Taranaki',
3022
+ 'G1' => 'Waikato',
3023
+ 'G2' => 'Wellington',
3024
+ 'G3' => 'West Coast',
3025
+ ),
3026
+ 'OM' =>
3027
+ array (
3028
+ '01' => 'Ad Dakhiliyah',
3029
+ '02' => 'Al Batinah',
3030
+ '03' => 'Al Wusta',
3031
+ '04' => 'Ash Sharqiyah',
3032
+ '05' => 'Az Zahirah',
3033
+ '06' => 'Masqat',
3034
+ '07' => 'Musandam',
3035
+ '08' => 'Zufar',
3036
+ ),
3037
+ 'PA' =>
3038
+ array (
3039
+ '01' => 'Bocas del Toro',
3040
+ '02' => 'Chiriqui',
3041
+ '03' => 'Cocle',
3042
+ '04' => 'Colon',
3043
+ '05' => 'Darien',
3044
+ '06' => 'Herrera',
3045
+ '07' => 'Los Santos',
3046
+ '08' => 'Panama',
3047
+ '09' => 'San Blas',
3048
+ 10 => 'Veraguas',
3049
+ ),
3050
+ 'PE' =>
3051
+ array (
3052
+ '01' => 'Amazonas',
3053
+ '02' => 'Ancash',
3054
+ '03' => 'Apurimac',
3055
+ '04' => 'Arequipa',
3056
+ '05' => 'Ayacucho',
3057
+ '06' => 'Cajamarca',
3058
+ '07' => 'Callao',
3059
+ '08' => 'Cusco',
3060
+ '09' => 'Huancavelica',
3061
+ 10 => 'Huanuco',
3062
+ 11 => 'Ica',
3063
+ 12 => 'Junin',
3064
+ 13 => 'La Libertad',
3065
+ 14 => 'Lambayeque',
3066
+ 15 => 'Lima',
3067
+ 16 => 'Loreto',
3068
+ 17 => 'Madre de Dios',
3069
+ 18 => 'Moquegua',
3070
+ 19 => 'Pasco',
3071
+ 20 => 'Piura',
3072
+ 21 => 'Puno',
3073
+ 22 => 'San Martin',
3074
+ 23 => 'Tacna',
3075
+ 24 => 'Tumbes',
3076
+ 25 => 'Ucayali',
3077
+ ),
3078
+ 'PG' =>
3079
+ array (
3080
+ '01' => 'Central',
3081
+ '02' => 'Gulf',
3082
+ '03' => 'Milne Bay',
3083
+ '04' => 'Northern',
3084
+ '05' => 'Southern Highlands',
3085
+ '06' => 'Western',
3086
+ '07' => 'North Solomons',
3087
+ '08' => 'Chimbu',
3088
+ '09' => 'Eastern Highlands',
3089
+ 10 => 'East New Britain',
3090
+ 11 => 'East Sepik',
3091
+ 12 => 'Madang',
3092
+ 13 => 'Manus',
3093
+ 14 => 'Morobe',
3094
+ 15 => 'New Ireland',
3095
+ 16 => 'Western Highlands',
3096
+ 17 => 'West New Britain',
3097
+ 18 => 'Sandaun',
3098
+ 19 => 'Enga',
3099
+ 20 => 'National Capital',
3100
+ ),
3101
+ 'PH' =>
3102
+ array (
3103
+ '01' => 'Abra',
3104
+ '02' => 'Agusan del Norte',
3105
+ '03' => 'Agusan del Sur',
3106
+ '04' => 'Aklan',
3107
+ '05' => 'Albay',
3108
+ '06' => 'Antique',
3109
+ '07' => 'Bataan',
3110
+ '08' => 'Batanes',
3111
+ '09' => 'Batangas',
3112
+ 10 => 'Benguet',
3113
+ 11 => 'Bohol',
3114
+ 12 => 'Bukidnon',
3115
+ 13 => 'Bulacan',
3116
+ 14 => 'Cagayan',
3117
+ 15 => 'Camarines Norte',
3118
+ 16 => 'Camarines Sur',
3119
+ 17 => 'Camiguin',
3120
+ 18 => 'Capiz',
3121
+ 19 => 'Catanduanes',
3122
+ 20 => 'Cavite',
3123
+ 21 => 'Cebu',
3124
+ 22 => 'Basilan',
3125
+ 23 => 'Eastern Samar',
3126
+ 24 => 'Davao',
3127
+ 25 => 'Davao del Sur',
3128
+ 26 => 'Davao Oriental',
3129
+ 27 => 'Ifugao',
3130
+ 28 => 'Ilocos Norte',
3131
+ 29 => 'Ilocos Sur',
3132
+ 30 => 'Iloilo',
3133
+ 31 => 'Isabela',
3134
+ 32 => 'Kalinga-Apayao',
3135
+ 33 => 'Laguna',
3136
+ 34 => 'Lanao del Norte',
3137
+ 35 => 'Lanao del Sur',
3138
+ 36 => 'La Union',
3139
+ 37 => 'Leyte',
3140
+ 38 => 'Marinduque',
3141
+ 39 => 'Masbate',
3142
+ 40 => 'Mindoro Occidental',
3143
+ 41 => 'Mindoro Oriental',
3144
+ 42 => 'Misamis Occidental',
3145
+ 43 => 'Misamis Oriental',
3146
+ 44 => 'Mountain',
3147
+ 'H3' => 'Negros Occidental',
3148
+ 46 => 'Negros Oriental',
3149
+ 47 => 'Nueva Ecija',
3150
+ 48 => 'Nueva Vizcaya',
3151
+ 49 => 'Palawan',
3152
+ 50 => 'Pampanga',
3153
+ 51 => 'Pangasinan',
3154
+ 53 => 'Rizal',
3155
+ 54 => 'Romblon',
3156
+ 55 => 'Samar',
3157
+ 56 => 'Maguindanao',
3158
+ 57 => 'North Cotabato',
3159
+ 58 => 'Sorsogon',
3160
+ 59 => 'Southern Leyte',
3161
+ 60 => 'Sulu',
3162
+ 'N3' => 'Surigao del Norte',
3163
+ 62 => 'Surigao del Sur',
3164
+ 63 => 'Tarlac',
3165
+ 'P1' => 'Zambales',
3166
+ 65 => 'Zamboanga del Norte',
3167
+ 66 => 'Zamboanga del Sur',
3168
+ 67 => 'Northern Samar',
3169
+ 68 => 'Quirino',
3170
+ 69 => 'Siquijor',
3171
+ 70 => 'South Cotabato',
3172
+ 71 => 'Sultan Kudarat',
3173
+ 72 => 'Tawitawi',
3174
+ 'A1' => 'Angeles',
3175
+ 'A2' => 'Bacolod',
3176
+ 'A3' => 'Bago',
3177
+ 'A4' => 'Baguio',
3178
+ 'A5' => 'Bais',
3179
+ 'A6' => 'Basilan City',
3180
+ 'A7' => 'Batangas City',
3181
+ 'A8' => 'Butuan',
3182
+ 'A9' => 'Cabanatuan',
3183
+ 'B1' => 'Cadiz',
3184
+ 'B2' => 'Cagayan de Oro',
3185
+ 'B3' => 'Calbayog',
3186
+ 'B4' => 'Caloocan',
3187
+ 'B5' => 'Canlaon',
3188
+ 'B6' => 'Cavite City',
3189
+ 'B7' => 'Cebu City',
3190
+ 'B8' => 'Cotabato',
3191
+ 'B9' => 'Dagupan',
3192
+ 'C1' => 'Danao',
3193
+ 'C2' => 'Dapitan',
3194
+ 'C3' => 'Davao City',
3195
+ 'C4' => 'Dipolog',
3196
+ 'C5' => 'Dumaguete',
3197
+ 'C6' => 'General Santos',
3198
+ 'C7' => 'Gingoog',
3199
+ 'C8' => 'Iligan',
3200
+ 'C9' => 'Iloilo City',
3201
+ 'D1' => 'Iriga',
3202
+ 'D2' => 'La Carlota',
3203
+ 'D3' => 'Laoag',
3204
+ 'D4' => 'Lapu-Lapu',
3205
+ 'D5' => 'Legaspi',
3206
+ 'D6' => 'Lipa',
3207
+ 'D7' => 'Lucena',
3208
+ 'D8' => 'Mandaue',
3209
+ 'D9' => 'Manila',
3210
+ 'E1' => 'Marawi',
3211
+ 'E2' => 'Naga',
3212
+ 'E3' => 'Olongapo',
3213
+ 'E4' => 'Ormoc',
3214
+ 'E5' => 'Oroquieta',
3215
+ 'E6' => 'Ozamis',
3216
+ 'E7' => 'Pagadian',
3217
+ 'E8' => 'Palayan',
3218
+ 'E9' => 'Pasay',
3219
+ 'F1' => 'Puerto Princesa',
3220
+ 'F2' => 'Quezon City',
3221
+ 'F3' => 'Roxas',
3222
+ 'F5' => 'San Carlos',
3223
+ 'F6' => 'San Jose',
3224
+ 'F7' => 'San Pablo',
3225
+ 'F8' => 'Silay',
3226
+ 'F9' => 'Surigao',
3227
+ 'G1' => 'Tacloban',
3228
+ 'G2' => 'Tagaytay',
3229
+ 'G3' => 'Tagbilaran',
3230
+ 'G4' => 'Tangub',
3231
+ 'G5' => 'Toledo',
3232
+ 'G6' => 'Trece Martires',
3233
+ 'P2' => 'Zamboanga',
3234
+ 'G8' => 'Aurora',
3235
+ 'H2' => 'Quezon',
3236
+ 'H9' => 'Biliran',
3237
+ 'I6' => 'Compostela Valley',
3238
+ 'I7' => 'Davao del Norte',
3239
+ 'J3' => 'Guimaras',
3240
+ 'J4' => 'Himamaylan',
3241
+ 'J7' => 'Kalinga',
3242
+ 'K1' => 'Las Pinas',
3243
+ 'K5' => 'Malabon',
3244
+ 'K6' => 'Malaybalay',
3245
+ 'L4' => 'Muntinlupa',
3246
+ 'L5' => 'Navotas',
3247
+ 'L7' => 'Paranaque',
3248
+ 'L9' => 'Passi',
3249
+ 'M5' => 'San Jose del Monte',
3250
+ 'M6' => 'San Juan',
3251
+ 'M8' => 'Santiago',
3252
+ 'M9' => 'Sarangani',
3253
+ 'N1' => 'Sipalay',
3254
+ ),
3255
+ 'PK' =>
3256
+ array (
3257
+ '01' => 'Federally Administered Tribal Areas',
3258
+ '02' => 'Balochistan',
3259
+ '03' => 'North-West Frontier',
3260
+ '04' => 'Punjab',
3261
+ '05' => 'Sindh',
3262
+ '06' => 'Azad Kashmir',
3263
+ '07' => 'Northern Areas',
3264
+ '08' => 'Islamabad',
3265
+ ),
3266
+ 'PL' =>
3267
+ array (
3268
+ 72 => 'Dolnoslaskie',
3269
+ 73 => 'Kujawsko-Pomorskie',
3270
+ 74 => 'Lodzkie',
3271
+ 75 => 'Lubelskie',
3272
+ 76 => 'Lubuskie',
3273
+ 77 => 'Malopolskie',
3274
+ 78 => 'Mazowieckie',
3275
+ 79 => 'Opolskie',
3276
+ 80 => 'Podkarpackie',
3277
+ 81 => 'Podlaskie',
3278
+ 82 => 'Pomorskie',
3279
+ 83 => 'Slaskie',
3280
+ 84 => 'Swietokrzyskie',
3281
+ 85 => 'Warminsko-Mazurskie',
3282
+ 86 => 'Wielkopolskie',
3283
+ 87 => 'Zachodniopomorskie',
3284
+ ),
3285
+ 'PS' =>
3286
+ array (
3287
+ 'GZ' => 'Gaza',
3288
+ 'WE' => 'West Bank',
3289
+ ),
3290
+ 'PT' =>
3291
+ array (
3292
+ '02' => 'Aveiro',
3293
+ '03' => 'Beja',
3294
+ '04' => 'Braga',
3295
+ '05' => 'Braganca',
3296
+ '06' => 'Castelo Branco',
3297
+ '07' => 'Coimbra',
3298
+ '08' => 'Evora',
3299
+ '09' => 'Faro',
3300
+ 10 => 'Madeira',
3301
+ 11 => 'Guarda',
3302
+ 13 => 'Leiria',
3303
+ 14 => 'Lisboa',
3304
+ 16 => 'Portalegre',
3305
+ 17 => 'Porto',
3306
+ 18 => 'Santarem',
3307
+ 19 => 'Setubal',
3308
+ 20 => 'Viana do Castelo',
3309
+ 21 => 'Vila Real',
3310
+ 22 => 'Viseu',
3311
+ 23 => 'Azores',
3312
+ ),
3313
+ 'PY' =>
3314
+ array (
3315
+ '01' => 'Alto Parana',
3316
+ '02' => 'Amambay',
3317
+ '04' => 'Caaguazu',
3318
+ '05' => 'Caazapa',
3319
+ '06' => 'Central',
3320
+ '07' => 'Concepcion',
3321
+ '08' => 'Cordillera',
3322
+ 10 => 'Guaira',
3323
+ 11 => 'Itapua',
3324
+ 12 => 'Misiones',
3325
+ 13 => 'Neembucu',
3326
+ 15 => 'Paraguari',
3327
+ 16 => 'Presidente Hayes',
3328
+ 17 => 'San Pedro',
3329
+ 19 => 'Canindeyu',
3330
+ 22 => 'Asuncion',
3331
+ 23 => 'Alto Paraguay',
3332
+ 24 => 'Boqueron',
3333
+ ),
3334
+ 'QA' =>
3335
+ array (
3336
+ '01' => 'Ad Dawhah',
3337
+ '02' => 'Al Ghuwariyah',
3338
+ '03' => 'Al Jumaliyah',
3339
+ '04' => 'Al Khawr',
3340
+ '05' => 'Al Wakrah Municipality',
3341
+ '06' => 'Ar Rayyan',
3342
+ '08' => 'Madinat ach Shamal',
3343
+ '09' => 'Umm Salal',
3344
+ 10 => 'Al Wakrah',
3345
+ 11 => 'Jariyan al Batnah',
3346
+ 12 => 'Umm Sa\'id',
3347
+ ),
3348
+ 'RO' =>
3349
+ array (
3350
+ '01' => 'Alba',
3351
+ '02' => 'Arad',
3352
+ '03' => 'Arges',
3353
+ '04' => 'Bacau',
3354
+ '05' => 'Bihor',
3355
+ '06' => 'Bistrita-Nasaud',
3356
+ '07' => 'Botosani',
3357
+ '08' => 'Braila',
3358
+ '09' => 'Brasov',
3359
+ 10 => 'Bucuresti',
3360
+ 11 => 'Buzau',
3361
+ 12 => 'Caras-Severin',
3362
+ 13 => 'Cluj',
3363
+ 14 => 'Constanta',
3364
+ 15 => 'Covasna',
3365
+ 16 => 'Dambovita',
3366
+ 17 => 'Dolj',
3367
+ 18 => 'Galati',
3368
+ 19 => 'Gorj',
3369
+ 20 => 'Harghita',
3370
+ 21 => 'Hunedoara',
3371
+ 22 => 'Ialomita',
3372
+ 23 => 'Iasi',
3373
+ 25 => 'Maramures',
3374
+ 26 => 'Mehedinti',
3375
+ 27 => 'Mures',
3376
+ 28 => 'Neamt',
3377
+ 29 => 'Olt',
3378
+ 30 => 'Prahova',
3379
+ 31 => 'Salaj',
3380
+ 32 => 'Satu Mare',
3381
+ 33 => 'Sibiu',
3382
+ 34 => 'Suceava',
3383
+ 35 => 'Teleorman',
3384
+ 36 => 'Timis',
3385
+ 37 => 'Tulcea',
3386
+ 38 => 'Vaslui',
3387
+ 39 => 'Valcea',
3388
+ 40 => 'Vrancea',
3389
+ 41 => 'Calarasi',
3390
+ 42 => 'Giurgiu',
3391
+ 43 => 'Ilfov',
3392
+ ),
3393
+ 'RS' =>
3394
+ array (
3395
+ '01' => 'Kosovo',
3396
+ '02' => 'Vojvodina',
3397
+ ),
3398
+ 'RU' =>
3399
+ array (
3400
+ '01' => 'Adygeya',
3401
+ '02' => 'Aginsky Buryatsky AO',
3402
+ '03' => 'Gorno-Altay',
3403
+ '04' => 'Altaisky krai',
3404
+ '05' => 'Amur',
3405
+ '06' => 'Arkhangel\'sk',
3406
+ '07' => 'Astrakhan\'',
3407
+ '08' => 'Bashkortostan',
3408
+ '09' => 'Belgorod',
3409
+ 10 => 'Bryansk',
3410
+ 11 => 'Buryat',
3411
+ 12 => 'Chechnya',
3412
+ 13 => 'Chelyabinsk',
3413
+ 14 => 'Chita',
3414
+ 15 => 'Chukot',
3415
+ 16 => 'Chuvashia',
3416
+ 17 => 'Dagestan',
3417
+ 18 => 'Evenk',
3418
+ 19 => 'Ingush',
3419
+ 20 => 'Irkutsk',
3420
+ 21 => 'Ivanovo',
3421
+ 22 => 'Kabardin-Balkar',
3422
+ 23 => 'Kaliningrad',
3423
+ 24 => 'Kalmyk',
3424
+ 25 => 'Kaluga',
3425
+ 26 => 'Kamchatka',
3426
+ 27 => 'Karachay-Cherkess',
3427
+ 28 => 'Karelia',
3428
+ 29 => 'Kemerovo',
3429
+ 30 => 'Khabarovsk',
3430
+ 31 => 'Khakass',
3431
+ 32 => 'Khanty-Mansiy',
3432
+ 33 => 'Kirov',
3433
+ 34 => 'Komi',
3434
+ 36 => 'Koryak',
3435
+ 37 => 'Kostroma',
3436
+ 38 => 'Krasnodar',
3437
+ 39 => 'Krasnoyarsk',
3438
+ 40 => 'Kurgan',
3439
+ 41 => 'Kursk',
3440
+ 42 => 'Leningrad',
3441
+ 43 => 'Lipetsk',
3442
+ 44 => 'Magadan',
3443
+ 45 => 'Mariy-El',
3444
+ 46 => 'Mordovia',
3445
+ 47 => 'Moskva',
3446
+ 48 => 'Moscow City',
3447
+ 49 => 'Murmansk',
3448
+ 50 => 'Nenets',
3449
+ 51 => 'Nizhegorod',
3450
+ 52 => 'Novgorod',
3451
+ 53 => 'Novosibirsk',
3452
+ 54 => 'Omsk',
3453
+ 55 => 'Orenburg',
3454
+ 56 => 'Orel',
3455
+ 57 => 'Penza',
3456
+ 58 => 'Perm\'',
3457
+ 59 => 'Primor\'ye',
3458
+ 60 => 'Pskov',
3459
+ 61 => 'Rostov',
3460
+ 62 => 'Ryazan\'',
3461
+ 63 => 'Sakha',
3462
+ 64 => 'Sakhalin',
3463
+ 65 => 'Samara',
3464
+ 66 => 'Saint Petersburg City',
3465
+ 67 => 'Saratov',
3466
+ 68 => 'North Ossetia',
3467
+ 69 => 'Smolensk',
3468
+ 70 => 'Stavropol\'',
3469
+ 71 => 'Sverdlovsk',
3470
+ 72 => 'Tambovskaya oblast',
3471
+ 73 => 'Tatarstan',
3472
+ 74 => 'Taymyr',
3473
+ 75 => 'Tomsk',
3474
+ 76 => 'Tula',
3475
+ 77 => 'Tver\'',
3476
+ 78 => 'Tyumen\'',
3477
+ 79 => 'Tuva',
3478
+ 80 => 'Udmurt',
3479
+ 81 => 'Ul\'yanovsk',
3480
+ 83 => 'Vladimir',
3481
+ 84 => 'Volgograd',
3482
+ 85 => 'Vologda',
3483
+ 86 => 'Voronezh',
3484
+ 87 => 'Yamal-Nenets',
3485
+ 88 => 'Yaroslavl\'',
3486
+ 89 => 'Yevrey',
3487
+ 90 => 'Permskiy Kray',
3488
+ 91 => 'Krasnoyarskiy Kray',
3489
+ 92 => 'Kamchatskiy Kray',
3490
+ 93 => 'Zabaykal\'skiy Kray',
3491
+ ),
3492
+ 'RW' =>
3493
+ array (
3494
+ '01' => 'Butare',
3495
+ '06' => 'Gitarama',
3496
+ '07' => 'Kibungo',
3497
+ 12 => 'Kigali',
3498
+ 11 => 'Est',
3499
+ 13 => 'Nord',
3500
+ 14 => 'Ouest',
3501
+ 15 => 'Sud',
3502
+ ),
3503
+ 'SA' =>
3504
+ array (
3505
+ '02' => 'Al Bahah',
3506
+ '05' => 'Al Madinah',
3507
+ '06' => 'Ash Sharqiyah',
3508
+ '08' => 'Al Qasim',
3509
+ 10 => 'Ar Riyad',
3510
+ 11 => 'Asir Province',
3511
+ 13 => 'Ha\'il',
3512
+ 14 => 'Makkah',
3513
+ 15 => 'Al Hudud ash Shamaliyah',
3514
+ 16 => 'Najran',
3515
+ 17 => 'Jizan',
3516
+ 19 => 'Tabuk',
3517
+ 20 => 'Al Jawf',
3518
+ ),
3519
+ 'SB' =>
3520
+ array (
3521
+ '03' => 'Malaita',
3522
+ '06' => 'Guadalcanal',
3523
+ '07' => 'Isabel',
3524
+ '08' => 'Makira',
3525
+ '09' => 'Temotu',
3526
+ 10 => 'Central',
3527
+ 11 => 'Western',
3528
+ 12 => 'Choiseul',
3529
+ 13 => 'Rennell and Bellona',
3530
+ ),
3531
+ 'SC' =>
3532
+ array (
3533
+ '01' => 'Anse aux Pins',
3534
+ '02' => 'Anse Boileau',
3535
+ '03' => 'Anse Etoile',
3536
+ '04' => 'Anse Louis',
3537
+ '05' => 'Anse Royale',
3538
+ '06' => 'Baie Lazare',
3539
+ '07' => 'Baie Sainte Anne',
3540
+ '08' => 'Beau Vallon',
3541
+ '09' => 'Bel Air',
3542
+ 10 => 'Bel Ombre',
3543
+ 11 => 'Cascade',
3544
+ 12 => 'Glacis',
3545
+ 14 => 'Grand\' Anse',
3546
+ 15 => 'La Digue',
3547
+ 16 => 'La Riviere Anglaise',
3548
+ 17 => 'Mont Buxton',
3549
+ 18 => 'Mont Fleuri',
3550
+ 19 => 'Plaisance',
3551
+ 20 => 'Pointe La Rue',
3552
+ 21 => 'Port Glaud',
3553
+ 22 => 'Saint Louis',
3554
+ 23 => 'Takamaka',
3555
+ ),
3556
+ 'SD' =>
3557
+ array (
3558
+ 27 => 'Al Wusta',
3559
+ 28 => 'Al Istiwa\'iyah',
3560
+ 29 => 'Al Khartum',
3561
+ 30 => 'Ash Shamaliyah',
3562
+ 31 => 'Ash Sharqiyah',
3563
+ 32 => 'Bahr al Ghazal',
3564
+ 33 => 'Darfur',
3565
+ 34 => 'Kurdufan',
3566
+ 35 => 'Upper Nile',
3567
+ 40 => 'Al Wahadah State',
3568
+ 44 => 'Central Equatoria State',
3569
+ 49 => 'Southern Darfur',
3570
+ 50 => 'Southern Kordofan',
3571
+ 52 => 'Kassala',
3572
+ 53 => 'River Nile',
3573
+ 55 => 'Northern Darfur',
3574
+ ),
3575
+ 'SE' =>
3576
+ array (
3577
+ '02' => 'Blekinge Lan',
3578
+ '03' => 'Gavleborgs Lan',
3579
+ '05' => 'Gotlands Lan',
3580
+ '06' => 'Hallands Lan',
3581
+ '07' => 'Jamtlands Lan',
3582
+ '08' => 'Jonkopings Lan',
3583
+ '09' => 'Kalmar Lan',
3584
+ 10 => 'Dalarnas Lan',
3585
+ 12 => 'Kronobergs Lan',
3586
+ 14 => 'Norrbottens Lan',
3587
+ 15 => 'Orebro Lan',
3588
+ 16 => 'Ostergotlands Lan',
3589
+ 18 => 'Sodermanlands Lan',
3590
+ 21 => 'Uppsala Lan',
3591
+ 22 => 'Varmlands Lan',
3592
+ 23 => 'Vasterbottens Lan',
3593
+ 24 => 'Vasternorrlands Lan',
3594
+ 25 => 'Vastmanlands Lan',
3595
+ 26 => 'Stockholms Lan',
3596
+ 27 => 'Skane Lan',
3597
+ 28 => 'Vastra Gotaland',
3598
+ ),
3599
+ 'SH' =>
3600
+ array (
3601
+ '01' => 'Ascension',
3602
+ '02' => 'Saint Helena',
3603
+ '03' => 'Tristan da Cunha',
3604
+ ),
3605
+ 'SI' =>
3606
+ array (
3607
+ '01' => 'Ajdovscina Commune',
3608
+ '02' => 'Beltinci Commune',
3609
+ '03' => 'Bled Commune',
3610
+ '04' => 'Bohinj Commune',
3611
+ '05' => 'Borovnica Commune',
3612
+ '06' => 'Bovec Commune',
3613
+ '07' => 'Brda Commune',
3614
+ '08' => 'Brezice Commune',
3615
+ '09' => 'Brezovica Commune',
3616
+ 11 => 'Celje Commune',
3617
+ 12 => 'Cerklje na Gorenjskem Commune',
3618
+ 13 => 'Cerknica Commune',
3619
+ 14 => 'Cerkno Commune',
3620
+ 15 => 'Crensovci Commune',
3621
+ 16 => 'Crna na Koroskem Commune',
3622
+ 17 => 'Crnomelj Commune',
3623
+ 19 => 'Divaca Commune',
3624
+ 20 => 'Dobrepolje Commune',
3625
+ 22 => 'Dol pri Ljubljani Commune',
3626
+ 24 => 'Dornava Commune',
3627
+ 25 => 'Dravograd Commune',
3628
+ 26 => 'Duplek Commune',
3629
+ 27 => 'Gorenja vas-Poljane Commune',
3630
+ 28 => 'Gorisnica Commune',
3631
+ 29 => 'Gornja Radgona Commune',
3632
+ 30 => 'Gornji Grad Commune',
3633
+ 31 => 'Gornji Petrovci Commune',
3634
+ 32 => 'Grosuplje Commune',
3635
+ 34 => 'Hrastnik Commune',
3636
+ 35 => 'Hrpelje-Kozina Commune',
3637
+ 36 => 'Idrija Commune',
3638
+ 37 => 'Ig Commune',
3639
+ 38 => 'Ilirska Bistrica Commune',
3640
+ 39 => 'Ivancna Gorica Commune',
3641
+ 40 => 'Izola-Isola Commune',
3642
+ 42 => 'Jursinci Commune',
3643
+ 44 => 'Kanal Commune',
3644
+ 45 => 'Kidricevo Commune',
3645
+ 46 => 'Kobarid Commune',
3646
+ 47 => 'Kobilje Commune',
3647
+ 49 => 'Komen Commune',
3648
+ 50 => 'Koper-Capodistria Urban Commune',
3649
+ 51 => 'Kozje Commune',
3650
+ 52 => 'Kranj Commune',
3651
+ 53 => 'Kranjska Gora Commune',
3652
+ 54 => 'Krsko Commune',
3653
+ 55 => 'Kungota Commune',
3654
+ 57 => 'Lasko Commune',
3655
+ 61 => 'Ljubljana Urban Commune',
3656
+ 62 => 'Ljubno Commune',
3657
+ 64 => 'Logatec Commune',
3658
+ 66 => 'Loski Potok Commune',
3659
+ 68 => 'Lukovica Commune',
3660
+ 71 => 'Medvode Commune',
3661
+ 72 => 'Menges Commune',
3662
+ 73 => 'Metlika Commune',
3663
+ 74 => 'Mezica Commune',
3664
+ 76 => 'Mislinja Commune',
3665
+ 77 => 'Moravce Commune',
3666
+ 78 => 'Moravske Toplice Commune',
3667
+ 79 => 'Mozirje Commune',
3668
+ 80 => 'Murska Sobota Urban Commune',
3669
+ 81 => 'Muta Commune',
3670
+ 82 => 'Naklo Commune',
3671
+ 83 => 'Nazarje Commune',
3672
+ 84 => 'Nova Gorica Urban Commune',
3673
+ 86 => 'Odranci Commune',
3674
+ 87 => 'Ormoz Commune',
3675
+ 88 => 'Osilnica Commune',
3676
+ 89 => 'Pesnica Commune',
3677
+ 91 => 'Pivka Commune',
3678
+ 92 => 'Podcetrtek Commune',
3679
+ 94 => 'Postojna Commune',
3680
+ 97 => 'Puconci Commune',
3681
+ 98 => 'Race-Fram Commune',
3682
+ 99 => 'Radece Commune',
3683
+ 'A1' => 'Radenci Commune',
3684
+ 'A2' => 'Radlje ob Dravi Commune',
3685
+ 'A3' => 'Radovljica Commune',
3686
+ 'A6' => 'Rogasovci Commune',
3687
+ 'A7' => 'Rogaska Slatina Commune',
3688
+ 'A8' => 'Rogatec Commune',
3689
+ 'B1' => 'Semic Commune',
3690
+ 'B2' => 'Sencur Commune',
3691
+ 'B3' => 'Sentilj Commune',
3692
+ 'B4' => 'Sentjernej Commune',
3693
+ 'B6' => 'Sevnica Commune',
3694
+ 'B7' => 'Sezana Commune',
3695
+ 'B8' => 'Skocjan Commune',
3696
+ 'B9' => 'Skofja Loka Commune',
3697
+ 'C1' => 'Skofljica Commune',
3698
+ 'C2' => 'Slovenj Gradec Urban Commune',
3699
+ 'C4' => 'Slovenske Konjice Commune',
3700
+ 'C5' => 'Smarje pri Jelsah Commune',
3701
+ 'C6' => 'Smartno ob Paki Commune',
3702
+ 'C7' => 'Sostanj Commune',
3703
+ 'C8' => 'Starse Commune',
3704
+ 'C9' => 'Store Commune',
3705
+ 'D1' => 'Sveti Jurij Commune',
3706
+ 'D2' => 'Tolmin Commune',
3707
+ 'D3' => 'Trbovlje Commune',
3708
+ 'D4' => 'Trebnje Commune',
3709
+ 'D5' => 'Trzic Commune',
3710
+ 'D6' => 'Turnisce Commune',
3711
+ 'D7' => 'Velenje Urban Commune',
3712
+ 'D8' => 'Velike Lasce Commune',
3713
+ 'E1' => 'Vipava Commune',
3714
+ 'E2' => 'Vitanje Commune',
3715
+ 'E3' => 'Vodice Commune',
3716
+ 'E5' => 'Vrhnika Commune',
3717
+ 'E6' => 'Vuzenica Commune',
3718
+ 'E7' => 'Zagorje ob Savi Commune',
3719
+ 'E9' => 'Zavrc Commune',
3720
+ 'F1' => 'Zelezniki Commune',
3721
+ 'F2' => 'Ziri Commune',
3722
+ 'F3' => 'Zrece Commune',
3723
+ 'F4' => 'Benedikt Commune',
3724
+ 'F5' => 'Bistrica ob Sotli Commune',
3725
+ 'F6' => 'Bloke Commune',
3726
+ 'F7' => 'Braslovce Commune',
3727
+ 'F8' => 'Cankova Commune',
3728
+ 'F9' => 'Cerkvenjak Commune',
3729
+ 'G1' => 'Destrnik Commune',
3730
+ 'G2' => 'Dobje Commune',
3731
+ 'G3' => 'Dobrna Commune',
3732
+ 'G4' => 'Dobrova-Horjul-Polhov Gradec Commune',
3733
+ 'G5' => 'Dobrovnik-Dobronak Commune',
3734
+ 'G6' => 'Dolenjske Toplice Commune',
3735
+ 'G7' => 'Domzale Commune',
3736
+ 'G8' => 'Grad Commune',
3737
+ 'G9' => 'Hajdina Commune',
3738
+ 'H1' => 'Hoce-Slivnica Commune',
3739
+ 'H2' => 'Hodos-Hodos Commune',
3740
+ 'H3' => 'Horjul Commune',
3741
+ 'H4' => 'Jesenice Commune',
3742
+ 'H5' => 'Jezersko Commune',
3743
+ 'H6' => 'Kamnik Commune',
3744
+ 'H7' => 'Kocevje Commune',
3745
+ 'H8' => 'Komenda Commune',
3746
+ 'H9' => 'Kostel Commune',
3747
+ 'I1' => 'Krizevci Commune',
3748
+ 'I2' => 'Kuzma Commune',
3749
+ 'I3' => 'Lenart Commune',
3750
+ 'I4' => 'Lendava-Lendva Commune',
3751
+ 'I5' => 'Litija Commune',
3752
+ 'I6' => 'Ljutomer Commune',
3753
+ 'I7' => 'Loska Dolina Commune',
3754
+ 'I8' => 'Lovrenc na Pohorju Commune',
3755
+ 'I9' => 'Luce Commune',
3756
+ 'J1' => 'Majsperk Commune',
3757
+ 'J2' => 'Maribor Commune',
3758
+ 'J3' => 'Markovci Commune',
3759
+ 'J4' => 'Miklavz na Dravskem polju Commune',
3760
+ 'J5' => 'Miren-Kostanjevica Commune',
3761
+ 'J6' => 'Mirna Pec Commune',
3762
+ 'J7' => 'Novo mesto Urban Commune',
3763
+ 'J8' => 'Oplotnica Commune',
3764
+ 'J9' => 'Piran-Pirano Commune',
3765
+ 'K1' => 'Podlehnik Commune',
3766
+ 'K2' => 'Podvelka Commune',
3767
+ 'K3' => 'Polzela Commune',
3768
+ 'K4' => 'Prebold Commune',
3769
+ 'K5' => 'Preddvor Commune',
3770
+ 'K6' => 'Prevalje Commune',
3771
+ 'K7' => 'Ptuj Urban Commune',
3772
+ 'K8' => 'Ravne na Koroskem Commune',
3773
+ 'K9' => 'Razkrizje Commune',
3774
+ 'L1' => 'Ribnica Commune',
3775
+ 'L2' => 'Ribnica na Pohorju Commune',
3776
+ 'L3' => 'Ruse Commune',
3777
+ 'L4' => 'Salovci Commune',
3778
+ 'L5' => 'Selnica ob Dravi Commune',
3779
+ 'L6' => 'Sempeter-Vrtojba Commune',
3780
+ 'L7' => 'Sentjur pri Celju Commune',
3781
+ 'L8' => 'Slovenska Bistrica Commune',
3782
+ 'L9' => 'Smartno pri Litiji Commune',
3783
+ 'M1' => 'Sodrazica Commune',
3784
+ 'M2' => 'Solcava Commune',
3785
+ 'M3' => 'Sveta Ana Commune',
3786
+ 'M4' => 'Sveti Andraz v Slovenskih goricah Commune',
3787
+ 'M5' => 'Tabor Commune',
3788
+ 'M6' => 'Tisina Commune',
3789
+ 'M7' => 'Trnovska vas Commune',
3790
+ 'M8' => 'Trzin Commune',
3791
+ 'M9' => 'Velika Polana Commune',
3792
+ 'N1' => 'Verzej Commune',
3793
+ 'N2' => 'Videm Commune',
3794
+ 'N3' => 'Vojnik Commune',
3795
+ 'N4' => 'Vransko Commune',
3796
+ 'N5' => 'Zalec Commune',
3797
+ 'N6' => 'Zetale Commune',
3798
+ 'N7' => 'Zirovnica Commune',
3799
+ 'N8' => 'Zuzemberk Commune',
3800
+ 'N9' => 'Apace Commune',
3801
+ 'O1' => 'Cirkulane Commune',
3802
+ 'O2' => 'Gorje',
3803
+ 'O3' => 'Kostanjevica na Krki',
3804
+ 'O4' => 'Log-Dragomer',
3805
+ 'O5' => 'Makole',
3806
+ 'O6' => 'Mirna',
3807
+ 'O7' => 'Mokronog-Trebelno',
3808
+ 'O8' => 'Poljcane',
3809
+ 'O9' => 'Recica ob Savinji',
3810
+ 'P1' => 'Rence-Vogrsko',
3811
+ 'P2' => 'Sentrupert',
3812
+ 'P3' => 'Smarjesk Toplice',
3813
+ 'P4' => 'Sredisce ob Dravi',
3814
+ 'P5' => 'Straza',
3815
+ ),
3816
+ 'SK' =>
3817
+ array (
3818
+ '01' => 'Banska Bystrica',
3819
+ '02' => 'Bratislava',
3820
+ '03' => 'Kosice',
3821
+ '04' => 'Nitra',
3822
+ '05' => 'Presov',
3823
+ '06' => 'Trencin',
3824
+ '07' => 'Trnava',
3825
+ '08' => 'Zilina',
3826
+ ),
3827
+ 'SL' =>
3828
+ array (
3829
+ '01' => 'Eastern',
3830
+ '02' => 'Northern',
3831
+ '03' => 'Southern',
3832
+ '04' => 'Western Area',
3833
+ ),
3834
+ 'SM' =>
3835
+ array (
3836
+ '01' => 'Acquaviva',
3837
+ '02' => 'Chiesanuova',
3838
+ '03' => 'Domagnano',
3839
+ '04' => 'Faetano',
3840
+ '05' => 'Fiorentino',
3841
+ '06' => 'Borgo Maggiore',
3842
+ '07' => 'San Marino',
3843
+ '08' => 'Monte Giardino',
3844
+ '09' => 'Serravalle',
3845
+ ),
3846
+ 'SN' =>
3847
+ array (
3848
+ '01' => 'Dakar',
3849
+ '03' => 'Diourbel',
3850
+ '05' => 'Tambacounda',
3851
+ '07' => 'Thies',
3852
+ '09' => 'Fatick',
3853
+ 10 => 'Kaolack',
3854
+ 11 => 'Kolda',
3855
+ 12 => 'Ziguinchor',
3856
+ 13 => 'Louga',
3857
+ 14 => 'Saint-Louis',
3858
+ 15 => 'Matam',
3859
+ ),
3860
+ 'SO' =>
3861
+ array (
3862
+ '01' => 'Bakool',
3863
+ '02' => 'Banaadir',
3864
+ '03' => 'Bari',
3865
+ '04' => 'Bay',
3866
+ '05' => 'Galguduud',
3867
+ '06' => 'Gedo',
3868
+ '07' => 'Hiiraan',
3869
+ '08' => 'Jubbada Dhexe',
3870
+ '09' => 'Jubbada Hoose',
3871
+ 10 => 'Mudug',
3872
+ 18 => 'Nugaal',
3873
+ 12 => 'Sanaag',
3874
+ 13 => 'Shabeellaha Dhexe',
3875
+ 14 => 'Shabeellaha Hoose',
3876
+ 20 => 'Woqooyi Galbeed',
3877
+ 19 => 'Togdheer',
3878
+ 21 => 'Awdal',
3879
+ 22 => 'Sool',
3880
+ ),
3881
+ 'SR' =>
3882
+ array (
3883
+ 10 => 'Brokopondo',
3884
+ 11 => 'Commewijne',
3885
+ 12 => 'Coronie',
3886
+ 13 => 'Marowijne',
3887
+ 14 => 'Nickerie',
3888
+ 15 => 'Para',
3889
+ 16 => 'Paramaribo',
3890
+ 17 => 'Saramacca',
3891
+ 18 => 'Sipaliwini',
3892
+ 19 => 'Wanica',
3893
+ ),
3894
+ 'SS' =>
3895
+ array (
3896
+ '01' => 'Central Equatoria',
3897
+ '02' => 'Eastern Equatoria',
3898
+ '03' => 'Jonglei',
3899
+ '04' => 'Lakes',
3900
+ '05' => 'Northern Bahr el Ghazal',
3901
+ '06' => 'Unity',
3902
+ '07' => 'Upper Nile',
3903
+ '08' => 'Warrap',
3904
+ '09' => 'Western Bahr el Ghazal',
3905
+ 10 => 'Western Equatoria',
3906
+ ),
3907
+ 'ST' =>
3908
+ array (
3909
+ '01' => 'Principe',
3910
+ '02' => 'Sao Tome',
3911
+ ),
3912
+ 'SV' =>
3913
+ array (
3914
+ '01' => 'Ahuachapan',
3915
+ '02' => 'Cabanas',
3916
+ '03' => 'Chalatenango',
3917
+ '04' => 'Cuscatlan',
3918
+ '05' => 'La Libertad',
3919
+ '06' => 'La Paz',
3920
+ '07' => 'La Union',
3921
+ '08' => 'Morazan',
3922
+ '09' => 'San Miguel',
3923
+ 10 => 'San Salvador',
3924
+ 11 => 'Santa Ana',
3925
+ 12 => 'San Vicente',
3926
+ 13 => 'Sonsonate',
3927
+ 14 => 'Usulutan',
3928
+ ),
3929
+ 'SY' =>
3930
+ array (
3931
+ '01' => 'Al Hasakah',
3932
+ '02' => 'Al Ladhiqiyah',
3933
+ '03' => 'Al Qunaytirah',
3934
+ '04' => 'Ar Raqqah',
3935
+ '05' => 'As Suwayda\'',
3936
+ '06' => 'Dar',
3937
+ '07' => 'Dayr az Zawr',
3938
+ '08' => 'Rif Dimashq',
3939
+ '09' => 'Halab',
3940
+ 10 => 'Hamah',
3941
+ 11 => 'Hims',
3942
+ 12 => 'Idlib',
3943
+ 13 => 'Dimashq',
3944
+ 14 => 'Tartus',
3945
+ ),
3946
+ 'SZ' =>
3947
+ array (
3948
+ '01' => 'Hhohho',
3949
+ '02' => 'Lubombo',
3950
+ '03' => 'Manzini',
3951
+ '04' => 'Shiselweni',
3952
+ '05' => 'Praslin',
3953
+ ),
3954
+ 'TD' =>
3955
+ array (
3956
+ '01' => 'Batha',
3957
+ '02' => 'Biltine',
3958
+ '03' => 'Borkou-Ennedi-Tibesti',
3959
+ '04' => 'Chari-Baguirmi',
3960
+ '05' => 'Guera',
3961
+ '06' => 'Kanem',
3962
+ '07' => 'Lac',
3963
+ '08' => 'Logone Occidental',
3964
+ '09' => 'Logone Oriental',
3965
+ 10 => 'Mayo-Kebbi',
3966
+ 11 => 'Moyen-Chari',
3967
+ 12 => 'Ouaddai',
3968
+ 13 => 'Salamat',
3969
+ 14 => 'Tandjile',
3970
+ ),
3971
+ 'TG' =>
3972
+ array (
3973
+ 22 => 'Centrale',
3974
+ 23 => 'Kara',
3975
+ 24 => 'Maritime',
3976
+ 25 => 'Plateaux',
3977
+ 26 => 'Savanes',
3978
+ ),
3979
+ 'TH' =>
3980
+ array (
3981
+ '01' => 'Mae Hong Son',
3982
+ '02' => 'Chiang Mai',
3983
+ '03' => 'Chiang Rai',
3984
+ '04' => 'Nan',
3985
+ '05' => 'Lamphun',
3986
+ '06' => 'Lampang',
3987
+ '07' => 'Phrae',
3988
+ '08' => 'Tak',
3989
+ '09' => 'Sukhothai',
3990
+ 10 => 'Uttaradit',
3991
+ 11 => 'Kamphaeng Phet',
3992
+ 12 => 'Phitsanulok',
3993
+ 13 => 'Phichit',
3994
+ 14 => 'Phetchabun',
3995
+ 15 => 'Uthai Thani',
3996
+ 16 => 'Nakhon Sawan',
3997
+ 17 => 'Nong Khai',
3998
+ 18 => 'Loei',
3999
+ 20 => 'Sakon Nakhon',
4000
+ 73 => 'Nakhon Phanom',
4001
+ 22 => 'Khon Kaen',
4002
+ 23 => 'Kalasin',
4003
+ 24 => 'Maha Sarakham',
4004
+ 25 => 'Roi Et',
4005
+ 26 => 'Chaiyaphum',
4006
+ 27 => 'Nakhon Ratchasima',
4007
+ 28 => 'Buriram',
4008
+ 29 => 'Surin',
4009
+ 30 => 'Sisaket',
4010
+ 31 => 'Narathiwat',
4011
+ 32 => 'Chai Nat',
4012
+ 33 => 'Sing Buri',
4013
+ 34 => 'Lop Buri',
4014
+ 35 => 'Ang Thong',
4015
+ 36 => 'Phra Nakhon Si Ayutthaya',
4016
+ 37 => 'Saraburi',
4017
+ 38 => 'Nonthaburi',
4018
+ 39 => 'Pathum Thani',
4019
+ 40 => 'Krung Thep',
4020
+ 41 => 'Phayao',
4021
+ 42 => 'Samut Prakan',
4022
+ 43 => 'Nakhon Nayok',
4023
+ 44 => 'Chachoengsao',
4024
+ 74 => 'Prachin Buri',
4025
+ 46 => 'Chon Buri',
4026
+ 47 => 'Rayong',
4027
+ 48 => 'Chanthaburi',
4028
+ 49 => 'Trat',
4029
+ 50 => 'Kanchanaburi',
4030
+ 51 => 'Suphan Buri',
4031
+ 52 => 'Ratchaburi',
4032
+ 53 => 'Nakhon Pathom',
4033
+ 54 => 'Samut Songkhram',
4034
+ 55 => 'Samut Sakhon',
4035
+ 56 => 'Phetchaburi',
4036
+ 57 => 'Prachuap Khiri Khan',
4037
+ 58 => 'Chumphon',
4038
+ 59 => 'Ranong',
4039
+ 60 => 'Surat Thani',
4040
+ 61 => 'Phangnga',
4041
+ 62 => 'Phuket',
4042
+ 63 => 'Krabi',
4043
+ 64 => 'Nakhon Si Thammarat',
4044
+ 65 => 'Trang',
4045
+ 66 => 'Phatthalung',
4046
+ 67 => 'Satun',
4047
+ 68 => 'Songkhla',
4048
+ 69 => 'Pattani',
4049
+ 70 => 'Yala',
4050
+ 75 => 'Ubon Ratchathani',
4051
+ 72 => 'Yasothon',
4052
+ 76 => 'Udon Thani',
4053
+ 77 => 'Amnat Charoen',
4054
+ 78 => 'Mukdahan',
4055
+ 79 => 'Nong Bua Lamphu',
4056
+ 80 => 'Sa Kaeo',
4057
+ 81 => 'Bueng Kan',
4058
+ ),
4059
+ 'TJ' =>
4060
+ array (
4061
+ '01' => 'Kuhistoni Badakhshon',
4062
+ '02' => 'Khatlon',
4063
+ '03' => 'Sughd',
4064
+ '04' => 'Dushanbe',
4065
+ '05' => 'Nohiyahoi Tobei Jumhuri',
4066
+ ),
4067
+ 'TL' =>
4068
+ array (
4069
+ '06' => 'Dili',
4070
+ ),
4071
+ 'TM' =>
4072
+ array (
4073
+ '01' => 'Ahal',
4074
+ '02' => 'Balkan',
4075
+ '03' => 'Dashoguz',
4076
+ '04' => 'Lebap',
4077
+ '05' => 'Mary',
4078
+ ),
4079
+ 'TN' =>
4080
+ array (
4081
+ '02' => 'Kasserine',
4082
+ '03' => 'Kairouan',
4083
+ '06' => 'Jendouba',
4084
+ 10 => 'Qafsah',
4085
+ 14 => 'El Kef',
4086
+ 15 => 'Al Mahdia',
4087
+ 16 => 'Al Munastir',
4088
+ 17 => 'Bajah',
4089
+ 18 => 'Bizerte',
4090
+ 19 => 'Nabeul',
4091
+ 22 => 'Siliana',
4092
+ 23 => 'Sousse',
4093
+ 27 => 'Ben Arous',
4094
+ 28 => 'Madanin',
4095
+ 29 => 'Gabes',
4096
+ 31 => 'Kebili',
4097
+ 32 => 'Sfax',
4098
+ 33 => 'Sidi Bou Zid',
4099
+ 34 => 'Tataouine',
4100
+ 35 => 'Tozeur',
4101
+ 36 => 'Tunis',
4102
+ 37 => 'Zaghouan',
4103
+ 38 => 'Aiana',
4104
+ 39 => 'Manouba',
4105
+ ),
4106
+ 'TO' =>
4107
+ array (
4108
+ '01' => 'Ha',
4109
+ '02' => 'Tongatapu',
4110
+ '03' => 'Vava',
4111
+ ),
4112
+ 'TR' =>
4113
+ array (
4114
+ '02' => 'Adiyaman',
4115
+ '03' => 'Afyonkarahisar',
4116
+ '04' => 'Agri',
4117
+ '05' => 'Amasya',
4118
+ '07' => 'Antalya',
4119
+ '08' => 'Artvin',
4120
+ '09' => 'Aydin',
4121
+ 10 => 'Balikesir',
4122
+ 11 => 'Bilecik',
4123
+ 12 => 'Bingol',
4124
+ 13 => 'Bitlis',
4125
+ 14 => 'Bolu',
4126
+ 15 => 'Burdur',
4127
+ 16 => 'Bursa',
4128
+ 17 => 'Canakkale',
4129
+ 19 => 'Corum',
4130
+ 20 => 'Denizli',
4131
+ 21 => 'Diyarbakir',
4132
+ 22 => 'Edirne',
4133
+ 23 => 'Elazig',
4134
+ 24 => 'Erzincan',
4135
+ 25 => 'Erzurum',
4136
+ 26 => 'Eskisehir',
4137
+ 28 => 'Giresun',
4138
+ 31 => 'Hatay',
4139
+ 32 => 'Mersin',
4140
+ 33 => 'Isparta',
4141
+ 34 => 'Istanbul',
4142
+ 35 => 'Izmir',
4143
+ 37 => 'Kastamonu',
4144
+ 38 => 'Kayseri',
4145
+ 39 => 'Kirklareli',
4146
+ 40 => 'Kirsehir',
4147
+ 41 => 'Kocaeli',
4148
+ 43 => 'Kutahya',
4149
+ 44 => 'Malatya',
4150
+ 45 => 'Manisa',
4151
+ 46 => 'Kahramanmaras',
4152
+ 48 => 'Mugla',
4153
+ 49 => 'Mus',
4154
+ 50 => 'Nevsehir',
4155
+ 52 => 'Ordu',
4156
+ 53 => 'Rize',
4157
+ 54 => 'Sakarya',
4158
+ 55 => 'Samsun',
4159
+ 57 => 'Sinop',
4160
+ 58 => 'Sivas',
4161
+ 59 => 'Tekirdag',
4162
+ 60 => 'Tokat',
4163
+ 61 => 'Trabzon',
4164
+ 62 => 'Tunceli',
4165
+ 63 => 'Sanliurfa',
4166
+ 64 => 'Usak',
4167
+ 65 => 'Van',
4168
+ 66 => 'Yozgat',
4169
+ 68 => 'Ankara',
4170
+ 69 => 'Gumushane',
4171
+ 70 => 'Hakkari',
4172
+ 71 => 'Konya',
4173
+ 72 => 'Mardin',
4174
+ 73 => 'Nigde',
4175
+ 74 => 'Siirt',
4176
+ 75 => 'Aksaray',
4177
+ 76 => 'Batman',
4178
+ 77 => 'Bayburt',
4179
+ 78 => 'Karaman',
4180
+ 79 => 'Kirikkale',
4181
+ 80 => 'Sirnak',
4182
+ 81 => 'Adana',
4183
+ 82 => 'Cankiri',
4184
+ 83 => 'Gaziantep',
4185
+ 84 => 'Kars',
4186
+ 85 => 'Zonguldak',
4187
+ 86 => 'Ardahan',
4188
+ 87 => 'Bartin',
4189
+ 88 => 'Igdir',
4190
+ 89 => 'Karabuk',
4191
+ 90 => 'Kilis',
4192
+ 91 => 'Osmaniye',
4193
+ 92 => 'Yalova',
4194
+ 93 => 'Duzce',
4195
+ ),
4196
+ 'TT' =>
4197
+ array (
4198
+ '01' => 'Arima',
4199
+ '02' => 'Caroni',
4200
+ '03' => 'Mayaro',
4201
+ '04' => 'Nariva',
4202
+ '05' => 'Port-of-Spain',
4203
+ '06' => 'Saint Andrew',
4204
+ '07' => 'Saint David',
4205
+ '08' => 'Saint George',
4206
+ '09' => 'Saint Patrick',
4207
+ 10 => 'San Fernando',
4208
+ 11 => 'Tobago',
4209
+ 12 => 'Victoria',
4210
+ ),
4211
+ 'TW' =>
4212
+ array (
4213
+ '01' => 'Fu-chien',
4214
+ '02' => 'Kao-hsiung',
4215
+ '03' => 'T\'ai-pei',
4216
+ '04' => 'T\'ai-wan',
4217
+ ),
4218
+ 'TZ' =>
4219
+ array (
4220
+ '02' => 'Pwani',
4221
+ '03' => 'Dodoma',
4222
+ '04' => 'Iringa',
4223
+ '05' => 'Kigoma',
4224
+ '06' => 'Kilimanjaro',
4225
+ '07' => 'Lindi',
4226
+ '08' => 'Mara',
4227
+ '09' => 'Mbeya',
4228
+ 10 => 'Morogoro',
4229
+ 11 => 'Mtwara',
4230
+ 12 => 'Mwanza',
4231
+ 13 => 'Pemba North',
4232
+ 14 => 'Ruvuma',
4233
+ 15 => 'Shinyanga',
4234
+ 16 => 'Singida',
4235
+ 17 => 'Tabora',
4236
+ 18 => 'Tanga',
4237
+ 19 => 'Kagera',
4238
+ 20 => 'Pemba South',
4239
+ 21 => 'Zanzibar Central',
4240
+ 22 => 'Zanzibar North',
4241
+ 23 => 'Dar es Salaam',
4242
+ 24 => 'Rukwa',
4243
+ 25 => 'Zanzibar Urban',
4244
+ 26 => 'Arusha',
4245
+ 27 => 'Manyara',
4246
+ ),
4247
+ 'UA' =>
4248
+ array (
4249
+ '01' => 'Cherkas\'ka Oblast\'',
4250
+ '02' => 'Chernihivs\'ka Oblast\'',
4251
+ '03' => 'Chernivets\'ka Oblast\'',
4252
+ '04' => 'Dnipropetrovs\'ka Oblast\'',
4253
+ '05' => 'Donets\'ka Oblast\'',
4254
+ '06' => 'Ivano-Frankivs\'ka Oblast\'',
4255
+ '07' => 'Kharkivs\'ka Oblast\'',
4256
+ '08' => 'Khersons\'ka Oblast\'',
4257
+ '09' => 'Khmel\'nyts\'ka Oblast\'',
4258
+ 10 => 'Kirovohrads\'ka Oblast\'',
4259
+ 11 => 'Krym',
4260
+ 12 => 'Kyyiv',
4261
+ 13 => 'Kyyivs\'ka Oblast\'',
4262
+ 14 => 'Luhans\'ka Oblast\'',
4263
+ 15 => 'L\'vivs\'ka Oblast\'',
4264
+ 16 => 'Mykolayivs\'ka Oblast\'',
4265
+ 17 => 'Odes\'ka Oblast\'',
4266
+ 18 => 'Poltavs\'ka Oblast\'',
4267
+ 19 => 'Rivnens\'ka Oblast\'',
4268
+ 20 => 'Sevastopol\'',
4269
+ 21 => 'Sums\'ka Oblast\'',
4270
+ 22 => 'Ternopil\'s\'ka Oblast\'',
4271
+ 23 => 'Vinnyts\'ka Oblast\'',
4272
+ 24 => 'Volyns\'ka Oblast\'',
4273
+ 25 => 'Zakarpats\'ka Oblast\'',
4274
+ 26 => 'Zaporiz\'ka Oblast\'',
4275
+ 27 => 'Zhytomyrs\'ka Oblast\'',
4276
+ ),
4277
+ 'UG' =>
4278
+ array (
4279
+ 26 => 'Apac',
4280
+ 28 => 'Bundibugyo',
4281
+ 29 => 'Bushenyi',
4282
+ 30 => 'Gulu',
4283
+ 31 => 'Hoima',
4284
+ 33 => 'Jinja',
4285
+ 36 => 'Kalangala',
4286
+ 37 => 'Kampala',
4287
+ 38 => 'Kamuli',
4288
+ 39 => 'Kapchorwa',
4289
+ 40 => 'Kasese',
4290
+ 41 => 'Kibale',
4291
+ 42 => 'Kiboga',
4292
+ 43 => 'Kisoro',
4293
+ 45 => 'Kotido',
4294
+ 46 => 'Kumi',
4295
+ 47 => 'Lira',
4296
+ 50 => 'Masindi',
4297
+ 52 => 'Mbarara',
4298
+ 56 => 'Mubende',
4299
+ 58 => 'Nebbi',
4300
+ 59 => 'Ntungamo',
4301
+ 60 => 'Pallisa',
4302
+ 61 => 'Rakai',
4303
+ 65 => 'Adjumani',
4304
+ 66 => 'Bugiri',
4305
+ 67 => 'Busia',
4306
+ 69 => 'Katakwi',
4307
+ 70 => 'Luwero',
4308
+ 71 => 'Masaka',
4309
+ 72 => 'Moyo',
4310
+ 73 => 'Nakasongola',
4311
+ 74 => 'Sembabule',
4312
+ 76 => 'Tororo',
4313
+ 77 => 'Arua',
4314
+ 78 => 'Iganga',
4315
+ 79 => 'Kabarole',
4316
+ 80 => 'Kaberamaido',
4317
+ 81 => 'Kamwenge',
4318
+ 82 => 'Kanungu',
4319
+ 83 => 'Kayunga',
4320
+ 84 => 'Kitgum',
4321
+ 85 => 'Kyenjojo',
4322
+ 86 => 'Mayuge',
4323
+ 87 => 'Mbale',
4324
+ 88 => 'Moroto',
4325
+ 89 => 'Mpigi',
4326
+ 90 => 'Mukono',
4327
+ 91 => 'Nakapiripirit',
4328
+ 92 => 'Pader',
4329
+ 93 => 'Rukungiri',
4330
+ 94 => 'Sironko',
4331
+ 95 => 'Soroti',
4332
+ 96 => 'Wakiso',
4333
+ 97 => 'Yumbe',
4334
+ ),
4335
+ 'US' =>
4336
+ array (
4337
+ 'AA' => 'Armed Forces Americas',
4338
+ 'AE' => 'Armed Forces Europe',
4339
+ 'AK' => 'Alaska',
4340
+ 'AL' => 'Alabama',
4341
+ 'AP' => 'Armed Forces Pacific',
4342
+ 'AR' => 'Arkansas',
4343
+ 'AS' => 'American Samoa',
4344
+ 'AZ' => 'Arizona',
4345
+ 'CA' => 'California',
4346
+ 'CO' => 'Colorado',
4347
+ 'CT' => 'Connecticut',
4348
+ 'DC' => 'District of Columbia',
4349
+ 'DE' => 'Delaware',
4350
+ 'FL' => 'Florida',
4351
+ 'FM' => 'Federated States of Micronesia',
4352
+ 'GA' => 'Georgia',
4353
+ 'GU' => 'Guam',
4354
+ 'HI' => 'Hawaii',
4355
+ 'IA' => 'Iowa',
4356
+ 'ID' => 'Idaho',
4357
+ 'IL' => 'Illinois',
4358
+ 'IN' => 'Indiana',
4359
+ 'KS' => 'Kansas',
4360
+ 'KY' => 'Kentucky',
4361
+ 'LA' => 'Louisiana',
4362
+ 'MA' => 'Massachusetts',
4363
+ 'MD' => 'Maryland',
4364
+ 'ME' => 'Maine',
4365
+ 'MH' => 'Marshall Islands',
4366
+ 'MI' => 'Michigan',
4367
+ 'MN' => 'Minnesota',
4368
+ 'MO' => 'Missouri',
4369
+ 'MP' => 'Northern Mariana Islands',
4370
+ 'MS' => 'Mississippi',
4371
+ 'MT' => 'Montana',
4372
+ 'NC' => 'North Carolina',
4373
+ 'ND' => 'North Dakota',
4374
+ 'NE' => 'Nebraska',
4375
+ 'NH' => 'New Hampshire',
4376
+ 'NJ' => 'New Jersey',
4377
+ 'NM' => 'New Mexico',
4378
+ 'NV' => 'Nevada',
4379
+ 'NY' => 'New York',
4380
+ 'OH' => 'Ohio',
4381
+ 'OK' => 'Oklahoma',
4382
+ 'OR' => 'Oregon',
4383
+ 'PA' => 'Pennsylvania',
4384
+ 'PW' => 'Palau',
4385
+ 'RI' => 'Rhode Island',
4386
+ 'SC' => 'South Carolina',
4387
+ 'SD' => 'South Dakota',
4388
+ 'TN' => 'Tennessee',
4389
+ 'TX' => 'Texas',
4390
+ 'UT' => 'Utah',
4391
+ 'VA' => 'Virginia',
4392
+ 'VI' => 'Virgin Islands',
4393
+ 'VT' => 'Vermont',
4394
+ 'WA' => 'Washington',
4395
+ 'WI' => 'Wisconsin',
4396
+ 'WV' => 'West Virginia',
4397
+ 'WY' => 'Wyoming',
4398
+ ),
4399
+ 'UY' =>
4400
+ array (
4401
+ '01' => 'Artigas',
4402
+ '02' => 'Canelones',
4403
+ '03' => 'Cerro Largo',
4404
+ '04' => 'Colonia',
4405
+ '05' => 'Durazno',
4406
+ '06' => 'Flores',
4407
+ '07' => 'Florida',
4408
+ '08' => 'Lavalleja',
4409
+ '09' => 'Maldonado',
4410
+ 10 => 'Montevideo',
4411
+ 11 => 'Paysandu',
4412
+ 12 => 'Rio Negro',
4413
+ 13 => 'Rivera',
4414
+ 14 => 'Rocha',
4415
+ 15 => 'Salto',
4416
+ 16 => 'San Jose',
4417
+ 17 => 'Soriano',
4418
+ 18 => 'Tacuarembo',
4419
+ 19 => 'Treinta y Tres',
4420
+ ),
4421
+ 'UZ' =>
4422
+ array (
4423
+ '01' => 'Andijon',
4424
+ '02' => 'Bukhoro',
4425
+ '03' => 'Farghona',
4426
+ '04' => 'Jizzakh',
4427
+ '05' => 'Khorazm',
4428
+ '06' => 'Namangan',
4429
+ '07' => 'Nawoiy',
4430
+ '08' => 'Qashqadaryo',
4431
+ '09' => 'Qoraqalpoghiston',
4432
+ 10 => 'Samarqand',
4433
+ 11 => 'Sirdaryo',
4434
+ 12 => 'Surkhondaryo',
4435
+ 14 => 'Toshkent',
4436
+ ),
4437
+ 'VC' =>
4438
+ array (
4439
+ '01' => 'Charlotte',
4440
+ '02' => 'Saint Andrew',
4441
+ '03' => 'Saint David',
4442
+ '04' => 'Saint George',
4443
+ '05' => 'Saint Patrick',
4444
+ '06' => 'Grenadines',
4445
+ ),
4446
+ 'VE' =>
4447
+ array (
4448
+ '01' => 'Amazonas',
4449
+ '02' => 'Anzoategui',
4450
+ '03' => 'Apure',
4451
+ '04' => 'Aragua',
4452
+ '05' => 'Barinas',
4453
+ '06' => 'Bolivar',
4454
+ '07' => 'Carabobo',
4455
+ '08' => 'Cojedes',
4456
+ '09' => 'Delta Amacuro',
4457
+ 11 => 'Falcon',
4458
+ 12 => 'Guarico',
4459
+ 13 => 'Lara',
4460
+ 14 => 'Merida',
4461
+ 15 => 'Miranda',
4462
+ 16 => 'Monagas',
4463
+ 17 => 'Nueva Esparta',
4464
+ 18 => 'Portuguesa',
4465
+ 19 => 'Sucre',
4466
+ 20 => 'Tachira',
4467
+ 21 => 'Trujillo',
4468
+ 22 => 'Yaracuy',
4469
+ 23 => 'Zulia',
4470
+ 24 => 'Dependencias Federales',
4471
+ 25 => 'Distrito Federal',
4472
+ 26 => 'Vargas',
4473
+ ),
4474
+ 'VN' =>
4475
+ array (
4476
+ '01' => 'An Giang',
4477
+ '03' => 'Ben Tre',
4478
+ '05' => 'Cao Bang',
4479
+ '09' => 'Dong Thap',
4480
+ 13 => 'Hai Phong',
4481
+ 20 => 'Ho Chi Minh',
4482
+ 21 => 'Kien Giang',
4483
+ 23 => 'Lam Dong',
4484
+ 24 => 'Long An',
4485
+ 30 => 'Quang Ninh',
4486
+ 32 => 'Son La',
4487
+ 33 => 'Tay Ninh',
4488
+ 34 => 'Thanh Hoa',
4489
+ 35 => 'Thai Binh',
4490
+ 37 => 'Tien Giang',
4491
+ 39 => 'Lang Son',
4492
+ 43 => 'Dong Nai',
4493
+ 44 => 'Ha Noi',
4494
+ 45 => 'Ba Ria-Vung Tau',
4495
+ 46 => 'Binh Dinh',
4496
+ 47 => 'Binh Thuan',
4497
+ 49 => 'Gia Lai',
4498
+ 50 => 'Ha Giang',
4499
+ 52 => 'Ha Tinh',
4500
+ 53 => 'Hoa Binh',
4501
+ 54 => 'Khanh Hoa',
4502
+ 55 => 'Kon Tum',
4503
+ 58 => 'Nghe An',
4504
+ 59 => 'Ninh Binh',
4505
+ 60 => 'Ninh Thuan',
4506
+ 61 => 'Phu Yen',
4507
+ 62 => 'Quang Binh',
4508
+ 63 => 'Quang Ngai',
4509
+ 64 => 'Quang Tri',
4510
+ 65 => 'Soc Trang',
4511
+ 66 => 'Thua Thien-Hue',
4512
+ 67 => 'Tra Vinh',
4513
+ 68 => 'Tuyen Quang',
4514
+ 69 => 'Vinh Long',
4515
+ 70 => 'Yen Bai',
4516
+ 71 => 'Bac Giang',
4517
+ 72 => 'Bac Kan',
4518
+ 73 => 'Bac Lieu',
4519
+ 74 => 'Bac Ninh',
4520
+ 75 => 'Binh Duong',
4521
+ 76 => 'Binh Phuoc',
4522
+ 77 => 'Ca Mau',
4523
+ 78 => 'Da Nang',
4524
+ 79 => 'Hai Duong',
4525
+ 80 => 'Ha Nam',
4526
+ 81 => 'Hung Yen',
4527
+ 82 => 'Nam Dinh',
4528
+ 83 => 'Phu Tho',
4529
+ 84 => 'Quang Nam',
4530
+ 85 => 'Thai Nguyen',
4531
+ 86 => 'Vinh Phuc',
4532
+ 87 => 'Can Tho',
4533
+ 88 => 'Dac Lak',
4534
+ 89 => 'Lai Chau',
4535
+ 90 => 'Lao Cai',
4536
+ 91 => 'Dak Nong',
4537
+ 92 => 'Dien Bien',
4538
+ 93 => 'Hau Giang',
4539
+ ),
4540
+ 'VU' =>
4541
+ array (
4542
+ '05' => 'Ambrym',
4543
+ '06' => 'Aoba',
4544
+ '07' => 'Torba',
4545
+ '08' => 'Efate',
4546
+ '09' => 'Epi',
4547
+ 10 => 'Malakula',
4548
+ 11 => 'Paama',
4549
+ 12 => 'Pentecote',
4550
+ 13 => 'Sanma',
4551
+ 14 => 'Shepherd',
4552
+ 15 => 'Tafea',
4553
+ 16 => 'Malampa',
4554
+ 17 => 'Penama',
4555
+ 18 => 'Shefa',
4556
+ ),
4557
+ 'WS' =>
4558
+ array (
4559
+ '02' => 'Aiga-i-le-Tai',
4560
+ '03' => 'Atua',
4561
+ '04' => 'Fa',
4562
+ '05' => 'Gaga',
4563
+ '06' => 'Va',
4564
+ '07' => 'Gagaifomauga',
4565
+ '08' => 'Palauli',
4566
+ '09' => 'Satupa',
4567
+ 10 => 'Tuamasaga',
4568
+ 11 => 'Vaisigano',
4569
+ ),
4570
+ 'YE' =>
4571
+ array (
4572
+ '01' => 'Abyan',
4573
+ '02' => 'Adan',
4574
+ '03' => 'Al Mahrah',
4575
+ '04' => 'Hadramawt',
4576
+ '05' => 'Shabwah',
4577
+ 24 => 'Lahij',
4578
+ 20 => 'Al Bayda\'',
4579
+ '08' => 'Al Hudaydah',
4580
+ 21 => 'Al Jawf',
4581
+ 10 => 'Al Mahwit',
4582
+ 11 => 'Dhamar',
4583
+ 22 => 'Hajjah',
4584
+ 23 => 'Ibb',
4585
+ 14 => 'Ma\'rib',
4586
+ 15 => 'Sa\'dah',
4587
+ 16 => 'San\'a\'',
4588
+ 25 => 'Taizz',
4589
+ 18 => 'Ad Dali',
4590
+ 19 => 'Amran',
4591
+ ),
4592
+ 'ZA' =>
4593
+ array (
4594
+ '01' => 'North-Western Province',
4595
+ '02' => 'KwaZulu-Natal',
4596
+ '03' => 'Free State',
4597
+ '05' => 'Eastern Cape',
4598
+ '06' => 'Gauteng',
4599
+ '07' => 'Mpumalanga',
4600
+ '08' => 'Northern Cape',
4601
+ '09' => 'Limpopo',
4602
+ 10 => 'North-West',
4603
+ 11 => 'Western Cape',
4604
+ ),
4605
+ 'ZM' =>
4606
+ array (
4607
+ '01' => 'Western',
4608
+ '02' => 'Central',
4609
+ '03' => 'Eastern',
4610
+ '04' => 'Luapula',
4611
+ '05' => 'Northern',
4612
+ '06' => 'North-Western',
4613
+ '07' => 'Southern',
4614
+ '08' => 'Copperbelt',
4615
+ '09' => 'Lusaka',
4616
+ ),
4617
+ 'ZW' =>
4618
+ array (
4619
+ '01' => 'Manicaland',
4620
+ '02' => 'Midlands',
4621
+ '03' => 'Mashonaland Central',
4622
+ '04' => 'Mashonaland East',
4623
+ '05' => 'Mashonaland West',
4624
+ '06' => 'Matabeleland North',
4625
+ '07' => 'Matabeleland South',
4626
+ '08' => 'Masvingo',
4627
+ '09' => 'Bulawayo',
4628
+ 10 => 'Harare',
4629
+ ),
4630
+ );
geoip/src/timezone.php ADDED
@@ -0,0 +1,2235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function get_time_zone($country, $region)
3
+ {
4
+ switch ($country) {
5
+ case "AD":
6
+ $timezone = "Europe/Andorra";
7
+ break;
8
+ case "AE":
9
+ $timezone = "Asia/Dubai";
10
+ break;
11
+ case "AF":
12
+ $timezone = "Asia/Kabul";
13
+ break;
14
+ case "AG":
15
+ $timezone = "America/Antigua";
16
+ break;
17
+ case "AI":
18
+ $timezone = "America/Anguilla";
19
+ break;
20
+ case "AL":
21
+ $timezone = "Europe/Tirane";
22
+ break;
23
+ case "AM":
24
+ $timezone = "Asia/Yerevan";
25
+ break;
26
+ case "AN":
27
+ $timezone = "America/Curacao";
28
+ break;
29
+ case "AO":
30
+ $timezone = "Africa/Luanda";
31
+ break;
32
+ case "AQ":
33
+ $timezone = "Antarctica/South_Pole";
34
+ break;
35
+ case "AR":
36
+ switch ($region) {
37
+ case "01":
38
+ $timezone = "America/Argentina/Buenos_Aires";
39
+ break;
40
+ case "02":
41
+ $timezone = "America/Argentina/Catamarca";
42
+ break;
43
+ case "03":
44
+ $timezone = "America/Argentina/Tucuman";
45
+ break;
46
+ case "04":
47
+ $timezone = "America/Argentina/Rio_Gallegos";
48
+ break;
49
+ case "05":
50
+ $timezone = "America/Argentina/Cordoba";
51
+ break;
52
+ case "06":
53
+ $timezone = "America/Argentina/Tucuman";
54
+ break;
55
+ case "07":
56
+ $timezone = "America/Argentina/Buenos_Aires";
57
+ break;
58
+ case "08":
59
+ $timezone = "America/Argentina/Buenos_Aires";
60
+ break;
61
+ case "09":
62
+ $timezone = "America/Argentina/Tucuman";
63
+ break;
64
+ case "10":
65
+ $timezone = "America/Argentina/Jujuy";
66
+ break;
67
+ case "11":
68
+ $timezone = "America/Argentina/San_Luis";
69
+ break;
70
+ case "12":
71
+ $timezone = "America/Argentina/La_Rioja";
72
+ break;
73
+ case "13":
74
+ $timezone = "America/Argentina/Mendoza";
75
+ break;
76
+ case "14":
77
+ $timezone = "America/Argentina/Buenos_Aires";
78
+ break;
79
+ case "15":
80
+ $timezone = "America/Argentina/San_Luis";
81
+ break;
82
+ case "16":
83
+ $timezone = "America/Argentina/Buenos_Aires";
84
+ break;
85
+ case "17":
86
+ $timezone = "America/Argentina/Salta";
87
+ break;
88
+ case "18":
89
+ $timezone = "America/Argentina/San_Juan";
90
+ break;
91
+ case "19":
92
+ $timezone = "America/Argentina/San_Luis";
93
+ break;
94
+ case "20":
95
+ $timezone = "America/Argentina/Rio_Gallegos";
96
+ break;
97
+ case "21":
98
+ $timezone = "America/Argentina/Buenos_Aires";
99
+ break;
100
+ case "22":
101
+ $timezone = "America/Argentina/Catamarca";
102
+ break;
103
+ case "23":
104
+ $timezone = "America/Argentina/Ushuaia";
105
+ break;
106
+ case "24":
107
+ $timezone = "America/Argentina/Tucuman";
108
+ break;
109
+ }
110
+ break;
111
+ case "AS":
112
+ $timezone = "Pacific/Pago_Pago";
113
+ break;
114
+ case "AT":
115
+ $timezone = "Europe/Vienna";
116
+ break;
117
+ case "AU":
118
+ switch ($region) {
119
+ case "01":
120
+ $timezone = "Australia/Sydney";
121
+ break;
122
+ case "02":
123
+ $timezone = "Australia/Sydney";
124
+ break;
125
+ case "03":
126
+ $timezone = "Australia/Darwin";
127
+ break;
128
+ case "04":
129
+ $timezone = "Australia/Brisbane";
130
+ break;
131
+ case "05":
132
+ $timezone = "Australia/Adelaide";
133
+ break;
134
+ case "06":
135
+ $timezone = "Australia/Hobart";
136
+ break;
137
+ case "07":
138
+ $timezone = "Australia/Melbourne";
139
+ break;
140
+ case "08":
141
+ $timezone = "Australia/Perth";
142
+ break;
143
+ }
144
+ break;
145
+ case "AW":
146
+ $timezone = "America/Aruba";
147
+ break;
148
+ case "AX":
149
+ $timezone = "Europe/Mariehamn";
150
+ break;
151
+ case "AZ":
152
+ $timezone = "Asia/Baku";
153
+ break;
154
+ case "BA":
155
+ $timezone = "Europe/Sarajevo";
156
+ break;
157
+ case "BB":
158
+ $timezone = "America/Barbados";
159
+ break;
160
+ case "BD":
161
+ $timezone = "Asia/Dhaka";
162
+ break;
163
+ case "BE":
164
+ $timezone = "Europe/Brussels";
165
+ break;
166
+ case "BF":
167
+ $timezone = "Africa/Ouagadougou";
168
+ break;
169
+ case "BG":
170
+ $timezone = "Europe/Sofia";
171
+ break;
172
+ case "BH":
173
+ $timezone = "Asia/Bahrain";
174
+ break;
175
+ case "BI":
176
+ $timezone = "Africa/Bujumbura";
177
+ break;
178
+ case "BJ":
179
+ $timezone = "Africa/Porto-Novo";
180
+ break;
181
+ case "BL":
182
+ $timezone = "America/St_Barthelemy";
183
+ break;
184
+ case "BM":
185
+ $timezone = "Atlantic/Bermuda";
186
+ break;
187
+ case "BN":
188
+ $timezone = "Asia/Brunei";
189
+ break;
190
+ case "BO":
191
+ $timezone = "America/La_Paz";
192
+ break;
193
+ case "BQ":
194
+ $timezone = "America/Curacao";
195
+ break;
196
+ case "BR":
197
+ switch ($region) {
198
+ case "01":
199
+ $timezone = "America/Rio_Branco";
200
+ break;
201
+ case "02":
202
+ $timezone = "America/Maceio";
203
+ break;
204
+ case "03":
205
+ $timezone = "America/Sao_Paulo";
206
+ break;
207
+ case "04":
208
+ $timezone = "America/Manaus";
209
+ break;
210
+ case "05":
211
+ $timezone = "America/Bahia";
212
+ break;
213
+ case "06":
214
+ $timezone = "America/Fortaleza";
215
+ break;
216
+ case "07":
217
+ $timezone = "America/Sao_Paulo";
218
+ break;
219
+ case "08":
220
+ $timezone = "America/Sao_Paulo";
221
+ break;
222
+ case "11":
223
+ $timezone = "America/Campo_Grande";
224
+ break;
225
+ case "13":
226
+ $timezone = "America/Belem";
227
+ break;
228
+ case "14":
229
+ $timezone = "America/Cuiaba";
230
+ break;
231
+ case "15":
232
+ $timezone = "America/Sao_Paulo";
233
+ break;
234
+ case "16":
235
+ $timezone = "America/Belem";
236
+ break;
237
+ case "17":
238
+ $timezone = "America/Recife";
239
+ break;
240
+ case "18":
241
+ $timezone = "America/Sao_Paulo";
242
+ break;
243
+ case "20":
244
+ $timezone = "America/Fortaleza";
245
+ break;
246
+ case "21":
247
+ $timezone = "America/Sao_Paulo";
248
+ break;
249
+ case "22":
250
+ $timezone = "America/Recife";
251
+ break;
252
+ case "23":
253
+ $timezone = "America/Sao_Paulo";
254
+ break;
255
+ case "24":
256
+ $timezone = "America/Porto_Velho";
257
+ break;
258
+ case "25":
259
+ $timezone = "America/Boa_Vista";
260
+ break;
261
+ case "26":
262
+ $timezone = "America/Sao_Paulo";
263
+ break;
264
+ case "27":
265
+ $timezone = "America/Sao_Paulo";
266
+ break;
267
+ case "28":
268
+ $timezone = "America/Maceio";
269
+ break;
270
+ case "29":
271
+ $timezone = "America/Sao_Paulo";
272
+ break;
273
+ case "30":
274
+ $timezone = "America/Recife";
275
+ break;
276
+ case "31":
277
+ $timezone = "America/Araguaina";
278
+ break;
279
+ }
280
+ break;
281
+ case "BS":
282
+ $timezone = "America/Nassau";
283
+ break;
284
+ case "BT":
285
+ $timezone = "Asia/Thimphu";
286
+ break;
287
+ case "BV":
288
+ $timezone = "Antarctica/Syowa";
289
+ break;
290
+ case "BW":
291
+ $timezone = "Africa/Gaborone";
292
+ break;
293
+ case "BY":
294
+ $timezone = "Europe/Minsk";
295
+ break;
296
+ case "BZ":
297
+ $timezone = "America/Belize";
298
+ break;
299
+ case "CA":
300
+ switch ($region) {
301
+ case "AB":
302
+ $timezone = "America/Edmonton";
303
+ break;
304
+ case "BC":
305
+ $timezone = "America/Vancouver";
306
+ break;
307
+ case "MB":
308
+ $timezone = "America/Winnipeg";
309
+ break;
310
+ case "NB":
311
+ $timezone = "America/Halifax";
312
+ break;
313
+ case "NL":
314
+ $timezone = "America/St_Johns";
315
+ break;
316
+ case "NS":
317
+ $timezone = "America/Halifax";
318
+ break;
319
+ case "NT":
320
+ $timezone = "America/Yellowknife";
321
+ break;
322
+ case "NU":
323
+ $timezone = "America/Rankin_Inlet";
324
+ break;
325
+ case "ON":
326
+ $timezone = "America/Toronto";
327
+ break;
328
+ case "PE":
329
+ $timezone = "America/Halifax";
330
+ break;
331
+ case "QC":
332
+ $timezone = "America/Montreal";
333
+ break;
334
+ case "SK":
335
+ $timezone = "America/Regina";
336
+ break;
337
+ case "YT":
338
+ $timezone = "America/Whitehorse";
339
+ break;
340
+ }
341
+ break;
342
+ case "CC":
343
+ $timezone = "Indian/Cocos";
344
+ break;
345
+ case "CD":
346
+ switch ($region) {
347
+ case "01":
348
+ $timezone = "Africa/Kinshasa";
349
+ break;
350
+ case "02":
351
+ $timezone = "Africa/Kinshasa";
352
+ break;
353
+ case "03":
354
+ $timezone = "Africa/Kinshasa";
355
+ break;
356
+ case "04":
357
+ $timezone = "Africa/Lubumbashi";
358
+ break;
359
+ case "05":
360
+ $timezone = "Africa/Lubumbashi";
361
+ break;
362
+ case "06":
363
+ $timezone = "Africa/Kinshasa";
364
+ break;
365
+ case "07":
366
+ $timezone = "Africa/Lubumbashi";
367
+ break;
368
+ case "08":
369
+ $timezone = "Africa/Kinshasa";
370
+ break;
371
+ case "09":
372
+ $timezone = "Africa/Lubumbashi";
373
+ break;
374
+ case "10":
375
+ $timezone = "Africa/Lubumbashi";
376
+ break;
377
+ case "11":
378
+ $timezone = "Africa/Lubumbashi";
379
+ break;
380
+ case "12":
381
+ $timezone = "Africa/Lubumbashi";
382
+ break;
383
+ }
384
+ break;
385
+ case "CF":
386
+ $timezone = "Africa/Bangui";
387
+ break;
388
+ case "CG":
389
+ $timezone = "Africa/Brazzaville";
390
+ break;
391
+ case "CH":
392
+ $timezone = "Europe/Zurich";
393
+ break;
394
+ case "CI":
395
+ $timezone = "Africa/Abidjan";
396
+ break;
397
+ case "CK":
398
+ $timezone = "Pacific/Rarotonga";
399
+ break;
400
+ case "CL":
401
+ $timezone = "America/Santiago";
402
+ break;
403
+ case "CM":
404
+ $timezone = "Africa/Lagos";
405
+ break;
406
+ case "CN":
407
+ switch ($region) {
408
+ case "01":
409
+ $timezone = "Asia/Shanghai";
410
+ break;
411
+ case "02":
412
+ $timezone = "Asia/Shanghai";
413
+ break;
414
+ case "03":
415
+ $timezone = "Asia/Shanghai";
416
+ break;
417
+ case "04":
418
+ $timezone = "Asia/Shanghai";
419
+ break;
420
+ case "05":
421
+ $timezone = "Asia/Harbin";
422
+ break;
423
+ case "06":
424
+ $timezone = "Asia/Chongqing";
425
+ break;
426
+ case "07":
427
+ $timezone = "Asia/Shanghai";
428
+ break;
429
+ case "08":
430
+ $timezone = "Asia/Harbin";
431
+ break;
432
+ case "09":
433
+ $timezone = "Asia/Shanghai";
434
+ break;
435
+ case "10":
436
+ $timezone = "Asia/Shanghai";
437
+ break;
438
+ case "11":
439
+ $timezone = "Asia/Chongqing";
440
+ break;
441
+ case "12":
442
+ $timezone = "Asia/Shanghai";
443
+ break;
444
+ case "13":
445
+ $timezone = "Asia/Urumqi";
446
+ break;
447
+ case "14":
448
+ $timezone = "Asia/Chongqing";
449
+ break;
450
+ case "15":
451
+ $timezone = "Asia/Chongqing";
452
+ break;
453
+ case "16":
454
+ $timezone = "Asia/Chongqing";
455
+ break;
456
+ case "18":
457
+ $timezone = "Asia/Chongqing";
458
+ break;
459
+ case "19":
460
+ $timezone = "Asia/Harbin";
461
+ break;
462
+ case "20":
463
+ $timezone = "Asia/Harbin";
464
+ break;
465
+ case "21":
466
+ $timezone = "Asia/Chongqing";
467
+ break;
468
+ case "22":
469
+ $timezone = "Asia/Harbin";
470
+ break;
471
+ case "23":
472
+ $timezone = "Asia/Shanghai";
473
+ break;
474
+ case "24":
475
+ $timezone = "Asia/Chongqing";
476
+ break;
477
+ case "25":
478
+ $timezone = "Asia/Shanghai";
479
+ break;
480
+ case "26":
481
+ $timezone = "Asia/Chongqing";
482
+ break;
483
+ case "28":
484
+ $timezone = "Asia/Shanghai";
485
+ break;
486
+ case "29":
487
+ $timezone = "Asia/Chongqing";
488
+ break;
489
+ case "30":
490
+ $timezone = "Asia/Chongqing";
491
+ break;
492
+ case "31":
493
+ $timezone = "Asia/Chongqing";
494
+ break;
495
+ case "32":
496
+ $timezone = "Asia/Chongqing";
497
+ break;
498
+ case "33":
499
+ $timezone = "Asia/Chongqing";
500
+ break;
501
+ }
502
+ break;
503
+ case "CO":
504
+ $timezone = "America/Bogota";
505
+ break;
506
+ case "CR":
507
+ $timezone = "America/Costa_Rica";
508
+ break;
509
+ case "CU":
510
+ $timezone = "America/Havana";
511
+ break;
512
+ case "CV":
513
+ $timezone = "Atlantic/Cape_Verde";
514
+ break;
515
+ case "CW":
516
+ $timezone = "America/Curacao";
517
+ break;
518
+ case "CX":
519
+ $timezone = "Indian/Christmas";
520
+ break;
521
+ case "CY":
522
+ $timezone = "Asia/Nicosia";
523
+ break;
524
+ case "CZ":
525
+ $timezone = "Europe/Prague";
526
+ break;
527
+ case "DE":
528
+ $timezone = "Europe/Berlin";
529
+ break;
530
+ case "DJ":
531
+ $timezone = "Africa/Djibouti";
532
+ break;
533
+ case "DK":
534
+ $timezone = "Europe/Copenhagen";
535
+ break;
536
+ case "DM":
537
+ $timezone = "America/Dominica";
538
+ break;
539
+ case "DO":
540
+ $timezone = "America/Santo_Domingo";
541
+ break;
542
+ case "DZ":
543
+ $timezone = "Africa/Algiers";
544
+ break;
545
+ case "EC":
546
+ switch ($region) {
547
+ case "01":
548
+ $timezone = "Pacific/Galapagos";
549
+ break;
550
+ case "02":
551
+ $timezone = "America/Guayaquil";
552
+ break;
553
+ case "03":
554
+ $timezone = "America/Guayaquil";
555
+ break;
556
+ case "04":
557
+ $timezone = "America/Guayaquil";
558
+ break;
559
+ case "05":
560
+ $timezone = "America/Guayaquil";
561
+ break;
562
+ case "06":
563
+ $timezone = "America/Guayaquil";
564
+ break;
565
+ case "07":
566
+ $timezone = "America/Guayaquil";
567
+ break;
568
+ case "08":
569
+ $timezone = "America/Guayaquil";
570
+ break;
571
+ case "09":
572
+ $timezone = "America/Guayaquil";
573
+ break;
574
+ case "10":
575
+ $timezone = "America/Guayaquil";
576
+ break;
577
+ case "11":
578
+ $timezone = "America/Guayaquil";
579
+ break;
580
+ case "12":
581
+ $timezone = "America/Guayaquil";
582
+ break;
583
+ case "13":
584
+ $timezone = "America/Guayaquil";
585
+ break;
586
+ case "14":
587
+ $timezone = "America/Guayaquil";
588
+ break;
589
+ case "15":
590
+ $timezone = "America/Guayaquil";
591
+ break;
592
+ case "17":
593
+ $timezone = "America/Guayaquil";
594
+ break;
595
+ case "18":
596
+ $timezone = "America/Guayaquil";
597
+ break;
598
+ case "19":
599
+ $timezone = "America/Guayaquil";
600
+ break;
601
+ case "20":
602
+ $timezone = "America/Guayaquil";
603
+ break;
604
+ case "22":
605
+ $timezone = "America/Guayaquil";
606
+ break;
607
+ case "24":
608
+ $timezone = "America/Guayaquil";
609
+ break;
610
+ }
611
+ break;
612
+ case "EE":
613
+ $timezone = "Europe/Tallinn";
614
+ break;
615
+ case "EG":
616
+ $timezone = "Africa/Cairo";
617
+ break;
618
+ case "EH":
619
+ $timezone = "Africa/El_Aaiun";
620
+ break;
621
+ case "ER":
622
+ $timezone = "Africa/Asmara";
623
+ break;
624
+ case "ES":
625
+ switch ($region) {
626
+ case "07":
627
+ $timezone = "Europe/Madrid";
628
+ break;
629
+ case "27":
630
+ $timezone = "Europe/Madrid";
631
+ break;
632
+ case "29":
633
+ $timezone = "Europe/Madrid";
634
+ break;
635
+ case "31":
636
+ $timezone = "Europe/Madrid";
637
+ break;
638
+ case "32":
639
+ $timezone = "Europe/Madrid";
640
+ break;
641
+ case "34":
642
+ $timezone = "Europe/Madrid";
643
+ break;
644
+ case "39":
645
+ $timezone = "Europe/Madrid";
646
+ break;
647
+ case "51":
648
+ $timezone = "Africa/Ceuta";
649
+ break;
650
+ case "52":
651
+ $timezone = "Europe/Madrid";
652
+ break;
653
+ case "53":
654
+ $timezone = "Atlantic/Canary";
655
+ break;
656
+ case "54":
657
+ $timezone = "Europe/Madrid";
658
+ break;
659
+ case "55":
660
+ $timezone = "Europe/Madrid";
661
+ break;
662
+ case "56":
663
+ $timezone = "Europe/Madrid";
664
+ break;
665
+ case "57":
666
+ $timezone = "Europe/Madrid";
667
+ break;
668
+ case "58":
669
+ $timezone = "Europe/Madrid";
670
+ break;
671
+ case "59":
672
+ $timezone = "Europe/Madrid";
673
+ break;
674
+ case "60":
675
+ $timezone = "Europe/Madrid";
676
+ break;
677
+ }
678
+ break;
679
+ case "ET":
680
+ $timezone = "Africa/Addis_Ababa";
681
+ break;
682
+ case "FI":
683
+ $timezone = "Europe/Helsinki";
684
+ break;
685
+ case "FJ":
686
+ $timezone = "Pacific/Fiji";
687
+ break;
688
+ case "FK":
689
+ $timezone = "Atlantic/Stanley";
690
+ break;
691
+ case "FM":
692
+ $timezone = "Pacific/Pohnpei";
693
+ break;
694
+ case "FO":
695
+ $timezone = "Atlantic/Faroe";
696
+ break;
697
+ case "FR":
698
+ $timezone = "Europe/Paris";
699
+ break;
700
+ case "FX":
701
+ $timezone = "Europe/Paris";
702
+ break;
703
+ case "GA":
704
+ $timezone = "Africa/Libreville";
705
+ break;
706
+ case "GB":
707
+ $timezone = "Europe/London";
708
+ break;
709
+ case "GD":
710
+ $timezone = "America/Grenada";
711
+ break;
712
+ case "GE":
713
+ $timezone = "Asia/Tbilisi";
714
+ break;
715
+ case "GF":
716
+ $timezone = "America/Cayenne";
717
+ break;
718
+ case "GG":
719
+ $timezone = "Europe/Guernsey";
720
+ break;
721
+ case "GH":
722
+ $timezone = "Africa/Accra";
723
+ break;
724
+ case "GI":
725
+ $timezone = "Europe/Gibraltar";
726
+ break;
727
+ case "GL":
728
+ switch ($region) {
729
+ case "01":
730
+ $timezone = "America/Thule";
731
+ break;
732
+ case "02":
733
+ $timezone = "America/Godthab";
734
+ break;
735
+ case "03":
736
+ $timezone = "America/Godthab";
737
+ break;
738
+ }
739
+ break;
740
+ case "GM":
741
+ $timezone = "Africa/Banjul";
742
+ break;
743
+ case "GN":
744
+ $timezone = "Africa/Conakry";
745
+ break;
746
+ case "GP":
747
+ $timezone = "America/Guadeloupe";
748
+ break;
749
+ case "GQ":
750
+ $timezone = "Africa/Malabo";
751
+ break;
752
+ case "GR":
753
+ $timezone = "Europe/Athens";
754
+ break;
755
+ case "GS":
756
+ $timezone = "Atlantic/South_Georgia";
757
+ break;
758
+ case "GT":
759
+ $timezone = "America/Guatemala";
760
+ break;
761
+ case "GU":
762
+ $timezone = "Pacific/Guam";
763
+ break;
764
+ case "GW":
765
+ $timezone = "Africa/Bissau";
766
+ break;
767
+ case "GY":
768
+ $timezone = "America/Guyana";
769
+ break;
770
+ case "HK":
771
+ $timezone = "Asia/Hong_Kong";
772
+ break;
773
+ case "HN":
774
+ $timezone = "America/Tegucigalpa";
775
+ break;
776
+ case "HR":
777
+ $timezone = "Europe/Zagreb";
778
+ break;
779
+ case "HT":
780
+ $timezone = "America/Port-au-Prince";
781
+ break;
782
+ case "HU":
783
+ $timezone = "Europe/Budapest";
784
+ break;
785
+ case "ID":
786
+ switch ($region) {
787
+ case "01":
788
+ $timezone = "Asia/Pontianak";
789
+ break;
790
+ case "02":
791
+ $timezone = "Asia/Makassar";
792
+ break;
793
+ case "03":
794
+ $timezone = "Asia/Jakarta";
795
+ break;
796
+ case "04":
797
+ $timezone = "Asia/Jakarta";
798
+ break;
799
+ case "05":
800
+ $timezone = "Asia/Jakarta";
801
+ break;
802
+ case "06":
803
+ $timezone = "Asia/Jakarta";
804
+ break;
805
+ case "07":
806
+ $timezone = "Asia/Jakarta";
807
+ break;
808
+ case "08":
809
+ $timezone = "Asia/Jakarta";
810
+ break;
811
+ case "09":
812
+ $timezone = "Asia/Jayapura";
813
+ break;
814
+ case "10":
815
+ $timezone = "Asia/Jakarta";
816
+ break;
817
+ case "11":
818
+ $timezone = "Asia/Pontianak";
819
+ break;
820
+ case "12":
821
+ $timezone = "Asia/Makassar";
822
+ break;
823
+ case "13":
824
+ $timezone = "Asia/Makassar";
825
+ break;
826
+ case "14":
827
+ $timezone = "Asia/Makassar";
828
+ break;
829
+ case "15":
830
+ $timezone = "Asia/Jakarta";
831
+ break;
832
+ case "16":
833
+ $timezone = "Asia/Makassar";
834
+ break;
835
+ case "17":
836
+ $timezone = "Asia/Makassar";
837
+ break;
838
+ case "18":
839
+ $timezone = "Asia/Makassar";
840
+ break;
841
+ case "19":
842
+ $timezone = "Asia/Pontianak";
843
+ break;
844
+ case "20":
845
+ $timezone = "Asia/Makassar";
846
+ break;
847
+ case "21":
848
+ $timezone = "Asia/Makassar";
849
+ break;
850
+ case "22":
851
+ $timezone = "Asia/Makassar";
852
+ break;
853
+ case "23":
854
+ $timezone = "Asia/Makassar";
855
+ break;
856
+ case "24":
857
+ $timezone = "Asia/Jakarta";
858
+ break;
859
+ case "25":
860
+ $timezone = "Asia/Pontianak";
861
+ break;
862
+ case "26":
863
+ $timezone = "Asia/Pontianak";
864
+ break;
865
+ case "28":
866
+ $timezone = "Asia/Jayapura";
867
+ break;
868
+ case "29":
869
+ $timezone = "Asia/Makassar";
870
+ break;
871
+ case "30":
872
+ $timezone = "Asia/Jakarta";
873
+ break;
874
+ case "31":
875
+ $timezone = "Asia/Makassar";
876
+ break;
877
+ case "32":
878
+ $timezone = "Asia/Jakarta";
879
+ break;
880
+ case "33":
881
+ $timezone = "Asia/Jakarta";
882
+ break;
883
+ case "34":
884
+ $timezone = "Asia/Makassar";
885
+ break;
886
+ case "35":
887
+ $timezone = "Asia/Pontianak";
888
+ break;
889
+ case "36":
890
+ $timezone = "Asia/Jayapura";
891
+ break;
892
+ case "37":
893
+ $timezone = "Asia/Pontianak";
894
+ break;
895
+ case "38":
896
+ $timezone = "Asia/Makassar";
897
+ break;
898
+ case "39":
899
+ $timezone = "Asia/Jayapura";
900
+ break;
901
+ case "40":
902
+ $timezone = "Asia/Pontianak";
903
+ break;
904
+ case "41":
905
+ $timezone = "Asia/Makassar";
906
+ break;
907
+ }
908
+ break;
909
+ case "IE":
910
+ $timezone = "Europe/Dublin";
911
+ break;
912
+ case "IL":
913
+ $timezone = "Asia/Jerusalem";
914
+ break;
915
+ case "IM":
916
+ $timezone = "Europe/Isle_of_Man";
917
+ break;
918
+ case "IN":
919
+ $timezone = "Asia/Kolkata";
920
+ break;
921
+ case "IO":
922
+ $timezone = "Indian/Chagos";
923
+ break;
924
+ case "IQ":
925
+ $timezone = "Asia/Baghdad";
926
+ break;
927
+ case "IR":
928
+ $timezone = "Asia/Tehran";
929
+ break;
930
+ case "IS":
931
+ $timezone = "Atlantic/Reykjavik";
932
+ break;
933
+ case "IT":
934
+ $timezone = "Europe/Rome";
935
+ break;
936
+ case "JE":
937
+ $timezone = "Europe/Jersey";
938
+ break;
939
+ case "JM":
940
+ $timezone = "America/Jamaica";
941
+ break;
942
+ case "JO":
943
+ $timezone = "Asia/Amman";
944
+ break;
945
+ case "JP":
946
+ $timezone = "Asia/Tokyo";
947
+ break;
948
+ case "KE":
949
+ $timezone = "Africa/Nairobi";
950
+ break;
951
+ case "KG":
952
+ $timezone = "Asia/Bishkek";
953
+ break;
954
+ case "KH":
955
+ $timezone = "Asia/Phnom_Penh";
956
+ break;
957
+ case "KI":
958
+ $timezone = "Pacific/Tarawa";
959
+ break;
960
+ case "KM":
961
+ $timezone = "Indian/Comoro";
962
+ break;
963
+ case "KN":
964
+ $timezone = "America/St_Kitts";
965
+ break;
966
+ case "KP":
967
+ $timezone = "Asia/Pyongyang";
968
+ break;
969
+ case "KR":
970
+ $timezone = "Asia/Seoul";
971
+ break;
972
+ case "KW":
973
+ $timezone = "Asia/Kuwait";
974
+ break;
975
+ case "KY":
976
+ $timezone = "America/Cayman";
977
+ break;
978
+ case "KZ":
979
+ switch ($region) {
980
+ case "01":
981
+ $timezone = "Asia/Almaty";
982
+ break;
983
+ case "02":
984
+ $timezone = "Asia/Almaty";
985
+ break;
986
+ case "03":
987
+ $timezone = "Asia/Qyzylorda";
988
+ break;
989
+ case "04":
990
+ $timezone = "Asia/Aqtobe";
991
+ break;
992
+ case "05":
993
+ $timezone = "Asia/Qyzylorda";
994
+ break;
995
+ case "06":
996
+ $timezone = "Asia/Aqtau";
997
+ break;
998
+ case "07":
999
+ $timezone = "Asia/Oral";
1000
+ break;
1001
+ case "08":
1002
+ $timezone = "Asia/Qyzylorda";
1003
+ break;
1004
+ case "09":
1005
+ $timezone = "Asia/Aqtau";
1006
+ break;
1007
+ case "10":
1008
+ $timezone = "Asia/Qyzylorda";
1009
+ break;
1010
+ case "11":
1011
+ $timezone = "Asia/Almaty";
1012
+ break;
1013
+ case "12":
1014
+ $timezone = "Asia/Qyzylorda";
1015
+ break;
1016
+ case "13":
1017
+ $timezone = "Asia/Aqtobe";
1018
+ break;
1019
+ case "14":
1020
+ $timezone = "Asia/Qyzylorda";
1021
+ break;
1022
+ case "15":
1023
+ $timezone = "Asia/Almaty";
1024
+ break;
1025
+ case "16":
1026
+ $timezone = "Asia/Aqtobe";
1027
+ break;
1028
+ case "17":
1029
+ $timezone = "Asia/Almaty";
1030
+ break;
1031
+ }
1032
+ break;
1033
+ case "LA":
1034
+ $timezone = "Asia/Vientiane";
1035
+ break;
1036
+ case "LB":
1037
+ $timezone = "Asia/Beirut";
1038
+ break;
1039
+ case "LC":
1040
+ $timezone = "America/St_Lucia";
1041
+ break;
1042
+ case "LI":
1043
+ $timezone = "Europe/Vaduz";
1044
+ break;
1045
+ case "LK":
1046
+ $timezone = "Asia/Colombo";
1047
+ break;
1048
+ case "LR":
1049
+ $timezone = "Africa/Monrovia";
1050
+ break;
1051
+ case "LS":
1052
+ $timezone = "Africa/Maseru";
1053
+ break;
1054
+ case "LT":
1055
+ $timezone = "Europe/Vilnius";
1056
+ break;
1057
+ case "LU":
1058
+ $timezone = "Europe/Luxembourg";
1059
+ break;
1060
+ case "LV":
1061
+ $timezone = "Europe/Riga";
1062
+ break;
1063
+ case "LY":
1064
+ $timezone = "Africa/Tripoli";
1065
+ break;
1066
+ case "MA":
1067
+ $timezone = "Africa/Casablanca";
1068
+ break;
1069
+ case "MC":
1070
+ $timezone = "Europe/Monaco";
1071
+ break;
1072
+ case "MD":
1073
+ $timezone = "Europe/Chisinau";
1074
+ break;
1075
+ case "ME":
1076
+ $timezone = "Europe/Podgorica";
1077
+ break;
1078
+ case "MF":
1079
+ $timezone = "America/Marigot";
1080
+ break;
1081
+ case "MG":
1082
+ $timezone = "Indian/Antananarivo";
1083
+ break;
1084
+ case "MH":
1085
+ $timezone = "Pacific/Kwajalein";
1086
+ break;
1087
+ case "MK":
1088
+ $timezone = "Europe/Skopje";
1089
+ break;
1090
+ case "ML":
1091
+ $timezone = "Africa/Bamako";
1092
+ break;
1093
+ case "MM":
1094
+ $timezone = "Asia/Rangoon";
1095
+ break;
1096
+ case "MN":
1097
+ switch ($region) {
1098
+ case "06":
1099
+ $timezone = "Asia/Choibalsan";
1100
+ break;
1101
+ case "11":
1102
+ $timezone = "Asia/Ulaanbaatar";
1103
+ break;
1104
+ case "17":
1105
+ $timezone = "Asia/Choibalsan";
1106
+ break;
1107
+ case "19":
1108
+ $timezone = "Asia/Hovd";
1109
+ break;
1110
+ case "20":
1111
+ $timezone = "Asia/Ulaanbaatar";
1112
+ break;
1113
+ case "21":
1114
+ $timezone = "Asia/Ulaanbaatar";
1115
+ break;
1116
+ case "25":
1117
+ $timezone = "Asia/Ulaanbaatar";
1118
+ break;
1119
+ }
1120
+ break;
1121
+ case "MO":
1122
+ $timezone = "Asia/Macau";
1123
+ break;
1124
+ case "MP":
1125
+ $timezone = "Pacific/Saipan";
1126
+ break;
1127
+ case "MQ":
1128
+ $timezone = "America/Martinique";
1129
+ break;
1130
+ case "MR":
1131
+ $timezone = "Africa/Nouakchott";
1132
+ break;
1133
+ case "MS":
1134
+ $timezone = "America/Montserrat";
1135
+ break;
1136
+ case "MT":
1137
+ $timezone = "Europe/Malta";
1138
+ break;
1139
+ case "MU":
1140
+ $timezone = "Indian/Mauritius";
1141
+ break;
1142
+ case "MV":
1143
+ $timezone = "Indian/Maldives";
1144
+ break;
1145
+ case "MW":
1146
+ $timezone = "Africa/Blantyre";
1147
+ break;
1148
+ case "MX":
1149
+ switch ($region) {
1150
+ case "01":
1151
+ $timezone = "America/Mexico_City";
1152
+ break;
1153
+ case "02":
1154
+ $timezone = "America/Tijuana";
1155
+ break;
1156
+ case "03":
1157
+ $timezone = "America/Hermosillo";
1158
+ break;
1159
+ case "04":
1160
+ $timezone = "America/Merida";
1161
+ break;
1162
+ case "05":
1163
+ $timezone = "America/Mexico_City";
1164
+ break;
1165
+ case "06":
1166
+ $timezone = "America/Chihuahua";
1167
+ break;
1168
+ case "07":
1169
+ $timezone = "America/Monterrey";
1170
+ break;
1171
+ case "08":
1172
+ $timezone = "America/Mexico_City";
1173
+ break;
1174
+ case "09":
1175
+ $timezone = "America/Mexico_City";
1176
+ break;
1177
+ case "10":
1178
+ $timezone = "America/Mazatlan";
1179
+ break;
1180
+ case "11":
1181
+ $timezone = "America/Mexico_City";
1182
+ break;
1183
+ case "12":
1184
+ $timezone = "America/Mexico_City";
1185
+ break;
1186
+ case "13":
1187
+ $timezone = "America/Mexico_City";
1188
+ break;
1189
+ case "14":
1190
+ $timezone = "America/Mazatlan";
1191
+ break;
1192
+ case "15":
1193
+ $timezone = "America/Chihuahua";
1194
+ break;
1195
+ case "16":
1196
+ $timezone = "America/Mexico_City";
1197
+ break;
1198
+ case "17":
1199
+ $timezone = "America/Mexico_City";
1200
+ break;
1201
+ case "18":
1202
+ $timezone = "America/Mazatlan";
1203
+ break;
1204
+ case "19":
1205
+ $timezone = "America/Monterrey";
1206
+ break;
1207
+ case "20":
1208
+ $timezone = "America/Mexico_City";
1209
+ break;
1210
+ case "21":
1211
+ $timezone = "America/Mexico_City";
1212
+ break;
1213
+ case "22":
1214
+ $timezone = "America/Mexico_City";
1215
+ break;
1216
+ case "23":
1217
+ $timezone = "America/Cancun";
1218
+ break;
1219
+ case "24":
1220
+ $timezone = "America/Mexico_City";
1221
+ break;
1222
+ case "25":
1223
+ $timezone = "America/Mazatlan";
1224
+ break;
1225
+ case "26":
1226
+ $timezone = "America/Hermosillo";
1227
+ break;
1228
+ case "27":
1229
+ $timezone = "America/Merida";
1230
+ break;
1231
+ case "28":
1232
+ $timezone = "America/Monterrey";
1233
+ break;
1234
+ case "29":
1235
+ $timezone = "America/Mexico_City";
1236
+ break;
1237
+ case "30":
1238
+ $timezone = "America/Mexico_City";
1239
+ break;
1240
+ case "31":
1241
+ $timezone = "America/Merida";
1242
+ break;
1243
+ case "32":
1244
+ $timezone = "America/Monterrey";
1245
+ break;
1246
+ }
1247
+ break;
1248
+ case "MY":
1249
+ switch ($region) {
1250
+ case "01":
1251
+ $timezone = "Asia/Kuala_Lumpur";
1252
+ break;
1253
+ case "02":
1254
+ $timezone = "Asia/Kuala_Lumpur";
1255
+ break;
1256
+ case "03":
1257
+ $timezone = "Asia/Kuala_Lumpur";
1258
+ break;
1259
+ case "04":
1260
+ $timezone = "Asia/Kuala_Lumpur";
1261
+ break;
1262
+ case "05":
1263
+ $timezone = "Asia/Kuala_Lumpur";
1264
+ break;
1265
+ case "06":
1266
+ $timezone = "Asia/Kuala_Lumpur";
1267
+ break;
1268
+ case "07":
1269
+ $timezone = "Asia/Kuala_Lumpur";
1270
+ break;
1271
+ case "08":
1272
+ $timezone = "Asia/Kuala_Lumpur";
1273
+ break;
1274
+ case "09":
1275
+ $timezone = "Asia/Kuala_Lumpur";
1276
+ break;
1277
+ case "11":
1278
+ $timezone = "Asia/Kuching";
1279
+ break;
1280
+ case "12":
1281
+ $timezone = "Asia/Kuala_Lumpur";
1282
+ break;
1283
+ case "13":
1284
+ $timezone = "Asia/Kuala_Lumpur";
1285
+ break;
1286
+ case "14":
1287
+ $timezone = "Asia/Kuala_Lumpur";
1288
+ break;
1289
+ case "15":
1290
+ $timezone = "Asia/Kuching";
1291
+ break;
1292
+ case "16":
1293
+ $timezone = "Asia/Kuching";
1294
+ break;
1295
+ }
1296
+ break;
1297
+ case "MZ":
1298
+ $timezone = "Africa/Maputo";
1299
+ break;
1300
+ case "NA":
1301
+ $timezone = "Africa/Windhoek";
1302
+ break;
1303
+ case "NC":
1304
+ $timezone = "Pacific/Noumea";
1305
+ break;
1306
+ case "NE":
1307
+ $timezone = "Africa/Niamey";
1308
+ break;
1309
+ case "NF":
1310
+ $timezone = "Pacific/Norfolk";
1311
+ break;
1312
+ case "NG":
1313
+ $timezone = "Africa/Lagos";
1314
+ break;
1315
+ case "NI":
1316
+ $timezone = "America/Managua";
1317
+ break;
1318
+ case "NL":
1319
+ $timezone = "Europe/Amsterdam";
1320
+ break;
1321
+ case "NO":
1322
+ $timezone = "Europe/Oslo";
1323
+ break;
1324
+ case "NP":
1325
+ $timezone = "Asia/Kathmandu";
1326
+ break;
1327
+ case "NR":
1328
+ $timezone = "Pacific/Nauru";
1329
+ break;
1330
+ case "NU":
1331
+ $timezone = "Pacific/Niue";
1332
+ break;
1333
+ case "NZ":
1334
+ switch ($region) {
1335
+ case "85":
1336
+ $timezone = "Pacific/Auckland";
1337
+ break;
1338
+ case "E7":
1339
+ $timezone = "Pacific/Auckland";
1340
+ break;
1341
+ case "E8":
1342
+ $timezone = "Pacific/Auckland";
1343
+ break;
1344
+ case "E9":
1345
+ $timezone = "Pacific/Auckland";
1346
+ break;
1347
+ case "F1":
1348
+ $timezone = "Pacific/Auckland";
1349
+ break;
1350
+ case "F2":
1351
+ $timezone = "Pacific/Auckland";
1352
+ break;
1353
+ case "F3":
1354
+ $timezone = "Pacific/Auckland";
1355
+ break;
1356
+ case "F4":
1357
+ $timezone = "Pacific/Auckland";
1358
+ break;
1359
+ case "F5":
1360
+ $timezone = "Pacific/Auckland";
1361
+ break;
1362
+ case "F6":
1363
+ $timezone = "Pacific/Auckland";
1364
+ break;
1365
+ case "F7":
1366
+ $timezone = "Pacific/Chatham";
1367
+ break;
1368
+ case "F8":
1369
+ $timezone = "Pacific/Auckland";
1370
+ break;
1371
+ case "F9":
1372
+ $timezone = "Pacific/Auckland";
1373
+ break;
1374
+ case "G1":
1375
+ $timezone = "Pacific/Auckland";
1376
+ break;
1377
+ case "G2":
1378
+ $timezone = "Pacific/Auckland";
1379
+ break;
1380
+ case "G3":
1381
+ $timezone = "Pacific/Auckland";
1382
+ break;
1383
+ }
1384
+ break;
1385
+ case "OM":
1386
+ $timezone = "Asia/Muscat";
1387
+ break;
1388
+ case "PA":
1389
+ $timezone = "America/Panama";
1390
+ break;
1391
+ case "PE":
1392
+ $timezone = "America/Lima";
1393
+ break;
1394
+ case "PF":
1395
+ $timezone = "Pacific/Marquesas";
1396
+ break;
1397
+ case "PG":
1398
+ $timezone = "Pacific/Port_Moresby";
1399
+ break;
1400
+ case "PH":
1401
+ $timezone = "Asia/Manila";
1402
+ break;
1403
+ case "PK":
1404
+ $timezone = "Asia/Karachi";
1405
+ break;
1406
+ case "PL":
1407
+ $timezone = "Europe/Warsaw";
1408
+ break;
1409
+ case "PM":
1410
+ $timezone = "America/Miquelon";
1411
+ break;
1412
+ case "PN":
1413
+ $timezone = "Pacific/Pitcairn";
1414
+ break;
1415
+ case "PR":
1416
+ $timezone = "America/Puerto_Rico";
1417
+ break;
1418
+ case "PS":
1419
+ $timezone = "Asia/Gaza";
1420
+ break;
1421
+ case "PT":
1422
+ switch ($region) {
1423
+ case "02":
1424
+ $timezone = "Europe/Lisbon";
1425
+ break;
1426
+ case "03":
1427
+ $timezone = "Europe/Lisbon";
1428
+ break;
1429
+ case "04":
1430
+ $timezone = "Europe/Lisbon";
1431
+ break;
1432
+ case "05":
1433
+ $timezone = "Europe/Lisbon";
1434
+ break;
1435
+ case "06":
1436
+ $timezone = "Europe/Lisbon";
1437
+ break;
1438
+ case "07":
1439
+ $timezone = "Europe/Lisbon";
1440
+ break;
1441
+ case "08":
1442
+ $timezone = "Europe/Lisbon";
1443
+ break;
1444
+ case "09":
1445
+ $timezone = "Europe/Lisbon";
1446
+ break;
1447
+ case "10":
1448
+ $timezone = "Atlantic/Madeira";
1449
+ break;
1450
+ case "11":
1451
+ $timezone = "Europe/Lisbon";
1452
+ break;
1453
+ case "13":
1454
+ $timezone = "Europe/Lisbon";
1455
+ break;
1456
+ case "14":
1457
+ $timezone = "Europe/Lisbon";
1458
+ break;
1459
+ case "16":
1460
+ $timezone = "Europe/Lisbon";
1461
+ break;
1462
+ case "17":
1463
+ $timezone = "Europe/Lisbon";
1464
+ break;
1465
+ case "18":
1466
+ $timezone = "Europe/Lisbon";
1467
+ break;
1468
+ case "19":
1469
+ $timezone = "Europe/Lisbon";
1470
+ break;
1471
+ case "20":
1472
+ $timezone = "Europe/Lisbon";
1473
+ break;
1474
+ case "21":
1475
+ $timezone = "Europe/Lisbon";
1476
+ break;
1477
+ case "22":
1478
+ $timezone = "Europe/Lisbon";
1479
+ break;
1480
+ case "23":
1481
+ $timezone = "Atlantic/Azores";
1482
+ break;
1483
+ }
1484
+ break;
1485
+ case "PW":
1486
+ $timezone = "Pacific/Palau";
1487
+ break;
1488
+ case "PY":
1489
+ $timezone = "America/Asuncion";
1490
+ break;
1491
+ case "QA":
1492
+ $timezone = "Asia/Qatar";
1493
+ break;
1494
+ case "RE":
1495
+ $timezone = "Indian/Reunion";
1496
+ break;
1497
+ case "RO":
1498
+ $timezone = "Europe/Bucharest";
1499
+ break;
1500
+ case "RS":
1501
+ $timezone = "Europe/Belgrade";
1502
+ break;
1503
+ case "RU":
1504
+ switch ($region) {
1505
+ case "01":
1506
+ $timezone = "Europe/Volgograd";
1507
+ break;
1508
+ case "02":
1509
+ $timezone = "Asia/Irkutsk";
1510
+ break;
1511
+ case "03":
1512
+ $timezone = "Asia/Novokuznetsk";
1513
+ break;
1514
+ case "04":
1515
+ $timezone = "Asia/Novosibirsk";
1516
+ break;
1517
+ case "05":
1518
+ $timezone = "Asia/Vladivostok";
1519
+ break;
1520
+ case "06":
1521
+ $timezone = "Europe/Moscow";
1522
+ break;
1523
+ case "07":
1524
+ $timezone = "Europe/Volgograd";
1525
+ break;
1526
+ case "08":
1527
+ $timezone = "Europe/Samara";
1528
+ break;
1529
+ case "09":
1530
+ $timezone = "Europe/Moscow";
1531
+ break;
1532
+ case "10":
1533
+ $timezone = "Europe/Moscow";
1534
+ break;
1535
+ case "11":
1536
+ $timezone = "Asia/Irkutsk";
1537
+ break;
1538
+ case "12":
1539
+ $timezone = "Europe/Volgograd";
1540
+ break;
1541
+ case "13":
1542
+ $timezone = "Asia/Yekaterinburg";
1543
+ break;
1544
+ case "14":
1545
+ $timezone = "Asia/Irkutsk";
1546
+ break;
1547
+ case "15":
1548
+ $timezone = "Asia/Anadyr";
1549
+ break;
1550
+ case "16":
1551
+ $timezone = "Europe/Samara";
1552
+ break;
1553
+ case "17":
1554
+ $timezone = "Europe/Volgograd";
1555
+ break;
1556
+ case "18":
1557
+ $timezone = "Asia/Krasnoyarsk";
1558
+ break;
1559
+ case "20":
1560
+ $timezone = "Asia/Irkutsk";
1561
+ break;
1562
+ case "21":
1563
+ $timezone = "Europe/Moscow";
1564
+ break;
1565
+ case "22":
1566
+ $timezone = "Europe/Volgograd";
1567
+ break;
1568
+ case "23":
1569
+ $timezone = "Europe/Kaliningrad";
1570
+ break;
1571
+ case "24":
1572
+ $timezone = "Europe/Volgograd";
1573
+ break;
1574
+ case "25":
1575
+ $timezone = "Europe/Moscow";
1576
+ break;
1577
+ case "26":
1578
+ $timezone = "Asia/Kamchatka";
1579
+ break;
1580
+ case "27":
1581
+ $timezone = "Europe/Volgograd";
1582
+ break;
1583
+ case "28":
1584
+ $timezone = "Europe/Moscow";
1585
+ break;
1586
+ case "29":
1587
+ $timezone = "Asia/Novokuznetsk";
1588
+ break;
1589
+ case "30":
1590
+ $timezone = "Asia/Vladivostok";
1591
+ break;
1592
+ case "31":
1593
+ $timezone = "Asia/Krasnoyarsk";
1594
+ break;
1595
+ case "32":
1596
+ $timezone = "Asia/Omsk";
1597
+ break;
1598
+ case "33":
1599
+ $timezone = "Asia/Yekaterinburg";
1600
+ break;
1601
+ case "34":
1602
+ $timezone = "Asia/Yekaterinburg";
1603
+ break;
1604
+ case "35":
1605
+ $timezone = "Asia/Yekaterinburg";
1606
+ break;
1607
+ case "36":
1608
+ $timezone = "Asia/Anadyr";
1609
+ break;
1610
+ case "37":
1611
+ $timezone = "Europe/Moscow";
1612
+ break;
1613
+ case "38":
1614
+ $timezone = "Europe/Volgograd";
1615
+ break;
1616
+ case "39":
1617
+ $timezone = "Asia/Krasnoyarsk";
1618
+ break;
1619
+ case "40":
1620
+ $timezone = "Asia/Yekaterinburg";
1621
+ break;
1622
+ case "41":
1623
+ $timezone = "Europe/Moscow";
1624
+ break;
1625
+ case "42":
1626
+ $timezone = "Europe/Moscow";
1627
+ break;
1628
+ case "43":
1629
+ $timezone = "Europe/Moscow";
1630
+ break;
1631
+ case "44":
1632
+ $timezone = "Asia/Magadan";
1633
+ break;
1634
+ case "45":
1635
+ $timezone = "Europe/Samara";
1636
+ break;
1637
+ case "46":
1638
+ $timezone = "Europe/Samara";
1639
+ break;
1640
+ case "47":
1641
+ $timezone = "Europe/Moscow";
1642
+ break;
1643
+ case "48":
1644
+ $timezone = "Europe/Moscow";
1645
+ break;
1646
+ case "49":
1647
+ $timezone = "Europe/Moscow";
1648
+ break;
1649
+ case "50":
1650
+ $timezone = "Asia/Yekaterinburg";
1651
+ break;
1652
+ case "51":
1653
+ $timezone = "Europe/Moscow";
1654
+ break;
1655
+ case "52":
1656
+ $timezone = "Europe/Moscow";
1657
+ break;
1658
+ case "53":
1659
+ $timezone = "Asia/Novosibirsk";
1660
+ break;
1661
+ case "54":
1662
+ $timezone = "Asia/Omsk";
1663
+ break;
1664
+ case "55":
1665
+ $timezone = "Europe/Samara";
1666
+ break;
1667
+ case "56":
1668
+ $timezone = "Europe/Moscow";
1669
+ break;
1670
+ case "57":
1671
+ $timezone = "Europe/Samara";
1672
+ break;
1673
+ case "58":
1674
+ $timezone = "Asia/Yekaterinburg";
1675
+ break;
1676
+ case "59":
1677
+ $timezone = "Asia/Vladivostok";
1678
+ break;
1679
+ case "60":
1680
+ $timezone = "Europe/Kaliningrad";
1681
+ break;
1682
+ case "61":
1683
+ $timezone = "Europe/Volgograd";
1684
+ break;
1685
+ case "62":
1686
+ $timezone = "Europe/Moscow";
1687
+ break;
1688
+ case "63":
1689
+ $timezone = "Asia/Yakutsk";
1690
+ break;
1691
+ case "64":
1692
+ $timezone = "Asia/Sakhalin";
1693
+ break;
1694
+ case "65":
1695
+ $timezone = "Europe/Samara";
1696
+ break;
1697
+ case "66":
1698
+ $timezone = "Europe/Moscow";
1699
+ break;
1700
+ case "67":
1701
+ $timezone = "Europe/Samara";
1702
+ break;
1703
+ case "68":
1704
+ $timezone = "Europe/Volgograd";
1705
+ break;
1706
+ case "69":
1707
+ $timezone = "Europe/Moscow";
1708
+ break;
1709
+ case "70":
1710
+ $timezone = "Europe/Volgograd";
1711
+ break;
1712
+ case "71":
1713
+ $timezone = "Asia/Yekaterinburg";
1714
+ break;
1715
+ case "72":
1716
+ $timezone = "Europe/Moscow";
1717
+ break;
1718
+ case "73":
1719
+ $timezone = "Europe/Samara";
1720
+ break;
1721
+ case "74":
1722
+ $timezone = "Asia/Krasnoyarsk";
1723
+ break;
1724
+ case "75":
1725
+ $timezone = "Asia/Novosibirsk";
1726
+ break;
1727
+ case "76":
1728
+ $timezone = "Europe/Moscow";
1729
+ break;
1730
+ case "77":
1731
+ $timezone = "Europe/Moscow";
1732
+ break;
1733
+ case "78":
1734
+ $timezone = "Asia/Yekaterinburg";
1735
+ break;
1736
+ case "79":
1737
+ $timezone = "Asia/Irkutsk";
1738
+ break;
1739
+ case "80":
1740
+ $timezone = "Asia/Yekaterinburg";
1741
+ break;
1742
+ case "81":
1743
+ $timezone = "Europe/Samara";
1744
+ break;
1745
+ case "82":
1746
+ $timezone = "Asia/Irkutsk";
1747
+ break;
1748
+ case "83":
1749
+ $timezone = "Europe/Moscow";
1750
+ break;
1751
+ case "84":
1752
+ $timezone = "Europe/Volgograd";
1753
+ break;
1754
+ case "85":
1755
+ $timezone = "Europe/Moscow";
1756
+ break;
1757
+ case "86":
1758
+ $timezone = "Europe/Moscow";
1759
+ break;
1760
+ case "87":
1761
+ $timezone = "Asia/Novosibirsk";
1762
+ break;
1763
+ case "88":
1764
+ $timezone = "Europe/Moscow";
1765
+ break;
1766
+ case "89":
1767
+ $timezone = "Asia/Vladivostok";
1768
+ break;
1769
+ case "90":
1770
+ $timezone = "Asia/Yekaterinburg";
1771
+ break;
1772
+ case "91":
1773
+ $timezone = "Asia/Krasnoyarsk";
1774
+ break;
1775
+ case "92":
1776
+ $timezone = "Asia/Anadyr";
1777
+ break;
1778
+ case "93":
1779
+ $timezone = "Asia/Irkutsk";
1780
+ break;
1781
+ }
1782
+ break;
1783
+ case "RW":
1784
+ $timezone = "Africa/Kigali";
1785
+ break;
1786
+ case "SA":
1787
+ $timezone = "Asia/Riyadh";
1788
+ break;
1789
+ case "SB":
1790
+ $timezone = "Pacific/Guadalcanal";
1791
+ break;
1792
+ case "SC":
1793
+ $timezone = "Indian/Mahe";
1794
+ break;
1795
+ case "SD":
1796
+ $timezone = "Africa/Khartoum";
1797
+ break;
1798
+ case "SE":
1799
+ $timezone = "Europe/Stockholm";
1800
+ break;
1801
+ case "SG":
1802
+ $timezone = "Asia/Singapore";
1803
+ break;
1804
+ case "SH":
1805
+ $timezone = "Atlantic/St_Helena";
1806
+ break;
1807
+ case "SI":
1808
+ $timezone = "Europe/Ljubljana";
1809
+ break;
1810
+ case "SJ":
1811
+ $timezone = "Arctic/Longyearbyen";
1812
+ break;
1813
+ case "SK":
1814
+ $timezone = "Europe/Bratislava";
1815
+ break;
1816
+ case "SL":
1817
+ $timezone = "Africa/Freetown";
1818
+ break;
1819
+ case "SM":
1820
+ $timezone = "Europe/San_Marino";
1821
+ break;
1822
+ case "SN":
1823
+ $timezone = "Africa/Dakar";
1824
+ break;
1825
+ case "SO":
1826
+ $timezone = "Africa/Mogadishu";
1827
+ break;
1828
+ case "SR":
1829
+ $timezone = "America/Paramaribo";
1830
+ break;
1831
+ case "SS":
1832
+ $timezone = "Africa/Juba";
1833
+ break;
1834
+ case "ST":
1835
+ $timezone = "Africa/Sao_Tome";
1836
+ break;
1837
+ case "SV":
1838
+ $timezone = "America/El_Salvador";
1839
+ break;
1840
+ case "SX":
1841
+ $timezone = "America/Curacao";
1842
+ break;
1843
+ case "SY":
1844
+ $timezone = "Asia/Damascus";
1845
+ break;
1846
+ case "SZ":
1847
+ $timezone = "Africa/Mbabane";
1848
+ break;
1849
+ case "TC":
1850
+ $timezone = "America/Grand_Turk";
1851
+ break;
1852
+ case "TD":
1853
+ $timezone = "Africa/Ndjamena";
1854
+ break;
1855
+ case "TF":
1856
+ $timezone = "Indian/Kerguelen";
1857
+ break;
1858
+ case "TG":
1859
+ $timezone = "Africa/Lome";
1860
+ break;
1861
+ case "TH":
1862
+ $timezone = "Asia/Bangkok";
1863
+ break;
1864
+ case "TJ":
1865
+ $timezone = "Asia/Dushanbe";
1866
+ break;
1867
+ case "TK":
1868
+ $timezone = "Pacific/Fakaofo";
1869
+ break;
1870
+ case "TL":
1871
+ $timezone = "Asia/Dili";
1872
+ break;
1873
+ case "TM":
1874
+ $timezone = "Asia/Ashgabat";
1875
+ break;
1876
+ case "TN":
1877
+ $timezone = "Africa/Tunis";
1878
+ break;
1879
+ case "TO":
1880
+ $timezone = "Pacific/Tongatapu";
1881
+ break;
1882
+ case "TR":
1883
+ $timezone = "Asia/Istanbul";
1884
+ break;
1885
+ case "TT":
1886
+ $timezone = "America/Port_of_Spain";
1887
+ break;
1888
+ case "TV":
1889
+ $timezone = "Pacific/Funafuti";
1890
+ break;
1891
+ case "TW":
1892
+ $timezone = "Asia/Taipei";
1893
+ break;
1894
+ case "TZ":
1895
+ $timezone = "Africa/Dar_es_Salaam";
1896
+ break;
1897
+ case "UA":
1898
+ switch ($region) {
1899
+ case "01":
1900
+ $timezone = "Europe/Kiev";
1901
+ break;
1902
+ case "02":
1903
+ $timezone = "Europe/Kiev";
1904
+ break;
1905
+ case "03":
1906
+ $timezone = "Europe/Uzhgorod";
1907
+ break;
1908
+ case "04":
1909
+ $timezone = "Europe/Zaporozhye";
1910
+ break;
1911
+ case "05":
1912
+ $timezone = "Europe/Zaporozhye";
1913
+ break;
1914
+ case "06":
1915
+ $timezone = "Europe/Uzhgorod";
1916
+ break;
1917
+ case "07":
1918
+ $timezone = "Europe/Zaporozhye";
1919
+ break;
1920
+ case "08":
1921
+ $timezone = "Europe/Simferopol";
1922
+ break;
1923
+ case "09":
1924
+ $timezone = "Europe/Kiev";
1925
+ break;
1926
+ case "10":
1927
+ $timezone = "Europe/Zaporozhye";
1928
+ break;
1929
+ case "11":
1930
+ $timezone = "Europe/Simferopol";
1931
+ break;
1932
+ case "12":
1933
+ $timezone = "Europe/Kiev";
1934
+ break;
1935
+ case "13":
1936
+ $timezone = "Europe/Kiev";
1937
+ break;
1938
+ case "14":
1939
+ $timezone = "Europe/Zaporozhye";
1940
+ break;
1941
+ case "15":
1942
+ $timezone = "Europe/Uzhgorod";
1943
+ break;
1944
+ case "16":
1945
+ $timezone = "Europe/Zaporozhye";
1946
+ break;
1947
+ case "17":
1948
+ $timezone = "Europe/Simferopol";
1949
+ break;
1950
+ case "18":
1951
+ $timezone = "Europe/Zaporozhye";
1952
+ break;
1953
+ case "19":
1954
+ $timezone = "Europe/Kiev";
1955
+ break;
1956
+ case "20":
1957
+ $timezone = "Europe/Simferopol";
1958
+ break;
1959
+ case "21":
1960
+ $timezone = "Europe/Kiev";
1961
+ break;
1962
+ case "22":
1963
+ $timezone = "Europe/Uzhgorod";
1964
+ break;
1965
+ case "23":
1966
+ $timezone = "Europe/Kiev";
1967
+ break;
1968
+ case "24":
1969
+ $timezone = "Europe/Uzhgorod";
1970
+ break;
1971
+ case "25":
1972
+ $timezone = "Europe/Uzhgorod";
1973
+ break;
1974
+ case "26":
1975
+ $timezone = "Europe/Zaporozhye";
1976
+ break;
1977
+ case "27":
1978
+ $timezone = "Europe/Kiev";
1979
+ break;
1980
+ }
1981
+ break;
1982
+ case "UG":
1983
+ $timezone = "Africa/Kampala";
1984
+ break;
1985
+ case "UM":
1986
+ $timezone = "Pacific/Wake";
1987
+ break;
1988
+ case "US":
1989
+ switch ($region) {
1990
+ case "AK":
1991
+ $timezone = "America/Anchorage";
1992
+ break;
1993
+ case "AL":
1994
+ $timezone = "America/Chicago";
1995
+ break;
1996
+ case "AR":
1997
+ $timezone = "America/Chicago";
1998
+ break;
1999
+ case "AZ":
2000
+ $timezone = "America/Phoenix";
2001
+ break;
2002
+ case "CA":
2003
+ $timezone = "America/Los_Angeles";
2004
+ break;
2005
+ case "CO":
2006
+ $timezone = "America/Denver";
2007
+ break;
2008
+ case "CT":
2009
+ $timezone = "America/New_York";
2010
+ break;
2011
+ case "DC":
2012
+ $timezone = "America/New_York";
2013
+ break;
2014
+ case "DE":
2015
+ $timezone = "America/New_York";
2016
+ break;
2017
+ case "FL":
2018
+ $timezone = "America/New_York";
2019
+ break;
2020
+ case "GA":
2021
+ $timezone = "America/New_York";
2022
+ break;
2023
+ case "HI":
2024
+ $timezone = "Pacific/Honolulu";
2025
+ break;
2026
+ case "IA":
2027
+ $timezone = "America/Chicago";
2028
+ break;
2029
+ case "ID":
2030
+ $timezone = "America/Denver";
2031
+ break;
2032
+ case "IL":
2033
+ $timezone = "America/Chicago";
2034
+ break;
2035
+ case "IN":
2036
+ $timezone = "America/Indiana/Indianapolis";
2037
+ break;
2038
+ case "KS":
2039
+ $timezone = "America/Chicago";
2040
+ break;
2041
+ case "KY":
2042
+ $timezone = "America/New_York";
2043
+ break;
2044
+ case "LA":
2045
+ $timezone = "America/Chicago";
2046
+ break;
2047
+ case "MA":
2048
+ $timezone = "America/New_York";
2049
+ break;
2050
+ case "MD":
2051
+ $timezone = "America/New_York";
2052
+ break;
2053
+ case "ME":
2054
+ $timezone = "America/New_York";
2055
+ break;
2056
+ case "MI":
2057
+ $timezone = "America/New_York";
2058
+ break;
2059
+ case "MN":
2060
+ $timezone = "America/Chicago";
2061
+ break;
2062
+ case "MO":
2063
+ $timezone = "America/Chicago";
2064
+ break;
2065
+ case "MS":
2066
+ $timezone = "America/Chicago";
2067
+ break;
2068
+ case "MT":
2069
+ $timezone = "America/Denver";
2070
+ break;
2071
+ case "NC":
2072
+ $timezone = "America/New_York";
2073
+ break;
2074
+ case "ND":
2075
+ $timezone = "America/Chicago";
2076
+ break;
2077
+ case "NE":
2078
+ $timezone = "America/Chicago";
2079
+ break;
2080
+ case "NH":
2081
+ $timezone = "America/New_York";
2082
+ break;
2083
+ case "NJ":
2084
+ $timezone = "America/New_York";
2085
+ break;
2086
+ case "NM":
2087
+ $timezone = "America/Denver";
2088
+ break;
2089
+ case "NV":
2090
+ $timezone = "America/Los_Angeles";
2091
+ break;
2092
+ case "NY":
2093
+ $timezone = "America/New_York";
2094
+ break;
2095
+ case "OH":
2096
+ $timezone = "America/New_York";
2097
+ break;
2098
+ case "OK":
2099
+ $timezone = "America/Chicago";
2100
+ break;
2101
+ case "OR":
2102
+ $timezone = "America/Los_Angeles";
2103
+ break;
2104
+ case "PA":
2105
+ $timezone = "America/New_York";
2106
+ break;
2107
+ case "RI":
2108
+ $timezone = "America/New_York";
2109
+ break;
2110
+ case "SC":
2111
+ $timezone = "America/New_York";
2112
+ break;
2113
+ case "SD":
2114
+ $timezone = "America/Chicago";
2115
+ break;
2116
+ case "TN":
2117
+ $timezone = "America/Chicago";
2118
+ break;
2119
+ case "TX":
2120
+ $timezone = "America/Chicago";
2121
+ break;
2122
+ case "UT":
2123
+ $timezone = "America/Denver";
2124
+ break;
2125
+ case "VA":
2126
+ $timezone = "America/New_York";
2127
+ break;
2128
+ case "VT":
2129
+ $timezone = "America/New_York";
2130
+ break;
2131
+ case "WA":
2132
+ $timezone = "America/Los_Angeles";
2133
+ break;
2134
+ case "WI":
2135
+ $timezone = "America/Chicago";
2136
+ break;
2137
+ case "WV":
2138
+ $timezone = "America/New_York";
2139
+ break;
2140
+ case "WY":
2141
+ $timezone = "America/Denver";
2142
+ break;
2143
+ }
2144
+ break;
2145
+ case "UY":
2146
+ $timezone = "America/Montevideo";
2147
+ break;
2148
+ case "UZ":
2149
+ switch ($region) {
2150
+ case "01":
2151
+ $timezone = "Asia/Tashkent";
2152
+ break;
2153
+ case "02":
2154
+ $timezone = "Asia/Samarkand";
2155
+ break;
2156
+ case "03":
2157
+ $timezone = "Asia/Tashkent";
2158
+ break;
2159
+ case "05":
2160
+ $timezone = "Asia/Samarkand";
2161
+ break;
2162
+ case "06":
2163
+ $timezone = "Asia/Tashkent";
2164
+ break;
2165
+ case "07":
2166
+ $timezone = "Asia/Samarkand";
2167
+ break;
2168
+ case "08":
2169
+ $timezone = "Asia/Samarkand";
2170
+ break;
2171
+ case "09":
2172
+ $timezone = "Asia/Samarkand";
2173
+ break;
2174
+ case "10":
2175
+ $timezone = "Asia/Samarkand";
2176
+ break;
2177
+ case "12":
2178
+ $timezone = "Asia/Samarkand";
2179
+ break;
2180
+ case "13":
2181
+ $timezone = "Asia/Tashkent";
2182
+ break;
2183
+ case "14":
2184
+ $timezone = "Asia/Tashkent";
2185
+ break;
2186
+ }
2187
+ break;
2188
+ case "VA":
2189
+ $timezone = "Europe/Vatican";
2190
+ break;
2191
+ case "VC":
2192
+ $timezone = "America/St_Vincent";
2193
+ break;
2194
+ case "VE":
2195
+ $timezone = "America/Caracas";
2196
+ break;
2197
+ case "VG":
2198
+ $timezone = "America/Tortola";
2199
+ break;
2200
+ case "VI":
2201
+ $timezone = "America/St_Thomas";
2202
+ break;
2203
+ case "VN":
2204
+ $timezone = "Asia/Phnom_Penh";
2205
+ break;
2206
+ case "VU":
2207
+ $timezone = "Pacific/Efate";
2208
+ break;
2209
+ case "WF":
2210
+ $timezone = "Pacific/Wallis";
2211
+ break;
2212
+ case "WS":
2213
+ $timezone = "Pacific/Pago_Pago";
2214
+ break;
2215
+ case "YE":
2216
+ $timezone = "Asia/Aden";
2217
+ break;
2218
+ case "YT":
2219
+ $timezone = "Indian/Mayotte";
2220
+ break;
2221
+ case "YU":
2222
+ $timezone = "Europe/Belgrade";
2223
+ break;
2224
+ case "ZA":
2225
+ $timezone = "Africa/Johannesburg";
2226
+ break;
2227
+ case "ZM":
2228
+ $timezone = "Africa/Lusaka";
2229
+ break;
2230
+ case "ZW":
2231
+ $timezone = "Africa/Harare";
2232
+ break;
2233
+ }
2234
+ return $timezone;
2235
+ }
geoip/tests/CityTest.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class CityTest extends \PHPUnit_Framework_TestCase
4
+ {
5
+
6
+ public function testCity()
7
+ {
8
+ global $GEOIP_REGION_NAME;
9
+
10
+ $gi = geoip_open("tests/data/GeoIPCity.dat", GEOIP_STANDARD);
11
+
12
+ $record = geoip_record_by_addr($gi, "64.17.254.216");
13
+
14
+ $this->assertEquals(310, $record->area_code);
15
+ $this->assertEquals('El Segundo', $record->city);
16
+ $this->assertEquals('US', $record->country_code);
17
+ $this->assertEquals('USA', $record->country_code3);
18
+ $this->assertEquals('United States', $record->country_name);
19
+ $this->assertEquals(803, $record->dma_code);
20
+ $this->assertEquals(33.91, $record->latitude, '', 0.01);
21
+ $this->assertEquals(-118.40, $record->longitude, '', 0.01);
22
+ $this->assertEquals(803, $record->metro_code);
23
+ $this->assertEquals('90245', $record->postal_code);
24
+ $this->assertEquals('CA', $record->region);
25
+ $this->assertEquals(
26
+ 'California',
27
+ $GEOIP_REGION_NAME[$record->country_code][$record->region]
28
+ );
29
+ $this->assertEquals(
30
+ 'America/Los_Angeles',
31
+ get_time_zone($record->country_code, $record->region)
32
+ );
33
+ }
34
+ }
geoip/tests/CountryTest.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class CountryTest extends \PHPUnit_Framework_TestCase
4
+ {
5
+
6
+ public function testCountry()
7
+ {
8
+ $gi = geoip_open("tests/data/GeoIP.dat", GEOIP_STANDARD);
9
+
10
+ $this->assertEquals(
11
+ 'US',
12
+ geoip_country_code_by_addr($gi, '64.17.254.216')
13
+ );
14
+ $this->assertEquals(
15
+ 'United States',
16
+ geoip_country_name_by_addr($gi, '64.17.254.216')
17
+ );
18
+ }
19
+
20
+ public function testV6()
21
+ {
22
+ $gi = geoip_open("tests/data/GeoIPv6.dat", GEOIP_STANDARD);
23
+
24
+ $this->assertEquals(
25
+ 'JP',
26
+ geoip_country_code_by_addr_v6($gi, '2001:200::')
27
+ );
28
+ }
29
+ }
geoip/tests/DomainTest.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class DomainTest extends \PHPUnit_Framework_TestCase
4
+ {
5
+
6
+ public function testDomain()
7
+ {
8
+ $gi = geoip_open("tests/data/GeoIPDomain.dat", GEOIP_STANDARD);
9
+
10
+ $this->assertEquals(
11
+ 'shoesfin.NET',
12
+ geoip_org_by_addr($gi, "67.43.156.0")
13
+ );
14
+ }
15
+ }
geoip/tests/NetspeedcellTest.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class NetspeedcellTest extends \PHPUnit_Framework_TestCase
4
+ {
5
+ public function testNetspeedcell()
6
+ {
7
+ $gi = geoip_open("tests/data/GeoIPNetSpeedCell.dat", GEOIP_STANDARD);
8
+
9
+ $this->assertEquals(
10
+ 'Dialup',
11
+ geoip_org_by_addr($gi, "2.125.160.1")
12
+ );
13
+ }
14
+ }
geoip/tests/OrgTest.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class OrgTest extends \PHPUnit_Framework_TestCase
4
+ {
5
+ public function testOrg()
6
+ {
7
+ $gi = geoip_open("tests/data/GeoIPOrg.dat", GEOIP_STANDARD);
8
+
9
+ $this->assertEquals(
10
+ 'AT&T Worldnet Services',
11
+ geoip_org_by_addr($gi, "12.87.118.0")
12
+ );
13
+ }
14
+ }
geoip/tests/RegionTest.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class RegionTest extends \PHPUnit_Framework_TestCase
4
+ {
5
+ public function testRegion()
6
+ {
7
+ $gi = geoip_open("tests/data/GeoIPRegion.dat", GEOIP_STANDARD);
8
+
9
+ list($countryCode, $region) = geoip_region_by_addr(
10
+ $gi,
11
+ '64.17.254.223'
12
+ );
13
+
14
+ $this->assertEquals('CA', $region);
15
+ $this->assertEquals('US', $countryCode);
16
+
17
+ global $GEOIP_REGION_NAME;
18
+ $this->assertEquals(
19
+ 'California',
20
+ $GEOIP_REGION_NAME[$countryCode][$region]
21
+ );
22
+ }
23
+ }
geoip/tests/bootstrap.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!$loader = @include __DIR__ . '/../vendor/autoload.php') {
4
+ die('Project dependencies missing');
5
+ }
geoip/tests/data/GeoIP.dat ADDED
Binary file
geoip/tests/data/GeoIPASNum.dat ADDED
Binary file
geoip/tests/data/GeoIPCity.dat ADDED
Binary file
geoip/tests/data/GeoIPDomain.dat ADDED
Binary file
geoip/tests/data/GeoIPISP.dat ADDED
Binary file
geoip/tests/data/GeoIPNetSpeedCell.dat ADDED
Binary file
geoip/tests/data/GeoIPOrg.dat ADDED
Binary file
geoip/tests/data/GeoIPRegion.dat ADDED
Binary file
geoip/tests/data/GeoIPv6.dat ADDED
Binary file
geoip/tests/data/GeoLiteCityIPv6.dat ADDED
Binary file
geoip/timezone/make_time_zone_php_code.pl ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/perl
2
+
3
+ use strict;
4
+ use warnings;
5
+
6
+ use HTTP::Tiny;
7
+ use Text::CSV_XS;
8
+
9
+ my $old_country;
10
+ my $old_region;
11
+
12
+ my $response = HTTP::Tiny->new->get(
13
+ 'http://dev.maxmind.com/static/csv/codes/time_zone.csv');
14
+
15
+ die "Failed to download CSV!\n" unless $response->{success};
16
+
17
+ print "<?php\n";
18
+ print "function get_time_zone(\$country, \$region)\n{\n";
19
+ print " switch (\$country) {\n";
20
+
21
+ my $csv = Text::CSV_XS->new ({ binary => 1});
22
+
23
+ my @timezones = split /\n/, $response->{content};
24
+ shift @timezones;
25
+
26
+ for my $line (@timezones) {
27
+ $csv->parse($line) or die $csv->error_diag();
28
+ my ( $country, $region, $timezone ) = $csv->fields;
29
+
30
+ if ( $country ne $old_country ) {
31
+ if ( $old_region ne q{} ) {
32
+ print " }\n";
33
+ print " break;\n";
34
+ }
35
+ print ' case "' . $country . q(") . ":\n";
36
+ if ( $region ne q{} ) {
37
+ print " switch (\$region) {\n";
38
+ }
39
+ }
40
+ if ( $region ne q{} ) {
41
+ print ' case "' . $region . q(") . ":\n ";
42
+ }
43
+ print ' $timezone = "' . $timezone . q(") . ";\n";
44
+ if ( $region ne q{} ) {
45
+ print " break;\n";
46
+ }
47
+ else {
48
+ print " break;\n";
49
+ }
50
+ $old_country = $country;
51
+ $old_region = $region;
52
+ }
53
+ print " }\n";
54
+ print " return \$timezone;\n";
55
+
56
+ print "}\n";
57
+
geoip/timezone/test_timezone.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ #!/usr/bin/php -q
2
+ <?php
3
+ require("timezone.php");
4
+ print get_time_zone("US", "WV");
5
+ ?>
images/browsers/mozilla.png CHANGED
Binary file
images/layers-2x.png ADDED
Binary file
images/layers.png ADDED
Binary file
images/loading.gif ADDED
Binary file
images/loadinggif.gif ADDED
Binary file
images/map_pro.jpg ADDED
Binary file
images/marker-icon-2x.png ADDED
Binary file
images/marker-icon.png ADDED
Binary file
images/marker-shadow.png ADDED
Binary file
images/online_upgrade_to_pro.jpg ADDED
Binary file
images/today_traffic_by_country_pro.jpg ADDED
Binary file
images/top_refferring_countries_pro.jpg ADDED
Binary file
images/traffic_by_country_pro.jpg ADDED
Binary file
images/ui-icons_444444_256x240.png ADDED
Binary file
images/ui-icons_555555_256x240.png ADDED
Binary file
images/ui-icons_777620_256x240.png ADDED
Binary file
images/ui-icons_777777_256x240.png ADDED
Binary file
images/ui-icons_cc0000_256x240.png ADDED
Binary file
images/ui-icons_ffffff_256x240.png ADDED
Binary file
images/upgrade_now.png ADDED
Binary file
init.php CHANGED
@@ -1,78 +1,79 @@
1
- <?php
2
- define('AHC_RECENT_VISITORS_LIMIT', 20);
3
- define('AHCFREE_RECENT_KEYWORDS_LIMIT', 20);
4
-
5
- define('AHCFREE_TOP_REFERING_SITES_LIMIT', 20); // used in ahcfree_get_top_refering_sites
6
- define('AHCFREE_TOP_COUNTRIES_LIMIT', 20); // used in ahcfree_get_top_countries
7
-
8
- define('AHCFREE_TRAFFIC_BY_TITLE_LIMIT', 20);
9
- define('AHCFREE_DS', DIRECTORY_SEPARATOR);
10
- define('AHCFREE_PLUGIN_SUPDIRE_FILE', dirname(__FILE__).'visitors-traffic-real-time-statistics.php');
11
-
12
-
13
- require_once("WPHitsCounter.php");
14
-
15
- register_activation_hook(AHCFREE_PLUGIN_MAIN_FILE, 'ahcfree_set_default_options');
16
- register_deactivation_hook(AHCFREE_PLUGIN_MAIN_FILE, 'ahcfree_unset_default_options');
17
-
18
-
19
-
20
- class Globalsahcfree{
21
-
22
- static $plugin_options = array();
23
- static $lang = NULL;
24
- static $post_type = NULL; // post | page | category
25
- static $page_id = NULL;
26
- static $page_title = NULL;
27
- }
28
-
29
- Globalsahcfree::$plugin_options = get_option('ahcfree_wp_hits_counter_options');
30
- Globalsahcfree::$lang = 'en';
31
-
32
-
33
- $ahcfree_get_save_settings = ahcfree_get_save_settings();
34
-
35
- if($ahcfree_get_save_settings == false or empty($ahcfree_get_save_settings))
36
- {
37
- ahcfree_add_settings();
38
- }
39
-
40
- if(isset($ahcfree_get_save_settings[0]))
41
- {
42
- $hits_days = $ahcfree_get_save_settings[0]->set_hits_days;
43
- $ajax_check = ($ahcfree_get_save_settings[0]->set_ajax_check * 1000);
44
- $set_ips = $ahcfree_get_save_settings[0]->set_ips;
45
- $set_google_map = $ahcfree_get_save_settings[0]->set_google_map;
46
- }else{
47
- $hits_days = 14;
48
- $ajax_check = 15;
49
- $set_ips = '';
50
- $set_google_map = 'today_visitors';
51
- }
52
-
53
- define('AHC_VISITORS_VISITS_LIMIT', $hits_days );
54
- define('AHCFREE_AJAX_CHECK', $ajax_check);
55
- define('AHCFREE_EXCLUDE_IPS', $set_ips);
56
-
57
-
58
-
59
- $admincore = '';
60
- if (isset($_GET['page'])) $admincore = $_GET['page'];
61
- if( is_admin() && $admincore == 'ahc_hits_counter_menu_free')
62
- {
63
- add_action('admin_enqueue_scripts', 'ahcfree_include_scripts');
64
- }
65
-
66
-
67
- add_action('admin_menu', 'ahcfree_create_admin_menu_link');
68
- add_action('wp_ajax_ahcfree_get_hits_by_custom_duration','ahcfree_get_hits_by_custom_duration_callback');
69
-
70
- define('AHCFREE_SERVER_CURRENT_TIMEZONE','+00:00');
71
- $stats_current_timezone = get_option('ahcfree_custom_timezone');
72
- $stats_current_timezone = !empty($stats_current_timezone) ? $stats_current_timezone : ahcfree_GetWPTimezoneString();
73
-
74
- /*
75
- if($stats_current_timezone !='')
76
- date_default_timezone_set($stats_current_timezone);
77
- */
78
- ?>
 
1
+ <?php
2
+ define('AHCFREE_DS', DIRECTORY_SEPARATOR);
3
+ define('AHCFREE_PLUGIN_SUPDIRE_FILE', dirname(__FILE__).'Visitors-Traffic-Real-Time-Statistics.php');
4
+
5
+ define('AHCFREE_RECENT_VISITORS_LIMIT', 20);
6
+ define('AHCFREE_RECENT_KEYWORDS_LIMIT', 20);
7
+ define('AHCFREE_VISITORS_VISITS_SUMMARY_LIMIT', 20); // used in ahc_get_ser_visits_by_date & search engines last days
8
+ define('AHCFREE_TOP_REFERING_SITES_LIMIT', 20); // used in ahcfree_get_top_refering_sites
9
+ define('AHCFREE_TOP_COUNTRIES_LIMIT', 20); // used in ahcfree_get_top_countries
10
+
11
+
12
+ define('AHCFREE_TRAFFIC_BY_TITLE_LIMIT', 20);
13
+ define('IS_DEMO', true);
14
+
15
+ require_once("WPHitsCounter.php");
16
+ require_once("geoip".AHCFREE_DS."src".AHCFREE_DS."geoip.inc");
17
+
18
+ register_activation_hook(AHCFREE_PLUGIN_MAIN_FILE, 'ahcfree_set_default_options');
19
+ register_deactivation_hook(AHCFREE_PLUGIN_MAIN_FILE, 'ahcfree_unset_default_options');
20
+
21
+
22
+ class GlobalsAHC{
23
+
24
+ static $plugin_options = array();
25
+ static $lang = NULL;
26
+ static $post_type = NULL; // post | page | category
27
+ static $page_id = NULL;
28
+ static $page_title = NULL;
29
+ }
30
+
31
+ GlobalsAHC::$plugin_options = get_option('ahcfree_wp_hits_counter_options');
32
+ GlobalsAHC::$lang = 'en';
33
+
34
+
35
+ $ahcfree_get_save_settings = ahcfree_get_save_settings();
36
+
37
+ if($ahcfree_get_save_settings == false or empty($ahcfree_get_save_settings))
38
+ {
39
+ ahcfree_add_settings();
40
+ }
41
+
42
+ if(isset($ahcfree_get_save_settings[0]))
43
+ {
44
+ $hits_days = $ahcfree_get_save_settings[0]->set_hits_days;
45
+ $ajax_check = ($ahcfree_get_save_settings[0]->set_ajax_check * 1000);
46
+ $set_ips = $ahcfree_get_save_settings[0]->set_ips;
47
+ $set_google_map = $ahcfree_get_save_settings[0]->set_google_map;
48
+ }else{
49
+
50
+ $hits_days = 30;
51
+ $ajax_check = 10;
52
+ $set_ips = '';
53
+ $set_google_map = 'today_visitors';
54
+ }
55
+
56
+
57
+ define('AHCFREE_VISITORS_VISITS_LIMIT', $hits_days );
58
+ define('AHC_AJAX_CHECK', $ajax_check);
59
+ define('EXCLUDE_IPS', $set_ips);
60
+ define('SET_GOOGLE_MAP', $set_google_map);
61
+
62
+
63
+
64
+ $admincore = '';
65
+ if (isset($_GET['page'])) $admincore = $_GET['page'];
66
+ if( is_admin() && $admincore == 'ahc_hits_counter_menu_free')
67
+ {
68
+ add_action('admin_enqueue_scripts', 'ahcfree_include_scripts',99);
69
+ }
70
+
71
+
72
+ add_action('admin_menu', 'ahcfree_create_admin_menu_link');
73
+ add_shortcode('ahcfree_show_google_map', 'ahcfree_google_map' );
74
+ //[ahcfree_show_google_map map_status="online"]
75
+
76
+ add_action('wp_ajax_ahcfree_get_hits_by_custom_duration','ahcfree_get_hits_by_custom_duration_callback');
77
+
78
+ define('AHCFREE_SERVER_CURRENT_TIMEZONE','+00:00');
79
+ ?>
js/FileSaver.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
2
+ var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})}
js/ahcfree_js_scripts.js ADDED
@@ -0,0 +1,906 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ var colors = ['#DB6946', '#C14543', '#445060', '#395953', '#6C8C80', '#829AB5', '#BF807A', '#BF0000', '#006BB7', '#EC732C', '#BF3D27', '#A6375F',
3
+ '#8C6D46', '#326149', '#802B35', '#8A3842', '#366D73', '#4D6173', '#4A4659', '#C9D65B', '#F45552', '#F3CC5E', '#F29B88', '#D96941',
4
+ '#484F73', '#C9AB81', '#F5655C', '#F0C480'];
5
+
6
+ jQuery(document).ready(function ()
7
+ {
8
+
9
+
10
+
11
+
12
+ if (typeof google === 'object' && typeof google.maps === 'object') {
13
+ return;
14
+ }else{
15
+
16
+ }
17
+
18
+
19
+
20
+ });
21
+ //------------------------------------------------------------------------------
22
+ function convertToNumeric(data){
23
+ if(data instanceof Array){
24
+ for(var index in data){
25
+ data[index] = Number(data[index]);
26
+ }
27
+ } else{
28
+ data = Number(data);
29
+ }
30
+ return data;
31
+ }
32
+ //------------------------------------------------------------------------------
33
+ function getRandomElementFromArray(array){
34
+ var ranIndex = Math.floor(Math.random() * array.length);
35
+ return array[ranIndex];
36
+ }
37
+ //------------------------------------------------------------------------------
38
+ function drawVisitsLineChart(visitsData){
39
+ var randomScalingFactor = function(){ return Math.round(Math.random()*100)};
40
+
41
+ var barChartData = {
42
+ labels : visitsData.data.dates,
43
+ datasets : [
44
+ {
45
+ label: "Visitors",
46
+ barShowStroke: false,
47
+ fillColor : "rgba(75,178,1970,.5)",
48
+ strokeColor : "rgba(75,178,1970,.5)",
49
+ highlightFill: "rgba(220,220,220,0.75)",
50
+ highlightStroke: "rgba(220,220,220,1)",
51
+ data : visitsData.data.visitors
52
+ },
53
+ {
54
+ label: "Visits",
55
+ barShowStroke: false,
56
+ fillColor : "rgba(234,162,40,0.5)",
57
+ strokeColor : "rgba(234,162,40,0.5)",
58
+ highlightFill : "rgba(151,187,205,0.75)",
59
+ highlightStroke : "rgba(151,187,205,1)",
60
+ data : visitsData.data.visits
61
+ }
62
+ ]
63
+
64
+ }
65
+ var ctx = document.getElementById("visitorsVisitsChart").getContext("2d");
66
+ window.myBar = new Chart(ctx).Bar(barChartData, {
67
+ responsive : true
68
+ });
69
+ }
70
+ //------------------------------------------------------------------------------
71
+
72
+
73
+ function drawBrowsersBieChart(browsersData){
74
+ var brsBieChartData = [];
75
+ var container = jQuery('#browsersLegContainer');
76
+ var html = '';
77
+
78
+ if(browsersData.length == 0)
79
+ {
80
+ document.getElementById('browsersLegContainer').style.display = 'none';
81
+ }else{
82
+ document.getElementById('browsersLegContainer').style.display = 'block';
83
+ }
84
+
85
+ for(var i = 0; i < browsersData.length; i++){
86
+ var color = getRandomElementFromArray(colors);
87
+ var value = Number(browsersData[i].hits);
88
+ brsBieChartData[i] = {label: browsersData[i].bsr_name, value: value, color: color};
89
+ html += (isEmpty(value))? '' : '<div class="legend">' +
90
+ '<span class="color" style="background-color: ' + color + ';">&nbsp;&nbsp;</span>' +
91
+ '<span class="name">' + browsersData[i].bsr_name + '</span>' +
92
+ '<span class="value">' + value + '</span>' +
93
+ '</div>';
94
+ }
95
+ html += '<div class="cleaner"></div>';
96
+ container.html(html);
97
+ var ctx = document.getElementById("brsBiechartContainer").getContext("2d");
98
+ /*var myPie = new Chart(ctx,{
99
+ type: 'pie',
100
+ data: brsBieChartData,
101
+ options: {responsive : true}
102
+ });*/
103
+ window.myPie = new Chart(ctx).Pie(brsBieChartData, {responsive : true});
104
+ }
105
+
106
+
107
+
108
+ //------------------------------------------------------------------------------
109
+ function drawSrhEngVstLineChart(f){
110
+ var srh_series = [];
111
+ var container = jQuery('#srchEngLegContainer');
112
+ var html = '';
113
+ document.getElementById('srchEngLegContainer').style.display = 'none';
114
+
115
+ for(var index in srhEngVisitsData.data.search_engines){
116
+ var color = getRandomElementFromArray(colors);
117
+ var value = countVisits(srhEngVisitsData.data.search_engines[index]);
118
+
119
+ if(parseFloat(value) !=0)
120
+ {
121
+ document.getElementById('srchEngLegContainer').style.display = 'block';
122
+ }
123
+
124
+ srh_series[srh_series.length] = {
125
+ "label": index,
126
+ "value": value,
127
+ "color": color
128
+ }
129
+
130
+ html += (isEmpty(value))? '' : '<div class="legend">' +
131
+ '<span class="color" style="background-color: ' + color + ';">&nbsp;&nbsp;</span>' +
132
+ '<span class="name">' + index + '</span>' +
133
+ '<span class="value">' + value + '</span>' +
134
+ '</div>';
135
+ }
136
+ html += '<div class="cleaner"></div>';
137
+ container.html(html);
138
+ var ctx = document.getElementById("srhEngBieChartContainer").getContext("2d");
139
+ /*var myPie = new Chart(ctx,{
140
+ type: 'pie',
141
+ data: srh_series,
142
+ options: {responsive : true}
143
+ });*/
144
+ window.myPie = new Chart(ctx).Pie(srh_series, {responsive : true});
145
+ }
146
+
147
+
148
+ function isEmpty(val){
149
+ return (val == null || val == 0 || val == '' || val == '0');
150
+ }
151
+
152
+ //------------------------------------------------------------------------------
153
+ function countVisits(arr){
154
+ var count = 0;
155
+ for(var i = 0; i < arr.length; i++){
156
+ count += Number(arr[i]);
157
+ }
158
+ return count;
159
+ }
160
+ //------------------------------------------------------------------------------
161
+
162
+ jQuery(document).ready(function () {
163
+
164
+ //------------------------------------------
165
+ //if(visitsData.success && typeof visitsData.data != 'undefined'){
166
+ var duration = jQuery('#hits-duration').val();
167
+ drawVisitsLineChart( mystart_date, myend_date, '1 day', visitors_data, visits_data, duration );
168
+ //}
169
+ //------------------------------------------
170
+ if (browsersData.success && typeof browsersData.data != 'undefined' && typeof drawBrowsersBieChart === "function") {
171
+ drawBrowsersBieChart(browsersData.data);
172
+ }
173
+ //------------------------------------------
174
+ if (srhEngVisitsData.success && typeof srhEngVisitsData.data != 'undefined' && typeof drawSrhEngVstLineChart === "function") {
175
+ drawSrhEngVstLineChart(srhEngVisitsData);
176
+ }
177
+ //------------------------------------------
178
+
179
+ //------------------------------------------
180
+ jQuery.fn.dataTable.ext.errMode = 'none';
181
+ /* pagination, export and search feature related jquery */
182
+ if(jQuery('#traffic_by_title').length)
183
+ {
184
+ jQuery('#traffic_by_title').DataTable({
185
+ "pageLength":10,
186
+ "searching": true,
187
+ "ordering": false,
188
+ "bLengthChange": false,
189
+ "bFilter": true,
190
+ "bInfo": false,
191
+ "bAutoWidth": false,
192
+ "bJQueryUI": true,
193
+ "processing": true,
194
+ "serverSide": true,
195
+ ajax: ahc_ajax.ajax_url+'?action=traffic_by_title',
196
+ dataSrc: 'data',
197
+ columns: [
198
+ { data: 'rank' },
199
+ { data: 'til_page_title' },
200
+ { data: 'til_hits' },
201
+ { data: 'percent' }
202
+ ],
203
+ language: {
204
+ searchPlaceholder: "Title",
205
+ processing: "<span class='loader'>&nbsp;</span>",
206
+ "zeroRecords": "No data available.",
207
+ paginate: {
208
+ next: '<i class="dashicons dashicons-arrow-right-alt2"></i>',
209
+ previous: '<i class="dashicons dashicons-arrow-left-alt2"></i>'
210
+ }
211
+ },
212
+ "fnDrawCallback": function(oSettings) {
213
+ if (oSettings._iDisplayLength > oSettings.fnRecordsDisplay()) {
214
+ jQuery(oSettings.nTableWrapper).find('.dataTables_paginate').hide();
215
+ }
216
+ },
217
+ dom: 'Bfrtip',
218
+ buttons: [{
219
+ extend: 'excelHtml5',
220
+ title:"",
221
+ action: function (e, dt, node, config) {
222
+ jQuery("#traffic_by_title").parents(".panelcontent").find(".dataTables_processing").show();
223
+ jQuery.ajax({
224
+ url: ahc_ajax.ajax_url+'?action=traffic_by_title&page=all',
225
+ data: dt.ajax.params(),
226
+ success: function(res, status, xhr) {
227
+ //console.log(res);
228
+
229
+ var createXLSLFormatObj = [];
230
+
231
+ /* XLS Head Columns */
232
+ var xlsHeader = ["Rank", "Title","Hits","Percentage"];
233
+
234
+ /* XLS Rows Data */
235
+ var xlsRows = JSON.parse(res);
236
+
237
+ createXLSLFormatObj.push(xlsHeader);
238
+ jQuery.each(xlsRows, function(index, value) {
239
+ var innerRowData = [];
240
+ jQuery.each(value, function(ind, val) {
241
+ innerRowData.push(val);
242
+ });
243
+ createXLSLFormatObj.push(innerRowData);
244
+ });
245
+ jQuery("#traffic_by_title").parents(".panelcontent").find(".dataTables_processing").hide();
246
+ /* File Name */
247
+ var filename = "traffic_by_title.xlsx";
248
+
249
+ /* Sheet Name */
250
+ var ws_name = "sheet1";
251
+
252
+ if (typeof console !== 'undefined') console.log(new Date());
253
+ var wb = XLSX.utils.book_new(),
254
+ ws = XLSX.utils.aoa_to_sheet(createXLSLFormatObj);
255
+
256
+ /* Add worksheet to workbook */
257
+ XLSX.utils.book_append_sheet(wb, ws, ws_name);
258
+
259
+ /* Write workbook and Download */
260
+ if (typeof console !== 'undefined') console.log(new Date());
261
+ XLSX.writeFile(wb, filename);
262
+ if (typeof console !== 'undefined') console.log(new Date());
263
+
264
+ }
265
+ })
266
+ }
267
+
268
+ }]
269
+ });
270
+ }
271
+ if(jQuery('#lasest_search_words').length)
272
+ {
273
+ latestSearchTable();
274
+ }
275
+ function latestSearchTable()
276
+ {
277
+ jQuery('#lasest_search_words').DataTable({
278
+ "pageLength": 10,
279
+ "searching": false,
280
+ "ordering": false,
281
+ "bLengthChange": false,
282
+ "bFilter": true,
283
+ "bInfo": false,
284
+ "bJQueryUI": true,
285
+ "processing": true,
286
+ "serverSide": true,
287
+ ajax: ahc_ajax.ajax_url+'?action=latest_search_words&fdt='+jQuery("#from_dt").val()+"&tdt="+jQuery("#to_dt").val(),
288
+ dataSrc: 'data',
289
+ columnDefs: [{
290
+ targets: 1,
291
+ className: 'hide'
292
+ }],
293
+ columns: [
294
+ { data: 'img' },
295
+ { data: 'csb' },
296
+ { data: 'keyword' },
297
+ { data: 'dt' },
298
+ ],
299
+ language: {
300
+ processing: "<span class='loader'>&nbsp;</span>",
301
+ "zeroRecords": "No data available.",
302
+ paginate: {
303
+ next: '<i class="dashicons dashicons-arrow-right-alt2"></i>',
304
+ previous: '<i class="dashicons dashicons-arrow-left-alt2"></i>'
305
+ }
306
+ },
307
+ "fnDrawCallback": function(oSettings) {
308
+ if (oSettings._iDisplayLength > oSettings.fnRecordsDisplay()) {
309
+ jQuery(oSettings.nTableWrapper).find('.dataTables_paginate').hide();
310
+ }
311
+ },
312
+ dom: 'Bfrtip',
313
+ buttons: [{
314
+ extend: 'excelHtml5',
315
+ title:"",
316
+ action: function (e, dt, node, config) {
317
+ jQuery("#lasest_search_words").parents(".panelcontent").find(".dataTables_processing").show();
318
+ jQuery.ajax({
319
+ url: ahc_ajax.ajax_url+'?action=latest_search_words&page=all&fdt='+jQuery("#from_dt").val()+"&tdt="+jQuery("#to_dt").val(),
320
+ data: dt.ajax.params(),
321
+ success: function(res, status, xhr) {
322
+ //console.log(res);
323
+
324
+ var createXLSLFormatObj = [];
325
+
326
+ /* XLS Head Columns */
327
+ var xlsHeader = ["Country/SE/Browser", "Keyword","Date"];
328
+
329
+ /* XLS Rows Data */
330
+ var xlsRows = JSON.parse(res);
331
+
332
+ createXLSLFormatObj.push(xlsHeader);
333
+ jQuery.each(xlsRows, function(index, value) {
334
+ var innerRowData = [];
335
+ jQuery.each(value, function(ind, val) {
336
+ innerRowData.push(val);
337
+ });
338
+ createXLSLFormatObj.push(innerRowData);
339
+ });
340
+ jQuery("#lasest_search_words").parents(".panelcontent").find(".dataTables_processing").hide();
341
+ /* File Name */
342
+ var filename = "latest_search_words.xlsx";
343
+
344
+ /* Sheet Name */
345
+ var ws_name = "sheet1";
346
+
347
+ if (typeof console !== 'undefined') console.log(new Date());
348
+ var wb = XLSX.utils.book_new(),
349
+ ws = XLSX.utils.aoa_to_sheet(createXLSLFormatObj);
350
+
351
+ /* Add worksheet to workbook */
352
+ XLSX.utils.book_append_sheet(wb, ws, ws_name);
353
+
354
+ /* Write workbook and Download */
355
+ if (typeof console !== 'undefined') console.log(new Date());
356
+ XLSX.writeFile(wb, filename);
357
+ if (typeof console !== 'undefined') console.log(new Date());
358
+
359
+ }
360
+ })
361
+ },
362
+ exportOptions: {
363
+ columns: [1,2,3]
364
+ },
365
+ }],
366
+
367
+ });
368
+
369
+ }
370
+
371
+ if(jQuery('#top_refering_sites').find("tr").length > 1)
372
+ {
373
+ jQuery('#top_refering_sites').DataTable({
374
+ "pageLength": 10,
375
+ "searching": false,
376
+ "ordering": false,
377
+ "bLengthChange": false,
378
+ "bFilter": true,
379
+ "bInfo": false,
380
+ "bAutoWidth": false,
381
+ language: {
382
+ paginate: {
383
+ next: '<i class="dashicons dashicons-arrow-right-alt2"></i>',
384
+ previous: '<i class="dashicons dashicons-arrow-left-alt2"></i>'
385
+ }
386
+ },
387
+ "fnDrawCallback": function(oSettings) {
388
+ if (oSettings._iDisplayLength > oSettings.fnRecordsDisplay()) {
389
+ jQuery(oSettings.nTableWrapper).find('.dataTables_paginate').hide();
390
+ }
391
+ },
392
+ dom: 'Bfrtip',
393
+ buttons: [{
394
+ extend: 'excelHtml5',
395
+ title:""
396
+ }]
397
+ });
398
+ }
399
+ if(jQuery('#recent_visit_by_ip').length )
400
+ {
401
+ recentVisiroeByIPTable();
402
+ }
403
+ function recentVisiroeByIPTable()
404
+ {
405
+ jQuery('#recent_visit_by_ip').DataTable({
406
+ "pageLength": 10,
407
+ "searching": false,
408
+ "ordering": false,
409
+ "bLengthChange": false,
410
+ "bFilter": true,
411
+ "bInfo": false,
412
+ "bAutoWidth": false,
413
+ "bJQueryUI": true,
414
+ "processing": true,
415
+ "serverSide": true,
416
+ "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
417
+ ajax: ahc_ajax.ajax_url+'?action=recent_visitor_by_ip&fdt='+jQuery("#r_from_dt").val()+"&tdt="+jQuery("#r_to_dt").val()+"&ip="+jQuery("#ip_addr").val(),
418
+ dataSrc: 'data',
419
+ columns: [
420
+ { data: 'hit_ip_address' },
421
+ { data: 'ctr_name' },
422
+ //{ data: 'ahc_city' },
423
+ //{ data: 'ahc_region' },
424
+ //{ data: 'bsr_name' },
425
+ { data: 'time' }
426
+ ],
427
+ language: {
428
+ processing: "<span class='loader'>&nbsp;</span>",
429
+ "zeroRecords": "No data available.",
430
+ paginate: {
431
+ next: '<i class="dashicons dashicons-arrow-right-alt2"></i>',
432
+ previous: '<i class="dashicons dashicons-arrow-left-alt2"></i>'
433
+ }
434
+ },
435
+ "fnDrawCallback": function(oSettings) {
436
+ if (oSettings._iDisplayLength > oSettings.fnRecordsDisplay()) {
437
+ jQuery(oSettings.nTableWrapper).find('.dataTables_paginate').hide();
438
+ }
439
+ },
440
+ dom: 'Bfrtip',
441
+ buttons: [{
442
+ extend: 'excelHtml5',
443
+ title:"",
444
+ action: function (e, dt, node, config) {
445
+ jQuery("#recent_visit_by_ip").parents(".panelcontent").find(".dataTables_processing").show();
446
+ jQuery.ajax({
447
+ url: ahc_ajax.ajax_url+'?action=recent_visitor_by_ip&page=all&fdt='+jQuery("#r_from_dt").val()+"&tdt="+jQuery("#r_to_dt").val()+"&ip="+jQuery("#ip_addr").val(),
448
+ data: dt.ajax.params(),
449
+ success: function(res, status, xhr) {
450
+ //console.log(res);
451
+
452
+ var createXLSLFormatObj = [];
453
+
454
+ /* XLS Head Columns */
455
+ var xlsHeader = ["IP Address", "Location","Time"];
456
+
457
+ /* XLS Rows Data */
458
+ var xlsRows = JSON.parse(res);
459
+
460
+ createXLSLFormatObj.push(xlsHeader);
461
+ jQuery.each(xlsRows, function(index, value) {
462
+ var innerRowData = [];
463
+ jQuery.each(value, function(ind, val) {
464
+ innerRowData.push(val);
465
+ });
466
+ createXLSLFormatObj.push(innerRowData);
467
+ });
468
+ jQuery("#recent_visit_by_ip").parents(".panelcontent").find(".dataTables_processing").hide();
469
+ /* File Name */
470
+ var filename = "recent_visitor_by_ip.xlsx";
471
+
472
+ /* Sheet Name */
473
+ var ws_name = "sheet1";
474
+
475
+ if (typeof console !== 'undefined') console.log(new Date());
476
+ var wb = XLSX.utils.book_new(),
477
+ ws = XLSX.utils.aoa_to_sheet(createXLSLFormatObj);
478
+
479
+ /* Add worksheet to workbook */
480
+ XLSX.utils.book_append_sheet(wb, ws, ws_name);
481
+
482
+ /* Write workbook and Download */
483
+ if (typeof console !== 'undefined') console.log(new Date());
484
+ XLSX.writeFile(wb, filename);
485
+ if (typeof console !== 'undefined') console.log(new Date());
486
+
487
+ }
488
+ })
489
+ }
490
+ }]
491
+ });
492
+
493
+ }
494
+ if(jQuery('#visit_time_graph_table').length)
495
+ {
496
+ visitTimeGraphTable();
497
+ }
498
+ function visitTimeGraphTable()
499
+ {
500
+ jQuery('#visit_time_graph_table').DataTable({
501
+ "pageLength": 10,
502
+ "searching": false,
503
+ "ordering": false,
504
+ "bLengthChange": false,
505
+ "bFilter": true,
506
+ "bInfo": false,
507
+ "bAutoWidth": false,
508
+ "bJQueryUI": true,
509
+ "processing": true,
510
+ "serverSide": true,
511
+ ajax: ahc_ajax.ajax_url+'?action=visits_time_graph&fdt='+jQuery("#vfrom_dt").val()+"&tdt="+jQuery("#vto_dt").val(),
512
+ dataSrc: 'data',
513
+ columns: [
514
+ { data: 'time' },
515
+ { data: 'graph' },
516
+ { data: 'vtm_visitors' },
517
+ { data: 'vtm_visits' }
518
+ ],
519
+ language: {
520
+ processing: "<span class='loader'>&nbsp;</span>",
521
+ "zeroRecords": "No data available.",
522
+ paginate: {
523
+ next: '<i class="dashicons dashicons-arrow-right-alt2"></i>',
524
+ previous: '<i class="dashicons dashicons-arrow-left-alt2"></i>'
525
+ }
526
+ },
527
+ "fnDrawCallback": function(oSettings) {
528
+ if (oSettings._iDisplayLength > oSettings.fnRecordsDisplay()) {
529
+ jQuery(oSettings.nTableWrapper).find('.dataTables_paginate').hide();
530
+ }
531
+ },
532
+ dom: 'Bfrtip',
533
+ buttons: [{
534
+ extend: 'excelHtml5',
535
+ title:"",
536
+ action: function (e, dt, node, config) {
537
+ jQuery("#visit_time_graph_table").parents(".panelcontent").find(".dataTables_processing").show();
538
+ jQuery.ajax({
539
+ url: ahc_ajax.ajax_url+'?action=visits_time_graph&page=all&fdt='+jQuery("#vfrom_dt").val()+"&tdt="+jQuery("#vto_dt").val(),
540
+ data: dt.ajax.params(),
541
+ success: function(res, status, xhr) {
542
+ //console.log(res);
543
+
544
+ var createXLSLFormatObj = [];
545
+
546
+ /* XLS Head Columns */
547
+ var xlsHeader = ["Time","Visitors","Visits","Graph"];
548
+
549
+ /* XLS Rows Data */
550
+ var xlsRows = JSON.parse(res);
551
+
552
+ createXLSLFormatObj.push(xlsHeader);
553
+ jQuery.each(xlsRows, function(index, value) {
554
+ var innerRowData = [];
555
+ jQuery.each(value, function(ind, val) {
556
+ innerRowData.push(val);
557
+ });
558
+ createXLSLFormatObj.push(innerRowData);
559
+ });
560
+ jQuery("#visit_time_graph_table").parents(".panelcontent").find(".dataTables_processing").hide();
561
+ /* File Name */
562
+ var filename = "visits_time_graph.xlsx";
563
+
564
+ /* Sheet Name */
565
+ var ws_name = "sheet1";
566
+
567
+ if (typeof console !== 'undefined') console.log(new Date());
568
+ var wb = XLSX.utils.book_new(),
569
+ ws = XLSX.utils.aoa_to_sheet(createXLSLFormatObj);
570
+
571
+ /* Add worksheet to workbook */
572
+ XLSX.utils.book_append_sheet(wb, ws, ws_name);
573
+
574
+ /* Write workbook and Download */
575
+ if (typeof console !== 'undefined') console.log(new Date());
576
+ XLSX.writeFile(wb, filename);
577
+ if (typeof console !== 'undefined') console.log(new Date());
578
+
579
+ }
580
+ })
581
+ },
582
+ }]
583
+ });
584
+
585
+ }
586
+ if(jQuery('#today_traffic_index_by_country').length )
587
+ {
588
+ trafficByIndexCountryTable();
589
+ }
590
+ function trafficByIndexCountryTable()
591
+ {
592
+ jQuery('#today_traffic_index_by_country').DataTable({
593
+ "pageLength": 10,
594
+ "searching": false,
595
+ "ordering": false,
596
+ "bLengthChange": false,
597
+ "bFilter": true,
598
+ "bInfo": false,
599
+ "bAutoWidth": false,
600
+ "bJQueryUI": true,
601
+ "processing": true,
602
+ "serverSide": true,
603
+ ajax: ahc_ajax.ajax_url+'?action=today_traffic_index&fdt='+jQuery("#t_from_dt").val()+"&tdt="+jQuery("#t_to_dt").val(),
604
+ dataSrc: 'data',
605
+ columns: [
606
+ { data: 'no' },
607
+ { data: 'country' },
608
+ { data: 'ctr_name' },
609
+ { data: 'total' },
610
+ ],
611
+ language: {
612
+ processing: "<span class='loader'>&nbsp;</span>",
613
+ "zeroRecords": "No data available.",
614
+ paginate: {
615
+ next: '<i class="dashicons dashicons-arrow-right-alt2"></i>',
616
+ previous: '<i class="dashicons dashicons-arrow-left-alt2"></i>'
617
+ }
618
+ },
619
+ "fnDrawCallback": function(oSettings) {
620
+ if (oSettings._iDisplayLength > oSettings.fnRecordsDisplay()) {
621
+ jQuery(oSettings.nTableWrapper).find('.dataTables_paginate').hide();
622
+ }
623
+ },
624
+ dom: 'Bfrtip',
625
+ buttons: [{
626
+ extend: 'excelHtml5',
627
+ title:"",
628
+ action: function (e, dt, node, config) {
629
+ jQuery("#today_traffic_index_by_country").parents(".panelcontent").find(".dataTables_processing").show();
630
+ jQuery.ajax({
631
+ url: ahc_ajax.ajax_url+'?action=today_traffic_index&page=all&fdt='+jQuery("#t_from_dt").val()+"&tdt="+jQuery("#t_to_dt").val(),
632
+ data: dt.ajax.params(),
633
+ success: function(res, status, xhr) {
634
+ //console.log(res);
635
+
636
+ var createXLSLFormatObj = [];
637
+
638
+ /* XLS Head Columns */
639
+ var xlsHeader = ["No","Country", "Total"];
640
+
641
+ /* XLS Rows Data */
642
+ var xlsRows = JSON.parse(res);
643
+
644
+ createXLSLFormatObj.push(xlsHeader);
645
+ jQuery.each(xlsRows, function(index, value) {
646
+ var innerRowData = [];
647
+ jQuery.each(value, function(ind, val) {
648
+ innerRowData.push(val);
649
+ });
650
+ createXLSLFormatObj.push(innerRowData);
651
+ });
652
+ jQuery("#today_traffic_index_by_country").parents(".panelcontent").find(".dataTables_processing").hide();
653
+
654
+ /* File Name */
655
+ var filename = "today_traffic_index.xlsx";
656
+
657
+ /* Sheet Name */
658
+ var ws_name = "sheet1";
659
+
660
+ if (typeof console !== 'undefined') console.log(new Date());
661
+ var wb = XLSX.utils.book_new(),
662
+ ws = XLSX.utils.aoa_to_sheet(createXLSLFormatObj);
663
+
664
+ /* Add worksheet to workbook */
665
+ XLSX.utils.book_append_sheet(wb, ws, ws_name);
666
+
667
+ /* Write workbook and Download */
668
+ if (typeof console !== 'undefined') console.log(new Date());
669
+ XLSX.writeFile(wb, filename);
670
+ if (typeof console !== 'undefined') console.log(new Date());
671
+
672
+ }
673
+ })
674
+ },
675
+ exportOptions: {
676
+ columns: [0,2,3]
677
+ },
678
+ }]
679
+ });
680
+
681
+ }
682
+ if(jQuery('#summary_statistics').find("tr").length > 1)
683
+ {
684
+ jQuery('#summary_statistics').DataTable({
685
+ "pageLength": 100,
686
+ "searching": false,
687
+ "ordering": false,
688
+ "bPaginate": false,
689
+ "bLengthChange": false,
690
+ "bFilter": true,
691
+ "bInfo": false,
692
+ "bAutoWidth": false,
693
+ "fnDrawCallback": function(oSettings) {
694
+ if (oSettings._iDisplayLength > oSettings.fnRecordsDisplay()) {
695
+ jQuery(oSettings.nTableWrapper).find('.dataTables_paginate').hide();
696
+ }
697
+ },
698
+ dom: 'Bfrtip',
699
+ buttons: [{
700
+ extend: 'excelHtml5',
701
+ title:""
702
+ }]
703
+ });
704
+
705
+ }
706
+ if(jQuery('#search_engine').find("tr").length > 1)
707
+ {
708
+ jQuery('#search_engine').DataTable({
709
+ "pageLength": 100,
710
+ "searching": false,
711
+ "ordering": false,
712
+ "bPaginate": false,
713
+ "bLengthChange": false,
714
+ "bFilter": true,
715
+ "bInfo": false,
716
+ "bAutoWidth": false,
717
+ "fnDrawCallback": function(oSettings) {
718
+ if (oSettings._iDisplayLength > oSettings.fnRecordsDisplay()) {
719
+ jQuery(oSettings.nTableWrapper).find('.dataTables_paginate').hide();
720
+ }
721
+ },
722
+ dom: 'Bfrtip',
723
+ buttons: [{
724
+ extend: 'excelHtml5',
725
+ title:""
726
+ }]
727
+ });
728
+
729
+ }
730
+
731
+ jQuery(".export_data a").click(function(e) {
732
+ e.preventDefault();
733
+ jQuery(this).parents(".panel").find(".dt-buttons").find(".dt-button").trigger("click");
734
+
735
+ })
736
+
737
+ var dateFormat = "mm-dd-yy";
738
+ if(jQuery("#from_dt").length && jQuery("#to_dt").length)
739
+ {
740
+ var from = jQuery( "#from_dt" ).datepicker({
741
+ defaultDate: 0,
742
+ dateFormat:"mm-dd-yy",
743
+ numberOfMonths: 1
744
+ });
745
+
746
+
747
+ var to = jQuery( "#to_dt" ).datepicker({
748
+ defaultDate: 0,
749
+ dateFormat:"mm-dd-yy",
750
+ numberOfMonths: 1
751
+ });
752
+ }
753
+
754
+
755
+ if(jQuery("#summary_from_dt").length && jQuery("#summary_to_dt").length)
756
+ {
757
+ var from = jQuery( "#summary_from_dt" ).datepicker({
758
+ defaultDate: 0,
759
+ dateFormat:"yy-mm-dd",
760
+ numberOfMonths: 1
761
+ });
762
+
763
+
764
+ var to = jQuery( "#summary_to_dt" ).datepicker({
765
+ defaultDate: 0,
766
+ dateFormat:"yy-mm-dd",
767
+ numberOfMonths: 1
768
+ });
769
+ }
770
+
771
+
772
+ jQuery( "#to_dt" ).on( "change", function() {
773
+ from.datepicker( "option", "maxDate", getDate( this ) );
774
+ });
775
+
776
+ jQuery("#from_dt").on( "change", function() {
777
+ to.datepicker( "option", "minDate", getDate( this ) );
778
+ });
779
+
780
+ if(jQuery("#t_from_dt").length && jQuery("#t_to_dt").length)
781
+ {
782
+ var t_from_dt = jQuery( "#t_from_dt" ).datepicker({
783
+ defaultDate: 0,
784
+ dateFormat:"mm-dd-yy",
785
+ numberOfMonths: 1
786
+ });
787
+
788
+
789
+ var t_to_dt = jQuery( "#t_to_dt" ).datepicker({
790
+ defaultDate: 0,
791
+ dateFormat:"mm-dd-yy",
792
+ numberOfMonths: 1
793
+ });
794
+ }
795
+
796
+ jQuery( "#t_to_dt" ).on( "change", function() {
797
+ t_from_dt.datepicker( "option", "maxDate", getDate( this ) );
798
+ });
799
+
800
+ jQuery("#t_from_dt").on( "change", function() {
801
+ t_to_dt.datepicker( "option", "minDate", getDate( this ) );
802
+ });
803
+
804
+ if(jQuery("#vfrom_dt").length && jQuery( "#vto_dt" ).length)
805
+ {
806
+ var vfrom = jQuery( "#vfrom_dt" ).datepicker({
807
+ defaultDate: 0,
808
+ dateFormat:"mm-dd-yy",
809
+ numberOfMonths: 1
810
+ });
811
+
812
+ var vto = jQuery( "#vto_dt" ).datepicker({
813
+ defaultDate: 0,
814
+ dateFormat:"mm-dd-yy",
815
+ numberOfMonths: 1
816
+ });
817
+ }
818
+
819
+ jQuery( "#vto_dt" ).on( "change", function() {
820
+ vfrom.datepicker( "option", "maxDate", getDate( this ) );
821
+ });
822
+
823
+ jQuery("#vfrom_dt").on( "change", function() {
824
+ vto.datepicker( "option", "minDate", getDate( this ) );
825
+ });
826
+
827
+ if(jQuery("#r_from_dt").length && jQuery( "#r_to_dt" ).length)
828
+ {
829
+ var vfrom = jQuery( "#r_from_dt" ).datepicker({
830
+ defaultDate: 0,
831
+ dateFormat:"mm-dd-yy",
832
+ numberOfMonths: 1
833
+ });
834
+
835
+ var vto = jQuery( "#r_to_dt" ).datepicker({
836
+ defaultDate: 0,
837
+ dateFormat:"mm-dd-yy",
838
+ numberOfMonths: 1
839
+ });
840
+ }
841
+
842
+ jQuery( "#r_to_dt" ).on( "change", function() {
843
+ vfrom.datepicker( "option", "maxDate", getDate( this ) );
844
+ });
845
+
846
+ jQuery("#r_from_dt").on( "change", function() {
847
+ vto.datepicker( "option", "minDate", getDate( this ) );
848
+ });
849
+
850
+
851
+ function getDate( element ) {
852
+ var date;
853
+ try {
854
+ date = jQuery.datepicker.parseDate( dateFormat, element.value );
855
+ } catch( error ) {
856
+ date = null;
857
+ }
858
+ return date;
859
+ }
860
+ jQuery(".search-panel .search_frm").submit(function(e){
861
+ e.preventDefault();
862
+ var tableID = jQuery(this).parents(".panel").find(".panelcontent").find("table").attr("id");
863
+
864
+
865
+ if(tableID=="recent_visit_by_ip")
866
+ {
867
+ jQuery('#'+tableID).DataTable().destroy();
868
+ recentVisiroeByIPTable();
869
+ return false;
870
+ }
871
+ else if(tableID=="today_traffic_index_by_country")
872
+ {
873
+ jQuery('#'+tableID).DataTable().destroy();
874
+ trafficByIndexCountryTable();
875
+ return false;
876
+ }
877
+ else if(tableID=="lasest_search_words")
878
+ {
879
+ jQuery('#'+tableID).DataTable().destroy();
880
+ latestSearchTable();
881
+ return false;
882
+ }
883
+ else if(tableID=="visit_time_graph_table")
884
+ {
885
+ jQuery('#'+tableID).DataTable().destroy();
886
+ visitTimeGraphTable();
887
+ return false;
888
+ }
889
+ else
890
+ return true;
891
+
892
+
893
+ });
894
+ jQuery(".clear_form").click(function(e){
895
+ jQuery(this).parents("form").find(".ahc_clear").val("");
896
+ jQuery(this).parents("form").submit();
897
+ });
898
+
899
+ jQuery(".search_data a").click(function(e){
900
+ e.preventDefault();
901
+ if(jQuery(this).parents(".panel").find(".search-panel").length)
902
+ jQuery(this).parents(".panel").find(".search-panel").slideToggle();
903
+ if(jQuery(this).parents(".panel").find(".dataTables_filter").length)
904
+ jQuery(this).parents(".panel").find(".dataTables_filter").slideToggle();
905
+ });
906
+ });
js/buttons.html5.min.js ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ HTML5 export buttons for Buttons and DataTables.
3
+ 2016 SpryMedia Ltd - datatables.net/license
4
+
5
+ FileSaver.js (1.3.3) - MIT license
6
+ Copyright © 2016 Eli Grey - http://eligrey.com
7
+ */
8
+ (function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(g){return f(g,window,document)}):"object"===typeof exports?module.exports=function(g,p,z,t){g||(g=window);p&&p.fn.dataTable||(p=require("datatables.net")(g,p).$);p.fn.dataTable.Buttons||require("datatables.net-buttons")(g,p);return f(p,g,g.document,z,t)}:f(jQuery,window,document)})(function(f,g,p,z,t,w){function A(a){for(var b="";0<=a;)b=String.fromCharCode(a%26+65)+b,a=Math.floor(a/
9
+ 26)-1;return b}function E(a,b){y===w&&(y=-1===C.serializeToString(f.parseXML(F["xl/worksheets/sheet1.xml"])).indexOf("xmlns:r"));f.each(b,function(b,c){if(f.isPlainObject(c))b=a.folder(b),E(b,c);else{if(y){var d=c.childNodes[0],e,h=[];for(e=d.attributes.length-1;0<=e;e--){var m=d.attributes[e].nodeName;var k=d.attributes[e].nodeValue;-1!==m.indexOf(":")&&(h.push({name:m,value:k}),d.removeAttribute(m))}e=0;for(m=h.length;e<m;e++)k=c.createAttribute(h[e].name.replace(":","_dt_b_namespace_token_")),
10
+ k.value=h[e].value,d.setAttributeNode(k)}c=C.serializeToString(c);y&&(-1===c.indexOf("<?xml")&&(c='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+c),c=c.replace(/_dt_b_namespace_token_/g,":"),c=c.replace(/xmlns:NS[\d]+="" NS[\d]+:/g,""));c=c.replace(/<([^<>]*?) xmlns=""([^<>]*?)>/g,"<$1 $2>");a.file(b,c)}})}function r(a,b,d){var c=a.createElement(b);d&&(d.attr&&f(c).attr(d.attr),d.children&&f.each(d.children,function(a,b){c.appendChild(b)}),null!==d.text&&d.text!==w&&c.appendChild(a.createTextNode(d.text)));
11
+ return c}function L(a,b){var d=a.header[b].length;a.footer&&a.footer[b].length>d&&(d=a.footer[b].length);for(var c=0,f=a.body.length;c<f;c++){var e=a.body[c][b];e=null!==e&&e!==w?e.toString():"";-1!==e.indexOf("\n")?(e=e.split("\n"),e.sort(function(a,c){return c.length-a.length}),e=e[0].length):e=e.length;e>d&&(d=e);if(40<d)return 54}d*=1.35;return 6<d?d:6}var v=f.fn.dataTable;v.Buttons.pdfMake=function(a){if(!a)return t||g.pdfMake;t=m_ake};v.Buttons.jszip=function(a){if(!a)return z||g.JSZip;z=a};
12
+ var B=function(a){if(!("undefined"===typeof a||"undefined"!==typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var b=a.document.createElementNS("http://www.w3.org/1999/xhtml","a"),d="download"in b,c=/constructor/i.test(a.HTMLElement)||a.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),e=function(c){(a.setImmediate||a.setTimeout)(function(){throw c;},0)},h=function(c){setTimeout(function(){"string"===typeof c?(a.URL||a.webkitURL||a).revokeObjectURL(c):c.remove()},4E4)},m=function(a){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?
13
+ new Blob([String.fromCharCode(65279),a],{type:a.type}):a},k=function(k,q,n){n||(k=m(k));var l=this,g="application/octet-stream"===k.type,D=function(){var a=["writestart","progress","write","writeend"];a=[].concat(a);for(var c=a.length;c--;){var b=l["on"+a[c]];if("function"===typeof b)try{b.call(l,l)}catch(M){e(M)}}};l.readyState=l.INIT;if(d){var u=(a.URL||a.webkitURL||a).createObjectURL(k);setTimeout(function(){b.href=u;b.download=q;var a=new MouseEvent("click");b.dispatchEvent(a);D();h(u);l.readyState=
14
+ l.DONE})}else(function(){if((f||g&&c)&&a.FileReader){var b=new FileReader;b.onloadend=function(){var c=f?b.result:b.result.replace(/^data:[^;]*;/,"data:attachment/file;");a.open(c,"_blank")||(a.location.href=c);l.readyState=l.DONE;D()};b.readAsDataURL(k);l.readyState=l.INIT}else u||(u=(a.URL||a.webkitURL||a).createObjectURL(k)),g?a.location.href=u:a.open(u,"_blank")||(a.location.href=u),l.readyState=l.DONE,D(),h(u)})()},n=k.prototype;if("undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob)return function(a,
15
+ c,b){c=c||a.name||"download";b||(a=m(a));return navigator.msSaveOrOpenBlob(a,c)};n.abort=function(){};n.readyState=n.INIT=0;n.WRITING=1;n.DONE=2;n.error=n.onwritestart=n.onprogress=n.onwrite=n.onabort=n.onerror=n.onwriteend=null;return function(a,c,b){return new k(a,c||a.name||"download",b)}}}("undefined"!==typeof self&&self||"undefined"!==typeof g&&g||this.content);v.fileSave=B;var G=function(a){var b="Sheet1";a.sheetName&&(b=a.sheetName.replace(/[\[\]\*\/\\\?:]/g,""));return b},H=function(a){return a.newline?
16
+ a.newline:navigator.userAgent.match(/Windows/)?"\r\n":"\n"},I=function(a,b){var d=H(b);a=a.buttons.exportData(b.exportOptions);var c=b.fieldBoundary,f=b.fieldSeparator,e=new RegExp(c,"g"),h=b.escapeChar!==w?b.escapeChar:"\\",m=function(a){for(var b="",d=0,m=a.length;d<m;d++)0<d&&(b+=f),b+=c?c+(""+a[d]).replace(e,h+c)+c:a[d];return b},k=b.header?m(a.header)+d:"";b=b.footer&&a.footer?d+m(a.footer):"";for(var n=[],g=0,q=a.body.length;g<q;g++)n.push(m(a.body[g]));return{str:k+n.join(d)+b,rows:n.length}},
17
+ J=function(){if(-1===navigator.userAgent.indexOf("Safari")||-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Opera"))return!1;var a=navigator.userAgent.match(/AppleWebKit\/(\d+\.\d+)/);return a&&1<a.length&&603.1>1*a[1]?!0:!1};try{var C=new XMLSerializer,y}catch(a){}var F={"_rels/.rels":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',
18
+ "xl/_rels/workbook.xml.rels":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>',"[Content_Types].xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="jpeg" ContentType="image/jpeg" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /></Types>',
19
+ "xl/workbook.xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="24816"/><workbookPr showInkAnnotation="0" autoCompressPictures="0"/><bookViews><workbookView xWindow="0" yWindow="0" windowWidth="25600" windowHeight="19020" tabRatio="500"/></bookViews><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets><definedNames/></workbook>',
20
+ "xl/worksheets/sheet1.xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><sheetData/><mergeCells count="0"/></worksheet>',"xl/styles.xml":'<?xml version="1.0" encoding="UTF-8"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><numFmts count="6"><numFmt numFmtId="164" formatCode="#,##0.00_- [$$-45C]"/><numFmt numFmtId="165" formatCode="&quot;£&quot;#,##0.00"/><numFmt numFmtId="166" formatCode="[$€-2] #,##0.00"/><numFmt numFmtId="167" formatCode="0.0%"/><numFmt numFmtId="168" formatCode="#,##0;(#,##0)"/><numFmt numFmtId="169" formatCode="#,##0.00;(#,##0.00)"/></numFmts><fonts count="5" x14ac:knownFonts="1"><font><sz val="11" /><name val="Calibri" /></font><font><sz val="11" /><name val="Calibri" /><color rgb="FFFFFFFF" /></font><font><sz val="11" /><name val="Calibri" /><b /></font><font><sz val="11" /><name val="Calibri" /><i /></font><font><sz val="11" /><name val="Calibri" /><u /></font></fonts><fills count="6"><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="solid"><fgColor rgb="FFD9D9D9" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="FFD99795" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="ffc6efce" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="ffc6cfef" /><bgColor indexed="64" /></patternFill></fill></fills><borders count="2"><border><left /><right /><top /><bottom /><diagonal /></border><border diagonalUp="false" diagonalDown="false"><left style="thin"><color auto="1" /></left><right style="thin"><color auto="1" /></right><top style="thin"><color auto="1" /></top><bottom style="thin"><color auto="1" /></bottom><diagonal /></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" /></cellStyleXfs><cellXfs count="67"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="left"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="center"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="right"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="fill"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment textRotation="90"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment wrapText="1"/></xf><xf numFmtId="9" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="164" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="165" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="166" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="167" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="168" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="169" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="3" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="4" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="1" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="2" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0" /></cellStyles><dxfs count="0" /><tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4" /></styleSheet>'},
21
+ K=[{match:/^\-?\d+\.\d%$/,style:60,fmt:function(a){return a/100}},{match:/^\-?\d+\.?\d*%$/,style:56,fmt:function(a){return a/100}},{match:/^\-?\$[\d,]+.?\d*$/,style:57},{match:/^\-?£[\d,]+.?\d*$/,style:58},{match:/^\-?€[\d,]+.?\d*$/,style:59},{match:/^\-?\d+$/,style:65},{match:/^\-?\d+\.\d{2}$/,style:66},{match:/^\([\d,]+\)$/,style:61,fmt:function(a){return-1*a.replace(/[\(\)]/g,"")}},{match:/^\([\d,]+\.\d{2}\)$/,style:62,fmt:function(a){return-1*a.replace(/[\(\)]/g,"")}},{match:/^\-?[\d,]+$/,style:63},
22
+ {match:/^\-?[\d,]+\.\d{2}$/,style:64}];v.ext.buttons.copyHtml5={className:"buttons-copy buttons-html5",text:function(a){return a.i18n("buttons.copy","Copy")},action:function(a,b,d,c){this.processing(!0);var g=this;a=I(b,c);var e=b.buttons.exportInfo(c),h=H(c),m=a.str;d=f("<div/>").css({height:1,width:1,overflow:"hidden",position:"fixed",top:0,left:0});e.title&&(m=e.title+h+h+m);e.messageTop&&(m=e.messageTop+h+h+m);e.messageBottom&&(m=m+h+h+e.messageBottom);c.customize&&(m=c.customize(m,c,b));c=f("<textarea readonly/>").val(m).appendTo(d);
23
+ if(p.queryCommandSupported("copy")){d.appendTo(b.table().container());c[0].focus();c[0].select();try{var k=p.execCommand("copy");d.remove();if(k){b.buttons.info(b.i18n("buttons.copyTitle","Copy to clipboard"),b.i18n("buttons.copySuccess",{1:"Copied one row to clipboard",_:"Copied %d rows to clipboard"},a.rows),2E3);this.processing(!1);return}}catch(q){}}k=f("<span>"+b.i18n("buttons.copyKeys","Press <i>ctrl</i> or <i>⌘</i> + <i>C</i> to copy the table data<br>to your system clipboard.<br><br>To cancel, click this message or press escape.")+
24
+ "</span>").append(d);b.buttons.info(b.i18n("buttons.copyTitle","Copy to clipboard"),k,0);c[0].focus();c[0].select();var n=f(k).closest(".dt-button-info"),r=function(){n.off("click.buttons-copy");f(p).off(".buttons-copy");b.buttons.info(!1)};n.on("click.buttons-copy",r);f(p).on("keydown.buttons-copy",function(a){27===a.keyCode&&(r(),g.processing(!1))}).on("copy.buttons-copy cut.buttons-copy",function(){r();g.processing(!1)})},exportOptions:{},fieldSeparator:"\t",fieldBoundary:"",header:!0,footer:!1,
25
+ title:"*",messageTop:"*",messageBottom:"*"};v.ext.buttons.csvHtml5={bom:!1,className:"buttons-csv buttons-html5",available:function(){return g.FileReader!==w&&g.Blob},text:function(a){return a.i18n("buttons.csv","CSV")},action:function(a,b,d,c){this.processing(!0);a=I(b,c).str;d=b.buttons.exportInfo(c);var f=c.charset;c.customize&&(a=c.customize(a,c,b));!1!==f?(f||(f=p.characterSet||p.charset),f&&(f=";charset="+f)):f="";c.bom&&(a=""+a);B(new Blob([a],{type:"text/csv"+f}),d.filename,!0);this.processing(!1)},
26
+ filename:"*",extension:".csv",exportOptions:{},fieldSeparator:",",fieldBoundary:'"',escapeChar:'"',charset:null,header:!0,footer:!1};v.ext.buttons.excelHtml5={className:"buttons-excel buttons-html5",available:function(){return g.FileReader!==w&&(z||g.JSZip)!==w&&!J()&&C},text:function(a){return a.i18n("buttons.excel","Excel")},action:function(a,b,d,c){this.processing(!0);var p=this,e=0;a=function(a){return f.parseXML(F[a])};var h=a("xl/worksheets/sheet1.xml"),m=h.getElementsByTagName("sheetData")[0];
27
+ a={_rels:{".rels":a("_rels/.rels")},xl:{_rels:{"workbook.xml.rels":a("xl/_rels/workbook.xml.rels")},"workbook.xml":a("xl/workbook.xml"),"styles.xml":a("xl/styles.xml"),worksheets:{"sheet1.xml":h}},"[Content_Types].xml":a("[Content_Types].xml")};var k=b.buttons.exportData(c.exportOptions),n,v,q=function(a){n=e+1;v=r(h,"row",{attr:{r:n}});for(var b=0,d=a.length;b<d;b++){var k=A(b)+""+n,g=null;if(null===a[b]||a[b]===w||""===a[b])if(!0===c.createEmptyCells)a[b]="";else continue;var l=a[b];a[b]=f.trim(a[b]);
28
+ for(var q=0,p=K.length;q<p;q++){var u=K[q];if(a[b].match&&!a[b].match(/^0\d+/)&&a[b].match(u.match)){g=a[b].replace(/[^\d\.\-]/g,"");u.fmt&&(g=u.fmt(g));g=r(h,"c",{attr:{r:k,s:u.style},children:[r(h,"v",{text:g})]});break}}g||("number"===typeof a[b]||a[b].match&&a[b].match(/^-?\d+(\.\d+)?$/)&&!a[b].match(/^0\d+/)?g=r(h,"c",{attr:{t:"n",r:k},children:[r(h,"v",{text:a[b]})]}):(l=l.replace?l.replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g,""):l,g=r(h,"c",{attr:{t:"inlineStr",r:k},children:{row:r(h,
29
+ "is",{children:{row:r(h,"t",{text:l,attr:{"xml:space":"preserve"}})}})}})));v.appendChild(g)}m.appendChild(v);e++};c.customizeData&&c.customizeData(k);var x=function(a,b){var c=f("mergeCells",h);c[0].appendChild(r(h,"mergeCell",{attr:{ref:"A"+a+":"+A(b)+a}}));c.attr("count",parseFloat(c.attr("count"))+1);f("row:eq("+(a-1)+") c",h).attr("s","51")},l=b.buttons.exportInfo(c);l.title&&(q([l.title],e),x(e,k.header.length-1));l.messageTop&&(q([l.messageTop],e),x(e,k.header.length-1));c.header&&(q(k.header,
30
+ e),f("row:last c",h).attr("s","2"));d=e;var t=0;for(var y=k.body.length;t<y;t++)q(k.body[t],e);t=e;c.footer&&k.footer&&(q(k.footer,e),f("row:last c",h).attr("s","2"));l.messageBottom&&(q([l.messageBottom],e),x(e,k.header.length-1));q=r(h,"cols");f("worksheet",h).prepend(q);x=0;for(y=k.header.length;x<y;x++)q.appendChild(r(h,"col",{attr:{min:x+1,max:x+1,width:L(k,x),customWidth:1}}));q=a.xl["workbook.xml"];f("sheets sheet",q).attr("name",G(c));c.autoFilter&&(f("mergeCells",h).before(r(h,"autoFilter",
31
+ {attr:{ref:"A"+d+":"+A(k.header.length-1)+t}})),f("definedNames",q).append(r(q,"definedName",{attr:{name:"_xlnm._FilterDatabase",localSheetId:"0",hidden:1},text:G(c)+"!$A$"+d+":"+A(k.header.length-1)+t})));c.customize&&c.customize(a,c,b);0===f("mergeCells",h).children().length&&f("mergeCells",h).remove();b=new (z||g.JSZip);d={type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};E(b,a);b.generateAsync?b.generateAsync(d).then(function(a){B(a,l.filename);p.processing(!1)}):
32
+ (B(b.generate(d),l.filename),this.processing(!1))},filename:"*",extension:".xlsx",exportOptions:{},header:!0,footer:!1,title:"*",messageTop:"*",messageBottom:"*",createEmptyCells:!1,autoFilter:!1,sheetName:""};v.ext.buttons.pdfHtml5={className:"buttons-pdf buttons-html5",available:function(){return g.FileReader!==w&&(t||g.pdfMake)},text:function(a){return a.i18n("buttons.pdf","PDF")},action:function(a,b,d,c){this.processing(!0);d=b.buttons.exportData(c.exportOptions);a=b.buttons.exportInfo(c);var p=
33
+ [];c.header&&p.push(f.map(d.header,function(a){return{text:"string"===typeof a?a:a+"",style:"tableHeader"}}));for(var e=0,h=d.body.length;e<h;e++)p.push(f.map(d.body[e],function(a){if(null===a||a===w)a="";return{text:"string"===typeof a?a:a+"",style:e%2?"tableBodyEven":"tableBodyOdd"}}));c.footer&&d.footer&&p.push(f.map(d.footer,function(a){return{text:"string"===typeof a?a:a+"",style:"tableFooter"}}));d={pageSize:c.pageSize,pageOrientation:c.orientation,content:[{table:{headerRows:1,body:p},layout:"noBorders"}],
34
+ styles:{tableHeader:{bold:!0,fontSize:11,color:"white",fillColor:"#2d4154",alignment:"center"},tableBodyEven:{},tableBodyOdd:{fillColor:"#f3f3f3"},tableFooter:{bold:!0,fontSize:11,color:"white",fillColor:"#2d4154"},title:{alignment:"center",fontSize:15},message:{}},defaultStyle:{fontSize:10}};a.messageTop&&d.content.unshift({text:a.messageTop,style:"message",margin:[0,0,0,12]});a.messageBottom&&d.content.push({text:a.messageBottom,style:"message",margin:[0,0,0,12]});a.title&&d.content.unshift({text:a.title,
35
+ style:"title",margin:[0,0,0,12]});c.customize&&c.customize(d,c,b);b=(t||g.pdfMake).createPdf(d);"open"!==c.download||J()?b.download(a.filename):b.open();this.processing(!1)},title:"*",filename:"*",extension:".pdf",exportOptions:{},orientation:"portrait",pageSize:"A4",header:!0,footer:!1,messageTop:"*",messageBottom:"*",customize:null,download:"download"};return v.Buttons});
js/dataTables.buttons.min.js ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Buttons for DataTables 1.5.6
3
+ ©2016-2019 SpryMedia Ltd - datatables.net/license
4
+ */
5
+ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(d,q,n){d instanceof String&&(d=String(d));for(var l=d.length,u=0;u<l;u++){var p=d[u];if(q.call(n,p,u,d))return{i:u,v:p}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
6
+ $jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(d,q,n){d!=Array.prototype&&d!=Object.prototype&&(d[q]=n.value)};$jscomp.getGlobal=function(d){return"undefined"!=typeof window&&window===d?d:"undefined"!=typeof global&&null!=global?global:d};$jscomp.global=$jscomp.getGlobal(this);
7
+ $jscomp.polyfill=function(d,q,n,l){if(q){n=$jscomp.global;d=d.split(".");for(l=0;l<d.length-1;l++){var u=d[l];u in n||(n[u]={});n=n[u]}d=d[d.length-1];l=n[d];q=q(l);q!=l&&null!=q&&$jscomp.defineProperty(n,d,{configurable:!0,writable:!0,value:q})}};$jscomp.polyfill("Array.prototype.find",function(d){return d?d:function(d,n){return $jscomp.findInternal(this,d,n).v}},"es6","es3");
8
+ (function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(q){return d(q,window,document)}):"object"===typeof exports?module.exports=function(q,n){q||(q=window);n&&n.fn.dataTable||(n=require("datatables.net")(q,n).$);return d(n,q,q.document)}:d(jQuery,window,document)})(function(d,q,n,l){function u(a){a=new p.Api(a);var b=a.init().buttons||p.defaults.buttons;return(new t(a,b)).container()}var p=d.fn.dataTable,B=0,C=0,r=p.ext.buttons,t=function(a,b){if(!(this instanceof
9
+ t))return function(b){return(new t(b,a)).container()};"undefined"===typeof b&&(b={});!0===b&&(b={});d.isArray(b)&&(b={buttons:b});this.c=d.extend(!0,{},t.defaults,b);b.buttons&&(this.c.buttons=b.buttons);this.s={dt:new p.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+B++};this.dom={container:d("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)};this._constructor()};d.extend(t.prototype,{action:function(a,b){a=this._nodeToButton(a);if(b===l)return a.conf.action;a.conf.action=
10
+ b;return this},active:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.button.active;c=d(c.node);if(b===l)return c.hasClass(a);c.toggleClass(a,b===l?!0:b);return this},add:function(a,b){var c=this.s.buttons;if("string"===typeof b){b=b.split("-");c=this.s;for(var d=0,f=b.length-1;d<f;d++)c=c.buttons[1*b[d]];c=c.buttons;b=1*b[b.length-1]}this._expandButton(c,a,!1,b);this._draw();return this},container:function(){return this.dom.container},disable:function(a){a=this._nodeToButton(a);d(a.node).addClass(this.c.dom.button.disabled);
11
+ return this},destroy:function(){d("body").off("keyup."+this.s.namespace);var a=this.s.buttons.slice(),b;var c=0;for(b=a.length;c<b;c++)this.remove(a[c].node);this.dom.container.remove();a=this.s.dt.settings()[0];c=0;for(b=a.length;c<b;c++)if(a.inst===this){a.splice(c,1);break}return this},enable:function(a,b){if(!1===b)return this.disable(a);a=this._nodeToButton(a);d(a.node).removeClass(this.c.dom.button.disabled);return this},name:function(){return this.c.name},node:function(a){if(!a)return this.dom.container;
12
+ a=this._nodeToButton(a);return d(a.node)},processing:function(a,b){a=this._nodeToButton(a);if(b===l)return d(a.node).hasClass("processing");d(a.node).toggleClass("processing",b);return this},remove:function(a){var b=this._nodeToButton(a),c=this._nodeToHost(a),e=this.s.dt;if(b.buttons.length)for(var f=b.buttons.length-1;0<=f;f--)this.remove(b.buttons[f].node);b.conf.destroy&&b.conf.destroy.call(e.button(a),e,d(a),b.conf);this._removeKey(b.conf);d(b.node).remove();a=d.inArray(b,c);c.splice(a,1);return this},
13
+ text:function(a,b){var c=this._nodeToButton(a);a=this.c.dom.collection.buttonLiner;a=c.inCollection&&a&&a.tag?a.tag:this.c.dom.buttonLiner.tag;var e=this.s.dt,f=d(c.node),g=function(a){return"function"===typeof a?a(e,f,c.conf):a};if(b===l)return g(c.conf.text);c.conf.text=b;a?f.children(a).html(g(b)):f.html(g(b));return this},_constructor:function(){var a=this,b=this.s.dt,c=b.settings()[0],e=this.c.buttons;c._buttons||(c._buttons=[]);c._buttons.push({inst:this,name:this.c.name});for(var f=0,g=e.length;f<
14
+ g;f++)this.add(e[f]);b.on("destroy",function(b,d){d===c&&a.destroy()});d("body").on("keyup."+this.s.namespace,function(b){if(!n.activeElement||n.activeElement===n.body){var c=String.fromCharCode(b.keyCode).toLowerCase();-1!==a.s.listenKeys.toLowerCase().indexOf(c)&&a._keypress(c,b)}})},_addKey:function(a){a.key&&(this.s.listenKeys+=d.isPlainObject(a.key)?a.key.key:a.key)},_draw:function(a,b){a||(a=this.dom.container,b=this.s.buttons);a.children().detach();for(var c=0,d=b.length;c<d;c++)a.append(b[c].inserter),
15
+ a.append(" "),b[c].buttons&&b[c].buttons.length&&this._draw(b[c].collection,b[c].buttons)},_expandButton:function(a,b,c,e){var f=this.s.dt,g=0;b=d.isArray(b)?b:[b];for(var h=0,k=b.length;h<k;h++){var v=this._resolveExtends(b[h]);if(v)if(d.isArray(v))this._expandButton(a,v,c,e);else{var m=this._buildButton(v,c);if(m){e!==l?(a.splice(e,0,m),e++):a.push(m);if(m.conf.buttons){var y=this.c.dom.collection;m.collection=d("<"+y.tag+"/>").addClass(y.className).attr("role","menu");m.conf._collection=m.collection;
16
+ this._expandButton(m.buttons,m.conf.buttons,!0,e)}v.init&&v.init.call(f.button(m.node),f,d(m.node),v);g++}}}},_buildButton:function(a,b){var c=this.c.dom.button,e=this.c.dom.buttonLiner,f=this.c.dom.collection,g=this.s.dt,h=function(b){return"function"===typeof b?b(g,m,a):b};b&&f.button&&(c=f.button);b&&f.buttonLiner&&(e=f.buttonLiner);if(a.available&&!a.available(g,a))return!1;var k=function(a,b,c,e){e.action.call(b.button(c),a,b,c,e);d(b.table().node()).triggerHandler("buttons-action.dt",[b.button(c),
17
+ b,c,e])};f=a.tag||c.tag;var v=a.clickBlurs===l?!0:a.clickBlurs,m=d("<"+f+"/>").addClass(c.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(b){b.preventDefault();!m.hasClass(c.disabled)&&a.action&&k(b,g,m,a);v&&m.blur()}).on("keyup.dtb",function(b){13===b.keyCode&&!m.hasClass(c.disabled)&&a.action&&k(b,g,m,a)});"a"===f.toLowerCase()&&m.attr("href","#");"button"===f.toLowerCase()&&m.attr("type","button");e.tag?(f=
18
+ d("<"+e.tag+"/>").html(h(a.text)).addClass(e.className),"a"===e.tag.toLowerCase()&&f.attr("href","#"),m.append(f)):m.html(h(a.text));!1===a.enabled&&m.addClass(c.disabled);a.className&&m.addClass(a.className);a.titleAttr&&m.attr("title",h(a.titleAttr));a.attr&&m.attr(a.attr);a.namespace||(a.namespace=".dt-button-"+C++);e=(e=this.c.dom.buttonContainer)&&e.tag?d("<"+e.tag+"/>").addClass(e.className).append(m):m;this._addKey(a);this.c.buttonCreated&&(e=this.c.buttonCreated(a,e));return{conf:a,node:m.get(0),
19
+ inserter:e,buttons:[],inCollection:b,collection:null}},_nodeToButton:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b[c];if(b[c].buttons.length){var f=this._nodeToButton(a,b[c].buttons);if(f)return f}}},_nodeToHost:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b;if(b[c].buttons.length){var f=this._nodeToHost(a,b[c].buttons);if(f)return f}}},_keypress:function(a,b){if(!b._buttonsHandled){var c=function(e){for(var f=
20
+ 0,g=e.length;f<g;f++){var h=e[f].conf,k=e[f].node;h.key&&(h.key===a?(b._buttonsHandled=!0,d(k).click()):!d.isPlainObject(h.key)||h.key.key!==a||h.key.shiftKey&&!b.shiftKey||h.key.altKey&&!b.altKey||h.key.ctrlKey&&!b.ctrlKey||h.key.metaKey&&!b.metaKey||(b._buttonsHandled=!0,d(k).click()));e[f].buttons.length&&c(e[f].buttons)}};c(this.s.buttons)}},_removeKey:function(a){if(a.key){var b=d.isPlainObject(a.key)?a.key.key:a.key;a=this.s.listenKeys.split("");b=d.inArray(b,a);a.splice(b,1);this.s.listenKeys=
21
+ a.join("")}},_resolveExtends:function(a){var b=this.s.dt,c,e=function(c){for(var e=0;!d.isPlainObject(c)&&!d.isArray(c);){if(c===l)return;if("function"===typeof c){if(c=c(b,a),!c)return!1}else if("string"===typeof c){if(!r[c])throw"Unknown button type: "+c;c=r[c]}e++;if(30<e)throw"Buttons: Too many iterations";}return d.isArray(c)?c:d.extend({},c)};for(a=e(a);a&&a.extend;){if(!r[a.extend])throw"Cannot extend unknown button type: "+a.extend;var f=e(r[a.extend]);if(d.isArray(f))return f;if(!f)return!1;
22
+ var g=f.className;a=d.extend({},f,a);g&&a.className!==g&&(a.className=g+" "+a.className);var h=a.postfixButtons;if(h){a.buttons||(a.buttons=[]);g=0;for(c=h.length;g<c;g++)a.buttons.push(h[g]);a.postfixButtons=null}if(h=a.prefixButtons){a.buttons||(a.buttons=[]);g=0;for(c=h.length;g<c;g++)a.buttons.splice(g,0,h[g]);a.prefixButtons=null}a.extend=f.extend}return a}});t.background=function(a,b,c,e){c===l&&(c=400);e||(e=n.body);a?d("<div/>").addClass(b).css("display","none").insertAfter(e).stop().fadeIn(c):
23
+ d("div."+b).stop().fadeOut(c,function(){d(this).removeClass(b).remove()})};t.instanceSelector=function(a,b){if(!a)return d.map(b,function(a){return a.inst});var c=[],e=d.map(b,function(a){return a.name}),f=function(a){if(d.isArray(a))for(var g=0,k=a.length;g<k;g++)f(a[g]);else"string"===typeof a?-1!==a.indexOf(",")?f(a.split(",")):(a=d.inArray(d.trim(a),e),-1!==a&&c.push(b[a].inst)):"number"===typeof a&&c.push(b[a].inst)};f(a);return c};t.buttonSelector=function(a,b){for(var c=[],e=function(a,b,c){for(var d,
24
+ f,g=0,k=b.length;g<k;g++)if(d=b[g])f=c!==l?c+g:g+"",a.push({node:d.node,name:d.conf.name,idx:f}),d.buttons&&e(a,d.buttons,f+"-")},f=function(a,b){var g,h=[];e(h,b.s.buttons);var k=d.map(h,function(a){return a.node});if(d.isArray(a)||a instanceof d)for(k=0,g=a.length;k<g;k++)f(a[k],b);else if(null===a||a===l||"*"===a)for(k=0,g=h.length;k<g;k++)c.push({inst:b,node:h[k].node});else if("number"===typeof a)c.push({inst:b,node:b.s.buttons[a].node});else if("string"===typeof a)if(-1!==a.indexOf(","))for(h=
25
+ a.split(","),k=0,g=h.length;k<g;k++)f(d.trim(h[k]),b);else if(a.match(/^\d+(\-\d+)*$/))k=d.map(h,function(a){return a.idx}),c.push({inst:b,node:h[d.inArray(a,k)].node});else if(-1!==a.indexOf(":name"))for(a=a.replace(":name",""),k=0,g=h.length;k<g;k++)h[k].name===a&&c.push({inst:b,node:h[k].node});else d(k).filter(a).each(function(){c.push({inst:b,node:this})});else"object"===typeof a&&a.nodeName&&(h=d.inArray(a,k),-1!==h&&c.push({inst:b,node:k[h]}))},g=0,h=a.length;g<h;g++)f(b,a[g]);return c};t.defaults=
26
+ {buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:"dt-button-collection"},button:{tag:"ActiveXObject"in q?"a":"button",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""}}};t.version="1.5.6";d.extend(r,{collection:{text:function(a){return a.i18n("buttons.collection","Collection")},className:"buttons-collection",init:function(a,b,c){b.attr("aria-expanded",
27
+ !1)},action:function(a,b,c,e){var f=function(){b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes().each(function(){var a=d(this).siblings(".dt-button-collection");a.length&&a.stop().fadeOut(e.fade,function(){a.detach()});d(this).attr("aria-expanded","false")});d("div.dt-button-background").off("click.dtb-collection");t.background(!1,e.backgroundClassName,e.fade,l);d("body").off(".dtb-collection");b.off("buttons-action.b-internal")};a="true"===c.attr("aria-expanded");f();if(!a){var g=
28
+ d(c).parents("div.dt-button-collection");a=c.position();var h=d(b.table().container()),k=!1,l=c;c.attr("aria-expanded","true");g.length&&(k=d(".dt-button-collection").position(),l=g,d("body").trigger("click.dtb-collection"));l.parents("body")[0]!==n.body&&(l=n.body.lastChild);e._collection.find(".dt-button-collection-title").remove();e._collection.prepend('<div class="dt-button-collection-title">'+e.collectionTitle+"</div>");e._collection.addClass(e.collectionLayout).css("display","none").insertAfter(l).stop().fadeIn(e.fade);
29
+ g=e._collection.css("position");if(k&&"absolute"===g)e._collection.css({top:k.top,left:k.left});else if("absolute"===g){e._collection.css({top:a.top+c.outerHeight(),left:a.left});k=h.offset().top+h.height();k=a.top+c.outerHeight()+e._collection.outerHeight()-k;g=a.top-e._collection.outerHeight();var m=h.offset().top;(k>m-g||e.dropup)&&e._collection.css("top",a.top-e._collection.outerHeight()-5);e._collection.hasClass(e.rightAlignClassName)&&e._collection.css("left",a.left+c.outerWidth()-e._collection.outerWidth());
30
+ k=a.left+e._collection.outerWidth();h=h.offset().left+h.width();k>h&&e._collection.css("left",a.left-(k-h));c=c.offset().left+e._collection.outerWidth();c>d(q).width()&&e._collection.css("left",a.left-(c-d(q).width()))}else c=e._collection.height()/2,c>d(q).height()/2&&(c=d(q).height()/2),e._collection.css("marginTop",-1*c);e.background&&t.background(!0,e.backgroundClassName,e.fade,l);setTimeout(function(){d("div.dt-button-background").on("click.dtb-collection",function(){});d("body").on("click.dtb-collection",
31
+ function(a){var b=d.fn.addBack?"addBack":"andSelf";d(a.target).parents()[b]().filter(e._collection).length||f()}).on("keyup.dtb-collection",function(a){27===a.keyCode&&f()});if(e.autoClose)b.on("buttons-action.b-internal",function(){f()})},10)}},background:!0,collectionLayout:"",collectionTitle:"",backgroundClassName:"dt-button-background",rightAlignClassName:"dt-button-right",autoClose:!1,fade:400,attr:{"aria-haspopup":!0}},copy:function(a,b){if(r.copyHtml5)return"copyHtml5";if(r.copyFlash&&r.copyFlash.available(a,
32
+ b))return"copyFlash"},csv:function(a,b){if(r.csvHtml5&&r.csvHtml5.available(a,b))return"csvHtml5";if(r.csvFlash&&r.csvFlash.available(a,b))return"csvFlash"},excel:function(a,b){if(r.excelHtml5&&r.excelHtml5.available(a,b))return"excelHtml5";if(r.excelFlash&&r.excelFlash.available(a,b))return"excelFlash"},pdf:function(a,b){if(r.pdfHtml5&&r.pdfHtml5.available(a,b))return"pdfHtml5";if(r.pdfFlash&&r.pdfFlash.available(a,b))return"pdfFlash"},pageLength:function(a){a=a.settings()[0].aLengthMenu;var b=d.isArray(a[0])?
33
+ a[0]:a,c=d.isArray(a[0])?a[1]:a;return{extend:"collection",text:function(a){return a.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},a.page.len())},className:"buttons-page-length",autoClose:!0,buttons:d.map(b,function(a,b){return{text:c[b],className:"button-page-length",action:function(b,c){c.page.len(a).draw()},init:function(b,c,d){var e=this;c=function(){e.active(b.page.len()===a)};b.on("length.dt"+d.namespace,c);c()},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}),
34
+ init:function(a,b,c){var d=this;a.on("length.dt"+c.namespace,function(){d.text(c.text)})},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}});p.Api.register("buttons()",function(a,b){b===l&&(b=a,a=l);this.selector.buttonGroup=a;var c=this.iterator(!0,"table",function(c){if(c._buttons)return t.buttonSelector(t.instanceSelector(a,c._buttons),b)},!0);c._groupSelector=a;return c});p.Api.register("button()",function(a,b){a=this.buttons(a,b);1<a.length&&a.splice(1,a.length);return a});p.Api.registerPlural("buttons().active()",
35
+ "button().active()",function(a){return a===l?this.map(function(a){return a.inst.active(a.node)}):this.each(function(b){b.inst.active(b.node,a)})});p.Api.registerPlural("buttons().action()","button().action()",function(a){return a===l?this.map(function(a){return a.inst.action(a.node)}):this.each(function(b){b.inst.action(b.node,a)})});p.Api.register(["buttons().enable()","button().enable()"],function(a){return this.each(function(b){b.inst.enable(b.node,a)})});p.Api.register(["buttons().disable()",
36
+ "button().disable()"],function(){return this.each(function(a){a.inst.disable(a.node)})});p.Api.registerPlural("buttons().nodes()","button().node()",function(){var a=d();d(this.each(function(b){a=a.add(b.inst.node(b.node))}));return a});p.Api.registerPlural("buttons().processing()","button().processing()",function(a){return a===l?this.map(function(a){return a.inst.processing(a.node)}):this.each(function(b){b.inst.processing(b.node,a)})});p.Api.registerPlural("buttons().text()","button().text()",function(a){return a===
37
+ l?this.map(function(a){return a.inst.text(a.node)}):this.each(function(b){b.inst.text(b.node,a)})});p.Api.registerPlural("buttons().trigger()","button().trigger()",function(){return this.each(function(a){a.inst.node(a.node).trigger("click")})});p.Api.registerPlural("buttons().containers()","buttons().container()",function(){var a=d(),b=this._groupSelector;this.iterator(!0,"table",function(c){if(c._buttons){c=t.instanceSelector(b,c._buttons);for(var d=0,f=c.length;d<f;d++)a=a.add(c[d].container())}});
38
+ return a});p.Api.register("button().add()",function(a,b){var c=this.context;c.length&&(c=t.instanceSelector(this._groupSelector,c[0]._buttons),c.length&&c[0].add(b,a));return this.button(this._groupSelector,a)});p.Api.register("buttons().destroy()",function(){this.pluck("inst").unique().each(function(a){a.destroy()});return this});p.Api.registerPlural("buttons().remove()","buttons().remove()",function(){this.each(function(a){a.inst.remove(a.node)});return this});var w;p.Api.register("buttons.info()",
39
+ function(a,b,c){var e=this;if(!1===a)return d("#datatables_buttons_info").fadeOut(function(){d(this).remove()}),clearTimeout(w),w=null,this;w&&clearTimeout(w);d("#datatables_buttons_info").length&&d("#datatables_buttons_info").remove();a=a?"<h2>"+a+"</h2>":"";d('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a).append(d("<div/>")["string"===typeof b?"html":"append"](b)).css("display","none").appendTo("body").fadeIn();c!==l&&0!==c&&(w=setTimeout(function(){e.buttons.info(!1)},c));
40
+ return this});p.Api.register("buttons.exportData()",function(a){if(this.context.length)return D(new p.Api(this.context[0]),a)});p.Api.register("buttons.exportInfo()",function(a){a||(a={});var b=a;var c="*"===b.filename&&"*"!==b.title&&b.title!==l&&null!==b.title&&""!==b.title?b.title:b.filename;"function"===typeof c&&(c=c());c===l||null===c?c=null:(-1!==c.indexOf("*")&&(c=d.trim(c.replace("*",d("head > title").text()))),c=c.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""),(b=x(b.extension))||
41
+ (b=""),c+=b);b=x(a.title);b=null===b?null:-1!==b.indexOf("*")?b.replace("*",d("head > title").text()||"Exported data"):b;return{filename:c,title:b,messageTop:z(this,a.message||a.messageTop,"top"),messageBottom:z(this,a.messageBottom,"bottom")}});var x=function(a){return null===a||a===l?null:"function"===typeof a?a():a},z=function(a,b,c){b=x(b);if(null===b)return null;a=d("caption",a.table().container()).eq(0);return"*"===b?a.css("caption-side")!==c?null:a.length?a.text():"":b},A=d("<textarea/>")[0],
42
+ D=function(a,b){var c=d.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(a){return e(a)},footer:function(a){return e(a)},body:function(a){return e(a)}},customizeData:null},b),e=function(a){if("string"!==typeof a)return a;a=a.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");a=a.replace(/<!\-\-.*?\-\->/g,"");c.stripHtml&&(a=a.replace(/<[^>]*>/g,""));c.trim&&
43
+ (a=a.replace(/^\s+|\s+$/g,""));c.stripNewlines&&(a=a.replace(/\n/g," "));c.decodeEntities&&(A.innerHTML=a,a=A.value);return a};b=a.columns(c.columns).indexes().map(function(b){var d=a.column(b).header();return c.format.header(d.innerHTML,b,d)}).toArray();var f=a.table().footer()?a.columns(c.columns).indexes().map(function(b){var d=a.column(b).footer();return c.format.footer(d?d.innerHTML:"",b,d)}).toArray():null,g=d.extend({},c.modifier);a.select&&"function"===typeof a.select.info&&g.selected===l&&
44
+ a.rows(c.rows,d.extend({selected:!0},g)).any()&&d.extend(g,{selected:!0});g=a.rows(c.rows,g).indexes().toArray();var h=a.cells(g,c.columns);g=h.render(c.orthogonal).toArray();h=h.nodes().toArray();for(var k=b.length,p=[],m=0,n=0,q=0<k?g.length/k:0;n<q;n++){for(var t=[k],r=0;r<k;r++)t[r]=c.format.body(g[m],n,r,h[m]),m++;p[n]=t}b={header:b,footer:f,body:p};c.customizeData&&c.customizeData(b);return b};d.fn.dataTable.Buttons=t;d.fn.DataTable.Buttons=t;d(n).on("init.dt plugin-init.dt",function(a,b){"dt"===
45
+ a.namespace&&(a=b.oInit.buttons||p.defaults.buttons)&&!b._buttons&&(new t(b,a)).container()});p.ext.feature.push({fnInit:u,cFeature:"B"});p.ext.features&&p.ext.features.register("buttons",u);return t});
js/front.js CHANGED
@@ -1,8 +1,8 @@
1
- var pageid = ahcfree_ajax_front.page_id;
2
  var page_id = (pageid.length > 0) ? pageid : '';
3
- var pagetitle = ahcfree_ajax_front.page_title;
4
  var page_title = (pagetitle.length > 0) ? pagetitle : '';
5
- var posttype = ahcfree_ajax_front.post_type;
6
  var post_type = (posttype.length > 0) ? posttype : '';
7
  var referer = document.referrer;
8
  var useragent = window.navigator.userAgent;
@@ -12,18 +12,18 @@ var request_uri = location.pathname.substring(1);
12
 
13
  var xhttp = new XMLHttpRequest();
14
 
15
- xhttp.open("POST", ahcfree_ajax_front.ajax_url, true);
16
  xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
17
  xhttp.send("action=ahcfree_track_visitor&page_id="+ page_id +"&page_title="+ page_title + "&post_type="+ post_type + "&referer="+ referer +"&useragent="+ useragent +"&servername="+ servername +"&hostname="+ hostname +"&request_uri="+request_uri);
18
  /*
19
 
20
  jQuery(document).ready(function ()
21
  {
22
- var pageid = ahcfree_ajax_front.page_id;
23
  var page_id = (pageid.length > 0) ? pageid : '';
24
- var pagetitle = ahcfree_ajax_front.page_title;
25
  var page_title = (pagetitle.length > 0) ? pagetitle : '';
26
- var posttype = ahcfree_ajax_front.post_type;
27
  var post_type = (posttype.length > 0) ? posttype : '';
28
  var referer = document.referrer;
29
  var useragent = window.navigator.userAgent;
@@ -33,7 +33,7 @@ jQuery(document).ready(function ()
33
 
34
  jQuery.ajax({
35
  type: 'POST',
36
- url : ahcfree_ajax_front.ajax_url,
37
  data: {
38
  'action': 'ahcfree_track_visitor',
39
  'page_id': page_id,
@@ -54,6 +54,4 @@ jQuery(document).ready(function ()
54
  }
55
  });
56
  });
57
- */
58
-
59
-
1
+ var pageid = ahc_ajax_front.page_id;
2
  var page_id = (pageid.length > 0) ? pageid : '';
3
+ var pagetitle = ahc_ajax_front.page_title;
4
  var page_title = (pagetitle.length > 0) ? pagetitle : '';
5
+ var posttype = ahc_ajax_front.post_type;
6
  var post_type = (posttype.length > 0) ? posttype : '';
7
  var referer = document.referrer;
8
  var useragent = window.navigator.userAgent;
12
 
13
  var xhttp = new XMLHttpRequest();
14
 
15
+ xhttp.open("POST", ahc_ajax_front.ajax_url, true);
16
  xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
17
  xhttp.send("action=ahcfree_track_visitor&page_id="+ page_id +"&page_title="+ page_title + "&post_type="+ post_type + "&referer="+ referer +"&useragent="+ useragent +"&servername="+ servername +"&hostname="+ hostname +"&request_uri="+request_uri);
18
  /*
19
 
20
  jQuery(document).ready(function ()
21
  {
22
+ var pageid = ahc_ajax_front.page_id;
23
  var page_id = (pageid.length > 0) ? pageid : '';
24
+ var pagetitle = ahc_ajax_front.page_title;
25
  var page_title = (pagetitle.length > 0) ? pagetitle : '';
26
+ var posttype = ahc_ajax_front.post_type;
27
  var post_type = (posttype.length > 0) ? posttype : '';
28
  var referer = document.referrer;
29
  var useragent = window.navigator.userAgent;
33
 
34
  jQuery.ajax({
35
  type: 'POST',
36
+ url : ahc_ajax_front.ajax_url,
37
  data: {
38
  'action': 'ahcfree_track_visitor',
39
  'page_id': page_id,
54
  }
55
  });
56
  });
57
+ */
 
 
js/jhxlsx.js ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * ####################################################################################################
3
+ * https://www.npmjs.com/package/xlsx-style
4
+ * ####################################################################################################
5
+ */
6
+ var Jhxlsx = {
7
+ config: {
8
+ fileName: "jhreport",
9
+ extension: ".xlsx",
10
+ sheetName: "Sheet",
11
+ fileFullName: "report.xlsx",
12
+ header: true,
13
+ maxCellWidth: 20
14
+ },
15
+ worksheetObj: {},
16
+ rowCount: 0,
17
+ wsColswidth: [],
18
+ merges: [],
19
+ worksheet: {},
20
+ range: {s: {c: 10000000, r: 10000000}, e: {c: 0, r: 0}},
21
+ init: function (options) {
22
+ this.reset();
23
+ for (var key in this.config) {
24
+ if (options.hasOwnProperty(key)) {
25
+ this.config[key] = options[key];
26
+ }
27
+ }
28
+ this.config['fileFullName'] = this.config.fileName + this.config.extension;
29
+ },
30
+ reset: function () {
31
+ this.worksheetObj = {};
32
+ this.rowCount = 0;
33
+ this.wsColswidth = [];
34
+ this.merges = [];
35
+ this.worksheet = {};
36
+ },
37
+ cellWidth: function (cellText, pos) {
38
+ var max = (cellText.length * 1.3);
39
+ if (this.wsColswidth[pos]) {
40
+ if (max > this.wsColswidth[pos].wch) {
41
+ this.wsColswidth[pos] = {wch: max};
42
+ }
43
+ } else {
44
+ this.wsColswidth[pos] = {wch: max};
45
+ }
46
+ },
47
+ cellWidthValidate: function () {
48
+ for (var i in this.wsColswidth) {
49
+ if (this.wsColswidth[i].wch > this.config.maxCellWidth) {
50
+ this.wsColswidth[i].wch = this.config.maxCellWidth;
51
+ }
52
+ }
53
+ },
54
+ datenum: function (v, date1904) {
55
+ if (date1904)
56
+ v += 1462;
57
+ var epoch = Date.parse(v);
58
+ return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
59
+ },
60
+ setCellDataType: function (cell) {
61
+ if (typeof cell.v === 'number') {
62
+ cell.t = 'n';
63
+ } else if (typeof cell.v === 'boolean') {
64
+ cell.t = 'b';
65
+ } else if (cell.v instanceof Date) {
66
+ cell.t = 'n';
67
+ cell.z = XLSX.SSF._table[14];
68
+ cell.v = this.datenum(cell.v);
69
+ } else {
70
+ cell.t = 's';
71
+ }
72
+ },
73
+ jhAddRow: function (rowObj) {
74
+
75
+ for (var c in rowObj) {
76
+ var cellObj = rowObj[c];
77
+ if (this.range.s.r > this.rowCount)
78
+ this.range.s.r = this.rowCount;
79
+ if (this.range.s.c > c)
80
+ this.range.s.c = c;
81
+ if (this.range.e.r < this.rowCount)
82
+ this.range.e.r = this.rowCount;
83
+ if (this.range.e.c < c)
84
+ this.range.e.c = c;
85
+
86
+ var cellText = null;
87
+ if (cellObj.hasOwnProperty('text')) {
88
+ cellText = cellObj.text;
89
+ }
90
+ var cell = {v: cellText};
91
+
92
+ var calColWidth = true;
93
+ if (cellObj.hasOwnProperty('merge')) {
94
+ calColWidth = false;
95
+ var colStartEnd = cellObj.merge.split('-');
96
+ this.merges.push({s: {r: this.rowCount, c: parseInt(colStartEnd[0])}, e: {r: this.rowCount, c: parseInt(colStartEnd[1])}});
97
+ }
98
+ if (calColWidth) {
99
+ this.cellWidth(cell.v, c);
100
+ }
101
+ if (cell.v === null)
102
+ continue;
103
+ var cell_ref = XLSX.utils.encode_cell({c: c, r: this.rowCount});
104
+ this.setCellDataType(cell);
105
+ /*if (typeof cell.v === 'number') {
106
+ cell.t = 'n';
107
+ } else if (typeof cell.v === 'boolean') {
108
+ cell.t = 'b';
109
+ } else if (cell.v instanceof Date) {
110
+ cell.t = 'n';
111
+ cell.z = XLSX.SSF._table[14];
112
+ cell.v = this.datenum(cell.v);
113
+ } else {
114
+ cell.t = 's';
115
+ }*/
116
+ if (cellObj.hasOwnProperty('style')) {
117
+ cell.s = cellObj.style;
118
+ }
119
+
120
+ this.worksheet[cell_ref] = cell;
121
+ }
122
+ this.rowCount++;
123
+ },
124
+ createWorkSheet: function () {
125
+ for (var i in this.worksheetObj.data) {
126
+ this.jhAddRow(this.worksheetObj.data[i]);
127
+ }
128
+
129
+ this.cellWidthValidate();
130
+ this.worksheet['!merges'] = this.merges;
131
+ this.worksheet['!cols'] = this.wsColswidth;
132
+ if (this.range.s.c < 10000000)
133
+ this.worksheet['!ref'] = XLSX.utils.encode_range(this.range);
134
+ return this.worksheet;
135
+ },
136
+ s2ab: function (s) {
137
+ var buf = new ArrayBuffer(s.length);
138
+ var view = new Uint8Array(buf);
139
+ for (var i = 0; i != s.length; ++i)
140
+ view[i] = s.charCodeAt(i) & 0xFF;
141
+ return buf;
142
+ },
143
+ export: function (workbookObj, options) {
144
+ this.init(options);
145
+ var workbook = new Workbook();
146
+ /* add worksheet to workbook */
147
+ for (var i in workbookObj) {
148
+ this.reset();
149
+ this.worksheetObj = workbookObj[i];
150
+ var sheetName = this.config.sheetName + i;
151
+ if (this.worksheetObj.hasOwnProperty('sheetName')) {
152
+ sheetName = this.worksheetObj.sheetName;
153
+ }
154
+ this.createWorkSheet();
155
+ workbook.SheetNames.push(sheetName);
156
+ workbook.Sheets[sheetName] = this.worksheet;
157
+ }
158
+ var wbout = XLSX.write(workbook, {bookType: 'xlsx', bookSST: true, type: 'binary'});
159
+ saveAs(new Blob([this.s2ab(wbout)], {type: "application/octet-stream"}), this.config.fileFullName)
160
+ }
161
+ }
162
+
163
+ function Workbook() {
164
+ if (!(this instanceof Workbook))
165
+ return new Workbook();
166
+ this.SheetNames = [];
167
+ this.Sheets = {};
168
+ }
js/jquery.dataTables.min.js ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ DataTables 1.10.19
3
+ ©2008-2018 SpryMedia Ltd - datatables.net/license
4
+ */
5
+ (function(h){"function"===typeof define&&define.amd?define(["jquery"],function(E){return h(E,window,document)}):"object"===typeof exports?module.exports=function(E,H){E||(E=window);H||(H="undefined"!==typeof window?require("jquery"):require("jquery")(E));return h(H,E,E.document)}:h(jQuery,window,document)})(function(h,E,H,k){function Z(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),
6
+ d[c]=e,"o"===b[1]&&Z(a[e])});a._hungarianMap=d}function J(a,b,c){a._hungarianMap||Z(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),J(a[d],b[d],c)):b[d]=b[e]})}function Ca(a){var b=n.defaults.oLanguage,c=b.sDecimal;c&&Da(c);if(a){var d=a.sZeroRecords;!a.sEmptyTable&&(d&&"No data available in table"===b.sEmptyTable)&&F(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(d&&"Loading..."===b.sLoadingRecords)&&F(a,
7
+ a,"sZeroRecords","sLoadingRecords");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&c!==a&&Da(a)}}function fb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":
8
+ "");"boolean"===typeof a.scrollX&&(a.scrollX=a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&J(n.models.oSearch,a[b])}function gb(a){A(a,"orderable","bSortable");A(a,"orderData","aDataSort");A(a,"orderSequence","asSorting");A(a,"orderDataType","sortDataType");var b=a.aDataSort;"number"===typeof b&&!h.isArray(b)&&(a.aDataSort=[b])}function hb(a){if(!n.__browser){var b={};n.__browser=b;var c=h("<div/>").css({position:"fixed",top:0,left:-1*h(E).scrollLeft(),height:1,width:1,
9
+ overflow:"hidden"}).append(h("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(h("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,n.__browser);a.oScroll.iBarWidth=n.__browser.barWidth}
10
+ function ib(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==e;)a.hasOwnProperty(d)&&(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Ea(a,b){var c=n.defaults.column,d=a.aoColumns.length,c=h.extend({},n.models.oColumn,c,{nTh:b?b:H.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},n.models.oSearch,c[d]);ka(a,d,h(b).data())}function ka(a,b,c){var b=a.aoColumns[b],
11
+ d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(gb(c),J(n.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),c.sClass&&e.addClass(c.sClass),h.extend(b,c),F(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),F(b,c,"aDataSort"));var g=b.mData,j=S(g),i=b.mRender?
12
+ S(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&&b?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return N(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,
13
+ b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function $(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Fa(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&la(a);r(a,null,"column-sizing",[a])}function aa(a,b){var c=ma(a,"bVisible");return"number"===
14
+ typeof c[b]?c[b]:null}function ba(a,b){var c=ma(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function V(a){var b=0;h.each(a.aoColumns,function(a,d){d.bVisible&&"none"!==h(d.nTh).css("display")&&b++});return b}function ma(a,b){var c=[];h.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Ga(a){var b=a.aoColumns,c=a.aoData,d=n.ext.type.detect,e,f,g,j,i,h,l,q,t;e=0;for(f=b.length;e<f;e++)if(l=b[e],t=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){g=0;for(j=d.length;g<
15
+ j;g++){i=0;for(h=c.length;i<h;i++){t[i]===k&&(t[i]=B(a,i,e,"type"));q=d[g](t[i],a);if(!q&&g!==d.length-1)break;if("html"===q)break}if(q){l.sType=q;break}}l.sType||(l.sType="string")}}function jb(a,b,c,d){var e,f,g,j,i,m,l=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){m=b[e];var q=m.targets!==k?m.targets:m.aTargets;h.isArray(q)||(q=[q]);f=0;for(g=q.length;f<g;f++)if("number"===typeof q[f]&&0<=q[f]){for(;l.length<=q[f];)Ea(a);d(q[f],m)}else if("number"===typeof q[f]&&0>q[f])d(l.length+q[f],m);else if("string"===
16
+ typeof q[f]){j=0;for(i=l.length;j<i;j++)("_all"==q[f]||h(l[j].nTh).hasClass(q[f]))&&d(j,m)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function O(a,b,c,d){var e=a.aoData.length,f=h.extend(!0,{},n.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,j=0,i=g.length;j<i;j++)g[j].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ha(a,e,c,d);return e}function na(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,
17
+ e){c=Ia(a,e);return O(a,c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw,f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,i=f.fnGetData(g,d,{settings:a,row:b,col:c});if(i===k)return a.iDrawError!=e&&null===j&&(K(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),j;if((i===g||null===i)&&null!==j&&d!==k)i=j;else if("function"===typeof i)return i.call(g);return null===i&&"display"==d?"":i}function kb(a,
18
+ b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})}function Ja(a){return h.map(a.match(/(\\.|[^\.])+/g)||[""],function(a){return a.replace(/\\\./g,".")})}function S(a){if(h.isPlainObject(a)){var b={};h.each(a,function(a,c){c&&(b[a]=S(c))});return function(a,c,f,g){var j=b[c]||b._;return j!==k?j(a,c,f,g):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f,g){return a(b,c,f,g)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||
19
+ -1!==a.indexOf("("))){var c=function(a,b,f){var g,j;if(""!==f){j=Ja(f);for(var i=0,m=j.length;i<m;i++){f=j[i].match(ca);g=j[i].match(W);if(f){j[i]=j[i].replace(ca,"");""!==j[i]&&(a=a[j[i]]);g=[];j.splice(0,i+1);j=j.join(".");if(h.isArray(a)){i=0;for(m=a.length;i<m;i++)g.push(c(a[i],b,j))}a=f[0].substring(1,f[0].length-1);a=""===a?g:g.join(a);break}else if(g){j[i]=j[i].replace(W,"");a=a[j[i]]();continue}if(null===a||a[j[i]]===k)return k;a=a[j[i]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}
20
+ function N(a){if(h.isPlainObject(a))return N(a._);if(null===a)return function(){};if("function"===typeof a)return function(b,d,e){a(b,"set",d,e)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=Ja(e),f;f=e[e.length-1];for(var g,j,i=0,m=e.length-1;i<m;i++){g=e[i].match(ca);j=e[i].match(W);if(g){e[i]=e[i].replace(ca,"");a[e[i]]=[];f=e.slice();f.splice(0,i+1);g=f.join(".");if(h.isArray(d)){j=0;for(m=d.length;j<m;j++)f={},b(f,d[j],g),
21
+ a[e[i]].push(f)}else a[e[i]]=d;return}j&&(e[i]=e[i].replace(W,""),a=a[e[i]](d));if(null===a[e[i]]||a[e[i]]===k)a[e[i]]={};a=a[e[i]]}if(f.match(W))a[f.replace(W,"")](d);else a[f.replace(ca,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ka(a){return D(a.aoData,"_aData")}function oa(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function pa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,
22
+ 1)}function da(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=Ia(a,e,d,d===k?k:e._aData).data;else{var j=e.anCells;if(j)if(d!==k)g(j[d],d);else{c=0;for(f=j.length;c<f;c++)g(j[c],c)}}e._aSortData=null;e._aFilterData=null;g=a.aoColumns;if(d!==k)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;La(a,e)}}function Ia(a,b,c,d){var e=[],f=b.firstChild,g,
23
+ j,i=0,m,l=a.aoColumns,q=a._rowReadObject,d=d!==k?d:q?{}:[],t=function(a,b){if("string"===typeof a){var c=a.indexOf("@");-1!==c&&(c=a.substring(c+1),N(a)(d,b.getAttribute(c)))}},G=function(a){if(c===k||c===i)j=l[i],m=h.trim(a.innerHTML),j&&j._bAttrSrc?(N(j.mData._)(d,m),t(j.mData.sort,a),t(j.mData.type,a),t(j.mData.filter,a)):q?(j._setter||(j._setter=N(j.mData)),j._setter(d,m)):d[i]=m;i++};if(f)for(;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)G(f),e.push(f);f=f.nextSibling}else{e=b.anCells;
24
+ f=0;for(g=e.length;f<g;f++)G(e[f])}if(b=b.firstChild?b:b.nTr)(b=b.getAttribute("id"))&&N(a.rowId)(d,b);return{data:d,cells:e}}function Ha(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],j,i,m,l,q;if(null===e.nTr){j=c||H.createElement("tr");e.nTr=j;e.anCells=g;j._DT_RowIndex=b;La(a,e);l=0;for(q=a.aoColumns.length;l<q;l++){m=a.aoColumns[l];i=c?d[l]:H.createElement(m.sCellType);i._DT_CellIndex={row:b,column:l};g.push(i);if((!c||m.mRender||m.mData!==l)&&(!h.isPlainObject(m.mData)||m.mData._!==l+".display"))i.innerHTML=
25
+ B(a,b,l,"display");m.sClass&&(i.className+=" "+m.sClass);m.bVisible&&!c?j.appendChild(i):!m.bVisible&&c&&i.parentNode.removeChild(i);m.fnCreatedCell&&m.fnCreatedCell.call(a.oInstance,i,B(a,b,l),f,b,l)}r(a,"aoRowCreatedCallback",null,[j,f,b,g])}e.nTr.setAttribute("role","row")}function La(a,b){var c=b.nTr,d=b._aData;if(c){var e=a.rowIdFn(d);e&&(c.id=e);d.DT_RowClass&&(e=d.DT_RowClass.split(" "),b.__rowc=b.__rowc?qa(b.__rowc.concat(e)):e,h(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));
26
+ d.DT_RowAttr&&h(c).attr(d.DT_RowAttr);d.DT_RowData&&h(c).data(d.DT_RowData)}}function lb(a){var b,c,d,e,f,g=a.nTHead,j=a.nTFoot,i=0===h("th, td",g).length,m=a.oClasses,l=a.aoColumns;i&&(e=h("<tr/>").appendTo(g));b=0;for(c=l.length;b<c;b++)f=l[b],d=h(f.nTh).addClass(f.sClass),i&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),Ma(a,f.nTh,b))),f.sTitle!=d[0].innerHTML&&d.html(f.sTitle),Na(a,"header")(a,d,
27
+ f,m);i&&ea(a.aoHeader,g);h(g).find(">tr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(m.sHeaderTH);h(j).find(">tr>th, >tr>td").addClass(m.sFooterTH);if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=l[b],f.nTf=a[b].cell,f.sClass&&h(f.nTf).addClass(f.sClass)}}function fa(a,b,c){var d,e,f,g=[],j=[],i=a.aoColumns.length,m;if(b){c===k&&(c=!1);d=0;for(e=b.length;d<e;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=i-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);j.push([])}d=
28
+ 0;for(e=g.length;d<e;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(m=i=1,j[d][f]===k){a.appendChild(g[d][f].cell);for(j[d][f]=1;g[d+i]!==k&&g[d][f].cell==g[d+i][f].cell;)j[d+i][f]=1,i++;for(;g[d][f+m]!==k&&g[d][f].cell==g[d][f+m].cell;){for(c=0;c<i;c++)j[d+c][f+m]=1;m++}h(g[d][f].cell).attr("rowspan",i).attr("colspan",m)}}}}function P(a){var b=r(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=
29
+ d.length,f=a.oLanguage,g=a.iInitDisplayStart,j="ssp"==y(a),i=a.aiDisplay;a.bDrawing=!0;g!==k&&-1!==g&&(a._iDisplayStart=j?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=-1);var g=a._iDisplayStart,m=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&!mb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:m;for(j=j?0:g;j<f;j++){var l=i[j],q=a.aoData[l];null===q.nTr&&Ha(a,l);var t=q.nTr;if(0!==e){var G=d[c%e];q._sRowStripe!=G&&(h(t).removeClass(q._sRowStripe).addClass(G),
30
+ q._sRowStripe=G)}r(a,"aoRowCallback",null,[t,q._aData,c,j,l]);b.push(t);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==y(a)?c=f.sLoadingRecords:f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=h("<tr/>",{"class":e?d[0]:""}).append(h("<td />",{valign:"top",colSpan:V(a),"class":a.oClasses.sRowEmpty}).html(c))[0];r(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ka(a),g,m,i]);r(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ka(a),g,m,i]);d=h(a.nTBody);d.children().detach();
31
+ d.append(h(b));r(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function T(a,b){var c=a.oFeatures,d=c.bFilter;c.bSort&&nb(a);d?ga(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;P(a);a._drawHold=!1}function ob(a){var b=a.oClasses,c=h(a.nTable),c=h("<div/>").insertBefore(c),d=a.oFeatures,e=h("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=
32
+ a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,m,l,q,k=0;k<f.length;k++){g=null;j=f[k];if("<"==j){i=h("<div/>")[0];m=f[k+1];if("'"==m||'"'==m){l="";for(q=2;f[k+q]!=m;)l+=f[k+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(m=l.split("."),i.id=m[0].substr(1,m[0].length-1),i.className=m[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;k+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=pb(a);else if("f"==j&&
33
+ d.bFilter)g=qb(a);else if("r"==j&&d.bProcessing)g=rb(a);else if("t"==j)g=sb(a);else if("i"==j&&d.bInfo)g=tb(a);else if("p"==j&&d.bPaginate)g=ub(a);else if(0!==n.ext.feature.length){i=n.ext.feature;q=0;for(m=i.length;q<m;q++)if(j==i[q].cFeature){g=i[q].fnInit(a);break}}g&&(i=a.aanFeatures,i[j]||(i[j]=[]),i[j].push(g),e.append(g))}c.replaceWith(e);a.nHolding=null}function ea(a,b){var c=h(b).children("tr"),d,e,f,g,j,i,m,l,q,k;a.splice(0,a.length);f=0;for(i=c.length;f<i;f++)a.push([]);f=0;for(i=c.length;f<
34
+ i;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){l=1*e.getAttribute("colspan");q=1*e.getAttribute("rowspan");l=!l||0===l||1===l?1:l;q=!q||0===q||1===q?1:q;g=0;for(j=a[f];j[g];)g++;m=g;k=1===l?!0:!1;for(j=0;j<l;j++)for(g=0;g<q;g++)a[f+g][m+j]={cell:e,unique:k},a[f+g].nTr=d}e=e.nextSibling}}}function ra(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],ea(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||
35
+ !a.bSortCellsTop))d[f]=c[b][f].cell;return d}function sa(a,b,c){r(a,"aoServerParams","serverParams",[b]);if(b&&h.isArray(b)){var d={},e=/(.*?)\[\]$/;h.each(b,function(a,b){var c=b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,g=a.ajax,j=a.oInstance,i=function(b){r(a,null,"xhr",[a,b,a.jqXHR]);c(b)};if(h.isPlainObject(g)&&g.data){f=g.data;var m="function"===typeof f?f(b,a):f,b="function"===typeof f&&m?m:h.extend(!0,b,m);delete g.data}m={data:b,success:function(b){var c=
36
+ b.error||b.sError;c&&K(a,0,c);a.json=b;i(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=r(a,null,"xhr",[a,null,a.jqXHR]);-1===h.inArray(!0,d)&&("parsererror"==c?K(a,0,"Invalid JSON response",1):4===b.readyState&&K(a,0,"Ajax error",7));C(a,!1)}};a.oAjaxData=b;r(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(m,{url:g||a.sAjaxSource})):
37
+ "function"===typeof g?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(m,g)),g.data=f)}function mb(a){return a.bAjaxDataGet?(a.iDraw++,C(a,!0),sa(a,vb(a),function(b){wb(a,b)}),!1):!0}function vb(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,m,l,k=X(a);g=a._iDisplayStart;i=!1!==d.bPaginate?a._iDisplayLength:-1;var t=function(a,b){j.push({name:a,value:b})};t("sEcho",a.iDraw);t("iColumns",c);t("sColumns",D(b,"sName").join(","));t("iDisplayStart",g);t("iDisplayLength",
38
+ i);var G={draw:a.iDraw,columns:[],order:[],start:g,length:i,search:{value:e.sSearch,regex:e.bRegex}};for(g=0;g<c;g++)m=b[g],l=f[g],i="function"==typeof m.mData?"function":m.mData,G.columns.push({data:i,name:m.sName,searchable:m.bSearchable,orderable:m.bSortable,search:{value:l.sSearch,regex:l.bRegex}}),t("mDataProp_"+g,i),d.bFilter&&(t("sSearch_"+g,l.sSearch),t("bRegex_"+g,l.bRegex),t("bSearchable_"+g,m.bSearchable)),d.bSort&&t("bSortable_"+g,m.bSortable);d.bFilter&&(t("sSearch",e.sSearch),t("bRegex",
39
+ e.bRegex));d.bSort&&(h.each(k,function(a,b){G.order.push({column:b.col,dir:b.dir});t("iSortCol_"+a,b.col);t("sSortDir_"+a,b.dir)}),t("iSortingCols",k.length));b=n.ext.legacy.ajax;return null===b?a.sAjaxSource?j:G:b?j:G}function wb(a,b){var c=ta(a,b),d=b.sEcho!==k?b.sEcho:b.draw,e=b.iTotalRecords!==k?b.iTotalRecords:b.recordsTotal,f=b.iTotalDisplayRecords!==k?b.iTotalDisplayRecords:b.recordsFiltered;if(d){if(1*d<a.iDraw)return;a.iDraw=1*d}oa(a);a._iRecordsTotal=parseInt(e,10);a._iRecordsDisplay=parseInt(f,
40
+ 10);d=0;for(e=c.length;d<e;d++)O(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;P(a);a._bInitComplete||ua(a,b);a.bAjaxDataGet=!0;C(a,!1)}function ta(a,b){var c=h.isPlainObject(a.ajax)&&a.ajax.dataSrc!==k?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===c?b.aaData||b[c]:""!==c?S(c)(b):b}function qb(a){var b=a.oClasses,c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",
41
+ g):j+g,b=h("<div/>",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("<label/>").append(j)),f=function(){var b=!this.value?"":this.value;b!=e.sSearch&&(ga(a,{sSearch:b,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,P(a))},g=null!==a.searchDelay?a.searchDelay:"ssp"===y(a)?400:0,i=h("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",g?Oa(f,g):f).on("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",
42
+ c);h(a.nTable).on("search.dt.DT",function(b,c){if(a===c)try{i[0]!==H.activeElement&&i.val(e.sSearch)}catch(d){}});return b[0]}function ga(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};Ga(a);if("ssp"!=y(a)){xb(a,b.sSearch,c,b.bEscapeRegex!==k?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)yb(a,e[b].sSearch,b,e[b].bEscapeRegex!==k?!e[b].bEscapeRegex:e[b].bRegex,
43
+ e[b].bSmart,e[b].bCaseInsensitive);zb(a)}else f(b);a.bFiltered=!0;r(a,null,"search",[a])}function zb(a){for(var b=n.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var j=[],i=0,m=c.length;i<m;i++)e=c[i],d=a.aoData[e],b[f](a,d._aFilterData,e,d._aData,i)&&j.push(e);c.length=0;h.merge(c,j)}}function yb(a,b,c,d,e,f){if(""!==b){for(var g=[],j=a.aiDisplay,d=Pa(b,d,e,f),e=0;e<j.length;e++)b=a.aoData[j[e]]._aFilterData[c],d.test(b)&&g.push(j[e]);a.aiDisplay=g}}function xb(a,b,c,d,e,f){var d=Pa(b,
44
+ d,e,f),f=a.oPreviousSearch.sSearch,g=a.aiDisplayMaster,j,e=[];0!==n.ext.search.length&&(c=!0);j=Ab(a);if(0>=b.length)a.aiDisplay=g.slice();else{if(j||c||f.length>b.length||0!==b.indexOf(f)||a.bSorted)a.aiDisplay=g.slice();b=a.aiDisplay;for(c=0;c<b.length;c++)d.test(a.aoData[b[c]]._sFilterRow)&&e.push(b[c]);a.aiDisplay=e}}function Pa(a,b,c,d){a=b?a:Qa(a);c&&(a="^(?=.*?"+h.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(a){if('"'===a.charAt(0))var b=a.match(/^"(.*)"$/),a=b?b[1]:a;return a.replace('"',
45
+ "")}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function Ab(a){var b=a.aoColumns,c,d,e,f,g,j,i,h,l=n.ext.type.search;c=!1;d=0;for(f=a.aoData.length;d<f;d++)if(h=a.aoData[d],!h._aFilterData){j=[];e=0;for(g=b.length;e<g;e++)c=b[e],c.bSearchable?(i=B(a,d,e,"filter"),l[c.sType]&&(i=l[c.sType](i)),null===i&&(i=""),"string"!==typeof i&&i.toString&&(i=i.toString())):i="",i.indexOf&&-1!==i.indexOf("&")&&(va.innerHTML=i,i=Wb?va.textContent:va.innerText),i.replace&&(i=i.replace(/[\r\n]/g,"")),j.push(i);
46
+ h._aFilterData=j;h._sFilterRow=j.join(" ");c=!0}return c}function Bb(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}function Cb(a){return{sSearch:a.search,bSmart:a.smart,bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function tb(a){var b=a.sTableId,c=a.aanFeatures.i,d=h("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Db,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby",
47
+ b+"_info"));return d[0]}function Db(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&(j+=" "+c.sInfoFiltered);j+=c.sInfoPostFix;j=Eb(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,d,e,f,g,j));h(b).html(j)}}function Eb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,
48
+ c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/e)))}function ha(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;var g=a.bDeferLoading;if(a.bInitialised){ob(a);lb(a);fa(a,a.aoHeader);fa(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Fa(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=v(f.sWidth));r(a,null,"preInit",[a]);T(a);e=
49
+ y(a);if("ssp"!=e||g)"ajax"==e?sa(a,[],function(c){var f=ta(a,c);for(b=0;b<f.length;b++)O(a,f[b]);a.iInitDisplayStart=d;T(a);C(a,!1);ua(a,c)},a):(C(a,!1),ua(a))}else setTimeout(function(){ha(a)},200)}function ua(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&$(a);r(a,null,"plugin-init",[a,b]);r(a,"aoInitComplete","init",[a,b])}function Ra(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Sa(a);r(a,null,"length",[a,c])}function pb(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=h.isArray(d[0]),f=
50
+ e?d[0]:d,d=e?d[1]:d,e=h("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}),g=0,j=f.length;g<j;g++)e[0][g]=new Option("number"===typeof d[g]?a.fnFormatNumber(d[g]):d[g],f[g]);var i=h("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(i[0].id=c+"_length");i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",i).val(a._iDisplayLength).on("change.DT",function(){Ra(a,h(this).val());P(a)});h(a.nTable).on("length.dt.DT",function(b,c,d){a===
51
+ c&&h("select",i).val(d)});return i[0]}function ub(a){var b=a.sPaginationType,c=n.ext.pager[b],d="function"===typeof c,e=function(a){P(a)},b=h("<div/>").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),k,l=0;for(k=f.p.length;l<k;l++)Na(a,"pageButton")(a,f.p[l],l,h,b,i)}else c.fnUpdate(a,
52
+ e)},sName:"pagination"}));return b}function Ta(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"===typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:K(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(r(a,null,"page",[a]),c&&P(a));return b}function rb(a){return h("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}
53
+ function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",b?"block":"none");r(a,null,"processing",[a,b])}function sb(a){var b=h(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),m=h(b[0].cloneNode(!1)),l=b.children("tfoot");l.length||(l=null);i=h("<div/>",{"class":f.sScrollWrapper}).append(h("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",
54
+ position:"relative",border:0,width:d?!d?null:v(d):"100%"}).append(h("<div/>",{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:v(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:v(d):"100%"}).append(h("<div/>",
55
+ {"class":f.sScrollFootInner}).append(m.removeAttr("id").css("margin-left",0).append("bottom"===j?g:null).append(b.children("tfoot")))));var b=i.children(),k=b[0],f=b[1],t=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(t.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:la,sName:"scrolling"});return i[0]}function la(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,
56
+ f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,m=j.children("table"),j=a.nScrollBody,l=h(j),q=j.style,t=h(a.nScrollFoot).children("div"),n=t.children("table"),o=h(a.nTHead),p=h(a.nTable),s=p[0],r=s.style,u=a.nTFoot?h(a.nTFoot):null,x=a.oBrowser,U=x.bScrollOversize,Xb=D(a.aoColumns,"nTh"),Q,L,R,w,Ua=[],y=[],z=[],A=[],B,C=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};L=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==
57
+ L&&a.scrollBarVis!==k)a.scrollBarVis=L,$(a);else{a.scrollBarVis=L;p.children("thead, tfoot").remove();u&&(R=u.clone().prependTo(p),Q=u.find("tr"),R=R.find("tr"));w=o.clone().prependTo(p);o=o.find("tr");L=w.find("tr");w.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(ra(a,w),function(b,c){B=aa(a,b);c.style.width=a.aoColumns[B].sWidth});u&&I(function(a){a.style.width=""},R);f=p.outerWidth();if(""===c){r.width="100%";if(U&&(p.find("tbody").height()>j.offsetHeight||
58
+ "scroll"==l.css("overflow-y")))r.width=v(p.outerWidth()-b);f=p.outerWidth()}else""!==d&&(r.width=v(d),f=p.outerWidth());I(C,L);I(function(a){z.push(a.innerHTML);Ua.push(v(h(a).css("width")))},L);I(function(a,b){if(h.inArray(a,Xb)!==-1)a.style.width=Ua[b]},o);h(L).height(0);u&&(I(C,R),I(function(a){A.push(a.innerHTML);y.push(v(h(a).css("width")))},R),I(function(a,b){a.style.width=y[b]},Q),h(R).height(0));I(function(a,b){a.innerHTML='<div class="dataTables_sizing">'+z[b]+"</div>";a.childNodes[0].style.height=
59
+ "0";a.childNodes[0].style.overflow="hidden";a.style.width=Ua[b]},L);u&&I(function(a,b){a.innerHTML='<div class="dataTables_sizing">'+A[b]+"</div>";a.childNodes[0].style.height="0";a.childNodes[0].style.overflow="hidden";a.style.width=y[b]},R);if(p.outerWidth()<f){Q=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(U&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=v(Q-b);(""===c||""!==d)&&K(a,1,"Possible column misalignment",6)}else Q="100%";q.width=v(Q);
60
+ g.width=v(Q);u&&(a.nScrollFoot.style.width=v(Q));!e&&U&&(q.height=v(s.offsetHeight+b));c=p.outerWidth();m[0].style.width=v(c);i.width=v(c);d=p.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+(x.bScrollbarLeft?"Left":"Right");i[e]=d?b+"px":"0px";u&&(n[0].style.width=v(c),t[0].style.width=v(c),t[0].style[e]=d?b+"px":"0px");p.children("colgroup").insertBefore(p.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function I(a,b,c){for(var d=0,e=0,
61
+ f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Fa(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,g=d.sXInner,j=c.length,i=ma(a,"bVisible"),m=h("th",a.nTHead),l=b.getAttribute("width"),k=b.parentNode,t=!1,n,o,p=a.oBrowser,d=p.bScrollOversize;(n=b.style.width)&&-1!==n.indexOf("%")&&(l=n);for(n=0;n<i.length;n++)o=c[i[n]],null!==o.sWidth&&(o.sWidth=Fb(o.sWidthOrig,k),t=!0);if(d||
62
+ !t&&!f&&!e&&j==V(a)&&j==m.length)for(n=0;n<j;n++)i=aa(a,n),null!==i&&(c[i].sWidth=v(m.eq(n).width()));else{j=h(b).clone().css("visibility","hidden").removeAttr("id");j.find("tbody tr").remove();var s=h("<tr/>").appendTo(j.find("tbody"));j.find("thead, tfoot").remove();j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());j.find("tfoot th, tfoot td").css("width","");m=ra(a,j.find("thead")[0]);for(n=0;n<i.length;n++)o=c[i[n]],m[n].style.width=null!==o.sWidthOrig&&""!==o.sWidthOrig?v(o.sWidthOrig):
63
+ "",o.sWidthOrig&&f&&h(m[n]).append(h("<div/>").css({width:o.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(n=0;n<i.length;n++)t=i[n],o=c[t],h(Gb(a,t)).clone(!1).append(o.sContentPadding).appendTo(s);h("[name]",j).removeAttr("name");o=h("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(j).appendTo(k);f&&g?j.width(g):f?(j.css("width","auto"),j.removeAttr("width"),j.width()<k.clientWidth&&l&&j.width(k.clientWidth)):e?j.width(k.clientWidth):
64
+ l&&j.width(l);for(n=e=0;n<i.length;n++)k=h(m[n]),g=k.outerWidth()-k.width(),k=p.bBounding?Math.ceil(m[n].getBoundingClientRect().width):k.outerWidth(),e+=k,c[i[n]].sWidth=v(k-g);b.style.width=v(e);o.remove()}l&&(b.style.width=v(l));if((l||f)&&!a._reszEvt)b=function(){h(E).on("resize.DT-"+a.sInstance,Oa(function(){$(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0}function Fb(a,b){if(!a)return 0;var c=h("<div/>").css("width",v(a)).appendTo(b||H.body),d=c[0].offsetWidth;c.remove();return d}function Gb(a,
65
+ b){var c=Hb(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?h("<td/>").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Hb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=B(a,f,b,"display")+"",c=c.replace(Yb,""),c=c.replace(/&nbsp;/g," "),c.length>d&&(d=c.length,e=f);return e}function v(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function X(a){var b,c,d=[],e=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var m=[];f=function(a){a.length&&
66
+ !h.isArray(a[0])?m.push(a):h.merge(m,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<m.length;a++){i=m[a][0];f=e[i].aDataSort;b=0;for(c=f.length;b<c;b++)g=f[b],j=e[g].sType||"string",m[a]._idx===k&&(m[a]._idx=h.inArray(m[a][1],e[g].asSorting)),d.push({src:i,col:g,dir:m[a][1],index:m[a]._idx,type:j,formatter:n.ext.type.order[j+"-pre"]})}return d}function nb(a){var b,c,d=[],e=n.ext.type.order,f=a.aoData,g=0,j,i=a.aiDisplayMaster,h;Ga(a);h=X(a);b=0;for(c=h.length;b<
67
+ c;b++)j=h[b],j.formatter&&g++,Ib(a,j.col);if("ssp"!=y(a)&&0!==h.length){b=0;for(c=i.length;b<c;b++)d[i[b]]=b;g===h.length?i.sort(function(a,b){var c,e,g,j,i=h.length,k=f[a]._aSortData,n=f[b]._aSortData;for(g=0;g<i;g++)if(j=h[g],c=k[j.col],e=n[j.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===j.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,n=f[a]._aSortData,o=f[b]._aSortData;for(j=0;j<k;j++)if(i=h[j],c=n[i.col],g=o[i.col],i=e[i.type+"-"+i.dir]||e["string-"+i.dir],
68
+ c=i(c,g),0!==c)return c;c=d[a];g=d[b];return c<g?-1:c>g?1:0})}a.bSorted=!0}function Jb(a){for(var b,c,d=a.aoColumns,e=X(a),a=a.oLanguage.oAria,f=0,g=d.length;f<g;f++){c=d[f];var j=c.asSorting;b=c.sTitle.replace(/<.*?>/g,"");var i=c.nTh;i.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(i.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=j[e[0].index+1]||j[0]):c=j[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);i.setAttribute("aria-label",b)}}function Va(a,
69
+ b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting,g=function(a,b){var c=a._idx;c===k&&(c=h.inArray(a[1],f));return c+1<f.length?c+1:b?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=h.inArray(b,D(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);T(a);"function"==
70
+ typeof d&&d(a)}function Ma(a,b,c,d){var e=a.aoColumns[c];Wa(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Va(a,c,b.shiftKey,d);"ssp"!==y(a)&&C(a,!1)},0)):Va(a,c,b.shiftKey,d))})}function wa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=X(a),e=a.oFeatures,f,g;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++)g=b[e].src,h(D(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3));e=0;for(f=d.length;e<f;e++)g=d[e].src,h(D(a.aoData,"anCells",g)).addClass(c+
71
+ (2>e?e+1:3))}a.aLastSort=d}function Ib(a,b){var c=a.aoColumns[b],d=n.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,ba(a,b)));for(var f,g=n.ext.type.order[c.sType+"-pre"],j=0,i=a.aoData.length;j<i;j++)if(c=a.aoData[j],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[j]:B(a,j,b,"sort"),c._aSortData[b]=g?g(f):f}function xa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:h.extend(!0,[],a.aaSorting),search:Bb(a.oPreviousSearch),
72
+ columns:h.map(a.aoColumns,function(b,d){return{visible:b.bVisible,search:Bb(a.aoPreSearchCols[d])}})};r(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,b)}}function Kb(a,b,c){var d,e,f=a.aoColumns,b=function(b){if(b&&b.time){var g=r(a,"aoStateLoadParams","stateLoadParams",[a,b]);if(-1===h.inArray(!1,g)&&(g=a.iStateDuration,!(0<g&&b.time<+new Date-1E3*g)&&!(b.columns&&f.length!==b.columns.length))){a.oLoadedState=h.extend(!0,{},b);b.start!==k&&
73
+ (a._iDisplayStart=b.start,a.iInitDisplayStart=b.start);b.length!==k&&(a._iDisplayLength=b.length);b.order!==k&&(a.aaSorting=[],h.each(b.order,function(b,c){a.aaSorting.push(c[0]>=f.length?[0,c[1]]:c)}));b.search!==k&&h.extend(a.oPreviousSearch,Cb(b.search));if(b.columns){d=0;for(e=b.columns.length;d<e;d++)g=b.columns[d],g.visible!==k&&(f[d].bVisible=g.visible),g.search!==k&&h.extend(a.aoPreSearchCols[d],Cb(g.search))}r(a,"aoStateLoaded","stateLoaded",[a,b])}}c()};if(a.oFeatures.bStateSave){var g=
74
+ a.fnStateLoadCallback.call(a.oInstance,a,b);g!==k&&b(g)}else c()}function ya(a){var b=n.settings,a=h.inArray(a,D(b,"nTable"));return-1!==a?b[a]:null}function K(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)E.console&&console.log&&console.log(c);else if(b=n.ext,b=b.sErrMode||b.errMode,a&&r(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==
75
+ typeof b&&b(a,d,c)}}function F(a,b,c,d){h.isArray(c)?h.each(c,function(c,d){h.isArray(d)?F(a,b,d[0],d[1]):F(a,b,d)}):(d===k&&(d=c),b[c]!==k&&(a[d]=b[c]))}function Xa(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],h.isPlainObject(d)?(h.isPlainObject(a[e])||(a[e]={}),h.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==e&&h.isArray(d)?d.slice():d);return a}function Wa(a,b,c){h(a).on("click.DT",b,function(b){h(a).blur();c(b)}).on("keypress.DT",b,function(a){13===a.which&&(a.preventDefault(),c(a))}).on("selectstart.DT",
76
+ function(){return!1})}function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function r(a,b,c,d){var e=[];b&&(e=h.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&(b=h.Event(c+".dt"),h(a.nTable).trigger(b,d),e.push(b.result));return e}function Sa(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Na(a,b){var c=a.renderer,d=n.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===
77
+ typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function ia(a,b){var c=[],c=Lb.numbers_length,d=Math.floor(c/2);b<=c?c=Y(0,b):a<=d?(c=Y(0,c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=Y(b-(c-2),b):(c=Y(a-d+2,a+d-1),c.push("ellipsis"),c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function Da(a){h.each({num:function(b){return za(b,a)},"num-fmt":function(b){return za(b,a,Ya)},"html-num":function(b){return za(b,
78
+ a,Aa)},"html-num-fmt":function(b){return za(b,a,Aa,Ya)}},function(b,c){x.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(x.type.search[b+a]=x.type.search.html)})}function Mb(a){return function(){var b=[ya(this[n.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return n.ext.internal[a].apply(this,b)}}var n=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new s(ya(this[x.iApiIndex])):new s(this)};
79
+ this.fnAddData=function(a,b){var c=this.api(!0),d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1):(""!==d.sX||""!==d.sY)&&la(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,
80
+ b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a,c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():
81
+ c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};
82
+ this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return ya(this[x.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();
83
+ (d===k||d)&&h.draw();return 0};this.fnVersionCheck=x.fnVersionCheck;var b=this,c=a===k,d=this.length;c&&(a={});this.oApi=this.internal=x.internal;for(var e in n.ext.internal)e&&(this[e]=Mb(e));this.each(function(){var e={},g=1<d?Xa(e,a,!0):a,j=0,i,e=this.getAttribute("id"),m=!1,l=n.defaults,q=h(this);if("table"!=this.nodeName.toLowerCase())K(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{fb(l);gb(l.column);J(l,l,!0);J(l.column,l.column,!0);J(l,h.extend(g,q.data()));var t=n.settings,
84
+ j=0;for(i=t.length;j<i;j++){var o=t[j];if(o.nTable==this||o.nTHead&&o.nTHead.parentNode==this||o.nTFoot&&o.nTFoot.parentNode==this){var s=g.bRetrieve!==k?g.bRetrieve:l.bRetrieve;if(c||s)return o.oInstance;if(g.bDestroy!==k?g.bDestroy:l.bDestroy){o.oInstance.fnDestroy();break}else{K(o,0,"Cannot reinitialise DataTable",3);return}}if(o.sTableId==this.id){t.splice(j,1);break}}if(null===e||""===e)this.id=e="DataTables_Table_"+n.ext._unique++;var p=h.extend(!0,{},n.models.oSettings,{sDestroyWidth:q[0].style.width,
85
+ sInstance:e,sTableId:e});p.nTable=this;p.oApi=b.internal;p.oInit=g;t.push(p);p.oInstance=1===b.length?b:q.dataTable();fb(g);Ca(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=h.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);g=Xa(h.extend(!0,{},l),g);F(p.oFeatures,g,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));F(p,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod",
86
+ "aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]);F(p.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);F(p.oLanguage,g,"fnInfoCallback");
87
+ z(p,"aoDrawCallback",g.fnDrawCallback,"user");z(p,"aoServerParams",g.fnServerParams,"user");z(p,"aoStateSaveParams",g.fnStateSaveParams,"user");z(p,"aoStateLoadParams",g.fnStateLoadParams,"user");z(p,"aoStateLoaded",g.fnStateLoaded,"user");z(p,"aoRowCallback",g.fnRowCallback,"user");z(p,"aoRowCreatedCallback",g.fnCreatedRow,"user");z(p,"aoHeaderCallback",g.fnHeaderCallback,"user");z(p,"aoFooterCallback",g.fnFooterCallback,"user");z(p,"aoInitComplete",g.fnInitComplete,"user");z(p,"aoPreDrawCallback",
88
+ g.fnPreDrawCallback,"user");p.rowIdFn=S(g.rowId);hb(p);var u=p.oClasses;h.extend(u,n.ext.classes,g.oClasses);q.addClass(u.sTable);p.iInitDisplayStart===k&&(p.iInitDisplayStart=g.iDisplayStart,p._iDisplayStart=g.iDisplayStart);null!==g.iDeferLoading&&(p.bDeferLoading=!0,e=h.isArray(g.iDeferLoading),p._iRecordsDisplay=e?g.iDeferLoading[0]:g.iDeferLoading,p._iRecordsTotal=e?g.iDeferLoading[1]:g.iDeferLoading);var v=p.oLanguage;h.extend(!0,v,g.oLanguage);v.sUrl&&(h.ajax({dataType:"json",url:v.sUrl,success:function(a){Ca(a);
89
+ J(l.oLanguage,a);h.extend(true,v,a);ha(p)},error:function(){ha(p)}}),m=!0);null===g.asStripeClasses&&(p.asStripeClasses=[u.sStripeOdd,u.sStripeEven]);var e=p.asStripeClasses,x=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(e,function(a){return x.hasClass(a)}))&&(h("tbody tr",this).removeClass(e.join(" ")),p.asDestroyStripes=e.slice());e=[];t=this.getElementsByTagName("thead");0!==t.length&&(ea(p.aoHeader,t[0]),e=ra(p));if(null===g.aoColumns){t=[];j=0;for(i=e.length;j<i;j++)t.push(null)}else t=
90
+ g.aoColumns;j=0;for(i=t.length;j<i;j++)Ea(p,e?e[j]:null);jb(p,g.aoColumnDefs,t,function(a,b){ka(p,a,b)});if(x.length){var w=function(a,b){return a.getAttribute("data-"+b)!==null?b:null};h(x[0]).children("th, td").each(function(a,b){var c=p.aoColumns[a];if(c.mData===a){var d=w(b,"sort")||w(b,"order"),e=w(b,"filter")||w(b,"search");if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:k,type:d!==null?a+".@data-"+d:k,filter:e!==null?a+".@data-"+e:k};ka(p,a)}}})}var U=p.oFeatures,
91
+ e=function(){if(g.aaSorting===k){var a=p.aaSorting;j=0;for(i=a.length;j<i;j++)a[j][1]=p.aoColumns[j].asSorting[0]}wa(p);U.bSort&&z(p,"aoDrawCallback",function(){if(p.bSorted){var a=X(p),b={};h.each(a,function(a,c){b[c.src]=c.dir});r(p,null,"order",[p,a,b]);Jb(p)}});z(p,"aoDrawCallback",function(){(p.bSorted||y(p)==="ssp"||U.bDeferRender)&&wa(p)},"sc");var a=q.children("caption").each(function(){this._captionSide=h(this).css("caption-side")}),b=q.children("thead");b.length===0&&(b=h("<thead/>").appendTo(q));
92
+ p.nTHead=b[0];b=q.children("tbody");b.length===0&&(b=h("<tbody/>").appendTo(q));p.nTBody=b[0];b=q.children("tfoot");if(b.length===0&&a.length>0&&(p.oScroll.sX!==""||p.oScroll.sY!==""))b=h("<tfoot/>").appendTo(q);if(b.length===0||b.children().length===0)q.addClass(u.sNoFooter);else if(b.length>0){p.nTFoot=b[0];ea(p.aoFooter,p.nTFoot)}if(g.aaData)for(j=0;j<g.aaData.length;j++)O(p,g.aaData[j]);else(p.bDeferLoading||y(p)=="dom")&&na(p,h(p.nTBody).children("tr"));p.aiDisplay=p.aiDisplayMaster.slice();
93
+ p.bInitialised=true;m===false&&ha(p)};g.bStateSave?(U.bStateSave=!0,z(p,"aoDrawCallback",xa,"state_save"),Kb(p,g,e)):e()}});b=null;return this},x,s,o,u,Za={},Nb=/[\r\n]/g,Aa=/<.*?>/g,Zb=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,$b=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),Ya=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,M=function(a){return!a||!0===a||"-"===a?!0:!1},Ob=function(a){var b=parseInt(a,10);return!isNaN(b)&&
94
+ isFinite(a)?b:null},Pb=function(a,b){Za[b]||(Za[b]=RegExp(Qa(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(Za[b],"."):a},$a=function(a,b,c){var d="string"===typeof a;if(M(a))return!0;b&&d&&(a=Pb(a,b));c&&d&&(a=a.replace(Ya,""));return!isNaN(parseFloat(a))&&isFinite(a)},Qb=function(a,b,c){return M(a)?!0:!(M(a)||"string"===typeof a)?null:$a(a.replace(Aa,""),b,c)?!0:null},D=function(a,b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<
95
+ f;e++)a[e]&&d.push(a[e][b]);return d},ja=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==k)for(;f<g;f++)a[b[f]][c]&&e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},Y=function(a,b){var c=[],d;b===k?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Rb=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},qa=function(a){var b;a:{if(!(2>a.length)){b=a.slice().sort();for(var c=b[0],d=1,e=b.length;d<e;d++){if(b[d]===c){b=!1;break a}c=b[d]}}b=!0}if(b)return a.slice();
96
+ b=[];var e=a.length,f,g=0,d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b};n.util={throttle:function(a,b){var c=b!==k?b:200,d,e;return function(){var b=this,g=+new Date,j=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=k;a.apply(b,j)},c)):(d=g,a.apply(b,j))}},escapeRegex:function(a){return a.replace($b,"\\$1")}};var A=function(a,b,c){a[b]!==k&&(a[c]=a[b])},ca=/\[.*?\]$/,W=/\(\)$/,Qa=n.util.escapeRegex,va=h("<div>")[0],Wb=va.textContent!==k,Yb=
97
+ /<.*?>/g,Oa=n.util.throttle,Sb=[],w=Array.prototype,ac=function(a){var b,c,d=n.settings,e=h.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=h.inArray(a,e),-1!==b?[d[b]]:null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=h(a):a instanceof h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};s=function(a,b){if(!(this instanceof
98
+ s))return new s(a,b);var c=[],d=function(a){(a=ac(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=qa(c);b&&h.merge(this,b);this.selector={rows:null,cols:null,opts:null};s.extend(this,this,Sb)};n.Api=s;h.extend(s.prototype,{any:function(){return 0!==this.count()},concat:w.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=
99
+ this.context;return b.length>a?new s(b[a],this[a]):null},filter:function(a){var b=[];if(w.filter)b=w.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new s(this.context,b)},flatten:function(){var a=[];return new s(this.context,a.concat.apply(a,this.toArray()))},join:w.join,indexOf:w.indexOf||function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,b,c,d){var e=[],f,g,j,h,m,l=this.context,
100
+ n,o,u=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);g=0;for(j=l.length;g<j;g++){var r=new s(l[g]);if("table"===b)f=c.call(r,l[g],g),f!==k&&e.push(f);else if("columns"===b||"rows"===b)f=c.call(r,l[g],this[g],g),f!==k&&e.push(f);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){o=this[g];"column-rows"===b&&(n=Ba(l[g],u.opts));h=0;for(m=o.length;h<m;h++)f=o[h],f="cell"===b?c.call(r,l[g],f.row,f.column,g,h):c.call(r,l[g],f,g,h,n),f!==k&&e.push(f)}}return e.length||d?(a=new s(l,a?
101
+ e.concat.apply([],e):e),b=a.selector,b.rows=u.rows,b.cols=u.cols,b.opts=u.opts,a):this},lastIndexOf:w.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(w.map)b=w.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new s(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:w.pop,push:w.push,reduce:w.reduce||function(a,b){return ib(this,a,b,0,this.length,
102
+ 1)},reduceRight:w.reduceRight||function(a,b){return ib(this,a,b,this.length-1,-1,-1)},reverse:w.reverse,selector:null,shift:w.shift,slice:function(){return new s(this.context,this)},sort:w.sort,splice:w.splice,toArray:function(){return w.slice.call(this)},to$:function(){return h(this)},toJQuery:function(){return h(this)},unique:function(){return new s(this.context,qa(this))},unshift:w.unshift});s.extend=function(a,b,c){if(c.length&&b&&(b instanceof s||b.__dt_wrapper)){var d,e,f,g=function(a,b,c){return function(){var d=
103
+ b.apply(a,arguments);s.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<e;d++)f=c[d],b[f.name]="function"===typeof f.val?g(a,f.val,f):h.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,s.extend(a,b[f.name],f.propExt)}};s.register=o=function(a,b){if(h.isArray(a))for(var c=0,d=a.length;c<d;c++)s.register(a[c],b);else for(var e=a.split("."),f=Sb,g,j,c=0,d=e.length;c<d;c++){g=(j=-1!==e[c].indexOf("()"))?e[c].replace("()",""):e[c];var i;a:{i=0;for(var m=f.length;i<m;i++)if(f[i].name===g){i=
104
+ f[i];break a}i=null}i||(i={name:g,val:{},methodExt:[],propExt:[]},f.push(i));c===d-1?i.val=b:f=j?i.methodExt:i.propExt}};s.registerPlural=u=function(a,b,c){s.register(a,c);s.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof s?a.length?h.isArray(a[0])?new s(a.context,a[0]):a[0]:k:a})};o("tables()",function(a){var b;if(a){b=s;var c=this.context;if("number"===typeof a)a=[c[a]];else var d=h.map(c,function(a){return a.nTable}),a=h(d).filter(a).map(function(){var a=h.inArray(this,
105
+ d);return c[a]}).toArray();b=new b(a)}else b=this;return b});o("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new s(b[0]):a});u("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});u("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody},1)});u("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});u("tables().footer()",
106
+ "table().footer()",function(){return this.iterator("table",function(a){return a.nTFoot},1)});u("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});o("draw()",function(a){return this.iterator("table",function(b){"page"===a?P(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),T(b,!1===a))})});o("page()",function(a){return a===k?this.page.info().page:this.iterator("table",function(b){Ta(b,a)})});o("page.info()",function(){if(0===
107
+ this.context.length)return k;var a=this.context[0],b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===y(a)}});o("page.len()",function(a){return a===k?0!==this.context.length?this.context[0]._iDisplayLength:k:this.iterator("table",function(b){Ra(b,a)})});var Tb=function(a,b,c){if(c){var d=new s(a);
108
+ d.one("draw",function(){c(d.ajax.json())})}if("ssp"==y(a))T(a,b);else{C(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();sa(a,[],function(c){oa(a);for(var c=ta(a,c),d=0,e=c.length;d<e;d++)O(a,c[d]);T(a,b);C(a,!1)})}};o("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});o("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});o("ajax.reload()",function(a,b){return this.iterator("table",function(c){Tb(c,!1===b,a)})});o("ajax.url()",function(a){var b=
109
+ this.context;if(a===k){if(0===b.length)return k;b=b[0];return b.ajax?h.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){h.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});o("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Tb(c,!1===b,a)})});var ab=function(a,b,c,d,e){var f=[],g,j,i,m,l,n;i=typeof b;if(!b||"string"===i||"function"===i||b.length===k)b=[b];i=0;for(m=b.length;i<m;i++){j=b[i]&&b[i].split&&!b[i].match(/[\[\(:]/)?b[i].split(","):
110
+ [b[i]];l=0;for(n=j.length;l<n;l++)(g=c("string"===typeof j[l]?h.trim(j[l]):j[l]))&&g.length&&(f=f.concat(g))}a=x.selector[a];if(a.length){i=0;for(m=a.length;i<m;i++)f=a[i](d,e,f)}return qa(f)},bb=function(a){a||(a={});a.filter&&a.search===k&&(a.search=a.filter);return h.extend({search:"none",order:"current",page:"all"},a)},cb=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Ba=function(a,b){var c,
111
+ d,e,f=[],g=a.aiDisplay;e=a.aiDisplayMaster;var j=b.search;c=b.order;d=b.page;if("ssp"==y(a))return"removed"===j?[]:Y(0,e.length);if("current"==d){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(g[c])}else if("current"==c||"applied"==c)if("none"==j)f=e.slice();else if("applied"==j)f=g.slice();else{if("removed"==j){var i={};c=0;for(d=g.length;c<d;c++)i[g[c]]=null;f=h.map(e,function(a){return!i.hasOwnProperty(a)?a:null})}}else if("index"==c||"original"==c){c=0;for(d=a.aoData.length;c<d;c++)"none"==
112
+ j?f.push(c):(e=h.inArray(c,g),(-1===e&&"removed"==j||0<=e&&"applied"==j)&&f.push(c))}return f};o("rows()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=bb(b),c=this.iterator("table",function(c){var e=b,f;return ab("row",a,function(a){var b=Ob(a),i=c.aoData;if(b!==null&&!e)return[b];f||(f=Ba(c,e));if(b!==null&&h.inArray(b,f)!==-1)return[b];if(a===null||a===k||a==="")return f;if(typeof a==="function")return h.map(f,function(b){var c=i[b];return a(b,c._aData,c.nTr)?b:null});if(a.nodeName){var b=
113
+ a._DT_RowIndex,m=a._DT_CellIndex;if(b!==k)return i[b]&&i[b].nTr===a?[b]:[];if(m)return i[m.row]&&i[m.row].nTr===a?[m.row]:[];b=h(a).closest("*[data-dt-row]");return b.length?[b.data("dt-row")]:[]}if(typeof a==="string"&&a.charAt(0)==="#"){b=c.aIds[a.replace(/^#/,"")];if(b!==k)return[b.idx]}b=Rb(ja(c.aoData,f,"nTr"));return h(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()},c,e)},1);c.selector.rows=a;c.selector.opts=b;return c});o("rows().nodes()",function(){return this.iterator("row",
114
+ function(a,b){return a.aoData[b].nTr||k},1)});o("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return ja(a.aoData,b,"_aData")},1)});u("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData},1)});u("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){da(b,c,a)})});u("rows().indexes()","row().index()",function(){return this.iterator("row",
115
+ function(a,b){return b},1)});u("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new s(c,b)});u("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h,i,m,l;e.splice(c,1);g=0;for(h=e.length;g<h;g++)if(i=e[g],l=i.anCells,null!==i.nTr&&(i.nTr._DT_RowIndex=g),null!==l){i=0;for(m=
116
+ l.length;i<m;i++)l[i]._DT_CellIndex.row=g}pa(b.aiDisplayMaster,c);pa(b.aiDisplay,c);pa(a[d],c,!1);0<b._iRecordsDisplay&&b._iRecordsDisplay--;Sa(b);c=b.rowIdFn(f._aData);c!==k&&delete b.aIds[c]});this.iterator("table",function(a){for(var c=0,d=a.aoData.length;c<d;c++)a.aoData[c].idx=c});return this});o("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,g,h=[];f=0;for(g=a.length;f<g;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?h.push(na(b,c)[0]):h.push(O(b,c));return h},
117
+ 1),c=this.rows(-1);c.pop();h.merge(c,b);return c});o("row()",function(a,b){return cb(this.rows(a,b))});o("row().data()",function(a){var b=this.context;if(a===k)return b.length&&this.length?b[0].aoData[this[0]]._aData:k;var c=b[0].aoData[this[0]];c._aData=a;h.isArray(a)&&c.nTr.id&&N(b[0].rowId)(a,c.nTr.id);da(b[0],this[0],"data");return this});o("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});o("row.add()",function(a){a instanceof h&&
118
+ a.length&&(a=a[0]);var b=this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?na(b,a)[0]:O(b,a)});return this.row(b[0])});var db=function(a,b){var c=a.context;if(c.length&&(c=c[0].aoData[b!==k?b:a[0]])&&c._details)c._details.remove(),c._detailsShow=k,c._details=k},Ub=function(a,b){var c=a.context;if(c.length&&a.length){var d=c[0].aoData[a[0]];if(d._details){(d._detailsShow=b)?d._details.insertAfter(d.nTr):d._details.detach();var e=c[0],f=new s(e),g=e.aoData;f.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");
119
+ 0<D(g,"_details").length&&(f.on("draw.dt.DT_details",function(a,b){e===b&&f.rows({page:"current"}).eq(0).each(function(a){a=g[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),f.on("column-visibility.dt.DT_details",function(a,b){if(e===b)for(var c,d=V(b),f=0,h=g.length;f<h;f++)c=g[f],c._details&&c._details.children("td[colspan]").attr("colspan",d)}),f.on("destroy.dt.DT_details",function(a,b){if(e===b)for(var c=0,d=g.length;c<d;c++)g[c]._details&&db(f,c)}))}}};o("row().child()",function(a,b){var c=
120
+ this.context;if(a===k)return c.length&&this.length?c[0].aoData[this[0]]._details:k;if(!0===a)this.child.show();else if(!1===a)db(this);else if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(h.isArray(a)||a instanceof h)for(var c=0,k=a.length;c<k;c++)f(a[c],b);else a.nodeName&&"tr"===a.nodeName.toLowerCase()?e.push(a):(c=h("<tr><td/></tr>").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=V(d),e.push(c[0]))};f(a,b);c._details&&c._details.detach();c._details=h(e);
121
+ c._detailsShow&&c._details.insertAfter(c.nTr)}return this});o(["row().child.show()","row().child().show()"],function(){Ub(this,!0);return this});o(["row().child.hide()","row().child().hide()"],function(){Ub(this,!1);return this});o(["row().child.remove()","row().child().remove()"],function(){db(this);return this});o("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var bc=/^([^:]+):(name|visIdx|visible)$/,Vb=function(a,b,
122
+ c,d,e){for(var c=[],d=0,f=e.length;d<f;d++)c.push(B(a,e[d],b));return c};o("columns()",function(a,b){a===k?a="":h.isPlainObject(a)&&(b=a,a="");var b=bb(b),c=this.iterator("table",function(c){var e=a,f=b,g=c.aoColumns,j=D(g,"sName"),i=D(g,"nTh");return ab("column",e,function(a){var b=Ob(a);if(a==="")return Y(g.length);if(b!==null)return[b>=0?b:g.length+b];if(typeof a==="function"){var e=Ba(c,f);return h.map(g,function(b,f){return a(f,Vb(c,f,0,0,e),i[f])?f:null})}var k=typeof a==="string"?a.match(bc):
123
+ "";if(k)switch(k[2]){case "visIdx":case "visible":b=parseInt(k[1],10);if(b<0){var n=h.map(g,function(a,b){return a.bVisible?b:null});return[n[n.length+b]]}return[aa(c,b)];case "name":return h.map(j,function(a,b){return a===k[1]?b:null});default:return[]}if(a.nodeName&&a._DT_CellIndex)return[a._DT_CellIndex.column];b=h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray();if(b.length||!a.nodeName)return b;b=h(a).closest("*[data-dt-column]");return b.length?[b.data("dt-column")]:[]},c,f)},
124
+ 1);c.selector.cols=a;c.selector.opts=b;return c});u("columns().header()","column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});u("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});u("columns().data()","column().data()",function(){return this.iterator("column-rows",Vb,1)});u("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},
125
+ 1)});u("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ja(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});u("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ja(a.aoData,e,"anCells",b)},1)});u("columns().visible()","column().visible()",function(a,b){var c=this.iterator("column",function(b,c){if(a===k)return b.aoColumns[c].bVisible;var f=b.aoColumns,g=f[c],j=b.aoData,
126
+ i,m,l;if(a!==k&&g.bVisible!==a){if(a){var n=h.inArray(!0,D(f,"bVisible"),c+1);i=0;for(m=j.length;i<m;i++)l=j[i].nTr,f=j[i].anCells,l&&l.insertBefore(f[c],f[n]||null)}else h(D(b.aoData,"anCells",c)).detach();g.bVisible=a;fa(b,b.aoHeader);fa(b,b.aoFooter);b.aiDisplay.length||h(b.nTBody).find("td[colspan]").attr("colspan",V(b));xa(b)}});a!==k&&(this.iterator("column",function(c,e){r(c,null,"column-visibility",[c,e,a,b])}),(b===k||b)&&this.columns.adjust());return c});u("columns().indexes()","column().index()",
127
+ function(a){return this.iterator("column",function(b,c){return"visible"===a?ba(b,c):c},1)});o("columns.adjust()",function(){return this.iterator("table",function(a){$(a)},1)});o("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return aa(c,b);if("fromData"===a||"toVisible"===a)return ba(c,b)}});o("column()",function(a,b){return cb(this.columns(a,b))});o("cells()",function(a,b,c){h.isPlainObject(a)&&(a.row===k?(c=a,a=null):(c=b,b=null));
128
+ h.isPlainObject(b)&&(c=b,b=null);if(null===b||b===k)return this.iterator("table",function(b){var d=a,e=bb(c),f=b.aoData,g=Ba(b,e),j=Rb(ja(f,g,"anCells")),i=h([].concat.apply([],j)),l,m=b.aoColumns.length,n,o,u,s,r,v;return ab("cell",d,function(a){var c=typeof a==="function";if(a===null||a===k||c){n=[];o=0;for(u=g.length;o<u;o++){l=g[o];for(s=0;s<m;s++){r={row:l,column:s};if(c){v=f[l];a(r,B(b,l,s),v.anCells?v.anCells[s]:null)&&n.push(r)}else n.push(r)}}return n}if(h.isPlainObject(a))return a.column!==
129
+ k&&a.row!==k&&h.inArray(a.row,g)!==-1?[a]:[];c=i.filter(a).map(function(a,b){return{row:b._DT_CellIndex.row,column:b._DT_CellIndex.column}}).toArray();if(c.length||!a.nodeName)return c;v=h(a).closest("*[data-dt-row]");return v.length?[{row:v.data("dt-row"),column:v.data("dt-column")}]:[]},b,e)});var d=this.columns(b),e=this.rows(a),f,g,j,i,m;this.iterator("table",function(a,b){f=[];g=0;for(j=e[b].length;g<j;g++){i=0;for(m=d[b].length;i<m;i++)f.push({row:e[b][g],column:d[b][i]})}},1);var l=this.cells(f,
130
+ c);h.extend(l.selector,{cols:b,rows:a,opts:c});return l});u("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b])&&a.anCells?a.anCells[c]:k},1)});o("cells().data()",function(){return this.iterator("cell",function(a,b,c){return B(a,b,c)},1)});u("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});u("cells().render()","cell().render()",
131
+ function(a){return this.iterator("cell",function(b,c,d){return B(b,c,d,a)},1)});u("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,b,c){return{row:b,column:c,columnVisible:ba(a,c)}},1)});u("cells().invalidate()","cell().invalidate()",function(a){return this.iterator("cell",function(b,c,d){da(b,c,a,d)})});o("cell()",function(a,b,c){return cb(this.cells(a,b,c))});o("cell().data()",function(a){var b=this.context,c=this[0];if(a===k)return b.length&&c.length?B(b[0],
132
+ c[0].row,c[0].column):k;kb(b[0],c[0].row,c[0].column,a);da(b[0],c[0].row,"data",c[0].column);return this});o("order()",function(a,b){var c=this.context;if(a===k)return 0!==c.length?c[0].aaSorting:k;"number"===typeof a?a=[[a,b]]:a.length&&!h.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));return this.iterator("table",function(b){b.aaSorting=a.slice()})});o("order.listener()",function(a,b,c){return this.iterator("table",function(d){Ma(d,a,b,c)})});o("order.fixed()",function(a){if(!a){var b=
133
+ this.context,b=b.length?b[0].aaSortingFixed:k;return h.isArray(b)?{pre:b}:b}return this.iterator("table",function(b){b.aaSortingFixed=h.extend(!0,{},a)})});o(["columns().order()","column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];h.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});o("search()",function(a,b,c,d){var e=this.context;return a===k?0!==e.length?e[0].oPreviousSearch.sSearch:k:this.iterator("table",function(e){e.oFeatures.bFilter&&ga(e,
134
+ h.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});u("columns().search()","column().search()",function(a,b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===k)return g[f].sSearch;e.oFeatures.bFilter&&(h.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),ga(e,e.oPreviousSearch,1))})});o("state()",function(){return this.context.length?this.context[0].oSavedState:
135
+ null});o("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});o("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});o("state.save()",function(){return this.iterator("table",function(a){xa(a)})});n.versionCheck=n.fnVersionCheck=function(a){for(var b=n.version.split("."),a=a.split("."),c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};n.isDataTable=
136
+ n.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;if(a instanceof n.Api)return!0;h.each(n.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?h("table",e.nScrollFoot)[0]:null;if(e.nTable===b||f===b||g===b)c=!0});return c};n.tables=n.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(n.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable});return b?new s(c):c};n.camelToHungarian=J;o("$()",function(a,b){var c=
137
+ this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){o(b+"()",function(){var a=Array.prototype.slice.call(arguments);a[0]=h.map(a[0].split(/\s/),function(a){return!a.match(/\.dt\b/)?a+".dt":a}).join(" ");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});o("clear()",function(){return this.iterator("table",function(a){oa(a)})});o("settings()",function(){return new s(this.context,this.context)});o("init()",function(){var a=
138
+ this.context;return a.length?a[0].oInit:null});o("data()",function(){return this.iterator("table",function(a){return D(a.aoData,"_aData")}).flatten()});o("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),o;b.bDestroying=!0;r(b,"aoDestroyCallback","destroy",[b]);a||(new s(b)).columns().visible(!0);k.off(".DT").find(":not(tbody *)").off(".DT");
139
+ h(E).off(".DT-"+b.sInstance);e!=g.parentNode&&(i.children("thead").detach(),i.append(g));j&&e!=j.parentNode&&(i.children("tfoot").detach(),i.append(j));b.aaSorting=[];b.aaSortingFixed=[];wa(b);h(l).removeClass(b.asStripeClasses.join(" "));h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);f.children().detach();f.append(l);g=a?"remove":"detach";i[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),i.css("width",b.sDestroyWidth).removeClass(d.sTable),
140
+ (o=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a%o])}));c=h.inArray(b,n.settings);-1!==c&&n.settings.splice(c,1)})});h.each(["column","row","cell"],function(a,b){o(b+"s().every()",function(a){var d=this.selector.opts,e=this;return this.iterator(b,function(f,g,h,i,m){a.call(e[b](g,"cell"===b?h:d,"cell"===b?d:k),g,h,i,m)})})});o("i18n()",function(a,b,c){var d=this.context[0],a=S(a)(d.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:
141
+ a._);return a.replace("%d",c)});n.version="1.10.19";n.settings=[];n.models={};n.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};n.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};n.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,
142
+ sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};n.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,
143
+ bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+
144
+ a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},
145
+ oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},
146
+ n.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};Z(n.defaults);n.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};
147
+ Z(n.defaults.column);n.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],
148
+ aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",
149
+ iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:
150
+ this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};n.ext=x={buttons:{},
151
+ classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:n.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:n.version};h.extend(x,{afnFiltering:x.search,aTypes:x.type.detect,ofnSearch:x.type.search,oSort:x.type.order,afnSortData:x.order,aoFeatures:x.feature,oApi:x.internal,oStdClasses:x.classes,oPagination:x.pager});
152
+ h.extend(n.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",
153
+ sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",
154
+ sJUIHeader:"",sJUIFooter:""});var Lb=n.ext.pager;h.extend(Lb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[ia(a,b)]},simple_numbers:function(a,b){return["previous",ia(a,b),"next"]},full_numbers:function(a,b){return["first","previous",ia(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",ia(a,b),"last"]},_numbers:ia,numbers_length:7});h.extend(!0,n.ext.renderer,{pageButton:{_:function(a,b,c,d,e,
155
+ f){var g=a.oClasses,j=a.oLanguage.oPaginate,i=a.oLanguage.oAria.paginate||{},m,l,n=0,o=function(b,d){var k,s,u,r,v=function(b){Ta(a,b.data.action,true)};k=0;for(s=d.length;k<s;k++){r=d[k];if(h.isArray(r)){u=h("<"+(r.DT_el||"div")+"/>").appendTo(b);o(u,r)}else{m=null;l="";switch(r){case "ellipsis":b.append('<span class="ellipsis">&#x2026;</span>');break;case "first":m=j.sFirst;l=r+(e>0?"":" "+g.sPageButtonDisabled);break;case "previous":m=j.sPrevious;l=r+(e>0?"":" "+g.sPageButtonDisabled);break;case "next":m=
156
+ j.sNext;l=r+(e<f-1?"":" "+g.sPageButtonDisabled);break;case "last":m=j.sLast;l=r+(e<f-1?"":" "+g.sPageButtonDisabled);break;default:m=r+1;l=e===r?g.sPageButtonActive:""}if(m!==null){u=h("<a>",{"class":g.sPageButton+" "+l,"aria-controls":a.sTableId,"aria-label":i[r],"data-dt-idx":n,tabindex:a.iTabIndex,id:c===0&&typeof r==="string"?a.sTableId+"_"+r:null}).html(m).appendTo(b);Wa(u,{action:r},v);n++}}}},s;try{s=h(b).find(H.activeElement).data("dt-idx")}catch(u){}o(h(b).empty(),d);s!==k&&h(b).find("[data-dt-idx="+
157
+ s+"]").focus()}}});h.extend(n.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return $a(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&!Zb.test(a))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||M(a)?"date":null},function(a,b){var c=b.oLanguage.sDecimal;return $a(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Qb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Qb(a,c,!0)?"html-num-fmt"+c:null},function(a){return M(a)||
158
+ "string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(n.ext.type.search,{html:function(a){return M(a)?a:"string"===typeof a?a.replace(Nb," ").replace(Aa,""):""},string:function(a){return M(a)?a:"string"===typeof a?a.replace(Nb," "):a}});var za=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Pb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(x.type.order,{"date-pre":function(a){a=Date.parse(a);return isNaN(a)?-Infinity:a},"html-pre":function(a){return M(a)?
159
+ "":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return M(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,b){return a<b?1:a>b?-1:0}});Da("");h.extend(!0,n.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:
160
+ c.sSortingClass)}})},jqueryui:function(a,b,c,d){h("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]==
161
+ "asc"?d.sSortJUIAsc:h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});var eb=function(a){return"string"===typeof a?a.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):a};n.render={number:function(a,b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return eb(f);h=h.toFixed(c);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
162
+ a)+f+(e||"")}}},text:function(){return{display:eb,filter:eb}}};h.extend(n.ext.internal,{_fnExternApiFunc:Mb,_fnBuildAjax:sa,_fnAjaxUpdate:mb,_fnAjaxParameters:vb,_fnAjaxUpdateDraw:wb,_fnAjaxDataSrc:ta,_fnAddColumn:Ea,_fnColumnOptions:ka,_fnAdjustColumnSizing:$,_fnVisibleToColumnIndex:aa,_fnColumnIndexToVisible:ba,_fnVisbleColumns:V,_fnGetColumns:ma,_fnColumnTypes:Ga,_fnApplyColumnDefs:jb,_fnHungarianMap:Z,_fnCamelToHungarian:J,_fnLanguageCompat:Ca,_fnBrowserDetect:hb,_fnAddData:O,_fnAddTr:na,_fnNodeToDataIndex:function(a,
163
+ b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:B,_fnSetCellData:kb,_fnSplitObjNotation:Ja,_fnGetObjectDataFn:S,_fnSetObjectDataFn:N,_fnGetDataMaster:Ka,_fnClearTable:oa,_fnDeleteIndex:pa,_fnInvalidate:da,_fnGetRowElements:Ia,_fnCreateTr:Ha,_fnBuildHead:lb,_fnDrawHead:fa,_fnDraw:P,_fnReDraw:T,_fnAddOptionsHtml:ob,_fnDetectHeader:ea,_fnGetUniqueThs:ra,_fnFeatureHtmlFilter:qb,_fnFilterComplete:ga,_fnFilterCustom:zb,
164
+ _fnFilterColumn:yb,_fnFilter:xb,_fnFilterCreateSearch:Pa,_fnEscapeRegex:Qa,_fnFilterData:Ab,_fnFeatureHtmlInfo:tb,_fnUpdateInfo:Db,_fnInfoMacros:Eb,_fnInitialise:ha,_fnInitComplete:ua,_fnLengthChange:Ra,_fnFeatureHtmlLength:pb,_fnFeatureHtmlPaginate:ub,_fnPageChange:Ta,_fnFeatureHtmlProcessing:rb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:sb,_fnScrollDraw:la,_fnApplyToChildren:I,_fnCalculateColumnWidths:Fa,_fnThrottle:Oa,_fnConvertToWidth:Fb,_fnGetWidestNode:Gb,_fnGetMaxLenString:Hb,_fnStringToCss:v,
165
+ _fnSortFlatten:X,_fnSort:nb,_fnSortAria:Jb,_fnSortListener:Va,_fnSortAttachListener:Ma,_fnSortingClasses:wa,_fnSortData:Ib,_fnSaveState:xa,_fnLoadState:Kb,_fnSettingsFromNode:ya,_fnLog:K,_fnMap:F,_fnBindAction:Wa,_fnCallbackReg:z,_fnCallbackFire:r,_fnLengthOverflow:Sa,_fnRenderer:Na,_fnDataSource:y,_fnRowAttributes:La,_fnExtend:Xa,_fnCalculateEnd:function(){}});h.fn.dataTable=n;n.$=h;h.fn.dataTableSettings=n.settings;h.fn.dataTableExt=n.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};
166
+ h.each(n,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable});
js/jquery.jqplot.min.js CHANGED
@@ -1,8 +1,5 @@
1
- /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jplot.com
2
- jsDate | (c) 2010-2016 Chris Leonello
 
3
  */
4
- !function(a){function b(b){a.jqplot.ElemContainer.call(this),this.name=b,this._series=[],this.show=!1,this.tickRenderer=a.jqplot.AxisTickRenderer,this.tickOptions={},this.labelRenderer=a.jqplot.AxisLabelRenderer,this.labelOptions={},this.label=null,this.showLabel=!0,this.min=null,this.max=null,this.autoscale=!1,this.pad=1.2,this.padMax=null,this.padMin=null,this.ticks=[],this.numberTicks,this.tickInterval,this.renderer=a.jqplot.LinearAxisRenderer,this.rendererOptions={},this.showTicks=!0,this.showTickMarks=!0,this.showMinorTicks=!0,this.drawMajorGridlines=!0,this.drawMinorGridlines=!1,this.drawMajorTickMarks=!0,this.drawMinorTickMarks=!0,this.useSeriesColor=!1,this.borderWidth=null,this.borderColor=null,this.scaleToHiddenSeries=!1,this._dataBounds={min:null,max:null},this._intervalStats=[],this._offsets={min:null,max:null},this._ticks=[],this._label=null,this.syncTicks=null,this.tickSpacing=75,this._min=null,this._max=null,this._tickInterval=null,this._numberTicks=null,this.__ticks=null,this._options={}}function c(b){a.jqplot.ElemContainer.call(this),this.show=!1,this.location="ne",this.labels=[],this.showLabels=!0,this.showSwatches=!0,this.placement="insideGrid",this.xoffset=0,this.yoffset=0,this.border,this.background,this.textColor,this.fontFamily,this.fontSize,this.rowSpacing="0.5em",this.renderer=a.jqplot.TableLegendRenderer,this.rendererOptions={},this.preDraw=!1,this.marginTop=null,this.marginRight=null,this.marginBottom=null,this.marginLeft=null,this.escapeHtml=!1,this._series=[],a.extend(!0,this,b)}function d(b){a.jqplot.ElemContainer.call(this),this.text=b,this.show=!0,this.fontFamily,this.fontSize,this.textAlign,this.textColor,this.renderer=a.jqplot.DivTitleRenderer,this.rendererOptions={},this.escapeHtml=!1}function e(b){b=b||{},a.jqplot.ElemContainer.call(this),this.show=!0,this.xaxis="xaxis",this._xaxis,this.yaxis="yaxis",this._yaxis,this.gridBorderWidth=2,this.renderer=a.jqplot.LineRenderer,this.rendererOptions={},this.data=[],this.gridData=[],this.label="",this.showLabel=!0,this.color,this.negativeColor,this.lineWidth=2.5,this.lineJoin="round",this.lineCap="round",this.linePattern="solid",this.shadow=!0,this.shadowAngle=45,this.shadowOffset=1.25,this.shadowDepth=3,this.shadowAlpha="0.1",this.breakOnNull=!1,this.markerRenderer=a.jqplot.MarkerRenderer,this.markerOptions={},this.showLine=!0,this.showMarker=!0,this.index,this.fill=!1,this.fillColor,this.fillAlpha,this.fillAndStroke=!1,this.disableStack=!1,this._stack=!1,this.neighborThreshold=4,this.fillToZero=!1,this.fillToValue=0,this.fillAxis="y",this.useNegativeColors=!0,this._stackData=[],this._plotData=[],this._plotValues={x:[],y:[]},this._intervals={x:{},y:{}},this._prevPlotData=[],this._prevGridData=[],this._stackAxis="y",this._primaryAxis="_xaxis",this.canvas=new a.jqplot.GenericCanvas,this.shadowCanvas=new a.jqplot.GenericCanvas,this.plugins={},this._sumy=0,this._sumx=0,this._type="",this.step=!1}function f(){a.jqplot.ElemContainer.call(this),this.drawGridlines=!0,this.gridLineColor="#cccccc",this.gridLineWidth=1,this.background="#fffdf6",this.borderColor="#999999",this.borderWidth=2,this.drawBorder=!0,this.shadow=!0,this.shadowAngle=45,this.shadowOffset=1.5,this.shadowWidth=3,this.shadowDepth=3,this.shadowColor=null,this.shadowAlpha="0.07",this._left,this._top,this._right,this._bottom,this._width,this._height,this._axes=[],this.renderer=a.jqplot.CanvasGridRenderer,this.rendererOptions={},this._offsets={top:null,bottom:null,left:null,right:null}}function g(){function h(a){for(var b,c=0;c<a.length;c++)for(var d,e=[a[c].data,a[c]._stackData,a[c]._plotData,a[c]._prevPlotData],f=0;4>f;f++)if(d=!0,b=e[f],"x"==a[c]._stackAxis){for(var g=0;g<b.length;g++)if("number"!=typeof b[g][1]){d=!1;break}d&&b.sort(function(a,b){return a[1]-b[1]})}else{for(var g=0;g<b.length;g++)if("number"!=typeof b[g][0]){d=!1;break}d&&b.sort(function(a,b){return a[0]-b[0]})}}function i(a){var b,c,d=a.data.plot,e=d.eventCanvas._elem.offset(),f={x:a.pageX-e.left,y:a.pageY-e.top},g={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null,yMidAxis:null},h=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"],i=d.axes;for(b=11;b>0;b--)c=h[b-1],i[c].show&&(g[c]=i[c].series_p2u(f[c.charAt(0)]));return{offsets:e,gridPos:f,dataPos:g}}function j(b,c){function d(a,b,c){var d=(b[1]-c[1])/(b[0]-c[0]),e=b[1]-d*b[0],f=a+b[1];return[(f-e)/d,f]}var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=c.series;for(g=c.seriesStack.length-1;g>=0;g--)switch(e=c.seriesStack[g],h=x[e],u=h._highlightThreshold,h.renderer.constructor){case a.jqplot.BarRenderer:for(j=b.x,k=b.y,f=0;f<h._barPoints.length;f++)if(t=h._barPoints[f],s=h.gridData[f],j>t[0][0]&&j<t[2][0]&&(k>t[2][1]&&k<t[0][1]||k<t[2][1]&&k>t[0][1]))return{seriesIndex:h.index,pointIndex:f,gridData:s,data:h.data[f],points:h._barPoints[f]};break;case a.jqplot.PyramidRenderer:for(j=b.x,k=b.y,f=0;f<h._barPoints.length;f++)if(t=h._barPoints[f],s=h.gridData[f],j>t[0][0]+u[0][0]&&j<t[2][0]+u[2][0]&&k>t[2][1]&&k<t[0][1])return{seriesIndex:h.index,pointIndex:f,gridData:s,data:h.data[f],points:h._barPoints[f]};break;case a.jqplot.DonutRenderer:if(n=h.startAngle/180*Math.PI,j=b.x-h._center[0],k=b.y-h._center[1],i=Math.sqrt(Math.pow(j,2)+Math.pow(k,2)),j>0&&-k>=0?l=2*Math.PI-Math.atan(-k/j):j>0&&0>-k?l=-Math.atan(-k/j):0>j?l=Math.PI-Math.atan(-k/j):0==j&&-k>0?l=3*Math.PI/2:0==j&&0>-k?l=Math.PI/2:0==j&&0==k&&(l=0),n&&(l-=n,0>l?l+=2*Math.PI:l>2*Math.PI&&(l-=2*Math.PI)),m=h.sliceMargin/180*Math.PI,i<h._radius&&i>h._innerRadius)for(f=0;f<h.gridData.length;f++)if(o=f>0?h.gridData[f-1][1]+m:m,p=h.gridData[f][1],l>o&&p>l)return{seriesIndex:h.index,pointIndex:f,gridData:[b.x,b.y],data:h.data[f]};break;case a.jqplot.PieRenderer:if(n=h.startAngle/180*Math.PI,j=b.x-h._center[0],k=b.y-h._center[1],i=Math.sqrt(Math.pow(j,2)+Math.pow(k,2)),j>0&&-k>=0?l=2*Math.PI-Math.atan(-k/j):j>0&&0>-k?l=-Math.atan(-k/j):0>j?l=Math.PI-Math.atan(-k/j):0==j&&-k>0?l=3*Math.PI/2:0==j&&0>-k?l=Math.PI/2:0==j&&0==k&&(l=0),n&&(l-=n,0>l?l+=2*Math.PI:l>2*Math.PI&&(l-=2*Math.PI)),m=h.sliceMargin/180*Math.PI,i<h._radius)for(f=0;f<h.gridData.length;f++)if(o=f>0?h.gridData[f-1][1]+m:m,p=h.gridData[f][1],l>o&&p>l)return{seriesIndex:h.index,pointIndex:f,gridData:[b.x,b.y],data:h.data[f]};break;case a.jqplot.BubbleRenderer:j=b.x,k=b.y;var y=null;if(h.show){for(var f=0;f<h.gridData.length;f++)s=h.gridData[f],r=Math.sqrt((j-s[0])*(j-s[0])+(k-s[1])*(k-s[1])),r<=s[2]&&(q>=r||null==q)&&(q=r,y={seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]});if(null!=y)return y}break;case a.jqplot.FunnelRenderer:j=b.x,k=b.y;var z,A,B,C=h._vertices,D=C[0],E=C[C.length-1];for(z=d(k,D[0],E[3]),A=d(k,D[1],E[2]),f=0;f<C.length;f++)if(B=C[f],k>=B[0][1]&&k<=B[3][1]&&j>=z[0]&&j<=A[0])return{seriesIndex:h.index,pointIndex:f,gridData:null,data:h.data[f]};break;case a.jqplot.LineRenderer:if(j=b.x,k=b.y,i=h.renderer,h.show){if(!(!(h.fill||h.renderer.bands.show&&h.renderer.bands.fill)||c.plugins.highlighter&&c.plugins.highlighter.show)){var F=!1;if(j>h._boundingBox[0][0]&&j<h._boundingBox[1][0]&&k>h._boundingBox[1][1]&&k<h._boundingBox[0][1])for(var G,H=h._areaPoints.length,f=H-1,G=0;H>G;G++){var I=[h._areaPoints[G][0],h._areaPoints[G][1]],J=[h._areaPoints[f][0],h._areaPoints[f][1]];(I[1]<k&&J[1]>=k||J[1]<k&&I[1]>=k)&&I[0]+(k-I[1])/(J[1]-I[1])*(J[0]-I[0])<j&&(F=!F),f=G}if(F)return{seriesIndex:e,pointIndex:null,gridData:h.gridData,data:h.data,points:h._areaPoints};break}w=h.markerRenderer.size/2+h.neighborThreshold,v=w>0?w:0;for(var f=0;f<h.gridData.length;f++)if(s=h.gridData[f],i.constructor==a.jqplot.OHLCRenderer)if(i.candleStick){var K=h._yaxis.series_u2p;if(j>=s[0]-i._bodyWidth/2&&j<=s[0]+i._bodyWidth/2&&k>=K(h.data[f][2])&&k<=K(h.data[f][3]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else if(i.hlc){var K=h._yaxis.series_u2p;if(j>=s[0]-i._tickLength&&j<=s[0]+i._tickLength&&k>=K(h.data[f][1])&&k<=K(h.data[f][2]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else{var K=h._yaxis.series_u2p;if(j>=s[0]-i._tickLength&&j<=s[0]+i._tickLength&&k>=K(h.data[f][2])&&k<=K(h.data[f][3]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else if(null!=s[0]&&null!=s[1]&&(r=Math.sqrt((j-s[0])*(j-s[0])+(k-s[1])*(k-s[1])),v>=r&&(q>=r||null==q)))return q=r,{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}break;default:if(j=b.x,k=b.y,i=h.renderer,h.show){w=h.markerRenderer.size/2+h.neighborThreshold,v=w>0?w:0;for(var f=0;f<h.gridData.length;f++)if(s=h.gridData[f],i.constructor==a.jqplot.OHLCRenderer)if(i.candleStick){var K=h._yaxis.series_u2p;if(j>=s[0]-i._bodyWidth/2&&j<=s[0]+i._bodyWidth/2&&k>=K(h.data[f][2])&&k<=K(h.data[f][3]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else if(i.hlc){var K=h._yaxis.series_u2p;if(j>=s[0]-i._tickLength&&j<=s[0]+i._tickLength&&k>=K(h.data[f][1])&&k<=K(h.data[f][2]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else{var K=h._yaxis.series_u2p;if(j>=s[0]-i._tickLength&&j<=s[0]+i._tickLength&&k>=K(h.data[f][2])&&k<=K(h.data[f][3]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else if(r=Math.sqrt((j-s[0])*(j-s[0])+(k-s[1])*(k-s[1])),v>=r&&(q>=r||null==q))return q=r,{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}}return null}this.animate=!1,this.animateReplot=!1,this.axes={xaxis:new b("xaxis"),yaxis:new b("yaxis"),x2axis:new b("x2axis"),y2axis:new b("y2axis"),y3axis:new b("y3axis"),y4axis:new b("y4axis"),y5axis:new b("y5axis"),y6axis:new b("y6axis"),y7axis:new b("y7axis"),y8axis:new b("y8axis"),y9axis:new b("y9axis"),yMidAxis:new b("yMidAxis")},this.baseCanvas=new a.jqplot.GenericCanvas,this.captureRightClick=!1,this.data=[],this.dataRenderer,this.dataRendererOptions,this.defaults={axesDefaults:{},axes:{xaxis:{},yaxis:{},x2axis:{},y2axis:{},y3axis:{},y4axis:{},y5axis:{},y6axis:{},y7axis:{},y8axis:{},y9axis:{},yMidAxis:{}},seriesDefaults:{},series:[]},this.defaultAxisStart=1,this.drawIfHidden=!1,this.eventCanvas=new a.jqplot.GenericCanvas,this.fillBetween={series1:null,series2:null,color:null,baseSeries:0,fill:!0},this.fontFamily,this.fontSize,this.grid=new f,this.legend=new c,this.noDataIndicator={show:!1,indicator:"Loading Data...",axes:{xaxis:{min:0,max:10,tickInterval:2,show:!0},yaxis:{min:0,max:12,tickInterval:3,show:!0}}},this.negativeSeriesColors=a.jqplot.config.defaultNegativeColors,this.options={},this.previousSeriesStack=[],this.plugins={},this.series=[],this.seriesStack=[],this.seriesColors=a.jqplot.config.defaultColors,this.sortData=!0,this.stackSeries=!1,this.syncXTicks=!0,this.syncYTicks=!0,this.target=null,this.targetId=null,this.textColor,this.title=new d,this._drawCount=0,this._sumy=0,this._sumx=0,this._stackData=[],this._plotData=[],this._width=null,this._height=null,this._plotDimensions={height:null,width:null},this._gridPadding={top:null,right:null,bottom:null,left:null},this._defaultGridPadding={top:10,right:10,bottom:23,left:10},this._addDomReference=a.jqplot.config.addDomReference,this.preInitHooks=new a.jqplot.HooksManager,this.postInitHooks=new a.jqplot.HooksManager,this.preParseOptionsHooks=new a.jqplot.HooksManager,this.postParseOptionsHooks=new a.jqplot.HooksManager,this.preDrawHooks=new a.jqplot.HooksManager,this.postDrawHooks=new a.jqplot.HooksManager,this.preDrawSeriesHooks=new a.jqplot.HooksManager,this.postDrawSeriesHooks=new a.jqplot.HooksManager,this.preDrawLegendHooks=new a.jqplot.HooksManager,this.addLegendRowHooks=new a.jqplot.HooksManager,this.preSeriesInitHooks=new a.jqplot.HooksManager,this.postSeriesInitHooks=new a.jqplot.HooksManager,this.preParseSeriesOptionsHooks=new a.jqplot.HooksManager,this.postParseSeriesOptionsHooks=new a.jqplot.HooksManager,this.eventListenerHooks=new a.jqplot.EventListenerManager,this.preDrawSeriesShadowHooks=new a.jqplot.HooksManager,this.postDrawSeriesShadowHooks=new a.jqplot.HooksManager,this.colorGenerator=new a.jqplot.ColorGenerator,this.negativeColorGenerator=new a.jqplot.ColorGenerator,this.canvasManager=new a.jqplot.CanvasManager,this.themeEngine=new a.jqplot.ThemeEngine;this.init=function(c,d,e){e=e||{};for(var f=0;f<a.jqplot.preInitHooks.length;f++)a.jqplot.preInitHooks[f].call(this,c,d,e);for(var f=0;f<this.preInitHooks.hooks.length;f++)this.preInitHooks.hooks[f].call(this,c,d,e);if(this.targetId="#"+c,this.target=a("#"+c),this._addDomReference&&this.target.data("jqplot",this),this.target.removeClass("jqplot-error"),!this.target.get(0))throw new Error("No plot target specified");if("static"==this.target.css("position")&&this.target.css("position","relative"),this.target.hasClass("jqplot-target")||this.target.addClass("jqplot-target"),this.target.height())this._height=g=this.target.height();else{var g;g=e&&e.height?parseInt(e.height,10):this.target.attr("data-height")?parseInt(this.target.attr("data-height"),10):parseInt(a.jqplot.config.defaultHeight,10),this._height=g,this.target.css("height",g+"px")}if(this.target.width())this._width=i=this.target.width();else{var i;i=e&&e.width?parseInt(e.width,10):this.target.attr("data-width")?parseInt(this.target.attr("data-width"),10):parseInt(a.jqplot.config.defaultWidth,10),this._width=i,this.target.css("width",i+"px")}for(var f=0,j=G.length;j>f;f++)this.axes[G[f]]=new b(G[f]);if(this._plotDimensions.height=this._height,this._plotDimensions.width=this._width,this.grid._plotDimensions=this._plotDimensions,this.title._plotDimensions=this._plotDimensions,this.baseCanvas._plotDimensions=this._plotDimensions,this.eventCanvas._plotDimensions=this._plotDimensions,this.legend._plotDimensions=this._plotDimensions,this._height<=0||this._width<=0||!this._height||!this._width)throw new Error("Canvas dimension not set");if(e.dataRenderer&&a.isFunction(e.dataRenderer)&&(e.dataRendererOptions&&(this.dataRendererOptions=e.dataRendererOptions),this.dataRenderer=e.dataRenderer,d=this.dataRenderer(d,this,this.dataRendererOptions)),e.noDataIndicator&&a.isPlainObject(e.noDataIndicator)&&a.extend(!0,this.noDataIndicator,e.noDataIndicator),null==d||0==a.isArray(d)||0==d.length||0==a.isArray(d[0])||0==d[0].length){if(0==this.noDataIndicator.show)throw new Error("No data specified");for(var k in this.noDataIndicator.axes)for(var l in this.noDataIndicator.axes[k])this.axes[k][l]=this.noDataIndicator.axes[k][l];this.postDrawHooks.add(function(){var b=this.eventCanvas.getHeight(),c=this.eventCanvas.getWidth(),d=a('<div class="jqplot-noData-container" style="position:absolute;"></div>');this.target.append(d),d.height(b),d.width(c),d.css("top",this.eventCanvas._offsets.top),d.css("left",this.eventCanvas._offsets.left);var e=a('<div class="jqplot-noData-contents" style="text-align:center; position:relative; margin-left:auto; margin-right:auto;"></div>');d.append(e),e.html(this.noDataIndicator.indicator);var f=e.height(),g=e.width();e.height(f),e.width(g),e.css("top",(b-f)/2+"px")})}this.data=a.extend(!0,[],d),this.parseOptions(e),this.textColor&&this.target.css("color",this.textColor),this.fontFamily&&this.target.css("font-family",this.fontFamily),this.fontSize&&this.target.css("font-size",this.fontSize),this.title.init(),this.legend.init(),this._sumy=0,this._sumx=0,this.computePlotData();for(var f=0;f<this.series.length;f++){this.seriesStack.push(f),this.previousSeriesStack.push(f),this.series[f].shadowCanvas._plotDimensions=this._plotDimensions,this.series[f].canvas._plotDimensions=this._plotDimensions;for(var m=0;m<a.jqplot.preSeriesInitHooks.length;m++)a.jqplot.preSeriesInitHooks[m].call(this.series[f],c,this.data,this.options.seriesDefaults,this.options.series[f],this);for(var m=0;m<this.preSeriesInitHooks.hooks.length;m++)this.preSeriesInitHooks.hooks[m].call(this.series[f],c,this.data,this.options.seriesDefaults,this.options.series[f],this);this.series[f]._plotDimensions=this._plotDimensions,this.series[f].init(f,this.grid.borderWidth,this);for(var m=0;m<a.jqplot.postSeriesInitHooks.length;m++)a.jqplot.postSeriesInitHooks[m].call(this.series[f],c,this.data,this.options.seriesDefaults,this.options.series[f],this);for(var m=0;m<this.postSeriesInitHooks.hooks.length;m++)this.postSeriesInitHooks.hooks[m].call(this.series[f],c,this.data,this.options.seriesDefaults,this.options.series[f],this);this._sumy+=this.series[f]._sumy,this._sumx+=this.series[f]._sumx}for(var n,o,f=0,j=G.length;j>f;f++)n=G[f],o=this.axes[n],o._plotDimensions=this._plotDimensions,o.init(),null==this.axes[n].borderColor&&("x"!==n.charAt(0)&&o.useSeriesColor===!0&&o.show?o.borderColor=o._series[0].color:o.borderColor=this.grid.borderColor);this.sortData&&h(this.series),this.grid.init(),this.grid._axes=this.axes,this.legend._series=this.series;for(var f=0;f<a.jqplot.postInitHooks.length;f++)a.jqplot.postInitHooks[f].call(this,c,this.data,e);for(var f=0;f<this.postInitHooks.hooks.length;f++)this.postInitHooks.hooks[f].call(this,c,this.data,e)},this.resetAxesScale=function(b,c){var d=c||{},e=b||this.axes;if(e===!0&&(e=this.axes),a.isArray(e))for(var f=0;f<e.length;f++)this.axes[e[f]].resetScale(d[e[f]]);else if("object"==typeof e)for(var g in e)this.axes[g].resetScale(d[g])},this.reInitialize=function(c,d){for(var e=a.extend(!0,{},this.options,d),f=this.targetId.substr(1),g=null==c?this.data:c,i=0;i<a.jqplot.preInitHooks.length;i++)a.jqplot.preInitHooks[i].call(this,f,g,e);for(var i=0;i<this.preInitHooks.hooks.length;i++)this.preInitHooks.hooks[i].call(this,f,g,e);if(this._height=this.target.height(),this._width=this.target.width(),this._height<=0||this._width<=0||!this._height||!this._width)throw new Error("Target dimension not set");this._plotDimensions.height=this._height,this._plotDimensions.width=this._width,this.grid._plotDimensions=this._plotDimensions,this.title._plotDimensions=this._plotDimensions,this.baseCanvas._plotDimensions=this._plotDimensions,this.eventCanvas._plotDimensions=this._plotDimensions,this.legend._plotDimensions=this._plotDimensions;for(var j,k,l,m,i=0,n=G.length;n>i;i++){j=G[i],m=this.axes[j],k=m._ticks;for(var l=0,o=k.length;o>l;l++){var p=k[l]._elem;p&&(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==F&&window.G_vmlCanvasManager.uninitElement(p.get(0)),p.emptyForce(),p=null,k._elem=null)}k=null,delete m.ticks,delete m._ticks,this.axes[j]=new b(j),this.axes[j]._plotWidth=this._width,this.axes[j]._plotHeight=this._height}c&&(e.dataRenderer&&a.isFunction(e.dataRenderer)&&(e.dataRendererOptions&&(this.dataRendererOptions=e.dataRendererOptions),this.dataRenderer=e.dataRenderer,c=this.dataRenderer(c,this,this.dataRendererOptions)),this.data=a.extend(!0,[],c)),d&&this.parseOptions(e),this.title._plotWidth=this._width,this.textColor&&this.target.css("color",this.textColor),this.fontFamily&&this.target.css("font-family",this.fontFamily),this.fontSize&&this.target.css("font-size",this.fontSize),this.title.init(),this.legend.init(),this._sumy=0,this._sumx=0,this.seriesStack=[],this.previousSeriesStack=[],this.computePlotData();for(var i=0,n=this.series.length;n>i;i++){this.seriesStack.push(i),this.previousSeriesStack.push(i),this.series[i].shadowCanvas._plotDimensions=this._plotDimensions,this.series[i].canvas._plotDimensions=this._plotDimensions;for(var l=0;l<a.jqplot.preSeriesInitHooks.length;l++)a.jqplot.preSeriesInitHooks[l].call(this.series[i],f,this.data,this.options.seriesDefaults,this.options.series[i],this);for(var l=0;l<this.preSeriesInitHooks.hooks.length;l++)this.preSeriesInitHooks.hooks[l].call(this.series[i],f,this.data,this.options.seriesDefaults,this.options.series[i],this);this.series[i]._plotDimensions=this._plotDimensions,this.series[i].init(i,this.grid.borderWidth,this);for(var l=0;l<a.jqplot.postSeriesInitHooks.length;l++)a.jqplot.postSeriesInitHooks[l].call(this.series[i],f,this.data,this.options.seriesDefaults,this.options.series[i],this);for(var l=0;l<this.postSeriesInitHooks.hooks.length;l++)this.postSeriesInitHooks.hooks[l].call(this.series[i],f,this.data,this.options.seriesDefaults,this.options.series[i],this);this._sumy+=this.series[i]._sumy,this._sumx+=this.series[i]._sumx}for(var i=0,n=G.length;n>i;i++)j=G[i],m=this.axes[j],m._plotDimensions=this._plotDimensions,m.init(),null==m.borderColor&&("x"!==j.charAt(0)&&m.useSeriesColor===!0&&m.show?m.borderColor=m._series[0].color:m.borderColor=this.grid.borderColor);this.sortData&&h(this.series),this.grid.init(),this.grid._axes=this.axes,this.legend._series=this.series;for(var i=0,n=a.jqplot.postInitHooks.length;n>i;i++)a.jqplot.postInitHooks[i].call(this,f,this.data,e);for(var i=0,n=this.postInitHooks.hooks.length;n>i;i++)this.postInitHooks.hooks[i].call(this,f,this.data,e)},this.quickInit=function(){if(this._height=this.target.height(),this._width=this.target.width(),this._height<=0||this._width<=0||!this._height||!this._width)throw new Error("Target dimension not set");this._plotDimensions.height=this._height,this._plotDimensions.width=this._width,this.grid._plotDimensions=this._plotDimensions,this.title._plotDimensions=this._plotDimensions,this.baseCanvas._plotDimensions=this._plotDimensions,this.eventCanvas._plotDimensions=this._plotDimensions,this.legend._plotDimensions=this._plotDimensions;for(var b in this.axes)this.axes[b]._plotWidth=this._width,this.axes[b]._plotHeight=this._height;this.title._plotWidth=this._width,this.textColor&&this.target.css("color",this.textColor),this.fontFamily&&this.target.css("font-family",this.fontFamily),this.fontSize&&this.target.css("font-size",this.fontSize),this._sumy=0,this._sumx=0,this.computePlotData();for(var c=0;c<this.series.length;c++)"line"===this.series[c]._type&&this.series[c].renderer.bands.show&&this.series[c].renderer.initBands.call(this.series[c],this.series[c].renderer.options,this),this.series[c]._plotDimensions=this._plotDimensions,this.series[c].canvas._plotDimensions=this._plotDimensions,this._sumy+=this.series[c]._sumy,this._sumx+=this.series[c]._sumx;for(var d,e=0;12>e;e++){d=G[e];for(var f=this.axes[d]._ticks,c=0;c<f.length;c++){var g=f[c]._elem;g&&(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==F&&window.G_vmlCanvasManager.uninitElement(g.get(0)),g.emptyForce(),g=null,f._elem=null)}f=null,this.axes[d]._plotDimensions=this._plotDimensions,this.axes[d]._ticks=[]}this.sortData&&h(this.series),this.grid._axes=this.axes,this.legend._series=this.series},this.computePlotData=function(){this._plotData=[],this._stackData=[];var b,c,d;for(c=0,d=this.series.length;d>c;c++){b=this.series[c],this._plotData.push([]),this._stackData.push([]);var e=b.data;this._plotData[c]=a.extend(!0,[],e),this._stackData[c]=a.extend(!0,[],e),b._plotData=this._plotData[c],b._stackData=this._stackData[c];var f={x:[],y:[]};if(this.stackSeries&&!b.disableStack){b._stack=!0;for(var g="x"===b._stackAxis?0:1,h=0,i=e.length;i>h;h++){var j=e[h][g];if(null==j&&(j=0),this._plotData[c][h][g]=j,this._stackData[c][h][g]=j,c>0)for(var k=c;k--;){var l=this._plotData[k][h][g];if(j*l>=0){this._plotData[c][h][g]+=l,this._stackData[c][h][g]+=l;break}}}}else{for(var m=0;m<b.data.length;m++)f.x.push(b.data[m][0]),f.y.push(b.data[m][1]);this._stackData.push(b.data),this.series[c]._stackData=b.data,this._plotData.push(b.data),b._plotData=b.data,b._plotValues=f}for(c>0&&(b._prevPlotData=this.series[c-1]._plotData),b._sumy=0,b._sumx=0,m=b.data.length-1;m>-1;m--)b._sumy+=b.data[m][1],b._sumx+=b.data[m][0]}},this.populatePlotData=function(b,c){this._plotData=[],this._stackData=[],b._stackData=[],b._plotData=[];var d={x:[],y:[]};if(this.stackSeries&&!b.disableStack){b._stack=!0;for(var e,f,g,h,i="x"===b._stackAxis?0:1,j=a.extend(!0,[],b.data),k=a.extend(!0,[],b.data),l=0;c>l;l++)for(var m=this.series[l].data,n=0;n<m.length;n++)g=m[n],e=null!=g[0]?g[0]:0,f=null!=g[1]?g[1]:0,j[n][0]+=e,j[n][1]+=f,h=i?f:e,b.data[n][i]*h>=0&&(k[n][i]+=h);for(var o=0;o<k.length;o++)d.x.push(k[o][0]),d.y.push(k[o][1]);this._plotData.push(k),this._stackData.push(j),b._stackData=j,b._plotData=k,b._plotValues=d}else{for(var o=0;o<b.data.length;o++)d.x.push(b.data[o][0]),d.y.push(b.data[o][1]);this._stackData.push(b.data),this.series[c]._stackData=b.data,this._plotData.push(b.data),b._plotData=b.data,b._plotValues=d}for(c>0&&(b._prevPlotData=this.series[c-1]._plotData),b._sumy=0,b._sumx=0,o=b.data.length-1;o>-1;o--)b._sumy+=b.data[o][1],b._sumx+=b.data[o][0]},this.getNextSeriesColor=function(a){var b=0,c=a.seriesColors;return function(){return b<c.length?c[b++]:(b=0,c[b++])}}(this),this.parseOptions=function(b){for(var c=0;c<this.preParseOptionsHooks.hooks.length;c++)this.preParseOptionsHooks.hooks[c].call(this,b);for(var c=0;c<a.jqplot.preParseOptionsHooks.length;c++)a.jqplot.preParseOptionsHooks[c].call(this,b);this.options=a.extend(!0,{},this.defaults,b);var d=this.options;if(this.animate=d.animate,this.animateReplot=d.animateReplot,this.stackSeries=d.stackSeries,a.isPlainObject(d.fillBetween))for(var f,g=["series1","series2","color","baseSeries","fill"],c=0,h=g.length;h>c;c++)f=g[c],null!=d.fillBetween[f]&&(this.fillBetween[f]=d.fillBetween[f]);d.seriesColors&&(this.seriesColors=d.seriesColors),d.negativeSeriesColors&&(this.negativeSeriesColors=d.negativeSeriesColors),d.captureRightClick&&(this.captureRightClick=d.captureRightClick),this.defaultAxisStart=b&&null!=b.defaultAxisStart?b.defaultAxisStart:this.defaultAxisStart,this.colorGenerator.setColors(this.seriesColors),this.negativeColorGenerator.setColors(this.negativeSeriesColors),a.extend(!0,this._gridPadding,d.gridPadding),this.sortData=null!=d.sortData?d.sortData:this.sortData;for(var c=0;12>c;c++){var i=G[c],j=this.axes[i];j._options=a.extend(!0,{},d.axesDefaults,d.axes[i]),a.extend(!0,j,d.axesDefaults,d.axes[i]),j._plotWidth=this._width,j._plotHeight=this._height}var k=function(b,c,d){var e,f,g=[];if(c=c||"vertical",a.isArray(b[0]))a.extend(!0,g,b);else for(e=0,f=b.length;f>e;e++)"vertical"==c?g.push([d+e,b[e]]):g.push([b[e],d+e]);return g};this.series=[];for(var c=0;c<this.data.length;c++){for(var l=a.extend(!0,{index:c},{seriesColors:this.seriesColors,negativeSeriesColors:this.negativeSeriesColors},this.options.seriesDefaults,this.options.series[c],{rendererOptions:{animation:{show:this.animate}}}),g=new e(l),m=0;m<a.jqplot.preParseSeriesOptionsHooks.length;m++)a.jqplot.preParseSeriesOptionsHooks[m].call(g,this.options.seriesDefaults,this.options.series[c]);for(var m=0;m<this.preParseSeriesOptionsHooks.hooks.length;m++)this.preParseSeriesOptionsHooks.hooks[m].call(g,this.options.seriesDefaults,this.options.series[c]);a.extend(!0,g,l);var n="vertical";switch(g.renderer===a.jqplot.BarRenderer&&g.rendererOptions&&"horizontal"==g.rendererOptions.barDirection&&(n="horizontal",g._stackAxis="x",g._primaryAxis="_yaxis"),g.data=k(this.data[c],n,this.defaultAxisStart),g.xaxis){case"xaxis":g._xaxis=this.axes.xaxis;break;case"x2axis":g._xaxis=this.axes.x2axis}g._yaxis=this.axes[g.yaxis],g._xaxis._series.push(g),g._yaxis._series.push(g),g.show?(g._xaxis.show=!0,g._yaxis.show=!0):(g._xaxis.scaleToHiddenSeries&&(g._xaxis.show=!0),g._yaxis.scaleToHiddenSeries&&(g._yaxis.show=!0)),g.label||(g.label="Series "+(c+1).toString()),this.series.push(g);for(var m=0;m<a.jqplot.postParseSeriesOptionsHooks.length;m++)a.jqplot.postParseSeriesOptionsHooks[m].call(this.series[c],this.options.seriesDefaults,this.options.series[c]);for(var m=0;m<this.postParseSeriesOptionsHooks.hooks.length;m++)this.postParseSeriesOptionsHooks.hooks[m].call(this.series[c],this.options.seriesDefaults,this.options.series[c])}a.extend(!0,this.grid,this.options.grid);for(var c=0,h=G.length;h>c;c++){var i=G[c],j=this.axes[i];null==j.borderWidth&&(j.borderWidth=this.grid.borderWidth)}"string"==typeof this.options.title?this.title.text=this.options.title:"object"==typeof this.options.title&&a.extend(!0,this.title,this.options.title),this.title._plotWidth=this._width,this.legend.setOptions(this.options.legend);for(var c=0;c<a.jqplot.postParseOptionsHooks.length;c++)a.jqplot.postParseOptionsHooks[c].call(this,b);for(var c=0;c<this.postParseOptionsHooks.hooks.length;c++)this.postParseOptionsHooks.hooks[c].call(this,b)},this.destroy=function(){this.canvasManager.freeAllCanvases(),this.eventCanvas&&this.eventCanvas._elem&&this.eventCanvas._elem.unbind(),this.target.empty(),this.target[0].innerHTML=""},this.replot=function(b){var c=b||{},d=c.data||null,e=c.clear===!1?!1:!0,f=c.resetAxes||!1;delete c.data,delete c.clear,delete c.resetAxes,this.target.trigger("jqplotPreReplot"),e&&this.destroy(),d||!a.isEmptyObject(c)?this.reInitialize(d,c):this.quickInit(),f&&this.resetAxesScale(f,c.axes),this.draw(),this.target.trigger("jqplotPostReplot")},this.redraw=function(a){a=null!=a?a:!0,this.target.trigger("jqplotPreRedraw"),a&&(this.canvasManager.freeAllCanvases(),this.eventCanvas._elem.unbind(),this.target.empty());for(var b in this.axes)this.axes[b]._ticks=[];this.computePlotData(),this._sumy=0,this._sumx=0;for(var c=0,d=this.series.length;d>c;c++)this._sumy+=this.series[c]._sumy,this._sumx+=this.series[c]._sumx;this.draw(),this.target.trigger("jqplotPostRedraw")},this.draw=function(){if(this.drawIfHidden||this.target.is(":visible")){this.target.trigger("jqplotPreDraw");var b,c,d;for(b=0,d=a.jqplot.preDrawHooks.length;d>b;b++)a.jqplot.preDrawHooks[b].call(this);for(b=0,d=this.preDrawHooks.hooks.length;d>b;b++)this.preDrawHooks.hooks[b].apply(this,this.preDrawSeriesHooks.args[b]);this.target.append(this.baseCanvas.createElement({left:0,right:0,top:0,bottom:0},"jqplot-base-canvas",null,this)),this.baseCanvas.setContext(),this.target.append(this.title.draw()),this.title.pack({top:0,left:0});var e=this.legend.draw({},this),f={top:0,left:0,bottom:0,right:0};if("outsideGrid"==this.legend.placement){switch(this.target.append(e),this.legend.location){case"n":f.top+=this.legend.getHeight();break;case"s":f.bottom+=this.legend.getHeight();break;case"ne":case"e":case"se":f.right+=this.legend.getWidth();break;case"nw":case"w":case"sw":f.left+=this.legend.getWidth();break;default:f.right+=this.legend.getWidth()}e=e.detach()}var g,h=this.axes;for(b=0;12>b;b++)g=G[b],this.target.append(h[g].draw(this.baseCanvas._ctx,this)),h[g].set();h.yaxis.show&&(f.left+=h.yaxis.getWidth());var i,j=["y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"],k=[0,0,0,0,0,0,0,0],l=0;for(i=0;8>i;i++)h[j[i]].show&&(l+=h[j[i]].getWidth(),k[i]=l);if(f.right+=l,h.x2axis.show&&(f.top+=h.x2axis.getHeight()),this.title.show&&(f.top+=this.title.getHeight()),h.xaxis.show&&(f.bottom+=h.xaxis.getHeight()),this.options.gridDimensions&&a.isPlainObject(this.options.gridDimensions)){var m=parseInt(this.options.gridDimensions.width,10)||0,n=parseInt(this.options.gridDimensions.height,10)||0,o=(this._width-f.left-f.right-m)/2,p=(this._height-f.top-f.bottom-n)/2;p>=0&&o>=0&&(f.top+=p,f.bottom+=p,f.left+=o,f.right+=o)}var q=["top","bottom","left","right"];for(var i in q)null==this._gridPadding[q[i]]&&f[q[i]]>0?this._gridPadding[q[i]]=f[q[i]]:null==this._gridPadding[q[i]]&&(this._gridPadding[q[i]]=this._defaultGridPadding[q[i]]);var r=this._gridPadding;for("outsideGrid"===this.legend.placement&&(r={top:this.title.getHeight(),left:0,right:0,bottom:0},"s"===this.legend.location&&(r.left=this._gridPadding.left,r.right=this._gridPadding.right)),h.xaxis.pack({position:"absolute",bottom:this._gridPadding.bottom-h.xaxis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right}),h.yaxis.pack({position:"absolute",top:0,left:this._gridPadding.left-h.yaxis.getWidth(),height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top}),h.x2axis.pack({position:"absolute",top:this._gridPadding.top-h.x2axis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right}),b=8;b>0;b--)h[j[b-1]].pack({position:"absolute",top:0,right:this._gridPadding.right-k[b-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});var s=(this._width-this._gridPadding.left-this._gridPadding.right)/2+this._gridPadding.left-h.yMidAxis.getWidth()/2;h.yMidAxis.pack({position:"absolute",top:0,left:s,zIndex:9,textAlign:"center"},{min:this._height-this._gridPadding.bottom,
5
- max:this._gridPadding.top}),this.target.append(this.grid.createElement(this._gridPadding,this)),this.grid.draw();var t=this.series,u=t.length;for(b=0,d=u;d>b;b++)c=this.seriesStack[b],this.target.append(t[c].shadowCanvas.createElement(this._gridPadding,"jqplot-series-shadowCanvas",null,this)),t[c].shadowCanvas.setContext(),t[c].shadowCanvas._elem.data("seriesIndex",c);for(b=0,d=u;d>b;b++)c=this.seriesStack[b],this.target.append(t[c].canvas.createElement(this._gridPadding,"jqplot-series-canvas",null,this)),t[c].canvas.setContext(),t[c].canvas._elem.data("seriesIndex",c);this.target.append(this.eventCanvas.createElement(this._gridPadding,"jqplot-event-canvas",null,this)),this.eventCanvas.setContext(),this.eventCanvas._ctx.fillStyle="rgba(0,0,0,0)",this.eventCanvas._ctx.fillRect(0,0,this.eventCanvas._ctx.canvas.width,this.eventCanvas._ctx.canvas.height),this.bindCustomEvents(),this.legend.preDraw?(this.eventCanvas._elem.before(e),this.legend.pack(r),this.legend._elem?this.drawSeries({legendInfo:{location:this.legend.location,placement:this.legend.placement,width:this.legend.getWidth(),height:this.legend.getHeight(),xoffset:this.legend.xoffset,yoffset:this.legend.yoffset}}):this.drawSeries()):(this.drawSeries(),u&&a(t[u-1].canvas._elem).after(e),this.legend.pack(r));for(var b=0,d=a.jqplot.eventListenerHooks.length;d>b;b++)this.eventCanvas._elem.bind(a.jqplot.eventListenerHooks[b][0],{plot:this},a.jqplot.eventListenerHooks[b][1]);for(var b=0,d=this.eventListenerHooks.hooks.length;d>b;b++)this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[b][0],{plot:this},this.eventListenerHooks.hooks[b][1]);var v=this.fillBetween;if("number"==typeof v.series1)v.fill&&v.series1!==v.series2&&v.series1<u&&v.series2<u&&"line"===t[v.series1]._type&&"line"===t[v.series2]._type&&this.doFillBetweenLines();else if(null!=v.series1&&null!=v.series2){var w=!1;if(v.series1.length===v.series2.length)for(var x=0,y=0,z=0;z<v.series1.length;z++){if(x=v.series1[z],y=v.series2[z],!(x!==y&&u>x&&u>y&&"line"===t[x]._type&&"line"===t[y]._type)){w=!1;break}w=!0}v.fill&&w&&this.doFillBetweenLines()}for(var b=0,d=a.jqplot.postDrawHooks.length;d>b;b++)a.jqplot.postDrawHooks[b].call(this);for(var b=0,d=this.postDrawHooks.hooks.length;d>b;b++)this.postDrawHooks.hooks[b].apply(this,this.postDrawHooks.args[b]);this.target.is(":visible")&&(this._drawCount+=1);var A,B,C,D;for(b=0,d=u;d>b;b++)A=t[b],B=A.renderer,C=".jqplot-point-label.jqplot-series-"+b,B.animation&&B.animation._supported&&B.animation.show&&(this._drawCount<2||this.animateReplot)&&(D=this.target.find(C),D.stop(!0,!0).hide(),A.canvas._elem.stop(!0,!0).hide(),A.shadowCanvas._elem.stop(!0,!0).hide(),A.canvas._elem.jqplotEffect("blind",{mode:"show",direction:B.animation.direction},B.animation.speed),A.shadowCanvas._elem.jqplotEffect("blind",{mode:"show",direction:B.animation.direction},B.animation.speed),D.fadeIn(.8*B.animation.speed));D=null,this.target.trigger("jqplotPostDraw",[this])}},g.prototype.doFillBetweenLines=function(){function a(a,e){var f=c[a],g=c[e];if(g.renderer.smooth)var h=g.renderer._smoothedData.slice(0).reverse();else var h=g.gridData.slice(0).reverse();if(f.renderer.smooth)var i=f.renderer._smoothedData.concat(h);else var i=f.gridData.concat(h);var j=null!==b.color?b.color:c[d].fillColor,k=null!==b.baseSeries?b.baseSeries:a,l=c[k].renderer.shapeRenderer,m={fillStyle:j,fill:!0,closePath:!0};l.draw(f.shadowCanvas._ctx,i,m)}var b=this.fillBetween,c=this.series,d=b.series1,e=b.series2,f=0,g=0;if("number"==typeof d&&"number"==typeof e)f=e>d?d:e,g=e>d?e:d,a(f,g);else for(var h=0;h<d.length;h++)f=d[h]<e[h]?d[h]:e[h],g=e[h]>d[h]?e[h]:d[h],a(f,g)},this.bindCustomEvents=function(){this.eventCanvas._elem.bind("click",{plot:this},this.onClick),this.eventCanvas._elem.bind("dblclick",{plot:this},this.onDblClick),this.eventCanvas._elem.bind("mousedown",{plot:this},this.onMouseDown),this.eventCanvas._elem.bind("mousemove",{plot:this},this.onMouseMove),this.eventCanvas._elem.bind("mouseenter",{plot:this},this.onMouseEnter),this.eventCanvas._elem.bind("mouseleave",{plot:this},this.onMouseLeave),this.captureRightClick?(this.eventCanvas._elem.bind("mouseup",{plot:this},this.onRightClick),this.eventCanvas._elem.get(0).oncontextmenu=function(){return!1}):this.eventCanvas._elem.bind("mouseup",{plot:this},this.onMouseUp)},this.onClick=function(b){var c=i(b),d=b.data.plot,e=j(c.gridPos,d),f=a.Event("jqplotClick");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])},this.onDblClick=function(b){var c=i(b),d=b.data.plot,e=j(c.gridPos,d),f=a.Event("jqplotDblClick");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])},this.onMouseDown=function(b){var c=i(b),d=b.data.plot,e=j(c.gridPos,d),f=a.Event("jqplotMouseDown");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])},this.onMouseUp=function(b){var c=i(b),d=a.Event("jqplotMouseUp");d.pageX=b.pageX,d.pageY=b.pageY,a(this).trigger(d,[c.gridPos,c.dataPos,null,b.data.plot])},this.onRightClick=function(b){var c=i(b),d=b.data.plot,e=j(c.gridPos,d);if(d.captureRightClick)if(3==b.which){var f=a.Event("jqplotRightClick");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])}else{var f=a.Event("jqplotMouseUp");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])}},this.onMouseMove=function(b){var c=i(b),d=b.data.plot,e=j(c.gridPos,d),f=a.Event("jqplotMouseMove");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])},this.onMouseEnter=function(b){var c=i(b),d=b.data.plot,e=a.Event("jqplotMouseEnter");e.pageX=b.pageX,e.pageY=b.pageY,e.relatedTarget=b.relatedTarget,a(this).trigger(e,[c.gridPos,c.dataPos,null,d])},this.onMouseLeave=function(b){var c=i(b),d=b.data.plot,e=a.Event("jqplotMouseLeave");e.pageX=b.pageX,e.pageY=b.pageY,e.relatedTarget=b.relatedTarget,a(this).trigger(e,[c.gridPos,c.dataPos,null,d])},this.drawSeries=function(b,c){var d,e,f;if(c="number"==typeof b&&null==c?b:c,b="object"==typeof b?b:{},c!=F)e=this.series[c],f=e.shadowCanvas._ctx,f.clearRect(0,0,f.canvas.width,f.canvas.height),e.drawShadow(f,b,this),f=e.canvas._ctx,f.clearRect(0,0,f.canvas.width,f.canvas.height),e.draw(f,b,this),e.renderer.constructor==a.jqplot.BezierCurveRenderer&&c<this.series.length-1&&this.drawSeries(c+1);else for(d=0;d<this.series.length;d++)e=this.series[d],f=e.shadowCanvas._ctx,f.clearRect(0,0,f.canvas.width,f.canvas.height),e.drawShadow(f,b,this),f=e.canvas._ctx,f.clearRect(0,0,f.canvas.width,f.canvas.height),e.draw(f,b,this);b=c=d=e=f=null},this.moveSeriesToFront=function(b){b=parseInt(b,10);var c=a.inArray(b,this.seriesStack);if(-1!=c){if(c==this.seriesStack.length-1)return void(this.previousSeriesStack=this.seriesStack.slice(0));var d=this.seriesStack[this.seriesStack.length-1],e=this.series[b].canvas._elem.detach(),f=this.series[b].shadowCanvas._elem.detach();this.series[d].shadowCanvas._elem.after(f),this.series[d].canvas._elem.after(e),this.previousSeriesStack=this.seriesStack.slice(0),this.seriesStack.splice(c,1),this.seriesStack.push(b)}},this.moveSeriesToBack=function(b){b=parseInt(b,10);var c=a.inArray(b,this.seriesStack);if(0!=c&&-1!=c){var d=this.seriesStack[0],e=this.series[b].canvas._elem.detach(),f=this.series[b].shadowCanvas._elem.detach();this.series[d].shadowCanvas._elem.before(f),this.series[d].canvas._elem.before(e),this.previousSeriesStack=this.seriesStack.slice(0),this.seriesStack.splice(c,1),this.seriesStack.unshift(b)}},this.restorePreviousSeriesOrder=function(){var a,b,c,d,e,f;if(this.seriesStack!=this.previousSeriesStack){for(a=1;a<this.previousSeriesStack.length;a++)e=this.previousSeriesStack[a],f=this.previousSeriesStack[a-1],b=this.series[e].canvas._elem.detach(),c=this.series[e].shadowCanvas._elem.detach(),this.series[f].shadowCanvas._elem.after(c),this.series[f].canvas._elem.after(b);d=this.seriesStack.slice(0),this.seriesStack=this.previousSeriesStack.slice(0),this.previousSeriesStack=d}},this.restoreOriginalSeriesOrder=function(){var a,b,c,d=[];for(a=0;a<this.series.length;a++)d.push(a);if(this.seriesStack!=d)for(this.previousSeriesStack=this.seriesStack.slice(0),this.seriesStack=d,a=1;a<this.seriesStack.length;a++)b=this.series[a].canvas._elem.detach(),c=this.series[a].shadowCanvas._elem.detach(),this.series[a-1].shadowCanvas._elem.after(c),this.series[a-1].canvas._elem.after(b)},this.activateTheme=function(a){this.themeEngine.activate(this,a)}}function h(a,b){return(3.4182054+b)*Math.pow(a,-.3534992)}function i(a){var b=(Math.exp(2*a)-1)/(Math.exp(2*a)+1);return b}function j(a){function b(a,b){return a-b==0?Math.pow(10,10):a-b}var c=this.renderer.smooth,d=this.canvas.getWidth(),e=this._xaxis.series_p2u,f=this._yaxis.series_p2u,g=null,i=a.length/d,j=[],k=[];g=isNaN(parseFloat(c))?h(i,.5):parseFloat(c);for(var l=[],m=[],n=0,o=a.length;o>n;n++)l.push(a[n][1]),m.push(a[n][0]);for(var p,q,r,s,t=a.length-1,u=1,v=a.length;v>u;u++){for(var w=[],x=[],y=0;2>y;y++){var n=u-1+y;0==n||n==t?w[y]=Math.pow(10,10):l[n+1]-l[n]==0||l[n]-l[n-1]==0?w[y]=0:(m[n+1]-m[n])/(l[n+1]-l[n])+(m[n]-m[n-1])/(l[n]-l[n-1])==0?w[y]=0:(l[n+1]-l[n])*(l[n]-l[n-1])<0?w[y]=0:w[y]=2/(b(m[n+1],m[n])/(l[n+1]-l[n])+b(m[n],m[n-1])/(l[n]-l[n-1]))}1==u?w[0]=1.5*(l[1]-l[0])/b(m[1],m[0])-w[1]/2:u==t&&(w[1]=1.5*(l[t]-l[t-1])/b(m[t],m[t-1])-w[0]/2),x[0]=-2*(w[1]+2*w[0])/b(m[u],m[u-1])+6*(l[u]-l[u-1])/Math.pow(b(m[u],m[u-1]),2),x[1]=2*(2*w[1]+w[0])/b(m[u],m[u-1])-6*(l[u]-l[u-1])/Math.pow(b(m[u],m[u-1]),2),s=1/6*(x[1]-x[0])/b(m[u],m[u-1]),r=.5*(m[u]*x[0]-m[u-1]*x[1])/b(m[u],m[u-1]),q=(l[u]-l[u-1]-r*(Math.pow(m[u],2)-Math.pow(m[u-1],2))-s*(Math.pow(m[u],3)-Math.pow(m[u-1],3)))/b(m[u],m[u-1]),p=l[u-1]-q*m[u-1]-r*Math.pow(m[u-1],2)-s*Math.pow(m[u-1],3);for(var z,A,B=(m[u]-m[u-1])/g,y=0,o=g;o>y;y++)z=[],A=m[u-1]+y*B,z.push(A),z.push(p+q*A+r*Math.pow(A,2)+s*Math.pow(A,3)),j.push(z),k.push([e(z[0]),f(z[1])])}return j.push(a[n]),k.push([e(a[n][0]),f(a[n][1])]),[j,k]}function k(a){var b,c,d,e,f,g,j,k,l,m,n,o,p,q,r,s,t,u,v=this.renderer.smooth,w=this.renderer.tension,x=this.canvas.getWidth(),y=this._xaxis.series_p2u,z=this._yaxis.series_p2u,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=a.length/x,I=[],J=[];A=isNaN(parseFloat(v))?h(H,.5):parseFloat(v),isNaN(parseFloat(w))||(w=parseFloat(w));for(var K=0,L=a.length-1;L>K;K++)for(null===w?(E=Math.abs((a[K+1][1]-a[K][1])/(a[K+1][0]-a[K][0])),q=.3,r=.6,s=(r-q)/2,t=2.5,u=-1.4,G=E/t+u,C=s*i(G)-s*i(u)+q,K>0&&(F=Math.abs((a[K][1]-a[K-1][1])/(a[K][0]-a[K-1][0]))),G=F/t+u,D=s*i(G)-s*i(u)+q,B=(C+D)/2):B=w,b=0;A>b;b++)c=b/A,d=(1+2*c)*Math.pow(1-c,2),e=c*Math.pow(1-c,2),f=Math.pow(c,2)*(3-2*c),g=Math.pow(c,2)*(c-1),a[K-1]?(j=B*(a[K+1][0]-a[K-1][0]),k=B*(a[K+1][1]-a[K-1][1])):(j=B*(a[K+1][0]-a[K][0]),k=B*(a[K+1][1]-a[K][1])),a[K+2]?(l=B*(a[K+2][0]-a[K][0]),m=B*(a[K+2][1]-a[K][1])):(l=B*(a[K+1][0]-a[K][0]),m=B*(a[K+1][1]-a[K][1])),n=d*a[K][0]+f*a[K+1][0]+e*j+g*l,o=d*a[K][1]+f*a[K+1][1]+e*k+g*m,p=[n,o],I.push(p),J.push([y(n),z(o)]);return I.push(a[L]),J.push([y(a[L][0]),z(a[L][1])]),[I,J]}function l(b,c,d){for(var e=0;e<this.series.length;e++)this.series[e].renderer.constructor==a.jqplot.LineRenderer&&this.series[e].highlightMouseOver&&(this.series[e].highlightMouseDown=!1)}function m(){this.plugins.lineRenderer&&this.plugins.lineRenderer.highlightCanvas&&(this.plugins.lineRenderer.highlightCanvas.resetCanvas(),this.plugins.lineRenderer.highlightCanvas=null),this.plugins.lineRenderer.highlightedSeriesIndex=null,this.plugins.lineRenderer.highlightCanvas=new a.jqplot.GenericCanvas,this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-lineRenderer-highlight-canvas",this._plotDimensions,this)),this.plugins.lineRenderer.highlightCanvas.setContext(),this.eventCanvas._elem.bind("mouseleave",{plot:this},function(a){o(a.data.plot)})}function n(a,b,c,d){var e=a.series[b],f=a.plugins.lineRenderer.highlightCanvas;f._ctx.clearRect(0,0,f._ctx.canvas.width,f._ctx.canvas.height),e._highlightedPoint=c,a.plugins.lineRenderer.highlightedSeriesIndex=b;var g={fillStyle:e.highlightColor};"line"===e.type&&e.renderer.bands.show&&(g.fill=!0,g.closePath=!0),e.renderer.shapeRenderer.draw(f._ctx,d,g),f=null}function o(a){var b=a.plugins.lineRenderer.highlightCanvas;b._ctx.clearRect(0,0,b._ctx.canvas.width,b._ctx.canvas.height);for(var c=0;c<a.series.length;c++)a.series[c]._highlightedPoint=null;a.plugins.lineRenderer.highlightedSeriesIndex=null,a.target.trigger("jqplotDataUnhighlight"),b=null}function p(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],g=jQuery.Event("jqplotDataMouseOver");if(g.pageX=a.pageX,g.pageY=a.pageY,e.target.trigger(g,f),e.series[f[0]].highlightMouseOver&&f[0]!=e.plugins.lineRenderer.highlightedSeriesIndex){var h=jQuery.Event("jqplotDataHighlight");h.which=a.which,h.pageX=a.pageX,h.pageY=a.pageY,e.target.trigger(h,f),n(e,d.seriesIndex,d.pointIndex,d.points)}}else null==d&&o(e)}function q(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data];if(e.series[f[0]].highlightMouseDown&&f[0]!=e.plugins.lineRenderer.highlightedSeriesIndex){var g=jQuery.Event("jqplotDataHighlight");g.which=a.which,g.pageX=a.pageX,g.pageY=a.pageY,e.target.trigger(g,f),n(e,d.seriesIndex,d.pointIndex,d.points)}}else null==d&&o(e)}function r(a,b,c,d,e){var f=e.plugins.lineRenderer.highlightedSeriesIndex;null!=f&&e.series[f].highlightMouseDown&&o(e)}function s(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],g=jQuery.Event("jqplotDataClick");g.which=a.which,g.pageX=a.pageX,g.pageY=a.pageY,e.target.trigger(g,f)}}function t(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],g=e.plugins.lineRenderer.highlightedSeriesIndex;null!=g&&e.series[g].highlightMouseDown&&o(e);var h=jQuery.Event("jqplotDataRightClick");h.which=a.which,h.pageX=a.pageX,h.pageY=a.pageY,e.target.trigger(h,f)}}function u(a){var b;if(a=Math.abs(a),a>=10)b="%d";else if(a>1)b=a===parseInt(a,10)?"%d":"%.1f";else{var c=-Math.floor(Math.log(a)/Math.LN10);b="%."+c+"f"}return b}function v(b,c,d){for(var e,f,g,h,i,j,k,l=Math.floor(d/2),m=Math.ceil(1.5*d),n=Number.MAX_VALUE,o=c-b,p=a.jqplot.getSignificantFigures,q=0,r=m-l+1;r>q;q++)j=l+q,e=o/(j-1),f=p(e),e=Math.abs(d-j)+f.digitsRight,n>e?(n=e,g=j,k=f.digitsRight):e===n&&f.digitsRight<k&&(g=j,k=f.digitsRight);return h=Math.max(k,Math.max(p(b).digitsRight,p(c).digitsRight)),i=0===h?"%d":"%."+h+"f",e=o/(g-1),[b,c,g,i,e]}function w(a,b){b=b||7;var c,d=a/(b-1),e=Math.pow(10,Math.floor(Math.log(d)/Math.LN10)),f=d/e;return c=1>e?f>5?10*e:f>2?5*e:f>1?2*e:e:f>5?10*e:f>4?5*e:f>3?4*e:f>2?3*e:f>1?2*e:e}function x(a,b){b=b||1;var c,d=Math.floor(Math.log(a)/Math.LN10),e=Math.pow(10,d),f=a/e;return f/=b,c=.38>=f?.1:1.6>=f?.2:4>=f?.5:8>=f?1:16>=f?2:5,c*e}function y(a,b){var c,d,e=Math.floor(Math.log(a)/Math.LN10),f=Math.pow(10,e),g=a/f;return g/=b,d=.38>=g?.1:1.6>=g?.2:4>=g?.5:8>=g?1:16>=g?2:5,c=d*f,[c,d,f]}function z(a,b){return a-b}function A(a){if(null==a||"object"!=typeof a)return a;var b=new a.constructor;for(var c in a)b[c]=A(a[c]);return b}function B(a,b){if(null!=b&&"object"==typeof b)for(var c in b)"highlightColors"==c&&(a[c]=A(b[c])),null!=b[c]&&"object"==typeof b[c]?(a.hasOwnProperty(c)||(a[c]={}),B(a[c],b[c])):a[c]=b[c]}function C(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;d>c;c++)if(b[c]===a)return c;return-1}function D(a){return null===a?"[object Null]":Object.prototype.toString.call(a)}function E(b,c,d,e){return a.isPlainObject(b)?b:(b={effect:b},c===F&&(c={}),a.isFunction(c)&&(e=c,d=null,c={}),("number"===a.type(c)||a.fx.speeds[c])&&(e=d,d=c,c={}),a.isFunction(d)&&(e=d,d=null),c&&a.extend(b,c),d=d||c.duration,b.duration=a.fx.off?0:"number"==typeof d?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,b.complete=e||c.complete,b)}var F;a.fn.emptyForce=function(){for(var b,c=0;null!=(b=a(this)[c]);c++){if(1===b.nodeType&&a.cleanData(b.getElementsByTagName("*")),a.jqplot.use_excanvas)b.outerHTML="";else for(;b.firstChild;)b.removeChild(b.firstChild);b=null}return a(this)},a.fn.removeChildForce=function(a){for(;a.firstChild;)this.removeChildForce(a.firstChild),a.removeChild(a.firstChild)},a.fn.jqplot=function(){for(var b=[],c=[],d=0,e=arguments.length;e>d;d++)a.isArray(arguments[d])?b.push(arguments[d]):a.isPlainObject(arguments[d])&&c.push(arguments[d]);return this.each(function(d){var e,f,g,h,i=a(this),j=b.length,k=c.length;g=j>d?b[d]:j?b[j-1]:null,h=k>d?c[d]:k?c[k-1]:null,e=i.attr("id"),e===F&&(e="jqplot_target_"+a.jqplot.targetCounter++,i.attr("id",e)),f=a.jqplot(e,g,h),i.data("jqplot",f)})},a.jqplot=function(b,c,d){var e=null,f=null;3===arguments.length?(e=c,f=d):2===arguments.length&&(a.isArray(c)?e=c:a.isPlainObject(c)&&(f=c)),null===e&&null!==f&&f.data&&(e=f.data);var h=new g;if(a("#"+b).removeClass("jqplot-error"),!a.jqplot.config.catchErrors)return h.init(b,e,f),h.draw(),h.themeEngine.init.call(h),h;try{return h.init(b,e,f),h.draw(),h.themeEngine.init.call(h),h}catch(i){var j=a.jqplot.config.errorMessage||i.message;a("#"+b).append('<div class="jqplot-error-message">'+j+"</div>"),a("#"+b).addClass("jqplot-error"),document.getElementById(b).style.background=a.jqplot.config.errorBackground,document.getElementById(b).style.border=a.jqplot.config.errorBorder,document.getElementById(b).style.fontFamily=a.jqplot.config.errorFontFamily,document.getElementById(b).style.fontSize=a.jqplot.config.errorFontSize,document.getElementById(b).style.fontStyle=a.jqplot.config.errorFontStyle,document.getElementById(b).style.fontWeight=a.jqplot.config.errorFontWeight}},a.jqplot.version="1.0.9",a.jqplot.revision="d96a669",a.jqplot.targetCounter=1,a.jqplot.CanvasManager=function(){"undefined"==typeof a.jqplot.CanvasManager.canvases&&(a.jqplot.CanvasManager.canvases=[],a.jqplot.CanvasManager.free=[]);var b=[];this.getCanvas=function(){var c,d=!0;if(!a.jqplot.use_excanvas)for(var e=0,f=a.jqplot.CanvasManager.canvases.length;f>e;e++)if(a.jqplot.CanvasManager.free[e]===!0){d=!1,c=a.jqplot.CanvasManager.canvases[e],a.jqplot.CanvasManager.free[e]=!1,b.push(e);break}return d&&(c=document.createElement("canvas"),b.push(a.jqplot.CanvasManager.canvases.length),a.jqplot.CanvasManager.canvases.push(c),a.jqplot.CanvasManager.free.push(!1)),c},this.initCanvas=function(b){if(a.jqplot.use_excanvas)return window.G_vmlCanvasManager.initElement(b);var c=b.getContext("2d"),d=1;window.devicePixelRatio>1&&(c.webkitBackingStorePixelRatio===F||c.webkitBackingStorePixelRatio<2)&&(d=window.devicePixelRatio);var e=b.width,f=b.height;return b.width=d*b.width,b.height=d*b.height,b.style.width=e+"px",b.style.height=f+"px",c.save(),c.scale(d,d),b},this.freeAllCanvases=function(){for(var a=0,c=b.length;c>a;a++)this.freeCanvas(b[a]);b=[]},this.freeCanvas=function(b){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==F)window.G_vmlCanvasManager.uninitElement(a.jqplot.CanvasManager.canvases[b]),a.jqplot.CanvasManager.canvases[b]=null;else{var c=a.jqplot.CanvasManager.canvases[b];c.getContext("2d").clearRect(0,0,c.width,c.height),a(c).unbind().removeAttr("class").removeAttr("style"),a(c).css({left:"",top:"",position:""}),c.width=0,c.height=0,a.jqplot.CanvasManager.free[b]=!0}}},a.jqplot.log=function(){window.console&&window.console.log.apply(window.console,arguments)},a.jqplot.config={addDomReference:!1,enablePlugins:!1,defaultHeight:300,defaultWidth:400,UTCAdjust:!1,timezoneOffset:new Date(6e4*(new Date).getTimezoneOffset()),errorMessage:"",errorBackground:"",errorBorder:"",errorFontFamily:"",errorFontSize:"",errorFontStyle:"",errorFontWeight:"",catchErrors:!1,defaultTickFormatString:"%.1f",defaultColors:["#4bb2c5","#EAA228","#c5b47f","#579575","#839557","#958c12","#953579","#4b5de4","#d8b83f","#ff5800","#0085cc","#c747a3","#cddf54","#FBD178","#26B4E3","#bd70c7"],defaultNegativeColors:["#498991","#C08840","#9F9274","#546D61","#646C4A","#6F6621","#6E3F5F","#4F64B0","#A89050","#C45923","#187399","#945381","#959E5C","#C7AF7B","#478396","#907294"],dashLength:4,gapLength:4,dotGapLength:2.5,srcLocation:"jqplot/src/",pluginLocation:"jqplot/src/plugins/"},a.jqplot.arrayMax=function(a){return Math.max.apply(Math,a)},a.jqplot.arrayMin=function(a){return Math.min.apply(Math,a)},a.jqplot.enablePlugins=a.jqplot.config.enablePlugins,a.jqplot.support_canvas=function(){return"undefined"==typeof a.jqplot.support_canvas.result&&(a.jqplot.support_canvas.result=!!document.createElement("canvas").getContext),a.jqplot.support_canvas.result},a.jqplot.support_canvas_text=function(){return"undefined"==typeof a.jqplot.support_canvas_text.result&&(window.G_vmlCanvasManager!==F&&window.G_vmlCanvasManager._version>887?a.jqplot.support_canvas_text.result=!0:a.jqplot.support_canvas_text.result=!(!document.createElement("canvas").getContext||"function"!=typeof document.createElement("canvas").getContext("2d").fillText)),a.jqplot.support_canvas_text.result},a.jqplot.use_excanvas=a.support.boxModel&&a.support.objectAll&&$support.leadingWhitespace||a.jqplot.support_canvas()?!1:!0,a.jqplot.preInitHooks=[],a.jqplot.postInitHooks=[],a.jqplot.preParseOptionsHooks=[],a.jqplot.postParseOptionsHooks=[],a.jqplot.preDrawHooks=[],a.jqplot.postDrawHooks=[],a.jqplot.preDrawSeriesHooks=[],a.jqplot.postDrawSeriesHooks=[],a.jqplot.preDrawLegendHooks=[],a.jqplot.addLegendRowHooks=[],a.jqplot.preSeriesInitHooks=[],a.jqplot.postSeriesInitHooks=[],a.jqplot.preParseSeriesOptionsHooks=[],a.jqplot.postParseSeriesOptionsHooks=[],a.jqplot.eventListenerHooks=[],a.jqplot.preDrawSeriesShadowHooks=[],a.jqplot.postDrawSeriesShadowHooks=[],a.jqplot.ElemContainer=function(){this._elem,this._plotWidth,this._plotHeight,this._plotDimensions={height:null,width:null}},a.jqplot.ElemContainer.prototype.createElement=function(b,c,d,e,f){this._offsets=c;var g=d||"jqplot",h=document.createElement(b);return this._elem=a(h),this._elem.addClass(g),this._elem.css(e),this._elem.attr(f),h=null,this._elem},a.jqplot.ElemContainer.prototype.getWidth=function(){return this._elem?this._elem.outerWidth(!0):null},a.jqplot.ElemContainer.prototype.getHeight=function(){return this._elem?this._elem.outerHeight(!0):null},a.jqplot.ElemContainer.prototype.getPosition=function(){return this._elem?this._elem.position():{top:null,left:null,bottom:null,right:null}},a.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top},a.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left},a.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")},a.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")},b.prototype=new a.jqplot.ElemContainer,b.prototype.constructor=b,b.prototype.init=function(){a.isFunction(this.renderer)&&(this.renderer=new this.renderer),this.tickOptions.axis=this.name,null==this.tickOptions.showMark&&(this.tickOptions.showMark=this.showTicks),null==this.tickOptions.showMark&&(this.tickOptions.showMark=this.showTickMarks),null==this.tickOptions.showLabel&&(this.tickOptions.showLabel=this.showTicks),null==this.label||""==this.label?this.showLabel=!1:this.labelOptions.label=this.label,0==this.showLabel&&(this.labelOptions.show=!1),0==this.pad&&(this.pad=1),0==this.padMax&&(this.padMax=1),0==this.padMin&&(this.padMin=1),null==this.padMax&&(this.padMax=(this.pad-1)/2+1),null==this.padMin&&(this.padMin=(this.pad-1)/2+1),this.pad=this.padMax+this.padMin-1,(null!=this.min||null!=this.max)&&(this.autoscale=!1),null==this.syncTicks&&this.name.indexOf("y")>-1?this.syncTicks=!0:null==this.syncTicks&&(this.syncTicks=!1),this.renderer.init.call(this,this.rendererOptions)},b.prototype.draw=function(a,b){return this.__ticks&&(this.__ticks=null),this.renderer.draw.call(this,a,b)},b.prototype.set=function(){this.renderer.set.call(this)},b.prototype.pack=function(a,b){this.show&&this.renderer.pack.call(this,a,b),null==this._min&&(this._min=this.min,this._max=this.max,this._tickInterval=this.tickInterval,this._numberTicks=this.numberTicks,this.__ticks=this._ticks)},b.prototype.reset=function(){this.renderer.reset.call(this)},b.prototype.resetScale=function(b){a.extend(!0,this,{min:null,max:null,numberTicks:null,tickInterval:null,_ticks:[],ticks:[]},b),this.resetDataBounds()},b.prototype.resetDataBounds=function(){var b=this._dataBounds;b.min=null,b.max=null;for(var c,d,e,f=this.show?!0:!1,g=0;g<this._series.length;g++)if(d=this._series[g],d.show||this.scaleToHiddenSeries){e=d._plotData,"line"===d._type&&d.renderer.bands.show&&"x"!==this.name.charAt(0)&&(e=[[0,d.renderer.bands._min],[1,d.renderer.bands._max]]);var h=1,i=1;null!=d._type&&"ohlc"==d._type&&(h=3,i=2);for(var j=0,c=e.length;c>j;j++)"xaxis"==this.name||"x2axis"==this.name?((null!=e[j][0]&&e[j][0]<b.min||null==b.min)&&(b.min=e[j][0]),(null!=e[j][0]&&e[j][0]>b.max||null==b.max)&&(b.max=e[j][0])):((null!=e[j][h]&&e[j][h]<b.min||null==b.min)&&(b.min=e[j][h]),(null!=e[j][i]&&e[j][i]>b.max||null==b.max)&&(b.max=e[j][i]));f&&d.renderer.constructor!==a.jqplot.BarRenderer?f=!1:f&&this._options.hasOwnProperty("forceTickAt0")&&0==this._options.forceTickAt0?f=!1:f&&d.renderer.constructor===a.jqplot.BarRenderer&&("vertical"==d.barDirection&&"xaxis"!=this.name&&"x2axis"!=this.name?(null!=this._options.pad||null!=this._options.padMin)&&(f=!1):"horizontal"!=d.barDirection||"xaxis"!=this.name&&"x2axis"!=this.name||(null!=this._options.pad||null!=this._options.padMin)&&(f=!1))}f&&this.renderer.constructor===a.jqplot.LinearAxisRenderer&&b.min>=0&&(this.padMin=1,this.forceTickAt0=!0)},c.prototype=new a.jqplot.ElemContainer,c.prototype.constructor=c,c.prototype.setOptions=function(b){if(a.extend(!0,this,b),"inside"==this.placement&&(this.placement="insideGrid"),this.xoffset>0){if("insideGrid"==this.placement)switch(this.location){case"nw":case"w":case"sw":null==this.marginLeft&&(this.marginLeft=this.xoffset+"px"),this.marginRight="0px";break;case"ne":case"e":case"se":default:null==this.marginRight&&(this.marginRight=this.xoffset+"px"),this.marginLeft="0px"}else if("outside"==this.placement)switch(this.location){case"nw":case"w":case"sw":null==this.marginRight&&(this.marginRight=this.xoffset+"px"),this.marginLeft="0px";break;case"ne":case"e":case"se":default:null==this.marginLeft&&(this.marginLeft=this.xoffset+"px"),this.marginRight="0px"}this.xoffset=0}if(this.yoffset>0){if("outside"==this.placement)switch(this.location){case"sw":case"s":case"se":null==this.marginTop&&(this.marginTop=this.yoffset+"px"),this.marginBottom="0px";break;case"ne":case"n":case"nw":default:null==this.marginBottom&&(this.marginBottom=this.yoffset+"px"),this.marginTop="0px"}else if("insideGrid"==this.placement)switch(this.location){case"sw":case"s":case"se":null==this.marginBottom&&(this.marginBottom=this.yoffset+"px"),this.marginTop="0px";break;case"ne":case"n":case"nw":default:null==this.marginTop&&(this.marginTop=this.yoffset+"px"),this.marginBottom="0px"}this.yoffset=0}},c.prototype.init=function(){a.isFunction(this.renderer)&&(this.renderer=new this.renderer),this.renderer.init.call(this,this.rendererOptions)},c.prototype.draw=function(b,c){for(var d=0;d<a.jqplot.preDrawLegendHooks.length;d++)a.jqplot.preDrawLegendHooks[d].call(this,b);return this.renderer.draw.call(this,b,c)},c.prototype.pack=function(a){this.renderer.pack.call(this,a)},d.prototype=new a.jqplot.ElemContainer,d.prototype.constructor=d,d.prototype.init=function(){a.isFunction(this.renderer)&&(this.renderer=new this.renderer),this.renderer.init.call(this,this.rendererOptions)},d.prototype.draw=function(a){return this.renderer.draw.call(this,a)},d.prototype.pack=function(){this.renderer.pack.call(this)},e.prototype=new a.jqplot.ElemContainer,e.prototype.constructor=e,e.prototype.init=function(b,c,d){this.index=b,this.gridBorderWidth=c;var e,f,g=this.data,h=[];for(e=0,f=g.length;f>e;e++)if(this.breakOnNull)h.push(g[e]);else{if(null==g[e]||null==g[e][0]||null==g[e][1])continue;h.push(g[e])}if(this.data=h,this.color||(this.color=d.colorGenerator.get(this.index)),this.negativeColor||(this.negativeColor=d.negativeColorGenerator.get(this.index)),this.fillColor||(this.fillColor=this.color),this.fillAlpha){var i=a.jqplot.normalize2rgb(this.fillColor),i=a.jqplot.getColorComponents(i);this.fillColor="rgba("+i[0]+","+i[1]+","+i[2]+","+this.fillAlpha+")"}a.isFunction(this.renderer)&&(this.renderer=new this.renderer),this.renderer.init.call(this,this.rendererOptions,d),this.markerRenderer=new this.markerRenderer,this.markerOptions.color||(this.markerOptions.color=this.color),null==this.markerOptions.show&&(this.markerOptions.show=this.showMarker),this.showMarker=this.markerOptions.show,this.markerRenderer.init(this.markerOptions)},e.prototype.draw=function(b,c,d){var e=c==F?{}:c;b=b==F?this.canvas._ctx:b;var f,g,h;for(f=0;f<a.jqplot.preDrawSeriesHooks.length;f++)a.jqplot.preDrawSeriesHooks[f].call(this,b,e);for(this.show&&(this.renderer.setGridData.call(this,d),e.preventJqPlotSeriesDrawTrigger||a(b.canvas).trigger("jqplotSeriesDraw",[this.data,this.gridData]),g=[],g=e.data?e.data:this._stack?this._plotData:this.data,h=e.gridData||this.renderer.makeGridData.call(this,g,d),"line"===this._type&&this.renderer.smooth&&this.renderer._smoothedData.length&&(h=this.renderer._smoothedData),this.renderer.draw.call(this,b,h,e,d)),f=0;f<a.jqplot.postDrawSeriesHooks.length;f++)a.jqplot.postDrawSeriesHooks[f].call(this,b,e,d);b=c=d=f=g=h=null},e.prototype.drawShadow=function(b,c,d){var e=c==F?{}:c;b=b==F?this.shadowCanvas._ctx:b;var f,g,h;for(f=0;f<a.jqplot.preDrawSeriesShadowHooks.length;f++)a.jqplot.preDrawSeriesShadowHooks[f].call(this,b,e);for(this.shadow&&(this.renderer.setGridData.call(this,d),g=[],g=e.data?e.data:this._stack?this._plotData:this.data,h=e.gridData||this.renderer.makeGridData.call(this,g,d),this.renderer.drawShadow.call(this,b,h,e,d)),f=0;f<a.jqplot.postDrawSeriesShadowHooks.length;f++)a.jqplot.postDrawSeriesShadowHooks[f].call(this,b,e);b=c=d=f=g=h=null},e.prototype.toggleDisplay=function(a,b){var c,d;c=a.data.series?a.data.series:this,a.data.speed&&(d=a.data.speed),d?c.canvas._elem.is(":hidden")||!c.show?(c.show=!0,c.canvas._elem.removeClass("jqplot-series-hidden"),c.shadowCanvas._elem&&c.shadowCanvas._elem.fadeIn(d),c.canvas._elem.fadeIn(d,b),c.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+c.index).fadeIn(d)):(c.show=!1,c.canvas._elem.addClass("jqplot-series-hidden"),c.shadowCanvas._elem&&c.shadowCanvas._elem.fadeOut(d),c.canvas._elem.fadeOut(d,b),c.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+c.index).fadeOut(d)):c.canvas._elem.is(":hidden")||!c.show?(c.show=!0,c.canvas._elem.removeClass("jqplot-series-hidden"),c.shadowCanvas._elem&&c.shadowCanvas._elem.show(),c.canvas._elem.show(0,b),c.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+c.index).show()):(c.show=!1,c.canvas._elem.addClass("jqplot-series-hidden"),c.shadowCanvas._elem&&c.shadowCanvas._elem.hide(),c.canvas._elem.hide(0,b),c.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+c.index).hide())},f.prototype=new a.jqplot.ElemContainer,f.prototype.constructor=f,f.prototype.init=function(){a.isFunction(this.renderer)&&(this.renderer=new this.renderer),this.renderer.init.call(this,this.rendererOptions)},f.prototype.createElement=function(a,b){return this._offsets=a,this.renderer.createElement.call(this,b)},f.prototype.draw=function(){this.renderer.draw.call(this)},a.jqplot.GenericCanvas=function(){a.jqplot.ElemContainer.call(this),this._ctx},a.jqplot.GenericCanvas.prototype=new a.jqplot.ElemContainer,a.jqplot.GenericCanvas.prototype.constructor=a.jqplot.GenericCanvas,a.jqplot.GenericCanvas.prototype.createElement=function(b,c,d,e){this._offsets=b;var f="jqplot";c!=F&&(f=c);var g;return g=e.canvasManager.getCanvas(),null!=d&&(this._plotDimensions=d),g.width=this._plotDimensions.width-this._offsets.left-this._offsets.right,g.height=this._plotDimensions.height-this._offsets.top-this._offsets.bottom,this._elem=a(g),this._elem.css({position:"absolute",left:this._offsets.left,top:this._offsets.top}),this._elem.addClass(f),g=e.canvasManager.initCanvas(g),g=null,this._elem},a.jqplot.GenericCanvas.prototype.setContext=function(){return this._ctx=this._elem.get(0).getContext("2d"),this._ctx;
6
- },a.jqplot.GenericCanvas.prototype.resetCanvas=function(){this._elem&&(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==F&&window.G_vmlCanvasManager.uninitElement(this._elem.get(0)),this._elem.emptyForce()),this._ctx=null},a.jqplot.HooksManager=function(){this.hooks=[],this.args=[]},a.jqplot.HooksManager.prototype.addOnce=function(a,b){b=b||[];for(var c=!1,d=0,e=this.hooks.length;e>d;d++)this.hooks[d]==a&&(c=!0);c||(this.hooks.push(a),this.args.push(b))},a.jqplot.HooksManager.prototype.add=function(a,b){b=b||[],this.hooks.push(a),this.args.push(b)},a.jqplot.EventListenerManager=function(){this.hooks=[]},a.jqplot.EventListenerManager.prototype.addOnce=function(a,b){for(var c,d,e=!1,d=0,f=this.hooks.length;f>d;d++)c=this.hooks[d],c[0]==a&&c[1]==b&&(e=!0);e||this.hooks.push([a,b])},a.jqplot.EventListenerManager.prototype.add=function(a,b){this.hooks.push([a,b])};var G=["yMidAxis","xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];a.jqplot.computeHighlightColors=function(b){var c;if(a.isArray(b)){c=[];for(var d=0;d<b.length;d++){for(var e=a.jqplot.getColorComponents(b[d]),f=[e[0],e[1],e[2]],g=f[0]+f[1]+f[2],h=0;3>h;h++)f[h]=g>660?.85*f[h]:.73*f[h]+90,f[h]=parseInt(f[h],10),f[h]>255?255:f[h];f[3]=.3+.35*e[3],c.push("rgba("+f[0]+","+f[1]+","+f[2]+","+f[3]+")")}}else{for(var e=a.jqplot.getColorComponents(b),f=[e[0],e[1],e[2]],g=f[0]+f[1]+f[2],h=0;3>h;h++)f[h]=g>660?.85*f[h]:.73*f[h]+90,f[h]=parseInt(f[h],10),f[h]>255?255:f[h];f[3]=.3+.35*e[3],c="rgba("+f[0]+","+f[1]+","+f[2]+","+f[3]+")"}return c},a.jqplot.ColorGenerator=function(b){b=b||a.jqplot.config.defaultColors;var c=0;this.next=function(){return c<b.length?b[c++]:(c=0,b[c++])},this.previous=function(){return c>0?b[c--]:(c=b.length-1,b[c])},this.get=function(a){var c=a-b.length*Math.floor(a/b.length);return b[c]},this.setColors=function(a){b=a},this.reset=function(){c=0},this.getIndex=function(){return c},this.setIndex=function(a){c=a}},a.jqplot.hex2rgb=function(a,b){a=a.replace("#",""),3==a.length&&(a=a.charAt(0)+a.charAt(0)+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2));var c;return c="rgba("+parseInt(a.slice(0,2),16)+", "+parseInt(a.slice(2,4),16)+", "+parseInt(a.slice(4,6),16),b&&(c+=", "+b),c+=")"},a.jqplot.rgb2hex=function(a){for(var b=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/,c=a.match(b),d="#",e=1;4>e;e++){var f;-1!=c[e].search(/%/)?(f=parseInt(255*c[e]/100,10).toString(16),1==f.length&&(f="0"+f)):(f=parseInt(c[e],10).toString(16),1==f.length&&(f="0"+f)),d+=f}return d},a.jqplot.normalize2rgb=function(b,c){if(-1!=b.search(/^ *rgba?\(/))return b;if(-1!=b.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/))return a.jqplot.hex2rgb(b,c);throw new Error("Invalid color spec")},a.jqplot.getColorComponents=function(b){b=a.jqplot.colorKeywordMap[b]||b;for(var c=a.jqplot.normalize2rgb(b),d=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/,e=c.match(d),f=[],g=1;4>g;g++)-1!=e[g].search(/%/)?f[g-1]=parseInt(255*e[g]/100,10):f[g-1]=parseInt(e[g],10);return f[3]=parseFloat(e[4])?parseFloat(e[4]):1,f},a.jqplot.colorKeywordMap={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb( 0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb( 0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb( 0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb( 95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(220, 20, 60)",cyan:"rgb( 0, 255, 255)",darkblue:"rgb( 0, 0, 139)",darkcyan:"rgb( 0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgreen:"rgb( 0, 100, 0)",darkgrey:"rgb(169, 169, 169)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb( 85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb( 72, 61, 139)",darkslategray:"rgb( 47, 79, 79)",darkslategrey:"rgb( 47, 79, 79)",darkturquoise:"rgb( 0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb( 0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb( 30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb( 34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb( 0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb( 75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgray:"rgb(211, 211, 211)",lightgreen:"rgb(144, 238, 144)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb( 32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb( 0, 255, 0)",limegreen:"rgb( 50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb( 0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb( 60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb( 0, 250, 154)",mediumturquoise:"rgb( 72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb( 25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb( 0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb( 65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb( 46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb( 0, 255, 127)",steelblue:"rgb( 70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb( 0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb( 64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)"},a.jqplot.AxisLabelRenderer=function(b){a.jqplot.ElemContainer.call(this),this.axis,this.show=!0,this.label="",this.fontFamily=null,this.fontSize=null,this.textColor=null,this._elem,this.escapeHTML=!1,a.extend(!0,this,b)},a.jqplot.AxisLabelRenderer.prototype=new a.jqplot.ElemContainer,a.jqplot.AxisLabelRenderer.prototype.constructor=a.jqplot.AxisLabelRenderer,a.jqplot.AxisLabelRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.AxisLabelRenderer.prototype.draw=function(b,c){return this._elem&&(this._elem.emptyForce(),this._elem=null),this._elem=a('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>'),Number(this.label)&&this._elem.css("white-space","nowrap"),this.escapeHTML?this._elem.text(this.label):this._elem.html(this.label),this.fontFamily&&this._elem.css("font-family",this.fontFamily),this.fontSize&&this._elem.css("font-size",this.fontSize),this.textColor&&this._elem.css("color",this.textColor),this._elem},a.jqplot.AxisLabelRenderer.prototype.pack=function(){},a.jqplot.AxisTickRenderer=function(b){a.jqplot.ElemContainer.call(this),this.mark="outside",this.axis,this.showMark=!0,this.showGridline=!0,this.isMinorTick=!1,this.size=4,this.markSize=6,this.show=!0,this.showLabel=!0,this.label=null,this.value=null,this._styles={},this.formatter=a.jqplot.DefaultTickFormatter,this.prefix="",this.suffix="",this.formatString="",this.fontFamily,this.fontSize,this.textColor,this.escapeHTML=!1,this._elem,this._breakTick=!1,a.extend(!0,this,b)},a.jqplot.AxisTickRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.AxisTickRenderer.prototype=new a.jqplot.ElemContainer,a.jqplot.AxisTickRenderer.prototype.constructor=a.jqplot.AxisTickRenderer,a.jqplot.AxisTickRenderer.prototype.setTick=function(a,b,c){return this.value=a,this.axis=b,c&&(this.isMinorTick=!0),this},a.jqplot.AxisTickRenderer.prototype.draw=function(){null===this.label&&(this.label=this.prefix+this.formatter(this.formatString,this.value)+this.suffix);var b={position:"absolute"};Number(this.label)&&(b.whitSpace="nowrap"),this._elem&&(this._elem.emptyForce(),this._elem=null),this._elem=a(document.createElement("div")),this._elem.addClass("jqplot-"+this.axis+"-tick"),this.escapeHTML?this._elem.text(this.label):this._elem.html(this.label),this._elem.css(b);for(var c in this._styles)this._elem.css(c,this._styles[c]);return this.fontFamily&&this._elem.css("font-family",this.fontFamily),this.fontSize&&this._elem.css("font-size",this.fontSize),this.textColor&&this._elem.css("color",this.textColor),this._breakTick&&this._elem.addClass("jqplot-breakTick"),this._elem},a.jqplot.DefaultTickFormatter=function(b,c){return"number"==typeof c?(b||(b=a.jqplot.config.defaultTickFormatString),a.jqplot.sprintf(b,c)):String(c)},a.jqplot.PercentTickFormatter=function(b,c){return"number"==typeof c?(c=100*c,b||(b=a.jqplot.config.defaultTickFormatString),a.jqplot.sprintf(b,c)):String(c)},a.jqplot.AxisTickRenderer.prototype.pack=function(){},a.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new a.jqplot.ShadowRenderer},a.jqplot.CanvasGridRenderer.prototype.init=function(b){this._ctx,a.extend(!0,this,b);var c={lineJoin:"miter",lineCap:"round",fill:!1,isarc:!1,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:!1,strokeStyle:this.shadowColor};this.renderer.shadowRenderer.init(c)},a.jqplot.CanvasGridRenderer.prototype.createElement=function(b){var c;this._elem&&(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==F&&(c=this._elem.get(0),window.G_vmlCanvasManager.uninitElement(c),c=null),this._elem.emptyForce(),this._elem=null),c=b.canvasManager.getCanvas();var d=this._plotDimensions.width,e=this._plotDimensions.height;return c.width=d,c.height=e,this._elem=a(c),this._elem.addClass("jqplot-grid-canvas"),this._elem.css({position:"absolute",left:0,top:0}),c=b.canvasManager.initCanvas(c),this._top=this._offsets.top,this._bottom=e-this._offsets.bottom,this._left=this._offsets.left,this._right=d-this._offsets.right,this._width=this._right-this._left,this._height=this._bottom-this._top,c=null,this._elem},a.jqplot.CanvasGridRenderer.prototype.draw=function(){function b(b,d,e,f,g){c.save(),g=g||{},(null==g.lineWidth||0!=g.lineWidth)&&(a.extend(!0,c,g),c.beginPath(),c.moveTo(b,d),c.lineTo(e,f),c.stroke(),c.restore())}this._ctx=this._elem.get(0).getContext("2d");var c=this._ctx,d=this._axes;c.save(),c.clearRect(0,0,this._plotDimensions.width,this._plotDimensions.height),c.fillStyle=this.backgroundColor||this.background,c.fillRect(this._left,this._top,this._width,this._height),c.save(),c.lineJoin="miter",c.lineCap="butt",c.lineWidth=this.gridLineWidth,c.strokeStyle=this.gridLineColor;for(var e,f,g,h,i=["xaxis","yaxis","x2axis","y2axis"],j=4;j>0;j--){var k=i[j-1],l=d[k],m=l._ticks,n=m.length;if(l.show){if(l.drawBaseline){var o={};switch(null!==l.baselineWidth&&(o.lineWidth=l.baselineWidth),null!==l.baselineColor&&(o.strokeStyle=l.baselineColor),k){case"xaxis":b(this._left,this._bottom,this._right,this._bottom,o);break;case"yaxis":b(this._left,this._bottom,this._left,this._top,o);break;case"x2axis":b(this._left,this._bottom,this._right,this._bottom,o);break;case"y2axis":b(this._right,this._bottom,this._right,this._top,o)}}for(var p=n;p>0;p--){var q=m[p-1];if(q.show){var r=Math.round(l.u2p(q.value))+.5;switch(k){case"xaxis":if(q.showGridline&&this.drawGridlines&&(!q.isMinorTick&&l.drawMajorGridlines||q.isMinorTick&&l.drawMinorGridlines)&&b(r,this._top,r,this._bottom),q.showMark&&q.mark&&(!q.isMinorTick&&l.drawMajorTickMarks||q.isMinorTick&&l.drawMinorTickMarks)){g=q.markSize,h=q.mark;var r=Math.round(l.u2p(q.value))+.5;switch(h){case"outside":e=this._bottom,f=this._bottom+g;break;case"inside":e=this._bottom-g,f=this._bottom;break;case"cross":e=this._bottom-g,f=this._bottom+g;break;default:e=this._bottom,f=this._bottom+g}this.shadow&&this.renderer.shadowRenderer.draw(c,[[r,e],[r,f]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:.75*this.gridLineWidth,depth:2,fill:!1,closePath:!1}),b(r,e,r,f)}break;case"yaxis":if(q.showGridline&&this.drawGridlines&&(!q.isMinorTick&&l.drawMajorGridlines||q.isMinorTick&&l.drawMinorGridlines)&&b(this._right,r,this._left,r),q.showMark&&q.mark&&(!q.isMinorTick&&l.drawMajorTickMarks||q.isMinorTick&&l.drawMinorTickMarks)){g=q.markSize,h=q.mark;var r=Math.round(l.u2p(q.value))+.5;switch(h){case"outside":e=this._left-g,f=this._left;break;case"inside":e=this._left,f=this._left+g;break;case"cross":e=this._left-g,f=this._left+g;break;default:e=this._left-g,f=this._left}this.shadow&&this.renderer.shadowRenderer.draw(c,[[e,r],[f,r]],{lineCap:"butt",lineWidth:1.5*this.gridLineWidth,offset:.75*this.gridLineWidth,fill:!1,closePath:!1}),b(e,r,f,r,{strokeStyle:l.borderColor})}break;case"x2axis":if(q.showGridline&&this.drawGridlines&&(!q.isMinorTick&&l.drawMajorGridlines||q.isMinorTick&&l.drawMinorGridlines)&&b(r,this._bottom,r,this._top),q.showMark&&q.mark&&(!q.isMinorTick&&l.drawMajorTickMarks||q.isMinorTick&&l.drawMinorTickMarks)){g=q.markSize,h=q.mark;var r=Math.round(l.u2p(q.value))+.5;switch(h){case"outside":e=this._top-g,f=this._top;break;case"inside":e=this._top,f=this._top+g;break;case"cross":e=this._top-g,f=this._top+g;break;default:e=this._top-g,f=this._top}this.shadow&&this.renderer.shadowRenderer.draw(c,[[r,e],[r,f]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:.75*this.gridLineWidth,depth:2,fill:!1,closePath:!1}),b(r,e,r,f)}break;case"y2axis":if(q.showGridline&&this.drawGridlines&&(!q.isMinorTick&&l.drawMajorGridlines||q.isMinorTick&&l.drawMinorGridlines)&&b(this._left,r,this._right,r),q.showMark&&q.mark&&(!q.isMinorTick&&l.drawMajorTickMarks||q.isMinorTick&&l.drawMinorTickMarks)){g=q.markSize,h=q.mark;var r=Math.round(l.u2p(q.value))+.5;switch(h){case"outside":e=this._right,f=this._right+g;break;case"inside":e=this._right-g,f=this._right;break;case"cross":e=this._right-g,f=this._right+g;break;default:e=this._right,f=this._right+g}this.shadow&&this.renderer.shadowRenderer.draw(c,[[e,r],[f,r]],{lineCap:"butt",lineWidth:1.5*this.gridLineWidth,offset:.75*this.gridLineWidth,fill:!1,closePath:!1}),b(e,r,f,r,{strokeStyle:l.borderColor})}}}}q=null}l=null,m=null}i=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];for(var j=7;j>0;j--){var l=d[i[j-1]],m=l._ticks;if(l.show){var s=m[l.numberTicks-1],t=m[0],u=l.getLeft(),v=[[u,s.getTop()+s.getHeight()/2],[u,t.getTop()+t.getHeight()/2+1]];this.shadow&&this.renderer.shadowRenderer.draw(c,v,{lineCap:"butt",fill:!1,closePath:!1}),b(v[0][0],v[0][1],v[1][0],v[1][1],{lineCap:"butt",strokeStyle:l.borderColor,lineWidth:l.borderWidth});for(var p=m.length;p>0;p--){var q=m[p-1];g=q.markSize,h=q.mark;var r=Math.round(l.u2p(q.value))+.5;if(q.showMark&&q.mark){switch(h){case"outside":e=u,f=u+g;break;case"inside":e=u-g,f=u;break;case"cross":e=u-g,f=u+g;break;default:e=u,f=u+g}v=[[e,r],[f,r]],this.shadow&&this.renderer.shadowRenderer.draw(c,v,{lineCap:"butt",lineWidth:1.5*this.gridLineWidth,offset:.75*this.gridLineWidth,fill:!1,closePath:!1}),b(e,r,f,r,{strokeStyle:l.borderColor})}q=null}t=null}l=null,m=null}if(c.restore(),this.shadow){var v=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(c,v)}0!=this.borderWidth&&this.drawBorder&&(b(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:d.x2axis.borderColor,lineWidth:d.x2axis.borderWidth}),b(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:d.y2axis.borderColor,lineWidth:d.y2axis.borderWidth}),b(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:d.xaxis.borderColor,lineWidth:d.xaxis.borderWidth}),b(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:d.yaxis.borderColor,lineWidth:d.yaxis.borderWidth})),c.restore(),c=null,d=null},a.jqplot.DivTitleRenderer=function(){},a.jqplot.DivTitleRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.DivTitleRenderer.prototype.draw=function(){this._elem&&(this._elem.emptyForce(),this._elem=null);var b=(this.renderer,document.createElement("div"));if(this._elem=a(b),this._elem.addClass("jqplot-title"),this.text){if(this.text){var c;this.color?c=this.color:this.textColor&&(c=this.textColor);var d={position:"absolute",top:"0px",left:"0px"};this._plotWidth&&(d.width=this._plotWidth+"px"),this.fontSize&&(d.fontSize=this.fontSize),"string"==typeof this.textAlign?d.textAlign=this.textAlign:d.textAlign="center",c&&(d.color=c),this.paddingBottom&&(d.paddingBottom=this.paddingBottom),this.fontFamily&&(d.fontFamily=this.fontFamily),this._elem.css(d),this.escapeHtml?this._elem.text(this.text):this._elem.html(this.text)}}else this.show=!1,this._elem.height(0),this._elem.width(0);return b=null,this._elem},a.jqplot.DivTitleRenderer.prototype.pack=function(){};var H=.1;a.jqplot.LinePattern=function(b,c){var d={dotted:[H,a.jqplot.config.dotGapLength],dashed:[a.jqplot.config.dashLength,a.jqplot.config.gapLength],solid:null};if("string"==typeof c)if("."===c[0]||"-"===c[0]){var e=c;c=[];for(var f=0,g=e.length;g>f;f++){if("."===e[f])c.push(H);else{if("-"!==e[f])continue;c.push(a.jqplot.config.dashLength)}c.push(a.jqplot.config.gapLength)}}else c=d[c];if(!c||!c.length)return b;var h=0,i=c[0],j=0,k=0,l=0,m=0,n=function(a,c){b.moveTo(a,c),j=a,k=c,l=a,m=c},o=function(a,d){var e=b.lineWidth,f=a-j,g=d-k,l=Math.sqrt(f*f+g*g);if(l>0&&e>0)for(f/=l,g/=l;;){var m=e*i;if(!(l>m)){j=a,k=d,0==(1&h)?b.lineTo(j,k):b.moveTo(j,k),i-=l/e;break}j+=m*f,k+=m*g,0==(1&h)?b.lineTo(j,k):b.moveTo(j,k),l-=m,h++,h>=c.length&&(h=0),i=c[h]}},p=function(){b.beginPath()},q=function(){o(l,m)};return{moveTo:n,lineTo:o,beginPath:p,closePath:q}},a.jqplot.LineRenderer=function(){this.shapeRenderer=new a.jqplot.ShapeRenderer,this.shadowRenderer=new a.jqplot.ShadowRenderer},a.jqplot.LineRenderer.prototype.init=function(b,c){b=b||{},this._type="line",this.renderer.animation={show:!1,direction:"left",speed:2500,_supported:!0},this.renderer.smooth=!1,this.renderer.tension=null,this.renderer.constrainSmoothing=!0,this.renderer._smoothedData=[],this.renderer._smoothedPlotData=[],this.renderer._hiBandGridData=[],this.renderer._lowBandGridData=[],this.renderer._hiBandSmoothedData=[],this.renderer._lowBandSmoothedData=[],this.renderer.bandData=[],this.renderer.bands={show:!1,hiData:[],lowData:[],color:this.color,showLines:!1,fill:!0,fillColor:null,_min:null,_max:null,interval:"3%"};var d={highlightMouseOver:b.highlightMouseOver,highlightMouseDown:b.highlightMouseDown,highlightColor:b.highlightColor};delete b.highlightMouseOver,delete b.highlightMouseDown,delete b.highlightColor,a.extend(!0,this.renderer,b),this.renderer.options=b,this.renderer.bandData.length>1&&(!b.bands||null==b.bands.show)?this.renderer.bands.show=!0:b.bands&&null==b.bands.show&&null!=b.bands.interval&&(this.renderer.bands.show=!0),this.fill&&(this.renderer.bands.show=!1),this.renderer.bands.show&&this.renderer.initBands.call(this,this.renderer.options,c),this._stack&&(this.renderer.smooth=!1);var e={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:!1,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shapeRenderer.init(e);var f=b.shadowOffset;null==f&&(f=this.lineWidth>2.5?1.25*(1+.6*(Math.atan(this.lineWidth/2.5)/.785398163-1)):1.25*Math.atan(this.lineWidth/2.5)/.785398163);var g={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:!1,angle:this.shadowAngle,offset:f,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};if(this.renderer.shadowRenderer.init(g),this._areaPoints=[],this._boundingBox=[[],[]],!this.isTrendline&&this.fill||this.renderer.bands.show){if(this.highlightMouseOver=!0,this.highlightMouseDown=!1,this.highlightColor=null,d.highlightMouseDown&&null==d.highlightMouseOver&&(d.highlightMouseOver=!1),a.extend(!0,this,{highlightMouseOver:d.highlightMouseOver,highlightMouseDown:d.highlightMouseDown,highlightColor:d.highlightColor}),!this.highlightColor){var h=this.renderer.bands.show?this.renderer.bands.fillColor:this.fillColor;this.highlightColor=a.jqplot.computeHighlightColors(h)}this.highlighter&&(this.highlighter.show=!1)}!this.isTrendline&&c&&(c.plugins.lineRenderer={},c.postInitHooks.addOnce(l),c.postDrawHooks.addOnce(m),c.eventListenerHooks.addOnce("jqplotMouseMove",p),c.eventListenerHooks.addOnce("jqplotMouseDown",q),c.eventListenerHooks.addOnce("jqplotMouseUp",r),c.eventListenerHooks.addOnce("jqplotClick",s),c.eventListenerHooks.addOnce("jqplotRightClick",t))},a.jqplot.LineRenderer.prototype.initBands=function(b,c){var d=b.bandData||[],e=this.renderer.bands;e.hiData=[],e.lowData=[];var f=this.data;if(e._max=null,e._min=null,2==d.length)if(a.isArray(d[0][0])){for(var g,h=0,i=0,j=0,k=d[0].length;k>j;j++)g=d[0][j],(null!=g[1]&&g[1]>e._max||null==e._max)&&(e._max=g[1]),(null!=g[1]&&g[1]<e._min||null==e._min)&&(e._min=g[1]);for(var j=0,k=d[1].length;k>j;j++)g=d[1][j],(null!=g[1]&&g[1]>e._max||null==e._max)&&(e._max=g[1],i=1),(null!=g[1]&&g[1]<e._min||null==e._min)&&(e._min=g[1],h=1);i===h&&(e.show=!1),e.hiData=d[i],e.lowData=d[h]}else if(d[0].length===f.length&&d[1].length===f.length)for(var l=d[0][0]>d[1][0]?0:1,m=l?0:1,j=0,k=f.length;k>j;j++)e.hiData.push([f[j][0],d[l][j]]),e.lowData.push([f[j][0],d[m][j]]);else e.show=!1;else if(d.length>2&&!a.isArray(d[0][0]))for(var l=d[0][0]>d[0][1]?0:1,m=l?0:1,j=0,k=d.length;k>j;j++)e.hiData.push([f[j][0],d[j][l]]),e.lowData.push([f[j][0],d[j][m]]);else{var n=e.interval,o=null,p=null,q=null,r=null;if(a.isArray(n)?(o=n[0],p=n[1]):o=n,isNaN(o)?"%"===o.charAt(o.length-1)&&(q="multiply",o=parseFloat(o)/100+1):(o=parseFloat(o),q="add"),null!==p&&isNaN(p)?"%"===p.charAt(p.length-1)&&(r="multiply",p=parseFloat(p)/100+1):null!==p&&(p=parseFloat(p),r="add"),null!==o){if(null===p&&(p=-o,r=q,"multiply"===r&&(p+=2)),p>o){var s=o;o=p,p=s,s=q,q=r,r=s}for(var j=0,k=f.length;k>j;j++){switch(q){case"add":e.hiData.push([f[j][0],f[j][1]+o]);break;case"multiply":e.hiData.push([f[j][0],f[j][1]*o])}switch(r){case"add":e.lowData.push([f[j][0],f[j][1]+p]);break;case"multiply":e.lowData.push([f[j][0],f[j][1]*p])}}}else e.show=!1}for(var t=e.hiData,u=e.lowData,j=0,k=t.length;k>j;j++)(null!=t[j][1]&&t[j][1]>e._max||null==e._max)&&(e._max=t[j][1]);for(var j=0,k=u.length;k>j;j++)(null!=u[j][1]&&u[j][1]<e._min||null==e._min)&&(e._min=u[j][1]);if(null===e.fillColor){var v=a.jqplot.getColorComponents(e.color);v[3]=.5*v[3],e.fillColor="rgba("+v[0]+", "+v[1]+", "+v[2]+", "+v[3]+")"}},a.jqplot.LineRenderer.prototype.setGridData=function(a){var b=this._xaxis.series_u2p,c=this._yaxis.series_u2p,d=this._plotData,e=this._prevPlotData;this.gridData=[],this._prevGridData=[],this.renderer._smoothedData=[],this.renderer._smoothedPlotData=[],this.renderer._hiBandGridData=[],this.renderer._lowBandGridData=[],this.renderer._hiBandSmoothedData=[],this.renderer._lowBandSmoothedData=[];for(var f=this.renderer.bands,g=!1,h=0,i=d.length;i>h;h++)null!=d[h][0]&&null!=d[h][1]?this.gridData.push([b.call(this._xaxis,d[h][0]),c.call(this._yaxis,d[h][1])]):null==d[h][0]?(g=!0,this.gridData.push([null,c.call(this._yaxis,d[h][1])])):null==d[h][1]&&(g=!0,this.gridData.push([b.call(this._xaxis,d[h][0]),null])),null!=e[h]&&null!=e[h][0]&&null!=e[h][1]?this._prevGridData.push([b.call(this._xaxis,e[h][0]),c.call(this._yaxis,e[h][1])]):null!=e[h]&&null==e[h][0]?this._prevGridData.push([null,c.call(this._yaxis,e[h][1])]):null!=e[h]&&null!=e[h][0]&&null==e[h][1]&&this._prevGridData.push([b.call(this._xaxis,e[h][0]),null]);if(g&&(this.renderer.smooth=!1,"line"===this._type&&(f.show=!1)),"line"===this._type&&f.show){for(var h=0,i=f.hiData.length;i>h;h++)this.renderer._hiBandGridData.push([b.call(this._xaxis,f.hiData[h][0]),c.call(this._yaxis,f.hiData[h][1])]);for(var h=0,i=f.lowData.length;i>h;h++)this.renderer._lowBandGridData.push([b.call(this._xaxis,f.lowData[h][0]),c.call(this._yaxis,f.lowData[h][1])])}if("line"===this._type&&this.renderer.smooth&&this.gridData.length>2){var l;this.renderer.constrainSmoothing?(l=j.call(this,this.gridData),this.renderer._smoothedData=l[0],this.renderer._smoothedPlotData=l[1],f.show&&(l=j.call(this,this.renderer._hiBandGridData),this.renderer._hiBandSmoothedData=l[0],l=j.call(this,this.renderer._lowBandGridData),this.renderer._lowBandSmoothedData=l[0]),l=null):(l=k.call(this,this.gridData),this.renderer._smoothedData=l[0],this.renderer._smoothedPlotData=l[1],f.show&&(l=k.call(this,this.renderer._hiBandGridData),this.renderer._hiBandSmoothedData=l[0],l=k.call(this,this.renderer._lowBandGridData),this.renderer._lowBandSmoothedData=l[0]),l=null)}},a.jqplot.LineRenderer.prototype.makeGridData=function(a,b){var c=this._xaxis.series_u2p,d=this._yaxis.series_u2p,e=[];this.renderer._smoothedData=[],this.renderer._smoothedPlotData=[],this.renderer._hiBandGridData=[],this.renderer._lowBandGridData=[],this.renderer._hiBandSmoothedData=[],this.renderer._lowBandSmoothedData=[];for(var f=this.renderer.bands,g=!1,h=0;h<a.length;h++)null!=a[h][0]&&null!=a[h][1]?(this.step&&h>0&&e.push([c.call(this._xaxis,a[h][0]),d.call(this._yaxis,a[h-1][1])]),e.push([c.call(this._xaxis,a[h][0]),d.call(this._yaxis,a[h][1])])):null==a[h][0]?(g=!0,e.push([null,d.call(this._yaxis,a[h][1])])):null==a[h][1]&&(g=!0,e.push([c.call(this._xaxis,a[h][0]),null]));if(g&&(this.renderer.smooth=!1,"line"===this._type&&(f.show=!1)),"line"===this._type&&f.show){for(var h=0,i=f.hiData.length;i>h;h++)this.renderer._hiBandGridData.push([c.call(this._xaxis,f.hiData[h][0]),d.call(this._yaxis,f.hiData[h][1])]);for(var h=0,i=f.lowData.length;i>h;h++)this.renderer._lowBandGridData.push([c.call(this._xaxis,f.lowData[h][0]),d.call(this._yaxis,f.lowData[h][1])])}if("line"===this._type&&this.renderer.smooth&&e.length>2){var l;this.renderer.constrainSmoothing?(l=j.call(this,e),this.renderer._smoothedData=l[0],this.renderer._smoothedPlotData=l[1],f.show&&(l=j.call(this,this.renderer._hiBandGridData),this.renderer._hiBandSmoothedData=l[0],l=j.call(this,this.renderer._lowBandGridData),this.renderer._lowBandSmoothedData=l[0]),l=null):(l=k.call(this,e),this.renderer._smoothedData=l[0],this.renderer._smoothedPlotData=l[1],f.show&&(l=k.call(this,this.renderer._hiBandGridData),this.renderer._hiBandSmoothedData=l[0],l=k.call(this,this.renderer._lowBandGridData),this.renderer._lowBandSmoothedData=l[0]),l=null)}return e},a.jqplot.LineRenderer.prototype.draw=function(b,c,d,e){var f,g,h,i,j,k=a.extend(!0,{},d),l=k.shadow!=F?k.shadow:this.shadow,m=k.showLine!=F?k.showLine:this.showLine,n=k.fill!=F?k.fill:this.fill,o=k.fillAndStroke!=F?k.fillAndStroke:this.fillAndStroke;if(b.save(),c.length){if(m)if(n){if(this.fillToZero){var p=this.negativeColor;this.useNegativeColors||(p=k.fillStyle);var q=!1,r=k.fillStyle;if(o)var s=c.slice(0);if(0!=this.index&&this._stack){for(var t=this._prevGridData,f=t.length;f>0;f--)c.push(t[f-1]);l&&this.renderer.shadowRenderer.draw(b,c,k),this._areaPoints=c,this.renderer.shapeRenderer.draw(b,c,k)}else{var u=[],v=this.renderer.smooth?this.renderer._smoothedPlotData:this._plotData;this._areaPoints=[];var w=this._yaxis.series_u2p(this.fillToValue);this._xaxis.series_u2p(this.fillToValue);if(k.closePath=!0,"y"==this.fillAxis){u.push([c[0][0],w]),this._areaPoints.push([c[0][0],w]);for(var f=0;f<c.length-1;f++)if(u.push(c[f]),this._areaPoints.push(c[f]),v[f][1]*v[f+1][1]<=0){v[f][1]<0?(q=!0,k.fillStyle=p):(q=!1,k.fillStyle=r);var x=c[f][0]+(c[f+1][0]-c[f][0])*(w-c[f][1])/(c[f+1][1]-c[f][1]);u.push([x,w]),this._areaPoints.push([x,w]),l&&this.renderer.shadowRenderer.draw(b,u,k),this.renderer.shapeRenderer.draw(b,u,k),u=[[x,w]]}v[c.length-1][1]<0?(q=!0,k.fillStyle=p):(q=!1,k.fillStyle=r),u.push(c[c.length-1]),this._areaPoints.push(c[c.length-1]),u.push([c[c.length-1][0],w]),this._areaPoints.push([c[c.length-1][0],w])}l&&this.renderer.shadowRenderer.draw(b,u,k),this.renderer.shapeRenderer.draw(b,u,k)}}else{if(o)var s=c.slice(0);if(0!=this.index&&this._stack)for(var t=this._prevGridData,f=t.length;f>0;f--)c.push(t[f-1]);else{var y=b.canvas.height;c.unshift([c[0][0],y]);var z=c.length;c.push([c[z-1][0],y])}this._areaPoints=c,l&&this.renderer.shadowRenderer.draw(b,c,k),this.renderer.shapeRenderer.draw(b,c,k)}if(o){var A=a.extend(!0,{},k,{fill:!1,closePath:!1});if(this.renderer.shapeRenderer.draw(b,s,A),this.markerRenderer.show)for(this.renderer.smooth&&(s=this.gridData),f=0;f<s.length;f++)this.markerRenderer.draw(s[f][0],s[f][1],b,k.markerOptions)}}else{if(this.renderer.bands.show){var B,C=a.extend(!0,{},k);this.renderer.bands.showLines&&(B=this.renderer.smooth?this.renderer._hiBandSmoothedData:this.renderer._hiBandGridData,this.renderer.shapeRenderer.draw(b,B,k),B=this.renderer.smooth?this.renderer._lowBandSmoothedData:this.renderer._lowBandGridData,this.renderer.shapeRenderer.draw(b,B,C)),this.renderer.bands.fill&&(B=this.renderer.smooth?this.renderer._hiBandSmoothedData.concat(this.renderer._lowBandSmoothedData.reverse()):this.renderer._hiBandGridData.concat(this.renderer._lowBandGridData.reverse()),this._areaPoints=B,C.closePath=!0,C.fill=!0,C.fillStyle=this.renderer.bands.fillColor,this.renderer.shapeRenderer.draw(b,B,C))}l&&this.renderer.shadowRenderer.draw(b,c,k),this.renderer.shapeRenderer.draw(b,c,k)}var g=i=h=j=null;for(f=0;f<this._areaPoints.length;f++){var D=this._areaPoints[f];(g>D[0]||null==g)&&(g=D[0]),(j<D[1]||null==j)&&(j=D[1]),(i<D[0]||null==i)&&(i=D[0]),(h>D[1]||null==h)&&(h=D[1])}if("line"===this.type&&this.renderer.bands.show&&(j=this._yaxis.series_u2p(this.renderer.bands._min),h=this._yaxis.series_u2p(this.renderer.bands._max)),this._boundingBox=[[g,j],[i,h]],this.markerRenderer.show&&!n)for(this.renderer.smooth&&(c=this.gridData),f=0;f<c.length;f++)null!=c[f][0]&&null!=c[f][1]&&this.markerRenderer.draw(c[f][0],c[f][1],b,k.markerOptions)}b.restore()},a.jqplot.LineRenderer.prototype.drawShadow=function(a,b,c){},a.jqplot.LinearAxisRenderer=function(){},a.jqplot.LinearAxisRenderer.prototype.init=function(b){this.breakPoints=null,this.breakTickLabel="&asymp;",this.drawBaseline=!0,this.baselineWidth=null,this.baselineColor=null,this.forceTickAt0=!1,this.forceTickAt100=!1,this.tickInset=0,this.minorTicks=0,this.alignTicks=!1,this._autoFormatString="",this._overrideFormatString=!1,this._scalefact=1,a.extend(!0,this,b),this.breakPoints&&(a.isArray(this.breakPoints)?(this.breakPoints.length<2||this.breakPoints[1]<=this.breakPoints[0])&&(this.breakPoints=null):this.breakPoints=null),
7
- null!=this.numberTicks&&this.numberTicks<2&&(this.numberTicks=2),this.resetDataBounds()},a.jqplot.LinearAxisRenderer.prototype.draw=function(b,c){if(this.show){this.renderer.createTicks.call(this,c);if(this._elem&&(this._elem.emptyForce(),this._elem=null),this._elem=a(document.createElement("div")),this._elem.addClass("jqplot-axis jqplot-"+this.name),this._elem.css("position","absolute"),"xaxis"==this.name||"x2axis"==this.name?this._elem.width(this._plotDimensions.width):this._elem.height(this._plotDimensions.height),this.labelOptions.axis=this.name,this._label=new this.labelRenderer(this.labelOptions),this._label.show){var d=this._label.draw(b,c);d.appendTo(this._elem),d=null}for(var e,f=this._ticks,g=0;g<f.length;g++)e=f[g],e.show&&e.showLabel&&(!e.isMinorTick||this.showMinorTicks)&&this._elem.append(e.draw(b,c));e=null,f=null}return this._elem},a.jqplot.LinearAxisRenderer.prototype.reset=function(){this.min=this._options.min,this.max=this._options.max,this.tickInterval=this._options.tickInterval,this.numberTicks=this._options.numberTicks,this._autoFormatString="",this._overrideFormatString&&this.tickOptions&&this.tickOptions.formatString&&(this.tickOptions.formatString="")},a.jqplot.LinearAxisRenderer.prototype.set=function(){var b,c=0,d=0,e=0,f=null==this._label?!1:this._label.show;if(this.show){for(var g,h=this._ticks,i=0;i<h.length;i++)g=h[i],g._breakTick||!g.show||!g.showLabel||g.isMinorTick&&!this.showMinorTicks||(b="xaxis"==this.name||"x2axis"==this.name?g._elem.outerHeight(!0):g._elem.outerWidth(!0),b>c&&(c=b));g=null,h=null,f&&(d=this._label._elem.outerWidth(!0),e=this._label._elem.outerHeight(!0)),"xaxis"==this.name?(c+=e,this._elem.css({height:c+"px",left:"0px",bottom:"0px"})):"x2axis"==this.name?(c+=e,this._elem.css({height:c+"px",left:"0px",top:"0px"})):"yaxis"==this.name?(c+=d,this._elem.css({width:c+"px",left:"0px",top:"0px"}),f&&this._label.constructor==a.jqplot.AxisLabelRenderer&&this._label._elem.css("width",d+"px")):(c+=d,this._elem.css({width:c+"px",right:"0px",top:"0px"}),f&&this._label.constructor==a.jqplot.AxisLabelRenderer&&this._label._elem.css("width",d+"px"))}},a.jqplot.LinearAxisRenderer.prototype.createTicks=function(b){var c,d,e,f,g=this._ticks,h=this.ticks,i=this.name,j=this._dataBounds,k="x"===this.name.charAt(0)?this._plotDimensions.width:this._plotDimensions.height,l=this.min,m=this.max,n=this.numberTicks,o=this.tickInterval,p=30;if(this._scalefact=(Math.max(k,p+1)-p)/300,h.length){for(f=0;f<h.length;f++){var q=h[f],r=new this.tickRenderer(this.tickOptions);a.isArray(q)?(r.value=q[0],this.breakPoints?q[0]==this.breakPoints[0]?(r.label=this.breakTickLabel,r._breakTick=!0,r.showGridline=!1,r.showMark=!1):q[0]>this.breakPoints[0]&&q[0]<=this.breakPoints[1]?(r.show=!1,r.showGridline=!1,r.label=q[1]):r.label=q[1]:r.label=q[1],r.setTick(q[0],this.name),this._ticks.push(r)):a.isPlainObject(q)?(a.extend(!0,r,q),r.axis=this.name,this._ticks.push(r)):(r.value=q,this.breakPoints&&(q==this.breakPoints[0]?(r.label=this.breakTickLabel,r._breakTick=!0,r.showGridline=!1,r.showMark=!1):q>this.breakPoints[0]&&q<=this.breakPoints[1]&&(r.show=!1,r.showGridline=!1)),r.setTick(q,this.name),this._ticks.push(r))}this.numberTicks=h.length,this.min=this._ticks[0].value,this.max=this._ticks[this.numberTicks-1].value,this.tickInterval=(this.max-this.min)/(this.numberTicks-1)}else{k="xaxis"==i||"x2axis"==i?this._plotDimensions.width:this._plotDimensions.height;var s=this.numberTicks;this.alignTicks&&("x2axis"===this.name&&b.axes.xaxis.show?s=b.axes.xaxis.numberTicks:"y"===this.name.charAt(0)&&"yaxis"!==this.name&&"yMidAxis"!==this.name&&b.axes.yaxis.show&&(s=b.axes.yaxis.numberTicks)),c=null!=this.min?this.min:j.min,d=null!=this.max?this.max:j.max;var t,u,v,w=d-c;if(null!=this.tickOptions&&this.tickOptions.formatString||(this._overrideFormatString=!0),null==this.min||null==this.max&&null==this.tickInterval&&!this.autoscale){this.forceTickAt0&&(c>0&&(c=0),0>d&&(d=0)),this.forceTickAt100&&(c>100&&(c=100),100>d&&(d=100));var x=!1,y=!1;null!=this.min?x=!0:null!=this.max&&(y=!0);var z=a.jqplot.LinearTickGenerator(c,d,this._scalefact,s,x,y),A=null!=this.min?c:c+w*(this.padMin-1),B=null!=this.max?d:d-w*(this.padMax-1);(A>c||d>B)&&(A=null!=this.min?c:c-w*(this.padMin-1),B=null!=this.max?d:d+w*(this.padMax-1),z=a.jqplot.LinearTickGenerator(A,B,this._scalefact,s,x,y)),this.min=z[0],this.max=z[1],this.numberTicks=z[2],this._autoFormatString=z[3],this.tickInterval=z[4]}else{if(c==d){var C=.05;c>0&&(C=Math.max(Math.log(c)/Math.LN10,.05)),c-=C,d+=C}if(this.autoscale&&null==this.min&&null==this.max){for(var D,E,F,G=!1,H=!1,f=0;f<this._series.length;f++){var I=this._series[f],J="x"==I.fillAxis?I._xaxis.name:I._yaxis.name;if(this.name==J){for(var K=I._plotValues[I.fillAxis],L=K[0],M=K[0],N=1;N<K.length;N++)K[N]<L?L=K[N]:K[N]>M&&(M=K[N]);var O=(M-L)/M;I.renderer.constructor==a.jqplot.BarRenderer?L>=0&&(I.fillToZero||O>.1)?G=!0:(G=!1,H=I.fill&&I.fillToZero&&0>L&&M>0?!0:!1):I.fill?L>=0&&(I.fillToZero||O>.1)?G=!0:0>L&&M>0&&I.fillToZero?(G=!1,H=!0):(G=!1,H=!1):0>L&&(G=!1)}}if(G)this.numberTicks=2+Math.ceil((k-(this.tickSpacing-1))/this.tickSpacing),this.min=0,l=0,E=d/(this.numberTicks-1),v=Math.pow(10,Math.abs(Math.floor(Math.log(E)/Math.LN10))),E/v==parseInt(E/v,10)&&(E+=v),this.tickInterval=Math.ceil(E/v)*v,this.max=this.tickInterval*(this.numberTicks-1);else if(H){this.numberTicks=2+Math.ceil((k-(this.tickSpacing-1))/this.tickSpacing);var P=Math.ceil(Math.abs(c)/w*(this.numberTicks-1)),Q=this.numberTicks-1-P;E=Math.max(Math.abs(c/P),Math.abs(d/Q)),v=Math.pow(10,Math.abs(Math.floor(Math.log(E)/Math.LN10))),this.tickInterval=Math.ceil(E/v)*v,this.max=this.tickInterval*Q,this.min=-this.tickInterval*P}else null==this.numberTicks&&(this.tickInterval?this.numberTicks=3+Math.ceil(w/this.tickInterval):this.numberTicks=2+Math.ceil((k-(this.tickSpacing-1))/this.tickSpacing)),null==this.tickInterval?(E=w/(this.numberTicks-1),v=1>E?Math.pow(10,Math.abs(Math.floor(Math.log(E)/Math.LN10))):1,this.tickInterval=Math.ceil(E*v*this.pad)/v):v=1/this.tickInterval,D=this.tickInterval*(this.numberTicks-1),F=(D-w)/2,null==this.min&&(this.min=Math.floor(v*(c-F))/v),null==this.max&&(this.max=this.min+D);var R,S=a.jqplot.getSignificantFigures(this.tickInterval);if(S.digitsLeft>=S.significantDigits)R="%d";else{var v=Math.max(0,5-S.digitsLeft);v=Math.min(v,S.digitsRight),R="%."+v+"f"}this._autoFormatString=R}else{t=null!=this.min?this.min:c-w*(this.padMin-1),u=null!=this.max?this.max:d+w*(this.padMax-1),w=u-t,null==this.numberTicks&&(null!=this.tickInterval?this.numberTicks=Math.ceil((u-t)/this.tickInterval)+1:k>100?this.numberTicks=parseInt(3+(k-100)/75,10):this.numberTicks=2),null==this.tickInterval&&(this.tickInterval=w/(this.numberTicks-1)),null==this.max&&(u=t+this.tickInterval*(this.numberTicks-1)),null==this.min&&(t=u-this.tickInterval*(this.numberTicks-1));var R,S=a.jqplot.getSignificantFigures(this.tickInterval);if(S.digitsLeft>=S.significantDigits)R="%d";else{var v=Math.max(0,5-S.digitsLeft);v=Math.min(v,S.digitsRight),R="%."+v+"f"}this._autoFormatString=R,this.min=t,this.max=u}if(this.renderer.constructor==a.jqplot.LinearAxisRenderer&&""==this._autoFormatString){w=this.max-this.min;var T=new this.tickRenderer(this.tickOptions),U=T.formatString||a.jqplot.config.defaultTickFormatString,U=U.match(a.jqplot.sprintf.regex)[0],V=0;if(U){if(U.search(/[fFeEgGpP]/)>-1){var W=U.match(/\%\.(\d{0,})?[eEfFgGpP]/);V=W?parseInt(W[1],10):6}else U.search(/[di]/)>-1&&(V=0);var X=Math.pow(10,-V);if(this.tickInterval<X&&null==n&&null==o)if(this.tickInterval=X,null==m&&null==l){this.min=Math.floor(this._dataBounds.min/X)*X,this.min==this._dataBounds.min&&(this.min=this._dataBounds.min-this.tickInterval),this.max=Math.ceil(this._dataBounds.max/X)*X,this.max==this._dataBounds.max&&(this.max=this._dataBounds.max+this.tickInterval);var Y=(this.max-this.min)/this.tickInterval;Y=Y.toFixed(11),Y=Math.ceil(Y),this.numberTicks=Y+1}else if(null==m){var Y=(this._dataBounds.max-this.min)/this.tickInterval;Y=Y.toFixed(11),this.numberTicks=Math.ceil(Y)+2,this.max=this.min+this.tickInterval*(this.numberTicks-1)}else if(null==l){var Y=(this.max-this._dataBounds.min)/this.tickInterval;Y=Y.toFixed(11),this.numberTicks=Math.ceil(Y)+2,this.min=this.max-this.tickInterval*(this.numberTicks-1)}else this.numberTicks=Math.ceil((m-l)/this.tickInterval)+1,this.min=Math.floor(l*Math.pow(10,V))/Math.pow(10,V),this.max=Math.ceil(m*Math.pow(10,V))/Math.pow(10,V),this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1}}}this._overrideFormatString&&""!=this._autoFormatString&&(this.tickOptions=this.tickOptions||{},this.tickOptions.formatString=this._autoFormatString);for(var r,Z,f=0;f<this.numberTicks;f++){if(e=this.min+f*this.tickInterval,r=new this.tickRenderer(this.tickOptions),r.setTick(e,this.name),this._ticks.push(r),f<this.numberTicks-1)for(var N=0;N<this.minorTicks;N++)e+=this.tickInterval/(this.minorTicks+1),Z=a.extend(!0,{},this.tickOptions,{name:this.name,value:e,label:"",isMinorTick:!0}),r=new this.tickRenderer(Z),this._ticks.push(r);r=null}}this.tickInset&&(this.min=this.min-this.tickInset*this.tickInterval,this.max=this.max+this.tickInset*this.tickInterval),g=null},a.jqplot.LinearAxisRenderer.prototype.resetTickValues=function(b){if(a.isArray(b)&&b.length==this._ticks.length){for(var c,d=0;d<b.length;d++)c=this._ticks[d],c.value=b[d],c.label=c.formatter(c.formatString,b[d]),c.label=c.prefix+c.label,c._elem.html(c.label);c=null,this.min=a.jqplot.arrayMin(b),this.max=a.jqplot.arrayMax(b),this.pack()}},a.jqplot.LinearAxisRenderer.prototype.pack=function(b,c){b=b||{},c=c||this._offsets;var d=this._ticks,e=this.max,f=this.min,g=c.max,h=c.min,i=null==this._label?!1:this._label.show;for(var j in b)this._elem.css(j,b[j]);this._offsets=c;var k=g-h,l=e-f;if(this.breakPoints?(l=l-this.breakPoints[1]+this.breakPoints[0],this.p2u=function(a){return(a-h)*l/k+f},this.u2p=function(a){return a>this.breakPoints[0]&&a<this.breakPoints[1]&&(a=this.breakPoints[0]),a<=this.breakPoints[0]?(a-f)*k/l+h:(a-this.breakPoints[1]+this.breakPoints[0]-f)*k/l+h},"x"==this.name.charAt(0)?(this.series_u2p=function(a){return a>this.breakPoints[0]&&a<this.breakPoints[1]&&(a=this.breakPoints[0]),a<=this.breakPoints[0]?(a-f)*k/l:(a-this.breakPoints[1]+this.breakPoints[0]-f)*k/l},this.series_p2u=function(a){return a*l/k+f}):(this.series_u2p=function(a){return a>this.breakPoints[0]&&a<this.breakPoints[1]&&(a=this.breakPoints[0]),a>=this.breakPoints[1]?(a-e)*k/l:(a+this.breakPoints[1]-this.breakPoints[0]-e)*k/l},this.series_p2u=function(a){return a*l/k+e})):(this.p2u=function(a){return(a-h)*l/k+f},this.u2p=function(a){return(a-f)*k/l+h},"xaxis"==this.name||"x2axis"==this.name?(this.series_u2p=function(a){return(a-f)*k/l},this.series_p2u=function(a){return a*l/k+f}):(this.series_u2p=function(a){return(a-e)*k/l},this.series_p2u=function(a){return a*l/k+e})),this.show)if("xaxis"==this.name||"x2axis"==this.name){for(var m=0;m<d.length;m++){var n=d[m];if(n.show&&n.showLabel){var o;if(n.constructor==a.jqplot.CanvasAxisTickRenderer&&n.angle){var p="xaxis"==this.name?1:-1;switch(n.labelPosition){case"auto":o=p*n.angle<0?-n.getWidth()+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2:-n._textRenderer.height*Math.sin(n._textRenderer.angle)/2;break;case"end":o=-n.getWidth()+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break;case"start":o=-n._textRenderer.height*Math.sin(n._textRenderer.angle)/2;break;case"middle":o=-n.getWidth()/2+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break;default:o=-n.getWidth()/2+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2}}else o=-n.getWidth()/2;var q=this.u2p(n.value)+o+"px";n._elem.css("left",q),n.pack()}}if(i){var r=this._label._elem.outerWidth(!0);this._label._elem.css("left",h+k/2-r/2+"px"),"xaxis"==this.name?this._label._elem.css("bottom","0px"):this._label._elem.css("top","0px"),this._label.pack()}}else{for(var m=0;m<d.length;m++){var n=d[m];if(n.show&&n.showLabel){var o;if(n.constructor==a.jqplot.CanvasAxisTickRenderer&&n.angle){var p="yaxis"==this.name?1:-1;switch(n.labelPosition){case"auto":case"end":o=p*n.angle<0?-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2:-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2;break;case"start":o=n.angle>0?-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2:-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2;break;case"middle":o=-n.getHeight()/2;break;default:o=-n.getHeight()/2}}else o=-n.getHeight()/2;var q=this.u2p(n.value)+o+"px";n._elem.css("top",q),n.pack()}}if(i){var s=this._label._elem.outerHeight(!0);this._label._elem.css("top",g-k/2-s/2+"px"),"yaxis"==this.name?this._label._elem.css("left","0px"):this._label._elem.css("right","0px"),this._label.pack()}}d=null};a.jqplot.LinearTickGenerator=function(b,c,d,e,f,g){if(f=null===f?!1:f,g=null===g||f?!1:g,b===c&&(c=c?0:1),d=d||1,b>c){var h=c;c=b,b=h}var i=[],j=x(c-b,d),k=a.jqplot.getSignificantFigures;if(null==e)if(f||g){if(f){i[0]=b,i[2]=Math.ceil((c-b)/j+1),i[1]=b+(i[2]-1)*j;var l=k(b).digitsRight,m=k(j).digitsRight;m>l?i[3]=u(j):i[3]="%."+l+"f",i[4]=j}else if(g){i[1]=c,i[2]=Math.ceil((c-b)/j+1),i[0]=c-(i[2]-1)*j;var n=k(c).digitsRight,m=k(j).digitsRight;m>n?i[3]=u(j):i[3]="%."+n+"f",i[4]=j}}else i[0]=Math.floor(b/j)*j,i[1]=Math.ceil(c/j)*j,i[2]=Math.round((i[1]-i[0])/j+1),i[3]=u(j),i[4]=j;else{var o=[];if(o[0]=Math.floor(b/j)*j,o[1]=Math.ceil(c/j)*j,o[2]=Math.round((o[1]-o[0])/j+1),o[3]=u(j),o[4]=j,o[2]===e)i=o;else{var p=w(o[1]-o[0],e);i[0]=o[0],i[2]=e,i[4]=p,i[3]=u(p),i[1]=i[0]+(i[2]-1)*i[4]}}return i},a.jqplot.LinearTickGenerator.bestLinearInterval=x,a.jqplot.LinearTickGenerator.bestInterval=w,a.jqplot.LinearTickGenerator.bestLinearComponents=y,a.jqplot.LinearTickGenerator.bestConstrainedInterval=v,a.jqplot.MarkerRenderer=function(b){this.show=!0,this.style="filledCircle",this.lineWidth=2,this.size=9,this.color="#666666",this.shadow=!0,this.shadowAngle=45,this.shadowOffset=1,this.shadowDepth=3,this.shadowAlpha="0.07",this.shadowRenderer=new a.jqplot.ShadowRenderer,this.shapeRenderer=new a.jqplot.ShapeRenderer,a.extend(!0,this,b)},a.jqplot.MarkerRenderer.prototype.init=function(b){a.extend(!0,this,b);var c={angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,lineWidth:this.lineWidth,depth:this.shadowDepth,closePath:!0};-1!=this.style.indexOf("filled")&&(c.fill=!0),-1!=this.style.indexOf("ircle")&&(c.isarc=!0,c.closePath=!1),this.shadowRenderer.init(c);var d={fill:!1,isarc:!1,strokeStyle:this.color,fillStyle:this.color,lineWidth:this.lineWidth,closePath:!0};-1!=this.style.indexOf("filled")&&(d.fill=!0),-1!=this.style.indexOf("ircle")&&(d.isarc=!0,d.closePath=!1),this.shapeRenderer.init(d)},a.jqplot.MarkerRenderer.prototype.drawDiamond=function(a,b,c,d,e){var f=1.2,g=this.size/2/f,h=this.size/2*f,i=[[a-g,b],[a,b+h],[a+g,b],[a,b-h]];this.shadow&&this.shadowRenderer.draw(c,i),this.shapeRenderer.draw(c,i,e)},a.jqplot.MarkerRenderer.prototype.drawPlus=function(b,c,d,e,f){var g=1,h=this.size/2*g,i=this.size/2*g,j=[[b,c-i],[b,c+i]],k=[[b+h,c],[b-h,c]],l=a.extend(!0,{},this.options,{closePath:!1});this.shadow&&(this.shadowRenderer.draw(d,j,{closePath:!1}),this.shadowRenderer.draw(d,k,{closePath:!1})),this.shapeRenderer.draw(d,j,l),this.shapeRenderer.draw(d,k,l)},a.jqplot.MarkerRenderer.prototype.drawX=function(b,c,d,e,f){var g=1,h=this.size/2*g,i=this.size/2*g,j=a.extend(!0,{},this.options,{closePath:!1}),k=[[b-h,c-i],[b+h,c+i]],l=[[b-h,c+i],[b+h,c-i]];this.shadow&&(this.shadowRenderer.draw(d,k,{closePath:!1}),this.shadowRenderer.draw(d,l,{closePath:!1})),this.shapeRenderer.draw(d,k,j),this.shapeRenderer.draw(d,l,j)},a.jqplot.MarkerRenderer.prototype.drawDash=function(a,b,c,d,e){var f=1,g=this.size/2*f,h=(this.size/2*f,[[a-g,b],[a+g,b]]);this.shadow&&this.shadowRenderer.draw(c,h),this.shapeRenderer.draw(c,h,e)},a.jqplot.MarkerRenderer.prototype.drawLine=function(a,b,c,d,e){var f=[a,b];this.shadow&&this.shadowRenderer.draw(c,f),this.shapeRenderer.draw(c,f,e)},a.jqplot.MarkerRenderer.prototype.drawSquare=function(a,b,c,d,e){var f=1,g=this.size/2/f,h=this.size/2*f,i=[[a-g,b-h],[a-g,b+h],[a+g,b+h],[a+g,b-h]];this.shadow&&this.shadowRenderer.draw(c,i),this.shapeRenderer.draw(c,i,e)},a.jqplot.MarkerRenderer.prototype.drawCircle=function(a,b,c,d,e){var f=this.size/2,g=2*Math.PI,h=[a,b,f,0,g,!0];this.shadow&&this.shadowRenderer.draw(c,h),this.shapeRenderer.draw(c,h,e)},a.jqplot.MarkerRenderer.prototype.draw=function(a,b,c,d){if(d=d||{},null==d.show||0!=d.show)switch(d.color&&!d.fillStyle&&(d.fillStyle=d.color),d.color&&!d.strokeStyle&&(d.strokeStyle=d.color),this.style){case"diamond":this.drawDiamond(a,b,c,!1,d);break;case"filledDiamond":this.drawDiamond(a,b,c,!0,d);break;case"circle":this.drawCircle(a,b,c,!1,d);break;case"filledCircle":this.drawCircle(a,b,c,!0,d);break;case"square":this.drawSquare(a,b,c,!1,d);break;case"filledSquare":this.drawSquare(a,b,c,!0,d);break;case"x":this.drawX(a,b,c,!0,d);break;case"plus":this.drawPlus(a,b,c,!0,d);break;case"dash":this.drawDash(a,b,c,!0,d);break;case"line":this.drawLine(a,b,c,!1,d);break;default:this.drawDiamond(a,b,c,!1,d)}},a.jqplot.ShadowRenderer=function(b){this.angle=45,this.offset=1,this.alpha=.07,this.lineWidth=1.5,this.lineJoin="miter",this.lineCap="round",this.closePath=!1,this.fill=!1,this.depth=3,this.strokeStyle="rgba(0,0,0,0.1)",this.isarc=!1,a.extend(!0,this,b)},a.jqplot.ShadowRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.ShadowRenderer.prototype.draw=function(b,c,d){b.save();var e=null!=d?d:{},f=null!=e.fill?e.fill:this.fill,g=null!=e.fillRect?e.fillRect:this.fillRect,h=null!=e.closePath?e.closePath:this.closePath,i=null!=e.offset?e.offset:this.offset,j=null!=e.alpha?e.alpha:this.alpha,k=null!=e.depth?e.depth:this.depth,l=null!=e.isarc?e.isarc:this.isarc,m=null!=e.linePattern?e.linePattern:this.linePattern;b.lineWidth=null!=e.lineWidth?e.lineWidth:this.lineWidth,b.lineJoin=null!=e.lineJoin?e.lineJoin:this.lineJoin,b.lineCap=null!=e.lineCap?e.lineCap:this.lineCap,b.strokeStyle=e.strokeStyle||this.strokeStyle||"rgba(0,0,0,"+j+")",b.fillStyle=e.fillStyle||this.fillStyle||"rgba(0,0,0,"+j+")";for(var n=0;k>n;n++){var o=a.jqplot.LinePattern(b,m);if(b.translate(Math.cos(this.angle*Math.PI/180)*i,Math.sin(this.angle*Math.PI/180)*i),o.beginPath(),l)b.arc(c[0],c[1],c[2],c[3],c[4],!0);else if(g)g&&b.fillRect(c[0],c[1],c[2],c[3]);else if(c&&c.length)for(var p=!0,q=0;q<c.length;q++)null!=c[q][0]&&null!=c[q][1]?p?(o.moveTo(c[q][0],c[q][1]),p=!1):o.lineTo(c[q][0],c[q][1]):p=!0;h&&o.closePath(),f?b.fill():b.stroke()}b.restore()},a.jqplot.ShapeRenderer=function(b){this.lineWidth=1.5,this.linePattern="solid",this.lineJoin="miter",this.lineCap="round",this.closePath=!1,this.fill=!1,this.isarc=!1,this.fillRect=!1,this.strokeRect=!1,this.clearRect=!1,this.strokeStyle="#999999",this.fillStyle="#999999",a.extend(!0,this,b)},a.jqplot.ShapeRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.ShapeRenderer.prototype.draw=function(b,c,d){b.save();var e=null!=d?d:{},f=null!=e.fill?e.fill:this.fill,g=null!=e.closePath?e.closePath:this.closePath,h=null!=e.fillRect?e.fillRect:this.fillRect,i=null!=e.strokeRect?e.strokeRect:this.strokeRect,j=null!=e.clearRect?e.clearRect:this.clearRect,k=null!=e.isarc?e.isarc:this.isarc,l=null!=e.linePattern?e.linePattern:this.linePattern,m=a.jqplot.LinePattern(b,l);if(b.lineWidth=e.lineWidth||this.lineWidth,b.lineJoin=e.lineJoin||this.lineJoin,b.lineCap=e.lineCap||this.lineCap,b.strokeStyle=e.strokeStyle||e.color||this.strokeStyle,b.fillStyle=e.fillStyle||this.fillStyle,b.beginPath(),k)return b.arc(c[0],c[1],c[2],c[3],c[4],!0),g&&b.closePath(),f?b.fill():b.stroke(),void b.restore();if(j)return b.clearRect(c[0],c[1],c[2],c[3]),void b.restore();if(h||i){if(h&&b.fillRect(c[0],c[1],c[2],c[3]),i)return b.strokeRect(c[0],c[1],c[2],c[3]),void b.restore()}else if(c&&c.length){for(var n=!0,o=0;o<c.length;o++)null!=c[o][0]&&null!=c[o][1]?n?(m.moveTo(c[o][0],c[o][1]),n=!1):m.lineTo(c[o][0],c[o][1]):n=!0;g&&m.closePath(),f?b.fill():b.stroke()}b.restore()},a.jqplot.TableLegendRenderer=function(){},a.jqplot.TableLegendRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.TableLegendRenderer.prototype.addrow=function(b,c,d,e){var f,g,h,i,j,k=d?this.rowSpacing+"px":"0px";h=document.createElement("tr"),f=a(h),f.addClass("jqplot-table-legend"),h=null,e?f.prependTo(this._elem):f.appendTo(this._elem),this.showSwatches&&(g=a(document.createElement("td")),g.addClass("jqplot-table-legend jqplot-table-legend-swatch"),g.css({textAlign:"center",paddingTop:k}),i=a(document.createElement("div")),i.addClass("jqplot-table-legend-swatch-outline"),j=a(document.createElement("div")),j.addClass("jqplot-table-legend-swatch"),j.css({backgroundColor:c,borderColor:c}),f.append(g.append(i.append(j)))),this.showLabels&&(g=a(document.createElement("td")),g.addClass("jqplot-table-legend jqplot-table-legend-label"),g.css("paddingTop",k),f.append(g),this.escapeHtml?g.text(b):g.html(b)),g=null,i=null,j=null,f=null,h=null},a.jqplot.TableLegendRenderer.prototype.draw=function(){if(this._elem&&(this._elem.emptyForce(),this._elem=null),this.show){var b=this._series,c=document.createElement("table");this._elem=a(c),this._elem.addClass("jqplot-table-legend");var d={position:"absolute"};this.background&&(d.background=this.background),this.border&&(d.border=this.border),this.fontSize&&(d.fontSize=this.fontSize),this.fontFamily&&(d.fontFamily=this.fontFamily),this.textColor&&(d.textColor=this.textColor),null!=this.marginTop&&(d.marginTop=this.marginTop),null!=this.marginBottom&&(d.marginBottom=this.marginBottom),null!=this.marginLeft&&(d.marginLeft=this.marginLeft),null!=this.marginRight&&(d.marginRight=this.marginRight);for(var e,f=!1,g=!1,h=0;h<b.length;h++)if(e=b[h],(e._stack||e.renderer.constructor==a.jqplot.BezierCurveRenderer)&&(g=!0),e.show&&e.showLabel){var i=this.labels[h]||e.label.toString();if(i){var j=e.color;g&&h<b.length-1?f=!0:g&&h==b.length-1&&(f=!1),this.renderer.addrow.call(this,i,j,f,g),f=!0}for(var k=0;k<a.jqplot.addLegendRowHooks.length;k++){var l=a.jqplot.addLegendRowHooks[k].call(this,e);l&&(this.renderer.addrow.call(this,l.label,l.color,f),f=!0)}i=null}}return this._elem},a.jqplot.TableLegendRenderer.prototype.pack=function(a){if(this.show)if("insideGrid"==this.placement)switch(this.location){case"nw":var b=a.left,c=a.top;this._elem.css("left",b),this._elem.css("top",c);break;case"n":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2,c=a.top;this._elem.css("left",b),this._elem.css("top",c);break;case"ne":var b=a.right,c=a.top;this._elem.css({right:b,top:c});break;case"e":var b=a.right,c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({right:b,top:c});break;case"se":var b=a.right,c=a.bottom;this._elem.css({right:b,bottom:c});break;case"s":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2,c=a.bottom;this._elem.css({left:b,bottom:c});break;case"sw":var b=a.left,c=a.bottom;this._elem.css({left:b,bottom:c});break;case"w":var b=a.left,c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({left:b,top:c});break;default:var b=a.right,c=a.bottom;this._elem.css({right:b,bottom:c})}else if("outside"==this.placement)switch(this.location){case"nw":var b=this._plotDimensions.width-a.left,c=a.top;this._elem.css("right",b),this._elem.css("top",c);break;case"n":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2,c=this._plotDimensions.height-a.top;this._elem.css("left",b),this._elem.css("bottom",c);break;case"ne":var b=this._plotDimensions.width-a.right,c=a.top;this._elem.css({left:b,top:c});break;case"e":var b=this._plotDimensions.width-a.right,c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({left:b,top:c});break;case"se":var b=this._plotDimensions.width-a.right,c=a.bottom;this._elem.css({left:b,bottom:c});break;case"s":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2,c=this._plotDimensions.height-a.bottom;this._elem.css({left:b,top:c});break;case"sw":var b=this._plotDimensions.width-a.left,c=a.bottom;this._elem.css({right:b,bottom:c});break;case"w":var b=this._plotDimensions.width-a.left,c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({right:b,top:c});break;default:var b=a.right,c=a.bottom;this._elem.css({right:b,bottom:c})}else switch(this.location){case"nw":this._elem.css({left:0,top:a.top});break;case"n":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2;this._elem.css({left:b,top:a.top});break;case"ne":this._elem.css({right:0,top:a.top});break;case"e":var c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({right:a.right,top:c});break;case"se":this._elem.css({right:a.right,bottom:a.bottom});break;case"s":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2;this._elem.css({left:b,bottom:a.bottom});break;case"sw":this._elem.css({left:a.left,bottom:a.bottom});break;case"w":var c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({left:a.left,top:c});break;default:this._elem.css({right:a.right,bottom:a.bottom})}},a.jqplot.ThemeEngine=function(){this.themes={},this.activeTheme=null},a.jqplot.ThemeEngine.prototype.init=function(){var b,c,d,e=new a.jqplot.Theme({_name:"Default"});for(b in e.target)"textColor"==b?e.target[b]=this.target.css("color"):e.target[b]=this.target.css(b);if(this.title.show&&this.title._elem)for(b in e.title)"textColor"==b?e.title[b]=this.title._elem.css("color"):e.title[b]=this.title._elem.css(b);for(b in e.grid)e.grid[b]=this.grid[b];if(null==e.grid.backgroundColor&&null!=this.grid.background&&(e.grid.backgroundColor=this.grid.background),this.legend.show&&this.legend._elem)for(b in e.legend)"textColor"==b?e.legend[b]=this.legend._elem.css("color"):e.legend[b]=this.legend._elem.css(b);var f;for(c=0;c<this.series.length;c++){f=this.series[c],f.renderer.constructor==a.jqplot.LineRenderer?e.series.push(new L):f.renderer.constructor==a.jqplot.BarRenderer?e.series.push(new N):f.renderer.constructor==a.jqplot.PieRenderer?e.series.push(new O):f.renderer.constructor==a.jqplot.DonutRenderer?e.series.push(new P):f.renderer.constructor==a.jqplot.FunnelRenderer?e.series.push(new Q):f.renderer.constructor==a.jqplot.MeterGaugeRenderer?e.series.push(new R):e.series.push({});for(b in e.series[c])e.series[c][b]=f[b]}var g,h;for(b in this.axes){if(h=this.axes[b],g=e.axes[b]=new I,g.borderColor=h.borderColor,g.borderWidth=h.borderWidth,h._ticks&&h._ticks[0])for(d in g.ticks)h._ticks[0].hasOwnProperty(d)?g.ticks[d]=h._ticks[0][d]:h._ticks[0]._elem&&(g.ticks[d]=h._ticks[0]._elem.css(d));if(h._label&&h._label.show)for(d in g.label)h._label[d]?g.label[d]=h._label[d]:h._label._elem&&("textColor"==d?g.label[d]=h._label._elem.css("color"):g.label[d]=h._label._elem.css(d))}this.themeEngine._add(e),this.themeEngine.activeTheme=this.themeEngine.themes[e._name]},a.jqplot.ThemeEngine.prototype.get=function(a){return a?this.themes[a]:this.activeTheme},a.jqplot.ThemeEngine.prototype.getThemeNames=function(){var a=[];for(var b in this.themes)a.push(b);return a.sort(z)},a.jqplot.ThemeEngine.prototype.getThemes=function(){var a=[],b=[];for(var c in this.themes)a.push(c);a.sort(z);for(var d=0;d<a.length;d++)b.push(this.themes[a[d]]);return b},a.jqplot.ThemeEngine.prototype.activate=function(b,c){var d=!1;if(!c&&this.activeTheme&&this.activeTheme._name&&(c=this.activeTheme._name),!this.themes.hasOwnProperty(c))throw new Error("No theme of that name");var e=this.themes[c];this.activeTheme=e;var f,g=["xaxis","x2axis","yaxis","y2axis"];for(p=0;p<g.length;p++){var h=g[p];null!=e.axesStyles.borderColor&&(b.axes[h].borderColor=e.axesStyles.borderColor),null!=e.axesStyles.borderWidth&&(b.axes[h].borderWidth=e.axesStyles.borderWidth)}for(var i in b.axes){var j=b.axes[i];if(j.show){var k=e.axes[i]||{},l=e.axesStyles,m=a.jqplot.extend(!0,{},k,l);if(f=null!=e.axesStyles.borderColor?e.axesStyles.borderColor:m.borderColor,null!=m.borderColor&&(j.borderColor=m.borderColor,d=!0),f=null!=e.axesStyles.borderWidth?e.axesStyles.borderWidth:m.borderWidth,null!=m.borderWidth&&(j.borderWidth=m.borderWidth,d=!0),j._ticks&&j._ticks[0])for(var n in m.ticks)f=m.ticks[n],null!=f&&(j.tickOptions[n]=f,j._ticks=[],d=!0);if(j._label&&j._label.show)for(var n in m.label)f=m.label[n],null!=f&&(j.labelOptions[n]=f,d=!0)}}for(var o in e.grid)null!=e.grid[o]&&(b.grid[o]=e.grid[o]);if(d||b.grid.draw(),b.legend.show)for(o in e.legend)null!=e.legend[o]&&(b.legend[o]=e.legend[o]);if(b.title.show)for(o in e.title)null!=e.title[o]&&(b.title[o]=e.title[o]);var p;for(p=0;p<e.series.length;p++){var q={};for(o in e.series[p])f=null!=e.seriesStyles[o]?e.seriesStyles[o]:e.series[p][o],null!=f&&(q[o]=f,"color"==o?(b.series[p].renderer.shapeRenderer.fillStyle=f,b.series[p].renderer.shapeRenderer.strokeStyle=f,b.series[p][o]=f):"lineWidth"==o||"linePattern"==o?(b.series[p].renderer.shapeRenderer[o]=f,b.series[p][o]=f):"markerOptions"==o?(B(b.series[p].markerOptions,f),B(b.series[p].markerRenderer,f)):b.series[p][o]=f,d=!0)}d&&(b.target.empty(),b.draw());for(o in e.target)null!=e.target[o]&&b.target.css(o,e.target[o])},a.jqplot.ThemeEngine.prototype._add=function(a,b){if(b&&(a._name=b),a._name||(a._name=Date.parse(new Date)),this.themes.hasOwnProperty(a._name))throw new Error("jqplot.ThemeEngine Error: Theme already in use");this.themes[a._name]=a},a.jqplot.ThemeEngine.prototype.remove=function(a){return"Default"==a?!1:delete this.themes[a]},a.jqplot.ThemeEngine.prototype.newTheme=function(b,c){"object"==typeof b&&(c=c||b,b=null),b=c&&c._name?c._name:b||Date.parse(new Date);var d=this.copy(this.themes.Default._name,b);return a.jqplot.extend(d,c),d},a.jqplot.clone=A,a.jqplot.merge=B,a.jqplot.extend=function(){var b,c=arguments[0]||{},d=1,e=arguments.length,f=!1;for("boolean"==typeof c&&(f=c,c=arguments[1]||{},d=2),"object"!=typeof c&&"[object Function]"===!toString.call(c)&&(c={});e>d;d++)if(null!=(b=arguments[d]))for(var g in b){var h=c[g],i=b[g];c!==i&&(f&&i&&"object"==typeof i&&!i.nodeType?c[g]=a.jqplot.extend(f,h||(null!=i.length?[]:{}),i):i!==F&&(c[g]=i))}return c},a.jqplot.ThemeEngine.prototype.rename=function(a,b){if("Default"==a||"Default"==b)throw new Error("jqplot.ThemeEngine Error: Cannot rename from/to Default");if(this.themes.hasOwnProperty(b))throw new Error("jqplot.ThemeEngine Error: New name already in use.");if(this.themes.hasOwnProperty(a)){var c=this.copy(a,b);return this.remove(a),c}throw new Error("jqplot.ThemeEngine Error: Old name or new name invalid")},a.jqplot.ThemeEngine.prototype.copy=function(b,c,d){if("Default"==c)throw new Error("jqplot.ThemeEngine Error: Cannot copy over Default theme");if(!this.themes.hasOwnProperty(b)){var e="jqplot.ThemeEngine Error: Source name invalid";throw new Error(e)}if(this.themes.hasOwnProperty(c)){var e="jqplot.ThemeEngine Error: Target name invalid";throw new Error(e)}var f=A(this.themes[b]);return f._name=c,a.jqplot.extend(!0,f,d),this._add(f),f},a.jqplot.Theme=function(b,c){"object"==typeof b&&(c=c||b,b=null),b=b||Date.parse(new Date),this._name=b,this.target={backgroundColor:null},this.legend={textColor:null,fontFamily:null,fontSize:null,border:null,background:null},this.title={textColor:null,fontFamily:null,fontSize:null,textAlign:null},this.seriesStyles={},this.series=[],this.grid={drawGridlines:null,gridLineColor:null,gridLineWidth:null,backgroundColor:null,borderColor:null,borderWidth:null,shadow:null},this.axesStyles={label:{},ticks:{}},this.axes={},"string"==typeof c?this._name=c:"object"==typeof c&&a.jqplot.extend(!0,this,c)};var I=function(){this.borderColor=null,this.borderWidth=null,this.ticks=new J,this.label=new K},J=function(){this.show=null,this.showGridline=null,this.showLabel=null,this.showMark=null,this.size=null,this.textColor=null,this.whiteSpace=null,this.fontSize=null,this.fontFamily=null},K=function(){this.textColor=null,this.whiteSpace=null,this.fontSize=null,
8
- this.fontFamily=null,this.fontWeight=null},L=function(){this.color=null,this.lineWidth=null,this.linePattern=null,this.shadow=null,this.fillColor=null,this.showMarker=null,this.markerOptions=new M},M=function(){this.show=null,this.style=null,this.lineWidth=null,this.size=null,this.color=null,this.shadow=null},N=function(){this.color=null,this.seriesColors=null,this.lineWidth=null,this.shadow=null,this.barPadding=null,this.barMargin=null,this.barWidth=null,this.highlightColors=null},O=function(){this.seriesColors=null,this.padding=null,this.sliceMargin=null,this.fill=null,this.shadow=null,this.startAngle=null,this.lineWidth=null,this.highlightColors=null},P=function(){this.seriesColors=null,this.padding=null,this.sliceMargin=null,this.fill=null,this.shadow=null,this.startAngle=null,this.lineWidth=null,this.innerDiameter=null,this.thickness=null,this.ringMargin=null,this.highlightColors=null},Q=function(){this.color=null,this.lineWidth=null,this.shadow=null,this.padding=null,this.sectionMargin=null,this.seriesColors=null,this.highlightColors=null},R=function(){this.padding=null,this.backgroundColor=null,this.ringColor=null,this.tickColor=null,this.ringWidth=null,this.intervalColors=null,this.intervalInnerRadius=null,this.intervalOuterRadius=null,this.hubRadius=null,this.needleThickness=null,this.needlePad=null};a.fn.jqplotChildText=function(){return a(this).contents().filter(function(){return 3==this.nodeType}).text()},a.fn.jqplotGetComputedFontStyle=function(){for(var a=window.getComputedStyle?window.getComputedStyle(this[0],""):this[0].currentStyle,b=a["font-style"]?["font-style","font-weight","font-size","font-family"]:["fontStyle","fontWeight","fontSize","fontFamily"],c=[],d=0;d<b.length;++d){var e=String(a[b[d]]);e&&"normal"!=e&&c.push(e)}return c.join(" ")},a.fn.jqplotToImageCanvas=function(b){function c(b){var c=parseInt(a(b).css("line-height"),10);return isNaN(c)&&(c=1.2*parseInt(a(b).css("font-size"),10)),c}function d(b,d,e,f,g,h){for(var i=c(b),j=a(b).innerWidth(),k=(a(b).innerHeight(),e.split(/\s+/)),l=k.length,m="",n=[],o=g,p=f,q=0;l>q;q++)m+=k[q],d.measureText(m).width>j&&m.length>k[q].length&&(n.push(q),m="",q--);if(0===n.length)"center"===a(b).css("textAlign")&&(p=f+(h-d.measureText(m).width)/2-s),d.fillText(e,p,g);else{m=k.slice(0,n[0]).join(" "),"center"===a(b).css("textAlign")&&(p=f+(h-d.measureText(m).width)/2-s),d.fillText(m,p,o),o+=i;for(var q=1,r=n.length;r>q;q++)m=k.slice(n[q-1],n[q]).join(" "),"center"===a(b).css("textAlign")&&(p=f+(h-d.measureText(m).width)/2-s),d.fillText(m,p,o),o+=i;m=k.slice(n[q-1],k.length).join(" "),"center"===a(b).css("textAlign")&&(p=f+(h-d.measureText(m).width)/2-s),d.fillText(m,p,o)}}function e(b,c,f){var g=b.tagName.toLowerCase(),h=a(b).position(),i=window.getComputedStyle?window.getComputedStyle(b,""):b.currentStyle,j=c+h.left+parseInt(i.marginLeft,10)+parseInt(i.borderLeftWidth,10)+parseInt(i.paddingLeft,10),k=f+h.top+parseInt(i.marginTop,10)+parseInt(i.borderTopWidth,10)+parseInt(i.paddingTop,10),l=m.width;if("div"!=g&&"span"!=g||a(b).hasClass("jqplot-highlighter-tooltip"))if("table"===g&&a(b).hasClass("jqplot-table-legend")){w.strokeStyle=a(b).css("border-top-color"),w.fillStyle=a(b).css("background-color"),w.fillRect(j,k,a(b).innerWidth(),a(b).innerHeight()),parseInt(a(b).css("border-top-width"),10)>0&&w.strokeRect(j,k,a(b).innerWidth(),a(b).innerHeight()),a(b).find("div.jqplot-table-legend-swatch-outline").each(function(){var b=a(this);w.strokeStyle=b.css("border-top-color");var c=j+b.position().left,d=k+b.position().top;w.strokeRect(c,d,b.innerWidth(),b.innerHeight()),c+=parseInt(b.css("padding-left"),10),d+=parseInt(b.css("padding-top"),10);var e=b.innerHeight()-2*parseInt(b.css("padding-top"),10),f=b.innerWidth()-2*parseInt(b.css("padding-left"),10),g=b.children("div.jqplot-table-legend-swatch");w.fillStyle=g.css("background-color"),w.fillRect(c,d,f,e)}),a(b).find("td.jqplot-table-legend-label").each(function(){var b=a(this),c=j+b.position().left,e=k+b.position().top+parseInt(b.css("padding-top"),10);w.font=b.jqplotGetComputedFontStyle(),w.fillStyle=b.css("color"),d(b,w,b.text(),c,e,l)})}else"canvas"==g&&w.drawImage(b,j,k);else{a(b).children().each(function(){e(this,j,k)});var n=a(b).jqplotChildText();n&&(w.font=a(b).jqplotGetComputedFontStyle(),w.fillStyle=a(b).css("color"),d(b,w,n,j,k,l))}}b=b||{};var f=null==b.x_offset?0:b.x_offset,g=null==b.y_offset?0:b.y_offset,h=null==b.backgroundColor?"rgb(255,255,255)":b.backgroundColor;if(0==a(this).width()||0==a(this).height())return null;if(a.jqplot.use_excanvas)return null;for(var i,j,k,l,m=document.createElement("canvas"),n=a(this).outerHeight(!0),o=a(this).outerWidth(!0),p=a(this).offset(),q=p.left,r=p.top,s=0,t=0,u=["jqplot-table-legend","jqplot-xaxis-tick","jqplot-x2axis-tick","jqplot-yaxis-tick","jqplot-y2axis-tick","jqplot-y3axis-tick","jqplot-y4axis-tick","jqplot-y5axis-tick","jqplot-y6axis-tick","jqplot-y7axis-tick","jqplot-y8axis-tick","jqplot-y9axis-tick","jqplot-xaxis-label","jqplot-x2axis-label","jqplot-yaxis-label","jqplot-y2axis-label","jqplot-y3axis-label","jqplot-y4axis-label","jqplot-y5axis-label","jqplot-y6axis-label","jqplot-y7axis-label","jqplot-y8axis-label","jqplot-y9axis-label"],v=0;v<u.length;v++)a(this).find("."+u[v]).each(function(){i=a(this).offset().top-r,j=a(this).offset().left-q,l=j+a(this).outerWidth(!0)+s,k=i+a(this).outerHeight(!0)+t,-s>j&&(o=o-s-j,s=-j),-t>i&&(n=n-t-i,t=-i),l>o&&(o=l),k>n&&(n=k)});m.width=o+Number(f),m.height=n+Number(g);var w=m.getContext("2d");return w.save(),w.fillStyle=h,w.fillRect(0,0,m.width,m.height),w.restore(),w.translate(s,t),w.textAlign="left",w.textBaseline="top",a(this).children().each(function(){e(this,f,g)}),m},a.fn.jqplotToImageStr=function(b){var c=a(this).jqplotToImageCanvas(b);return c?c.toDataURL("image/png"):null},a.fn.jqplotToImageElem=function(b){var c=document.createElement("img"),d=a(this).jqplotToImageStr(b);return c.src=d,c},a.fn.jqplotToImageElemStr=function(b){var c="<img src="+a(this).jqplotToImageStr(b)+" />";return c},a.fn.jqplotSaveImage=function(){var b=a(this).jqplotToImageStr({});b&&(window.location.href=b.replace("image/png","image/octet-stream"))},a.fn.jqplotViewImage=function(){var b=a(this).jqplotToImageElemStr({});a(this).jqplotToImageStr({});if(b){var c=window.open("");c.document.open("image/png"),c.document.write(b),c.document.close(),c=null}};var S=function(){switch(this.syntax=S.config.syntax,this._type="jsDate",this.proxy=new Date,this.options={},this.locale=S.regional.getLocale(),this.formatString="",this.defaultCentury=S.config.defaultCentury,arguments.length){case 0:break;case 1:if("[object Object]"==D(arguments[0])&&"jsDate"!=arguments[0]._type){var a=this.options=arguments[0];this.syntax=a.syntax||this.syntax,this.defaultCentury=a.defaultCentury||this.defaultCentury,this.proxy=S.createDate(a.date)}else this.proxy=S.createDate(arguments[0]);break;default:for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c]);this.proxy=new Date,this.proxy.setFullYear.apply(this.proxy,b.slice(0,3)),b.slice(3).length&&this.proxy.setHours.apply(this.proxy,b.slice(3))}};S.config={defaultLocale:"en",syntax:"perl",defaultCentury:1900},S.prototype.add=function(a,b){var c=V[b]||V.day;return"number"==typeof c?this.proxy.setTime(this.proxy.getTime()+c*a):c.add(this,a),this},S.prototype.clone=function(){return new S(this.proxy.getTime())},S.prototype.getUtcOffset=function(){return 6e4*this.proxy.getTimezoneOffset()},S.prototype.diff=function(a,b,c){if(a=new S(a),null===a)return null;var d=V[b]||V.day;if("number"==typeof d)var e=(this.proxy.getTime()-a.proxy.getTime())/d;else var e=d.diff(this.proxy,a.proxy);return c?e:Math[e>0?"floor":"ceil"](e)},S.prototype.getAbbrDayName=function(){return S.regional[this.locale].dayNamesShort[this.proxy.getDay()]},S.prototype.getAbbrMonthName=function(){return S.regional[this.locale].monthNamesShort[this.proxy.getMonth()]},S.prototype.getAMPM=function(){return this.proxy.getHours()>=12?"PM":"AM"},S.prototype.getAmPm=function(){return this.proxy.getHours()>=12?"pm":"am"},S.prototype.getCentury=function(){return parseInt(this.proxy.getFullYear()/100,10)},S.prototype.getDate=function(){return this.proxy.getDate()},S.prototype.getDay=function(){return this.proxy.getDay()},S.prototype.getDayOfWeek=function(){var a=this.proxy.getDay();return 0===a?7:a},S.prototype.getDayOfYear=function(){var a=this.proxy,b=a-new Date(""+a.getFullYear()+"/1/1 GMT");return b+=6e4*a.getTimezoneOffset(),a=null,parseInt(b/6e4/60/24,10)+1},S.prototype.getDayName=function(){return S.regional[this.locale].dayNames[this.proxy.getDay()]},S.prototype.getFullWeekOfYear=function(){var a=this.proxy,b=this.getDayOfYear(),c=6-a.getDay(),d=parseInt((b+c)/7,10);return d},S.prototype.getFullYear=function(){return this.proxy.getFullYear()},S.prototype.getGmtOffset=function(){var a=this.proxy.getTimezoneOffset()/60,b=0>a?"+":"-";return a=Math.abs(a),b+U(Math.floor(a),2)+":"+U(a%1*60,2)},S.prototype.getHours=function(){return this.proxy.getHours()},S.prototype.getHours12=function(){var a=this.proxy.getHours();return a>12?a-12:0==a?12:a},S.prototype.getIsoWeek=function(){var a=this.proxy,b=this.getWeekOfYear(),c=new Date(""+a.getFullYear()+"/1/1").getDay(),d=b+(c>4||1>=c?0:1);return 53==d&&new Date(""+a.getFullYear()+"/12/31").getDay()<4?d=1:0===d&&(a=new S(new Date(""+(a.getFullYear()-1)+"/12/31")),d=a.getIsoWeek()),a=null,d},S.prototype.getMilliseconds=function(){return this.proxy.getMilliseconds()},S.prototype.getMinutes=function(){return this.proxy.getMinutes()},S.prototype.getMonth=function(){return this.proxy.getMonth()},S.prototype.getMonthName=function(){return S.regional[this.locale].monthNames[this.proxy.getMonth()]},S.prototype.getMonthNumber=function(){return this.proxy.getMonth()+1},S.prototype.getSeconds=function(){return this.proxy.getSeconds()},S.prototype.getShortYear=function(){return this.proxy.getYear()%100},S.prototype.getTime=function(){return this.proxy.getTime()},S.prototype.getTimezoneAbbr=function(){return this.proxy.toString().replace(/^.*\(([^)]+)\)$/,"$1")},S.prototype.getTimezoneName=function(){var a=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return a[1]||a[2]||"GMT"+this.getGmtOffset()},S.prototype.getTimezoneOffset=function(){return this.proxy.getTimezoneOffset()},S.prototype.getWeekOfYear=function(){var a=this.getDayOfYear(),b=7-this.getDayOfWeek(),c=parseInt((a+b)/7,10);return c},S.prototype.getUnix=function(){return Math.round(this.proxy.getTime()/1e3,0)},S.prototype.getYear=function(){return this.proxy.getYear()},S.prototype.next=function(a){return a=a||"day",this.clone().add(1,a)},S.prototype.set=function(){switch(arguments.length){case 0:this.proxy=new Date;break;case 1:if("[object Object]"==D(arguments[0])&&"jsDate"!=arguments[0]._type){var a=this.options=arguments[0];this.syntax=a.syntax||this.syntax,this.defaultCentury=a.defaultCentury||this.defaultCentury,this.proxy=S.createDate(a.date)}else this.proxy=S.createDate(arguments[0]);break;default:for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c]);this.proxy=new Date,this.proxy.setFullYear.apply(this.proxy,b.slice(0,3)),b.slice(3).length&&this.proxy.setHours.apply(this.proxy,b.slice(3))}return this},S.prototype.setDate=function(a){return this.proxy.setDate(a),this},S.prototype.setFullYear=function(){return this.proxy.setFullYear.apply(this.proxy,arguments),this},S.prototype.setHours=function(){return this.proxy.setHours.apply(this.proxy,arguments),this},S.prototype.setMilliseconds=function(a){return this.proxy.setMilliseconds(a),this},S.prototype.setMinutes=function(){return this.proxy.setMinutes.apply(this.proxy,arguments),this},S.prototype.setMonth=function(){return this.proxy.setMonth.apply(this.proxy,arguments),this},S.prototype.setSeconds=function(){return this.proxy.setSeconds.apply(this.proxy,arguments),this},S.prototype.setTime=function(a){return this.proxy.setTime(a),this},S.prototype.setYear=function(){return this.proxy.setYear.apply(this.proxy,arguments),this},S.prototype.strftime=function(a){return a=a||this.formatString||S.regional[this.locale].formatString,S.strftime(this,a,this.syntax)},S.prototype.toString=function(){return this.proxy.toString()},S.prototype.toYmdInt=function(){return 1e4*this.proxy.getFullYear()+100*this.getMonthNumber()+this.proxy.getDate()},S.regional={en:{monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],formatString:"%Y-%m-%d %H:%M:%S"},fr:{monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthNamesShort:["Jan","Fév","Mar","Avr","Mai","Jun","Jul","Aoû","Sep","Oct","Nov","Déc"],dayNames:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayNamesShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],formatString:"%Y-%m-%d %H:%M:%S"},de:{monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],formatString:"%Y-%m-%d %H:%M:%S"},es:{monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthNamesShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],dayNames:["Domingo","Lunes","Martes","Mi&eacute;rcoles","Jueves","Viernes","S&aacute;bado"],dayNamesShort:["Dom","Lun","Mar","Mi&eacute;","Juv","Vie","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},ru:{monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],dayNamesShort:["вск","пнд","втр","срд","чтв","птн","сбт"],formatString:"%Y-%m-%d %H:%M:%S"},ar:{monthNames:["كانون الثاني","شباط","آذار","نيسان","آذار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],dayNames:["السبت","الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة"],dayNamesShort:["سبت","أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة"],formatString:"%Y-%m-%d %H:%M:%S"},pt:{monthNames:["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},"pt-BR":{monthNames:["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},pl:{monthNames:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthNamesShort:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],dayNames:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],dayNamesShort:["Ni","Pn","Wt","Śr","Cz","Pt","Sb"],formatString:"%Y-%m-%d %H:%M:%S"},nl:{monthNames:["Januari","Februari","Maart","April","Mei","Juni","July","Augustus","September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],dayNames:",".Zaterdag,dayNamesShort:["Zo","Ma","Di","Wo","Do","Vr","Za"],formatString:"%Y-%m-%d %H:%M:%S"},sv:{monthNames:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],monthNamesShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],dayNames:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],dayNamesShort:["sön","mån","tis","ons","tor","fre","lör"],formatString:"%Y-%m-%d %H:%M:%S"},it:{monthNames:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthNamesShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],dayNames:["Domenica","Lunedi","Martedi","Mercoledi","Giovedi","Venerdi","Sabato"],dayNamesShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],formatString:"%d-%m-%Y %H:%M:%S"}},S.regional["en-US"]=S.regional["en-GB"]=S.regional.en,S.regional.getLocale=function(){var a=S.config.defaultLocale;return document&&document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang&&(a=document.getElementsByTagName("html")[0].lang,S.regional.hasOwnProperty(a)||(a=S.config.defaultLocale)),a};var T=864e5,U=function(a,b){a=String(a);var c=b-a.length,d=String(Math.pow(10,c)).slice(1);return d.concat(a)},V={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:T,week:7*T,month:{add:function(a,b){V.year.add(a,Math[b>0?"floor":"ceil"](b/12));var c=a.getMonth()+b%12;12==c?(c=0,a.setYear(a.getFullYear()+1)):-1==c&&(c=11,a.setYear(a.getFullYear()-1)),a.setMonth(c)},diff:function(a,b){var c=a.getFullYear()-b.getFullYear(),d=a.getMonth()-b.getMonth()+12*c,e=a.getDate()-b.getDate();return d+e/30}},year:{add:function(a,b){a.setYear(a.getFullYear()+Math[b>0?"floor":"ceil"](b))},diff:function(a,b){return V.month.diff(a,b)/12}}};for(var W in V)"s"!=W.substring(W.length-1)&&(V[W+"s"]=V[W]);var X=function(a,b,c){if(S.formats[c].shortcuts[b])return S.strftime(a,S.formats[c].shortcuts[b],c);var d=(S.formats[c].codes[b]||"").split("."),e=a["get"+d[0]]?a["get"+d[0]]():"";return d[1]&&(e=U(e,d[1])),e};S.strftime=function(a,b,c,d){var e="perl",f=S.regional.getLocale();c&&S.formats.hasOwnProperty(c)?e=c:c&&S.regional.hasOwnProperty(c)&&(f=c),d&&S.formats.hasOwnProperty(d)?e=d:d&&S.regional.hasOwnProperty(d)&&(f=d),("[object Object]"!=D(a)||"jsDate"!=a._type)&&(a=new S(a),a.locale=f),b||(b=a.formatString||S.regional[f].formatString);for(var g,h=b||"%Y-%m-%d",i="";h.length>0;)(g=h.match(S.formats[e].codes.matcher))?(i+=h.slice(0,g.index),i+=(g[1]||"")+X(a,g[2],e),h=h.slice(g.index+g[0].length)):(i+=h,h="");return i},S.formats={ISO:"%Y-%m-%dT%H:%M:%S.%N%G",SQL:"%Y-%m-%d %H:%M:%S"},S.formats.perl={codes:{matcher:/()%(#?(%|[a-z]))/i,Y:"FullYear",y:"ShortYear.2",m:"MonthNumber.2","#m":"MonthNumber",B:"MonthName",b:"AbbrMonthName",d:"Date.2","#d":"Date",e:"Date",A:"DayName",a:"AbbrDayName",w:"Day",H:"Hours.2","#H":"Hours",I:"Hours12.2","#I":"Hours12",p:"AMPM",M:"Minutes.2","#M":"Minutes",S:"Seconds.2","#S":"Seconds",s:"Unix",N:"Milliseconds.3","#N":"Milliseconds",O:"TimezoneOffset",Z:"TimezoneName",G:"GmtOffset"},shortcuts:{F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",D:"%m/%d/%y","#c":"%a %b %e %H:%M:%S %Y",v:"%e-%b-%Y",R:"%H:%M",r:"%I:%M:%S %p",t:" ",n:"\n","%":"%"}},S.formats.php={codes:{matcher:/()%((%|[a-z]))/i,a:"AbbrDayName",A:"DayName",d:"Date.2",e:"Date",j:"DayOfYear.3",u:"DayOfWeek",w:"Day",U:"FullWeekOfYear.2",V:"IsoWeek.2",W:"WeekOfYear.2",b:"AbbrMonthName",B:"MonthName",m:"MonthNumber.2",h:"AbbrMonthName",C:"Century.2",y:"ShortYear.2",Y:"FullYear",H:"Hours.2",I:"Hours12.2",l:"Hours12",p:"AMPM",P:"AmPm",M:"Minutes.2",S:"Seconds.2",s:"Unix",O:"TimezoneOffset",z:"GmtOffset",Z:"TimezoneAbbr"},shortcuts:{D:"%m/%d/%y",F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",R:"%H:%M",r:"%I:%M:%S %p",t:" ",n:"\n","%":"%"}},S.createDate=function(a){function b(a,b){var c,d,e,f,g=parseFloat(b[1]),h=parseFloat(b[2]),i=parseFloat(b[3]),j=S.config.defaultCentury;return g>31?(d=i,e=h,c=j+g):(d=h,e=g,c=j+i),f=e+"/"+d+"/"+c,a.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/,f)}if(null==a)return new Date;if(a instanceof Date)return a;if("number"==typeof a)return new Date(a);var c=String(a).replace(/^\s*(.+)\s*$/g,"$1");c=c.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/,"$1/$2/$3"),c=c.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i,"$1 $2 $3");var d=c.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);if(d&&d.length>3){var e=parseFloat(d[3]),f=S.config.defaultCentury+e;f=String(f),c=c.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i,d[1]+" "+d[2]+" "+f)}d=c.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/),d&&d.length>3&&(c=b(c,d));var d=c.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);d&&d.length>3&&(c=b(c,d));for(var g,h,i,j=0,k=S.matchers.length,l=c;k>j;){if(h=Date.parse(l),!isNaN(h))return new Date(h);if(g=S.matchers[j],"function"==typeof g){if(i=g.call(S,l),i instanceof Date)return i}else l=c.replace(g[0],g[1]);j++}return NaN},S.daysInMonth=function(a,b){return 2==b?29==new Date(a,1,29).getDate()?29:28:[F,31,F,31,30,31,30,31,31,30,31,30,31][b]},S.matchers=[[/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/,"$2/$1/$3"],[/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/,"$2/$3/$1"],function(a){var b=a.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i);if(b){if(b[1]){var c=this.createDate(b[1]);if(isNaN(c))return}else{var c=new Date;c.setMilliseconds(0)}var d=parseFloat(b[2]);return b[6]&&(d="am"==b[6].toLowerCase()?12==d?0:d:12==d?12:d+12),c.setHours(d,parseInt(b[3]||0,10),parseInt(b[4]||0,10),1e3*(parseFloat(b[5]||0)||0)),c}return a},function(a){var b=a.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i);if(b){if(b[1]){var c=this.createDate(b[1]);if(isNaN(c))return}else{var c=new Date;c.setMilliseconds(0)}var d=parseFloat(b[2]);return c.setHours(d,parseInt(b[3],10),parseInt(b[4],10),1e3*parseFloat(b[5])),c}return a},function(a){var b=a.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/);if(b){var c,d,e,f=new Date,g=S.config.defaultCentury,h=parseFloat(b[1]),i=parseFloat(b[3]);h>31?(d=i,c=g+h):(d=h,c=g+i);var e=C(b[2],S.regional[S.regional.getLocale()].monthNamesShort);return-1==e&&(e=C(b[2],S.regional[S.regional.getLocale()].monthNames)),f.setFullYear(c,e,d),f.setHours(0,0,0,0),f}return a}],a.jsDate=S,a.jqplot.sprintf=function(){function b(a,b,c,d){var e=a.length>=b?"":Array(1+b-a.length>>>0).join(c);return d?a+e:e+a}function c(b){for(var c=new String(b),d=10;d>0&&c!=(c=c.replace(/^(\d+)(\d{3})/,"$1"+a.jqplot.sprintf.thousandsSeparator+"$2"));d--);return c}function d(a,c,d,e,f,g){var h=e-a.length;if(h>0){var i=" ";g&&(i="&nbsp;"),a=d||!f?b(a,e,i,d):a.slice(0,c.length)+b("",h,"0",!0)+a.slice(c.length)}return a}function e(a,c,e,f,g,h,i,j){var k=a>>>0;return e=e&&k&&{2:"0b",8:"0",16:"0x"}[c]||"",a=e+b(k.toString(c),h||0,"0",!1),d(a,e,f,g,i,j)}function f(a,b,c,e,f,g){return null!=e&&(a=a.slice(0,e)),d(a,"",b,c,f,g)}var g=arguments,h=0,i=g[h++];return i.replace(a.jqplot.sprintf.regex,function(i,j,k,l,m,n,o){if("%%"==i)return"%";for(var p=!1,q="",r=!1,s=!1,t=!1,u=!1,v=0;k&&v<k.length;v++)switch(k.charAt(v)){case" ":q=" ";break;case"+":q="+";break;case"-":p=!0;break;case"0":r=!0;break;case"#":s=!0;break;case"&":t=!0;break;case"'":u=!0}if(l=l?"*"==l?+g[h++]:"*"==l.charAt(0)?+g[l.slice(1,-1)]:+l:0,0>l&&(l=-l,p=!0),!isFinite(l))throw new Error("$.jqplot.sprintf: (minimum-)width must be finite");n=n?"*"==n?+g[h++]:"*"==n.charAt(0)?+g[n.slice(1,-1)]:+n:"fFeE".indexOf(o)>-1?6:"d"==o?0:void 0;var w=j?g[j.slice(0,-1)]:g[h++];switch(o){case"s":return null==w?"":f(String(w),p,l,n,r,t);case"c":return f(String.fromCharCode(+w),p,l,n,r,t);case"b":return e(w,2,s,p,l,n,r,t);case"o":return e(w,8,s,p,l,n,r,t);case"x":return e(w,16,s,p,l,n,r,t);case"X":return e(w,16,s,p,l,n,r,t).toUpperCase();case"u":return e(w,10,s,p,l,n,r,t);case"i":var x=parseInt(+w,10);if(isNaN(x))return"";var y=0>x?"-":q,z=u?c(String(Math.abs(x))):String(Math.abs(x));return w=y+b(z,n,"0",!1),d(w,y,p,l,r,t);case"d":var x=Math.round(+w);if(isNaN(x))return"";var y=0>x?"-":q,z=u?c(String(Math.abs(x))):String(Math.abs(x));return w=y+b(z,n,"0",!1),d(w,y,p,l,r,t);case"e":case"E":case"f":case"F":case"g":case"G":var x=+w;if(isNaN(x))return"";var y=0>x?"-":q,A=["toExponential","toFixed","toPrecision"]["efg".indexOf(o.toLowerCase())],B=["toString","toUpperCase"]["eEfFgG".indexOf(o)%2],z=Math.abs(x)[A](n),C=z.toString().split(".");C[0]=u?c(C[0]):C[0],z=C.join(a.jqplot.sprintf.decimalMark),w=y+z;var D=d(w,y,p,l,r,t)[B]();return D;case"p":case"P":var x=+w;if(isNaN(x))return"";var y=0>x?"-":q,C=String(Number(Math.abs(x)).toExponential()).split(/e|E/),E=-1!=C[0].indexOf(".")?C[0].length-1:String(x).length,F=C[1]<0?-C[1]-1:0;if(Math.abs(x)<1)w=n>=E+F?y+Math.abs(x).toPrecision(E):n-1>=E?y+Math.abs(x).toExponential(E-1):y+Math.abs(x).toExponential(n-1);else{var G=n>=E?E:n;w=y+Math.abs(x).toPrecision(G)}var B=["toString","toUpperCase"]["pP".indexOf(o)%2];return d(w,y,p,l,r,t)[B]();case"n":return"";default:return i}})},a.jqplot.sprintf.thousandsSeparator=",",a.jqplot.sprintf.decimalMark=".",a.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g,a.jqplot.getSignificantFigures=function(a){var b=String(Number(Math.abs(a)).toExponential()).split(/e|E/),c=-1!=b[0].indexOf(".")?b[0].length-1:b[0].length,d=b[1]<0?-b[1]-1:0,e=parseInt(b[1],10),f=e+1>0?e+1:0,g=f>=c?0:c-e-1;return{significantDigits:c,digitsLeft:f,digitsRight:g,zeros:d,exponent:e}},a.jqplot.getPrecision=function(b){return a.jqplot.getSignificantFigures(b).digitsRight};var Y=a.uiBackCompat!==!1;a.jqplot.effects={effect:{}};var Z="jqplot.storage.";a.extend(a.jqplot.effects,{version:"1.9pre",save:function(a,b){for(var c=0;c<b.length;c++)null!==b[c]&&a.data(Z+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)null!==b[c]&&a.css(b[c],a.data(Z+b[c]))},setMode:function(a,b){return"toggle"===b&&(b=a.is(":hidden")?"show":"hide"),b},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:b.width(),height:b.height()},f=document.activeElement;return b.wrap(d),(b[0]===f||a.contains(b[0],f))&&a(f).focus(),d=b.parent(),"static"===b.css("position")?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),b.css(e),d.css(c).show()},removeWrapper:function(b){var c=document.activeElement;return b.parent().is(".ui-effects-wrapper")&&(b.parent().replaceWith(b),(b[0]===c||a.contains(b[0],c))&&a(c).focus()),b}}),a.fn.extend({jqplotEffect:function(b,c,d,e){function f(b){function c(){a.isFunction(e)&&e.call(d[0]),a.isFunction(b)&&b()}var d=a(this),e=g.complete,f=g.mode;(d.is(":hidden")?"hide"===f:"show"===f)?c():j.call(d[0],g,c)}var g=E.apply(this,arguments),h=g.mode,i=g.queue,j=a.jqplot.effects.effect[g.effect],k=!j&&Y&&a.jqplot.effects[g.effect];return a.fx.off||!j&&!k?h?this[h](g.duration,g.complete):this.each(function(){g.complete&&g.complete.call(this)}):j?i===!1?this.each(f):this.queue(i||"fx",f):k.call(this,{options:g,duration:g.duration,callback:g.complete,mode:g.mode})}});var $=/up|down|vertical/,_=/up|left|vertical|horizontal/;a.jqplot.effects.effect.blind=function(b,c){var d,e,f,g=a(this),h=["position","top","bottom","left","right","height","width"],i=a.jqplot.effects.setMode(g,b.mode||"hide"),j=b.direction||"up",k=$.test(j),l=k?"height":"width",m=k?"top":"left",n=_.test(j),o={},p="show"===i;g.parent().is(".ui-effects-wrapper")?a.jqplot.effects.save(g.parent(),h):a.jqplot.effects.save(g,h),g.show(),f=parseInt(g.css("top"),10),d=a.jqplot.effects.createWrapper(g).css({overflow:"hidden"}),e=k?d[l]()+f:d[l](),o[l]=p?String(e):"0",n||(g.css(k?"bottom":"right",0).css(k?"top":"left","").css({position:"absolute"}),o[m]=p?"0":String(e)),p&&(d.css(l,0),n||d.css(m,e)),d.animate(o,{duration:b.duration,easing:b.easing,queue:!1,complete:function(){"hide"===i&&g.hide(),a.jqplot.effects.restore(g,h),a.jqplot.effects.removeWrapper(g),c()}})}}(jQuery);
1
+ /* jqPlot 1.0.8r1250.1 | (c) 2009-2013 Chris Leonello | jplot.com
2
+ jsDate | (c) 2010-2013 Chris Leonello
3
+ DST Patched for add/diff date functions.
4
  */
5
+ eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(26($){14 322;$.348.574=26(){51(14 17=0,132;(132=$(13)[17])!=18;17++){15(132.1182===1){$.1672(132.936("*"))}15($.22.553){132.1678=""}27{869(132.886){132.1361(132.886)}}132=18}37 $(13)};$.348.1343=26(484){869(484.886){13.1343(484.886);484.1361(484.886)}};$.348.22=26(){14 891=[];14 39=[];51(14 17=0,94=261.41;17<94;17++){15($.462(261[17])){891.103(261[17])}27 15($.723(261[17])){39.103(261[17])}}37 13.580(26(198){14 780,67,$13=$(13),1002=891.41,965=39.41,44,58;15(198<1002){44=891[198]}27{44=1002?891[1002-1]:18}15(198<965){58=39[198]}27{58=965?39[965-1]:18}780=$13.506(\'1285\');15(780===322){780=\'1664\'+$.22.1497++;$13.506(\'1285\',780)}67=$.22(780,44,58);$13.44(\'22\',67)})};$.22=26(91,44,39){14 738=18,368=18;15(261.41===3){738=44;368=39}27 15(261.41===2){15($.462(44)){738=44}27 15($.723(44)){368=44}}15(738===18&&368!==18&&368.44){738=368.44}14 67=86 1172();$(\'#\'+91).925(\'22-991\');15($.22.271.1424){1653{67.231(91,738,368);67.129();67.701.231.108(67);37 67}1644(202){14 1279=$.22.271.1418||202.1294;$(\'#\'+91).419(\'<409 900="22-991-1294">\'+1279+\'</409>\');$(\'#\'+91).401(\'22-991\');276.765(91).311.473=$.22.271.1393;276.765(91).311.551=$.22.271.1395;276.765(91).311.308=$.22.271.1390;276.765(91).311.296=$.22.271.1397;276.765(91).311.1498=$.22.271.1404;276.765(91).311.1184=$.22.271.1402}}27{67.231(91,738,368);67.129();67.701.231.108(67);37 67}};$.22.1292="1.0.8";$.22.1641="1250";$.22.1497=1;$.22.415=26(){15(266 $.22.415.612==\'322\'){$.22.415.612=[];$.22.415.833=[]}14 766=[];13.1082=26(){14 120;14 1096=52;15(!$.22.553){51(14 17=0,94=$.22.415.612.41;17<94;17++){15($.22.415.833[17]===52){1096=56;120=$.22.415.612[17];$.22.415.833[17]=56;766.103(17);83}}}15(1096){120=276.309(\'120\');766.103($.22.415.612.41);$.22.415.612.103(120);$.22.415.833.103(56)}37 120};13.1101=26(120){15($.22.553){37 345.471.1650(120)}37 120};13.1079=26(){51(14 17=0,94=766.41;17<94;17++){13.1470(766[17])}766=[]};13.1470=26(194){15($.22.553&&345.471.560!==322){345.471.560($.22.415.612[194]);$.22.415.612[194]=18}27{14 120=$.22.415.612[194];120.680(\'859\').427(0,0,120.137,120.141);$(120).1105().1410(\'900\').1410(\'311\');$(120).68({97:\'\',115:\'\',274:\'\'});120.137=0;120.141=0;$.22.415.833[194]=52}}};$.22.522=26(){15(345.1048){345.1048.522.422(345.1048,261)}};$.22.271={1485:56,1198:56,1453:300,1452:400,1627:56,1630:86 277(86 277().564()*1017),1418:\'\',1393:\'\',1395:\'\',1390:\'\',1397:\'\',1404:\'\',1402:\'\',1424:56,956:"%.1449",1138:["#1699","#1708","#1674","#1670","#1671","#1689","#1690","#1691","#1692","#1617","#1666","#1703","#1696","#1654","#1710","#1681"],1411:["#1677","#1626","#1623","#1658","#1657","#1642","#1646","#1648","#1647","#1649","#1652","#1663","#1638","#1619","#1618","#1714"],1117:4,1120:4,1374:2.5,1712:\'22/745/\',1713:\'22/745/356/\'};$.22.1388=26(607){37 55.111.422(55,607)};$.22.1391=26(607){37 55.98.422(55,607)};$.22.1198=$.22.271.1198;$.22.849=26(){15(266 $.22.849.483==\'322\'){$.22.849.483=!!276.309(\'120\').680}37 $.22.849.483};$.22.853=26(){15(266 $.22.853.483==\'322\'){15(345.471!==322&&345.471.1673>887){$.22.853.483=52}27{$.22.853.483=!!(276.309(\'120\').680&&266 276.309(\'120\').680(\'859\').817==\'26\')}}37 $.22.853.483};$.22.553=((!$.1203.1669||!$.1203.1679||!$1203.1628)&&!$.22.849())?52:56;$.22.545=[];$.22.529=[];$.22.809=[];$.22.807=[];$.22.811=[];$.22.590=[];$.22.831=[];$.22.1040=[];$.22.1032=[];$.22.952=[];$.22.534=[];$.22.536=[];$.22.808=[];$.22.812=[];$.22.472=[];$.22.1035=[];$.22.1025=[];$.22.321=26(){13.48;13.613;13.950;13.117={141:18,137:18}};$.22.321.62.309=26(166,125,840,1239,1405){13.378=125;14 837=840||\'22\';14 132=276.309(166);13.48=$(132);13.48.401(837);13.48.68(1239);13.48.506(1405);132=18;37 13.48};$.22.321.62.340=26(){15(13.48){37 13.48.716(52)}27{37 18}};$.22.321.62.327=26(){15(13.48){37 13.48.713(52)}27{37 18}};$.22.321.62.1189=26(){15(13.48){37 13.48.274()}27{37{115:18,97:18,172:18,163:18}}};$.22.321.62.1053=26(){37 13.1189().115};$.22.321.62.1303=26(){37 13.1189().97};$.22.321.62.1695=26(){37 13.48.68(\'172\')};$.22.321.62.1698=26(){37 13.48.68(\'163\')};26 320(88){$.22.321.108(13);13.88=88;13.448=[];13.89=56;13.874=$.22.623;13.364={};13.1467=$.22.566;13.744={};13.162=18;13.468=52;13.98=18;13.111=18;13.979=56;13.325=1.2;13.597=18;13.481=18;13.291=[];13.190;13.223;13.49=$.22.517;13.479={};13.1213=52;13.1415=52;13.1174=52;13.912=52;13.911=56;13.915=52;13.881=52;13.1161=56;13.318=18;13.267=18;13.947=56;13.514={98:18,111:18};13.1682=[];13.378={98:18,111:18};13.269=[];13.263=18;13.867=18;13.689=75;13.417=18;13.436=18;13.1216=18;13.739=18;13.1028=18;13.368={}}320.62=86 $.22.321();320.62.281=320;320.62.231=26(){15($.533(13.49)){13.49=86 13.49()}13.364.116=13.88;15(13.364.475==18){13.364.475=13.1213}15(13.364.475==18){13.364.475=13.1415}15(13.364.468==18){13.364.468=13.1213}15(13.162==18||13.162==\'\'){13.468=56}27{13.744.162=13.162}15(13.468==56){13.744.89=56}15(13.325==0){13.325=1.0}15(13.597==0){13.597=1.0}15(13.481==0){13.481=1.0}15(13.597==18){13.597=(13.325-1)/2+1}15(13.481==18){13.481=(13.325-1)/2+1}13.325=13.597+13.481-1;15(13.98!=18||13.111!=18){13.979=56}15(13.867==18&&13.88.435(\'76\')>-1){13.867=52}27 15(13.867==18){13.867=56}13.49.231.108(13,13.479)};320.62.129=26(59,67){15(13.1028){13.1028=18}37 13.49.129.108(13,59,67)};320.62.399=26(){13.49.399.108(13)};320.62.329=26(207,125){15(13.89){13.49.329.108(13,207,125)}15(13.417==18){13.417=13.98;13.436=13.111;13.1216=13.223;13.739=13.190;13.1028=13.269}};320.62.972=26(){13.49.972.108(13)};320.62.1095=26(58){$.177(52,13,{98:18,111:18,190:18,223:18,269:[],291:[]},58);13.1057()};320.62.1057=26(){14 381=13.514;381.98=18;381.111=18;14 94,33,57;14 620=(13.89)?52:56;51(14 17=0;17<13.448.41;17++){33=13.448[17];15(33.89||13.947){57=33.316;15(33.387===\'420\'&&33.49.118.89&&13.88.404(0)!==\'77\'){57=[[0,33.49.118.417],[1,33.49.118.436]]}14 870=1,872=1;15(33.387!=18&&33.387==\'1716\'){870=3;872=2}51(14 36=0,94=57.41;36<94;36++){15(13.88==\'243\'||13.88==\'282\'){15((57[36][0]!=18&&57[36][0]<381.98)||381.98==18){381.98=57[36][0]}15((57[36][0]!=18&&57[36][0]>381.111)||381.111==18){381.111=57[36][0]}}27{15((57[36][870]!=18&&57[36][870]<381.98)||381.98==18){381.98=57[36][870]}15((57[36][872]!=18&&57[36][872]>381.111)||381.111==18){381.111=57[36][872]}}}15(620&&33.49.281!==$.22.801){620=56}27 15(620&&13.368.439(\'826\')&&13.368.826==56){620=56}27 15(620&&33.49.281===$.22.801){15(33.1212==\'486\'&&13.88!=\'243\'&&13.88!=\'282\'){15(13.368.325!=18||13.368.481!=18){620=56}}27 15(33.1212==\'922\'&&(13.88==\'243\'||13.88==\'282\')){15(13.368.325!=18||13.368.481!=18){620=56}}}}}15(620&&13.49.281===$.22.517&&381.98>=0){13.481=1.0;13.826=52}};26 581(39){$.22.321.108(13);13.89=56;13.460=\'596\';13.1443=[];13.1432=52;13.1434=52;13.474="847";13.582=0;13.589=0;13.551;13.473;13.299;13.308;13.296;13.1389=\'0.1515\';13.49=$.22.790;13.479={};13.1330=56;13.511=18;13.568=18;13.575=18;13.507=18;13.918=56;13.448=[];$.177(52,13,39)}581.62=86 $.22.321();581.62.281=581;581.62.1296=26(39){$.177(52,13,39);15(13.474==\'539\'){13.474=\'847\'}15(13.582>0){15(13.474==\'847\'){317(13.460){74\'659\':74\'174\':74\'644\':15(13.507==18){13.507=13.582+\'265\'}13.568=\'336\';83;74\'596\':74\'202\':74\'652\':355:15(13.568==18){13.568=13.582+\'265\'}13.507=\'336\';83}}27 15(13.474==\'592\'){317(13.460){74\'659\':74\'174\':74\'644\':15(13.568==18){13.568=13.582+\'265\'}13.507=\'336\';83;74\'596\':74\'202\':74\'652\':355:15(13.507==18){13.507=13.582+\'265\'}13.568=\'336\';83}}13.582=0}15(13.589>0){15(13.474==\'592\'){317(13.460){74\'644\':74\'33\':74\'652\':15(13.511==18){13.511=13.589+\'265\'}13.575=\'336\';83;74\'596\':74\'81\':74\'659\':355:15(13.575==18){13.575=13.589+\'265\'}13.511=\'336\';83}}27 15(13.474==\'847\'){317(13.460){74\'644\':74\'33\':74\'652\':15(13.575==18){13.575=13.589+\'265\'}13.511=\'336\';83;74\'596\':74\'81\':74\'659\':355:15(13.511==18){13.511=13.589+\'265\'}13.575=\'336\';83}}13.589=0}};581.62.231=26(){15($.533(13.49)){13.49=86 13.49()}13.49.231.108(13,13.479)};581.62.129=26(125,67){51(14 17=0;17<$.22.1032.41;17++){$.22.1032[17].108(13,125)}37 13.49.129.108(13,125,67)};581.62.329=26(125){13.49.329.108(13,125)};26 669(357){$.22.321.108(13);13.357=357;13.89=52;13.308;13.296;13.463;13.299;13.49=$.22.893;13.479={};13.918=56}669.62=86 $.22.321();669.62.281=669;669.62.231=26(){15($.533(13.49)){13.49=86 13.49()}13.49.231.108(13,13.479)};669.62.129=26(137){37 13.49.129.108(13,137)};669.62.329=26(){13.49.329.108(13)};26 538(39){39=39||{};$.22.321.108(13);13.89=52;13.243=\'243\';13.326;13.301=\'301\';13.280;13.1356=2.0;13.49=$.22.516;13.479={};13.44=[];13.187=[];13.162=\'\';13.468=52;13.157;13.657;13.217=2.5;13.418=\'382\';13.305=\'382\';13.392=\'1085\';13.260=52;13.800=45;13.761=1.25;13.798=3;13.799=\'0.1\';13.1438=56;13.504=$.22.518;13.496={};13.774=52;13.937=52;13.198;13.156=56;13.443;13.1099;13.661=56;13.1043=56;13.593=56;13.1192=4;13.767=56;13.1171=0;13.968=\'76\';13.1218=52;13.394=[];13.316=[];13.827={77:[],76:[]};13.1676={77:{},76:{}};13.890=[];13.721=[];13.868=\'76\';13.1430=\'326\';13.120=86 $.22.498();13.289=86 $.22.498();13.356={};13.389=0;13.395=0;13.387=\'\'}538.62=86 $.22.321();538.62.281=538;538.62.231=26(198,1423,67){13.198=198;13.1356=1423;14 57=13.44;14 78=[],17,94;51(17=0,94=57.41;17<94;17++){15(!13.1438){15(57[17]==18||57[17][0]==18||57[17][1]==18){1193}27{78.103(57[17])}}27{78.103(57[17])}}13.44=78;15(!13.157){13.157=67.1090.449(13.198)}15(!13.657){13.657=67.1089.449(13.198)}15(!13.443){13.443=13.157}15(13.1099){14 752=$.22.1086(13.443);14 752=$.22.914(752);13.443=\'354(\'+752[0]+\',\'+752[1]+\',\'+752[2]+\',\'+13.1099+\')\'}15($.533(13.49)){13.49=86 13.49()}13.49.231.108(13,13.479,67);13.504=86 13.504();15(!13.496.157){13.496.157=13.157}15(13.496.89==18){13.496.89=13.937}13.937=13.496.89;13.504.231(13.496)};538.62.129=26(410,58,67){14 39=(58==322)?{}:58;410=(410==322)?13.120.314:410;14 36,44,187;51(36=0;36<$.22.831.41;36++){$.22.831[36].108(13,410,39)}15(13.89){13.49.1119.108(13,67);15(!39.1680){$(410.120).346(\'1667\',[13.44,13.187])}44=[];15(39.44){44=39.44}27 15(!13.593){44=13.44}27{44=13.316}187=39.187||13.49.1141.108(13,44,67);15(13.387===\'420\'&&13.49.333&&13.49.376.41){187=13.49.376}13.49.129.108(13,410,187,39,67)}51(36=0;36<$.22.1040.41;36++){$.22.1040[36].108(13,410,39,67)}410=58=67=36=44=187=18};538.62.879=26(410,58,67){14 39=(58==322)?{}:58;410=(410==322)?13.289.314:410;14 36,44,187;51(36=0;36<$.22.1035.41;36++){$.22.1035[36].108(13,410,39)}15(13.260){13.49.1119.108(13,67);44=[];15(39.44){44=39.44}27 15(!13.593){44=13.44}27{44=13.316}187=39.187||13.49.1141.108(13,44,67);13.49.879.108(13,410,187,39,67)}51(36=0;36<$.22.1025.41;36++){$.22.1025[36].108(13,410,39)}410=58=67=36=44=187=18};538.62.1668=26(126,497){14 33,247;15(126.44.40){33=126.44.40}27{33=13}15(126.44.247){247=126.44.247}15(247){15(33.120.48.588(\':591\')||!33.89){33.89=52;33.120.48.925(\'22-40-591\');15(33.289.48){33.289.48.1014(247)}33.120.48.1014(247,497);33.120.48.1031(\'.22-909-162.22-40-\'+33.198).1014(247)}27{33.89=56;33.120.48.401(\'22-40-591\');15(33.289.48){33.289.48.1094(247)}33.120.48.1094(247,497);33.120.48.1031(\'.22-909-162.22-40-\'+33.198).1094(247)}}27{15(33.120.48.588(\':591\')||!33.89){33.89=52;33.120.48.925(\'22-40-591\');15(33.289.48){33.289.48.89()}33.120.48.89(0,497);33.120.48.1031(\'.22-909-162.22-40-\'+33.198).89()}27{33.89=56;33.120.48.401(\'22-40-591\');15(33.289.48){33.289.48.505()}33.120.48.505(0,497);33.120.48.1031(\'.22-909-162.22-40-\'+33.198).505()}}};26 670(){$.22.321.108(13);13.759=52;13.1194=\'#1694\';13.467=1.0;13.473=\'#1700\';13.267=\'#1084\';13.318=2.0;13.1313=52;13.260=52;13.800=45;13.761=1.5;13.1342=3;13.798=3;13.1339=18;13.799=\'0.1088\';13.337;13.365;13.341;13.319;13.292;13.323;13.913=[];13.49=$.22.916;13.479={};13.378={115:18,172:18,97:18,163:18}}670.62=86 $.22.321();670.62.281=670;670.62.231=26(){15($.533(13.49)){13.49=86 13.49()}13.49.231.108(13,13.479)};670.62.309=26(125,67){13.378=125;37 13.49.309.108(13,67)};670.62.129=26(){13.49.129.108(13)};$.22.498=26(){$.22.321.108(13);13.314};$.22.498.62=86 $.22.321();$.22.498.62.281=$.22.498;$.22.498.62.309=26(125,840,1052,67){13.378=125;14 837=\'22\';15(840!=322){837=840}14 132;132=67.712.1082();15(1052!=18){13.117=1052}132.137=13.117.137-13.378.97-13.378.163;132.141=13.117.141-13.378.115-13.378.172;13.48=$(132);13.48.68({274:\'454\',97:13.378.97,115:13.378.115});13.48.401(837);132=67.712.1101(132);132=18;37 13.48};$.22.498.62.771=26(){13.314=13.48.449(0).680("859");37 13.314};$.22.498.62.1295=26(){15(13.48){15($.22.553&&345.471.560!==322){345.471.560(13.48.449(0))}13.48.574()}13.314=18};$.22.377=26(){13.234=[];13.287=[]};$.22.377.62.587=26(348,287){287=287||[];14 756=56;51(14 17=0,94=13.234.41;17<94;17++){15(13.234[17]==348){756=52}}15(!756){13.234.103(348);13.287.103(287)}};$.22.377.62.464=26(348,287){287=287||[];13.234.103(348);13.287.103(287)};$.22.1033=26(){13.234=[]};$.22.1033.62.587=26(126,348){14 756=56,201,17;51(14 17=0,94=13.234.41;17<94;17++){201=13.234[17];15(201[0]==126&&201[1]==348){756=52}}15(!756){13.234.103([126,348])}};$.22.1033.62.464=26(126,348){13.234.103([126,348])};14 426=[\'569\',\'243\',\'301\',\'282\',\'433\',\'548\',\'543\',\'542\',\'544\',\'547\',\'546\',\'571\'];26 1172(){13.882=56;13.1022=56;13.146={243:86 320(\'243\'),301:86 320(\'301\'),282:86 320(\'282\'),433:86 320(\'433\'),548:86 320(\'548\'),543:86 320(\'543\'),542:86 320(\'542\'),544:86 320(\'544\'),547:86 320(\'547\'),546:86 320(\'546\'),571:86 320(\'571\'),569:86 320(\'569\')};13.740=86 $.22.498();13.802=56;13.44=[];13.520;13.583;13.1427={1076:{},146:{243:{},301:{},282:{},433:{},548:{},543:{},542:{},544:{},547:{},546:{},571:{},569:{}},444:{},40:[]};13.804=1;13.1472=56;13.264=86 $.22.498();13.730={513:18,562:18,157:18,755:0,156:52};13.308;13.296;13.268=86 670();13.168=86 581();13.549={89:56,1377:\'1636 1633...\',146:{243:{98:0,111:10,223:2,89:52},301:{98:0,111:12,223:3,89:52}}};13.703=$.22.271.1411;13.39={};13.453=[];13.356={};13.40=[];13.298=[];13.488=$.22.271.1138;13.495=52;13.873=56;13.1612=52;13.1621=52;13.91=18;13.1049=18;13.299;13.258=86 669();13.1116=0;13.389=0;13.395=0;13.394=[];13.316=[];13.292=18;13.323=18;13.117={141:18,137:18};13.275={115:18,163:18,172:18,97:18};13.1364={115:10,163:10,172:23,97:10};13.1463=$.22.271.1485;13.545=86 $.22.377();13.529=86 $.22.377();13.809=86 $.22.377();13.807=86 $.22.377();13.811=86 $.22.377();13.590=86 $.22.377();13.831=86 $.22.377();13.1040=86 $.22.377();13.1032=86 $.22.377();13.952=86 $.22.377();13.534=86 $.22.377();13.536=86 $.22.377();13.808=86 $.22.377();13.812=86 $.22.377();13.472=86 $.22.1033();13.1035=86 $.22.377();13.1025=86 $.22.377();13.1090=86 $.22.1139();13.1089=86 $.22.1139();13.712=86 $.22.415();13.701=86 $.22.379();14 1651=0;13.231=26(91,44,39){39=39||{};51(14 17=0;17<$.22.545.41;17++){$.22.545[17].108(13,91,44,39)}51(14 17=0;17<13.545.234.41;17++){13.545.234[17].108(13,91,44,39)}13.1049=\'#\'+91;13.91=$(\'#\'+91);15(13.1463){13.91.44(\'22\',13)}13.91.925(\'22-991\');15(!13.91.449(0)){438 86 343("1175 67 91 1280")}15(13.91.68(\'274\')==\'1257\'){13.91.68(\'274\',\'885\')}15(!13.91.1051(\'22-91\')){13.91.401(\'22-91\')}15(!13.91.141()){14 201;15(39&&39.141){201=200(39.141,10)}27 15(13.91.506(\'44-141\')){201=200(13.91.506(\'44-141\'),10)}27{201=200($.22.271.1453,10)}13.323=201;13.91.68(\'141\',201+\'265\')}27{13.323=201=13.91.141()}15(!13.91.137()){14 174;15(39&&39.137){174=200(39.137,10)}27 15(13.91.506(\'44-137\')){174=200(13.91.506(\'44-137\'),10)}27{174=200($.22.271.1452,10)}13.292=174;13.91.68(\'137\',174+\'265\')}27{13.292=174=13.91.137()}51(14 17=0,94=426.41;17<94;17++){13.146[426[17]]=86 320(426[17])}13.117.141=13.323;13.117.137=13.292;13.268.117=13.117;13.258.117=13.117;13.740.117=13.117;13.264.117=13.117;13.168.117=13.117;15(13.323<=0||13.292<=0||!13.323||!13.292){438 86 343("1719 1160 1166 399")}15(39.520&&$.533(39.520)){15(39.583){13.583=39.583}13.520=39.520;44=13.520(44,13,13.583)}15(39.549&&$.723(39.549)){$.177(52,13.549,39.549)}15(44==18||$.462(44)==56||44.41==0||$.462(44[0])==56||44[0].41==0){15(13.549.89==56){438 86 343("1175 44 1280")}27{51(14 159 262 13.549.146){51(14 1111 262 13.549.146[159]){13.146[159][1111]=13.549.146[159][1111]}}13.590.464(26(){14 1077=13.264.327();14 1300=13.264.340();14 78=$(\'<409 900="22-1358-1665" 311="274:454;"></409>\');13.91.419(78);78.141(1077);78.137(1300);78.68(\'115\',13.264.378.115);78.68(\'97\',13.264.378.97);14 627=$(\'<409 900="22-1358-1289" 311="357-1705:662; 274:885; 777-97:728; 777-163:728;"></409>\');78.419(627);627.614(13.549.1377);14 145=627.141();14 1231=627.137();627.141(145);627.137(1231);627.68(\'115\',(1077-145)/2+\'265\')})}}13.44=$.177(52,[],44);13.1100(39);15(13.299){13.91.68(\'157\',13.299)}15(13.308){13.91.68(\'407-751\',13.308)}15(13.296){13.91.68(\'407-313\',13.296)}13.258.231();13.168.231();13.389=0;13.395=0;13.836();51(14 17=0;17<13.40.41;17++){13.298.103(17);13.453.103(17);13.40[17].289.117=13.117;13.40[17].120.117=13.117;51(14 36=0;36<$.22.534.41;36++){$.22.534[36].108(13.40[17],91,13.44,13.39.444,13.39.40[17],13)}51(14 36=0;36<13.534.234.41;36++){13.534.234[36].108(13.40[17],91,13.44,13.39.444,13.39.40[17],13)}13.40[17].117=13.117;13.40[17].231(17,13.268.318,13);51(14 36=0;36<$.22.536.41;36++){$.22.536[36].108(13.40[17],91,13.44,13.39.444,13.39.40[17],13)}51(14 36=0;36<13.536.234.41;36++){13.536.234[36].108(13.40[17],91,13.44,13.39.444,13.39.40[17],13)}13.389+=13.40[17].389;13.395+=13.40[17].395}14 88,116;51(14 17=0,94=426.41;17<94;17++){88=426[17];116=13.146[88];116.117=13.117;116.231();15(13.146[88].267==18){15(88.404(0)!==\'77\'&&116.1161===52&&116.89){116.267=116.448[0].157}27{116.267=13.268.267}}}15(13.495){495(13.40)}13.268.231();13.268.913=13.146;13.168.448=13.40;51(14 17=0;17<$.22.529.41;17++){$.22.529[17].108(13,91,13.44,39)}51(14 17=0;17<13.529.234.41;17++){13.529.234[17].108(13,91,13.44,39)}};13.1368=26(146,39){14 58=39||{};14 159=146||13.146;15(159===52){159=13.146}15($.462(159)){51(14 17=0;17<159.41;17++){13.146[159[17]].1095(58[159[17]])}}27 15(266(159)===\'416\'){51(14 88 262 159){13.146[88].1095(58[88])}}};13.1351=26(44,58){14 39=$.177(52,{},13.39,58);14 91=13.1049.1709(1);14 1130=(44==18)?13.44:44;51(14 17=0;17<$.22.545.41;17++){$.22.545[17].108(13,91,1130,39)}51(14 17=0;17<13.545.234.41;17++){13.545.234[17].108(13,91,1130,39)}13.323=13.91.141();13.292=13.91.137();15(13.323<=0||13.292<=0||!13.323||!13.292){438 86 343("1207 1160 1166 399")}13.117.141=13.323;13.117.137=13.292;13.268.117=13.117;13.258.117=13.117;13.740.117=13.117;13.264.117=13.117;13.168.117=13.117;14 88,54,36,116;51(14 17=0,94=426.41;17<94;17++){88=426[17];116=13.146[88];54=116.269;51(14 36=0,1348=54.41;36<1348;36++){14 166=54[36].48;15(166){15($.22.553&&345.471.560!==322){345.471.560(166.449(0))}166.574();166=18;54.48=18}}54=18;598 116.291;598 116.269;13.146[88]=86 320(88);13.146[88].613=13.292;13.146[88].950=13.323}15(44){15(39.520&&$.533(39.520)){15(39.583){13.583=39.583}13.520=39.520;44=13.520(44,13,13.583)}13.44=$.177(52,[],44)}15(58){13.1100(39)}13.258.613=13.292;15(13.299){13.91.68(\'157\',13.299)}15(13.308){13.91.68(\'407-751\',13.308)}15(13.296){13.91.68(\'407-313\',13.296)}13.258.231();13.168.231();13.389=0;13.395=0;13.298=[];13.453=[];13.836();51(14 17=0,94=13.40.41;17<94;17++){13.298.103(17);13.453.103(17);13.40[17].289.117=13.117;13.40[17].120.117=13.117;51(14 36=0;36<$.22.534.41;36++){$.22.534[36].108(13.40[17],91,13.44,13.39.444,13.39.40[17],13)}51(14 36=0;36<13.534.234.41;36++){13.534.234[36].108(13.40[17],91,13.44,13.39.444,13.39.40[17],13)}13.40[17].117=13.117;13.40[17].231(17,13.268.318,13);51(14 36=0;36<$.22.536.41;36++){$.22.536[36].108(13.40[17],91,13.44,13.39.444,13.39.40[17],13)}51(14 36=0;36<13.536.234.41;36++){13.536.234[36].108(13.40[17],91,13.44,13.39.444,13.39.40[17],13)}13.389+=13.40[17].389;13.395+=13.40[17].395}51(14 17=0,94=426.41;17<94;17++){88=426[17];116=13.146[88];116.117=13.117;116.231();15(116.267==18){15(88.404(0)!==\'77\'&&116.1161===52&&116.89){116.267=116.448[0].157}27{116.267=13.268.267}}}15(13.495){495(13.40)}13.268.231();13.268.913=13.146;13.168.448=13.40;51(14 17=0,94=$.22.529.41;17<94;17++){$.22.529[17].108(13,91,13.44,39)}51(14 17=0,94=13.529.234.41;17<94;17++){13.529.234[17].108(13,91,13.44,39)}};13.1383=26(){13.323=13.91.141();13.292=13.91.137();15(13.323<=0||13.292<=0||!13.323||!13.292){438 86 343("1207 1160 1166 399")}13.117.141=13.323;13.117.137=13.292;13.268.117=13.117;13.258.117=13.117;13.740.117=13.117;13.264.117=13.117;13.168.117=13.117;51(14 81 262 13.146){13.146[81].613=13.292;13.146[81].950=13.323}13.258.613=13.292;15(13.299){13.91.68(\'157\',13.299)}15(13.308){13.91.68(\'407-751\',13.308)}15(13.296){13.91.68(\'407-313\',13.296)}13.389=0;13.395=0;13.836();51(14 17=0;17<13.40.41;17++){15(13.40[17].387===\'420\'&&13.40[17].49.118.89){13.40[17].49.1128.108(13.40[17],13.40[17].49.39,13)}13.40[17].117=13.117;13.40[17].120.117=13.117;13.389+=13.40[17].389;13.395+=13.40[17].395}14 88;51(14 36=0;36<12;36++){88=426[36];14 54=13.146[88].269;51(14 17=0;17<54.41;17++){14 166=54[17].48;15(166){15($.22.553&&345.471.560!==322){345.471.560(166.449(0))}166.574();166=18;54.48=18}}54=18;13.146[88].117=13.117;13.146[88].269=[]}15(13.495){495(13.40)}13.268.913=13.146;13.168.448=13.40};26 495(40){14 57,383,773,1622,171;51(14 17=0;17<40.41;17++){14 806;14 1219=[40[17].44,40[17].394,40[17].316,40[17].890];51(14 81=0;81<4;81++){806=52;57=1219[81];15(40[17].868==\'77\'){51(14 36=0;36<57.41;36++){15(266(57[36][1])!="195"){806=56;83}}15(806){57.951(26(84,109){37 84[1]-109[1]})}}27{51(14 36=0;36<57.41;36++){15(266(57[36][0])!="195"){806=56;83}}15(806){57.951(26(84,109){37 84[0]-109[0]})}}}}}13.836=26(){13.316=[];13.394=[];14 40,198,94;51(198=0,94=13.40.41;198<94;198++){40=13.40[198];13.316.103([]);13.394.103([]);14 633=40.44;13.316[198]=$.177(52,[],633);13.394[198]=$.177(52,[],633);40.316=13.316[198];40.394=13.394[198];14 524={77:[],76:[]};15(13.873&&!40.1043){40.593=52;14 445=(40.868===\'77\')?0:1;51(14 347=0,1412=633.41;347<1412;347++){14 78=633[347][445];15(78==18){78=0}13.316[198][347][445]=78;13.394[198][347][445]=78;15(198>0){51(14 36=198;36--;){14 957=13.316[36][347][445];15(78*957>=0){13.316[198][347][445]+=957;13.394[198][347][445]+=957;83}}}}}27{51(14 17=0;17<40.44.41;17++){524.77.103(40.44[17][0]);524.76.103(40.44[17][1])}13.394.103(40.44);13.40[198].394=40.44;13.316.103(40.44);40.316=40.44;40.827=524}15(198>0){40.890=13.40[198-1].316}40.389=0;40.395=0;51(17=40.44.41-1;17>-1;17--){40.389+=40.44[17][1];40.395+=40.44[17][0]}}};13.1635=26(40,198){13.316=[];13.394=[];40.394=[];40.316=[];14 524={77:[],76:[]};15(13.873&&!40.1043){40.593=52;14 445=(40.868===\'77\')?0:1;14 78=$.177(52,[],40.44);14 682=$.177(52,[],40.44);14 559,1004,803,1009,1697;51(14 36=0;36<198;36++){14 633=13.40[36].44;51(14 347=0;347<633.41;347++){803=633[347];559=(803[0]!=18)?803[0]:0;1004=(803[1]!=18)?803[1]:0;78[347][0]+=559;78[347][1]+=1004;1009=(445)?1004:559;15(40.44[347][445]*1009>=0){682[347][445]+=1009}}}51(14 17=0;17<682.41;17++){524.77.103(682[17][0]);524.76.103(682[17][1])}13.316.103(682);13.394.103(78);40.394=78;40.316=682;40.827=524}27{51(14 17=0;17<40.44.41;17++){524.77.103(40.44[17][0]);524.76.103(40.44[17][1])}13.394.103(40.44);13.40[198].394=40.44;13.316.103(40.44);40.316=40.44;40.827=524}15(198>0){40.890=13.40[198-1].316}40.389=0;40.395=0;51(17=40.44.41-1;17>-1;17--){40.389+=40.44[17][1];40.395+=40.44[17][0]}};13.1687=(26(54){14 194=0;14 953=54.488;37 26(){15(194<953.41){37 953[194++]}27{194=0;37 953[194++]}}})(13);13.1100=26(39){51(14 17=0;17<13.809.234.41;17++){13.809.234[17].108(13,39)}51(14 17=0;17<$.22.809.41;17++){$.22.809[17].108(13,39)}13.39=$.177(52,{},13.1427,39);14 58=13.39;13.882=58.882;13.1022=58.1022;13.873=58.873;15($.723(58.730)){14 78=[\'513\',\'562\',\'157\',\'755\',\'156\'],862;51(14 17=0,94=78.41;17<94;17++){862=78[17];15(58.730[862]!=18){13.730[862]=58.730[862]}}}15(58.488){13.488=58.488}15(58.703){13.703=58.703}15(58.802){13.802=58.802}13.804=(39&&39.804!=18)?39.804:13.804;13.1090.1133(13.488);13.1089.1133(13.703);$.177(52,13.275,58.344);13.495=(58.495!=18)?58.495:13.495;51(14 17=0;17<12;17++){14 81=426[17];14 116=13.146[81];116.368=$.177(52,{},58.1076,58.146[81]);$.177(52,116,58.1076,58.146[81]);116.613=13.292;116.950=13.323}14 1392=26(44,698,823){14 78=[];14 17,94;698=698||\'486\';15(!$.462(44[0])){51(17=0,94=44.41;17<94;17++){15(698==\'486\'){78.103([823+17,44[17]])}27{78.103([44[17],823+17])}}}27{$.177(52,78,44)}37 78};14 1704=0;13.40=[];51(14 17=0;17<13.44.41;17++){14 679=$.177(52,{198:17},{488:13.488,703:13.703},13.39.444,13.39.40[17],{479:{440:{89:13.882}}});14 78=86 538(679);51(14 36=0;36<$.22.808.41;36++){$.22.808[36].108(78,13.39.444,13.39.40[17])}51(14 36=0;36<13.808.234.41;36++){13.808.234[36].108(78,13.39.444,13.39.40[17])}$.177(52,78,679);14 698=\'486\';15(78.49===$.22.801&&78.479&&78.479.1212==\'922\'){698=\'922\';78.868=\'77\';78.1430=\'280\'}78.44=1392(13.44[17],698,13.804);317(78.243){74\'243\':78.326=13.146.243;83;74\'282\':78.326=13.146.282;83;355:83}78.280=13.146[78.301];78.326.448.103(78);78.280.448.103(78);15(78.89){78.326.89=52;78.280.89=52}27{15(78.326.947){78.326.89=52}15(78.280.947){78.280.89=52}}15(!78.162){78.162=\'538 \'+(17+1).452()}13.40.103(78);51(14 36=0;36<$.22.812.41;36++){$.22.812[36].108(13.40[17],13.39.444,13.39.40[17])}51(14 36=0;36<13.812.234.41;36++){13.812.234[36].108(13.40[17],13.39.444,13.39.40[17])}}$.177(52,13.268,13.39.268);51(14 17=0,94=426.41;17<94;17++){14 81=426[17];14 116=13.146[81];15(116.318==18){116.318=13.268.318}}15(266 13.39.258==\'906\'){13.258.357=13.39.258}27 15(266 13.39.258==\'416\'){$.177(52,13.258,13.39.258)}13.258.613=13.292;13.168.1296(13.39.168);51(14 17=0;17<$.22.807.41;17++){$.22.807[17].108(13,39)}51(14 17=0;17<13.807.234.41;17++){13.807.234[17].108(13,39)}};13.1249=26(){13.712.1079();15(13.264&&13.264.48){13.264.48.1105()}13.91.1180();13.91[0].1613=\'\'};13.1614=26(39){14 58=39||{};14 44=58.44||18;14 585=(58.585===56)?56:52;14 854=58.854||56;598 58.44;598 58.585;598 58.854;13.91.346(\'1616\');15(585){13.1249()}15(44||!$.1625(58)){13.1351(44,58)}27{13.1383()}15(854){13.1368(854,58.146)}13.129();13.91.346(\'1632\')};13.1624=26(585){585=(585!=18)?585:52;13.91.346(\'1645\');15(585){13.712.1079();13.264.48.1105();13.91.1180()}51(14 159 262 13.146){13.146[159].269=[]}13.836();13.389=0;13.395=0;51(14 17=0,1431=13.40.41;17<1431;17++){13.389+=13.40[17].389;13.395+=13.40[17].395}13.129();13.91.346(\'1629\')};13.129=26(){15(13.1472||13.91.588(\':1243\')){13.91.346(\'1659\');14 17,36,94,1660;51(17=0,94=$.22.811.41;17<94;17++){$.22.811[17].108(13)}51(17=0,94=13.811.234.41;17<94;17++){13.811.234[17].422(13,13.831.287[17])}13.91.419(13.740.309({97:0,163:0,115:0,172:0},\'22-981-120\',18,13));13.740.771();13.91.419(13.258.129());13.258.329({115:0,97:0});14 793=13.168.129({},13);14 344={115:0,97:0,172:0,163:0};15(13.168.474=="1355"){13.91.419(793);317(13.168.460){74\'81\':344.115+=13.168.327();83;74\'33\':344.172+=13.168.327();83;74\'596\':74\'202\':74\'652\':344.163+=13.168.340();83;74\'659\':74\'174\':74\'644\':344.97+=13.168.340();83;355:344.163+=13.168.340();83}793=793.626()}14 159=13.146;14 88;51(17=0;17<12;17++){88=426[17];13.91.419(159[88].129(13.740.314,13));159[88].399()}15(159.301.89){344.97+=159.301.340()}14 1038=[\'433\',\'548\',\'543\',\'542\',\'544\',\'547\',\'546\',\'571\'];14 1122=[0,0,0,0,0,0,0,0];14 1016=0;14 81;51(81=0;81<8;81++){15(159[1038[81]].89){1016+=159[1038[81]].340();1122[81]=1016}}344.163+=1016;15(159.282.89){344.115+=159.282.327()}15(13.258.89){344.115+=13.258.327()}15(159.243.89){344.172+=159.243.327()}15(13.39.1015&&$.723(13.39.1015)){14 1287=200(13.39.1015.137,10)||0;14 1233=200(13.39.1015.141,10)||0;14 1021=(13.292-344.97-344.163-1287)/2;14 1013=(13.323-344.115-344.172-1233)/2;15(1013>=0&&1021>=0){344.115+=1013;344.172+=1013;344.97+=1021;344.163+=1021}}14 424=[\'115\',\'172\',\'97\',\'163\'];51(14 81 262 424){15(13.275[424[81]]==18&&344[424[81]]>0){13.275[424[81]]=344[424[81]]}27 15(13.275[424[81]]==18){13.275[424[81]]=13.1364[424[81]]}}14 760=13.275;15(13.168.474===\'1355\'){760={115:13.258.327(),97:0,163:0,172:0};15(13.168.460===\'33\'){760.97=13.275.97;760.163=13.275.163}}159.243.329({274:\'454\',172:13.275.172-159.243.327(),97:0,137:13.292},{98:13.275.97,111:13.292-13.275.163});159.301.329({274:\'454\',115:0,97:13.275.97-159.301.340(),141:13.323},{98:13.323-13.275.172,111:13.275.115});159.282.329({274:\'454\',115:13.275.115-159.282.327(),97:0,137:13.292},{98:13.275.97,111:13.292-13.275.163});51(17=8;17>0;17--){159[1038[17-1]].329({274:\'454\',115:0,163:13.275.163-1122[17-1]},{98:13.323-13.275.172,111:13.275.115})}14 1444=(13.292-13.275.97-13.275.163)/2.0+13.275.97-159.569.340()/2.0;159.569.329({274:\'454\',115:0,97:1444,1227:9,463:\'662\'},{98:13.323-13.275.172,111:13.275.115});13.91.419(13.268.309(13.275,13));13.268.129();14 40=13.40;14 650=40.41;51(17=0,94=650;17<94;17++){36=13.298[17];13.91.419(40[36].289.309(13.275,\'22-40-289\',18,13));40[36].289.771();40[36].289.48.44(\'332\',36)}51(17=0,94=650;17<94;17++){36=13.298[17];13.91.419(40[36].120.309(13.275,\'22-40-120\',18,13));40[36].120.771();40[36].120.48.44(\'332\',36)}13.91.419(13.264.309(13.275,\'22-1521-120\',18,13));13.264.771();13.264.314.297=\'354(0,0,0,0)\';13.264.314.369(0,0,13.264.314.120.137,13.264.314.120.141);13.1482();15(13.168.1330){13.264.48.959(793);13.168.329(760);15(13.168.48){13.825({1720:{460:13.168.460,474:13.168.474,137:13.168.340(),141:13.168.327(),582:13.168.582,589:13.168.589}})}27{13.825()}}27{13.825();15(650){$(40[650-1].120.48).732(793)}13.168.329(760)}51(14 17=0,94=$.22.472.41;17<94;17++){13.264.48.508($.22.472[17][0],{67:13},$.22.472[17][1])}51(14 17=0,94=13.472.234.41;17<94;17++){13.264.48.508(13.472.234[17][0],{67:13},13.472.234[17][1])}14 432=13.730;15(432.156&&432.513!==432.562&&432.513<650&&432.562<650&&40[432.513].387===\'420\'&&40[432.562].387===\'420\'){13.1224()}51(14 17=0,94=$.22.590.41;17<94;17++){$.22.590[17].108(13)}51(14 17=0,94=13.590.234.41;17<94;17++){13.590.234[17].422(13,13.590.287[17])}15(13.91.588(\':1243\')){13.1116+=1}14 714,338,1118,892;51(17=0,94=650;17<94;17++){714=40[17];338=714.49;1118=\'.22-909-162.22-40-\'+17;15(338.440&&338.440.1369&&338.440.89&&(13.1116<2||13.1022)){892=13.91.1034(1118);892.1140(52,52).505();714.120.48.1140(52,52).505();714.289.48.1140(52,52).505();714.120.48.1110(\'1127\',{370:\'89\',584:338.440.584},338.440.247);714.289.48.1110(\'1127\',{370:\'89\',584:338.440.584},338.440.247);892.1014(338.440.247*0.8)}}892=18;13.91.346(\'1639\',[13])}};1172.62.1224=26(){14 432=13.730;14 757=432.513;14 897=432.562;14 1173=(757<897)?757:897;14 1262=(897>757)?897:757;14 513=13.40[1173];14 562=13.40[1262];15(562.49.333){14 437=562.49.376.279(0).521()}27{14 437=562.187.279(0).521()}15(513.49.333){14 110=513.49.376.852(437)}27{14 110=513.187.852(437)}14 157=(432.157!==18)?432.157:13.40[757].443;14 755=(432.755!==18)?432.755:1173;14 1477=13.40[755].49.303;14 58={297:157,156:52,229:52};1477.129(513.289.314,110,58)};13.1482=26(){13.264.48.508(\'1662\',{67:13},13.1502);13.264.48.508(\'1656\',{67:13},13.1488);13.264.48.508(\'1707\',{67:13},13.1478);13.264.48.508(\'1717\',{67:13},13.1293);13.264.48.508(\'1611\',{67:13},13.1408);13.264.48.508(\'1264\',{67:13},13.1394);15(13.802){13.264.48.508(\'1445\',{67:13},13.1366);13.264.48.449(0).1693=26(){37 56}}27{13.264.48.508(\'1445\',{67:13},13.1436)}};26 604(126){14 67=126.44.67;14 1026=67.264.48.386();14 391={77:126.288-1026.97,76:126.284-1026.115};14 480={243:18,301:18,282:18,433:18,548:18,543:18,542:18,544:18,547:18,546:18,571:18,569:18};14 1457=[\'243\',\'301\',\'282\',\'433\',\'548\',\'543\',\'542\',\'544\',\'547\',\'546\',\'571\',\'569\'];14 159=67.146;14 81,116;51(81=11;81>0;81--){116=1457[81-1];15(159[116].89){480[116]=159[116].595(391[116.404(0)])}}37{125:1026,391:391,480:480}}26 784(315,67){14 40=67.40;14 17,36,347,33,151,77,76,307,704,705,842,850;14 578,57,93,1685,121,1686,1012;14 636,54;51(347=67.298.41-1;347>=0;347--){17=67.298[347];33=40[17];1012=33.1711;317(33.49.281){74 $.22.801:77=315.77;76=315.76;51(36=0;36<33.754.41;36++){121=33.754[36];93=33.187[36];15(77>121[0][0]&&77<121[2][0]&&76>121[2][1]&&76<121[0][1]){37{332:33.198,362:36,187:93,44:33.44[36],121:33.754[36]}}}83;74 $.22.1661:77=315.77;76=315.76;51(36=0;36<33.754.41;36++){121=33.754[36];93=33.187[36];15(77>121[0][0]+1012[0][0]&&77<121[2][0]+1012[2][0]&&76>121[2][1]&&76<121[0][1]){37{332:33.198,362:36,187:93,44:33.44[36],121:33.754[36]}}}83;74 $.22.1471:705=33.1042/180*55.367;77=315.77-33.1018[0];76=315.76-33.1018[1];151=55.722(55.257(77,2)+55.257(76,2));15(77>0&&-76>=0){307=2*55.367-55.653(-76/77)}27 15(77>0&&-76<0){307=-55.653(-76/77)}27 15(77<0){307=55.367-55.653(-76/77)}27 15(77==0&&-76>0){307=3*55.367/2}27 15(77==0&&-76<0){307=55.367/2}27 15(77==0&&76==0){307=0}15(705){307-=705;15(307<0){307+=2*55.367}27 15(307>2*55.367){307-=2*55.367}}704=33.1039/180*55.367;15(151<33.1246&&151>33.1615){51(36=0;36<33.187.41;36++){842=(36>0)?33.187[36-1][1]+704:704;850=33.187[36][1];15(307>842&&307<850){37{332:33.198,362:36,187:[315.77,315.76],44:33.44[36]}}}}83;74 $.22.1468:705=33.1042/180*55.367;77=315.77-33.1018[0];76=315.76-33.1018[1];151=55.722(55.257(77,2)+55.257(76,2));15(77>0&&-76>=0){307=2*55.367-55.653(-76/77)}27 15(77>0&&-76<0){307=-55.653(-76/77)}27 15(77<0){307=55.367-55.653(-76/77)}27 15(77==0&&-76>0){307=3*55.367/2}27 15(77==0&&-76<0){307=55.367/2}27 15(77==0&&76==0){307=0}15(705){307-=705;15(307<0){307+=2*55.367}27 15(307>2*55.367){307-=2*55.367}}704=33.1039/180*55.367;15(151<33.1246){51(36=0;36<33.187.41;36++){842=(36>0)?33.187[36-1][1]+704:704;850=33.187[36][1];15(307>842&&307<850){37{332:33.198,362:36,187:[315.77,315.76],44:33.44[36]}}}}83;74 $.22.1702:77=315.77;76=315.76;14 171=18;15(33.89){51(14 36=0;36<33.187.41;36++){93=33.187[36];57=55.722((77-93[0])*(77-93[0])+(76-93[1])*(76-93[1]));15(57<=93[2]&&(57<=578||578==18)){578=57;171={332:17,362:36,187:93,44:33.44[36]}}}15(171!=18){37 171}}83;74 $.22.1473:77=315.77;76=315.76;14 668=33.1701,1199=668[0],1059=668[668.41-1],1206,1204,960;26 1197(94,637,861){14 197=(637[1]-861[1])/(637[0]-861[0]);14 109=637[1]-197*637[0];14 76=94+637[1];37[(76-109)/197,76]}1206=1197(76,1199[0],1059[3]);1204=1197(76,1199[1],1059[2]);51(36=0;36<668.41;36++){960=668[36];15(76>=960[0][1]&&76<=960[3][1]&&77>=1206[0]&&77<=1204[0]){37{332:33.198,362:36,187:18,44:33.44[36]}}}83;74 $.22.516:77=315.77;76=315.76;151=33.49;15(33.89){15((33.156||(33.49.118.89&&33.49.118.156))&&(!67.356.813||!67.356.813.89)){14 539=56;15(77>33.779[0][0]&&77<33.779[1][0]&&76>33.779[1][1]&&76<33.779[0][1]){14 1205=33.408.41;14 702;14 36=1205-1;51(14 702=0;702<1205;702++){14 710=[33.408[702][0],33.408[702][1]];14 843=[33.408[36][0],33.408[36][1]];15(710[1]<76&&843[1]>=76||843[1]<76&&710[1]>=76){15(710[0]+(76-710[1])/(843[1]-710[1])*(843[0]-710[0])<77){539=!539}}36=702}}15(539){37{332:17,362:18,187:33.187,44:33.44,121:33.408}}83}27{54=33.504.313/2+33.1192;636=(54>0)?54:0;51(14 36=0;36<33.187.41;36++){93=33.187[36];15(151.281==$.22.1215){15(151.1387){14 249=33.280.398;15(77>=93[0]-151.949/2&&77<=93[0]+151.949/2&&76>=249(33.44[36][2])&&76<=249(33.44[36][3])){37{332:17,362:36,187:93,44:33.44[36]}}}27 15(!151.1271){14 249=33.280.398;15(77>=93[0]-151.648&&77<=93[0]+151.648&&76>=249(33.44[36][2])&&76<=249(33.44[36][3])){37{332:17,362:36,187:93,44:33.44[36]}}}27{14 249=33.280.398;15(77>=93[0]-151.648&&77<=93[0]+151.648&&76>=249(33.44[36][1])&&76<=249(33.44[36][2])){37{332:17,362:36,187:93,44:33.44[36]}}}}27 15(93[0]!=18&&93[1]!=18){57=55.722((77-93[0])*(77-93[0])+(76-93[1])*(76-93[1]));15(57<=636&&(57<=578||578==18)){578=57;37{332:17,362:36,187:93,44:33.44[36]}}}}}}83;355:77=315.77;76=315.76;151=33.49;15(33.89){54=33.504.313/2+33.1192;636=(54>0)?54:0;51(14 36=0;36<33.187.41;36++){93=33.187[36];15(151.281==$.22.1215){15(151.1387){14 249=33.280.398;15(77>=93[0]-151.949/2&&77<=93[0]+151.949/2&&76>=249(33.44[36][2])&&76<=249(33.44[36][3])){37{332:17,362:36,187:93,44:33.44[36]}}}27 15(!151.1271){14 249=33.280.398;15(77>=93[0]-151.648&&77<=93[0]+151.648&&76>=249(33.44[36][2])&&76<=249(33.44[36][3])){37{332:17,362:36,187:93,44:33.44[36]}}}27{14 249=33.280.398;15(77>=93[0]-151.648&&77<=93[0]+151.648&&76>=249(33.44[36][1])&&76<=249(33.44[36][2])){37{332:17,362:36,187:93,44:33.44[36]}}}}27{57=55.722((77-93[0])*(77-93[0])+(76-93[1])*(76-93[1]));15(57<=636&&(57<=578||578==18)){578=57;37{332:17,362:36,187:93,44:33.44[36]}}}}}83}}37 18}13.1502=26(126){14 278=604(126);14 93=126.44.67;14 236=784(278.391,93);14 167=$.447(\'1365\');167.288=126.288;167.284=126.284;$(13).346(167,[278.391,278.480,236,93])};13.1488=26(126){14 278=604(126);14 93=126.44.67;14 236=784(278.391,93);14 167=$.447(\'1640\');167.288=126.288;167.284=126.284;$(13).346(167,[278.391,278.480,236,93])};13.1478=26(126){14 278=604(126);14 93=126.44.67;14 236=784(278.391,93);14 167=$.447(\'1380\');167.288=126.288;167.284=126.284;$(13).346(167,[278.391,278.480,236,93])};13.1436=26(126){14 278=604(126);14 167=$.447(\'1131\');167.288=126.288;167.284=126.284;$(13).346(167,[278.391,278.480,18,126.44.67])};13.1366=26(126){14 278=604(126);14 93=126.44.67;14 236=784(278.391,93);15(93.802){15(126.616==3){14 167=$.447(\'1353\');167.288=126.288;167.284=126.284;$(13).346(167,[278.391,278.480,236,93])}27{14 167=$.447(\'1131\');167.288=126.288;167.284=126.284;$(13).346(167,[278.391,278.480,236,93])}}};13.1293=26(126){14 278=604(126);14 93=126.44.67;14 236=784(278.391,93);14 167=$.447(\'1379\');167.288=126.288;167.284=126.284;$(13).346(167,[278.391,278.480,236,93])};13.1408=26(126){14 278=604(126);14 93=126.44.67;14 167=$.447(\'1634\');167.288=126.288;167.284=126.284;167.1007=126.1007;$(13).346(167,[278.391,278.480,18,93])};13.1394=26(126){14 278=604(126);14 93=126.44.67;14 167=$.447(\'1683\');167.288=126.288;167.284=126.284;167.1007=126.1007;$(13).346(167,[278.391,278.480,18,93])};13.825=26(39,194){14 17,40,59;194=(266(39)==="195"&&194==18)?39:194;39=(266(39)==="416")?39:{};15(194!=322){40=13.40[194];59=40.289.314;59.427(0,0,59.120.137,59.120.141);40.879(59,39,13);59=40.120.314;59.427(0,0,59.120.137,59.120.141);40.129(59,39,13);15(40.49.281==$.22.1450){15(194<13.40.41-1){13.825(194+1)}}}27{51(17=0;17<13.40.41;17++){40=13.40[17];59=40.289.314;59.427(0,0,59.120.137,59.120.141);40.879(59,39,13);59=40.120.314;59.427(0,0,59.120.137,59.120.141);40.129(59,39,13)}}39=194=17=40=59=18};13.1631=26(194){194=200(194,10);14 628=$.816(194,13.298);15(628==-1){37}15(628==13.298.41-1){13.453=13.298.279(0);37}14 768=13.298[13.298.41-1];14 572=13.40[194].120.48.626();14 573=13.40[194].289.48.626();13.40[768].289.48.732(573);13.40[768].120.48.732(572);13.453=13.298.279(0);13.298.1409(628,1);13.298.103(194)};13.1637=26(194){194=200(194,10);14 628=$.816(194,13.298);15(628==0||628==-1){37}14 768=13.298[0];14 572=13.40[194].120.48.626();14 573=13.40[194].289.48.626();13.40[768].289.48.959(573);13.40[768].120.48.959(572);13.453=13.298.279(0);13.298.1409(628,1);13.298.1229(194)};13.1655=26(){14 17,36,572,573,78,490,978;15(13.298==13.453){37}51(17=1;17<13.453.41;17++){490=13.453[17];978=13.453[17-1];572=13.40[490].120.48.626();573=13.40[490].289.48.626();13.40[978].289.48.732(573);13.40[978].120.48.732(572)}78=13.298.279(0);13.298=13.453.279(0);13.453=78};13.1643=26(){14 17,36,424=[],572,573;51(17=0;17<13.40.41;17++){424.103(17)}15(13.298==424){37}13.453=13.298.279(0);13.298=424;51(17=1;17<13.298.41;17++){572=13.40[17].120.48.626();573=13.40[17].289.48.626();13.40[17-1].289.48.732(573);13.40[17-1].120.48.732(572)}};13.1620=26(88){13.701.1490(13,88)}}$.22.1384=26(393){14 171;15($.462(393)){171=[];51(14 17=0;17<393.41;17++){14 354=$.22.914(393[17]);14 270=[354[0],354[1],354[2]];14 1003=270[0]+270[1]+270[2];51(14 36=0;36<3;36++){270[36]=(1003>660)?270[36]*0.85:0.73*270[36]+90;270[36]=200(270[36],10);(270[36]>255)?255:270[36]}270[3]=0.3+0.35*354[3];171.103(\'354(\'+270[0]+\',\'+270[1]+\',\'+270[2]+\',\'+270[3]+\')\')}}27{14 354=$.22.914(393);14 270=[354[0],354[1],354[2]];14 1003=270[0]+270[1]+270[2];51(14 36=0;36<3;36++){270[36]=(1003>660)?270[36]*0.85:0.73*270[36]+90;270[36]=200(270[36],10);(270[36]>255)?255:270[36]}270[3]=0.3+0.35*354[3];171=\'354(\'+270[0]+\',\'+270[1]+\',\'+270[2]+\',\'+270[3]+\')\'}37 171};$.22.1139=26(393){393=393||$.22.271.1138;14 194=0;13.904=26(){15(194<393.41){37 393[194++]}27{194=0;37 393[194++]}};13.1706=26(){15(194>0){37 393[194--]}27{194=393.41-1;37 393[194]}};13.449=26(17){14 194=17-393.41*55.390(17/393.41);37 393[194]};13.1133=26(482){393=482};13.972=26(){194=0};13.1718=26(){37 194};13.1715=26(198){194=198}};$.22.1332=26(201,84){201=201.528(\'#\',\'\');15(201.41==3){201=201.404(0)+201.404(0)+201.404(1)+201.404(1)+201.404(2)+201.404(2)}14 66;66=\'354(\'+200(201.279(0,2),16)+\', \'+200(201.279(2,4),16)+\', \'+200(201.279(4,6),16);15(84){66+=\', \'+84}66+=\')\';37 66};$.22.1675=26(33){14 938=/354?\\( *([0-9]{1,3}\\.?[0-9]*%?) *, *([0-9]{1,3}\\.?[0-9]*%?) *, *([0-9]{1,3}\\.?[0-9]*%?) *(?:, *[0-9.]*)?\\)/;14 197=33.155(938);14 201=\'#\';51(14 17=1;17<4;17++){14 78;15(197[17].781(/%/)!=-1){78=200(255*197[17]/100,10).452(16);15(78.41==1){78=\'0\'+78}}27{78=200(197[17],10).452(16);15(78.41==1){78=\'0\'+78}}201+=78}37 201};$.22.1086=26(33,84){15(33.781(/^ *354?\\(/)!=-1){37 33}27 15(33.781(/^ *#?[0-1373-1340-711]?[0-1373-1340-711]/)!=-1){37 $.22.1332(33,84)}27{438 86 343(\'1684 157 1579\')}};$.22.914=26(33){33=$.22.1329[33]||33;14 66=$.22.1086(33);14 938=/354?\\( *([0-9]{1,3}\\.?[0-9]*%?) *, *([0-9]{1,3}\\.?[0-9]*%?) *, *([0-9]{1,3}\\.?[0-9]*%?) *,? *([0-9.]* *)?\\)/;14 197=66.155(938);14 171=[];51(14 17=1;17<4;17++){15(197[17].781(/%/)!=-1){171[17-1]=200(255*197[17]/100,10)}27{171[17-1]=200(197[17],10)}}171[3]=350(197[4])?350(197[4]):1.0;37 171};$.22.1329={1541:\'66(240, 248, 255)\',1544:\'66(250, 235, 215)\',1525:\'66( 0, 255, 255)\',1530:\'66(127, 255, 212)\',1539:\'66(240, 255, 255)\',1529:\'66(245, 245, 220)\',1531:\'66(255, 228, 196)\',1532:\'66( 0, 0, 0)\',1527:\'66(255, 235, 205)\',1522:\'66( 0, 0, 255)\',1524:\'66(138, 43, 226)\',1533:\'66(165, 42, 42)\',1543:\'66(222, 184, 135)\',1545:\'66( 95, 158, 160)\',1540:\'66(127, 255, 0)\',1537:\'66(210, 105, 30)\',1538:\'66(255, 127, 80)\',1546:\'66(100, 149, 237)\',1516:\'66(255, 248, 220)\',1505:\'66(220, 20, 60)\',1506:\'66( 0, 255, 255)\',1520:\'66( 0, 0, 139)\',1507:\'66( 0, 139, 139)\',1517:\'66(184, 134, 11)\',1518:\'66(169, 169, 169)\',1513:\'66( 0, 100, 0)\',1509:\'66(169, 169, 169)\',1508:\'66(189, 183, 107)\',1510:\'66(139, 0, 139)\',1511:\'66( 85, 107, 47)\',1534:\'66(255, 140, 0)\',1610:\'66(153, 50, 204)\',1589:\'66(139, 0, 0)\',1588:\'66(233, 150, 122)\',1591:\'66(143, 188, 143)\',1593:\'66( 72, 61, 139)\',1592:\'66( 47, 79, 79)\',1587:\'66( 47, 79, 79)\',1586:\'66( 0, 206, 209)\',1547:\'66(148, 0, 211)\',1583:\'66(255, 20, 147)\',1594:\'66( 0, 191, 255)\',1605:\'66(105, 105, 105)\',1607:\'66(105, 105, 105)\',1609:\'66( 30, 144, 255)\',1608:\'66(178, 34, 34)\',1603:\'66(255, 250, 240)\',1602:\'66( 34, 139, 34)\',1597:\'66(255, 0, 255)\',1601:\'66(220, 220, 220)\',1600:\'66(248, 248, 255)\',1578:\'66(255, 215, 0)\',1557:\'66(218, 165, 32)\',1556:\'66(128, 128, 128)\',1558:\'66(128, 128, 128)\',1559:\'66( 0, 128, 0)\',1560:\'66(173, 255, 47)\',1555:\'66(240, 255, 240)\',1554:\'66(255, 105, 180)\',1548:\'66(205, 92, 92)\',1551:\'66( 75, 0, 130)\',1553:\'66(255, 255, 240)\',1552:\'66(240, 230, 140)\',1562:\'66(230, 230, 250)\',1563:\'66(255, 240, 245)\',1577:\'66(124, 252, 0)\',1576:\'66(255, 250, 205)\',1571:\'66(173, 216, 230)\',1570:\'66(240, 128, 128)\',1565:\'66(224, 255, 255)\',1564:\'66(250, 250, 210)\',1566:\'66(211, 211, 211)\',1567:\'66(144, 238, 144)\',1569:\'66(211, 211, 211)\',1581:\'66(255, 182, 193)\',1568:\'66(255, 160, 122)\',1575:\'66( 32, 178, 170)\',1574:\'66(135, 206, 250)\',1572:\'66(119, 136, 153)\',1573:\'66(119, 136, 153)\',1550:\'66(176, 196, 222)\',1549:\'66(255, 255, 224)\',1561:\'66( 0, 255, 0)\',1599:\'66( 50, 205, 50)\',1598:\'66(250, 240, 230)\',1596:\'66(255, 0, 255)\',1606:\'66(128, 0, 0)\',1604:\'66(102, 205, 170)\',1595:\'66( 0, 0, 205)\',1584:\'66(186, 85, 211)\',1585:\'66(147, 112, 219)\',1582:\'66( 60, 179, 113)\',1580:\'66(123, 104, 238)\',1590:\'66( 0, 250, 154)\',1512:\'66( 72, 209, 204)\',1536:\'66(199, 21, 133)\',1542:\'66( 25, 25, 112)\',1523:\'66(245, 255, 250)\',1528:\'66(255, 228, 225)\',1526:\'66(255, 228, 181)\',1535:\'66(255, 222, 173)\',1504:\'66( 0, 0, 128)\',1519:\'66(253, 245, 230)\',1514:\'66(128, 128, 0)\',1688:\'66(107, 142, 35)\',2021:\'66(255, 165, 0)\',2020:\'66(255, 69, 0)\',2022:\'66(218, 112, 214)\',2023:\'66(238, 232, 170)\',2025:\'66(152, 251, 152)\',2024:\'66(175, 238, 238)\',2019:\'66(219, 112, 147)\',2018:\'66(255, 239, 213)\',2013:\'66(255, 218, 185)\',2012:\'66(205, 133, 63)\',2011:\'66(255, 192, 203)\',2014:\'66(221, 160, 221)\',2015:\'66(176, 224, 230)\',2017:\'66(128, 0, 128)\',2016:\'66(255, 0, 0)\',2026:\'66(188, 143, 143)\',2027:\'66( 65, 105, 225)\',2037:\'66(139, 69, 19)\',2036:\'66(250, 128, 114)\',2038:\'66(244, 164, 96)\',2039:\'66( 46, 139, 87)\',2041:\'66(255, 245, 238)\',2040:\'66(160, 82, 45)\',2035:\'66(192, 192, 192)\',2034:\'66(135, 206, 235)\',2029:\'66(106, 90, 205)\',2028:\'66(112, 128, 144)\',2030:\'66(112, 128, 144)\',2031:\'66(255, 250, 250)\',2043:\'66( 0, 255, 127)\',2032:\'66( 70, 130, 180)\',2010:\'66(210, 180, 140)\',2009:\'66( 0, 128, 128)\',1988:\'66(216, 191, 216)\',1987:\'66(255, 99, 71)\',1989:\'66( 64, 224, 208)\',1990:\'66(238, 130, 238)\',1992:\'66(245, 222, 179)\',1331:\'66(255, 255, 255)\',1991:\'66(245, 245, 245)\',1986:\'66(255, 255, 0)\',1985:\'66(154, 205, 50)\'};$.22.566=26(39){$.22.321.108(13);13.116;13.89=52;13.162=\'\';13.308=18;13.296=18;13.299=18;13.48;13.939=56;$.177(52,13,39)};$.22.566.62=86 $.22.321();$.22.566.62.281=$.22.566;$.22.566.62.231=26(39){$.177(52,13,39)};$.22.566.62.129=26(59,67){15(13.48){13.48.574();13.48=18}13.48=$(\'<409 311="274:454;" 900="22-\'+13.116+\'-162"></409>\');15(731(13.162)){13.48.68(\'1331-1980\',\'1324\')}15(!13.939){13.48.614(13.162)}27{13.48.357(13.162)}15(13.308){13.48.68(\'407-751\',13.308)}15(13.296){13.48.68(\'407-313\',13.296)}15(13.299){13.48.68(\'157\',13.299)}37 13.48};$.22.566.62.329=26(){};$.22.623=26(39){$.22.321.108(13);13.531=\'592\';13.116;13.475=52;13.552=52;13.360=56;13.313=4;13.746=6;13.89=52;13.468=52;13.162=18;13.161=18;13.1087={};13.1050=$.22.1333;13.295=\'\';13.1323=\'\';13.256=\'\';13.308;13.296;13.299;13.939=56;13.48;13.830=56;$.177(52,13,39)};$.22.623.62.231=26(39){$.177(52,13,39)};$.22.623.62=86 $.22.321();$.22.623.62.281=$.22.623;$.22.623.62.955=26(161,1328,1327){13.161=161;13.116=1328;15(1327){13.360=52}37 13};$.22.623.62.129=26(){15(13.162===18){13.162=13.295+13.1050(13.256,13.161)+13.1323}14 311={274:\'454\'};15(731(13.162)){311[\'1979\']=\'1324\'}15(13.48){13.48.574();13.48=18}13.48=$(276.309(\'409\'));13.48.401("22-"+13.116+"-294");15(!13.939){13.48.614(13.162)}27{13.48.357(13.162)}13.48.68(311);51(14 33 262 13.1087){13.48.68(33,13.1087[33])}15(13.308){13.48.68(\'407-751\',13.308)}15(13.296){13.48.68(\'407-313\',13.296)}15(13.299){13.48.68(\'157\',13.299)}15(13.830){13.48.401(\'22-1978\')}37 13.48};$.22.1333=26(487,259){15(266 259==\'195\'){15(!487){487=$.22.271.956}37 $.22.509(487,259)}27{37 385(259)}};$.22.1981=26(487,259){15(266 259==\'195\'){259=100*259;15(!487){487=$.22.271.956}37 $.22.509(487,259)}27{37 385(259)}};$.22.623.62.329=26(){};$.22.916=26(){13.302=86 $.22.783()};$.22.916.62.231=26(39){13.314;$.177(52,13,39);14 679={418:\'924\',305:\'382\',156:56,396:56,366:13.800,386:13.761,550:13.799,523:13.798,217:13.1342,229:56,312:13.1339};13.49.302.231(679)};$.22.916.62.309=26(67){14 132;15(13.48){15($.22.553&&345.471.560!==322){132=13.48.449(0);345.471.560(132);132=18}13.48.574();13.48=18}132=67.712.1082();14 174=13.117.137;14 201=13.117.141;132.137=174;132.141=201;13.48=$(132);13.48.401(\'22-268-120\');13.48.68({274:\'454\',97:0,115:0});132=67.712.1101(132);13.365=13.378.115;13.319=201-13.378.172;13.337=13.378.97;13.341=174-13.378.163;13.292=13.341-13.337;13.323=13.319-13.365;132=18;37 13.48};$.22.916.62.129=26(){13.314=13.48.449(0).680("859");14 59=13.314;14 146=13.913;59.540();59.427(0,0,13.117.137,13.117.141);59.297=13.503||13.473;59.369(13.337,13.365,13.292,13.323);59.540();59.418=\'924\';59.305=\'643\';59.217=13.467;59.312=13.1194;14 109,202,33,197;14 159=[\'243\',\'301\',\'282\',\'433\'];51(14 17=4;17>0;17--){14 88=159[17-1];14 116=146[88];14 291=116.269;14 1309=291.41;15(116.89){15(116.1469){14 466={};15(116.1061!==18){466.217=116.1061}15(116.1060!==18){466.312=116.1060}317(88){74\'243\':363(13.337,13.319,13.341,13.319,466);83;74\'301\':363(13.337,13.319,13.337,13.365,466);83;74\'282\':363(13.337,13.319,13.341,13.319,466);83;74\'433\':363(13.341,13.319,13.341,13.365,466);83}}51(14 36=1309;36>0;36--){14 54=291[36-1];15(54.89){14 207=55.382(116.535(54.161))+0.5;317(88){74\'243\':15(54.552&&13.759&&((!54.360&&116.912)||(54.360&&116.911))){363(207,13.365,207,13.319)}15(54.475&&54.531&&((!54.360&&116.915)||(54.360&&116.881))){33=54.746;197=54.531;14 207=55.382(116.535(54.161))+0.5;317(197){74\'592\':109=13.319;202=13.319+33;83;74\'539\':109=13.319-33;202=13.319;83;74\'877\':109=13.319-33;202=13.319+33;83;355:109=13.319;202=13.319+33;83}15(13.260){13.49.302.129(59,[[207,109],[207,202]],{305:\'643\',217:13.467,386:13.467*0.75,523:2,156:56,229:56})}363(207,109,207,202)}83;74\'301\':15(54.552&&13.759&&((!54.360&&116.912)||(54.360&&116.911))){363(13.341,207,13.337,207)}15(54.475&&54.531&&((!54.360&&116.915)||(54.360&&116.881))){33=54.746;197=54.531;14 207=55.382(116.535(54.161))+0.5;317(197){74\'592\':109=13.337-33;202=13.337;83;74\'539\':109=13.337;202=13.337+33;83;74\'877\':109=13.337-33;202=13.337+33;83;355:109=13.337-33;202=13.337;83}15(13.260){13.49.302.129(59,[[109,207],[202,207]],{305:\'643\',217:13.467*1.5,386:13.467*0.75,156:56,229:56})}363(109,207,202,207,{312:116.267})}83;74\'282\':15(54.552&&13.759&&((!54.360&&116.912)||(54.360&&116.911))){363(207,13.319,207,13.365)}15(54.475&&54.531&&((!54.360&&116.915)||(54.360&&116.881))){33=54.746;197=54.531;14 207=55.382(116.535(54.161))+0.5;317(197){74\'592\':109=13.365-33;202=13.365;83;74\'539\':109=13.365;202=13.365+33;83;74\'877\':109=13.365-33;202=13.365+33;83;355:109=13.365-33;202=13.365;83}15(13.260){13.49.302.129(59,[[207,109],[207,202]],{305:\'643\',217:13.467,386:13.467*0.75,523:2,156:56,229:56})}363(207,109,207,202)}83;74\'433\':15(54.552&&13.759&&((!54.360&&116.912)||(54.360&&116.911))){363(13.337,207,13.341,207)}15(54.475&&54.531&&((!54.360&&116.915)||(54.360&&116.881))){33=54.746;197=54.531;14 207=55.382(116.535(54.161))+0.5;317(197){74\'592\':109=13.341;202=13.341+33;83;74\'539\':109=13.341-33;202=13.341;83;74\'877\':109=13.341-33;202=13.341+33;83;355:109=13.341;202=13.341+33;83}15(13.260){13.49.302.129(59,[[109,207],[202,207]],{305:\'643\',217:13.467*1.5,386:13.467*0.75,156:56,229:56})}363(109,207,202,207,{312:116.267})}83;355:83}}}54=18}116=18;291=18}159=[\'548\',\'543\',\'542\',\'544\',\'547\',\'546\',\'571\',\'569\'];51(14 17=7;17>0;17--){14 116=146[159[17-1]];14 291=116.269;15(116.89){14 525=291[116.190-1];14 948=291[0];14 97=116.1303();14 121=[[97,525.1053()+525.327()/2],[97,948.1053()+948.327()/2+1.0]];15(13.260){13.49.302.129(59,121,{305:\'643\',156:56,229:56})}363(121[0][0],121[0][1],121[1][0],121[1][1],{305:\'643\',312:116.267,217:116.318});51(14 36=291.41;36>0;36--){14 54=291[36-1];33=54.746;197=54.531;14 207=55.382(116.535(54.161))+0.5;15(54.475&&54.531){317(197){74\'592\':109=97;202=97+33;83;74\'539\':109=97-33;202=97;83;74\'877\':109=97-33;202=97+33;83;355:109=97;202=97+33;83}121=[[109,207],[202,207]];15(13.260){13.49.302.129(59,121,{305:\'643\',217:13.467*1.5,386:13.467*0.75,156:56,229:56})}363(109,207,202,207,{312:116.267})}54=18}948=18}116=18;291=18}59.499();26 363(1320,1317,1316,1312,58){59.540();58=58||{};15(58.217==18||58.217!=0){$.177(52,59,58);59.697();59.610(1320,1317);59.609(1316,1312);59.926();59.499()}}15(13.260){14 121=[[13.337,13.319],[13.341,13.319],[13.341,13.365]];13.49.302.129(59,121)}15(13.318!=0&&13.1313){363(13.337,13.365,13.341,13.365,{305:\'382\',312:146.282.267,217:146.282.318});363(13.341,13.365,13.341,13.319,{305:\'382\',312:146.433.267,217:146.433.318});363(13.341,13.319,13.337,13.319,{305:\'382\',312:146.243.267,217:146.243.318});363(13.337,13.319,13.337,13.365,{305:\'382\',312:146.301.267,217:146.301.318})}59.499();59=18;146=18};$.22.893=26(){};$.22.893.62.231=26(39){$.177(52,13,39)};$.22.893.62.129=26(){15(13.48){13.48.574();13.48=18}14 151=13.49;14 132=276.309(\'409\');13.48=$(132);13.48.401(\'22-258\');15(!13.357){13.89=56;13.48.141(0);13.48.137(0)}27 15(13.357){14 157;15(13.157){157=13.157}27 15(13.299){157=13.299}14 618={274:\'454\',115:\'336\',97:\'336\'};15(13.613){618[\'137\']=13.613+\'265\'}15(13.296){618[\'296\']=13.296}15(266 13.463===\'906\'){618[\'463\']=13.463}27{618[\'463\']=\'662\'}15(157){618[\'157\']=157}15(13.1162){618[\'1162\']=13.1162}15(13.308){618[\'308\']=13.308}13.48.68(618);15(13.918){13.48.357(13.357)}27{13.48.614(13.357)}}132=18;37 13.48};$.22.893.62.329=26(){};14 1163=0.1;$.22.1148=26(59,342){14 1371={1982:[1163,$.22.271.1374],1984:[$.22.271.1117,$.22.271.1120],1085:18};15(266 342===\'906\'){15(342[0]===\'.\'||342[0]===\'-\'){14 33=342;342=[];51(14 17=0,1375=33.41;17<1375;17++){15(33[17]===\'.\'){342.103(1163)}27 15(33[17]===\'-\'){342.103($.22.271.1117)}27{1193}342.103($.22.271.1120)}}27{342=1371[342]}}15(!(342&&342.41)){37 59}14 693=0;14 942=342[0];14 265=0;14 579=0;14 1126=0;14 1151=0;14 610=26(77,76){59.610(77,76);265=77;579=76;1126=77;1151=76};14 609=26(77,76){14 640=59.217;14 324=77-265;14 352=76-579;14 502=55.722(324*324+352*352);15((502>0)&&(640>0)){324/=502;352/=502;869(52){14 632=640*942;15(632<502){265+=632*324;579+=632*352;15((693&1)==0){59.609(265,579)}27{59.610(265,579)}502-=632;693++;15(693>=342.41){693=0}942=342[693]}27{265=77;579=76;15((693&1)==0){59.609(265,579)}27{59.610(265,579)}942-=502/640;83}}}};14 697=26(){59.697()};14 229=26(){609(1126,1151)};37{610:610,609:609,697:697,229:229}};$.22.516=26(){13.303=86 $.22.871();13.302=86 $.22.783()};$.22.516.62.231=26(39,67){39=39||{};13.387=\'420\';13.49.440={89:56,584:\'97\',247:1983,1369:52};13.49.333=56;13.49.641=18;13.49.1165=52;13.49.376=[];13.49.421=[];13.49.500=[];13.49.512=[];13.49.621=[];13.49.622=[];13.49.1125=[];13.49.118={89:56,457:[],446:[],157:13.157,1299:56,156:52,443:18,417:18,436:18,304:\'3%\'};14 683={557:39.557,501:39.501,615:39.615};598(39.557);598(39.501);598(39.615);$.177(52,13.49,39);13.49.39=39;15(13.49.1125.41>1&&(!39.118||39.118.89==18)){13.49.118.89=52}27 15(39.118&&39.118.89==18&&39.118.304!=18){13.49.118.89=52}15(13.156){13.49.118.89=56}15(13.49.118.89){13.49.1128.108(13,13.49.39,67)}15(13.593){13.49.333=56}14 58={418:13.418,305:13.305,156:13.156,396:56,312:13.157,297:13.443,217:13.217,392:13.392,229:13.156};13.49.303.231(58);14 880=39.761;15(880==18){15(13.217>2.5){880=1.25*(1+(55.653((13.217/2.5))/0.1376-1)*0.6)}27{880=1.25*55.653((13.217/2.5))/0.1376}}14 679={418:13.418,305:13.305,156:13.156,396:56,366:13.800,386:880,550:13.799,523:13.798,217:13.217,392:13.392,229:13.156};13.49.302.231(679);13.408=[];13.779=[[],[]];15(!13.1382&&13.156||13.49.118.89){13.557=52;13.501=56;13.615=18;15(683.501&&683.557==18){683.557=56}$.177(52,13,{557:683.557,501:683.501,615:683.615});15(!13.615){14 1385=(13.49.118.89)?13.49.118.443:13.443;13.615=$.22.1384(1385)}15(13.813){13.813.89=56}}15(!13.1382&&67){67.356.388={};67.529.587(1297);67.590.587(1298);67.472.587(\'1379\',1261);67.472.587(\'1380\',1275);67.472.587(\'1131\',1274);67.472.587(\'1365\',1273);67.472.587(\'1353\',1269)}};$.22.516.62.1128=26(39,67){14 351=39.1125||[];14 118=13.49.118;118.457=[];118.446=[];14 44=13.44;118.436=18;118.417=18;15(351.41==2){15($.462(351[0][0])){14 93;14 921=0,928=0;51(14 17=0,94=351[0].41;17<94;17++){93=351[0][17];15((93[1]!=18&&93[1]>118.436)||118.436==18){118.436=93[1]}15((93[1]!=18&&93[1]<118.417)||118.417==18){118.417=93[1]}}51(14 17=0,94=351[1].41;17<94;17++){93=351[1][17];15((93[1]!=18&&93[1]>118.436)||118.436==18){118.436=93[1];928=1}15((93[1]!=18&&93[1]<118.417)||118.417==18){118.417=93[1];921=1}}15(928===921){118.89=56}118.457=351[928];118.446=351[921]}27 15(351[0].41===44.41&&351[1].41===44.41){14 630=(351[0][0]>351[1][0])?0:1;14 676=(630)?0:1;51(14 17=0,94=44.41;17<94;17++){118.457.103([44[17][0],351[630][17]]);118.446.103([44[17][0],351[676][17]])}}27{118.89=56}}27 15(351.41>2&&!$.462(351[0][0])){14 630=(351[0][0]>351[0][1])?0:1;14 676=(630)?0:1;51(14 17=0,94=351.41;17<94;17++){118.457.103([44[17][0],351[17][630]]);118.446.103([44[17][0],351[17][676]])}}27{14 895=118.304;14 84=18;14 109=18;14 737=18;14 655=18;15($.462(895)){84=895[0];109=895[1]}27{84=895}15(442(84)){15(84.404(84.41-1)===\'%\'){737=\'876\';84=350(84)/100+1}}27{84=350(84);737=\'464\'}15(109!==18&&442(109)){15(109.404(109.41-1)===\'%\'){655=\'876\';109=350(109)/100+1}}27 15(109!==18){109=350(109);655=\'464\'}15(84!==18){15(109===18){109=-84;655=737;15(655===\'876\'){109+=2}}15(84<109){14 78=84;84=109;109=78;78=737;737=655;655=78}51(14 17=0,94=44.41;17<94;17++){317(737){74\'464\':118.457.103([44[17][0],44[17][1]+84]);83;74\'876\':118.457.103([44[17][0],44[17][1]*84]);83}317(655){74\'464\':118.446.103([44[17][0],44[17][1]+109]);83;74\'876\':118.446.103([44[17][0],44[17][1]*109]);83}}}27{118.89=56}}14 875=118.457;14 896=118.446;51(14 17=0,94=875.41;17<94;17++){15((875[17][1]!=18&&875[17][1]>118.436)||118.436==18){118.436=875[17][1]}}51(14 17=0,94=896.41;17<94;17++){15((896[17][1]!=18&&896[17][1]<118.417)||118.417==18){118.417=896[17][1]}}15(118.443===18){14 482=$.22.914(118.157);482[3]=482[3]*0.5;118.443=\'354(\'+482[0]+\', \'+482[1]+\', \'+482[2]+\', \'+482[3]+\')\'}};26 1124(57,283){37(3.1993+283)*55.257(57,-0.1994)}26 2004(617,625){14 33=55.722(55.257((625[0]-617[0]),2)+55.257((625[1]-617[1]),2));37 5.2003*55.522(33)+7.2005}26 905(77){14 84=(55.1360(2*77)-1)/(55.1360(2*77)+1);37 84}26 725(110){14 333=13.49.333;14 293=13.120.340();14 402=13.326.595;14 249=13.280.595;14 561=18;14 1244=18;14 502=110.41/293;14 376=[];14 421=[];15(!442(350(333))){561=350(333)}27{561=1124(502,0.5)}14 290=[];14 241=[];51(14 17=0,94=110.41;17<94;17++){290.103(110[17][1]);241.103(110[17][0])}26 485(1137,1136){15(1137-1136==0){37 55.257(10,10)}27{37 1137-1136}}14 741,788,789,530;14 724=110.41-1;51(14 227=1,1357=110.41;227<1357;227++){14 441=[];14 706=[];51(14 36=0;36<2;36++){14 17=227-1+36;15(17==0||17==724){441[36]=55.257(10,10)}27 15(290[17+1]-290[17]==0||290[17]-290[17-1]==0){441[36]=0}27 15(((241[17+1]-241[17])/(290[17+1]-290[17])+(241[17]-241[17-1])/(290[17]-290[17-1]))==0){441[36]=0}27 15((290[17+1]-290[17])*(290[17]-290[17-1])<0){441[36]=0}27{441[36]=2/(485(241[17+1],241[17])/ (290[17 + 1] - 290[17]) + 485(241[17], 241[17 - 1]) /(290[17]-290[17-1]))}}15(227==1){441[0]=3/2*(290[1]-290[0])/ 485(241[1], 241[0]) - 441[1] /2}27 15(227==724){441[1]=3/2*(290[724]-290[724-1])/ 485(241[724], 241[724 - 1]) - 441[0] /2}706[0]=-2*(441[1]+2*441[0])/485(241[227],241[227-1])+6*(290[227]-290[227-1])/55.257(485(241[227],241[227-1]),2);706[1]=2*(2*441[1]+441[0])/485(241[227],241[227-1])-6*(290[227]-290[227-1])/55.257(485(241[227],241[227-1]),2);530=1/6*(706[1]-706[0])/485(241[227],241[227-1]);789=1/2*(241[227]*706[0]-241[227-1]*706[1])/485(241[227],241[227-1]);788=(290[227]-290[227-1]-789*(55.257(241[227],2)-55.257(241[227-1],2))-530*(55.257(241[227],3)-55.257(241[227-1],3)))/485(241[227],241[227-1]);741=290[227-1]-788*241[227-1]-789*55.257(241[227-1],2)-530*55.257(241[227-1],3);14 1242=(241[227]-241[227-1])/561;14 78,559;51(14 36=0,94=561;36<94;36++){78=[];559=241[227-1]+36*1242;78.103(559);78.103(741+788*559+789*55.257(559,2)+530*55.257(559,3));376.103(78);421.103([402(78[0]),249(78[1])])}}376.103(110[17]);421.103([402(110[17][0]),249(110[17][1])]);37[376,421]}26 726(110){14 333=13.49.333;14 641=13.49.641;14 293=13.120.340();14 402=13.326.595;14 249=13.280.595;14 561=18;14 1244=18;14 84=18;14 1108=18;14 1109=18;14 1113=18;14 1114=18;14 78=18;14 54,33,695,989,994,985;14 992,988,993,996;14 1006,1008,93;14 383=[];14 2006=[];14 502=110.41/293;14 98,111,361,640,775;14 376=[];14 421=[];15(!442(350(333))){561=350(333)}27{561=1124(502,0.5)}15(!442(350(641))){641=350(641)}51(14 17=0,94=110.41-1;17<94;17++){15(641===18){1113=55.335((110[17+1][1]-110[17][1])/(110[17+1][0]-110[17][0]));98=0.3;111=0.6;361=(111-98)/2.0;640=2.5;775=-1.4;78=1113/640+775;1108=361*905(78)-361*905(775)+98;15(17>0){1114=55.335((110[17][1]-110[17-1][1])/(110[17][0]-110[17-1][0]))}78=1114/640+775;1109=361*905(78)-361*905(775)+98;84=(1108+1109)/2.0}27{84=641}51(54=0;54<561;54++){33=54/561;695=(1+2*33)*55.257((1-33),2);989=33*55.257((1-33),2);994=55.257(33,2)*(3-2*33);985=55.257(33,2)*(33-1);15(110[17-1]){992=84*(110[17+1][0]-110[17-1][0]);988=84*(110[17+1][1]-110[17-1][1])}27{992=84*(110[17+1][0]-110[17][0]);988=84*(110[17+1][1]-110[17][1])}15(110[17+2]){993=84*(110[17+2][0]-110[17][0]);996=84*(110[17+2][1]-110[17][1])}27{993=84*(110[17+1][0]-110[17][0]);996=84*(110[17+1][1]-110[17][1])}1006=695*110[17][0]+994*110[17+1][0]+989*992+985*993;1008=695*110[17][1]+994*110[17+1][1]+989*988+985*996;93=[1006,1008];376.103(93);421.103([402(1006),249(1008)])}}376.103(110[94]);421.103([402(110[94][0]),249(110[94][1])]);37[376,421]}$.22.516.62.1119=26(67){14 402=13.326.398;14 249=13.280.398;14 44=13.316;14 458=13.890;13.187=[];13.721=[];13.49.376=[];13.49.421=[];13.49.500=[];13.49.512=[];13.49.621=[];13.49.622=[];14 118=13.49.118;14 658=56;51(14 17=0,94=44.41;17<94;17++){15(44[17][0]!=18&&44[17][1]!=18){13.187.103([402.108(13.326,44[17][0]),249.108(13.280,44[17][1])])}27 15(44[17][0]==18){658=52;13.187.103([18,249.108(13.280,44[17][1])])}27 15(44[17][1]==18){658=52;13.187.103([402.108(13.326,44[17][0]),18])}15(458[17]!=18&&458[17][0]!=18&&458[17][1]!=18){13.721.103([402.108(13.326,458[17][0]),249.108(13.280,458[17][1])])}27 15(458[17]!=18&&458[17][0]==18){13.721.103([18,249.108(13.280,458[17][1])])}27 15(458[17]!=18&&458[17][0]!=18&&458[17][1]==18){13.721.103([402.108(13.326,458[17][0]),18])}}15(658){13.49.333=56;15(13.387===\'420\'){118.89=56}}15(13.387===\'420\'&&118.89){51(14 17=0,94=118.457.41;17<94;17++){13.49.500.103([402.108(13.326,118.457[17][0]),249.108(13.280,118.457[17][1])])}51(14 17=0,94=118.446.41;17<94;17++){13.49.512.103([402.108(13.326,118.446[17][0]),249.108(13.280,118.446[17][1])])}}15(13.387===\'420\'&&13.49.333&&13.187.41>2){14 171;15(13.49.1165){171=725.108(13,13.187);13.49.376=171[0];13.49.421=171[1];15(118.89){171=725.108(13,13.49.500);13.49.621=171[0];171=725.108(13,13.49.512);13.49.622=171[0]}171=18}27{171=726.108(13,13.187);13.49.376=171[0];13.49.421=171[1];15(118.89){171=726.108(13,13.49.500);13.49.621=171[0];171=726.108(13,13.49.512);13.49.622=171[0]}171=18}}};$.22.516.62.1141=26(44,67){14 402=13.326.398;14 249=13.280.398;14 110=[];14 2008=[];13.49.376=[];13.49.421=[];13.49.500=[];13.49.512=[];13.49.621=[];13.49.622=[];14 118=13.49.118;14 658=56;51(14 17=0;17<44.41;17++){15(44[17][0]!=18&&44[17][1]!=18){110.103([402.108(13.326,44[17][0]),249.108(13.280,44[17][1])])}27 15(44[17][0]==18){658=52;110.103([18,249.108(13.280,44[17][1])])}27 15(44[17][1]==18){658=52;110.103([402.108(13.326,44[17][0]),18])}}15(658){13.49.333=56;15(13.387===\'420\'){118.89=56}}15(13.387===\'420\'&&118.89){51(14 17=0,94=118.457.41;17<94;17++){13.49.500.103([402.108(13.326,118.457[17][0]),249.108(13.280,118.457[17][1])])}51(14 17=0,94=118.446.41;17<94;17++){13.49.512.103([402.108(13.326,118.446[17][0]),249.108(13.280,118.446[17][1])])}}15(13.387===\'420\'&&13.49.333&&110.41>2){14 171;15(13.49.1165){171=725.108(13,110);13.49.376=171[0];13.49.421=171[1];15(118.89){171=725.108(13,13.49.500);13.49.621=171[0];171=725.108(13,13.49.512);13.49.622=171[0]}171=18}27{171=726.108(13,110);13.49.376=171[0];13.49.421=171[1];15(118.89){171=726.108(13,13.49.500);13.49.621=171[0];171=726.108(13,13.49.512);13.49.622=171[0]}171=18}}37 110};$.22.516.62.129=26(59,110,39,67){14 17;14 58=$.177(52,{},39);14 260=(58.260!=322)?58.260:13.260;14 774=(58.774!=322)?58.774:13.774;14 156=(58.156!=322)?58.156:13.156;14 661=(58.661!=322)?58.661:13.661;14 778,729,772,719;59.540();15(110.41){15(774){15(156){15(13.767){14 657=13.657;15(!13.1218){657=58.297}14 894=56;14 1170=58.297;15(661){14 720=110.279(0)}15(13.198==0||!13.593){14 437=[];14 773=(13.49.333)?13.49.421:13.316;13.408=[];14 586=13.280.398(13.1171);14 2007=13.326.398(13.1171);58.229=52;15(13.968==\'76\'){437.103([110[0][0],586]);13.408.103([110[0][0],586]);51(14 17=0;17<110.41-1;17++){437.103(110[17]);13.408.103(110[17]);15(773[17][1]*773[17+1][1]<=0){15(773[17][1]<0){894=52;58.297=657}27{894=56;58.297=1170}14 982=110[17][0]+(110[17+1][0]-110[17][0])*(586-110[17][1])/(110[17+1][1]-110[17][1]);437.103([982,586]);13.408.103([982,586]);15(260){13.49.302.129(59,437,58)}13.49.303.129(59,437,58);437=[[982,586]]}}15(773[110.41-1][1]<0){894=52;58.297=657}27{894=56;58.297=1170}437.103(110[110.41-1]);13.408.103(110[110.41-1]);437.103([110[110.41-1][0],586]);13.408.103([110[110.41-1][0],586])}15(260){13.49.302.129(59,437,58)}13.49.303.129(59,437,58)}27{14 776=13.721;51(14 17=776.41;17>0;17--){110.103(776[17-1])}15(260){13.49.302.129(59,110,58)}13.408=110;13.49.303.129(59,110,58)}}27{15(661){14 720=110.279(0)}15(13.198==0||!13.593){14 1169=59.120.141;110.1229([110[0][0],1169]);14 815=110.41;110.103([110[815-1][0],1169])}27{14 776=13.721;51(14 17=776.41;17>0;17--){110.103(776[17-1])}}13.408=110;15(260){13.49.302.129(59,110,58)}13.49.303.129(59,110,58)}15(661){14 1228=$.177(52,{},58,{156:56,229:56});13.49.303.129(59,720,1228);15(13.504.89){15(13.49.333){720=13.187}51(17=0;17<720.41;17++){13.504.129(720[17][0],720[17][1],59,58.496)}}}}27{15(13.49.118.89){14 619;14 466=$.177(52,{},58);15(13.49.118.1299){619=(13.49.333)?13.49.621:13.49.500;13.49.303.129(59,619,58);619=(13.49.333)?13.49.622:13.49.512;13.49.303.129(59,619,466)}15(13.49.118.156){15(13.49.333){619=13.49.621.852(13.49.622.521())}27{619=13.49.500.852(13.49.512.521())}13.408=619;466.229=52;466.156=52;466.297=13.49.118.443;13.49.303.129(59,619,466)}}15(260){13.49.302.129(59,110,58)}13.49.303.129(59,110,58)}}14 778=772=729=719=18;51(17=0;17<13.408.41;17++){14 93=13.408[17];15(778>93[0]||778==18){778=93[0]}15(719<93[1]||719==18){719=93[1]}15(772<93[0]||772==18){772=93[0]}15(729>93[1]||729==18){729=93[1]}}15(13.565===\'420\'&&13.49.118.89){719=13.280.398(13.49.118.417);729=13.280.398(13.49.118.436)}13.779=[[778,719],[772,729]];15(13.504.89&&!156){15(13.49.333){110=13.187}51(17=0;17<110.41;17++){15(110[17][0]!=18&&110[17][1]!=18){13.504.129(110[17][0],110[17][1],59,58.496)}}}}59.499()};$.22.516.62.879=26(59,110,39){};26 1297(91,44,39){51(14 17=0;17<13.40.41;17++){15(13.40[17].49.281==$.22.516){15(13.40[17].557){13.40[17].501=56}}}}26 1298(){15(13.356.388&&13.356.388.642){13.356.388.642.1295();13.356.388.642=18}13.356.388.733=18;13.356.388.642=86 $.22.498();13.264.48.959(13.356.388.642.309(13.275,\'22-388-969-120\',13.117,13));13.356.388.642.771();13.264.48.508(\'1264\',{67:13},26(126){763(126.44.67)})}26 969(67,445,1265,121){14 33=67.40[445];14 120=67.356.388.642;120.314.427(0,0,120.314.120.137,120.314.120.141);33.1259=1265;67.356.388.733=445;14 58={297:33.615};15(33.565===\'420\'&&33.49.118.89){58.156=52;58.229=52}33.49.303.129(120.314,121,58);120=18}26 763(67){14 120=67.356.388.642;120.314.427(0,0,120.314.120.137,120.314.120.141);51(14 17=0;17<67.40.41;17++){67.40[17].1259=18}67.356.388.733=18;67.91.346(\'2002\');120=18}26 1261(126,315,899,236,67){15(236){14 469=[236.332,236.362,236.44];14 977=785.447(\'2001\');977.288=126.288;977.284=126.284;67.91.346(977,469);15(67.40[469[0]].557&&!(469[0]==67.356.388.733)){14 167=785.447(\'1276\');167.616=126.616;167.288=126.288;167.284=126.284;67.91.346(167,469);969(67,236.332,236.362,236.121)}}27 15(236==18){763(67)}}26 1275(126,315,899,236,67){15(236){14 469=[236.332,236.362,236.44];15(67.40[469[0]].501&&!(469[0]==67.356.388.733)){14 167=785.447(\'1276\');167.616=126.616;167.288=126.288;167.284=126.284;67.91.346(167,469);969(67,236.332,236.362,236.121)}}27 15(236==18){763(67)}}26 1274(126,315,899,236,67){14 194=67.356.388.733;15(194!=18&&67.40[194].501){763(67)}}26 1273(126,315,899,236,67){15(236){14 469=[236.332,236.362,236.44];14 167=785.447(\'1996\');167.616=126.616;167.288=126.288;167.284=126.284;67.91.346(167,469)}}26 1269(126,315,899,236,67){15(236){14 469=[236.332,236.362,236.44];14 194=67.356.388.733;15(194!=18&&67.40[194].501){763(67)}14 167=785.447(\'1995\');167.616=126.616;167.288=126.288;167.284=126.284;67.91.346(167,469)}}$.22.517=26(){};$.22.517.62.231=26(39){13.246=18;13.1065="&1997;";13.1469=52;13.1061=18;13.1060=18;13.826=56;13.1483=56;13.966=0;13.1055=0;13.1480=56;13.651=\'\';13.954=56;13.975=1.0;$.177(52,13,39);15(13.246){15(!$.462(13.246)){13.246=18}27 15(13.246.41<2||13.246[1]<=13.246[0]){13.246=18}}15(13.190!=18&&13.190<2){13.190=2}13.1057()};$.22.517.62.129=26(59,67){15(13.89){13.49.1486.108(13,67);14 293=0;14 78;15(13.48){13.48.574();13.48=18}13.48=$(276.309(\'409\'));13.48.401(\'22-116 22-\'+13.88);13.48.68(\'274\',\'454\');15(13.88==\'243\'||13.88==\'282\'){13.48.137(13.117.137)}27{13.48.141(13.117.141)}13.744.116=13.88;13.263=86 13.1467(13.744);15(13.263.89){14 132=13.263.129(59,67);132.1435(13.48);132=18}14 54=13.269;14 294;51(14 17=0;17<54.41;17++){294=54[17];15(294.89&&294.468&&(!294.360||13.1174)){13.48.419(294.129(59,67))}}294=18;54=18}37 13.48};$.22.517.62.972=26(){13.98=13.368.98;13.111=13.368.111;13.223=13.368.223;13.190=13.368.190;13.651=\'\';15(13.954&&13.364&&13.364.256){13.364.256=\'\'}};$.22.517.62.399=26(){14 293=0;14 78;14 174=0;14 201=0;14 677=(13.263==18)?56:13.263.89;15(13.89){14 54=13.269;14 294;51(14 17=0;17<54.41;17++){294=54[17];15(!294.830&&294.89&&294.468&&(!294.360||13.1174)){15(13.88==\'243\'||13.88==\'282\'){78=294.48.713(52)}27{78=294.48.716(52)}15(78>293){293=78}}}294=18;54=18;15(677){174=13.263.48.716(52);201=13.263.48.713(52)}15(13.88==\'243\'){293=293+201;13.48.68({\'141\':293+\'265\',97:\'336\',172:\'336\'})}27 15(13.88==\'282\'){293=293+201;13.48.68({\'141\':293+\'265\',97:\'336\',115:\'336\'})}27 15(13.88==\'301\'){293=293+174;13.48.68({\'137\':293+\'265\',97:\'336\',115:\'336\'});15(677&&13.263.281==$.22.566){13.263.48.68(\'137\',174+\'265\')}}27{293=293+174;13.48.68({\'137\':293+\'265\',163:\'336\',115:\'336\'});15(677&&13.263.281==$.22.566){13.263.48.68(\'137\',174+\'265\')}}}};$.22.517.62.1486=26(67){14 291=13.269;14 829=13.291;14 88=13.88;14 381=13.514;14 293=(13.88.404(0)===\'77\')?13.117.137:13.117.141;14 304;14 98,111;14 1998,2000;14 839,17;14 782=13.98;14 838=13.111;14 1422=13.190;14 1420=13.223;14 636=30;13.975=(55.111(293,636+1)-636)/300.0;15(829.41){51(17=0;17<829.41;17++){14 411=829[17];14 54=86 13.874(13.364);15($.462(411)){54.161=411[0];15(13.246){15(411[0]==13.246[0]){54.162=13.1065;54.830=52;54.552=56;54.475=56}27 15(411[0]>13.246[0]&&411[0]<=13.246[1]){54.89=56;54.552=56;54.162=411[1]}27{54.162=411[1]}}27{54.162=411[1]}54.955(411[0],13.88);13.269.103(54)}27 15($.723(411)){$.177(52,54,411);54.116=13.88;13.269.103(54)}27{54.161=411;15(13.246){15(411==13.246[0]){54.162=13.1065;54.830=52;54.552=56;54.475=56}27 15(411>13.246[0]&&411<=13.246[1]){54.89=56;54.552=56}}54.955(411,13.88);13.269.103(54)}}13.190=829.41;13.98=13.269[0].161;13.111=13.269[13.190-1].161;13.223=(13.111-13.98)/(13.190-1)}27{15(88==\'243\'||88==\'282\'){293=13.117.137}27{293=13.117.141}14 739=13.190;15(13.1480){15(13.88===\'282\'&&67.146.243.89){739=67.146.243.190}27 15(13.88.404(0)===\'76\'&&13.88!==\'301\'&&13.88!==\'569\'&&67.146.301.89){739=67.146.301.190}}98=((13.98!=18)?13.98:381.98);111=((13.111!=18)?13.111:381.111);14 349=111-98;14 692,691;14 78;15(13.364==18||!13.364.256){13.954=52}15(13.98==18||13.111==18&&13.223==18&&!13.979){15(13.826){15(98>0){98=0}15(111<0){111=0}}15(13.1483){15(98>100){98=100}15(111<100){111=100}}14 515=56,554=56;15(13.98!=18){515=52}27 15(13.111!=18){554=52}14 171=$.22.694(98,111,13.975,739,515,554);14 970=(13.98!=18)?98:98+349*(13.481-1);14 974=(13.111!=18)?111:111-349*(13.597-1);15(98<970||111>974){970=(13.98!=18)?98:98-349*(13.481-1);974=(13.111!=18)?111:111+349*(13.597-1);171=$.22.694(970,974,13.975,739,515,554)}13.98=171[0];13.111=171[1];13.190=171[2];13.651=171[3];13.223=171[4]}27{15(98==111){14 980=0.1466;15(98>0){980=55.111(55.522(98)/55.638,0.1466)}98-=980;111+=980}15(13.979&&13.98==18&&13.111==18){14 958,455,777;14 656=56;14 769=56;14 1999={98:18,111:18,2042:18,2049:18};51(14 17=0;17<13.448.41;17++){14 33=13.448[17];14 1487=(33.968==\'77\')?33.326.88:33.280.88;15(13.88==1487){14 629=33.827[33.968];14 600=629[0];14 687=629[0];51(14 36=1;36<629.41;36++){15(629[36]<600){600=629[36]}27 15(629[36]>687){687=629[36]}}14 632=(687-600)/687;15(33.49.281==$.22.801){15(600>=0&&(33.767||632>0.1)){656=52}27{656=56;15(33.156&&33.767&&600<0&&687>0){769=52}27{769=56}}}27 15(33.156){15(600>=0&&(33.767||632>0.1)){656=52}27 15(600<0&&687>0&&33.767){656=56;769=52}27{656=56;769=56}}27 15(600<0){656=56}}}15(656){13.190=2+55.330((293-(13.689-1))/13.689);13.98=0;782=0;455=111/(13.190-1);78=55.257(10,55.335(55.390(55.522(455)/55.638)));15(455/78==200(455/78,10)){455+=78}13.223=55.330(455/78)*78;13.111=13.223*(13.190-1)}27 15(769){13.190=2+55.330((293-(13.689-1))/13.689);14 967=55.330(55.335(98)/349*(13.190-1));14 1072=13.190-1-967;455=55.111(55.335(98/967),55.335(111/1072));78=55.257(10,55.335(55.390(55.522(455)/55.638)));13.223=55.330(455/78)*78;13.111=13.223*1072;13.98=-13.223*967}27{15(13.190==18){15(13.223){13.190=3+55.330(349/13.223)}27{13.190=2+55.330((293-(13.689-1))/13.689)}}15(13.223==18){455=349/(13.190-1);15(455<1){78=55.257(10,55.335(55.390(55.522(455)/55.638)))}27{78=1}13.223=55.330(455*78*13.325)/78}27{78=1/13.223}958=13.223*(13.190-1);777=(958-349)/2;15(13.98==18){13.98=55.390(78*(98-777))/78}15(13.111==18){13.111=13.98+958}}14 567=$.22.764(13.223);14 451;15(567.898>=567.1155){451=\'%57\'}27{14 78=55.111(0,5-567.898);78=55.98(78,567.450);451=\'%.\'+78+\'283\'}13.651=451}27{692=(13.98!=18)?13.98:98-349*(13.481-1);691=(13.111!=18)?13.111:111+349*(13.597-1);349=691-692;15(13.190==18){15(13.223!=18){13.190=55.330((691-692)/13.223)+1}27 15(293>100){13.190=200(3+(293-100)/75,10)}27{13.190=2}}15(13.223==18){13.223=349/(13.190-1)}15(13.111==18){691=692+13.223*(13.190-1)}15(13.98==18){692=691-13.223*(13.190-1)}14 567=$.22.764(13.223);14 451;15(567.898>=567.1155){451=\'%57\'}27{14 78=55.111(0,5-567.898);78=55.98(78,567.450);451=\'%.\'+78+\'283\'}13.651=451;13.98=692;13.111=691}15(13.49.281==$.22.517&&13.651==\'\'){349=13.111-13.98;14 1414=86 13.874(13.364);14 519=1414.256||$.22.271.956;14 519=519.155($.22.509.1152)[0];14 242=0;15(519){15(519.781(/[2100]/)>-1){14 197=519.155(/\\%\\.(\\57{0,})?[2084]/);15(197){242=200(197[1],10)}27{242=6}}27 15(519.781(/[2079]/)>-1){242=0}14 328=55.257(10,-242);15(13.223<328){15(1422==18&&1420==18){13.223=328;15(838==18&&782==18){13.98=55.390(13.514.98/328)*328;15(13.98==13.514.98){13.98=13.514.98-13.223}13.111=55.330(13.514.111/328)*328;15(13.111==13.514.111){13.111=13.514.111+13.223}14 81=(13.111-13.98)/13.223;81=81.976(11);81=55.330(81);13.190=81+1}27 15(838==18){14 81=(13.514.111-13.98)/13.223;81=81.976(11);13.190=55.330(81)+2;13.111=13.98+13.223*(13.190-1)}27 15(782==18){14 81=(13.111-13.514.98)/13.223;81=81.976(11);13.190=55.330(81)+2;13.98=13.111-13.223*(13.190-1)}27{13.190=55.330((838-782)/13.223)+1;13.98=55.390(782*55.257(10,242))/55.257(10,242);13.111=55.330(838*55.257(10,242))/55.257(10,242);13.190=55.330((13.111-13.98)/13.223)+1}}}}}}15(13.954&&13.651!=\'\'){13.364=13.364||{};13.364.256=13.651}14 54,933;51(14 17=0;17<13.190;17++){839=13.98+17*13.223;54=86 13.874(13.364);54.955(839,13.88);13.269.103(54);15(17<13.190-1){51(14 36=0;36<13.1055;36++){839+=13.223/(13.1055+1);933=$.177(52,{},13.364,{88:13.88,161:839,162:\'\',360:52});54=86 13.874(933);13.269.103(54)}}54=18}}15(13.966){13.98=13.98-13.966*13.223;13.111=13.111+13.966*13.223}291=18};$.22.517.62.2089=26(58){15($.462(58)&&58.41==13.269.41){14 54;51(14 17=0;17<58.41;17++){54=13.269[17];54.161=58[17];54.162=54.1050(54.256,58[17]);54.162=54.295+54.162;54.48.614(54.162)}54=18;13.98=$.22.1391(58);13.111=$.22.1388(58);13.329()}};$.22.517.62.329=26(207,125){207=207||{};125=125||13.378;14 291=13.269;14 111=13.111;14 98=13.98;14 1106=125.111;14 631=125.98;14 677=(13.263==18)?56:13.263.89;51(14 93 262 207){13.48.68(93,207[93])}13.378=125;14 405=1106-631;14 403=111-98;15(13.246){403=403-13.246[1]+13.246[0];13.1396=26(93){37(93-631)*403/405+98};13.535=26(286){15(286>13.246[0]&&286<13.246[1]){286=13.246[0]}15(286<=13.246[0]){37(286-98)*405/403+631}27{37(286-13.246[1]+13.246[0]-98)*405/403+631}};15(13.88.404(0)==\'77\'){13.398=26(286){15(286>13.246[0]&&286<13.246[1]){286=13.246[0]}15(286<=13.246[0]){37(286-98)*405/403}27{37(286-13.246[1]+13.246[0]-98)*405/403}};13.595=26(93){37 93*403/405+98}}27{13.398=26(286){15(286>13.246[0]&&286<13.246[1]){286=13.246[0]}15(286>=13.246[1]){37(286-111)*405/403}27{37(286+13.246[1]-13.246[0]-111)*405/403}};13.595=26(93){37 93*403/405+111}}}27{13.1396=26(93){37(93-631)*403/405+98};13.535=26(286){37(286-98)*405/403+631};15(13.88==\'243\'||13.88==\'282\'){13.398=26(286){37(286-98)*405/403};13.595=26(93){37 93*403/405+98}}27{13.398=26(286){37(286-111)*405/403};13.595=26(93){37 93*403/405+111}}}15(13.89){15(13.88==\'243\'||13.88==\'282\'){51(14 17=0;17<291.41;17++){14 54=291[17];15(54.89&&54.468){14 406;15(54.281==$.22.1401&&54.366){14 78=(13.88==\'243\')?1:-1;317(54.1398){74\'728\':15(78*54.366<0){406=-54.340()+54.374.141*55.709(-54.374.366)/2}27{406=-54.374.141*55.709(54.374.366)/2}83;74\'990\':406=-54.340()+54.374.141*55.709(-54.374.366)/2;83;74\'823\':406=-54.374.141*55.709(54.374.366)/2;83;74\'1400\':406=-54.340()/2+54.374.141*55.709(-54.374.366)/2;83;355:406=-54.340()/2+54.374.141*55.709(-54.374.366)/2;83}}27{406=-54.340()/2}14 259=13.535(54.161)+406+\'265\';54.48.68(\'97\',259);54.329()}}15(677){14 174=13.263.48.716(52);13.263.48.68(\'97\',631+405/2-174/2+\'265\');15(13.88==\'243\'){13.263.48.68(\'172\',\'336\')}27{13.263.48.68(\'115\',\'336\')}13.263.329()}}27{51(14 17=0;17<291.41;17++){14 54=291[17];15(54.89&&54.468){14 406;15(54.281==$.22.1401&&54.366){14 78=(13.88==\'301\')?1:-1;317(54.1398){74\'728\':74\'990\':15(78*54.366<0){406=-54.374.141*55.866(-54.374.366)/2}27{406=-54.327()+54.374.141*55.866(54.374.366)/2}83;74\'823\':15(54.366>0){406=-54.374.141*55.866(-54.374.366)/2}27{406=-54.327()+54.374.141*55.866(54.374.366)/2}83;74\'1400\':406=-54.327()/2;83;355:406=-54.327()/2;83}}27{406=-54.327()/2}14 259=13.535(54.161)+406+\'265\';54.48.68(\'115\',259);54.329()}}15(677){14 201=13.263.48.713(52);13.263.48.68(\'115\',1106-405/2-201/2+\'265\');15(13.88==\'301\'){13.263.48.68(\'97\',\'336\')}27{13.263.48.68(\'163\',\'336\')}13.263.329()}}}291=18};26 797(304){14 451;304=55.335(304);15(304>=10){451=\'%57\'}27 15(304>1){15(304===200(304,10)){451=\'%57\'}27{451=\'%.1449\'}}27{14 794=-55.390(55.522(304)/55.638);451=\'%.\'+794+\'283\'}37 451}14 601=[0.1,0.2,0.3,0.4,0.5,0.8,1,2,3,4,5];14 2090=26(283){14 17=601.435(283);15(17>0){37 601[17-1]}27{37 601[601.41-1]/100}};14 2086=26(283){14 17=601.435(283);15(17<601.41-1){37 601[17+1]}27{37 601[0]*100}};26 1102(98,111,999){14 676=55.390(999/2);14 630=55.330(999*1.5);14 1011=731.2095;14 151=(111-98);14 78;14 383;14 822;14 605=$.22.764;14 997;14 519;14 795;14 824;51(14 17=0,94=630-676+1;17<94;17++){795=676+17;78=151/(795-1);383=605(78);78=55.335(999-795)+383.450;15(78<1011){1011=78;822=795;824=383.450}27 15(78===1011){15(383.450<824){822=795;824=383.450}}}997=55.111(824,55.111(605(98).450,605(111).450));15(997===0){519=\'%57\'}27{519=\'%.\'+997+\'283\'}78=151/(822-1);37[98,111,822,519,78]}26 983(349,190){190=190||7;14 964=349/(190-1);14 371=55.257(10,55.390(55.522(964)/55.638));14 606=964/371;14 304;15(371<1){15(606>5){304=10*371}27 15(606>2){304=5*371}27 15(606>1){304=2*371}27{304=371}}27{15(606>5){304=10*371}27 15(606>4){304=5*371}27 15(606>3){304=4*371}27 15(606>2){304=3*371}27 15(606>1){304=2*371}27{304=371}}37 304}26 986(349,555){555=555||1;14 794=55.390(55.522(349)/55.638);14 371=55.257(10,794);14 283=349/371;14 328;283=283/555;15(283<=0.38){328=0.1}27 15(283<=1.6){328=0.2}27 15(283<=4.0){328=0.5}27 15(283<=8.0){328=1.0}27 15(283<=16.0){328=2}27{328=5}37 328*371}26 1103(349,555){14 794=55.390(55.522(349)/55.638);14 371=55.257(10,794);14 283=349/371;14 304;14 328;283=283/555;15(283<=0.38){328=0.1}27 15(283<=1.6){328=0.2}27 15(283<=4.0){328=0.5}27 15(283<=8.0){328=1.0}27 15(283<=16.0){328=2}27{328=5}304=328*371;37[304,328,371]}$.22.694=26(461,434,555,190,515,554){515=(515===18)?56:515;554=(554===18||515)?56:554;15(461===434){434=(434)?0:1}555=555||1.0;15(434<461){14 84=434;434=461;461=84}14 151=[];14 254=986(434-461,555);14 605=$.22.764;15(190==18){15(!515&&!554){151[0]=55.390(461/254)*254; 151[1]=55.330(434/254)*254; 151[2]=55.382((151[1]-151[0])/254+1.0);151[3]=797(254);151[4]=254}27 15(515){151[0]=461;151[2]=55.330((434-461)/254+1.0); 151[1]=461+(151[2]-1)*254;14 1093=605(461).450;14 995=605(254).450;15(1093<995){151[3]=797(254)}27{151[3]=\'%.\'+1093+\'283\'}151[4]=254}27 15(554){151[1]=434;151[2]=55.330((434-461)/254+1.0); 151[0]=434-(151[2]-1)*254;14 1098=605(434).450;14 995=605(254).450;15(1098<995){151[3]=797(254)}27{151[3]=\'%.\'+1098+\'283\'}151[4]=254}}27{14 338=[];338[0]=55.390(461/254)*254; 338[1]=55.330(434/254)*254; 338[2]=55.382((338[1]-338[0])/254+1.0);338[3]=797(254);338[4]=254;15(338[2]===190){151=338}27{14 1104=983(338[1]-338[0],190);151[0]=338[0];151[2]=190;151[4]=1104;151[3]=797(1104);151[1]=151[0]+(151[2]-1)*151[4]}}37 151};$.22.694.986=986;$.22.694.983=983;$.22.694.1103=1103;$.22.694.1102=1102;$.22.518=26(39){13.89=52;13.311=\'1417\';13.217=2;13.313=9.0;13.157=\'#2096\';13.260=52;13.800=45;13.761=1;13.798=3;13.799=\'0.1088\';13.302=86 $.22.783();13.303=86 $.22.871();$.177(52,13,39)};$.22.518.62.231=26(39){$.177(52,13,39);14 841={366:13.800,386:13.761,550:13.799,217:13.217,523:13.798,229:52};15(13.311.435(\'1439\')!=-1){841.156=52}15(13.311.435(\'1440\')!=-1){841.396=52;841.229=56}13.302.231(841);14 864={156:56,396:56,312:13.157,297:13.157,217:13.217,229:52};15(13.311.435(\'1439\')!=-1){864.156=52}15(13.311.435(\'1440\')!=-1){864.396=52;864.229=56}13.303.231(864)};$.22.518.62.1010=26(77,76,59,156,39){14 361=1.2;14 324=13.313/2/361;14 352=13.313/2*361;14 121=[[77-324,76],[77,76+352],[77+324,76],[77,76-352]];15(13.260){13.302.129(59,121)}13.303.129(59,121,39)};$.22.518.62.1263=26(77,76,59,156,39){14 361=1.0;14 324=13.313/2*361;14 352=13.313/2*361;14 792=[[77,76-352],[77,76+352]];14 791=[[77+324,76],[77-324,76]];14 58=$.177(52,{},13.39,{229:56});15(13.260){13.302.129(59,792,{229:56});13.302.129(59,791,{229:56})}13.303.129(59,792,58);13.303.129(59,791,58)};$.22.518.62.1499=26(77,76,59,156,39){14 361=1.0;14 324=13.313/2*361;14 352=13.313/2*361;14 58=$.177(52,{},13.39,{229:56});14 792=[[77-324,76-352],[77+324,76+352]];14 791=[[77-324,76+352],[77+324,76-352]];15(13.260){13.302.129(59,792,{229:56});13.302.129(59,791,{229:56})}13.303.129(59,792,58);13.303.129(59,791,58)};$.22.518.62.1232=26(77,76,59,156,39){14 361=1.0;14 324=13.313/2*361;14 352=13.313/2*361;14 121=[[77-324,76],[77+324,76]];15(13.260){13.302.129(59,121)}13.303.129(59,121,39)};$.22.518.62.363=26(637,861,59,156,39){14 121=[637,861];15(13.260){13.302.129(59,121)}13.303.129(59,121,39)};$.22.518.62.1075=26(77,76,59,156,39){14 361=1.0;14 324=13.313/2/361;14 352=13.313/2*361;14 121=[[77-324,76-352],[77-324,76+352],[77+324,76+352],[77+324,76-352]];15(13.260){13.302.129(59,121)}13.303.129(59,121,39)};$.22.518.62.1074=26(77,76,59,156,39){14 1428=13.313/2;14 990=2*55.367;14 121=[77,76,1428,0,990,52];15(13.260){13.302.129(59,121)}13.303.129(59,121,39)};$.22.518.62.129=26(77,76,59,39){39=39||{};15(39.89==18||39.89!=56){15(39.157&&!39.297){39.297=39.157}15(39.157&&!39.312){39.312=39.157}317(13.311){74\'1721\':13.1010(77,76,59,56,39);83;74\'2097\':13.1010(77,76,59,52,39);83;74\'2094\':13.1074(77,76,59,56,39);83;74\'1417\':13.1074(77,76,59,52,39);83;74\'2083\':13.1075(77,76,59,56,39);83;74\'2082\':13.1075(77,76,59,52,39);83;74\'77\':13.1499(77,76,59,52,39);83;74\'2080\':13.1263(77,76,59,52,39);83;74\'2093\':13.1232(77,76,59,52,39);83;74\'420\':13.363(77,76,59,56,39);83;355:13.1010(77,76,59,56,39);83}}};$.22.783=26(39){13.366=45;13.386=1;13.550=0.1088;13.217=1.5;13.418=\'924\';13.305=\'382\';13.229=56;13.156=56;13.523=3;13.312=\'354(0,0,0,0.1)\';13.396=56;$.177(52,13,39)};$.22.783.62.231=26(39){$.177(52,13,39)};$.22.783.62.129=26(59,121,39){59.540();14 58=(39!=18)?39:{};14 156=(58.156!=18)?58.156:13.156;14 369=(58.369!=18)?58.369:13.369;14 229=(58.229!=18)?58.229:13.229;14 386=(58.386!=18)?58.386:13.386;14 550=(58.550!=18)?58.550:13.550;14 523=(58.523!=18)?58.523:13.523;14 396=(58.396!=18)?58.396:13.396;14 392=(58.392!=18)?58.392:13.392;59.217=(58.217!=18)?58.217:13.217;59.418=(58.418!=18)?58.418:13.418;59.305=(58.305!=18)?58.305:13.305;59.312=58.312||13.312||\'354(0,0,0,\'+550+\')\';59.297=58.297||13.297||\'354(0,0,0,\'+550+\')\';51(14 36=0;36<523;36++){14 608=$.22.1148(59,392);59.1425(55.866(13.366*55.367/180)*386,55.709(13.366*55.367/180)*386);608.697();15(396){59.1367(121[0],121[1],121[2],121[3],121[4],52)}27 15(369){15(369){59.369(121[0],121[1],121[2],121[3])}}27 15(121&&121.41){14 490=52;51(14 17=0;17<121.41;17++){15(121[17][0]!=18&&121[17][1]!=18){15(490){608.610(121[17][0],121[17][1]);490=56}27{608.609(121[17][0],121[17][1])}}27{490=52}}}15(229){608.229()}15(156){59.156()}27{59.926()}}59.499()};$.22.871=26(39){13.217=1.5;13.392=\'1085\';13.418=\'924\';13.305=\'382\';13.229=56;13.156=56;13.396=56;13.369=56;13.558=56;13.427=56;13.312=\'#1084\';13.297=\'#1084\';$.177(52,13,39)};$.22.871.62.231=26(39){$.177(52,13,39)};$.22.871.62.129=26(59,121,39){59.540();14 58=(39!=18)?39:{};14 156=(58.156!=18)?58.156:13.156;14 229=(58.229!=18)?58.229:13.229;14 369=(58.369!=18)?58.369:13.369;14 558=(58.558!=18)?58.558:13.558;14 427=(58.427!=18)?58.427:13.427;14 396=(58.396!=18)?58.396:13.396;14 392=(58.392!=18)?58.392:13.392;14 608=$.22.1148(59,392);59.217=58.217||13.217;59.418=58.418||13.418;59.305=58.305||13.305;59.312=(58.312||58.157)||13.312;59.297=58.297||13.297;59.697();15(396){59.1367(121[0],121[1],121[2],121[3],121[4],52);15(229){59.229()}15(156){59.156()}27{59.926()}59.499();37}27 15(427){59.427(121[0],121[1],121[2],121[3]);59.499();37}27 15(369||558){15(369){59.369(121[0],121[1],121[2],121[3])}15(558){59.558(121[0],121[1],121[2],121[3]);59.499();37}}27 15(121&&121.41){14 490=52;51(14 17=0;17<121.41;17++){15(121[17][0]!=18&&121[17][1]!=18){15(490){608.610(121[17][0],121[17][1]);490=56}27{608.609(121[17][0],121[17][1])}}27{490=52}}15(229){608.229()}15(156){59.156()}27{59.926()}}59.499()};$.22.790=26(){};$.22.790.62.231=26(39){$.177(52,13,39)};$.22.790.62.1188=26(162,157,325,521){14 1187=(325)?13.1389+\'265\':\'336\';14 594;14 429;14 132;14 857;14 787;132=276.309(\'594\');594=$(132);594.401(\'22-431-168\');132=18;15(521){594.2088(13.48)}27{594.1435(13.48)}15(13.1434){429=$(276.309(\'429\'));429.401(\'22-431-168 22-431-168-690\');429.68({463:\'662\',1097:1187});857=$(276.309(\'409\'));857.401(\'22-431-168-690-1403\');787=$(276.309(\'409\'));787.401(\'22-431-168-690\');787.68({503:157,267:157});594.419(429.419(857.419(787)))}15(13.1432){429=$(276.309(\'429\'));429.401(\'22-431-168 22-431-168-162\');429.68(\'1097\',1187);594.419(429);15(13.918){429.357(162)}27{429.614(162)}}429=18;857=18;787=18;594=18;132=18};$.22.790.62.129=26(){15(13.48){13.48.574();13.48=18}15(13.89){14 40=13.448;14 132=276.309(\'431\');13.48=$(132);13.48.401(\'22-431-168\');14 254={274:\'454\'};15(13.473){254[\'473\']=13.473}15(13.551){254[\'551\']=13.551}15(13.296){254[\'296\']=13.296}15(13.308){254[\'308\']=13.308}15(13.299){254[\'299\']=13.299}15(13.511!=18){254[\'511\']=13.511}15(13.575!=18){254[\'575\']=13.575}15(13.507!=18){254[\'507\']=13.507}15(13.568!=18){254[\'568\']=13.568}14 325=56,521=56,33;51(14 17=0;17<40.41;17++){33=40[17];15(33.593||33.49.281==$.22.1450){521=52}15(33.89&&33.468){14 944=13.1443[17]||33.162.452();15(944){14 157=33.157;15(521&&17<40.41-1){325=52}27 15(521&&17==40.41-1){325=56}13.49.1188.108(13,944,157,325,521);325=52}51(14 36=0;36<$.22.952.41;36++){14 945=$.22.952[36].108(13,33);15(945){13.49.1188.108(13,945.162,945.157,325);325=52}}944=18}}}37 13.48};$.22.790.62.329=26(125){15(13.89){15(13.474==\'847\'){317(13.460){74\'659\':14 84=125.97;14 109=125.115;13.48.68(\'97\',84);13.48.68(\'115\',109);83;74\'81\':14 84=(125.97+(13.117.137-125.163))/2-13.340()/2;14 109=125.115;13.48.68(\'97\',84);13.48.68(\'115\',109);83;74\'596\':14 84=125.163;14 109=125.115;13.48.68({163:84,115:109});83;74\'202\':14 84=125.163;14 109=(125.115+(13.117.141-125.172))/2-13.327()/2;13.48.68({163:84,115:109});83;74\'652\':14 84=125.163;14 109=125.172;13.48.68({163:84,172:109});83;74\'33\':14 84=(125.97+(13.117.137-125.163))/2-13.340()/2;14 109=125.172;13.48.68({97:84,172:109});83;74\'644\':14 84=125.97;14 109=125.172;13.48.68({97:84,172:109});83;74\'174\':14 84=125.97;14 109=(125.115+(13.117.141-125.172))/2-13.327()/2;13.48.68({97:84,115:109});83;355:14 84=125.163;14 109=125.172;13.48.68({163:84,172:109});83}}27 15(13.474==\'592\'){317(13.460){74\'659\':14 84=13.117.137-125.97;14 109=125.115;13.48.68(\'163\',84);13.48.68(\'115\',109);83;74\'81\':14 84=(125.97+(13.117.137-125.163))/2-13.340()/2;14 109=13.117.141-125.115;13.48.68(\'97\',84);13.48.68(\'172\',109);83;74\'596\':14 84=13.117.137-125.163;14 109=125.115;13.48.68({97:84,115:109});83;74\'202\':14 84=13.117.137-125.163;14 109=(125.115+(13.117.141-125.172))/2-13.327()/2;13.48.68({97:84,115:109});83;74\'652\':14 84=13.117.137-125.163;14 109=125.172;13.48.68({97:84,172:109});83;74\'33\':14 84=(125.97+(13.117.137-125.163))/2-13.340()/2;14 109=13.117.141-125.172;13.48.68({97:84,115:109});83;74\'644\':14 84=13.117.137-125.97;14 109=125.172;13.48.68({163:84,172:109});83;74\'174\':14 84=13.117.137-125.97;14 109=(125.115+(13.117.141-125.172))/2-13.327()/2;13.48.68({163:84,115:109});83;355:14 84=125.163;14 109=125.172;13.48.68({163:84,172:109});83}}27{317(13.460){74\'659\':13.48.68({97:0,115:125.115});83;74\'81\':14 84=(125.97+(13.117.137-125.163))/2-13.340()/2;13.48.68({97:84,115:125.115});83;74\'596\':13.48.68({163:0,115:125.115});83;74\'202\':14 109=(125.115+(13.117.141-125.172))/2-13.327()/2;13.48.68({163:125.163,115:109});83;74\'652\':13.48.68({163:125.163,172:125.172});83;74\'33\':14 84=(125.97+(13.117.137-125.163))/2-13.340()/2;13.48.68({97:84,172:125.172});83;74\'644\':13.48.68({97:125.97,172:125.172});83;74\'174\':14 109=(125.115+(13.117.141-125.172))/2-13.327()/2;13.48.68({97:125.97,115:109});83;355:13.48.68({163:125.163,172:125.172});83}}}};$.22.379=26(){13.372={};13.700=18};$.22.379.62.231=26(){14 145=86 $.22.1201({425:\'654\'});14 81,17,359;51(81 262 145.91){15(81=="299"){145.91[81]=13.91.68(\'157\')}27{145.91[81]=13.91.68(81)}}15(13.258.89&&13.258.48){51(81 262 145.258){15(81=="299"){145.258[81]=13.258.48.68(\'157\')}27{145.258[81]=13.258.48.68(81)}}}51(81 262 145.268){145.268[81]=13.268[81]}15(145.268.503==18&&13.268.473!=18){145.268.503=13.268.473}15(13.168.89&&13.168.48){51(81 262 145.168){15(81==\'299\'){145.168[81]=13.168.48.68(\'157\')}27{145.168[81]=13.168.48.68(81)}}}14 33;51(17=0;17<13.40.41;17++){33=13.40[17];15(33.49.281==$.22.516){145.40.103(86 1305())}27 15(33.49.281==$.22.801){145.40.103(86 1326())}27 15(33.49.281==$.22.1468){145.40.103(86 1336())}27 15(33.49.281==$.22.1471){145.40.103(86 1337())}27 15(33.49.281==$.22.1473){145.40.103(86 1359())}27 15(33.49.281==$.22.2091){145.40.103(86 1236())}27{145.40.103({})}51(81 262 145.40[17]){145.40[17][81]=33[81]}}14 84,159;51(81 262 13.146){159=13.146[81];84=145.146[81]=86 1372();84.267=159.267;84.318=159.318;15(159.269&&159.269[0]){51(359 262 84.291){15(159.269[0].439(359)){84.291[359]=159.269[0][359]}27 15(159.269[0].48){84.291[359]=159.269[0].48.68(359)}}}15(159.263&&159.263.89){51(359 262 84.162){15(159.263[359]){84.162[359]=159.263[359]}27 15(159.263.48){15(359==\'299\'){84.162[359]=159.263.48.68(\'157\')}27{84.162[359]=159.263.48.68(359)}}}}}13.701.1202(145);13.701.700=13.701.372[145.425]};$.22.379.62.449=26(88){15(!88){37 13.700}27{37 13.372[88]}};26 1176(84,109){37 84-109}$.22.379.62.2092=26(){14 525=[];51(14 81 262 13.372){525.103(81)}37 525.951(1176)};$.22.379.62.2087=26(){14 525=[];14 372=[];51(14 81 262 13.372){525.103(81)}525.951(1176);51(14 17=0;17<525.41;17++){372.103(13.372[525[17]])}37 372};$.22.379.62.1490=26(67,88){14 635=56;15(!88&&13.700&&13.700.425){88=13.700.425}15(!13.372.439(88)){438 86 343("1175 624 2081 2085 88")}27{14 145=13.372[88];13.700=145;14 259,2099=56,2098=56;14 424=[\'243\',\'282\',\'301\',\'433\'];51(17=0;17<424.41;17++){14 159=424[17];15(145.570.267!=18){67.146[159].267=145.570.267}15(145.570.318!=18){67.146[159].318=145.570.318}}51(14 1178 262 67.146){14 116=67.146[1178];15(116.89){14 1277=145.146[1178]||{};14 1268=145.570;14 527=$.22.177(52,{},1277,1268);259=(145.570.267!=18)?145.570.267:527.267;15(527.267!=18){116.267=527.267;635=52}259=(145.570.318!=18)?145.570.318:527.318;15(527.318!=18){116.318=527.318;635=52}15(116.269&&116.269[0]){51(14 359 262 527.291){259=527.291[359];15(259!=18){116.364[359]=259;116.269=[];635=52}}}15(116.263&&116.263.89){51(14 359 262 527.162){259=527.162[359];15(259!=18){116.744[359]=259;635=52}}}}}51(14 81 262 145.268){15(145.268[81]!=18){67.268[81]=145.268[81]}}15(!635){67.268.129()}15(67.168.89){51(81 262 145.168){15(145.168[81]!=18){67.168[81]=145.168[81]}}}15(67.258.89){51(81 262 145.258){15(145.258[81]!=18){67.258[81]=145.258[81]}}}14 17;51(17=0;17<145.40.41;17++){14 58={};14 2077=56;51(81 262 145.40[17]){259=(145.1196[81]!=18)?145.1196[81]:145.40[17][81];15(259!=18){58[81]=259;15(81==\'157\'){67.40[17].49.303.297=259;67.40[17].49.303.312=259;67.40[17][81]=259}27 15((81==\'217\')||(81==\'392\')){67.40[17].49.303[81]=259;67.40[17][81]=259}27 15(81==\'496\'){743(67.40[17].496,259);743(67.40[17].504,259)}27{67.40[17][81]=259}635=52}}}15(635){67.91.1180();67.129()}51(81 262 145.91){15(145.91[81]!=18){67.91.68(81,145.91[81])}}}};$.22.379.62.1202=26(624,88){15(88){624.425=88}15(!624.425){624.425=277.927(86 277())}15(!13.372.439(624.425)){13.372[624.425]=624}27{438 86 343("22.379 343: 1201 1235 262 1252")}};$.22.379.62.1245=26(88){15(88==\'654\'){37 56}37 598 13.372[88]};$.22.379.62.2055=26(88,306){15(266(88)==\'416\'){306=306||88;88=18}15(306&&306.425){88=306.425}27{88=88||277.927(86 277())}14 145=13.477(13.372[\'654\'].425,88);$.22.177(145,306);37 145};26 646(306){15(306==18||266(306)!=\'416\'){37 306}14 78=86 306.281();51(14 428 262 306){78[428]=646(306[428])}37 78}$.22.646=646;26 743(747,611){15(611==18||266(611)!=\'416\'){37}51(14 428 262 611){15(428==\'844\'){747[428]=646(611[428])}15(611[428]!=18&&266(611[428])==\'416\'){15(!747.439(428)){747[428]={}}743(747[428],611[428])}27{747[428]=611[428]}}}$.22.743=743;$.22.177=26(){14 91=261[0]||{},17=1,41=261.41,940=56,39;15(266 91==="2054"){940=91;91=261[1]||{};17=2}15(266 91!=="416"&&!452.108(91)==="[416 2053]"){91={}}51(;17<41;17++){15((39=261[17])!=18){51(14 88 262 39){14 745=91[88],477=39[88];15(91===477){1193}15(940&&477&&266 477==="416"&&!477.1182){91[88]=$.22.177(940,745||(477.41!=18?[]:{}),477)}27 15(477!==322){91[88]=477}}}}37 91};$.22.379.62.1256=26(845,932){15(845==\'654\'||932==\'654\'){438 86 343("22.379 343: 1237 1256 2056/933 654")}15(13.372.439(932)){438 86 343("22.379 343: 2057 88 1235 262 1252.")}27 15(13.372.439(845)){14 145=13.477(845,932);13.1245(845);37 145}438 86 343("22.379 343: 2059 88 2058 86 88 1209")};$.22.379.62.477=26(1208,935,306){15(935==\'654\'){438 86 343("22.379 343: 1237 477 2052 654 624")}15(!13.372.439(1208)){14 33="22.379 343: 2051 88 1209";438 86 343(33)}15(13.372.439(935)){14 33="22.379 343: 1207 88 1209";438 86 343(33)}27{14 145=646(13.372[1208]);145.425=935;$.22.177(52,145,306);13.1202(145);37 145}};$.22.1201=26(88,306){15(266(88)==\'416\'){306=306||88;88=18}88=88||277.927(86 277());13.425=88;13.91={503:18};13.168={299:18,308:18,296:18,551:18,473:18};13.258={299:18,308:18,296:18,463:18};13.1196={};13.40=[];13.268={759:18,1194:18,467:18,503:18,267:18,318:18,260:18};13.570={162:{},291:{}};13.146={};15(266(306)==\'906\'){13.425=306}27 15(266(306)==\'416\'){$.22.177(52,13,306)}};14 1372=26(){13.267=18;13.318=18;13.291=86 1314();13.162=86 1311()};14 1314=26(){13.89=18;13.552=18;13.468=18;13.475=18;13.313=18;13.299=18;13.1304=18;13.296=18;13.308=18};14 1311=26(){13.299=18;13.1304=18;13.296=18;13.308=18;13.1184=18};14 1305=26(){13.157=18;13.217=18;13.392=18;13.260=18;13.443=18;13.937=18;13.496=86 1335()};14 1335=26(){13.89=18;13.311=18;13.217=18;13.313=18;13.157=18;13.260=18};14 1326=26(){13.157=18;13.488=18;13.217=18;13.260=18;13.2046=18;13.2045=18;13.2044=18;13.844=18};14 1336=26(){13.488=18;13.465=18;13.1039=18;13.156=18;13.260=18;13.1042=18;13.217=18;13.844=18};14 1337=26(){13.488=18;13.465=18;13.1039=18;13.156=18;13.260=18;13.1042=18;13.217=18;13.2047=18;13.2048=18;13.2050=18;13.844=18};14 1359=26(){13.157=18;13.217=18;13.260=18;13.465=18;13.2078=18;13.488=18;13.844=18};14 1236=26(){13.465=18;13.503=18;13.2060=18;13.2061=18;13.2072=18;13.2071=18;13.2073=18;13.2074=18;13.2076=18;13.2075=18;13.2070=18};$.348.1448=26(){37 $(13).1289().2069(26(){37 13.1182==3}).357()};$.348.1047=26(){14 68=345.1030?345.1030(13[0],""):13[0].1451;14 1191=68[\'407-311\']?[\'407-311\',\'407-2064\',\'407-313\',\'407-751\']:[\'1498\',\'1184\',\'296\',\'308\'];14 311=[];51(14 17=0;17<1191.41;++17){14 506=385(68[1191[17]]);15(506&&506!=\'2063\'){311.103(506)}}37 311.762(\' \')};$.348.1465=26(39){39=39||{};14 688=(39.688==18)?0:39.688;14 686=(39.686==18)?0:39.686;14 503=(39.503==18)?\'66(255,255,255)\':39.503;15($(13).137()==0||$(13).141()==0){37 18}15($.22.553){37 18}14 634=276.309("120");14 201=$(13).713(52);14 174=$(13).716(52);14 1210=$(13).386();14 1286=1210.97;14 1345=1210.115;14 541=0,753=0;14 1083=[\'22-431-168\',\'22-243-294\',\'22-282-294\',\'22-301-294\',\'22-433-294\',\'22-548-294\',\'22-543-294\',\'22-542-294\',\'22-544-294\',\'22-547-294\',\'22-546-294\',\'22-571-294\',\'22-243-162\',\'22-282-162\',\'22-301-162\',\'22-433-162\',\'22-548-162\',\'22-543-162\',\'22-542-162\',\'22-544-162\',\'22-547-162\',\'22-546-162\',\'22-571-162\'];14 489,430,1027,1029;51(14 17=0;17<1083.41;17++){$(13).1034(\'.\'+1083[17]).580(26(){489=$(13).386().115-1345;430=$(13).386().97-1286;1029=430+$(13).716(52)+541;1027=489+$(13).713(52)+753;15(430<-541){174=174-541-430;541=-430}15(489<-753){201=201-753-489;753=-489}15(1029>174){174=1029}15(1027>201){201=1027}})}634.137=174+731(688);634.141=201+731(686);14 334=634.680("859");334.540();334.297=503;334.369(0,0,634.137,634.141);334.499();334.1425(541,753);334.463=\'97\';334.2062=\'115\';26 1433(166){14 681=200($(166).68(\'420-141\'),10);15(442(681)){681=200($(166).68(\'407-313\'),10)*1.2}37 681}26 1046(166,556,357,97,115,819){14 681=1433(166);14 1429=$(166).834();14 2065=$(166).835();14 684=357.907(/\\33+/);14 1426=684.41;14 174=\'\';14 639=[];14 489=115;14 430=97;51(14 17=0;17<1426;17++){174+=684[17];15(556.818(174).137>1429){639.103(17);174=\'\';17--}}15(639.41===0){15($(166).68(\'463\')===\'662\'){430=97+(819-556.818(174).137)/2-541}556.817(357,430,115)}27{174=684.279(0,639[0]).762(\' \');15($(166).68(\'463\')===\'662\'){430=97+(819-556.818(174).137)/2-541}556.817(174,430,489);489+=681;51(14 17=1,94=639.41;17<94;17++){174=684.279(639[17-1],639[17]).762(\' \');15($(166).68(\'463\')===\'662\'){430=97+(819-556.818(174).137)/2-541}556.817(174,430,489);489+=681}174=684.279(639[17-1],684.41).762(\' \');15($(166).68(\'463\')===\'662\'){430=97+(819-556.818(174).137)/2-541}556.817(174,430,489)}}26 1069(166,688,686){14 832=166.2066.1071();14 93=$(166).274();14 68=345.1030?345.1030(166,""):166.1451;14 97=688+93.97+200(68.507,10)+200(68.2068,10)+200(68.2067,10);14 115=686+93.115+200(68.511,10)+200(68.2033,10)+200(68.1097,10);14 174=634.137;15((832==\'409\'||832==\'1976\')&&!$(166).1051(\'22-813-1806\')){$(166).1068().580(26(){1069(13,97,115)});14 357=$(166).1448();15(357){334.407=$(166).1047();334.297=$(166).68(\'157\');1046(166,334,357,97,115,174)}}27 15(832===\'431\'&&$(166).1051(\'22-431-168\')){334.312=$(166).68(\'551-115-157\');334.297=$(166).68(\'473-157\');334.369(97,115,$(166).834(),$(166).835());15(200($(166).68(\'551-115-137\'),10)>0){334.558(97,115,$(166).834(),$(166).835())}$(166).1034(\'409.22-431-168-690-1403\').580(26(){14 132=$(13);334.312=132.68(\'551-115-157\');14 94=97+132.274().97;14 54=115+132.274().115;334.558(94,54,132.834(),132.835());94+=200(132.68(\'465-97\'),10);54+=200(132.68(\'465-115\'),10);14 201=132.835()-2*200(132.68(\'465-115\'),10);14 174=132.834()-2*200(132.68(\'465-97\'),10);14 690=132.1068(\'409.22-431-168-690\');334.297=690.68(\'473-157\');334.369(94,54,174,201)});$(166).1034(\'429.22-431-168-162\').580(26(){14 132=$(13);14 94=97+132.274().97;14 54=115+132.274().115+200(132.68(\'465-115\'),10);334.407=132.1047();334.297=132.68(\'157\');1046(132,334,132.357(),94,54,174)});14 132=18}27 15(832==\'120\'){334.1807(166,97,115)}}$(13).1068().580(26(){1069(13,688,686)});37 634};$.348.908=26(39){14 1070=$(13).1465(39);15(1070){37 1070.1805("1023/1150")}27{37 18}};$.348.1804=26(39){14 132=276.309("1476");14 358=$(13).908(39);132.745=358;37 132};$.348.1272=26(39){14 358=\'<1476 745=\'+$(13).908(39)+\' />\';37 358};$.348.1802=26(){14 1024=$(13).908({});15(1024){345.460.1803=1024.528("1023/1150","1023/1808-1809")}};$.348.1814=26(){14 1143=$(13).1272({});14 1024=$(13).908({});15(1143){14 174=345.1270(\'\');174.276.1270("1023/1150");174.276.1815(1143);174.276.1813();174=18}};14 101=26(){13.353=101.271.353;13.387="101";13.131=86 277();13.39={};13.456=101.373.820();13.256=\'\';13.494=101.271.494;317(261.41){74 0:83;74 1:15(998(261[0])=="[416 1001]"&&261[0].387!="101"){14 58=13.39=261[0];13.353=58.353||13.353;13.494=58.494||13.494;13.131=101.708(58.602)}27{13.131=101.708(261[0])}83;355:14 84=[];51(14 17=0;17<261.41;17++){84.103(261[17])}13.131=86 277();13.131.821.422(13.131,84.279(0,3));15(84.279(3).41){13.131.678.422(13.131,84.279(3))}83}};101.271={1200:\'851\',353:\'1181\',494:1900};101.62.464=26(195,476){14 647=563[476]||563.707;15(266 647==\'195\'){14 1291=13.131.564();13.131.1041(13.131.645()+(647*195));1037=1291-13.131.564();13.131.1041(13.131.645()-(1037*60*1000))}27{647.464(13,195)}37 13};101.62.646=26(){37 86 101(13.131.645())};101.62.1812=26(){37 13.131.564()*1017};101.62.664=26(717,476,1226){717=86 101(717);15(717===18){37 18}14 647=563[476]||563.707;15(266 647==\'195\'){14 1037=(717.131.564()-13.131.564())*60*1000;14 884=(13.131.645()-717.131.645()+1037)/647}27{14 884=647.664(13.131,717.131)}37(1226?884:55[884>0?\'390\':\'330\'](884))};101.62.1977=26(){37 101.373[13.456]["492"][13.131.649()]};101.62.1810=26(){37 101.373[13.456]["478"][13.131.671()]};101.62.1811=26(){37 13.131.888()>=12?\'1801\':\'1800\'};101.62.1790=26(){37 13.131.888()>=12?\'1458\':\'1078\'};101.62.1791=26(){37 200(13.131.459()/100,10)};101.62.786=26(){37 13.131.786()};101.62.649=26(){37 13.131.649()};101.62.1346=26(){14 1164=13.131.649();37 1164===0?7:1164};101.62.1132=26(){14 57=13.131;14 696=57-86 277(\'\'+57.459()+\'/1/1 1363\');696+=57.564()*1017;57=18;37 200(696/1017/60/24,10)+1};101.62.1789=26(){37 101.373[13.456]["493"][13.131.649()]};101.62.1788=26(){14 57=13.131;14 1019=13.1132();14 1036=6-57.649();14 742=200((1019+1036)/7,10);37 742};101.62.459=26(){37 13.131.459()};101.62.1362=26(){14 532=13.131.564()/60;14 295=532<0?\'+\':\'-\';532=55.335(532);37 295+930(55.390(532),2)+\':\'+930((532%1)*60,2)};101.62.888=26(){37 13.131.888()};101.62.1786=26(){14 532=13.131.888();37 532>12?532-12:(532==0?12:532)};101.62.1251=26(){14 57=13.131;14 742=13.1354();14 1121=(86 277(\'\'+57.459()+\'/1/1\')).649();14 749=742+(1121>4||1121<=1?0:1);15(749==53&&(86 277(\'\'+57.459()+\'/12/31\')).649()<4){749=1}27 15(749===0){57=86 101(86 277(\'\'+(57.459()-1)+\'/12/31\'));749=57.1251()}57=18;37 749};101.62.1255=26(){37 13.131.1255()};101.62.1254=26(){37 13.131.1254()};101.62.671=26(){37 13.131.671()};101.62.1787=26(){37 101.373[13.456]["470"][13.131.671()]};101.62.1322=26(){37 13.131.671()+1};101.62.1253=26(){37 13.131.1253()};101.62.1792=26(){37 13.131.1159()%100};101.62.645=26(){37 13.131.645()};101.62.1793=26(){37 13.131.452().528(/^.*\\(([^)]+)\\)$/,\'$1\')};101.62.1798=26(){14 155=/(?:\\((.+)\\)$| ([741-1005]{3}) )/.1799(13.452());37 155[1]||155[2]||\'1363\'+13.1362()};101.62.564=26(){37 13.131.564()};101.62.1354=26(){14 1019=13.1132();14 1036=7-13.1346();14 742=200((1019+1036)/7,10);37 742};101.62.1797=26(){37 55.382(13.131.645()/1000,0)};101.62.1159=26(){37 13.131.1159()};101.62.904=26(476){476=476||\'707\';37 13.646().464(1,476)};101.62.399=26(){317(261.41){74 0:13.131=86 277();83;74 1:15(998(261[0])=="[416 1001]"&&261[0].387!="101"){14 58=13.39=261[0];13.353=58.353||13.353;13.494=58.494||13.494;13.131=101.708(58.602)}27{13.131=101.708(261[0])}83;355:14 84=[];51(14 17=0;17<261.41;17++){84.103(261[17])}13.131=86 277();13.131.821.422(13.131,84.279(0,3));15(84.279(3).41){13.131.678.422(13.131,84.279(3))}83}37 13};101.62.1310=26(81){13.131.1310(81);37 13};101.62.821=26(){13.131.821.422(13.131,261);37 13};101.62.678=26(){13.131.678.422(13.131,261);37 13};101.62.987=26(81){13.131.987(81);37 13};101.62.1302=26(){13.131.1302.422(13.131,261);37 13};101.62.1195=26(){13.131.1195.422(13.131,261);37 13};101.62.1301=26(){13.131.1301.422(13.131,261);37 13};101.62.1041=26(81){13.131.1041(81);37 13};101.62.856=26(){13.131.856.422(13.131,261);37 13};101.62.941=26(256){256=256||13.256||101.373[13.456][\'256\'];37 101.941(13,256,13.353)};101.62.452=26(){37 13.131.452()};101.62.1796=26(){37(13.131.459()*1794)+(13.1322()*100)+13.131.786()};101.373={\'851\':{470:[\'1795\',\'1816\',\'1817\',\'1115\',\'1092\',\'1838\',\'1321\',\'1413\',\'1058\',\'1839\',\'1144\',\'1344\'],478:[\'748\',\'1020\',\'526\',\'1112\',\'1092\',\'715\',\'718\',\'1142\',\'903\',\'1091\',\'736\',\'1475\'],493:[\'1837\',\'1836\',\'1834\',\'1835\',\'1840\',\'1841\',\'1846\'],492:[\'1847\',\'1845\',\'1844\',\'1842\',\'1843\',\'1833\',\'1832\'],256:\'%375-%197-%57 %331:%310:%285\'},\'1822\':{470:[\'1823\',\'711é1821\',\'1820\',\'1818\',\'805\',\'1819\',\'1824\',\'1223û54\',\'1825\',\'1830\',\'1831\',\'530é1829\'],478:[\'748\',\'711é668\',\'526\',\'1828\',\'805\',\'715\',\'718\',\'1223û\',\'903\',\'1091\',\'736\',\'530é482\'],493:[\'1826\',\'1827\',\'1785\',\'1784\',\'1742\',\'1743\',\'1741\'],492:[\'1740\',\'1399\',\'526\',\'1738\',\'1739\',\'1744\',\'1745\'],256:\'%375-%197-%57 %331:%310:%285\'},\'1750\':{470:[\'1751\',\'1749\',\'310ä1748\',\'1115\',\'805\',\'1325\',\'1746\',\'1413\',\'1058\',\'1318\',\'1144\',\'1747\'],478:[\'748\',\'1020\',\'310ä151\',\'1112\',\'805\',\'715\',\'718\',\'1142\',\'903\',\'1496\',\'736\',\'1146\'],493:[\'1737\',\'1736\',\'1726\',\'1727\',\'1725\',\'1724\',\'1722\'],492:[\'1723\',\'1728\',\'1460\',\'1044\',\'1406\',\'1729\',\'1734\'],256:\'%375-%197-%57 %331:%310:%285\'},\'1735\':{470:[\'1733\',\'1732\',\'1730\',\'1056\',\'1731\',\'1752\',\'1753\',\'1064\',\'1774\',\'1775\',\'1773\',\'1772\'],478:[\'1770\',\'1020\',\'526\',\'1153\',\'1092\',\'715\',\'718\',\'1145\',\'903\',\'1091\',\'736\',\'1771\'],493:[\'1157\',\'1776\',\'1777\',\'1044&1421;1782\',\'1783\',\'1781\',\'285&810;1168\'],492:[\'1167\',\'1399\',\'526\',\'1044&1421;\',\'1780\',\'1778\',\'285&810;109\'],256:\'%375-%197-%57 %331:%310:%285\'},\'1779\':{470:[\'Январь\',\'Февраль\',\'Март\',\'Апрель\',\'Май\',\'Июнь\',\'Июль\',\'Август\',\'Сентябрь\',\'Октябрь\',\'Ноябрь\',\'Декабрь\'],478:[\'Янв\',\'Фев\',\'Мар\',\'Апр\',\'Май\',\'Июн\',\'Июл\',\'Авг\',\'Сен\',\'Окт\',\'Ноя\',\'Дек\'],493:[\'воскресенье\',\'понедельник\',\'вторник\',\'среда\',\'четверг\',\'пятница\',\'суббота\'],492:[\'вск\',\'пнд\',\'втр\',\'срд\',\'чтв\',\'птн\',\'сбт\'],256:\'%375-%197-%57 %331:%310:%285\'},\'1769\':{470:[\'كانون الثاني\',\'شباط\',\'آذار\',\'نيسان\',\'آذار\',\'حزيران\',\'تموز\',\'آب\',\'أيلول\',\'تشرين الأول\',\'تشرين الثاني\',\'كانون الأول\'],478:[\'1\',\'2\',\'3\',\'4\',\'5\',\'6\',\'7\',\'8\',\'9\',\'10\',\'11\',\'12\'],493:[\'السبت\',\'الأحد\',\'الاثنين\',\'الثلاثاء\',\'الأربعاء\',\'الخميس\',\'الجمعة\'],492:[\'سبت\',\'أحد\',\'اثنين\',\'ثلاثاء\',\'أربعاء\',\'خميس\',\'جمعة\'],256:\'%375-%197-%57 %331:%310:%285\'},\'1459\':{470:[\'1489\',\'1501\',\'526&961;675\',\'1056\',\'1493\',\'1462\',\'1464\',\'1064\',\'1479\',\'1461\',\'1503\',\'1494\'],478:[\'748\',\'1500\',\'526\',\'1153\',\'805\',\'715\',\'718\',\'1145\',\'1266\',\'1278\',\'736\',\'1146\'],493:[\'1157\',\'1290-537\',\'962&961;84-537\',\'1283-537\',\'1282-537\',\'1281-537\',\'285&810;1168\'],492:[\'1167\',\'1248\',\'962\',\'1225\',\'1230\',\'1234\',\'285&810;109\'],256:\'%375-%197-%57 %331:%310:%285\'},\'1459-1768\':{470:[\'1489\',\'1501\',\'526&961;675\',\'1056\',\'1493\',\'1462\',\'1464\',\'1064\',\'1479\',\'1461\',\'1503\',\'1494\'],478:[\'748\',\'1500\',\'526\',\'1153\',\'805\',\'715\',\'718\',\'1145\',\'1266\',\'1278\',\'736\',\'1146\'],493:[\'1157\',\'1290-537\',\'962&961;84-537\',\'1283-537\',\'1282-537\',\'1281-537\',\'285&810;1168\'],492:[\'1167\',\'1248\',\'962\',\'1225\',\'1230\',\'1234\',\'285&810;109\'],256:\'%375-%197-%57 %331:%310:%285\'},\'1758\':{470:[\'1759ń\',\'1757\',\'1756\',\'1754ń\',\'1308\',\'1755\',\'1760\',\'1761ń\',\'1766ń\',\'1338ź1767\',\'1765\',\'1764ń\'],478:[\'1762\',\'1763\',\'526\',\'1848\',\'1308\',\'1849\',\'1935\',\'1936\',\'1934\',\'1338ź\',\'1933\',\'1931\'],493:[\'1932\',\'1937ł1938\',\'1943\',\'Ś1944\',\'1942\',\'1941ą1939\',\'1940\'],492:[\'1930\',\'1929\',\'1919\',\'Ś151\',\'1920\',\'1918\',\'1917\'],256:\'%375-%197-%57 %331:%310:%285\'},\'1915\':{470:[\'1916\',\'1921\',\'1922\',\'1115\',\'1247\',\'1325\',\'1321\',\'1927\',\'1058\',\'1318\',\'1144\',\'1344\'],478:[\'748\',\'1020\',\'526\',\'1112\',\'1247\',\'715\',\'718\',\'1142\',\'903\',\'1496\',\'736\',\'1475\'],493:\',\'[\'1928\',\'1926\',\'1925\',\'1923\',\'1924\',\'1945\',\'1946\'],492:[\'1967\',\'1968\',\'1460\',\'1966\',\'1406\',\'1965\',\'1963\'],256:\'%375-%197-%57 %331:%310:%285\'},\'1964\':{470:[\'1969\',\'1970\',\'1975\',\'1974\',\'1306\',\'1973\',\'1971\',\'1972\',\'1962\',\'1961\',\'1951\',\'1952\'],478:[\'1950\',\'1949\',\'1947\',\'1948\',\'1306\',\'1953\',\'1954\',\'1959\',\'1960\',\'1958\',\'1957\',\'1955\'],493:[\'33ö1221\',\'197å1221\',\'1956\',\'1914\',\'1913\',\'1870\',\'94ö1871\'],492:[\'33ö81\',\'197å81\',\'1869\',\'1868\',\'1866\',\'1867\',\'94ö151\'],256:\'%375-%197-%57 %331:%310:%285\'}};101.373[\'851-1872\']=101.373[\'851-1873\']=101.373[\'851\'];101.373.820=26(){14 94=101.271.1200;15(276&&276.936(\'614\')&&276.936(\'614\')[0].1307){94=276.936(\'614\')[0].1307;15(!101.373.439(94)){94=101.271.1200}}37 94};14 707=24*60*60*1000;14 930=26(227,1319){227=385(227);14 17=1319-227.41;14 33=385(55.257(10,17)).279(1);37 33.852(227)};14 563={1878:1,1879:1000,1877:60*1000,577:60*60*1000,707:707,1876:7*707,865:{464:26(57,195){563.920.464(57,55[195>0?\'390\':\'330\'](195/12));14 758=57.671()+(195%12);15(758==12){758=0;57.856(57.459()+1)}27 15(758==-1){758=11;57.856(57.459()-1)}57.1195(758)},664:26(617,625){14 1350=617.459()-625.459();14 1349=617.671()-625.671()+(1350*12);14 1347=617.786()-625.786();37 1349+(1347/30)}},920:{464:26(57,195){57.856(57.459()+55[195>0?\'390\':\'330\'](195))},664:26(617,625){37 563.865.664(617,625)/12}}};51(14 476 262 563){15(476.984(476.41-1)!=\'33\'){563[476+\'33\']=563[476]}}14 487=26(57,934,353){15(101.599[353]["919"][934]){37 101.941(57,101.599[353]["919"][934],353)}27{14 855=(101.599[353]["929"][934]||\'\').907(\'.\');14 931=57[\'449\'+855[0]]?57[\'449\'+855[0]]():\'\';15(855[1]){931=930(931,855[1])}37 931}};101.941=26(57,256,353,456){14 848=\'1181\';14 846=101.373.820();15(353&&101.599.439(353)){848=353}27 15(353&&101.373.439(353)){846=353}15(456&&101.599.439(456)){848=456}27 15(456&&101.373.439(456)){846=456}15(998(57)!="[416 1001]"||57.387!="101"){57=86 101(57);57.456=846}15(!256){256=57.256||101.373[846][\'256\']}14 672=256||\'%375-%197-%57\',483=\'\',155;869(672.41>0){15(155=672.155(101.599[848].929.1179)){483+=672.279(0,155.198);483+=(155[1]||\'\')+487(57,155[2],848);672=672.279(155.198+155[0].41)}27{483+=672;672=\'\'}}37 483};101.599={1874:\'%375-%197-%1875%331:%310:%285.%1211%1066\',1865:\'%375-%197-%57 %331:%310:%285\'};101.599.1181={929:{1179:/()%(#?(%|[84-727]))/17,375:\'1416\',76:\'1419.2\',197:\'1177.2\',\'#197\':\'1177\',788:\'1407\',109:\'1183\',57:\'277.2\',\'#57\':\'277\',202:\'277\',741:\'1267\',84:\'1258\',174:\'1386\',331:\'1190.2\',\'#331\':\'1190\',858:\'943.2\',\'#858\':\'943\',93:\'1446\',310:\'1185.2\',\'#310\':\'1185\',285:\'1186.2\',\'#285\':\'1186\',33:\'1455\',1211:\'1288.3\',\'#1211\':\'1288\',1454:\'1442\',1005:\'1864\',1066:\'1441\'},919:{711:\'%375-%197-%57\',1080:\'%331:%310:%285\',1054:\'%331:%310:%285\',77:\'%197/%57/%76\',530:\'%197/%57/%76\',\'#482\':\'%84 %109 %202 %331:%310:%285 %375\',668:\'%202-%109-%375\',1456:\'%331:%310\',151:\'%858:%310:%285 %93\',54:\'\\54\',81:\'\\81\',\'%\':\'%\'}};101.599.1854={929:{1179:/()%((%|[84-727]))/17,84:\'1258\',741:\'1267\',57:\'277.2\',202:\'277\',36:\'1855.3\',286:\'1853\',174:\'1386\',1852:\'1850.2\',1851:\'1856.2\',1857:\'1862.2\',109:\'1183\',788:\'1407\',197:\'1177.2\',201:\'1183\',789:\'1863.2\',76:\'1419.2\',375:\'1416\',331:\'1190.2\',858:\'943.2\',94:\'943\',93:\'1446\',1474:\'1861\',310:\'1185.2\',285:\'1186.2\',33:\'1455\',1454:\'1442\',727:\'1441\',1005:\'1860\'},919:{530:\'%197/%57/%76\',711:\'%375-%197-%57\',1080:\'%331:%310:%285\',1054:\'%331:%310:%285\',77:\'%197/%57/%76\',1456:\'%331:%310\',151:\'%858:%310:%285 %93\',54:\'\\54\',81:\'\\81\',\'%\':\'%\'}};101.708=26(602){15(602==18){37 86 277()}15(602 1240 277){37 602}15(266 602==\'195\'){37 86 277(602)}14 397=385(602).528(/^\\33*(.+)\\33*$/1107,\'$1\');397=397.528(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/,"$1/$2/$3");397=397.528(/^(3[860]|[0-2]?\\57)[-\\/]([84-727]{3,})[-\\/](\\57{4})/17,"$1 $2 $3");14 155=397.155(/^(3[860]|[0-2]?\\57)[-\\/]([84-727]{3,})[-\\/](\\57{2})\\530*/17);15(155&&155.41>3){14 674=350(155[3]);14 491=101.271.494+674;491=385(491);397=397.528(/^(3[860]|[0-2]?\\57)[-\\/]([84-727]{3,})[-\\/](\\57{2})\\530*/17,155[1]+\' \'+155[2]+\' \'+491)}155=397.155(/^([0-9]{1,2})[-\\/]([0-9]{1,2})[-\\/]([0-9]{1,2})[^0-9]/);26 695(397,155){14 667=350(155[1]);14 1214=350(155[2]);14 674=350(155[3]);14 796=101.271.494;14 491,663,603,358;15(667>31){663=674;603=1214;491=796+667}27{663=1214;603=667;491=796+674}358=603+\'/\'+663+\'/\'+491;37 397.528(/^([0-9]{1,2})[-\\/]([0-9]{1,2})[-\\/]([0-9]{1,2})/,358)}15(155&&155.41>3){397=695(397,155)}14 155=397.155(/^([0-9]{1,2})[-\\/]([0-9]{1,2})[-\\/]([0-9]{1,2})$/);15(155&&155.41>3){397=695(397,155)}14 17=0;14 41=101.1081.41;14 342,696,923=397,306;869(17<41){696=277.927(923);15(!442(696)){37 86 277(696)}342=101.1081[17];15(266 342==\'26\'){306=342.108(101,923);15(306 1240 277){37 306}}27{923=397.528(342[0],342[1])}17++}37 1858};101.1859=26(920,865){15(865==2){37 86 277(920,1,29).786()==29?29:28}37[322,31,322,31,30,31,30,31,31,30,31,30,31][865]};101.1081=[[/(3[860]|[0-2]\\57)\\33*\\.\\33*(1[0-2]|0\\57)\\33*\\.\\33*([1-9]\\57{3})/,\'$2/$1/$3\'],[/([1-9]\\57{3})\\33*-\\33*(1[0-2]|0\\57)\\33*-\\33*(3[860]|[0-2]\\57)/,\'$2/$3/$1\'],26(358){14 155=358.155(/^(?:(.+)\\33+)?([1437]?\\57)(?:\\33*\\:\\33*(\\57\\57))?(?:\\33*\\:\\33*(\\57\\57(\\.\\57*)?))?\\33*(1078|1458)?\\33*$/17);15(155){15(155[1]){14 57=13.708(155[1]);15(442(57)){37}}27{14 57=86 277();57.987(0)}14 577=350(155[2]);15(155[6]){577=155[6].1071()==\'1078\'?(577==12?0:577):(577==12?12:577+12)}57.678(577,200(155[3]||0,10),200(155[4]||0,10),((350(155[5]||0))||0)*1000);37 57}27{37 358}},26(358){14 155=358.155(/^(?:(.+))[1080|\\33+]([1437]\\57)(?:\\:(\\57\\57))(?:\\:(\\57\\57))(?:\\.\\57+)([\\+\\-]\\57\\57\\:\\57\\57)$/17);15(155){15(155[1]){14 57=13.708(155[1]);15(442(57)){37}}27{14 57=86 277();57.987(0)}14 577=350(155[2]);57.678(577,200(155[3],10),200(155[4],10),350(155[5])*1000);37 57}27{37 358}},26(358){14 155=358.155(/^([0-3]?\\57)\\33*[-\\/.\\33]{1}\\33*([84-1880-1005]{3,9})\\33*[-\\/.\\33]{1}\\33*([0-3]?\\57)$/);15(155){14 57=86 277();14 796=101.271.494;14 667=350(155[1]);14 674=350(155[3]);14 491,663,603;15(667>31){663=674;491=796+667}27{663=667;491=796+674}14 603=816(155[2],101.373[101.373.820()]["478"]);15(603==-1){603=816(155[2],101.373[101.373.820()]["470"])}57.821(491,603,663);57.678(0,0,0,0);37 57}27{37 358}}];26 816(132,607){15(607.435){37 607.435(132)}51(14 17=0,41=607.41;17<41;17++){15(607[17]===132){37 17}}37-1}26 998(1073){15(1073===18)37"[416 1881]";37 1001.62.452.108(1073)}$.101=101;$.22.509=26(){26 325(358,815,1447,339){14 465=(358.41>=815)?\'\':1903(1+815-358.41>>>0).762(1447);37 339?358+465:465+358}26 971(161){14 814=86 385(161);51(14 17=10;17>0;17--){15(814==(814=814.528(/^(\\57+)(\\57{3})/,"$1"+$.22.509.1491+"$2")))83}37 814}26 735(161,295,339,272,384,380){14 664=272-161.41;15(664>0){14 1067=\' \';15(380){1067=\'&1904;\'}15(339||!384){161=325(161,272,1067,339)}27{161=161.279(0,295.41)+325(\'\',664,\'0\',52)+161.279(295.41)}}37 161}26 770(161,981,295,339,272,242,384,380){14 195=161>>>0;295=295&&195&&{\'2\':\'1902\',\'8\':\'0\',\'16\':\'1901\'}[981]||\'\';161=295+325(195.452(981),242||0,\'0\',56);37 735(161,295,339,272,384,380)}26 256(161,339,272,242,384,380){15(242!=18){161=161.279(0,242)}37 735(161,\'\',339,272,384,380)}14 84=261,17=0,487=84[17++];37 487.528($.22.509.1152,26(984,1045,963,272,1898,242,565){15(984==\'%%\'){37\'%\'}14 339=56,734=\'\',384=56,685=56,380=56,828=56;51(14 36=0;963&&36<963.41;36++)317(963.404(36)){74\' \':734=\' \';83;74\'+\':734=\'+\';83;74\'-\':339=52;83;74\'0\':384=52;83;74\'#\':685=52;83;74\'&\':380=52;83;74\'\\\'\':828=52;83}15(!272){272=0}27 15(272==\'*\'){272=+84[17++]}27 15(272.404(0)==\'*\'){272=+84[272.279(1,-1)]}27{272=+272}15(272<0){272=-272;339=52}15(!1899(272)){438 86 343(\'$.22.509: (964-)137 1905 1906 1911\')}15(!242){242=\'1912\'.435(565)>-1?6:(565==\'57\')?0:1910(0)}27 15(242==\'*\'){242=+84[17++]}27 15(242.404(0)==\'*\'){242=+84[242.279(1,-1)]}27{242=+242}14 161=1045?84[1045.279(0,-1)]:84[17++];317(565){74\'33\':{15(161==18){37\'\'}37 256(385(161),339,272,242,384,380)}74\'482\':37 256(385.1909(+161),339,272,242,384,380);74\'109\':37 770(161,2,685,339,272,242,384,380);74\'675\':37 770(161,8,685,339,272,242,384,380);74\'77\':37 770(161,16,685,339,272,242,384,380);74\'1054\':37 770(161,16,685,339,272,242,384,380).1062();74\'286\':37 770(161,10,685,339,272,242,384,380);74\'17\':{14 195=200(+161,10);15(442(195)){37\'\'}14 295=195<0?\'-\':734;14 665=828?971(385(55.335(195))):385(55.335(195));161=295+325(665,242,\'0\',56);37 735(161,295,339,272,384,380)}74\'57\':{14 195=55.382(+161);15(442(195)){37\'\'}14 295=195<0?\'-\':734;14 665=828?971(385(55.335(195))):385(55.335(195));161=295+325(665,242,\'0\',56);37 735(161,295,339,272,384,380)}74\'202\':74\'1156\':74\'283\':74\'711\':74\'1107\':74\'1066\':{14 195=+161;15(442(195)){37\'\'}14 295=195<0?\'-\':734;14 1484=[\'863\',\'976\',\'1063\'][\'1907\'.435(565.1071())];14 973=[\'452\',\'1062\'][\'1908\'.435(565)%2];14 665=55.335(195)[1484](242);14 413=665.452().907(\'.\');413[0]=828?971(413[0]):413[0];665=413.762($.22.509.1492);161=295+665;14 1481=735(161,295,339,272,384,380)[973]();37 1481}74\'93\':74\'1474\':{14 195=+161;15(442(195)){37\'\'}14 295=195<0?\'-\':734;14 413=385(731(55.335(195)).863()).907(/202|1156/);14 383=(413[0].435(\'.\')!=-1)?413[0].41-1:385(195).41;14 917=(413[1]<0)?-413[1]-1:0;15(55.335(195)<1){15(383+917<=242){161=295+55.335(195).1063(383)}27{15(383<=242-1){161=295+55.335(195).863(383-1)}27{161=295+55.335(195).863(242-1)}}}27{14 1495=(383<=242)?383:242;161=295+55.335(195).1063(1495)}14 973=[\'452\',\'1062\'][\'1897\'.435(565)%2];37 735(161,295,339,272,384,380)[973]()}74\'81\':37\'\';355:37 984}})};$.22.509.1491=\',\';$.22.509.1492=\'.\';$.22.509.1152=/%%|%(\\57+\\$)?([-+#0&\\\' ]*)(\\*\\57+\\$|\\*|\\57+)?(\\.(\\*\\57+\\$|\\*|\\57+))?([1896])/1107;$.22.764=26(195){14 413=385(731(55.335(195)).863()).907(/202|1156/);14 383=(413[0].435(\'.\')!=-1)?413[0].41-1:413[0].41;14 917=(413[1]<0)?-413[1]-1:0;14 901=200(413[1],10);14 1149=(901+1>0)?901+1:0;14 1260=(383<=1149)?0:383-901-1;37{1155:383,898:1149,450:1260,917:917,1886:901}};$.22.1887=26(195){37 $.22.764(195).450};14 1123=$.1885!==56;$.22.412={414:{}};14 1147="22.1884.";$.177($.22.412,{1292:"1.1882",540:26(273,399){51(14 17=0;17<399.41;17++){15(399[17]!==18){273.44(1147+399[17],273[0].311[399[17]])}}},499:26(273,399){51(14 17=0;17<399.41;17++){15(399[17]!==18){273.68(399[17],273.44(1147+399[17]))}}},1352:26(166,370){15(370==="1883"){370=166.588(":591")?"89":"505"}37 370},1315:26(273){15(273.484().588(".946-412-423")){37 273.484()}14 576={137:273.716(52),141:273.713(52),"1284":273.68("1284")},423=$("<409></409>").401("946-412-423").68({296:"100%",473:"1888",551:"1889",777:0,465:0}),313={137:273.137(),141:273.141()},666=276.1217;273.1894(423);15(273[0]===666||$.1222(273[0],666)){$(666).1220()}423=273.484();15(273.68("274")==="1257"){423.68({274:"885"});273.68({274:"885"})}27{$.177(576,{274:273.68("274"),1227:273.68("727-198")});$.580(["115","97","172","163"],26(17,207){576[207]=273.68(207);15(442(200(576[207],10))){576[207]="728"}});273.68({274:"885",115:0,97:0,163:"728",172:"728"})}273.68(313);37 423.68(576).89()},1341:26(273){14 666=276.1217;15(273.484().588(".946-412-423")){273.484().1895(273);15(273[0]===666||$.1222(273[0],666)){$(666).1220()}}37 273}});26 1238(414,39,247,497){15($.723(414)){37 414}414={414:414};15(39===322){39={}}15($.533(39)){497=39;247=18;39={}}15($.565(39)==="195"||$.673.889[39]){497=247;247=39;39={}}15($.533(247)){497=247;247=18}15(39){$.177(414,39)}247=247||39.699;414.699=$.673.1241?0:266 247==="195"?247:247 262 $.673.889?$.673.889[247]:$.673.889.1893;414.510=497||39.510;37 414}26 1892(247){15(!247||266 247==="195"||$.673.889[247]){37 52}15(266 247==="906"&&!$.22.412.414[247]){15(1123&&$.22.412[247]){37 56}37 52}37 56}$.348.177({1110:26(414,39,247,497){14 287=1238.422(13,261),370=287.370,750=287.750,902=$.22.412.414[287.414],1134=!902&&1123&&$.22.412[287.414];15($.673.1241||!(902||1134)){15(370){37 13[370](287.699,287.510)}27{37 13.580(26(){15(287.510){287.510.108(13)}})}}26 1135(904){14 132=$(13),510=287.510,370=287.370;26 910(){15($.533(510)){510.108(132[0])}15($.533(904)){904()}}15(132.588(":591")?370==="505":370==="89"){910()}27{902.108(132[0],287,910)}}15(902){37 750===56?13.580(1135):13.750(750||"673",1135)}27{37 1134.108(13,{39:287,699:287.699,497:287.510,370:287.370})}}});14 1378=/1129|1890|486/,1381=/1129|97|486|922/;$.22.412.414.1127=26(675,910){14 166=$(13),576=["274","115","172","97","163","141","137"],370=$.22.412.1352(166,675.370||"505"),584=675.584||"1129",486=1378.1370(584),878=486?"141":"137",1154=486?"115":"97",1158=1381.1370(584),440={},89=370==="89",423,883,115;15(166.484().588(".946-412-423")){$.22.412.540(166.484(),576)}27{$.22.412.540(166,576)}166.89();115=200(166.68(\'115\'),10);423=$.22.412.1315(166).68({1891:"591"});883=486?423[878]()+115:423[878]();440[878]=89?385(883):\'0\';15(!1158){166.68(486?"172":"163",0).68(486?"115":"97","").68({274:"454"});440[1154]=89?\'0\':385(883)}15(89){423.68(878,0);15(!1158){423.68(1154,883)}}423.882(440,{699:675.699,1334:675.1334,750:56,510:26(){15(370==="505"){166.505()}$.22.412.499(166,576);$.22.412.1341(166);910()}})}})(785);',10,2101,'|||||||||||||this|var|if||i|null||||jqplot||||function|else||||||s|||j|return||options|series|length|||data||||_elem|renderer||for|true||t|Math|false|d|opts|ctx|||prototype||||rgb|plot|css||||||case||y|x|temp|||n||break|a||new||name|show||target||p|l|||left|min|||jsDate||push|||||call|b|gd|max||||top|axis|_plotDimensions|bands||canvas|points||||offsets|ev|||draw||proxy|elem|||||width||||height||||th|axes|||||r||||match|fill|color||ax||value|label|right|||el|evt|legend|||ret|bottom||w|||extend||||||||||gridData|||numberTicks||||idx|number||m|index||parseInt|h|e|||||pos||||||||||lineWidth||||||tickInterval||||num||closePath||init|||hooks||neighbor|||||xx|precision|xaxis|||breakPoints|speed||yp|||||ss||formatString|pow|title|val|shadow|arguments|in|_label|eventCanvas|px|typeof|borderColor|grid|_ticks|newrgb|config|minWidth|element|position|_gridPadding|document|Date|positions|slice|_yaxis|constructor|x2axis|f|pageY|S|u|args|pageX|shadowCanvas|yy|ticks|_width|dim|tick|prefix|fontSize|fillStyle|seriesStack|textColor||yaxis|shadowRenderer|shapeRenderer|interval|lineCap|obj|theta|fontFamily|createElement|M|style|strokeStyle|size|_ctx|gridpos|_plotData|switch|borderWidth|_bottom|Axis|ElemContainer|undefined|_height|dx|pad|_xaxis|getHeight|fact|pack|ceil|H|seriesIndex|smooth|newContext|abs|0px|_left|tempr|leftJustify|getWidth|_right|pattern|Error|gridPadding|window|trigger|k|fn|range|parseFloat|bd|dy|syntax|rgba|default|plugins|text|str|nn|isMinorTick|stretch|pointIndex|drawLine|tickOptions|_top|angle|PI|_options|fillRect|mode|magnitude|themes|regional|_textRenderer|Y|_smoothedData|HooksManager|_offsets|ThemeEngine|htmlSpace|db|round|sd|zeroPad|String|offset|_type|lineRenderer|_sumy|floor|gridPos|linePattern|colors|_stackData|_sumx|isarc|parsable|series_u2p|set||addClass|xp|unitlength|charAt|pixellength|shim|font|_areaPoints|div|sctx|ut|effects|parts|effect|CanvasManager|object|_min|lineJoin|append|line|_smoothedPlotData|apply|wrapper|arr|_name|_axisNames|clearRect|key|td|templeft|table|fb|y2axis|axis_max|indexOf|_max|tempgd|throw|hasOwnProperty|animation|gxx|isNaN|fillColor|seriesDefaults|sidx|lowData|Event|_series|get|digitsRight|fstr|toString|previousSeriesStack|absolute|ti|locale|hiData|pdata|getFullYear|location|axis_min|isArray|textAlign|add|padding|bopts|gridLineWidth|showLabel|ins|monthNames|G_vmlCanvasManager|eventListenerHooks|background|placement|showMark|unit|copy|monthNamesShort|rendererOptions|dataPos|padMin|c|result|parent|dxx|vertical|format|seriesColors|temptop|move|ny|dayNamesShort|dayNames|defaultCentury|sortData|markerOptions|callback|GenericCanvas|restore|_hiBandGridData|highlightMouseDown|dist|backgroundColor|markerRenderer|hide|attr|marginLeft|bind|sprintf|complete|marginTop|_lowBandGridData|series1|_dataBounds|keepMin|LineRenderer|LinearAxisRenderer|MarkerRenderer|fs|dataRenderer|reverse