Initial commit with updated Auth and media ignored
This commit is contained in:
35
driver_assurance/add.php
Executable file
35
driver_assurance/add.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/../connect.php';
|
||||
|
||||
// Get the values from the request
|
||||
$driver_id = filterRequest("driver_id");
|
||||
$assured = filterRequest("assured"); // إذا كانت قيمة حساسة يجب تشفيرها
|
||||
$health_insurance_provider = filterRequest("health_insurance_provider"); // إذا كانت حساسة، شفرها
|
||||
|
||||
// إذا تحتاج تشفير، فعّل التالي:
|
||||
// $assured = $encryptionHelper->encryptData($assured);
|
||||
// $health_insurance_provider = $encryptionHelper->encryptData($health_insurance_provider);
|
||||
|
||||
// SQL using bind parameters
|
||||
$sql = "INSERT INTO `driver_health_assurance` (
|
||||
`driver_id`,
|
||||
`assured`,
|
||||
`health_insurance_provider`
|
||||
) VALUES (
|
||||
:driver_id,
|
||||
:assured,
|
||||
:health_insurance_provider
|
||||
)";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':driver_id', $driver_id);
|
||||
$stmt->bindParam(':assured', $assured);
|
||||
$stmt->bindParam(':health_insurance_provider', $health_insurance_provider);
|
||||
|
||||
if ($stmt->execute()) {
|
||||
jsonSuccess(null, "Health assurance data saved successfully");
|
||||
} else {
|
||||
jsonError("Failed to save health assurance data");
|
||||
}
|
||||
?>
|
||||
0
driver_assurance/get.php
Executable file
0
driver_assurance/get.php
Executable file
0
driver_assurance/update.php
Executable file
0
driver_assurance/update.php
Executable file
Reference in New Issue
Block a user