![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/.cursor-server/data/User/History/-6f1a51dd/ |
<?php
// Debug playlist AJAX - no authentication required
header('Content-Type: application/json');
// Simulate the admin AJAX handling
if (isset($_POST['playlist_action'])) {
$response = ['success' => false, 'error' => 'Unknown action'];
try {
switch ($_POST['playlist_action']) {
case 'toggle_featured':
$track_id = intval($_POST['track_id']);
$is_featured = isset($_POST['is_featured']) && $_POST['is_featured'] == '1' ? 1 : 0;
$response = [
'success' => true,
'message' => 'Featured status updated',
'track_id' => $track_id,
'is_featured' => $is_featured
];
break;
case 'toggle_vip':
$track_id = intval($_POST['track_id']);
$is_vip = isset($_POST['is_vip']) && $_POST['is_vip'] == '1' ? 1 : 0;
$response = [
'success' => true,
'message' => 'VIP status updated',
'track_id' => $track_id,
'is_vip' => $is_vip
];
break;
case 'update_order':
$track_id = intval($_POST['track_id']);
$order = intval($_POST['order']);
if ($order < 0 || $order > 999) {
$response = ['success' => false, 'error' => 'Invalid order value'];
break;
}
$response = [
'success' => true,
'message' => 'Order updated',
'track_id' => $track_id,
'order' => $order
];
break;
default:
$response = ['success' => false, 'error' => 'Invalid action: ' . $_POST['playlist_action']];
}
} catch (Exception $e) {
$response = ['success' => false, 'error' => 'Error: ' . $e->getMessage()];
}
echo json_encode($response);
} else {
echo json_encode([
'success' => false,
'error' => 'No playlist_action provided',
'post_data' => $_POST
]);
}
?>