function updateProjectStatus() { $projectId = intval($_GET['id']); $status = trim(strval($_GET['status'])); if (in_array($status, array('active', 'archived'))) { $updated = updateTableFieldById('projects', 'status', $status, $projectId); if ($updated) { return response('success', $updated); } } response('error', 'Project not updated! Please try again.'); }
function savePosition() { $card = intval($_GET['card']); $status = intval($_GET['status']); // update card try { $updated = updateTableFieldById('cards', 'status_id', $status, $card); if ($updated) { return response('success', $updated); } } catch (Exception $e) { return response('error', $e->getMessage()); } }