v1 release

This commit is contained in:
2025-03-31 16:37:40 +00:00
parent 41dcd937cd
commit 391f057824
4 changed files with 13 additions and 92 deletions

View File

@@ -11,6 +11,8 @@
position: fixed; position: fixed;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 50px; /* Define the height explicitly */
box-sizing: border-box;
} }
.footer-bar a { .footer-bar a {
@@ -22,9 +24,13 @@
.footer-bar a:hover { .footer-bar a:hover {
text-decoration: underline; text-decoration: underline;
} }
body {
padding-bottom: 50px; /* Add padding equal to the footer height */
box-sizing: border-box;
}
</style> </style>
<div class="footer-bar"> <div class="footer-bar">
<span>Version 1.0.0</span> <span>Swansea Airport PPR system Version 1.0</span>
<a href="changelog.php">View Changelog</a>
</div> </div>

View File

@@ -1,10 +1,11 @@
<?php <?php
// Database connection details // Database connection details
$host = 'sasaprod.pattinson.org'; // Replace with your database host (usually 'localhost') $host = 'sasaprod.pattinson.org';
$username = 'ppruser'; // Replace with your database username $username = 'ppruser';
$password = 'iJ8kN*5[g6P3jaqN'; // Replace with your database password $password = 'iJ8kN*5[g6P3jaqN';
$database = 'pprdevdb'; // Replace with your database name $database = 'pprdevdb';
$created_by = "Website (DEV)";
$mailHost = 'send.one.com'; // Your SMTP server $mailHost = 'send.one.com'; // Your SMTP server
$mailSMTPAuth = true; $mailSMTPAuth = true;

View File

@@ -1,8 +1,6 @@
<?php <?php
include("functions.php"); include("functions.php");
$created_by = "Website (DEV)";
$conn = connectDb(); $conn = connectDb();
// Check if the URL has a 'test' parameter set // Check if the URL has a 'test' parameter set

View File

@@ -1,84 +0,0 @@
<?php
// Basic connection settings
$databaseHost = 'sasaprod.pattinson.org';
$databaseUsername = 'root';
$databasePassword = 'PugPictureMousePen';
$databaseName = 'pprdevdb';
$created_by = "webhook-dev";
//ini_set("error_log", "ppr.log");
error_log("Webhook handler called");
// Connect to the database
$mysqli = mysqli_connect($databaseHost, $databaseUsername, $databasePassword, $databaseName);
header('Content-Type: application/json');
#if($json = json_decode(file_get_contents("php://input"), true)) {
if($json = json_decode(file_get_contents("testhook.json"), true)) {
$data = $json;
}
print_r($data);
$fieldMap = array();
$fieldMap['ac_reg'] = '617dd0cd-2d17-4d7f-826b-5348afdb30b3';
$fieldMap['ac_type'] = '148a55d8-5357-49a3-b9aa-2a5d4dc64173';
$fieldMap['ac_call'] = '52d7bc90-9d26-48a1-82db-b91b4ccd2f92';
$fieldMap['captain'] = '49b2de0d-5bd6-4b0c-86dd-b18b85f8b8ff';
$fieldMap['fuel'] = 'd153c8a5-8345-4e6a-abfd-cf8adcc06f2d';
$fieldMap['in_from'] = '4b4f7ecd-f80c-4e86-a7ab-6fadb3220df8';
$fieldMap['eta'] = 'ca4ac44f-0388-4a70-a072-38276ed2ac13';
$fieldMap['pob_in'] = '6fc47c54-7383-48fd-93fc-d8080f5ed8f5';
$fieldMap['out_to'] = 'ba95fd3f-1ec0-4553-95d3-a0b6a850738d';
$fieldMap['etd'] = '53d60abd-eb75-4b1f-92b6-5d47d26367ec';
$fieldMap['pob_out'] = 'd1ac0860-31f4-4914-9d0b-cae42dfc7eda';
$fieldMap['email'] = '0198c86c-edd1-4aaf-93a1-d68f8fc8c365';
$fieldMap['phone'] = 'e40ebc2d-887b-42b3-931d-c981c76b0c20';
$fieldMap['notes'] = '73d26c2c-1d3d-44e2-82fc-3a1a2600c393';
#print_r($json['data'][$fieldMap['eta']]['value']);
$stmt = mysqli_prepare($mysqli, "INSERT INTO submitted (ac_reg, ac_type, captain, fuel, in_from, eta, pob_in, etd, pob_out, email, phone, notes, created_by) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
// Check if the statement was prepared correctly
if ($stmt === false) {
die('MySQL prepare error: ' . mysqli_error($conn));
}
$ac_reg = $json['data'][$fieldMap['ac_reg']]['value'];
$ac_type = $json['data'][$fieldMap['ac_type']]['value'];
$captain = $json['data'][$fieldMap['captain']]['value'];
$in_from = $json['data'][$fieldMap['in_from']]['value'];
$fuel = $json['data'][$fieldMap['fuel']]['value'];
$date = DateTime::createFromFormat('d/m/Y H:i', $json['data'][$fieldMap['eta']]['value']);
$eta = $date->format('Y-m-d H:i:s');
$pob_in = $json['data'][$fieldMap['pob_in']]['value'];
if (array_key_exists($fieldMap['out_to'], $json['data'])) {
$date = DateTime::createFromFormat('d/m/Y H:i', $json['data'][$fieldMap['etd']]['value']);
$etd = $date->format('Y-m-d H:i:s');
$pob_out = $json['data'][$fieldMap['pob_out']]['value'];
$out_to = $json['data'][$fieldMap['out_to']]['value'];
}
$email = $json['data'][$fieldMap['email']]['value'];
$phone = $json['data'][$fieldMap['phone']]['value'];
$notes = $json['data'][$fieldMap['notes']]['value'];
mysqli_stmt_bind_param($stmt, "ssssssisissss", $ac_reg, $ac_type, $captain, $fuel, $in_from, $eta, $pob_in, $etd, $pob_out, $email, $phone, $notes, $created_by);
// Execute the statement
if (mysqli_stmt_execute($stmt)) {
error_log("Record inserted for " . $ac_reg);
} else {
error_log("Error: " . mysqli_stmt_error($stmt));
}
// Close the statement and connection
mysqli_stmt_close($stmt);
mysqli_close($mysqli);
?>