first commit

This commit is contained in:
Hamza-Ayed
2026-06-09 08:40:31 +03:00
commit d8901e1a87
3161 changed files with 536187 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
require_once __DIR__ . '/../../connect.php';
$name = filterRequest("name");
$email = filterRequest("email");
$phone = filterRequest("phone");
$userId = filterRequest("userId");
$userType = filterRequest("userType");
$rating = filterRequest("rating");
$comment = filterRequest("comment");
$email = $encryptionHelper->encryptData($email);
$phone = $encryptionHelper->encryptData($phone);
// Insert into `ratingApp` table
$sql = "INSERT INTO `ratingApp`(`id`, `name`, `email`, `phone`, `userId`, `userType`, `rating`, `comment`)
VALUES (null, :name, :email, :phone, :userId, :userType, :rating, :comment)";
$stmt = $con->prepare($sql);
$stmt->bindParam(':name', $name);
$stmt->bindParam(':email', $email);
$stmt->bindParam(':phone', $phone);
$stmt->bindParam(':userId', $userId);
$stmt->bindParam(':userType', $userType);
$stmt->bindParam(':rating', $rating);
$stmt->bindParam(':comment', $comment);
$stmt->execute();
if ($stmt->rowCount() > 0) {
jsonSuccess($message = 'Rating inserted successfully');
} else {
jsonError($message = "Failed to save rating information");
}
?>