Esempio n. 1
0
}
if (isset($_REQUEST['sort'])) {
    $sort = $_REQUEST['sort'];
} else {
    $sort = "id";
}
$aSortBy = array('id' => _AM_XHELP_TEXT_ID, 'description' => _AM_XHELP_TEXT_DESCRIPTION, 'state' => _AM_XHELP_TEXT_STATE);
$aOrderBy = array('ASC' => _AM_XHELP_TEXT_ASCENDING, 'DESC' => _AM_XHELP_TEXT_DESCENDING);
$aLimitBy = array('10' => 10, '15' => 15, '20' => 20, '25' => 25, '50' => 50, '100' => 100);
$op = 'default';
if (isset($_REQUEST['op'])) {
    $op = $_REQUEST['op'];
}
switch ($op) {
    case "deleteStatus":
        deleteStatus();
        break;
    case "editStatus":
        editStatus();
        break;
    case "manageStatus":
        manageStatus();
        break;
    default:
        header("Location: " . XHELP_ADMIN_URL . "/index.php");
        break;
}
function deleteStatus()
{
    if (isset($_GET['statusid'])) {
        $statusid = intval($_GET['statusid']);
Esempio n. 2
0
{
    $s = new Status();
    return $s->getFields();
}
/* </functions> */
$action = Functions::get('action');
Functions::checkRights(__FILE__, $action, Functions::get('token'));
switch ($action) {
    case 'fields_info':
        $data = infoFields();
        break;
    case 'new':
        $data = addStatus();
        break;
    case 'update':
        $data = updateStatus(Functions::get('id'));
        break;
    case 'info':
        $data = infoStatus(Functions::get('id'));
        break;
    case 'delete':
        $data = deleteStatus(Functions::get('id'));
        break;
    case 'list':
        $data = listStatuses();
        break;
    default:
        Functions::setResponse(400);
}
/* </controller> */
loadview('json', $data);