/** * select juz * */ public function juzPage($juz) { $QuranModel = new Quran(); $pages = $QuranModel->getJuzPage($juz); $page = $pages[0]->page; // get pages mushaf quran $pages = $QuranModel->getPage(); // get mushaf per page $ayats = $QuranModel->getAyat($page); if (empty($ayats)) { return redirect('mushaf'); } // get surah $surahs = $QuranModel->getSurah(); // showing paging if ($page <= 4) { $pages = array_slice($pages, 0, 4); } elseif ($page > 4 && $page <= 592) { $pages = array_slice($pages, $page - 3, 5); } else { $pages = array_slice($pages, $page - 3, 5); } // send to view $data['surahs'] = $surahs; $data['ayats'] = $ayats; $data['pages'] = $pages; $data['curr_page'] = $page; // data header $data['header_title'] = 'Mushaf Hal ' . $page . ', Juz ' . $ayats[0]->juz . ', Surah ' . $ayats[0]->surah_name; $data['body_class'] = 'body-mushaf'; $data['ayat_start'] = ''; $data['ayat_end'] = ''; $data['cookies'] = getCookie(); $data['bookmarked'] = @$_COOKIE['coo_mushaf_bookmark_url'] == $_SERVER['REQUEST_URI'] ? 'fa-bookmark' : 'fa-bookmark-o'; // show view template return view('mushaf', $data); }