request->getVar('keywords'); $total = $m_akun->total_cari($keywords); $title = 'Hasil pencarian: '.$_GET['keywords'].' - '.$total.' ditemukan'; $page = (int) ($this->request->getGet('page') ?? 1); $perPage = $this->website->paginasi(); $total = $total; $pager_links = $pager->makeLinks($page, $perPage, $total,'bootstrap_pagination'); $page = ($this->request->getGet('page'))?($this->request->getGet('page')-1)*$perPage:0; $akun = $m_akun->paginasi_admin_cari($keywords,$perPage, $page); }else{ $total = $m_akun->total(); $title = 'Data Akun Pendaftar ('.$total.')'; $page = (int) ($this->request->getGet('page') ?? 1); $perPage = $this->website->paginasi(); $total = $total; $pager_links = $pager->makeLinks($page, $perPage, $total,'bootstrap_pagination'); $page = ($this->request->getGet('page'))?($this->request->getGet('page')-1)*$perPage:0; $akun = $m_akun->paginasi_admin($perPage, $page); } // end akun $data = [ 'title' => $title, 'akun' => $akun, 'pagination' => $pager_links, 'content' => 'admin/akun_pendaftar/index' ]; return view('admin/layout/wrapper',$data); } public function delete($id) { // Memuat model Akun_model $m_akun = new Akun_model(); // Cek apakah akun ada $akun = $m_akun->find($id); if ($akun) { // Hapus akun berdasarkan ID $m_akun->delete($id); // Redirect dengan pesan sukses return redirect()->to('/admin/akun_pendaftar')->with('success', 'Akun berhasil dihapus'); } else { // Jika akun tidak ditemukan return redirect()->to('/admin/akun_pendaftar')->with('error', 'Akun tidak ditemukan'); } } }