First complete upload on nas
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['id_schedule'])) {
|
||||
$idschedule = intval($_POST['id_schedule']);
|
||||
|
||||
// Check if the cart exists
|
||||
if (isset($_SESSION['cart'][$idschedule])) {
|
||||
// Remove the item from the cart
|
||||
unset($_SESSION['cart'][$idschedule]);
|
||||
|
||||
// Return a success response
|
||||
echo json_encode([
|
||||
'status' => 'success',
|
||||
'message' => 'Item removed from your cart successfully!'
|
||||
]);
|
||||
} else {
|
||||
// If the item doesn't exist in the cart
|
||||
echo json_encode([
|
||||
'status' => 'error',
|
||||
'message' => 'Item not found in the cart!'
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
// Invalid request
|
||||
echo json_encode([
|
||||
'status' => 'error',
|
||||
'message' => 'Invalid request!'
|
||||
]);
|
||||
}
|
||||
Reference in New Issue
Block a user