| 1 |
<?php |
| 2 |
|
| 3 |
if(class_exists('RabbitLoader_21_Tab_Geo')){ |
| 4 |
#it seems we have a conflict |
| 5 |
return; |
| 6 |
} |
| 7 |
|
| 8 |
final class RabbitLoader_21_Tab_Geo extends RabbitLoader_21_Tab_Init{ |
| 9 |
|
| 10 |
public static function init(){ |
| 11 |
add_settings_section( |
| 12 |
'rabbitloader_section_geo', |
| 13 |
' ', |
| 14 |
'', |
| 15 |
'rabbitloader-geo' |
| 16 |
); |
| 17 |
$start_date = date("Y-m-d", strtotime('-30 days')); |
| 18 |
$end_date = date("Y-m-d"); |
| 19 |
$top10_format = ' |
| 20 |
<div class="col-sm-12 col-md-4"> |
| 21 |
<div class="bg-white rounded py-4"> |
| 22 |
<div class="row"> |
| 23 |
<div class="col-12"> |
| 24 |
<h5 class="px-4">%%TITLE%% <span class="dashicons dashicons-info-outline text-secondary tpopup" title="%%TOOLTIP%% in last 30 days" style="font-size: 16px; line-height: 28px;"></span></h5> |
| 25 |
<div class="px-4 mt-3" id="%%BODY_ID%%">%%BODY%%</div> |
| 26 |
</div> |
| 27 |
</div> |
| 28 |
</div> |
| 29 |
</div>'; |
| 30 |
$tbl = "RLGeoReport.setTop10Format(`$top10_format`);RLGeoReport.initV2(rabbitloader_local_vars.hostname, `".RabbitLoader_21_Core::getRLDomain()."`, `".RabbitLoader_21_Core::getWpOptVal('api_token')."`, `".$start_date."`, `".$end_date."`);"; |
| 31 |
|
| 32 |
self::addDtDependencies(); |
| 33 |
|
| 34 |
wp_enqueue_style( 'rabbitloader-leaflet-css', RABBITLOADER_PLUG_URL . 'admin/css/leaflet.css', [], RABBITLOADER_PLUG_VERSION); |
| 35 |
wp_enqueue_script('rabbitloader-leaflet-js', RABBITLOADER_PLUG_URL . 'admin/js/leaflet.js', [], RABBITLOADER_PLUG_VERSION); |
| 36 |
wp_enqueue_script('rabbitloader-geo-js', RabbitLoader_21_Core::getRLDomain().'account/common/js/report_geo.js', ['rabbitloader-datatable-js', 'rabbitloader-leaflet-js'], RABBITLOADER_PLUG_VERSION); |
| 37 |
wp_add_inline_script('rabbitloader-geo-js', $tbl); |
| 38 |
} |
| 39 |
|
| 40 |
public static function echoMainContent(){ |
| 41 |
|
| 42 |
do_settings_sections( 'rabbitloader-geo' ); |
| 43 |
|
| 44 |
?> |
| 45 |
<div class="" style="max-width: 1160px; margin:40px auto;"> |
| 46 |
|
| 47 |
<div class="row mb-4"> |
| 48 |
<div class="col-12"> |
| 49 |
<div id="rl_analytics_map" style="height:400px; border-radius:4px;"></div> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
|
| 53 |
<div class="row mb-4" id="rl_top10_locations"> |
| 54 |
</div> |
| 55 |
|
| 56 |
<div class="row mb-4"> |
| 57 |
<div class="col"> |
| 58 |
<div class="bg-white rounded py-4"> |
| 59 |
<div class="row"> |
| 60 |
<div class="col-12 text-secondary"> |
| 61 |
<h5 class="px-4">All Countries</h5> |
| 62 |
<span class="d-block px-4">Bandwidth usage and total assets loaded in different countries in last 30 days.</span> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
<div class="mt-4"> |
| 66 |
<table class="table rl-table" id="rl_table_country_stats" style="width:100%"> |
| 67 |
</table> |
| 68 |
</div> |
| 69 |
</div> |
| 70 |
</div> |
| 71 |
</div> |
| 72 |
</div> |
| 73 |
<?php |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
?> |