ajax
3 years ago
databases
3 years ago
migrations
3 years ago
models
3 years ago
queries
3 years ago
utils
3 years ago
chart.php
3 years ago
chart_geo.php
3 years ago
dashboard_widget.php
3 years ago
db.php
3 years ago
filters.php
3 years ago
freemius.php
3 years ago
independent_analytics.php
3 years ago
known_referrers.php
3 years ago
quick_stats.php
3 years ago
rest_api.php
3 years ago
settings.php
3 years ago
table.php
3 years ago
table_geo.php
3 years ago
table_referrers.php
3 years ago
table_views.php
3 years ago
track_resource_changes.php
3 years ago
view_counter.php
3 years ago
table_geo.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP; |
| 4 | |
| 5 | class Table_Geo extends Table |
| 6 | { |
| 7 | public function columns() |
| 8 | { |
| 9 | return [ |
| 10 | 'continent' => esc_html__('Continent', 'iawp'), |
| 11 | 'country' => esc_html__('Country', 'iawp'), |
| 12 | 'subdivision' => esc_html__('Subdivision', 'iawp'), |
| 13 | 'city' => esc_html__('City', 'iawp'), |
| 14 | 'views' => esc_html__('Views', 'iawp'), |
| 15 | 'visitors' => esc_html__('Visitors', 'iawp'), |
| 16 | ]; |
| 17 | } |
| 18 | |
| 19 | protected function table_name() |
| 20 | { |
| 21 | return 'geo'; |
| 22 | } |
| 23 | |
| 24 | public function default_columns() |
| 25 | { |
| 26 | return ['views', 'visitors', 'city', 'subdivision', 'country']; |
| 27 | } |
| 28 | |
| 29 | public function rows(array $dates) |
| 30 | { |
| 31 | list($start, $end) = $dates; |
| 32 | $geo_query = new Geos($start, $end); |
| 33 | |
| 34 | return $geo_query->get_geos(); |
| 35 | } |
| 36 | } |
| 37 |