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:
@@ -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
|
||||
{
|
||||
//++++++++++++++++++++++
|
||||
|
||||
Reference in New Issue
Block a user