Exemplo n.º 1
0
$start_year_output = build_select_simple('start_year', $year_list, $date_start[0]);
$frequency_list = array('mwf' => 'Mon-Wed-Fri', 'weekdays' => 'Weekdays', 'saturdays' => 'Saturdays', 'sundays' => 'Sundays', 'mondays' => 'Mondays', 'tuesdays' => 'Tuesdays', 'wednesdays' => 'Wednesdays', 'thursdays' => 'Thursdays', 'fridays' => 'Fridays');
/*****
 * Updates
 */
if ($publish_frequency && $start_month && $start_day && $start_year && $book_id) {
    $date_start = $start_year . '-' . $start_month . '-' . $start_day;
    $data = array('publish_frequency' => $publish_frequency, 'date_start' => $date_start, 'date_modified' => $db->NOW());
    $db->where('id', $book_id);
    $db->update('book', $data);
    $success = $db->count;
    set_book_dates($book_id, $publish_frequency, $db);
}
if ($book && $_POST) {
    $data = array('title' => $new_title, 'publish_frequency' => $publish_frequency, 'date_modified' => $db->NOW());
    $book->saveInfo($data);
    $link->url('book.view.php?book_id=' . $book_id);
    $link->tap('Peruse this book’s pages');
    $alert_output .= $message->success_dialog('Book info saved. ' . $link->paint() . '.');
}
/*****
 * Display
 */
if (!is_writable('../' . DIR_COMICS_IMG)) {
    $alert_output .= $message->alert_dialog('The comics images folder is not writable. Please set ' . DIR_COMICS_IMG . ' to 0777 so I can upload and manage images.');
}
if ($book_id) {
    $book = new GrlxComicBook($book_id);
} else {
    $book = new GrlxComicBook();
    $book_id = $book->bookID;