. */ session_start(); // hide all error error_reporting(0); ini_set('max_execution_time', 300); if (!isset($_SESSION["mikhmon"])) { header("Location:../admin.php?id=login"); } else { // time zone date_default_timezone_set($_SESSION['timezone']); $genprof = $_GET['genprof']; if ($genprof != "") { $getprofile = $API->comm("/ip/hotspot/user/profile/print", array( "?name" => "$genprof", )); $ponlogin = $getprofile[0]['on-login']; $getprice = explode(",", $ponlogin)[2]; if ($getprice == "0") { $getprice = ""; } else { $getprice = $getprice; } $getvalid = explode(",", $ponlogin)[3]; $getlocku = explode(",", $ponlogin)[6]; if ($getlocku == "") { $getprice = "Disable"; } else { $getlocku = $getlocku; } if ($currency == in_array($currency, $cekindo['indo'])) { $getprice = $currency . " " . number_format((float)$getprice, 0, ",", "."); } else { $getprice = $currency . " " . number_format((float)$getprice); } $ValidPrice = "Validity : " . $getvalid . " | Price : " . $getprice . " | Lock User : " . $getlocku . ""; } else { } $srvlist = $API->comm("/ip/hotspot/print"); if (isset($_POST['qty'])) { $qty = ($_POST['qty']); $server = ($_POST['server']); $user = ($_POST['user']); $userl = ($_POST['userl']); $prefix = ($_POST['prefix']); $char = ($_POST['char']); $profile = ($_POST['profile']); $timelimit = ($_POST['timelimit']); $datalimit = ($_POST['datalimit']); $adcomment = ($_POST['adcomment']); $mbgb = ($_POST['mbgb']); if ($timelimit == "") { $timelimit = "0"; } else { $timelimit = $timelimit; } if ($datalimit == "") { $datalimit = "0"; } else { $datalimit = $datalimit * $mbgb; } if ($adcomment == "") { $adcomment = ""; } else { $adcomment = $adcomment; } $getprofile = $API->comm("/ip/hotspot/user/profile/print", array("?name" => "$profile")); $ponlogin = $getprofile[0]['on-login']; $getvalid = explode(",", $ponlogin)[3]; $getprice = explode(",", $ponlogin)[2]; $getsprice = explode(",", $ponlogin)[4]; $getlock = explode(",", $ponlogin)[6]; $_SESSION['ubp'] = $profile; $commt = $user . "-" . rand(100, 999) . "-" . date("m.d.y") . "-" . $adcomment; $gentemp = $commt . "|~" . $profile . "~" . $getvalid . "~" . $getprice . "!".$getsprice."~" . $timelimit . "~" . $datalimit . "~" . $getlock; $gen = ''; $temp = './voucher/temp.php'; $handle = fopen($temp, 'w') or die('Cannot open file: ' . $temp); $data = $gen; fwrite($handle, $data); $a = array("1" => "", "", 1, 2, 2, 3, 3, 4); if ($user == "up") { for ($i = 1; $i <= $qty; $i++) { if ($char == "lower") { $u[$i] = randLC($userl); } elseif ($char == "upper") { $u[$i] = randUC($userl); } elseif ($char == "upplow") { $u[$i] = randULC($userl); } elseif ($char == "mix") { $u[$i] = randNLC($userl); } elseif ($char == "mix1") { $u[$i] = randNUC($userl); } elseif ($char == "mix2") { $u[$i] = randNULC($userl); } if ($userl == 3) { $p[$i] = randN(3); } elseif ($userl == 4) { $p[$i] = randN(4); } elseif ($userl == 5) { $p[$i] = randN(5); } elseif ($userl == 6) { $p[$i] = randN(6); } elseif ($userl == 7) { $p[$i] = randN(7); } elseif ($userl == 8) { $p[$i] = randN(8); } $u[$i] = "$prefix$u[$i]"; } for ($i = 1; $i <= $qty; $i++) { $API->comm("/ip/hotspot/user/add", array( "server" => "$server", "name" => "$u[$i]", "password" => "$p[$i]", "profile" => "$profile", "limit-uptime" => "$timelimit", "limit-bytes-total" => "$datalimit", "comment" => "$commt", )); } } if ($user == "vc") { $shuf = ($userl - $a[$userl]); for ($i = 1; $i <= $qty; $i++) { if ($char == "lower") { $u[$i] = randLC($shuf); } elseif ($char == "upper") { $u[$i] = randUC($shuf); } elseif ($char == "upplow") { $u[$i] = randULC($shuf); } if ($userl == 3) { $p[$i] = randN(1); } elseif ($userl == 4 || $userl == 5) { $p[$i] = randN(2); } elseif ($userl == 6 || $userl == 7) { $p[$i] = randN(3); } elseif ($userl == 8) { $p[$i] = randN(4); } $u[$i] = "$prefix$u[$i]$p[$i]"; if ($char == "num") { if ($userl == 3) { $p[$i] = randN(3); } elseif ($userl == 4) { $p[$i] = randN(4); } elseif ($userl == 5) { $p[$i] = randN(5); } elseif ($userl == 6) { $p[$i] = randN(6); } elseif ($userl == 7) { $p[$i] = randN(7); } elseif ($userl == 8) { $p[$i] = randN(8); } $u[$i] = "$prefix$p[$i]"; } if ($char == "mix") { $p[$i] = randNLC($userl); $u[$i] = "$prefix$p[$i]"; } if ($char == "mix1") { $p[$i] = randNUC($userl); $u[$i] = "$prefix$p[$i]"; } if ($char == "mix2") { $p[$i] = randNULC($userl); $u[$i] = "$prefix$p[$i]"; } } for ($i = 1; $i <= $qty; $i++) { $API->comm("/ip/hotspot/user/add", array( "server" => "$server", "name" => "$u[$i]", "password" => "$u[$i]", "profile" => "$profile", "limit-uptime" => "$timelimit", "limit-bytes-total" => "$datalimit", "comment" => "$commt", )); } } if ($qty < 2) { echo ""; } else { echo ""; } } $getprofile = $API->comm("/ip/hotspot/user/profile/print"); include_once('./voucher/temp.php'); $genuser = explode("-", decrypt($genu)); $genuser1 = explode("~", decrypt($genu)); $umode = $genuser[0]; $ucode = $genuser[1]; $udate = $genuser[2]; $uprofile = $genuser1[1]; $uvalid = $genuser1[2]; $ucommt = $genuser[3]; if ($uvalid == "") { $uvalid = "-"; } else { $uvalid = $uvalid; } $uprice = explode("!",$genuser1[3])[0]; if ($uprice == "0") { $uprice = "-"; } else { $uprice = $uprice; } $suprice = explode("!",$genuser1[3])[1]; if ($suprice == "0") { $suprice = "-"; } else { $suprice = $suprice; } $utlimit = $genuser1[4]; if ($utlimit == "0") { $utlimit = "-"; } else { $utlimit = $utlimit; } $udlimit = $genuser1[5]; if ($udlimit == "0") { $udlimit = "-"; } else { $udlimit = formatBytes($udlimit, 2); } $ulock = $genuser1[6]; //$urlprint = "$umode-$ucode-$udate-$ucommt"; $urlprint = explode("|", decrypt($genu))[0]; if ($currency == in_array($currency, $cekindo['indo'])) { $uprice = $currency . " " . number_format((float)$uprice, 0, ",", "."); $suprice = $currency . " " . number_format((float)$suprice, 0, ",", "."); } else { $uprice = $currency . " " . number_format((float)$uprice); $suprice = $currency . " " . number_format((float)$suprice); } } ?>
| = $_generate_code ?> | = $ucode ?> |
| = $_date ?> | = $udate ?> |
| = $_profile ?> | = $uprofile ?> |
| = $_validity ?> | = $uvalid ?> |
| = $_time_limit ?> | = $utlimit ?> |
| = $_data_limit ?> | = $udlimit ?> |
| = $_price ?> | = $uprice ?> |
| = $_selling_price ?> | = $suprice ?> |
| = $_lock_user ?> | = $ulock ?> |
|
= $_format_time_limit ?> = $_details_add_user ?> |
|