. */ // hide all error error_reporting(0); if (!isset($_SESSION["mikhmon"])) { header("Location:../admin.php?id=login"); } else { date_default_timezone_set($_SESSION['timezone']); $getprofile = $API->comm("/ip/hotspot/user/profile/print"); $srvlist = $API->comm("/ip/hotspot/print"); if (substr($hotspotuser, 0, 1) == "*") { $hotspotuser = $hotspotuser; } elseif (substr($hotspotuser, 0, 1) != "") { $getuser = $API->comm("/ip/hotspot/user/print", array( "?name" => "$hotspotuser", )); $hotspotuser = $getuser[0]['.id']; //if($hotspotuser == ""){echo "Hotspot User not found";} } $getuser = $API->comm("/ip/hotspot/user/print", array( "?.id" => "$hotspotuser", )); $userdetails = $getuser[0]; $uid = $userdetails['.id']; $userver = $userdetails['server']; $uname = $userdetails['name']; $upass = $userdetails['password']; $umac = $userdetails['mac-address']; $uprofile = $userdetails['profile']; $uuptime = formatDTM($userdetails['uptime']); $ueduser = $userdetails['disabled']; $utimelimit = $userdetails['limit-uptime']; $udatalimit = $userdetails['limit-bytes-total']; $ubytesout = $userdetails['bytes-out']; $ubytesin = $userdetails['bytes-in']; $ucomment = $userdetails['comment']; if (substr(formatBytes2($udatalimit, 2), -2) == "MB") { $udatalimit = $udatalimit / 1048576; $MG = "MB"; } elseif (substr(formatBytes2($udatalimit, 2), -2) == "GB") { $udatalimit = $udatalimit / 1073741824; $MG = "GB"; } elseif ($udatalimit == "") { $udatalimit = ""; $MG = "MB"; } if ($uname == $upass) { $usermode = "vc"; } else { $usermode = "up"; } if ($uname == "") { echo "User not found redirect to user list..."; echo ""; } if((substr($ucomment,3,1) == "/" && substr($ucomment,6,1) == "/")){ $commt = 'disabled'; $comment2t = 'text'; $_tcomment = $_expired; $_tcomment2 = $_comment; $ucomment2 = substr($ucomment,21, (strlen($ucomment)-21)); $ucomment = substr($ucomment,0,20); }else{ $comment2t = 'hidden'; $_tcomment = $_comment; $_tcomment2 = ""; $display = 'style="display:none"'; } $getprofilebyuser = $API->comm("/ip/hotspot/user/profile/print", array( "?name" => "$uprofile" )); $profiledetalis = $getprofilebyuser[0]; $ponlogin = $profiledetalis['on-login']; $getvalid = explode(",", $ponlogin)[3]; $getprice = explode(",", $ponlogin)[2]; $getsprice = explode(",", $ponlogin)[4]; $getsch = $API->comm("/system/scheduler/print", array( "?name" => "$uname", )); $schdetails = $getsch[0]; $start = $schdetails['start-date'] . " " . $schdetails['start-time']; $end = $schdetails['next-run']; //$valy = $schdetails['interval']; // share WhatsApp if ($getvalid != "") { $wavalid = $_validity." : *" . $getvalid . "* %0A"; } else { $wavalid = ""; } if ($utimelimit != "") { $watlimit = $_time_limit." : *" . $utimelimit . "* %0A"; } else { $watlimit = ""; $bMB = ""; } if ($udatalimit != "") { $wadlimit = $_data_limit." : *" . $udatalimit . "" . $MG . "* %0A"; $bMG = $MG; } else { $wadlimit = ""; } if($getsprice == "" && $getprice != ""){ if ($currency == in_array($currency, $cekindo['indo'])) { $waprice = $_price." : *" . $currency . " " . number_format((float)$getprice, 0, ",", ".") . "* %0A"; } else { $waprice = $_price . " : *" . $currency . " " . number_format((float)$getprice) . "* %0A"; } $btprice = $getprice; }else if($getsprice != ""){ if ($currency == in_array($currency, $cekindo['indo'])) { $waprice = $_price." : *" . $currency . " " . number_format((float)$getsprice, 0, ",", ".") . "* %0A"; } else { $waprice = $_price . " : *" . $currency . " " . number_format((float)$getsprice) . "* %0A"; } $btprice = $getsprice; }else if ($getsprice == "") { $waprice = ""; $btprice = ""; } $shareWAUP = " %0A---------%0A *" . $hotspotname . "* %0A%0A Username : *" . $uname . "* %0A Password : *" . $upass . "* %0A " . $wavalid . " " . $watlimit . " " . $wadlimit . " " . $waprice . " %0A Login : *http://" . $dnsname . "* %0A --------- "; $shareWAVC = " %0A---------%0A *" . $hotspotname . "* %0A%0A Voucher : *" . $uname . "* %0A " . $wavalid . " " . $watlimit . " " . $wadlimit . " " . $waprice . " %0A Login : *http://" . $dnsname . "* %0A --------- "; if ($uname == $upass) { $shareWA = $shareWAVC; } else { $shareWA = $shareWAUP; } // quick bt include('./include/quickbt.php'); // Print BT $chl = urlencode("http://$dnsname/login?username=$uname&password=$upass"); $qrcode = 'https://chart.googleapis.com/chart?cht=qr&chs=100x100&chld=L|0&chl=' . $chl . '&choe=utf-8'; //$qrcode = 'https://api.qrserver.com/v1/create-qr-code/?size=200x200&data='.$chl; if ($currency == in_array($currency, $cekindo['indo'])) { $pricebt = $currency . " " . number_format((float)$btprice, 0, ",", "."); if (substr($getvalid, -1) == "d") { $validity = substr($getvalid, 0, -1) . "Hari"; } else if (substr($getvalid, -1) == "h") { $validity = substr($getvalid, 0, -1) . "Jam"; } else if (substr($getvalid, -1) == "m") { $validity = substr($getvalid, 0, -1) . "Menit"; } if (substr($utimelimit, -1) == "d" & strlen($utimelimit) > 3) { $timelimit = ((substr($utimelimit, 0, -1) * 7) + substr($utimelimit, 2, 1)) . "Hari"; } else if (substr($utimelimit, -1) == "d") { $timelimit = substr($utimelimit, 0, -1) . "Hari"; } else if (substr($utimelimit, -1) == "h") { $timelimit = substr($utimelimit, 0, -1) . "Jam"; } else if (substr($utimelimit, -1) == "w") { $timelimit = (substr($utimelimit, 0, -1) * 7) . "Hari"; } } else { $pricebt = $currency . " " . number_format((float)$btprice); $timelimit = $utimelimit; $validity = $getvalid; } if (isset($_POST['name'])) { $server = ($_POST['server']); $name = ($_POST['name']); $password = ($_POST['pass']); $profile = ($_POST['profile']); $disabled = ($_POST['disabled']); $timelimit = ($_POST['timelimit']); $datalimit = ($_POST['datalimit']); $comment = ($_POST['comment']); $comment2 = ($_POST['comment2']); $hcomment = ($_POST['h_comment']); $mbgb = ($_POST['mbgb']); if ($timelimit == "") { $timelimit = "0"; } else { $timelimit = $timelimit; } if ($datalimit == "") { $datalimit = "0"; } else { $datalimit = $datalimit * $mbgb; } if ($name == $password) { $usermode = "vc-"; }else{ $usermode = "up-"; } if((substr($hcomment,3,1) == "/" && substr($hcomment,6,1) == "/")){ $comment = $hcomment." ".$comment2; }elseif((substr($comment,3,1) == "/" && substr($comment,6,1) == "/")){ $comment = $comment." ".$comment2; }elseif(substr($comment,0,3) == "vc-" || substr($comment,0,3) == "up-"){ $comment = $comment; }else{ $comment = $usermode.$comment; } $API->comm("/ip/hotspot/user/set", array( ".id" => "$uid", "server" => "$server", "name" => "$name", "password" => "$password", "profile" => "$profile", "disabled" => "$disabled", "limit-uptime" => "$timelimit", "limit-bytes-total" => "$datalimit", "comment" => "$comment", )); echo ""; } } include('./voucher/printbt.php'); ?>