load->model('model'); $this->load->library('pdf'); } function index() { if ($this->input->post('proses') == 'cek_foto_detail') { // header('Access-Control-Allow-Origin: *'); $html = ''; foreach (glob('images/kategori/'.$this->input->post('id').'/*.*') as $key => $value){ // print_r($key); // if ($key == 0) { // $html .= '
Klik Untuk Melihat Foto
'; $html .= ''; // }else{ // $html .= ''; // } } print_r($html); }else{ $this->load->view('home/index2'); } } function kembali(){ $this->load->view('home/kembali'); } function cari() { if ($this->input->post("proses") == "cari_buku_qr") { // $rak_buku = $this->input->post("rak"); $id = $this->input->post("id"); $cek_buku = $this->model->custom_query("SELECT *,(SELECT b.rak_buku from tb_kategori b where b.no = a.kategori) as rak_buku,(SELECT b.kategori from tb_kategori b where b.no = a.kategori) kategori_buku FROM `tb_list_buku` a where a.no = $id")->result(); $cek_data = $this->model->tampil_data_keseluruhan("tb_map_perpustakaan"); if (count($cek_buku) > 0) { $html = ''; if (count($cek_data->result()) > 0) { $html .= ""; print_r($html); } }else{ $html = ''; // print_r($cek_buku[0]->rak_buku); print_r($html); } } elseif ($this->input->post("proses") == "cari_rak_buku") { $rak_buku = $this->input->post("rak"); $cek_data = $this->model->tampil_data_keseluruhan("tb_map_perpustakaan"); $html = ''; if (count($cek_data->result()) > 0) { $html .= ""; print_r($html); } } elseif ($this->input->post('proses') == 'cari') { $id = $this->input->post('id'); $kategori = $this->input->post('kategori'); // print_r($kategori); if ($kategori == 'semua') { $cari_data = $this->model->custom_query("SELECT *,b.kategori as ini_kategori, b.no as no_kategori FROM tb_list_buku a join tb_kategori b on a.kategori = b.no where a.judul like '%$id%' OR a.pengarang like '%$id%' OR a.kategori like '%$id%' OR a.tahun_terbit like '%$id%'"); }elseif ($kategori == 'judul') { $cari_data = $this->model->custom_query("SELECT *,b.kategori as ini_kategori, b.no as no_kategori FROM tb_list_buku a join tb_kategori b on a.kategori = b.no where a.judul like '%$id%'"); }elseif ($kategori == 'pengarang') { $cari_data = $this->model->custom_query("SELECT *,b.kategori as ini_kategori, b.no as no_kategori FROM tb_list_buku a join tb_kategori b on a.kategori = b.no where a.pengarang like '%$id%'"); }elseif ($kategori == 'kategori') { $cari_data = $this->model->custom_query("SELECT *,b.kategori as ini_kategori, b.no as no_kategori FROM tb_list_buku a join tb_kategori b on a.kategori = b.no where b.no = $id"); } $html = ' '; foreach ($cari_data->result() as $key => $value) { $html .= ''; } $html .= '
Judul Kategori Pengarang Tahun Terbit Peletakan
'.$value->judul.' '.$value->ini_kategori.' '.$value->pengarang.' '.$value->tahun_terbit.'
'; print_r($html); } elseif ($this->input->post('proses') == 'cari_kategori') { $cari_data = $this->model->tampil_data_keseluruhan("tb_kategori"); $html = '