init: workspace opencode sync

This commit is contained in:
2026-08-15 00:28:06 +07:00
commit eb71c40fc1
170 changed files with 23352 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
<table class="voucher" style=" width: 160px;">
<tbody>
<tr>
<td style="text-align: left; font-size: 14px; font-weight:bold; border-bottom: 1px black solid;"><?= $hotspotname; ?><span id="num"><?= " [$num]"; ?></span></td>
</tr>
<tr>
<td>
<table style=" text-align: center; width: 150px;">
<tbody>
<tr style="color: black; font-size: 11px;">
<td>
<table style="width:100%;">
<!-- Username = Password -->
<?php if ($usermode == "vc") { ?>
<tr>
<td >Kode Voucher</td>
</tr>
<tr style="color: black; font-size: 14px;">
<td style="width:100%; border: 1px solid black; font-weight:bold;"><?= $username; ?></td>
</tr>
<tr>
<td colspan="2" style="border: 1px solid black; font-weight:bold;"><?= $validity; ?> <?= $timelimit; ?> <?= $datalimit; ?> <?= $price; ?></td>
</tr>
<!-- / -->
<!-- Username & Password -->
<?php
} elseif ($usermode == "up") { ?>
<tr>
<td style="width: 50%">Username</td>
<td>Password</td>
</tr>
<tr style="color: black; font-size: 14px;">
<td style="border: 1px solid black; font-weight:bold;"><?= $username; ?></td>
<td style="border: 1px solid black; font-weight:bold;"><?= $password; ?></td>
</tr>
<tr>
<td colspan="2" style="border: 1px solid black; font-weight:bold;"><?= $validity; ?> <?= $timelimit; ?> <?= $datalimit; ?> <?= $price; ?></td>
</tr>
<?php
} ?>
<!-- / -->
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
+77
View File
@@ -0,0 +1,77 @@
<style>
.qrcode{
height:100px;
width:100px;
}
</style>
<table class="voucher" style=" width: 180px;">
<tbody>
<!-- Logo Hotspotname -->
<tr>
<td style="text-align: center; font-size: 14px; font-weight:bold;"><?= $hotspotname; ?></td>
</tr>
<tr>
<td style="text-align: center; font-size: 14px; font-weight:bold; border-bottom: 1px black solid;"><img src="<?= $logo; ?>" alt="logo" style="height:30px;border:0;"><br><?= date("Y-m-d h:i:sa") ?></td>
</tr>
<!-- / -->
<tr>
<td>
<table style=" text-align: center; width: 170px; font-size: 12px;">
<tbody>
<!-- Username Password QR -->
<tr>
<td>
<table style="width:100%;">
<!-- Username = Password -->
<?php if ($usermode == "vc") { ?>
<tr>
<td font-size: 12px;>Kode Voucher</td>
</tr>
<tr>
<td style="width:100%; border: 1px solid black; font-weight:bold; font-size:16px;"><?= $username; ?></td>
</tr>
<!-- / -->
<!-- Username & Password -->
<?php
} elseif ($usermode == "up") { ?>
<tr>
<td style="width: 50%">Username</td>
<td >Password</td>
</tr>
<tr style="font-size: 14px;">
<td style="border: 1px solid black; font-weight:bold;"><?= $username; ?></td>
<td style="border: 1px solid black; font-weight:bold;"><?= $password; ?></td>
</tr>
<?php
} ?>
<!-- / -->
</tr>
</td>
<!-- QR Code -->
<?php if ($qr == "yes") { ?>
<td colspan="2">
<?= $qrcode ?>
</td>
</tr>
<?php
} ?>
<!-- / -->
<tr>
<!-- Price -->
<td colspan="2" style="border-top: 1px solid black;font-weight:bold; font-size:16px"><?= $validity; ?> <?= $timelimit; ?> <?= $datalimit; ?> <?= $price; ?></td>
<!-- / -->
</tr>
<tr>
<!-- Note -->
<td colspan="2" style="font-weight:bold; font-size:12px">Login: http://<?= $dnsname; ?></td>
<!-- / -->
</tr>
<!-- / -->
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
+90
View File
@@ -0,0 +1,90 @@
<style>
.qrcode{
height:80px;
width:80px;
}
</style>
<table class="voucher" style=" width: 220px;">
<tbody>
<!-- Logo Hotspotname -->
<tr>
<td style="text-align: left; font-size: 14px; font-weight:bold; border-bottom: 1px black solid;"><img src="<?= $logo; ?>" alt="logo" style="height:30px;border:0;"> <?= $hotspotname; ?> <span id="num"><?= " [$num]"; ?></span></td>
</tr>
<!-- / -->
<tr>
<td>
<table style=" text-align: center; width: 210px; font-size: 12px;">
<tbody>
<!-- Username Password QR -->
<tr>
<td>
<table style="width:100%;">
<!-- Username = Password -->
<?php if ($usermode == "vc") { ?>
<tr>
<td font-size: 12px;>Kode Voucher</td>
</tr>
<tr>
<td style="width:100%; border: 1px solid black; font-weight:bold; font-size:16px;"><?= $username; ?></td>
</tr>
<!-- / -->
<!-- Username & Password -->
<?php
} elseif ($usermode == "up") { ?>
<!-- Check QR -->
<?php if ($qr == "yes") { ?>
<tr>
<td>Username</td>
</tr>
<tr>
<td style="border: 1px solid black; font-weight:bold;"><?= $username; ?></td>
</tr>
<tr>
<td>Password</td>
</tr>
<tr>
<td style="border: 1px solid black; font-weight:bold;"><?= $password; ?></td>
</tr>
<?php
} else { ?>
<tr>
<td style="width: 50%">Username</td>
<td >Password</td>
</tr>
<tr style="font-size: 14px;">
<td style="border: 1px solid black; font-weight:bold;"><?= $username; ?></td>
<td style="border: 1px solid black; font-weight:bold;"><?= $password; ?></td>
</tr>
<?php
}
} ?>
<!-- / -->
</table>
</td>
<!-- QR Code -->
<?php if ($qr == "yes") { ?>
<td>
<?= $qrcode ?>
</td>
<?php
} ?>
<!-- / -->
<tr>
<!-- Price -->
<td colspan="2" style="border-top: 1px solid black;font-weight:bold; font-size:16px"><?= $validity; ?> <?= $timelimit; ?> <?= $datalimit; ?> <?= $price; ?></td>
<!-- / -->
</tr>
<tr>
<!-- Note -->
<td colspan="2" style="font-weight:bold; font-size:12px">Login: http://<?= $dnsname; ?></td>
<!-- / -->
</tr>
<!-- / -->
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
+20
View File
@@ -0,0 +1,20 @@
<?php
/*
* Copyright (C) 2017, 2018 Laksamadi Guko.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
echo "<meta http-equiv='refresh' content='0;url=../' />";
?>
+209
View File
@@ -0,0 +1,209 @@
<?php
/*
* Copyright (C) 2018 Laksamadi Guko.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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"));
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Voucher-<?= $hotspotname . "-" . $getuprofile . "-" . $id; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<link rel="icon" href="../img/favicon.png" />
<script src="../js/qrious.min.js"></script>
<style>
body {
color: #000000;
background-color: #FFFFFF;
font-size: 14px;
font-family: 'Helvetica', arial, sans-serif;
margin: 0px;
-webkit-print-color-adjust: exact;
}
table.voucher {
display: inline-block;
border: 2px solid black;
margin: 2px;
}
@page
{
size: auto;
margin-left: 7mm;
margin-right: 3mm;
margin-top: 9mm;
margin-bottom: 3mm;
}
@media print
{
table { page-break-after:auto }
tr { page-break-inside:avoid; page-break-after:auto }
td { page-break-inside:avoid; page-break-after:auto }
thead { display:table-header-group }
tfoot { display:table-footer-group }
}
#num {
float:right;
display:inline-block;
}
.qrc {
width:30px;
height:30px;
margin-top:1px;
}
</style>
</head>
<body onload="window.print()">
<?php for ($i = 0; $i < $TotalReg; $i++) {;
$regtable = $getuser[$i];
$uid = str_replace("=","",base64_encode($regtable['.id']));
$idqr = str_replace("=","",base64_encode(($regtable['.id']."qr")));
$username = $regtable['name'];
$password = $regtable['password'];
$profile = $regtable['profile'];
$timelimit = $regtable['limit-uptime'];
$getdatalimit = $regtable['limit-bytes-total'];
$comment = $regtable['comment'];
if ($getdatalimit == 0) {
$datalimit = "";
} else {
$datalimit = formatBytes($getdatalimit, 2);
}
$urilogin = "http://$dnsname/login?username=$username&password=$password";
$qrcode = "
<canvas class='qrcode' id='".$uid."'></canvas>
<script>
(function() {
var ".$uid." = new QRious({
element: document.getElementById('".$uid."'),
value: '".$urilogin."',
size:'256'
});
})();
</script>
";
$num = $i + 1;
?>
<?php
if ($userp != "") {
include('./template-thermal.php');
} else {
if ($small == "yes") {
include('./template-small.php');
} else {
include('./template.php');
}
}
?>
<?php
} ?>
</body>
</html>
+40
View File
@@ -0,0 +1,40 @@
<?php date_default_timezone_set($_SESSION['timezone']); ?>
<script>
function sendToQuickPrinterChrome(){
var commandsToPrint =
"<center><big><bold><?= $hotspotname ?>\n" +
//"<line0>\n" +
"<center><?= date("Y-m-d h:i:sa") ?>\n" +
"<line0>\n" +
<?php if($uname == $upass){
echo '"'.$_voucher_code.' :;; '. $uname.'\n" +';
}else{
echo '"'.$_user_name.' :;; '. $uname.'\n" +
"'.$_password.' :;; '. $upass.'\n" +';
}?>
<?php if($getvalid != ""){
echo '"'.$_validity.' :;; '.$validity.'\n" +';
}?>
<?php if($utimelimit != ""){
echo '"'.$_time_limit.' :;; '.$timelimit.'\n" +';
}?>
<?php if($udatalimit != ""){
echo '"'.$_data_limit.' :;; '.$udatalimit.$MG.'\n" +';
}?>
<?php if ($getprice != 0) {
echo '"'.$_price.' :;; '.$pricebt.'\n" +';
}?>
"<line0>\n" +
"<center>Login : http://<?= $dnsname ?>\n" +
//"<line0>\n" +
<?php if($qrbt == "enable"){
echo '"<center><image>" + "'.$qrcode.'" +"\n"';
}else{echo '"\n"';}?>
+ "<cut>"
;
var textEncoded = encodeURI(commandsToPrint);
window.location.href="intent://"+textEncoded+"#Intent;scheme=quickprinter;package=pe.diegoveloper.printerserverapp;end;";
}
</script>
+1
View File
@@ -0,0 +1 @@
<?php $genu="rpRfcGZiZWFnZmFkZmNoZa2wrpRfbXxjaHuwaWGatmZiaGFTbWFiaK9kbJmwaK92oaSTmp2X";?>
+93
View File
@@ -0,0 +1,93 @@
<?php
/*
1 lembar A4 total 9 voucher scale 100
1 lembar A4 total 25 voucher scale 60
*/
if(substr($validity,-1) == "d"){
$validity = " <br>MASA AKTIF : ".substr($validity,0,-1)." HARI";
}else if(substr($validity,-1) == "h"){
$validity = "MASA AKTIF : ".substr($validity,0,-1)."Jam";
}
if(substr($timelimit,-1) == "d" & strlen($timelimit) >3){
$timelimit = "Durasi:".((substr($timelimit,0,-1)*7) + substr($timelimit, 2,1))." HARI";
}else if(substr($timelimit,-1) == "d"){
$timelimit = "Durasi:".substr($timelimit,0,-1)." HARI";
}else if(substr($timelimit,-1) == "h"){
$timelimit = "Durasi:".substr($timelimit,0,-1)."Jam";
}else if(substr($timelimit,-1) == "w"){
$timelimit = "Durasi:".(substr($timelimit,0,-1)*7)." HARI";
}
if($getsprice == "3000"){ $color = "#800000";}
elseif($getsprice == "1000"){ $color = "#424242";}
elseif($getsprice == "2000"){ $color = "#424242";}
elseif($getsprice == "3000"){ $color = "#800000";}
elseif($getsprice == "5000"){ $color = "#FF4500";}
elseif($getsprice == "10000"){ $color = "#424242";}
elseif($getsprice == "15000"){ $color = "#228B22";}
elseif($getsprice == "20000"){ $color = "#008000";}
elseif($getsprice == "30000"){ $color = "#FF00FF";}
elseif($getsprice == "60000"){ $color = "#E60C00";}
elseif($getsprice == "70000"){ $color = "#FF0000";}
else{ $color = "#BA68C8";}
?>
<!--mks-mulai-->
<style>
.qrcode{
height:70px;
width:70px;
}
</style>
<table class="voucher" style="border: 1px <?php echo $color ?> solid; border-radius: 0px; text-align: center; font-size: 2px; font-weight:bold; ">
<tbody>
<tr>
<td style="color:#666;" valign="top">
<table style="width:7px;">
<tbody>
<tr>
<td style="width:65px">
<div style="position:relative;z-index:-1;padding: 0px;float:left;">
<div style="position:absolute;top:0;display:inline;margin-top:-100px;width: 0; height: 0; border-top: 0px solid transparent;border-left: 0px solid transparent;border-right:0px solid #DCDCDC; "></div>
<td style="width:60px">
<div style="float:right;margin-top:0px;margin-right:0px;width:1%;text-align:right;font-size:7px;">
</div>
<!--mks-price-->
<div style="text-align:right;font-weight:bold;font-family:Tahoma;font-size:15px;padding-left:25px;color:<?php echo $color ?>">
<small style="font-size:10px;margin-left:-15px;position:absolute;">Rp </small><?php echo $getsprice;?>
</div>
<!--mks-price-akhir-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!--mks-voucher-->
<tr>
<td style="color:#666;border-collapse: collapse;" valign="top">
<table style="width:30px;border-collapse: collapse;">
<tbody>
<tr>
<td style="width:50px"valign="top" >
<div style="clear:both;color:#555;margin-top:2px;margin-bottom:2.5px;">
<div><?= $qrcode ?></div>
<?php if($usermode == "vc"){?>
<div style="padding:0px;border-bottom:1px solid;text-align:center;font-weight:bold;font-size:17px;color:#111;"><?php echo $username;?></div>
<?php }elseif($usermode == "up"){?>
<div style="padding:0px;border-bottom:1px solid;text-align:center;font-weight:bold;font-size:14px;color:#111;"><?php echo "User: ".$username."<br>Pass: ".$password;?></div>
<?php }?>
<tr>
<td style="background:<?php echo $color ?>;color:#000;padding:0px;" valign="top" colspan="2">
<div style="text-align:left;color:#fff;font-size:10px;font-weight:bold;margin:0px;padding:2.5px;">
<b>msr.net</b><span id="num"><?php echo " [$num]";?>
</div>
<!--mks-cs-akhir-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<!--mks-template-selesai-By-isber nendi-mks.net-->
+77
View File
@@ -0,0 +1,77 @@
<style>
.qrcode{
height:150px;
width:150px;
}
</style>
<table class="voucher" style=" width: 180px;">
<tbody>
<!-- Logo Hotspotname -->
<tr>
<td style="text-align: center; font-size: 14px; font-weight:bold;"><?= $hotspotname; ?></td>
</tr>
<tr>
<td style="text-align: center; font-size: 14px; font-weight:bold; border-bottom: 1px black solid;"><img src="<?= $logo; ?>" alt="logo" style="height:30px;border:0;"><br><?= date("Y-m-d h:i:sa") ?></td>
</tr>
<!-- / -->
<tr>
<td>
<table style=" text-align: center; width: 170px; font-size: 12px;">
<tbody>
<!-- Username Password QR -->
<tr>
<td>
<table style="width:100%;">
<!-- Username = Password -->
<?php if ($usermode == "vc") { ?>
<tr>
<td font-size: 12px;>Kode Voucher</td>
</tr>
<tr>
<td style="width:100%; border: 1px solid black; font-weight:bold; font-size:16px;"><?= $username; ?></td>
</tr>
<!-- / -->
<!-- Username & Password -->
<?php
} elseif ($usermode == "up") { ?>
<tr>
<td style="width: 50%">Username</td>
<td >Password</td>
</tr>
<tr style="font-size: 14px;">
<td style="border: 1px solid black; font-weight:bold;"><?= $username; ?></td>
<td style="border: 1px solid black; font-weight:bold;"><?= $password; ?></td>
</tr>
<?php
} ?>
<!-- / -->
</tr>
</td>
<!-- QR Code -->
<?php if ($qr == "yes") { ?>
<td colspan="2">
<?= $qrcode ?>
</td>
</tr>
<?php
} ?>
<!-- / -->
<tr>
<!-- Price -->
<td colspan="2" style="border-top: 1px solid black;font-weight:bold; font-size:16px"><?= $validity; ?> <?= $timelimit; ?> <?= $datalimit; ?> <?= $price; ?></td>
<!-- / -->
</tr>
<tr>
<!-- Note -->
<td colspan="2" style="font-weight:bold; font-size:12px">Login: http://<?= $dnsname; ?></td>
<!-- / -->
</tr>
<!-- / -->
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
+90
View File
@@ -0,0 +1,90 @@
<style>
.qrcode{
height:80px;
width:80px;
}
</style>
<table class="voucher" style=" width: 220px;">
<tbody>
<!-- Logo Hotspotname -->
<tr>
<td style="text-align: left; font-size: 14px; font-weight:bold; border-bottom: 1px black solid;"><img src="<?= $logo; ?>" alt="logo" style="height:30px;border:0;"> <?= $hotspotname; ?> <span id="num"><?= " [$num]"; ?></span></td>
</tr>
<!-- / -->
<tr>
<td>
<table style=" text-align: center; width: 210px; font-size: 12px;">
<tbody>
<!-- Username Password QR -->
<tr>
<td>
<table style="width:100%;">
<!-- Username = Password -->
<?php if ($usermode == "vc") { ?>
<tr>
<td font-size: 12px;>Kode Voucher</td>
</tr>
<tr>
<td style="width:100%; border: 1px solid black; font-weight:bold; font-size:16px;"><?= $username; ?></td>
</tr>
<!-- / -->
<!-- Username & Password -->
<?php
} elseif ($usermode == "up") { ?>
<!-- Check QR -->
<?php if ($qr == "yes") { ?>
<tr>
<td>Username</td>
</tr>
<tr>
<td style="border: 1px solid black; font-weight:bold;"><?= $username; ?></td>
</tr>
<tr>
<td>Password</td>
</tr>
<tr>
<td style="border: 1px solid black; font-weight:bold;"><?= $password; ?></td>
</tr>
<?php
} else { ?>
<tr>
<td style="width: 50%">Username</td>
<td >Password</td>
</tr>
<tr style="font-size: 14px;">
<td style="border: 1px solid black; font-weight:bold;"><?= $username; ?></td>
<td style="border: 1px solid black; font-weight:bold;"><?= $password; ?></td>
</tr>
<?php
}
} ?>
<!-- / -->
</table>
</td>
<!-- QR Code -->
<?php if ($qr == "yes") { ?>
<td>
<?= $qrcode ?>
</td>
<?php
} ?>
<!-- / -->
<tr>
<!-- Price -->
<td colspan="2" style="border-top: 1px solid black;font-weight:bold; font-size:16px"><?= $validity; ?> <?= $timelimit; ?> <?= $datalimit; ?> <?= $price; ?></td>
<!-- / -->
</tr>
<tr>
<!-- Note -->
<td colspan="2" style="font-weight:bold; font-size:12px">Login: http://<?= $dnsname; ?></td>
<!-- / -->
</tr>
<!-- / -->
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
+47
View File
@@ -0,0 +1,47 @@
Logo :
<img src="<?= $logo; ?>" style="height:30px;border:0;">
Hotspotname :
<?= $hotspotname; ?>
Username :
<?= $username; ?>
Password :
<?= $password; ?>
Validity :
<?= $validity; ?>
Time Limit :
<?= $timelimit; ?>
Data Limit :
<?= $datalimit; ?>
Price :
<?= $price; ?>
Profile :
<?= $profile; ?>
Comment :
<?= $comment; ?>
DNS Name Hotspot :
<?= $dnsname; ?>
QR Code :
<?= $qrcode ?>
Number Voucher:
<?= $num; ?>
<span id="num"><?= " [$num]"; ?></span>
Conditional :
$usermode = "vc"
username = password
$usermode = "up"
username & password
+163
View File
@@ -0,0 +1,163 @@
<?php
/*
* Copyright (C) 2018 Laksamadi Guko.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
session_start();
error_reporting(0);
ob_start("ob_gzhandler");
if (!isset($_SESSION["mikhmon"])) {
header("Location:../admin.php?id=login");
} else {
// 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'];
$usermode = $_GET['usermode'];
$small = $_GET['small'];
$userp = $_GET['user'];
$logo = "../img/logo-" . $session . ".png";
if (file_exists($logo)) {
$logo = "../img/logo-" . $session . ".png";
} else {
$logo = "../img/logo.png";
}
$username = "mikhmon";
$password = "1234";
$timelimit = "6h";
$getdatalimit = "1073741824";
$comment = "test";
$validity = "1d";
$profile = "6Jam";
if ($currency == in_array($currency, $cekindo['indo'])) {
$getprice = "5000";
$price = $currency . " " . number_format((float)$getprice, 0, ",", ".");
} else {
$getprice = "10";
$price = $currency . " " . number_format((float)$getprice, 2);
}
if ($getdatalimit == 0) {
$datalimit = "";
} else {
$datalimit = formatBytes($getdatalimit, 2);
}
$urilogin = "http://$dnsname/login?username=$username&password=$password";
$qrcode = "
<canvas class='qrcode' id='qr'></canvas>
<script>
(function() {
var qr = new QRious({
element: document.getElementById('qr'),
value: '".$urilogin."',
size:'256'
});
})();
</script>
";
$num = 1;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Voucher-<?= $hotspotname . "-" . $getuprofile . "-" . $id; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<link rel="icon" href="../img/favicon.png" />
<script src="../js/qrious.min.js"></script>
<style>
body {
color: #000000;
background-color: #FFFFFF;
font-size: 14px;
font-family: 'Helvetica', arial, sans-serif;
margin: 0px;
-webkit-print-color-adjust: exact;
}
table.voucher {
display: inline-block;
border: 2px solid black;
margin: 2px;
}
@page
{
size: auto;
margin-left: 7mm;
margin-right: 3mm;
margin-top: 9mm;
margin-bottom: 3mm;
}
@media print
{
table { page-break-after:auto }
tr { page-break-inside:avoid; page-break-after:auto }
td { page-break-inside:avoid; page-break-after:auto }
thead { display:table-header-group }
tfoot { display:table-footer-group }
}
#num {
float:right;
display:inline-block;
}
.qrc {
width:30px;
height:30px;
margin-top:1px;
}
</style>
</head>
<body>
<?php
if ($userp != "") {
include('./template-thermal.php');
} else {
if ($small == "yes") {
include('./template-small.php');
} else {
include('./template.php');
}
}
?>
</body>
</html>