for ($cont3 = 0; $cont3 < count($estadoAccessCR); $cont3++) { $allPortsAccessCR = $estadoAccessCR[$cont3]['new-customer-vid'] . "," . $allPortsAccessCR; } //DELETE LAST COMMA if ($allPortsAccessCR[strlen($allPorts) - 1] == ",") { $allPortsAccessCR = rtrim($allPorts, ','); } //LEAVE UNIQUE VALUES WITHOUT REPEATING $allPortsAccessCR = implode(',', array_unique(explode(',', $allPortsAccessCR))); //DO ARRAY WITH EACH VALUE $allPortsAccessCR = explode(',', $allPortsAccessCR); $API->write("/interface/ethernet/monitor", false); $API->write("=numbers=" . $valores, false); $API->write("=once=", true); $READ = $API->read(false); $statusPorts = $API->parse_response($READ); //Array Colores, $colores = ["#00fff9", "#ff00e7", "#a3ff00", "#ffdc0b", "#ff4400", "#7c00ff", "#3377ff", "#ff7468", "#20e523", "#fcc512", "#9f0d0d", "#bc9ad4", "#79addd", "#e7d1e5", "#7bcf5a", "#cc8324", "#b80f12", "#0da9b0", "#eea7b9", "#1e7352", "#eee117", "#b80000", "#00137a", "#AA0078", "#3333FF", "#99FF00", "#FFCC00", "#CC0000", "#587498", "#E86850", "#FFD800", "##00FF00", "#FF0000", "#0000FF", "#FF6600", "#A16B23", "#C9341C", "#ECC5A8", "#A3CBF1", "#79BFA1", "#FB7374", "#FF9900", "#4FD5D6", "#D6E3B5", "#FFD197", "#FFFF66", "#FFC3CE", "#21B6A8", "#CDFFFF", ""]; $API->disconnect(); } //Sacar valores String TRUNK CR for ($cont = 0; $cont < count($estadoTrunkCR); $cont++) { //Concatenamos todos los puertos de trunk $puertosTrunk = $estadoTrunkCR[$cont]['tagged-ports'] . "," . $puertosTrunk; } //Eliminamos la ultima coma $rest = substr($puertosTrunk, 0, -1); //Separamos cada puerto en una string delimitando la coma $tags = explode(',', $rest); //Elegimos el primer puerto y eliminamos a los repetidos $resultTrunk = array_unique($tags);
</div> <div class="panel-body"> <table id="customers2" class="table datatable"> <thead> <tr> <th width="30%">Nombre</th> <th width="15%">IP</th> <th width="30%">Perfil</th> </tr> </thead> <tbody> <?php $API->write("/ip/hotspot/active/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]['user']); $datos_user_hotspot = '<tr>'; $datos_user_hotspot .= '<td>' . $name . '</td>'; $datos_user_hotspot .= '<td>' . $ARRAY[$x]['address'] . '</td>'; $datos_user_hotspot .= '<td>' . $ARRAY[$x]['login-by'] . '</td>'; $datos_user_hotspot .= '</tr>'; echo $datos_user_hotspot; } } else { // si no hay ningun binding echo "No hay ningun IP-Bindings. //<br/>"; }