X7ROOT File Manager
Current Path:
/home/u126090504/domains/oceanicabeachresort.com/public_html/admin
home
/
u126090504
/
domains
/
oceanicabeachresort.com
/
public_html
/
admin
/
📁
..
📁
assets
📄
banners.php
(9.78 KB)
📄
booking-dashboard.php
(4.93 KB)
📄
booking_status_update.php
(6.14 KB)
📄
booking_view.php
(4.04 KB)
📄
branding_settings.php
(5.93 KB)
📄
change_password.php
(3.01 KB)
📄
contacts.php
(3.83 KB)
📄
dashboard.php
(5.64 KB)
📁
dompdf
📄
downloads.php
(4.91 KB)
📄
forgot_password.php
(5.76 KB)
📄
gallery.php
(3.08 KB)
📁
img
📁
includes
📄
index.php
(82 B)
📁
invoices
📄
login.php
(13.47 KB)
📄
logo.png
(19.29 KB)
📄
logout.php
(102 B)
📄
manage_albums.php
(10.82 KB)
📄
manage_media.php
(11.77 KB)
📄
manage_photos.php
(6.35 KB)
📄
manage_videos.php
(18.38 KB)
📄
new_password.php
(3.9 KB)
📄
notice.php
(15.52 KB)
📄
notice_error.log
(38.45 KB)
📄
notices.php
(8.24 KB)
📄
payments.php
(14.96 KB)
📄
pdf_bill_template.php
(30.69 KB)
📁
phpmailer
📄
popup.php
(14.07 KB)
📄
reset_password.php
(2.27 KB)
📄
secure_session.php
(1000 B)
📄
settings.php
(8.34 KB)
📄
test.php
(239 B)
📄
test_pdf.php
(1.58 KB)
📄
testimonials.php
(15.15 KB)
📁
tmp
📄
update_status.php
(1.66 KB)
📄
upi_settings.php
(1.52 KB)
Editing: update_status.php
<?php // admin/update_status.php declare(strict_types=1); ini_set('display_errors', '0'); error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); session_start(); require_once __DIR__ . '/../config.php'; $conn->set_charset('utf8mb4'); header('Content-Type: application/json'); // ---- Auth guard (match this with your actual login session) ---- if (empty($_SESSION['admin_id'])) { // <-- yahi flag aapke app me present hona chahiye http_response_code(401); echo json_encode(['ok' => false, 'error' => 'Unauthorized']); exit; } // ---- Validate input ---- $id = isset($_POST['id']) ? (int)$_POST['id'] : 0; $status = isset($_POST['status']) ? trim((string)$_POST['status']) : ''; $allowed = ['Pending','Paid','Failed','Cancelled']; if ($id <= 0 || !in_array($status, $allowed, true)) { http_response_code(422); echo json_encode(['ok' => false, 'error' => 'Invalid parameters']); exit; } // (Optional) Prevent no-op updates $stmt = $conn->prepare("SELECT status FROM payments WHERE id = ?"); $stmt->bind_param('i', $id); $stmt->execute(); $cur = $stmt->get_result()->fetch_assoc(); $stmt->close(); if (!$cur) { http_response_code(404); echo json_encode(['ok' => false, 'error' => 'Record not found']); exit; } if ($cur['status'] === $status) { echo json_encode(['ok' => true, 'note' => 'No change']); exit; } // ---- Update (only admin reaches here) ---- $stmt = $conn->prepare("UPDATE payments SET status = ? WHERE id = ?"); $stmt->bind_param('si', $status, $id); $stmt->execute(); $stmt->close(); // (Optional) audit log here echo json_encode(['ok' => true]);
Upload File
Create Folder