Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table class="unstriped table-server-margin">
- <thead>
- <tr>
- <th>Interface</th>
- <th>Download</th>
- <th>Upload</th>
- </tr>
- </thead>
- <?php
- require_once("../../../../connection/connection.php");
- require_once("../../../../connection/routeros_api.class.php");
- $tw_status_vpn3 = $db->prepare("SELECT * FROM tw_status_vpn WHERE status_negara = :status_negara");
- $tw_status_vpn3->bindParam(":status_negara", $_GET['id2']);
- $tw_status_vpn3->execute();
- echo '<div class="text-center"><h5>';
- if($tw_status_vpn3->rowCount() == 0){
- header("Location: ../../../../id/error");
- }else{
- $data2 = $tw_status_vpn3->fetch();
- }
- echo '</h5></div>';
- $API = new RouterosAPI();
- $API->debug = false;
- if ($API->connect($data2['status_ip'], $data2['status_login'], $data2['status_password'])) {
- $API->write('/interface/print');
- $ARRAY2 = $API->read();
- foreach ($ARRAY2 as $data3) {
- $interface = $data3['name'];
- $monitor = $API->comm("/interface/monitor-traffic", array(
- "interface" => $interface,
- "once" => "",
- ));
- $frx = number_format($monitor[0]['tx-bits-per-second']/1048576,1,",",".");
- $frx2 = number_format($monitor[0]['rx-bits-per-second']/1048576,1,",",".");
- }
- $API->disconnect();
- } else {
- }
- ?>
- <?php
- echo "<tbody>";
- foreach ($ARRAY2 as $data4) {
- echo "<tr>";
- echo "<td class='text-left'>";
- $interface2 = $data4['name'];
- echo $interface2;
- echo "</td>";
- echo "<td class='text-left'>";
- print_r ($frx);
- echo " Mbps";
- echo "</td>";
- echo "<td class='text-left'>";
- print_r ($frx2);
- echo " Mbps";
- echo "</td>";
- echo "</tr>";
- }
- ?>
- </tbody>
- </table>
Add Comment
Please, Sign In to add comment