예제 #1
0
/**
 * Update a shift.
 */
function Shift_update($shift)
{
    global $user;
    $shift['name'] = ShiftType($shift['shifttype_id'])['name'];
    mail_shift_change(Shift($shift['SID']), $shift);
    return sql_query("UPDATE `Shifts` SET\n      `shifttype_id`='" . sql_escape($shift['shifttype_id']) . "',\n      `start`='" . sql_escape($shift['start']) . "',\n      `end`='" . sql_escape($shift['end']) . "',\n      `RID`='" . sql_escape($shift['RID']) . "',\n      `title`=" . sql_null($shift['title']) . ",\n      `URL`=" . sql_null($shift['URL']) . ",\n      `PSID`=" . sql_null($shift['PSID']) . ",\n      `edited_by_user_id`='" . sql_escape($user['UID']) . "',\n      `edited_at_timestamp`=" . time() . "\n      WHERE `SID`='" . sql_escape($shift['SID']) . "'");
}
예제 #2
0
/**
 * Update a shift.
 */
function Shift_update($shift)
{
    $shift['name'] = ShiftType($shift['shifttype_id'])['name'];
    mail_shift_change(Shift($shift['SID']), $shift);
    return sql_query("UPDATE `Shifts` SET\n      `shifttype_id`='" . sql_escape($shift['shifttype_id']) . "',\n      `start`='" . sql_escape($shift['start']) . "',\n      `end`='" . sql_escape($shift['end']) . "',\n      `RID`='" . sql_escape($shift['RID']) . "',\n      `title`=" . sql_null($shift['title']) . ",\n      `URL`=" . sql_null($shift['URL']) . ",\n      `PSID`=" . sql_null($shift['PSID']) . "\n      WHERE `SID`='" . sql_escape($shift['SID']) . "'");
}