public function deleteMarker($marker_id, $pages_too = false) { $this->db->where('id', $marker_id); $success = $this->db->delete('marker'); $data = array('marker_id' => null); $this->db->where('marker_id', $marker_id); $success = $this->db->update('book_page', $data); if ($pages_too === true) { $start = $this->startPage; $end = $this->endPage; if ($start && $end) { $sql = 'DELETE FROM grlx_book_page WHERE sort_order >= ' . $start . ' AND sort_order <= ' . $end; $result2 = $this->db->rawQuery($sql, null); $success = reset_page_order(1, $this->db); } } return $result1[0]; }
function delete_comic_page($comic_page_id, $db) { // Delete the images (MATCHES and REFERENCES). delete_comic_images($comic_page_id, $db); // Delete the COMIC PAGE itself. $db->where('id', $comic_page_id); $db->delete('book_page'); // Renumber everything $book_id = get_comic_book_id($db); reset_page_order($book_id, $db); }
} } reset_page_order($book_id, $db); } if ($delete_marker_id) { $doomed_marker = new GrlxMarker($delete_marker_id); if ($doomed_marker->markerInfo) { $doomed_marker->deleteMarker($delete_marker_id, false); } } if ($delete_page_id) { $doomed_page = new GrlxComicPage($delete_page_id); if ($doomed_page->pageInfo) { $doomed_page->deletePage($delete_page_id, true); } reset_page_order($book_id, $db); } /***** * Display logic */ ///// Get the book info if ($book_id) { $book = new GrlxComicBook($book_id); } else { $book = new GrlxComicBook(); $book_id = $book->bookID; } if ($book) { $book->getPages(); $book->getMarkers(); $total_pages = count($book->pageList);