-
Notifications
You must be signed in to change notification settings - Fork 23
/
interfaces.php
234 lines (205 loc) · 12 KB
/
interfaces.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<?php
session_start();
if($_SESSION['Authenticated']!="1"){
header('Location: index');
}
require("../../includes/variables.php");
require('functions/funciones.php');
include("action/security.php");
include("layouts/menu.php");
require('apimikrotik.php');
$API = new routeros_api();
$API->debug = false;
/*session_start();
if(empty($_SESSION['login_user']))
{
header('Location: index');
}*/
?>
<!DOCTYPE html>
<html lang="es">
<head>
<!-- META SECTION -->
<meta name="description" content="SISTEMA DE GESTION - WIFICOLOMBIA">
<title>Sistema de Gestión <?php echo $Identidad_Mikrotik ;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="<?php echo $Autor ?>">
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<!-- END META SECTION -->
<!-- CSS INCLUDE -->
<link rel="stylesheet" type="text/css" id="theme" href="css/theme-default.css"/>
<!-- EOF CSS INCLUDE -->
</head>
<body>
<!-- START PAGE CONTAINER -->
<div class="page-container">
<?= $menu; ?>
<!-- PAGE CONTENT -->
<div class="page-content">
<!-- START X-NAVIGATION VERTICAL -->
<ul class="x-navigation x-navigation-horizontal x-navigation-panel">
<!-- TOGGLE NAVIGATION -->
<!-- END TOGGLE NAVIGATION -->
<!-- SEARCH -->
<li class="xn-search">
<form role="form">
<input type="text" name="search" placeholder="Search..."/>
</form>
</li>
<!-- END SEARCH -->
<!-- SIGN OUT -->
<li class="xn-icon-button pull-right">
<a href="#" class="mb-control" data-box="#mb-signout"><span class="fa fa-sign-out"></span></a>
</li>
<!-- END SIGN OUT -->
</ul>
<!-- END X-NAVIGATION VERTICAL -->
<!-- START BREADCRUMB -->
<ul class="breadcrumb">
<li><a href="#">Inicio</a></li>
<li class="active">Panel</li>
</ul>
<!-- END BREADCRUMB -->
<!-- PAGE CONTENT WRAPPER -->
<div class="page-content-wrap">
<?php if ($API->connect(IP_MIKROTIK, USER, PASS)) { ;?>
<!-- START WIDGETS -->
<div class="row">
<div class="col-md-8">
<!-- START PROJECTS BLOCK -->
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-title-box">
<h3>Interfaces</h3>
<span>Estado de interfaces físicas</span>
</div>
<ul class="panel-controls" style="margin-top: 2px;">
<li><a href="#" class="panel-fullscreen"><span class="fa fa-expand"></span></a></li>
<li><a href="#" class="panel-refresh"><span class="fa fa-refresh"></span></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="fa fa-cog"></span></a>
<ul class="dropdown-menu">
<li><a href="#" class="panel-collapse"><span class="fa fa-angle-down"></span> Collapse</a></li>
<li><a href="#" class="panel-remove"><span class="fa fa-times"></span> Remove</a></li>
</ul>
</li>
</ul>
</div>
<div class="panel-body panel-body-table">
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th width="50%">Nombre Interfaz</th>
<th width="20%">Estado</th>
<th width="30%">Velocidad LAN</th>
</tr>
</thead>
<tbody>
<?php
$API->write("/interface/ethernet/getall",true);
$READ = $API->read(false);
$ARRAY = $API->parse_response($READ);
if(count($ARRAY)>0){ // si hay mas de 1 queue.
for($x=0;$x<count($ARRAY);$x++){
$name=sanear_string($ARRAY[$x]['name']);
$speed=sanear_string($ARRAY[$x]['speed']);
if($ARRAY[$x]['running']=="true"){
$estado = "<span class='ok'>conectado</span>";
}else{
$estado = "<span class='fail'>desconectado</span>";
}
$datos_interface = '<tr>';
$datos_interface.= '<td>'.$name.'</td>';
$datos_interface.= '<td>'.$estado.'</td>';
$datos_interface.= '<td>'.$speed.'</td>';
$datos_interface.= '</tr>';
echo $datos_interface;
//var_dump($ARRAY);
}
}else{ // si no hay ningun binding
echo "No hay ningun IP-Bindings. //<br/>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- END PROJECTS BLOCK -->
</div>
<div class="col-md-3">
<!-- START WIDGET CLOCK -->
<div class="widget widget-danger widget-padding-sm">
<div class="widget-big-int plugin-clock">00:00</div>
<div class="widget-subtitle plugin-date">Loading...</div>
</div>
<!-- END WIDGET CLOCK -->
</div>
</div>
<!-- END WIDGETS -->
<?php
}else{
echo "No hay conexion";
}
?>
</div>
<!-- END PAGE CONTENT WRAPPER -->
</div>
<!-- END PAGE CONTENT -->
</div>
<!-- END PAGE CONTAINER -->
<!-- MESSAGE BOX-->
<div class="message-box animated fadeIn" data-sound="alert" id="mb-signout">
<div class="mb-container">
<div class="mb-middle">
<div class="mb-title"><span class="fa fa-sign-out">¿</span>Cerrar <strong>Sesión</strong> ?</div>
<div class="mb-content">
<p>¿Esta seguro que desea salir?</p>
<p>Presione No si desea continuar trabajando. Presione Si para salir del sistema de forma segura.</p>
</div>
<div class="mb-footer">
<div class="pull-right">
<a href="<?=$salir;?>" class="btn btn-success btn-lg">Si</a>
<button class="btn btn-default btn-lg mb-control-close">No</button>
</div>
</div>
</div>
</div>
</div>
<!-- END MESSAGE BOX-->
<!-- START PRELOADS -->
<audio id="audio-alert" src="audio/alert.mp3" preload="auto"></audio>
<audio id="audio-fail" src="audio/fail.mp3" preload="auto"></audio>
<!-- END PRELOADS -->
<!-- START SCRIPTS -->
<!-- START PLUGINS -->
<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="js/plugins/jquery/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/plugins/bootstrap/bootstrap.min.js"></script>
<!-- END PLUGINS -->
<!-- START THIS PAGE PLUGINS-->
<script type='text/javascript' src='js/plugins/icheck/icheck.min.js'></script>
<script type="text/javascript" src="js/plugins/mcustomscrollbar/jquery.mCustomScrollbar.min.js"></script>
<script type="text/javascript" src="js/plugins/scrolltotop/scrolltopcontrol.js"></script>
<script type="text/javascript" src="js/plugins/morris/raphael-min.js"></script>
<script type="text/javascript" src="js/plugins/morris/morris.min.js"></script>
<script type="text/javascript" src="js/plugins/rickshaw/d3.v3.js"></script>
<script type="text/javascript" src="js/plugins/rickshaw/rickshaw.min.js"></script>
<script type='text/javascript' src='js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js'></script>
<script type='text/javascript' src='js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js'></script>
<script type='text/javascript' src='js/plugins/bootstrap/bootstrap-datepicker.js'></script>
<script type="text/javascript" src="js/plugins/owl/owl.carousel.min.js"></script>
<script type="text/javascript" src="js/plugins/moment.min.js"></script>
<script type="text/javascript" src="js/plugins/daterangepicker/daterangepicker.js"></script>
<!-- END THIS PAGE PLUGINS-->
<!-- START TEMPLATE -->
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="js/actions.js"></script>
<script type="text/javascript" src="js/demo_dashboard.js"></script>
<!-- END TEMPLATE -->
<!-- END SCRIPTS -->
</body>
</html>