Update Voucher , Tiket , Dashboard

membuat perubahan dan update
This commit is contained in:
YanDrs
2025-07-15 00:30:19 +07:00
parent 84c697516e
commit 0f32cf00ad
23 changed files with 2086 additions and 513 deletions
+4 -4
View File
@@ -4,13 +4,13 @@
const script = document.currentScript;
if (script && script.src) {
const url = new URL(script.src);
return url.searchParams.get("router_id");
return url.searchParams.get("i");
}
return null;
}
const routerId = getRouterIdFromScriptSrc() || "unknown";
console.log("Halaman login diakses dari MikroTik:", routerId);
const i = getRouterIdFromScriptSrc() || "unknown";
console.log("Halaman login diakses dari MikroTik:", i);
document.addEventListener("DOMContentLoaded", function () {
const container = document.getElementById("voucher-container");
@@ -18,7 +18,7 @@
if (container) {
const iframe = document.createElement("iframe");
iframe.id = "voucherFrame";
iframe.src = "https://manjapro.net/voucherpay/?id=" + encodeURIComponent(routerId);
iframe.src = "http://localhost/manjapro-project/voucherpay/?i=" + encodeURIComponent(i);
iframe.style.width = "100%";
iframe.style.border = "none";
iframe.style.display = "block";
+26 -4
View File
@@ -1,12 +1,34 @@
<?php
include "/www/wwwroot/bilspro/config/connect.php";
include "/www/wwwroot/bilspro/payment/paydisini/api_control.php";
// include "/www/wwwroot/bilspro/config/connect.php";
// include "/www/wwwroot/bilspro/payment/paydisini/api_control.php";
if (!isset($_GET['id']) || empty($_GET['id'])) {
include "../config/connect.php";
include "../payment/paydisini/api_control.php";
if (!isset($_GET['i']) || empty($_GET['i'])) {
die("ID tidak valid");
}
$board_id = $_GET['id'];
// encrypt url
define('ENCRYPTION_KEY', hex2bin('9a307dfcf16ac2e4406b1a59a31c1d096eafe37e40c60ddee4bb827b6a947079'));
define('ENCRYPTION_METHOD', 'AES-256-CBC');
function decrypt_url($data) {
$decoded = base64_decode($data);
if ($decoded === false) return false;
$parts = explode('::', $decoded);
if (count($parts) !== 2) return false;
$iv = hex2bin($parts[0]);
$encrypted_data = base64_decode($parts[1]);
return openssl_decrypt($encrypted_data, ENCRYPTION_METHOD, ENCRYPTION_KEY, OPENSSL_RAW_DATA, $iv);
}
$param = decrypt_url($_GET['i']);
$params = json_decode($param);
$board_id = $params->{'board'};
$radius_id = $params->nasgroupname;
$stmt = $pdo->prepare("SELECT * FROM setting_mikrotik WHERE board_id = :board_id");
$stmt->bindParam(':board_id', $board_id, PDO::PARAM_STR);