Beispiel #1
0
 public function surah($id_surah, $ayat)
 {
     $QuranModel = new Quran();
     if (strpos($ayat, '-') !== false) {
         $ayatArr = explode('-', $ayat);
         $ayats = $QuranModel->getRangeAyat($id_surah, $ayatArr[0], $id_surah, $ayatArr[1]);
     } else {
         $ayats = $QuranModel->getOneAyat($id_surah, $ayat);
     }
     if ($id_surah == '' || $ayat == '' || empty($ayats)) {
         return redirect('mushaf')->with('messageError', 'Data tidak ada!');
     }
     // name surah
     $surah = $QuranModel->getSurah($id_surah);
     // get surah
     $surahs = $QuranModel->getSurah();
     $data['body_class'] = 'body-mushaf';
     $data['surahs'] = $surahs;
     $data['selected_surah'] = $surah[0]->surah_name;
     $data['ayats'] = $ayats;
     $data['id_surah'] = $id_surah;
     $data['ayat'] = $ayat;
     $data['curr_page'] = $ayats[0]->page;
     $arrAyat = explode('-', $ayat);
     $data['ayat_start'] = !empty($arrAyat[0]) ? $arrAyat[0] : '';
     $data['ayat_end'] = !empty($arrAyat[1]) ? $arrAyat[1] : '';
     $data['cookies'] = getCookie();
     // data header
     $data['header_title'] = 'Surah ' . $surah[0]->surah_name . ' : ' . $ayat;
     $data['header_description'] = $ayats[0]->text_indo;
     $data['bookmarked'] = @$_COOKIE['coo_mushaf_bookmark_url'] == $_SERVER['REQUEST_URI'] ? 'fa-bookmark' : 'fa-bookmark-o';
     return view('mushaf', $data);
 }
Beispiel #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($surah_start = '', $ayat_range = '', $message = '')
 {
     $messageErrors = $ayats = '';
     // get data hafalan
     $QuranModel = new Quran();
     $ayat_start = '';
     $ayat_end = '';
     if (strpos($ayat_range, '-') !== false) {
         $ayatArr = explode('-', $ayat_range);
         $ayats = $QuranModel->getRangeAyat($surah_start, $ayatArr[0], $surah_start, $ayatArr[1]);
         $ayat_start = $ayatArr[0];
         $ayat_end = $ayatArr[1];
     } else {
         $ayats = $QuranModel->getOneAyat($surah_start, $ayat_range);
         $ayat_start = $ayat_range;
     }
     // get surah
     $surahs = $QuranModel->getSurah();
     // data header
     $data['header_title'] = 'Menghafal';
     $data['body_class'] = 'body-memo';
     $data['on_memo'] = true;
     // data header
     if (!empty($ayats)) {
         $data['header_title'] = 'Menghafal Surah ' . $ayats[0]->surah_name . ' : ' . $ayat_range;
         $data['header_description'] = 'Menghafal Surah ' . $ayats[0]->surah_name . ' : ' . $ayat_range . ' ' . $ayats[0]->text_indo;
     }
     //$data['fill_ayat_end'] = $fill_ayat_end;
     $data['ayats'] = $ayats;
     $data['surahs'] = $surahs;
     $data['surah_start'] = $surah_start;
     $data['ayat_start'] = $ayat_start;
     $data['ayat_range'] = $ayat_range;
     //$data['surah_end'] = $surah_end;
     $data['ayat_end'] = $ayat_end;
     $data['curr_page'] = 0;
     return view('memoz', $data);
 }