update cara upload gambar
This commit is contained in:
@@ -17,3 +17,4 @@ load/cronjob/*.log
|
||||
load/*.log
|
||||
webhook_cloud_api/*.jsonl
|
||||
load/*.txt
|
||||
config/*.log
|
||||
|
||||
+110
-10
@@ -1,11 +1,111 @@
|
||||
REMAND => 2 <-> cc.net Limit_Tgl_5<br>REMAND => 3 <-> nsn utama Limit_Tgl_10<br>NO ACTION => 3 <-> ciangsana Limit_Tgl_15<br>NO ACTION => 4 <-> fast.net Limit_Tgl_12<br>NO ACTION => 5 <-> bima net Limit Tagihan Tgl 15<br>NO ACTION => 6 <-> kingnet Limit Tgl 15<br>NO ACTION => 8 <-> diamond.net Limit_Tgl_15<br>NO ACTION => 9 <-> 22 p.net Limit_Tgl_15<br>KIRIM TAGIHAN => 10 <-> nettizen Tagihan Limit tgl 15<br>NO ACTION => 12 <-> DNY - Tagihan_Limit_Tgl5<br>REMAND => 15 <-> Tag_NTA2 Limit Tgl 10<br>REMAND => 16 <-> NTA1 - Tagihan Limit Tgl 10<br>PHP Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (2025-12-33) at position 9 (3): Unexpected character in /www/wwwroot/bilspro/config/cronjob_tagihan.php:31
|
||||
Stack trace:
|
||||
#0 /www/wwwroot/bilspro/config/cronjob_tagihan.php(31): DateTime->__construct()
|
||||
#1 {main}
|
||||
thrown in /www/wwwroot/bilspro/config/cronjob_tagihan.php on line 31
|
||||
OFF CONNECTION => 2 <-> cc.net Limit_Tgl_5<br>OFF CONNECTION => 3 <-> nsn utama Limit_Tgl_10<br>NO ACTION => 3 <-> ciangsana Limit_Tgl_15<br>NO ACTION => 4 <-> fast.net Limit_Tgl_12<br>NO ACTION => 5 <-> bima net Limit Tagihan Tgl 15<br>NO ACTION => 6 <-> kingnet Limit Tgl 15<br>NO ACTION => 8 <-> diamond.net Limit_Tgl_15<br>NO ACTION => 9 <-> 22 p.net Limit_Tgl_15<br>NO ACTION => 10 <-> nettizen Tagihan Limit tgl 15<br>NO ACTION => 12 <-> DNY - Tagihan_Limit_Tgl5<br>OFF CONNECTION => 15 <-> Tag_NTA2 Limit Tgl 10<br>OFF CONNECTION => 16 <-> NTA1 - Tagihan Limit Tgl 10<br>NO ACTION => 18 <-> BUM-Limit-Tgl-5<br>NO ACTION => 14 <-> Kh_Limit Tanggal 25<br>OFF CONNECTION => 17 <-> Tagihan Limit Tgl 10<br>KIRIM TAGIHAN => 17 <-> Tagihan Limit Tgl 15<br>OFF CONNECTION => 20 <-> IVVI-10<br>KIRIM TAGIHAN => 20 <-> IVVI-20<br>NO ACTION => 20 <-> IVVI-30<br>NO ACTION => 21 <-> QONNET<br>BUAT TAGIHAN => 21 <-> QONNET2 Start : 2025-11-11 - Last : 2025-11-14<br>NO ACTION => 25 <-> Tagihan Limit Tgl 5<br>NO ACTION => 23 <-> Limit Tanggal 5<br>OFF CONNECTION => 26 <-> Limit Tanggal 10<br>BUAT TAGIHAN => 24 <-> Tagihan30 Start : 2025-11-06 - Last : 2025-11-11<br>BUAT TAGIHAN => 23 <-> limit tanggal 19 Start : 2025-10-28 - Last : 2025-11-14<br>NO ACTION => 31 <-> 23-ISOLIR<br>NO ACTION => 33 <-> usolir-10<br>NO ACTION => 37 <-> paket 140 ribu<br>NO ACTION => 28 <-> PAKET-100K<br>NO ACTION => 28 <-> PAKET-150K<br>NO ACTION => 28 <-> PAKET-200K<br>NO ACTION => 28 <-> PAKET-300K<br>NO ACTION => 42 <-> meldina-20<br>NO ACTION => 41 <-> lippy-20<br>NO ACTION => 43 <-> Tagihan_Limit_tgl_13<br>OFF CONNECTION => 46 <-> Limit Tgl 10<br>NO ACTION => 35 <-> PAKET 1 DEVICE<br>NO ACTION => 35 <-> PAKET 2 DEVICE<br>NO ACTION => 35 <-> PAKET 3 DEVICE<br>NO ACTION => 35 <-> PAKET 4 DEVICE<br>NO ACTION => 35 <-> PAKET 5 DEVICE [1/80]<br>NO ACTION => 35 <-> PAKET 5 DEVICE [1/70]<br>NO ACTION => 35 <-> PAKET 6 DEVICE [1/80]<br>NO ACTION => 35 <-> PAKET 6 DEVICE [1/70]<br>NO ACTION => 35 <-> PAKET 7 DEVICE<br>NO ACTION => 35 <-> PAKET 8 DEVICE<br>OFF CONNECTION => 44 <-> Isolir_20<br>REMAND => 53 <-> PAKET BRONZE <br>NO ACTION => 54 <-> Muhamad rouf<br>REMAND => 53 <-> PAKET PLATINUM 5MBs<br>REMAND => 53 <-> PAKET GLOD 7 MBs<br>REMAND => 53 <-> PAKET GLOD+ 10 MBs<br>NO ACTION => 59 <-> Isolir_21<br>NO ACTION => 46 <-> Limit tgl 30<br>BUAT TAGIHAN => 61 <-> Isolir_20 Start : 2025-11-09 - Last : 2025-11-14<br>NO ACTION => 55 <-> Dcn_CO_Isolir<br>NO ACTION => 62 <-> limit tanggal 5<br>NO ACTION => 55 <-> Dcn_GB_Isolir<br>BUAT TAGIHAN => 49 <-> TAGIHAN TANGGAL 20 Start : 2025-10-30 - Last : 2025-11-18<br>NO ACTION => 19 <-> TAGIHAN-TGL1<br>NO ACTION => 49 <-> TAGIHAN TANGGAL 1<br>OFF CONNECTION => 66 <-> Tagihan Isolir Tgl 1<br>andri69<br>Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[ip_address] => tunnel.bilspro.com
|
||||
[port_api] => 9041
|
||||
[username] => apkbilsproaccess
|
||||
[password] => apkbilsproaccess123
|
||||
)
|
||||
|
||||
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (2025-12-33) at position 9 (3): Unexpected character in /www/wwwroot/bilspro/config/cronjob_tagihan.php:31
|
||||
Stack trace:
|
||||
#0 /www/wwwroot/bilspro/config/cronjob_tagihan.php(31): DateTime->__construct()
|
||||
#1 {main}
|
||||
thrown in /www/wwwroot/bilspro/config/cronjob_tagihan.php on line 31
|
||||
)
|
||||
Server Not ConnectTEST69<br>Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[ip_address] => tunnel.bilspro.com
|
||||
[port_api] => 9041
|
||||
[username] => apkbilsproaccess
|
||||
[password] => apkbilsproaccess123
|
||||
)
|
||||
|
||||
)
|
||||
Server Not ConnectRirin Rusmawati69<br>Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[ip_address] => tunnel.bilspro.com
|
||||
[port_api] => 9041
|
||||
[username] => apkbilsproaccess
|
||||
[password] => apkbilsproaccess123
|
||||
)
|
||||
|
||||
)
|
||||
Server Not ConnectSaefulloh69<br>Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[ip_address] => tunnel.bilspro.com
|
||||
[port_api] => 9041
|
||||
[username] => apkbilsproaccess
|
||||
[password] => apkbilsproaccess123
|
||||
)
|
||||
|
||||
)
|
||||
Server Not ConnectAbdul Rosid69<br>Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[ip_address] => tunnel.bilspro.com
|
||||
[port_api] => 9041
|
||||
[username] => apkbilsproaccess
|
||||
[password] => apkbilsproaccess123
|
||||
)
|
||||
|
||||
)
|
||||
Server Not ConnectSuhersih69<br>Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[ip_address] => tunnel.bilspro.com
|
||||
[port_api] => 9041
|
||||
[username] => apkbilsproaccess
|
||||
[password] => apkbilsproaccess123
|
||||
)
|
||||
|
||||
)
|
||||
Server Not ConnectMunayah69<br>Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[ip_address] => tunnel.bilspro.com
|
||||
[port_api] => 9041
|
||||
[username] => apkbilsproaccess
|
||||
[password] => apkbilsproaccess123
|
||||
)
|
||||
|
||||
)
|
||||
Server Not ConnectMasta69<br>Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[ip_address] => tunnel.bilspro.com
|
||||
[port_api] => 9041
|
||||
[username] => apkbilsproaccess
|
||||
[password] => apkbilsproaccess123
|
||||
)
|
||||
|
||||
)
|
||||
Server Not Connectandri69<br>Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[ip_address] => tunnel.bilspro.com
|
||||
[port_api] => 9041
|
||||
[username] => apkbilsproaccess
|
||||
[password] => apkbilsproaccess123
|
||||
)
|
||||
|
||||
)
|
||||
Server Not ConnectTEST69<br>Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[ip_address] => tunnel.bilspro.com
|
||||
[port_api] => 9041
|
||||
[username] => apkbilsproaccess
|
||||
[password] => apkbilsproaccess123
|
||||
)
|
||||
|
||||
)
|
||||
Server Not ConnectOFF CONNECTION => 67 <-> Tag Netborhood Limit Tgl 10<br>NO ACTION => 73 <-> Tagihan01-05<br>OFF CONNECTION => 74 <-> tto Limit_Tgl_10<br>OFF CONNECTION => 75 <-> too_Limit_Tgl_10<br>OFF CONNECTION => 76 <-> GAS NET limit_tgl_10<br>NO ACTION => 77 <-> DamarisNet<br>NO ACTION => 22 <-> rumahan<br>NO ACTION => 68 <-> limit tgl 5<br>OFF CONNECTION => 80 <-> Tagihan Tgl 5 ( Kenzi Net )<br>
|
||||
@@ -294,11 +294,10 @@ try {
|
||||
|
||||
$namaclean = preg_replace('/[^a-zA-Z\s]/', '', $pecah1['nama']);
|
||||
$namaclean = ucwords(strtolower(trim($namaclean)));
|
||||
$transaction_title = "Tagihan " . formatIndo($limit_tag, 'F Y') . ' an ' . $namaclean . ' id ' . $pecah1['akun'];
|
||||
|
||||
$stmt = $pdo->prepare("INSERT INTO tagihan
|
||||
(id_data_server, id_pelanggan, id_profile_paket, id_profile_tagihan, nominal_tagihan, jumlah_tagihan, ppn, total_tagihan, kode_unik, verifikasi_tagihan, keterangan, limit_pembayaran, status, transaction_title)
|
||||
VALUES (:id_data_server, :id_pelanggan, :id_profile_paket, :id_profile_tagihan, :nominal_tagihan, :jumlah_tagihan, :ppn, :total_tagihan, :kode_unik, :verifikasi_tagihan, :keterangan, :limit_pembayaran, :status, :transaction_title)
|
||||
(id_data_server, id_pelanggan, id_profile_paket, id_profile_tagihan, nominal_tagihan, jumlah_tagihan, ppn, total_tagihan, kode_unik, verifikasi_tagihan, keterangan, limit_pembayaran, status)
|
||||
VALUES (:id_data_server, :id_pelanggan, :id_profile_paket, :id_profile_tagihan, :nominal_tagihan, :jumlah_tagihan, :ppn, :total_tagihan, :kode_unik, :verifikasi_tagihan, :keterangan, :limit_pembayaran, :status)
|
||||
");
|
||||
$stmt->execute([
|
||||
':id_data_server' => $id_data_server,
|
||||
@@ -314,7 +313,6 @@ try {
|
||||
':keterangan' => $keterangan,
|
||||
':limit_pembayaran' => $limit_tag,
|
||||
':status' => $status,
|
||||
':transaction_title' => $transaction_title,
|
||||
]);
|
||||
$last_id = $pdo->lastInsertId();
|
||||
|
||||
|
||||
+36
-34
@@ -3,10 +3,12 @@ include '../config/connect.php';
|
||||
require '../payment/flip/Flip/Transaction.php';
|
||||
|
||||
try {
|
||||
// Query ambil data tagihan yang lunas & masih ACTIVE di bulan berjalan
|
||||
$sql = "
|
||||
SELECT
|
||||
a.id,
|
||||
a.transaction_id,
|
||||
a.transaction_data,
|
||||
b.apikey_payment_gateway,
|
||||
b.url_payment_gateway
|
||||
FROM
|
||||
@@ -15,14 +17,15 @@ try {
|
||||
data_server b
|
||||
ON a.id_data_server = b.id
|
||||
WHERE
|
||||
a.status = 'lewat'
|
||||
a.status = 'lunas'
|
||||
AND a.transaction_id != ''
|
||||
AND a.transaction_status = 'ACTIVE'
|
||||
AND a.transaction_data != ''
|
||||
AND b.payment_gateway = 'flip'
|
||||
AND b.status_payment_gateway = 'ACTIVE'
|
||||
AND YEAR(a.limit_pembayaran) = YEAR(NOW())
|
||||
AND MONTH(a.limit_pembayaran) = MONTH(NOW())
|
||||
ORDER BY a.limit_pembayaran ASC
|
||||
ORDER BY a.id ASC
|
||||
LIMIT 5
|
||||
";
|
||||
|
||||
@@ -31,64 +34,63 @@ try {
|
||||
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$results = [];
|
||||
$no = 1;
|
||||
|
||||
foreach ($data as $row) {
|
||||
// Pastikan class FlipPaymentGateway ada di Transaction.php
|
||||
$flip = new FlipPaymentGateway($row['apikey_payment_gateway'], $row['url_payment_gateway']);
|
||||
// Decode JSON transaction_data
|
||||
$data2 = json_decode($row['transaction_data'], true);
|
||||
|
||||
// Ambil status bill
|
||||
$response = $flip->getBillStatus($row['transaction_id']);
|
||||
|
||||
// Cek apakah respon valid dan mengandung link_id
|
||||
if (!is_array($response) || empty($response['link_id'])) {
|
||||
// Cek jika JSON tidak valid atau kosong
|
||||
if (json_last_error() !== JSON_ERROR_NONE || empty($data2)) {
|
||||
$results[] = [
|
||||
'nomor' => $no,
|
||||
'id' => $row['id'],
|
||||
'transaction_id' => $row['transaction_id'],
|
||||
'status' => 'error',
|
||||
'message' => 'Invalid or missing response from Flip API'
|
||||
'title' => '(invalid JSON)',
|
||||
'error' => 'transaction_data tidak valid'
|
||||
];
|
||||
$no++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$flip = new FlipPaymentGateway($row['apikey_payment_gateway'], $row['url_payment_gateway']);
|
||||
|
||||
$delete = $flip->editBill(
|
||||
$data2['link_id'],
|
||||
'INACTIVE',
|
||||
$data2['title'] ?? '',
|
||||
$data2['amount'] ?? 0
|
||||
);
|
||||
|
||||
if ($delete) {
|
||||
$update = $pdo->prepare("UPDATE tagihan SET transaction_status = 'INACTIVE' WHERE id = :id");
|
||||
$update->execute([':id' => $row['id']]);
|
||||
}
|
||||
|
||||
// Tampilkan respon dari Flip (opsional)
|
||||
// print_r($response);
|
||||
|
||||
// Edit bill menjadi INACTIVE
|
||||
// $delete = $flip->editBill(
|
||||
// $response['link_id'],
|
||||
// 'INACTIVE',
|
||||
// $response['title'] ?? '',
|
||||
// $response['amount'] ?? 0
|
||||
// );
|
||||
|
||||
// Tambahkan ke hasil
|
||||
$results[] = [
|
||||
'nomor' => $no,
|
||||
'id' => $row['id'],
|
||||
'transaction_id' => $row['transaction_id'],
|
||||
'flip_response' => $response
|
||||
'title' => $delete['title'] ?? '(tidak ada title)',
|
||||
// 'flip_response' => $response // bisa diaktifkan nanti jika perlu request ke Flip API
|
||||
];
|
||||
|
||||
// // Jika berhasil, update status di database
|
||||
// if ($delete) {
|
||||
// $update = $pdo->prepare("UPDATE tagihan SET transaction_status = :status WHERE id = :id");
|
||||
// $update->execute([
|
||||
// ':status' => 'INACTIVE',
|
||||
// ':id' => $row['id']
|
||||
// ]);
|
||||
// }
|
||||
$no++;
|
||||
}
|
||||
|
||||
// Tampilkan hasil dari Flip (bukan data dari DB)
|
||||
// Output hasil
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($results, JSON_PRETTY_PRINT);
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode([
|
||||
'status' => 'error',
|
||||
'message' => $e->getMessage()
|
||||
'message' => 'Database Error: ' . $e->getMessage()
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode([
|
||||
'status' => 'error',
|
||||
'message' => $e->getMessage()
|
||||
'message' => 'General Error: ' . $e->getMessage()
|
||||
]);
|
||||
}
|
||||
|
||||
+62
-1
@@ -120,7 +120,68 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
echo json_encode(['success' => false, 'error' => 'Mikrotik tidak terhubung']);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
elseif ($tabel === 'tagihan') {
|
||||
|
||||
$sql = "
|
||||
SELECT
|
||||
a.id,
|
||||
a.transaction_id,
|
||||
a.transaction_data,
|
||||
b.apikey_payment_gateway,
|
||||
b.url_payment_gateway
|
||||
FROM
|
||||
tagihan a
|
||||
LEFT JOIN
|
||||
data_server b
|
||||
ON a.id_data_server = b.id
|
||||
WHERE
|
||||
a.id = :id
|
||||
AND a.transaction_id != ''
|
||||
AND a.transaction_status = 'ACTIVE'
|
||||
AND a.transaction_data != ''
|
||||
AND b.payment_gateway = 'flip'
|
||||
AND b.status_payment_gateway = 'ACTIVE'
|
||||
";
|
||||
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([':id' => $id]);
|
||||
$data = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($data && !empty($data['transaction_data'])) {
|
||||
require "../payment/flip/Flip/Transaction.php";
|
||||
|
||||
$data2 = json_decode($data['transaction_data'], true);
|
||||
if (json_last_error() === JSON_ERROR_NONE && !empty($data2['link_id'])) {
|
||||
$flip = new FlipPaymentGateway($data['apikey_payment_gateway'], $data['url_payment_gateway']);
|
||||
|
||||
$flip->editBill(
|
||||
$data2['link_id'],
|
||||
'INACTIVE',
|
||||
$data2['title'] ?? '',
|
||||
$data2['amount'] ?? 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM tagihan WHERE id = ?";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->bindParam(1, $id, PDO::PARAM_INT);
|
||||
|
||||
if ($stmt->execute()) {
|
||||
$deletedCount = $stmt->rowCount();
|
||||
$response = [
|
||||
'success' => true,
|
||||
'deleted_count' => $deletedCount,
|
||||
'deleted_items' => [
|
||||
['table' => 'data yang anda hapus', 'count' => $deletedCount]
|
||||
]
|
||||
];
|
||||
} else {
|
||||
$response = ['success' => false, 'error' => 'Gagal menghapus data'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Menyiapkan perintah SQL untuk menghapus data dari tabel lain
|
||||
$sql = "DELETE FROM $tabel WHERE id = ?";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
|
||||
+71
-16
@@ -46,53 +46,108 @@ function minioUpload($bucket, $key, $sourceFile) {
|
||||
/**
|
||||
* Upload lokal dan MinIO
|
||||
*/
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
if (isset($_FILES['file']) && $_FILES['file']['error'] === UPLOAD_ERR_OK) {
|
||||
|
||||
$uploadDir = '../img/user/';
|
||||
if (!is_dir($uploadDir)) mkdir($uploadDir, 0777, true);
|
||||
session_start(); // pastikan session aktif
|
||||
|
||||
$fileExt = "." . pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
|
||||
$fileName = "bilspro_" . date('YmdHis') . $fileExt;
|
||||
$uploadFile = $uploadDir . $fileName;
|
||||
$formId = $_POST['formId'];
|
||||
|
||||
// --- 1️⃣ Upload ke server lokal ---
|
||||
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadFile)) {
|
||||
// --- 📤 Upload langsung ke MinIO ---
|
||||
$tmpFilePath = $_FILES['file']['tmp_name']; // ambil file temporary upload
|
||||
|
||||
// --- 2️⃣ Upload ke MinIO ---
|
||||
$minioUrl = minioUpload('files', 'user/' . $fileName, $uploadFile);
|
||||
// Pastikan minioUpload menerima path file lokal sementara ($tmpFilePath)
|
||||
$minioUrl = minioUpload('files', 'user/' . $fileName, $tmpFilePath);
|
||||
|
||||
if ($minioUrl) {
|
||||
// Simpan info file ke session
|
||||
if (!isset($_SESSION['uploaded_files'])) {
|
||||
$_SESSION['uploaded_files'] = [];
|
||||
}
|
||||
|
||||
$_SESSION['uploaded_files'][$formId] = $fileName;
|
||||
|
||||
// $_SESSION['uploaded_files'][$formId] = [
|
||||
// 'local' => $fileName,
|
||||
// 'minio' => $minioUrl ?: null
|
||||
// 'file_name' => $fileName,
|
||||
// 'minio_url' => $minioUrl
|
||||
// ];
|
||||
|
||||
// --- Respons sukses ---
|
||||
echo json_encode([
|
||||
'status' => 'success',
|
||||
'message' => 'File berhasil diupload.',
|
||||
'local_path' => $uploadFile,
|
||||
'file_name' => $fileName,
|
||||
'minio_url' => $minioUrl
|
||||
]);
|
||||
} else {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Gagal upload ke server lokal.']);
|
||||
echo json_encode([
|
||||
'status' => 'error',
|
||||
'message' => 'Gagal upload.'
|
||||
]);
|
||||
}
|
||||
|
||||
} else {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Tidak ada file diupload atau terjadi error.']);
|
||||
echo json_encode([
|
||||
'status' => 'error',
|
||||
'message' => 'Tidak ada file diupload atau terjadi error.'
|
||||
]);
|
||||
}
|
||||
|
||||
} else {
|
||||
echo json_encode(['status' => 'error', 'message' => 'Invalid request method.']);
|
||||
echo json_encode([
|
||||
'status' => 'error',
|
||||
'message' => 'Invalid request method.'
|
||||
]);
|
||||
}
|
||||
|
||||
// if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
// if (isset($_FILES['file']) && $_FILES['file']['error'] === UPLOAD_ERR_OK) {
|
||||
|
||||
// $uploadDir = '../img/user/';
|
||||
// if (!is_dir($uploadDir)) mkdir($uploadDir, 0777, true);
|
||||
|
||||
// $fileExt = "." . pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
|
||||
// $fileName = "bilspro_" . date('YmdHis') . $fileExt;
|
||||
// $uploadFile = $uploadDir . $fileName;
|
||||
// $formId = $_POST['formId'];
|
||||
|
||||
// // --- 1️⃣ Upload ke server lokal ---
|
||||
// if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadFile)) {
|
||||
|
||||
// // --- 2️⃣ Upload ke MinIO ---
|
||||
// $minioUrl = minioUpload('files', 'user/' . $fileName, $uploadFile);
|
||||
|
||||
// // Simpan info file ke session
|
||||
// if (!isset($_SESSION['uploaded_files'])) {
|
||||
// $_SESSION['uploaded_files'] = [];
|
||||
// }
|
||||
|
||||
// $_SESSION['uploaded_files'][$formId] = $fileName;
|
||||
// // $_SESSION['uploaded_files'][$formId] = [
|
||||
// // 'local' => $fileName,
|
||||
// // 'minio' => $minioUrl ?: null
|
||||
// // ];
|
||||
|
||||
// // --- Respons sukses ---
|
||||
// echo json_encode([
|
||||
// 'status' => 'success',
|
||||
// 'message' => 'File berhasil diupload.',
|
||||
// 'local_path' => $uploadFile,
|
||||
// 'minio_url' => $minioUrl
|
||||
// ]);
|
||||
// } else {
|
||||
// echo json_encode(['status' => 'error', 'message' => 'Gagal upload ke server lokal.']);
|
||||
// }
|
||||
|
||||
// } else {
|
||||
// echo json_encode(['status' => 'error', 'message' => 'Tidak ada file diupload atau terjadi error.']);
|
||||
// }
|
||||
|
||||
// } else {
|
||||
// echo json_encode(['status' => 'error', 'message' => 'Invalid request method.']);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ function sanitizeString($input) {
|
||||
}
|
||||
|
||||
include "../config/connect.php";
|
||||
include "../config/tanggal_indo.php";
|
||||
|
||||
try {
|
||||
$linkCreated = false; // Penanda apakah ada link yang berhasil dibuat
|
||||
@@ -72,8 +73,8 @@ try {
|
||||
|
||||
if ($sekarang === $cektanggal) {
|
||||
|
||||
$keteranganName = ucwords(strtolower(preg_replace('/[^a-zA-Z\s]/', '', $data['nama'])));
|
||||
$keteranganFlip = str_replace('Layanan Internet ', '', $data['keterangan']) . " (an. " . $keteranganName . ")";
|
||||
$namaclean = ucwords(strtolower(preg_replace('/[^a-zA-Z\s]/', '', $data['nama'])));
|
||||
$keteranganFlip = "Tagihan " . formatIndo($data['limit_pembayaran'], 'F Y') . ' an ' . $namaclean . ' id ' . $data['akun'];
|
||||
|
||||
// Buat link payment gateway
|
||||
require '../payment/flip/Flip/Transaction.php';
|
||||
|
||||
@@ -1,121 +1,121 @@
|
||||
[17:42:01] [OK] 103.26.176.81
|
||||
[17:42:01] [OK] 103.188.169.123
|
||||
[17:42:01] [OK] 103.26.176.85
|
||||
[17:42:01] [OK] 103.188.169.121
|
||||
[17:42:01] [OK] 103.26.176.83
|
||||
[17:42:01] [OK] tunnel.manjapro.net
|
||||
[17:42:01] [OK] tunnel.manjapro.net
|
||||
[17:42:01] [OK] tunnel.manjapro.net
|
||||
[17:42:01] [OK] tunnel.manjapro.net
|
||||
[17:42:01] [OK] 103.155.198.185
|
||||
[17:42:01] [OK] 103.188.169.127
|
||||
[17:42:01] [OK] tunnel.manjapro.net
|
||||
[17:42:02] [OK] tunnel.manjapro.net
|
||||
[17:42:02] [OK] 103.26.176.87
|
||||
[17:42:02] [OK] tunnel.manjapro.net
|
||||
[17:42:02] [OK] 103.236.190.109
|
||||
[17:42:02] [OK] tunnel.manjapro.net
|
||||
[17:42:02] [OK] 103.26.176.93
|
||||
[17:42:02] [OK] 103.155.196.145
|
||||
[17:42:02] [OK] 103.242.104.69
|
||||
[17:42:02] [OK] 103.31.233.237
|
||||
[17:42:02] [OK] gusjampang.xyz
|
||||
[17:42:03] [OK] tunnel.manjapro.net
|
||||
[17:42:03] [OK] tunnel.manjapro.net
|
||||
[17:42:03] [OK] 103.18.79.171
|
||||
[17:42:03] [OK] 103.155.199.191
|
||||
[17:42:04] [OK] tunnel.manjapro.net
|
||||
[17:42:04] [OK] 103.242.106.56
|
||||
[17:42:05] [FAIL] 103.67.80.126
|
||||
[17:42:05] [FAIL] 157.20.128.231
|
||||
[17:42:05] [OK] tunnel.manjapro.net
|
||||
[17:42:06] [FAIL] tunnel.bilspro.com
|
||||
[17:42:06] [FAIL] tunnel.bilspro.com
|
||||
[17:42:06] [FAIL] 103.94.10.240
|
||||
[17:42:06] [OK] tunnel.manjapro.net
|
||||
[17:42:07] [FAIL] 103.94.10.240
|
||||
[17:42:07] [FAIL] 103.94.10.240
|
||||
[17:42:07] [OK] tunnel.manjapro.net
|
||||
[17:42:08] [FAIL] tunnel.bilspro.com
|
||||
[17:42:09] [FAIL] infinnet.cloud
|
||||
[17:42:09] [OK] tunnel.manjapro.net
|
||||
[17:42:09] [OK] tunnel.manjapro.net
|
||||
[17:42:09] [OK] tunnel.manjapro.net
|
||||
[17:42:10] [OK] tunnel.manjapro.net
|
||||
[17:42:10] [OK] tunnel.manjapro.net
|
||||
[17:42:10] [OK] tunnel.manjapro.net
|
||||
[17:42:10] [OK] tunnel.manjapro.net
|
||||
[17:42:10] [OK] tunnel.manjapro.net
|
||||
[17:42:11] [FAIL] infinnet.cloud
|
||||
[17:42:11] [FAIL] tunnel.bilspro.com
|
||||
[17:42:11] [FAIL] 103.155.198.109
|
||||
[17:42:11] [OK] tunnel.manjapro.net
|
||||
[17:42:15] [FAIL] tunnel.manjapro.net
|
||||
[17:42:16] [FAIL] 157.20.12
|
||||
[17:42:16] [FAIL] tunnel.manjapro.net
|
||||
[17:42:16] [FAIL] 114.141.51.12
|
||||
[17:42:16] [FAIL] 114.141.51.12
|
||||
[17:42:17] [FAIL] 103.103.147.225
|
||||
[17:42:20] [FAIL] tunnel.manjapro.net
|
||||
[2025-11-10 17:42:20] Semua child selesai. Mulai update DB...
|
||||
[17:42:20] [UPDATE DB] 03FK-Q7XE1
|
||||
[17:42:20] [UPDATE DB] IDLF-SK944
|
||||
[17:42:20] [UPDATE DB] TYF0-3RP75
|
||||
[17:42:20] [UPDATE DB] 0YDS-EI1V6
|
||||
[17:42:20] [UPDATE DB] C7CU-PGT97
|
||||
[17:42:20] [UPDATE STATUS] 7FZH-WIBI8 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE DB] YHVJ-ZN9V9
|
||||
[17:42:20] [UPDATE DB] C7CU-PGT910
|
||||
[17:42:20] [UPDATE DB] MPK0-Q43P11
|
||||
[17:42:20] [UPDATE DB] S9QL-XRJ512
|
||||
[17:42:20] [UPDATE DB] HHJH-UFWL14
|
||||
[17:42:20] [UPDATE DB] 03FK-Q7XE15
|
||||
[17:42:20] [UPDATE DB] DG7B-JP4218
|
||||
[17:42:20] [UPDATE DB] XXWL-VMH419
|
||||
[17:42:20] [UPDATE DB] 03FK-Q7XE20
|
||||
[17:42:20] [UPDATE DB] C7CU-PGT922
|
||||
[17:42:20] [UPDATE DB] 8FHL-TXVS23
|
||||
[17:42:20] [UPDATE DB] Q23C-IE2524
|
||||
[17:42:20] [UPDATE STATUS] Q4D5-ATUM25 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE DB] 03FK-Q7XE28
|
||||
[17:42:20] [UPDATE DB] 11P4-SII029
|
||||
[17:42:20] [UPDATE DB] CUAA-CD2K30
|
||||
[17:42:20] [UPDATE DB] 03FK-Q7XE32
|
||||
[17:42:20] [UPDATE DB] H67G-R4AK33
|
||||
[17:42:20] [UPDATE STATUS] 9RV7-3W5U34 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE DB] 32PA-DAZ435
|
||||
[17:42:20] [UPDATE STATUS] LJQ6-KDDJ37 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE DB] 0TW0-J74U38
|
||||
[17:42:20] [UPDATE DB] L7TJ-IF2G39
|
||||
[17:42:20] [UPDATE DB] RWDJ-NXBZ40
|
||||
[17:42:20] [UPDATE DB] A26W-ART341
|
||||
[17:42:20] [UPDATE STATUS] RE5H-G12Y42 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE STATUS] 03FK-Q7XE43 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE STATUS] Q96U-20UZ44 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE DB] D3TU-JN5745
|
||||
[17:42:20] [UPDATE DB] 7SDF-17X546
|
||||
[17:42:20] [UPDATE DB] HMAZ-3HSX51
|
||||
[17:42:20] [UPDATE STATUS] PQJB-HG8V53 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE STATUS] PMA9-QC7654 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE STATUS] 7ZCI-NFCI62 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE STATUS] 0E73-PABK63 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE STATUS] 4MZF-SFTR65 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE STATUS] PJC8-K0EG66 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE STATUS] 351D-5NCH67 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE STATUS] A0S7-K2IC69 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE DB] G9Z1-HRLY70
|
||||
[17:42:20] [UPDATE STATUS] C7CU-PGT972 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE DB] 66AU-Z7I573
|
||||
[17:42:20] [UPDATE DB] S9QL-XRJ575
|
||||
[17:42:20] [UPDATE DB] ABMS-YBP776
|
||||
[17:42:20] [UPDATE DB] C7CU-PGT977
|
||||
[17:42:20] [UPDATE DB] C7CU-PGT978
|
||||
[17:42:20] [UPDATE DB] HHJH-UFWL81
|
||||
[17:42:20] [UPDATE DB] 83
|
||||
[17:42:20] [UPDATE STATUS] RNS6-DB3N84 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE STATUS] C7CU-PGT987 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE DB] ZMVC-KAFH88
|
||||
[17:42:20] [UPDATE STATUS] L5BR-E8QA89 (Disconnected -> Disconnected)
|
||||
[17:42:20] [UPDATE DB] XNEQ-GB6L90
|
||||
[2025-11-10 17:42:20] Update DB selesai. OK: 59, FAIL: 0
|
||||
[2025-11-10 17:42:20] Lama eksekusi: 19.57 detik
|
||||
[12:54:01] [OK] 103.26.176.81
|
||||
[12:54:01] [OK] 103.188.169.123
|
||||
[12:54:01] [OK] 103.26.176.85
|
||||
[12:54:01] [OK] 103.26.176.83
|
||||
[12:54:01] [OK] 103.188.169.121
|
||||
[12:54:01] [OK] tunnel.manjapro.net
|
||||
[12:54:01] [OK] tunnel.manjapro.net
|
||||
[12:54:01] [OK] 103.155.198.185
|
||||
[12:54:01] [OK] tunnel.manjapro.net
|
||||
[12:54:01] [OK] 103.188.169.127
|
||||
[12:54:01] [OK] tunnel.manjapro.net
|
||||
[12:54:01] [OK] tunnel.manjapro.net
|
||||
[12:54:02] [OK] 103.26.176.87
|
||||
[12:54:02] [OK] tunnel.manjapro.net
|
||||
[12:54:02] [OK] tunnel.manjapro.net
|
||||
[12:54:02] [OK] tunnel.manjapro.net
|
||||
[12:54:02] [OK] 103.26.176.93
|
||||
[12:54:02] [OK] 103.236.190.109
|
||||
[12:54:02] [OK] 103.155.196.145
|
||||
[12:54:02] [OK] 103.31.233.237
|
||||
[12:54:02] [OK] 103.242.104.69
|
||||
[12:54:02] [OK] gusjampang.xyz
|
||||
[12:54:02] [OK] tunnel.manjapro.net
|
||||
[12:54:03] [OK] 103.18.79.171
|
||||
[12:54:03] [OK] 103.155.199.191
|
||||
[12:54:04] [OK] tunnel.manjapro.net
|
||||
[12:54:05] [OK] tunnel.manjapro.net
|
||||
[12:54:05] [FAIL] 103.67.80.126
|
||||
[12:54:05] [OK] 103.242.106.56
|
||||
[12:54:05] [OK] tunnel.manjapro.net
|
||||
[12:54:05] [FAIL] 157.20.128.231
|
||||
[12:54:06] [FAIL] tunnel.bilspro.com
|
||||
[12:54:06] [FAIL] tunnel.bilspro.com
|
||||
[12:54:06] [FAIL] 103.94.10.240
|
||||
[12:54:06] [FAIL] 103.94.10.240
|
||||
[12:54:07] [FAIL] 103.94.10.240
|
||||
[12:54:07] [OK] tunnel.manjapro.net
|
||||
[12:54:09] [FAIL] tunnel.bilspro.com
|
||||
[12:54:10] [FAIL] infinnet.cloud
|
||||
[12:54:10] [FAIL] 103.155.198.109
|
||||
[12:54:10] [FAIL] tunnel.manjapro.net
|
||||
[12:54:10] [OK] tunnel.manjapro.net
|
||||
[12:54:11] [OK] tunnel.manjapro.net
|
||||
[12:54:11] [FAIL] infinnet.cloud
|
||||
[12:54:11] [FAIL] tunnel.bilspro.com
|
||||
[12:54:11] [OK] tunnel.manjapro.net
|
||||
[12:54:11] [OK] tunnel.manjapro.net
|
||||
[12:54:11] [OK] tunnel.manjapro.net
|
||||
[12:54:11] [OK] tunnel.manjapro.net
|
||||
[12:54:11] [OK] tunnel.manjapro.net
|
||||
[12:54:11] [OK] tunnel.manjapro.net
|
||||
[12:54:12] [OK] tunnel.manjapro.net
|
||||
[12:54:15] [FAIL] tunnel.manjapro.net
|
||||
[12:54:16] [FAIL] 157.20.12
|
||||
[12:54:16] [FAIL] tunnel.manjapro.net
|
||||
[12:54:16] [FAIL] 114.141.51.12
|
||||
[12:54:16] [FAIL] 114.141.51.12
|
||||
[12:54:17] [FAIL] 103.103.147.225
|
||||
[12:54:19] [FAIL] tunnel.manjapro.net
|
||||
[2025-11-11 12:54:19] Semua child selesai. Mulai update DB...
|
||||
[12:54:19] [UPDATE DB] 03FK-Q7XE1
|
||||
[12:54:19] [UPDATE DB] IDLF-SK944
|
||||
[12:54:19] [UPDATE DB] TYF0-3RP75
|
||||
[12:54:19] [UPDATE DB] 0YDS-EI1V6
|
||||
[12:54:19] [UPDATE DB] C7CU-PGT97
|
||||
[12:54:19] [UPDATE STATUS] 7FZH-WIBI8 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE DB] YHVJ-ZN9V9
|
||||
[12:54:19] [UPDATE DB] C7CU-PGT910
|
||||
[12:54:19] [UPDATE DB] MPK0-Q43P11
|
||||
[12:54:19] [UPDATE DB] S9QL-XRJ512
|
||||
[12:54:19] [UPDATE DB] HHJH-UFWL14
|
||||
[12:54:19] [UPDATE DB] 03FK-Q7XE15
|
||||
[12:54:19] [UPDATE DB] DG7B-JP4218
|
||||
[12:54:19] [UPDATE DB] XXWL-VMH419
|
||||
[12:54:19] [UPDATE DB] 03FK-Q7XE20
|
||||
[12:54:19] [UPDATE DB] C7CU-PGT922
|
||||
[12:54:19] [UPDATE DB] 8FHL-TXVS23
|
||||
[12:54:19] [UPDATE DB] Q23C-IE2524
|
||||
[12:54:19] [UPDATE STATUS] Q4D5-ATUM25 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE DB] 03FK-Q7XE28
|
||||
[12:54:19] [UPDATE DB] 11P4-SII029
|
||||
[12:54:19] [UPDATE DB] CUAA-CD2K30
|
||||
[12:54:19] [UPDATE DB] 03FK-Q7XE32
|
||||
[12:54:19] [UPDATE DB] H67G-R4AK33
|
||||
[12:54:19] [UPDATE STATUS] 9RV7-3W5U34 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE DB] 32PA-DAZ435
|
||||
[12:54:19] [UPDATE STATUS] LJQ6-KDDJ37 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE DB] 0TW0-J74U38
|
||||
[12:54:19] [UPDATE DB] L7TJ-IF2G39
|
||||
[12:54:19] [UPDATE DB] RWDJ-NXBZ40
|
||||
[12:54:19] [UPDATE STATUS] A26W-ART341 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] RE5H-G12Y42 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] 03FK-Q7XE43 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] Q96U-20UZ44 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE DB] D3TU-JN5745
|
||||
[12:54:19] [UPDATE DB] 7SDF-17X546
|
||||
[12:54:19] [UPDATE DB] HMAZ-3HSX51
|
||||
[12:54:19] [UPDATE STATUS] PQJB-HG8V53 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] PMA9-QC7654 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] 7ZCI-NFCI62 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] 0E73-PABK63 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] 4MZF-SFTR65 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] PJC8-K0EG66 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] 351D-5NCH67 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] A0S7-K2IC69 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE DB] G9Z1-HRLY70
|
||||
[12:54:19] [UPDATE STATUS] C7CU-PGT972 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE DB] 66AU-Z7I573
|
||||
[12:54:19] [UPDATE DB] S9QL-XRJ575
|
||||
[12:54:19] [UPDATE DB] ABMS-YBP776
|
||||
[12:54:19] [UPDATE DB] C7CU-PGT977
|
||||
[12:54:19] [UPDATE DB] C7CU-PGT978
|
||||
[12:54:19] [UPDATE DB] HHJH-UFWL81
|
||||
[12:54:19] [UPDATE DB] 83
|
||||
[12:54:19] [UPDATE STATUS] RNS6-DB3N84 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE STATUS] C7CU-PGT987 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE DB] ZMVC-KAFH88
|
||||
[12:54:19] [UPDATE STATUS] L5BR-E8QA89 (Disconnected -> Disconnected)
|
||||
[12:54:19] [UPDATE DB] XNEQ-GB6L90
|
||||
[2025-11-11 12:54:19] Update DB selesai. OK: 59, FAIL: 0
|
||||
[2025-11-11 12:54:19] Lama eksekusi: 18.11 detik
|
||||
|
||||
@@ -1 +1 @@
|
||||
[2025-11-10 17:40:02] Remote port 12911 berhasil ditutup.
|
||||
[2025-11-11 12:52:02] Tidak ada remote expired.
|
||||
|
||||
@@ -1 +1 @@
|
||||
[2025-11-09 23:50:02] 0 data telah dihapus. Data tersisa sejak 2025-10-01 00:00:00 sampai sekarang.
|
||||
[2025-11-10 23:50:02] 0 data telah dihapus. Data tersisa sejak 2025-10-01 00:00:00 sampai sekarang.
|
||||
|
||||
@@ -11,84 +11,195 @@ date_default_timezone_set('Asia/Jakarta');
|
||||
require "/www/wwwroot/bilspro/config/connect.php";
|
||||
require "/www/wwwroot/bilspro/payment/flip/Flip/Transaction.php";
|
||||
|
||||
// try {
|
||||
// // Ambil maksimum 5 data agar ringan
|
||||
// $sql = "
|
||||
// SELECT
|
||||
// a.id,
|
||||
// a.transaction_id,
|
||||
// b.apikey_payment_gateway,
|
||||
// b.url_payment_gateway
|
||||
// FROM
|
||||
// tagihan a
|
||||
// LEFT JOIN
|
||||
// data_server b ON a.id_data_server = b.id
|
||||
// WHERE
|
||||
// a.status = 'lewat'
|
||||
// AND a.transaction_id != ''
|
||||
// AND a.transaction_status = 'ACTIVE'
|
||||
// AND b.payment_gateway = 'flip'
|
||||
// AND b.status_payment_gateway = 'ACTIVE'
|
||||
// AND (
|
||||
// YEAR(a.limit_pembayaran) < YEAR(NOW())
|
||||
// OR (
|
||||
// YEAR(a.limit_pembayaran) = YEAR(NOW())
|
||||
// AND MONTH(a.limit_pembayaran) < MONTH(NOW())
|
||||
// )
|
||||
// )
|
||||
// ORDER BY a.limit_pembayaran ASC
|
||||
// LIMIT 5
|
||||
// ";
|
||||
|
||||
// $stmt = $pdo->prepare($sql);
|
||||
// $stmt->execute();
|
||||
// $data = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
// if (empty($data)) {
|
||||
// exit; // tidak ada data, langsung keluar biar hemat resource
|
||||
// }
|
||||
|
||||
// $logFile = "/www/wwwroot/bilspro/load/cronjob/flip_auto_inactive.log";
|
||||
// if (!file_exists(dirname($logFile))) {
|
||||
// mkdir(dirname($logFile), 0777, true);
|
||||
// }
|
||||
|
||||
// $results = [];
|
||||
|
||||
// foreach ($data as $row) {
|
||||
// try {
|
||||
// $flip = new FlipPaymentGateway($row['apikey_payment_gateway'], $row['url_payment_gateway']);
|
||||
// $response = $flip->getBillStatus($row['transaction_id']);
|
||||
|
||||
// if (!is_array($response) || empty($response['link_id'])) {
|
||||
// $results[] = [
|
||||
// 'id' => $row['id'],
|
||||
// 'transaction_id' => $row['transaction_id'],
|
||||
// 'status' => 'error',
|
||||
// 'message' => 'Invalid or missing response from Flip API'
|
||||
// ];
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// $delete = $flip->editBill(
|
||||
// $response['link_id'],
|
||||
// 'INACTIVE',
|
||||
// $response['title'] ?? '',
|
||||
// $response['amount'] ?? 0
|
||||
// );
|
||||
|
||||
// $results[] = [
|
||||
// 'id' => $row['id'],
|
||||
// 'transaction_id' => $row['transaction_id'],
|
||||
// 'flip_response' => $delete
|
||||
// ];
|
||||
|
||||
// if ($delete) {
|
||||
// $update = $pdo->prepare("UPDATE tagihan SET transaction_status = 'INACTIVE' WHERE id = :id");
|
||||
// $update->execute([':id' => $row['id']]);
|
||||
// }
|
||||
|
||||
// // Delay 1 detik antar request agar tidak membanjiri Flip API
|
||||
// sleep(1);
|
||||
// } catch (Exception $e) {
|
||||
// $results[] = [
|
||||
// 'id' => $row['id'],
|
||||
// 'transaction_id' => $row['transaction_id'],
|
||||
// 'status' => 'error',
|
||||
// 'message' => $e->getMessage()
|
||||
// ];
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Simpan hasil ke log file, bukan echo ke output
|
||||
// file_put_contents(
|
||||
// $logFile,
|
||||
// "[" . date('Y-m-d H:i:s') . "] " . json_encode($results, JSON_UNESCAPED_SLASHES) . PHP_EOL,
|
||||
// FILE_APPEND
|
||||
// );
|
||||
|
||||
// } catch (Throwable $e) {
|
||||
// // Tangkap semua error (PDO/Exception)
|
||||
// file_put_contents(
|
||||
// "/www/wwwroot/bilspro/load/cronjob/flip_auto_inactive_error.log",
|
||||
// "[" . date('Y-m-d H:i:s') . "] ERROR: " . $e->getMessage() . PHP_EOL,
|
||||
// FILE_APPEND
|
||||
// );
|
||||
// }
|
||||
|
||||
try {
|
||||
// Ambil maksimum 5 data agar ringan
|
||||
$sql = "
|
||||
SELECT
|
||||
a.id,
|
||||
a.transaction_id,
|
||||
a.transaction_data,
|
||||
b.apikey_payment_gateway,
|
||||
b.url_payment_gateway
|
||||
FROM
|
||||
tagihan a
|
||||
LEFT JOIN
|
||||
data_server b ON a.id_data_server = b.id
|
||||
data_server b
|
||||
ON a.id_data_server = b.id
|
||||
WHERE
|
||||
a.status = 'lewat'
|
||||
a.status = 'lunas'
|
||||
AND a.transaction_id != ''
|
||||
AND a.transaction_status = 'ACTIVE'
|
||||
AND a.transaction_data != ''
|
||||
AND b.payment_gateway = 'flip'
|
||||
AND b.status_payment_gateway = 'ACTIVE'
|
||||
AND (
|
||||
YEAR(a.limit_pembayaran) < YEAR(NOW())
|
||||
OR (
|
||||
YEAR(a.limit_pembayaran) = YEAR(NOW())
|
||||
AND MONTH(a.limit_pembayaran) < MONTH(NOW())
|
||||
)
|
||||
)
|
||||
ORDER BY a.limit_pembayaran ASC
|
||||
LIMIT 5
|
||||
AND YEAR(a.limit_pembayaran) = YEAR(NOW())
|
||||
AND MONTH(a.limit_pembayaran) = MONTH(NOW())
|
||||
ORDER BY a.id ASC
|
||||
LIMIT 15
|
||||
";
|
||||
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute();
|
||||
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if (empty($data)) {
|
||||
exit; // tidak ada data, langsung keluar biar hemat resource
|
||||
}
|
||||
if (empty($data)) exit;
|
||||
|
||||
$logFile = "/www/wwwroot/bilspro/load/cronjob/flip_auto_inactive.log";
|
||||
if (!file_exists(dirname($logFile))) {
|
||||
mkdir(dirname($logFile), 0777, true);
|
||||
}
|
||||
if (!file_exists(dirname($logFile))) mkdir(dirname($logFile), 0777, true);
|
||||
|
||||
$results = [];
|
||||
$no = 1;
|
||||
|
||||
foreach ($data as $row) {
|
||||
try {
|
||||
$flip = new FlipPaymentGateway($row['apikey_payment_gateway'], $row['url_payment_gateway']);
|
||||
$response = $flip->getBillStatus($row['transaction_id']);
|
||||
$data2 = json_decode($row['transaction_data'], true);
|
||||
|
||||
if (!is_array($response) || empty($response['link_id'])) {
|
||||
if (json_last_error() !== JSON_ERROR_NONE || empty($data2)) {
|
||||
$results[] = [
|
||||
'nomor' => $no++,
|
||||
'id' => $row['id'],
|
||||
'transaction_id' => $row['transaction_id'],
|
||||
'status' => 'error',
|
||||
'message' => 'Invalid or missing response from Flip API'
|
||||
'title' => '(invalid JSON)',
|
||||
'error' => 'transaction_data tidak valid'
|
||||
];
|
||||
continue;
|
||||
}
|
||||
|
||||
$delete = $flip->editBill(
|
||||
$response['link_id'],
|
||||
'INACTIVE',
|
||||
$response['title'] ?? '',
|
||||
$response['amount'] ?? 0
|
||||
);
|
||||
if (empty($data2['link_id'])) {
|
||||
$results[] = [
|
||||
'nomor' => $no++,
|
||||
'id' => $row['id'],
|
||||
'transaction_id' => $row['transaction_id'],
|
||||
'status' => 'error',
|
||||
'message' => 'link_id kosong di transaction_data'
|
||||
];
|
||||
continue;
|
||||
}
|
||||
|
||||
$results[] = [
|
||||
'id' => $row['id'],
|
||||
'transaction_id' => $row['transaction_id'],
|
||||
'flip_response' => $delete
|
||||
];
|
||||
$flip = new FlipPaymentGateway($row['apikey_payment_gateway'], $row['url_payment_gateway']);
|
||||
$delete = $flip->editBill(
|
||||
$data2['link_id'],
|
||||
'INACTIVE',
|
||||
$data2['title'] ?? '',
|
||||
$data2['amount'] ?? 0
|
||||
);
|
||||
|
||||
if ($delete) {
|
||||
$update = $pdo->prepare("UPDATE tagihan SET transaction_status = 'INACTIVE' WHERE id = :id");
|
||||
$update->execute([':id' => $row['id']]);
|
||||
}
|
||||
|
||||
// Delay 1 detik antar request agar tidak membanjiri Flip API
|
||||
$results[] = [
|
||||
'nomor' => $no++,
|
||||
'id' => $row['id'],
|
||||
'transaction_id' => $row['transaction_id'],
|
||||
'title' => is_array($delete) ? ($delete['title'] ?? '(tidak ada title)') : '(tidak ada title)'
|
||||
];
|
||||
|
||||
sleep(1);
|
||||
} catch (Exception $e) {
|
||||
$results[] = [
|
||||
@@ -100,18 +211,16 @@ try {
|
||||
}
|
||||
}
|
||||
|
||||
// Simpan hasil ke log file, bukan echo ke output
|
||||
file_put_contents(
|
||||
$logFile,
|
||||
"[" . date('Y-m-d H:i:s') . "] " . json_encode($results, JSON_UNESCAPED_SLASHES) . PHP_EOL,
|
||||
"[" . date('Y-m-d H:i:s') . "] " . json_encode($results, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL,
|
||||
FILE_APPEND
|
||||
);
|
||||
|
||||
} catch (Throwable $e) {
|
||||
// Tangkap semua error (PDO/Exception)
|
||||
file_put_contents(
|
||||
"/www/wwwroot/bilspro/load/cronjob/flip_auto_inactive_error.log",
|
||||
"[" . date('Y-m-d H:i:s') . "] ERROR: " . $e->getMessage() . PHP_EOL,
|
||||
FILE_APPEND
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
2025-11-10 17:30:07 ✅ Summary updated, rows affected: 1784
|
||||
2025-11-11 12:45:05 ✅ Summary updated, rows affected: 1782
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Voucher: PG12HJNHP8KQ<br>Aktif => 2025-11-10 06:54:16<br>Format durasi tidak valid.<br>PHP Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format () in /www/wwwroot/bilspro/load/hotspot_update.php:70
|
||||
Voucher: PG12H7SA4LGC<br>Aktif => 2025-11-11 06:47:30<br>Format durasi tidak valid.<br>PHP Fatal error: Uncaught Exception: DateInterval::__construct(): Unknown or bad format () in /www/wwwroot/bilspro/load/hotspot_update.php:70
|
||||
Stack trace:
|
||||
#0 /www/wwwroot/bilspro/load/hotspot_update.php(70): DateInterval->__construct()
|
||||
#1 {main}
|
||||
|
||||
+15
-15
@@ -1,23 +1,23 @@
|
||||
SV_Cikembar_Utama Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01SV_BojongKerta Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01RO Bima Net Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01SV_Kingnet_Cibadak Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01SV_CC-Net_Cipicung Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01SV_Nusaina_Cibadak Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01SV_Diamond Net Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
2025-11-11 12:25:00SV_BojongKerta Data pelanggan tidak ada
|
||||
2025-11-11 12:25:00RO Bima Net Data pelanggan tidak ada
|
||||
2025-11-11 12:25:00SV_Kingnet_Cibadak Data pelanggan tidak ada
|
||||
2025-11-11 12:25:00SV_CC-Net_Cipicung Data pelanggan tidak ada
|
||||
2025-11-11 12:25:00SV_Nusaina_Cibadak Data pelanggan tidak ada
|
||||
2025-11-11 12:25:00SV_Diamond Net Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
SV_22P Net Cibadak Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01SV_Nettizen_Segaranten Data pelanggan tidak ada
|
||||
2025-11-10 16:42:01SV-DNY-Net-1 Data pelanggan tidak ada
|
||||
2025-11-10 17:22:01SV_NTA_2_PSW_1 Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
2025-11-11 12:25:00SV_Nettizen_Segaranten Data pelanggan tidak ada
|
||||
2025-11-11 11:55:00SV-DNY-Net-1 Data pelanggan tidak ada
|
||||
2025-11-11 12:35:00SV_NTA_2_PSW_1 Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
SV_NTA_1 Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
SV-Cicukang Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
RO-Bumdes-Mekarmanah Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
RO-Pak-Kholiq Data pelanggan tidak ada
|
||||
2025-11-10 17:27:01RO-Dendrit-Net Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
2025-11-11 12:40:00RO-Dendrit-Net Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
LJN.NS.CSR.NET Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
IVVINET-CBD Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01QONNET Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01Mikrotik_X86 Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
2025-11-11 12:25:00QONNET Data pelanggan tidak ada
|
||||
2025-11-11 12:25:00Mikrotik_X86 Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
Mikrotik_BSW_1 Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
Mikrotik_Alea Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
STANG Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
@@ -37,16 +37,16 @@ RO_Wargasari Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
LJN_AGUNG Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
RNET-CMS Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
DCN-GB-CCR Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01412NET Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
2025-11-11 12:25:00412NET Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
brf Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
BMSNET Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
purabaya Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
DCN-CO-GX4 Data pelanggan tidak ada
|
||||
2025-11-10 17:12:01MIKROTIK GX4 Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
2025-11-11 12:25:00MIKROTIK GX4 Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
RO - Netborhood Wifi Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
Neglasari Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
SV-DNY-Net-2 Data pelanggan tidak ada
|
||||
2025-11-10 17:22:01DNY-Neglasari Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
2025-11-11 12:35:00DNY-Neglasari Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
RO_TTO Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
AP - NET Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
GAS NET Status koneksi tidak aktif atau interval tidak tersedia.
|
||||
|
||||
@@ -3,7 +3,6 @@ Successfully started background process for IP: 103.188.169.123 SV_22P Net Cibad
|
||||
Successfully started background process for IP: tunnel.manjapro.net RO-Bumdes-Mekarmanah
|
||||
Successfully started background process for IP: 103.242.104.69 RO-Dendrit-Net
|
||||
Successfully started background process for IP: 103.26.176.93 LJN.NS.CSR.NET
|
||||
Successfully started background process for IP: tunnel.manjapro.net RO_Asep
|
||||
Successfully started background process for IP: 103.155.199.191 PERWASIM-NETWORK
|
||||
Successfully started background process for IP: tunnel.manjapro.net SV_NTA_2_PSW_1
|
||||
Successfully started background process for IP: tunnel.manjapro.net SV-Cicukang
|
||||
@@ -18,4 +17,4 @@ Successfully started background process for IP: tunnel.manjapro.net SV_Diamond N
|
||||
Successfully started background process for IP: tunnel.manjapro.net RO_Wargasari
|
||||
Successfully started background process for IP: tunnel.manjapro.net RO_Sukasari
|
||||
Successfully started background process for IP: tunnel.manjapro.net GAS NET
|
||||
Started parallel processes for checking vouchers. => 2025-11-10 17:30:02
|
||||
Started parallel processes for checking vouchers. => 2025-11-11 12:30:02
|
||||
+40243
-19500
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
||||
Tidak perlu update untuk ID: 2 Rp.200,000<br>Harga khusus untuk ID: 3 Rp.250,000<br>Tidak perlu update untuk ID: 4 Rp.300,000<br>Tidak perlu update untuk ID: 5 Rp.300,000<br>Tidak perlu update untuk ID: 6 Rp.200,000<br>Harga khusus untuk ID: 7 Rp.200,000<br>Tidak perlu update untuk ID: 8 Rp.200,000<br>Tidak perlu update untuk ID: 9 Rp.200,000<br>Tidak perlu update untuk ID: 10 Rp.200,000<br>Tidak perlu update untuk ID: 12 Rp.750,000<br>Tidak perlu update untuk ID: 13 Rp.750,000<br>Tidak perlu update untuk ID: 14 Rp.450,000<br>Tidak perlu update untuk ID: 15 Rp.450,000<br>Tidak perlu update untuk ID: 16 Rp.300,000<br>Harga khusus untuk ID: 17 Rp.300,000<br>Tidak perlu update untuk ID: 18 Rp.300,000<br>Tidak perlu update untuk ID: 19 Rp.450,000<br>Tidak perlu update untuk ID: 20 Rp.200,000<br>Tidak perlu update untuk ID: 21 Rp.300,000<br>Tidak perlu update untuk ID: 22 Rp.300,000<br>Tidak perlu update untuk ID: 23 Rp.450,000<br>Tidak perlu update untuk ID: 24 Rp.200,000<br>Tidak perlu update untuk ID: 25 Rp.250,000<br>Tidak perlu update untuk ID: 26 Rp.200,000<br>Tidak perlu update untuk ID: 28 Rp.200,000<br>Tidak perlu update untuk ID: 29 Rp.300,000<br>Tidak perlu update untuk ID: 30 Rp.200,000<br>Tidak perlu update untuk ID: 31 Rp.300,000<br>Tidak perlu update untuk ID: 32 Rp.200,000<br>Tidak perlu update untuk ID: 33 Rp.200,000<br>Tidak perlu update untuk ID: 34 Rp.200,000<br>Tidak perlu update untuk ID: 35 Rp.200,000<br>Tidak perlu update untuk ID: 36 Rp.200,000<br>Tidak perlu update untuk ID: 37 Rp.300,000<br>Tidak perlu update untuk ID: 38 Rp.200,000<br>Tidak perlu update untuk ID: 39 Rp.200,000<br>Harga khusus untuk ID: 40 Rp.1,000,000<br>Tidak perlu update untuk ID: 41 Rp.200,000<br>Harga harus diupdate untuk ID Data Server: 42 Rp.300,000<br>Harga khusus untuk ID: 43 Rp.100,000<br>Tidak perlu update untuk ID: 44 Rp.200,000<br>Tidak perlu update untuk ID: 45 Rp.300,000<br>Tidak perlu update untuk ID: 46 Rp.200,000<br>Tidak perlu update untuk ID: 47 Rp.200,000<br>Tidak perlu update untuk ID: 48 Rp.200,000<br>Tidak perlu update untuk ID: 49 Rp.200,000<br>Tidak perlu update untuk ID: 50 Rp.200,000<br>Tidak perlu update untuk ID: 51 Rp.200,000<br>Tidak perlu update untuk ID: 52 Rp.1,000,000<br>Tidak perlu update untuk ID: 53 Rp.200,000<br>Tidak perlu update untuk ID: 54 Rp.200,000<br>Tidak perlu update untuk ID: 55 Rp.200,000<br>Tidak perlu update untuk ID: 56 Rp.200,000<br>Tidak perlu update untuk ID: 57 Rp.200,000<br>Tidak perlu update untuk ID: 58 Rp.200,000<br>Tidak perlu update untuk ID: 59 Rp.200,000<br>Tidak perlu update untuk ID: 60 Rp.200,000<br>Tidak perlu update untuk ID: 61 Rp.300,000<br>Tidak perlu update untuk ID: 62 Rp.200,000<br>Tidak perlu update untuk ID: 63 Rp.200,000<br>Tidak perlu update untuk ID: 64 Rp.200,000<br>Tidak perlu update untuk ID: 65 Rp.200,000<br>Tidak perlu update untuk ID: 66 Rp.200,000<br>Tidak perlu update untuk ID: 67 Rp.200,000<br>Harga khusus untuk ID: 68 Rp.200,000<br>Harga khusus untuk ID: 69 Rp.200,000<br>Tidak perlu update untuk ID: 70 Rp.200,000<br>Tidak perlu update untuk ID: 71 Rp.200,000<br>Tidak perlu update untuk ID: 72 Rp.200,000<br>Tidak perlu update untuk ID: 73 Rp.200,000<br>Harga khusus untuk ID: 74 Rp.0<br>Harga khusus untuk ID: 75 Rp.0<br>Tidak perlu update untuk ID: 76 Rp.200,000<br>Tidak perlu update untuk ID: 77 Rp.200,000<br>Harga khusus untuk ID: 78 Rp.200,000<br>Harga khusus untuk ID: 79 Rp.200,000<br>Harga khusus untuk ID: 80 Rp.200,000<br>Harga khusus untuk ID: 81 Rp.300,000<br>
|
||||
Tidak perlu update untuk ID: 2 Rp.200,000<br>Harga khusus untuk ID: 3 Rp.250,000<br>Tidak perlu update untuk ID: 4 Rp.300,000<br>Tidak perlu update untuk ID: 5 Rp.300,000<br>Tidak perlu update untuk ID: 6 Rp.200,000<br>Harga khusus untuk ID: 7 Rp.200,000<br>Tidak perlu update untuk ID: 8 Rp.200,000<br>Tidak perlu update untuk ID: 9 Rp.200,000<br>Tidak perlu update untuk ID: 10 Rp.200,000<br>Tidak perlu update untuk ID: 12 Rp.750,000<br>Tidak perlu update untuk ID: 13 Rp.750,000<br>Tidak perlu update untuk ID: 14 Rp.450,000<br>Tidak perlu update untuk ID: 15 Rp.450,000<br>Tidak perlu update untuk ID: 16 Rp.300,000<br>Harga khusus untuk ID: 17 Rp.300,000<br>Tidak perlu update untuk ID: 18 Rp.300,000<br>Tidak perlu update untuk ID: 19 Rp.450,000<br>Tidak perlu update untuk ID: 20 Rp.200,000<br>Tidak perlu update untuk ID: 21 Rp.300,000<br>Tidak perlu update untuk ID: 22 Rp.300,000<br>Tidak perlu update untuk ID: 23 Rp.450,000<br>Tidak perlu update untuk ID: 24 Rp.200,000<br>Tidak perlu update untuk ID: 25 Rp.250,000<br>Tidak perlu update untuk ID: 26 Rp.200,000<br>Tidak perlu update untuk ID: 28 Rp.200,000<br>Tidak perlu update untuk ID: 29 Rp.300,000<br>Tidak perlu update untuk ID: 30 Rp.200,000<br>Tidak perlu update untuk ID: 31 Rp.300,000<br>Tidak perlu update untuk ID: 32 Rp.200,000<br>Tidak perlu update untuk ID: 33 Rp.200,000<br>Tidak perlu update untuk ID: 34 Rp.200,000<br>Tidak perlu update untuk ID: 35 Rp.200,000<br>Tidak perlu update untuk ID: 36 Rp.200,000<br>Tidak perlu update untuk ID: 37 Rp.300,000<br>Tidak perlu update untuk ID: 38 Rp.200,000<br>Tidak perlu update untuk ID: 39 Rp.200,000<br>Harga khusus untuk ID: 40 Rp.1,000,000<br>Tidak perlu update untuk ID: 41 Rp.200,000<br>Tidak perlu update untuk ID: 42 Rp.300,000<br>Harga khusus untuk ID: 43 Rp.100,000<br>Tidak perlu update untuk ID: 44 Rp.200,000<br>Tidak perlu update untuk ID: 45 Rp.300,000<br>Tidak perlu update untuk ID: 46 Rp.200,000<br>Tidak perlu update untuk ID: 47 Rp.200,000<br>Tidak perlu update untuk ID: 48 Rp.200,000<br>Tidak perlu update untuk ID: 49 Rp.200,000<br>Tidak perlu update untuk ID: 50 Rp.200,000<br>Tidak perlu update untuk ID: 51 Rp.200,000<br>Tidak perlu update untuk ID: 52 Rp.1,000,000<br>Tidak perlu update untuk ID: 53 Rp.200,000<br>Tidak perlu update untuk ID: 54 Rp.200,000<br>Tidak perlu update untuk ID: 55 Rp.200,000<br>Tidak perlu update untuk ID: 56 Rp.200,000<br>Tidak perlu update untuk ID: 57 Rp.200,000<br>Tidak perlu update untuk ID: 58 Rp.200,000<br>Tidak perlu update untuk ID: 59 Rp.200,000<br>Tidak perlu update untuk ID: 60 Rp.200,000<br>Tidak perlu update untuk ID: 61 Rp.300,000<br>Tidak perlu update untuk ID: 62 Rp.200,000<br>Tidak perlu update untuk ID: 63 Rp.200,000<br>Tidak perlu update untuk ID: 64 Rp.200,000<br>Tidak perlu update untuk ID: 65 Rp.200,000<br>Tidak perlu update untuk ID: 66 Rp.200,000<br>Tidak perlu update untuk ID: 67 Rp.200,000<br>Harga khusus untuk ID: 68 Rp.200,000<br>Harga khusus untuk ID: 69 Rp.200,000<br>Tidak perlu update untuk ID: 70 Rp.200,000<br>Tidak perlu update untuk ID: 71 Rp.200,000<br>Tidak perlu update untuk ID: 72 Rp.200,000<br>Tidak perlu update untuk ID: 73 Rp.200,000<br>Harga khusus untuk ID: 74 Rp.0<br>Harga khusus untuk ID: 75 Rp.0<br>Tidak perlu update untuk ID: 76 Rp.200,000<br>Tidak perlu update untuk ID: 77 Rp.200,000<br>Harga khusus untuk ID: 78 Rp.200,000<br>Harga khusus untuk ID: 79 Rp.200,000<br>Harga khusus untuk ID: 80 Rp.200,000<br>Harga khusus untuk ID: 81 Rp.300,000<br>
|
||||
@@ -361,11 +361,13 @@ $datakonpensasi = ($data[0]['konpensasi'] == 0) ? $data[0]['jumlah_konpensasi']
|
||||
&& !empty($data[0]['transaction_id'])) {
|
||||
|
||||
require 'payment/flip/Flip/Transaction.php';
|
||||
$dataFlip = json_decode($data[0]['transaction_data'],true);
|
||||
$titleDis = $dataFlip['title'];
|
||||
$amountDis = $dataFlip['amount'];
|
||||
|
||||
$flip = new FlipPaymentGateway($paygw['apikey_payment_gateway'], $paygw['url_payment_gateway']);
|
||||
$response = $flip->editBill($data[0]['transaction_id'], 'INACTIVE', $data[0]['keterangan'], $data[0]['verifikasi_tagihan']);
|
||||
$response = $flip->editBill($data[0]['transaction_id'], 'INACTIVE', $titleDis, $amountDis);
|
||||
}
|
||||
// nanti jangan lupa ubah yang keterangan jadi transaction_title
|
||||
|
||||
|
||||
$nomor = explode(',', $data[0]['nomor_whatsapp']);
|
||||
// Kirim Pesan WhatsApp
|
||||
|
||||
@@ -111,8 +111,11 @@ if (isset($_POST['tambah'])) {
|
||||
$limit_tag = $_POST['tanggal'];
|
||||
$keterangan = "Tagihan Layanan Internet bulan " . formatIndo($limit_tag, 'F Y');
|
||||
|
||||
$keteranganName = ucwords(strtolower(preg_replace('/[^a-zA-Z\s]/', '', $pelanggan['nama'])));
|
||||
$keteranganFlip = "Tagihan bulan " . formatIndo($limit_tag, 'F Y') . " (a.n " . $keteranganName . ")";
|
||||
// $keteranganName = ucwords(strtolower(preg_replace('/[^a-zA-Z\s]/', '', $pelanggan['nama'])));
|
||||
// $keteranganFlip = "Tagihan bulan " . formatIndo($limit_tag, 'F Y') . " (a.n " . $keteranganName . ")";
|
||||
|
||||
$namaclean = ucwords(strtolower(preg_replace('/[^a-zA-Z\s]/', '', $pelanggan['nama'])));
|
||||
$keteranganFlip = "Tagihan " . formatIndo($data['limit_pembayaran'], 'F Y') . ' an ' . $namaclean . ' id ' . $pelanggan['akun'];
|
||||
$status = 'pending';
|
||||
|
||||
// Payment gateway processing
|
||||
@@ -139,8 +142,8 @@ if (isset($_POST['tambah'])) {
|
||||
|
||||
// Insert into the tagihan table
|
||||
$stmt = $pdo->prepare("INSERT INTO tagihan
|
||||
(id_data_server, id_pelanggan, id_profile_paket, id_profile_tagihan, nominal_tagihan, jumlah_tagihan, ppn, total_tagihan, verifikasi_tagihan, keterangan, limit_pembayaran, status, transaction_link, transaction_id, transaction_status, kode_unik)
|
||||
VALUES (:id_data_server, :id_pelanggan, :id_profile_paket, :id_profile_tagihan, :nominal_tagihan, :jumlah_tagihan, :ppn, :total_tagihan, :verifikasi_tagihan, :keterangan, :limit_pembayaran, :status, :transaction_link, :transaction_id, :transaction_status, :kode_unik)");
|
||||
(id_data_server, id_pelanggan, id_profile_paket, id_profile_tagihan, nominal_tagihan, jumlah_tagihan, ppn, total_tagihan, verifikasi_tagihan, keterangan, limit_pembayaran, status, transaction_link, transaction_id, transaction_status, transaction_data, kode_unik)
|
||||
VALUES (:id_data_server, :id_pelanggan, :id_profile_paket, :id_profile_tagihan, :nominal_tagihan, :jumlah_tagihan, :ppn, :total_tagihan, :verifikasi_tagihan, :keterangan, :limit_pembayaran, :status, :transaction_link, :transaction_id, :transaction_status, :transaction_data, :kode_unik)");
|
||||
|
||||
$stmt->execute([
|
||||
':id_data_server' => $pelanggan['id_data_server'],
|
||||
@@ -158,6 +161,7 @@ if (isset($_POST['tambah'])) {
|
||||
':transaction_link' => $transaction_link,
|
||||
':transaction_id' => $transaction_id,
|
||||
':transaction_status' => $transaction_status,
|
||||
':transaction_data' => json_encode($response),
|
||||
':kode_unik' => $kode_unik,
|
||||
]);
|
||||
|
||||
|
||||
@@ -189,9 +189,15 @@ $paygw = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if ($paygw['payment_gateway'] == 'flip' && !empty($paygw['apikey_payment_gateway']) && $paygw['status_payment_gateway'] === 'ACTIVE') {
|
||||
require 'payment/flip/Flip/Transaction.php';
|
||||
$flip = new FlipPaymentGateway($paygw['apikey_payment_gateway'], $paygw['url_payment_gateway']);
|
||||
|
||||
$namaclean = ucwords(strtolower(preg_replace('/[^a-zA-Z\s]/', '', $data[0]['nama'])));
|
||||
$keteranganFlip = "Tagihan " . formatIndo($data[0]['limit_pembayaran'], 'F Y') . ' an ' . $namaclean . ' id ' . $data[0]['akun'];
|
||||
|
||||
// $transaction_data = json_decode($data[0]['transaction_data'], true);
|
||||
// $keteranganFlip = $transaction_data['title'];
|
||||
|
||||
$response = $flip->createBill(
|
||||
$data[0]['keterangan'] ?? '',
|
||||
$keteranganFlip ?? '',
|
||||
$data[0]['verifikasi_tagihan'] ?? '',
|
||||
$data[0]['email'] ?? '',
|
||||
$data[0]['nama'] ?? '',
|
||||
@@ -207,11 +213,13 @@ $paygw = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$stmt = $pdo->prepare("UPDATE tagihan
|
||||
SET transaction_id = :transaction_id,
|
||||
transaction_link = :transaction_link,
|
||||
transaction_status = :transaction_status
|
||||
transaction_status = :transaction_status,
|
||||
transaction_data = :transaction_data
|
||||
WHERE id = :idtag");
|
||||
$stmt->bindParam(':transaction_id', $transaction_id);
|
||||
$stmt->bindParam(':transaction_link', $transaction_link);
|
||||
$stmt->bindParam(':transaction_status', $transaction_status);
|
||||
$stmt->bindParam(':transaction_data', json_encode($response));
|
||||
$stmt->bindParam(':idtag', $page[1]);
|
||||
$stmt->execute();
|
||||
|
||||
@@ -318,15 +326,18 @@ $paygw = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$apiUrl = $paygw[0]['url_payment_gateway'];
|
||||
$transactionId = $data[0]['transaction_id'];
|
||||
$status = $data[0]['transaction_status'];
|
||||
$title = $data[0]['keterangan'];
|
||||
|
||||
$namaclean = ucwords(strtolower(preg_replace('/[^a-zA-Z\s]/', '', $data[0]['nama'])));
|
||||
$keteranganFlip = "Tagihan " . formatIndo($data[0]['limit_pembayaran'], 'F Y') . ' an ' . $namaclean . ' id ' . $data[0]['akun'];
|
||||
// $title = $data[0]['keterangan'];
|
||||
$amount = $verifikasi_tagihan;
|
||||
// echo $apiUrl;
|
||||
//Buat Fungsion Flip Payment Gateway
|
||||
$flip = new FlipPaymentGateway($apiKey,$apiUrl);
|
||||
if ($status == 'ACTIVE') {
|
||||
$response = $flip->editBill($transactionId,$status,$title, $amount);
|
||||
$response = $flip->editBill($transactionId,$status,$keteranganFlip, $amount);
|
||||
} else {
|
||||
$response = $flip->createBill($title, $amount, $data[0]['email'], $data[0]['nama'], $data[0]['nomor_whatsapp'], $data[0]['alamat']);
|
||||
$response = $flip->createBill($keteranganFlip, $amount, $data[0]['email'], $data[0]['nama'], $data[0]['nomor_whatsapp'], $data[0]['alamat']);
|
||||
}
|
||||
// echo $verifikasi_tagihan;
|
||||
// print_r($response);
|
||||
@@ -345,7 +356,7 @@ $paygw = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$transaction_status = NULL;
|
||||
}
|
||||
|
||||
$stmt = $pdo->prepare("UPDATE tagihan SET konpensasi = :konpensasi, jumlah_konpensasi = :jumlahkon, jumlah_tagihan = :jumlah_tagihan, ppn = :ppn, total_tagihan = :total_tagihan, verifikasi_tagihan = :verifikasi_tagihan, transaction_id = :transaction_id, transaction_link = :transaction_link, transaction_status = :transaction_status, kode_unik = :kode_unik WHERE id = :idtag");
|
||||
$stmt = $pdo->prepare("UPDATE tagihan SET konpensasi = :konpensasi, jumlah_konpensasi = :jumlahkon, jumlah_tagihan = :jumlah_tagihan, ppn = :ppn, total_tagihan = :total_tagihan, verifikasi_tagihan = :verifikasi_tagihan, transaction_id = :transaction_id, transaction_link = :transaction_link, transaction_status = :transaction_status, transaction_data = :transaction_data, kode_unik = :kode_unik WHERE id = :idtag");
|
||||
$stmt->bindParam(':jumlahkon', $jumlahkon);
|
||||
$stmt->bindParam(':jumlah_tagihan', $jumlah_tagihan);
|
||||
$stmt->bindParam(':ppn', $ppn_amount);
|
||||
@@ -355,6 +366,7 @@ $paygw = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$stmt->bindParam(':transaction_id', $transaction_id);
|
||||
$stmt->bindParam(':transaction_link', $transaction_link);
|
||||
$stmt->bindParam(':transaction_status', $transaction_status);
|
||||
$stmt->bindParam(':transaction_data', json_encode($response));
|
||||
$stmt->bindParam(':kode_unik', $kode_unik);
|
||||
$stmt->bindParam(':idtag', $page[1]);
|
||||
$stmt->execute();
|
||||
|
||||
@@ -85,7 +85,7 @@ try {
|
||||
|
||||
// Cek tagihan
|
||||
$query = "
|
||||
SELECT transaction_id, keterangan, verifikasi_tagihan, id_data_server
|
||||
SELECT transaction_id, transaction_data, keterangan, verifikasi_tagihan, id_data_server
|
||||
FROM tagihan
|
||||
WHERE id_data_server IN ($idsServer) AND transaction_id = :bill_link_id
|
||||
";
|
||||
@@ -108,11 +108,15 @@ try {
|
||||
$stmt->bindParam(':status', $status, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':tanggal_bayar', $waktu, PDO::PARAM_STR);
|
||||
$stmt->execute();
|
||||
|
||||
$dataFlip = json_decode($cek_tagihan['transaction_data'],true);
|
||||
$titleDis = $dataFlip['title'];
|
||||
$amountDis = $dataFlip['amount'];
|
||||
|
||||
// Matikan link payment gateway
|
||||
require '../Flip/Transaction.php';
|
||||
$flip = new FlipPaymentGateway($apiKey, $apiUrl);
|
||||
$response = $flip->editBill($bill_link_id, 'INACTIVE', $cek_tagihan['keterangan'], $cek_tagihan['verifikasi_tagihan']);
|
||||
$response = $flip->editBill($bill_link_id, 'INACTIVE', $titleDis, $amountDis);
|
||||
|
||||
} else {
|
||||
http_response_code(200); // OK
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user