. */ session_start(); // hide all error error_reporting(0); if (!isset($_SESSION["mikhmon"])) { header("Location:../admin.php?id=login"); } else { // load session MikroTik $session = $_GET['session']; // set timezone date_default_timezone_set($_SESSION['timezone']); // lang include('../include/lang.php'); include('../lang/'.$langid.'.php'); // load config include('../include/config.php'); include('../include/readcfg.php'); // routeros api include_once('../lib/routeros_api.class.php'); include_once('../lib/formatbytesbites.php'); $API = new RouterosAPI(); $API->debug = false; $API->connect($iphost, $userhost, decrypt($passwdhost)); if ($livereport == "disable") { $logh = "457px"; $lreport = "style='display:none;'"; } else { $logh = "350px"; $lreport = "style='display:block;'"; // get selling report $thisD = date("d"); $thisM = strtolower(date("M")); $thisY = date("Y"); if (strlen($thisD) == 1) { $thisD = "0" . $thisD; } else { $thisD = $thisD; } $idhr = $thisM . "/" . $thisD . "/" . $thisY; $idbl = $thisM . $thisY; $_SESSION[$session.'idhr'] = $idhr; /* $getSRHr = $API->comm("/system/script/print", array( "?source" => "$idhr", )); $TotalRHr = count($getSRHr); $_SESSION[$session.'totalHr'] = $TotalRHr;*/ $getSRBl = $API->comm("/system/script/print", array( "?owner" => "$idbl", )); $TotalRBl = count($getSRBl); $_SESSION[$session.'totalBl'] = $TotalRBl; /* for ($i = 0; $i < $TotalRHr; $i++) { $tHr += explode("-|-", $getSRHr[$i]['name'])[3]; }*/ foreach($getSRBl as $row){ if((explode("-|-", $row['name'])[0]) == $idhr){ $tHr += explode("-|-", $row['name'])[3]; $TotalRHr += count((array)$row['source']); /*Modif line add (array) by github https://github.com/MasKawer*/ } $tBl += explode("-|-", $row['name'])[3]; if($TotalRHr == ""){ $TotalRHr = "0"; $_SESSION[$session.'totalHr'] = "0"; }else{ $_SESSION[$session.'totalHr'] = $TotalRHr; } } } } ?>