. */ session_start(); error_reporting(0); ob_start("ob_gzhandler"); if (!isset($_SESSION["mikhmon"])) { header("Location:../admin.php?id=login"); } else { date_default_timezone_set($_SESSION['timezone']); // load session MikroTik $session = $_GET['session']; // load config include('../include/config.php'); include('../include/readcfg.php'); include('../lib/formatbytesbites.php'); $id = $_GET['id']; $qr = $_GET['qr']; $small = $_GET['small']; $userp = $_GET['user']; require('../lib/routeros_api.class.php'); $API = new RouterosAPI(); $API->debug = false; $API->connect($iphost, $userhost, decrypt($passwdhost)); if ($userp != "") { $usermode = explode('-', $userp)[0]; $pulluser = explode('-', $userp); $iuser = count($pulluser); $prefix = explode('-', $userp)[$iuser - 2]; $user = explode('-', $userp)[$iuser - 1]; if ($iuser == 3) { $user = $prefix . "-" . $user; } else { $user = $user; } $getuser = $API->comm("/ip/hotspot/user/print", array("?name" => "$user")); $TotalReg = count($getuser); } elseif ($id != "") { $usermode = explode('-', $id)[0]; $getuser = $API->comm('/ip/hotspot/user/print', array("?comment" => "$id", "?uptime" => "0s")); $TotalReg = count($getuser); } $getuprofile = $getuser[0]['profile']; $getprofile = $API->comm("/ip/hotspot/user/profile/print", array("?name" => "$getuprofile")); $getsharedu = $getprofile[0]['shared-users']; $ponlogin = $getprofile[0]['on-login']; $validity = explode(",", $ponlogin)[3]; $getprice = explode(",", $ponlogin)[2]; $getsprice = explode(",", $ponlogin)[4]; if($getsprice == "0" && $getprice != "0"){ if ($currency == in_array($currency, $cekindo['indo'])) { $price = $currency . " " . number_format((float)$getprice, 0, ",", "."); } else { $price = $currency . " " . number_format((float)$getprice, 2); } }else if($getsprice != "0"){ if ($currency == in_array($currency, $cekindo['indo'])) { $price = $currency . " " . number_format((float)$getsprice, 0, ",", "."); } else { $price = $currency . " " . number_format((float)$getsprice, 2); } }else if ($getsprice == "0") { $price = ""; } $logo = "../img/logo-" . $session . ".png"; if (file_exists($logo)) { $logo = "../img/logo-" . $session . ".png?t=". str_replace(" ","_",date("Y-m-d H:i:s")); } else { $logo = "../img/logo.png?t=". str_replace(" ","_",date("Y-m-d H:i:s")); } } ?> Voucher-<?= $hotspotname . "-" . $getuprofile . "-" . $id; ?> "; $num = $i + 1; ?>