diff --git a/system/controllers/dashboard.php b/system/controllers/dashboard.php
index 1bb592e9..81b95402 100644
--- a/system/controllers/dashboard.php
+++ b/system/controllers/dashboard.php
@@ -209,6 +209,12 @@ if (file_exists($cacheMSfile) && time() - filemtime($cacheMSfile) < 43200) {
file_put_contents($cacheMSfile, json_encode($monthlySales));
}
+if ($config['router_check']) {
+ $routeroffs = ORM::for_table('tbl_routers')->selects(['id', 'name', 'last_seen'])->where('status', 'Offline')->order_by_desc('name')->find_array();
+ print_r($routeroffs);
+ $ui->assign('routeroffs', $routeroffs);
+}
+
// Assign the monthly sales data to Smarty
$ui->assign('start_date', $start_date);
$ui->assign('current_date', $current_date);
diff --git a/ui/ui/dashboard.tpl b/ui/ui/dashboard.tpl
index 7b2abee7..256282d6 100644
--- a/ui/ui/dashboard.tpl
+++ b/ui/ui/dashboard.tpl
@@ -175,6 +175,25 @@
+ {if $_c['router_check']}
+
+
{Lang::T('Routers Offline')}
+
+
+
+ {foreach $routeroffs as $ros}
+
+ {$ros['name']} |
+ {Lang::timeElapsed($ros['last_seen'])}
+ |
+
+ {/foreach}
+
+
+
+
+ {/if}
{if $_c['hide_pg'] != 'yes'}
{Lang::T('Payment Gateway')}: {str_replace(',',', ',$_c['payment_gateway'])}
@@ -337,7 +356,7 @@
//lets calculate the inactive users as reported
var expired = u_all - u_act;
var inactive = c_all - u_all;
- if(inactive < 0){
+ if (inactive < 0) {
inactive = 0;
}
// Create the chart data
diff --git a/ui/ui/routers.tpl b/ui/ui/routers.tpl
index 00a08a81..58b63aef 100644
--- a/ui/ui/routers.tpl
+++ b/ui/ui/routers.tpl
@@ -5,10 +5,10 @@
@@ -40,10 +40,10 @@
{Lang::T('IP Address')} |
{Lang::T('Username')} |
{Lang::T('Description')} |
- {if $config['router_check']}
+ {if $_c['router_check']}
{Lang::T('Online Status')} |
+
{Lang::T('Last Seen')} |
{/if}
-
{Lang::T('Last Seen')} |
{Lang::T('Status')} |
{Lang::T('Manage')} |
ID |
@@ -51,52 +51,58 @@
{foreach $d as $ds}
-
-
- {if $ds['coordinates']}
-
- {/if}
- {$ds['name']}
- |
- {$ds['ip_address']} |
- {$ds['username']} |
- {$ds['description']} |
- {if $config['router_check']}
- {if
- $ds['status'] == 'Online'}{Lang::T('Online')}{else}{Lang::T('Offline')}{/if}
+ |
+
+ {if $ds['coordinates']}
+
+ {/if}
+ {$ds['name']}
|
- {/if}
- {$ds['last_seen']} |
- {if $ds['enabled'] == 1}{Lang::T('Enabled')}{else}{Lang::T('Disabled')}{/if} |
-
- {Lang::T('Edit')}
-
- |
- {$ds['id']} |
-
+ {$ds['ip_address']} |
+ {$ds['username']} |
+ {$ds['description']} |
+ {if $_c['router_check']}
+
+
+ {if $ds['status'] == 'Online'}
+ {Lang::T('Online')}
+ {else}
+ {Lang::T('Offline')}
+ {/if}
+
+ |
+ {$ds['last_seen']} |
+ {/if}
+ {if $ds['enabled'] == 1}{Lang::T('Enabled')}{else}{Lang::T('Disabled')}{/if} |
+
+ {Lang::T('Edit')}
+
+ |
+ {$ds['id']} |
+
{/foreach}
{include file="pagination.tpl"}
-
{Lang::T('Check if Mikrotik Online?')}
-
{Lang::T('To check if Mikrotik is Online or not, go to Settings, set Router Check Enabled')}
-
+
{Lang::T('Check if Mikrotik Online?')}
+
{Lang::T('To check if Mikrotik is Online or not, go to Settings, set Router Check Enabled')}
+
-{include file="sections/footer.tpl"}
+{include file="sections/footer.tpl"}
\ No newline at end of file