feat: Add software licenses management page and update payment handling

- Introduced a new licenses management page with functionality to create, update, and view software licenses.
- Updated payment return handling in softwaretool.php to check payment status from the database and display appropriate modals for success, pending, and failure states.
- Enhanced webhook_mollie.php to log webhook calls, handle payment status updates directly in the database, and generate invoices based on payment status.
- Improved CSS styles for better alignment of buttons and modal components.
- Added JavaScript for modal interactions and bulk license creation functionality.
This commit is contained in:
“VeLiTi”
2025-12-24 14:07:28 +01:00
parent 0f968aac14
commit 543f0b3cac
21 changed files with 1400 additions and 238 deletions

View File

@@ -354,6 +354,42 @@ elseif(isset($post_content['dealer_closeby'])){
echo json_encode(['error' => "Latitude or longitude not provided."]);
}
}
elseif(isset($post_content['action']) && $post_content['action']=='unsubscribe'){
//++++++++++++++++++++++
//Process DEALER UNSUBSCRIBE
//++++++++++++++++++++++
// Check if email is provided
if (isset($post_content['email']) && !empty($post_content['email'])) {
$email = $post_content['email'];
try {
// Update dealer status to 0 (inactive) where email matches
$sql = 'UPDATE dealers SET status = 0 WHERE email = ?';
$stmt = $pdo->prepare($sql);
if ($stmt->execute([$email])) {
// Check if any rows were affected
if ($stmt->rowCount() > 0) {
header('Content-Type: application/json');
echo json_encode(['status' => 'success', 'message' => 'Dealer unsubscribed successfully']);
} else {
header('Content-Type: application/json');
echo json_encode(['status' => 'error', 'message' => 'No dealer found with this email']);
}
} else {
header('Content-Type: application/json');
echo json_encode(['status' => 'error', 'message' => 'Database update failed']);
}
} catch (PDOException $e) {
header('Content-Type: application/json');
echo json_encode(['status' => 'error', 'message' => 'Database error occurred']);
}
} else {
header('Content-Type: application/json');
echo json_encode(['status' => 'error', 'message' => 'Email not provided']);
}
}
else
{
//++++++++++++++++++++++