} } else { if (installerStep() == STEP_PERMISSION) { if (isRedirect()) { redirectSelf(); } $result['page'] = 'Check Permission'; $result['permission'] = permissionProcess(); } else { if (installerStep() === STEP_WRITE) { $result['page'] = 'Write Files'; if (isRedirect()) { redirectSelf(); } $result['config'] = configWrite(); $result['db'] = dbWrite(); if ($result['config'] && $result['db']) { transitionNextStep(); redirectSelf(); } } else { if (installerStep() === STEP_DONE) { $result['page'] = 'Done'; } else { installerStepSet(STEP_PHP_REQUIREMENTS); redirectSelf(); } } } } }
function gigs_saveGig($request) { $gig_id = dbEscape(isset($request['gig_id']) ? $request['gig_id'] : ''); $fields = array(); $gig = $request['data']; foreach (array('title', 'description', 'date', 'start_time', 'end_time', 'meet_time', 'band_start', 'band_end', 'location', 'who', 'contact', 'details', 'tactical', 'musical', 'approved', 'public_description', 'notes', 'colors', 'type', 'url') as $key) { if (isset($gig[$key])) { if (in_array($key, array('start_time', 'end_time', 'meet_time', 'band_start', 'band_end'))) { $gig[$key] = date('H:i', strtotime($gig[$key])); } elseif ($key == 'date') { $date = str_replace('/', '-', $gig[$key]); $date = date_create_from_format('m-d-Y', $date) ?: date_create_from_format('Y-m-d', $date); //$date = date_create_from_format('Y-m-d', $gig[$key]); $gig[$key] = date_format($date, 'Y-m-d'); } array_push($fields, "{$key}='" . dbEscape($gig[$key]) . "'"); } } if (!isset($gig['details'])) { $details = ""; foreach (array('cause', 'event_history', 'arrestable', 'has_permit', 'cops', 'people_of_color', 'relevant_communities', 'blo_role', 'other_groups', 'sound', 'other') as $key) { $details .= strtoupper($key) . ": " . (isset($gig[$key]) ? $gig[$key] : '') . "\n\n"; } array_push($fields, "details='" . dbEscape($details) . "'"); } if (isset($gig['setlist'])) { array_push($fields, "setlist='" . dbEscape(implode(",", $gig['setlist'])) . "'"); } //$title = dbEscape($gig['title']); $new_gig = 0; if ($gig_id) { $res = dbWrite("update gigs set " . implode(",", $fields) . " where gig_id={$gig_id}"); } else { $res = dbwrite("insert into gigs set " . implode(",", $fields)); $new_gig = 1; $gig_id = getInsertId(); $gig['gig_id'] = $gig_id; } $gig = gigs_fetchGig($gig); saveToCalendar($gig); if ($gig['approved'] == 1) { saveToCalendar($gig, 'public'); } elseif ($gig['approved'] == -1) { deleteFromCalendar($gig, 'public'); } if ($new_gig && $gig['type'] == 'gig') { sendEmails($gig); } return $gig; }
function createEmptySlideshow($slideshowId, $slideshowKey) { dbWrite("INSERT INTO slideshows (id, admin_key, src) VALUES ('" . dbEscape($slideshowId) . "', '" . dbEscape($slideshowKey) . "', '');"); }
function createItem($id, $location, $time) { $table = "table"; $fields = "id, file_location, created_at, updated_at"; $values = '"' . $id . '", "' . $location . '", "' . $time . '", "' . $time . '"'; dbWrite($table, $fields, $values); }