Terjadi eror di file php

Permisi kak, saya ingin Bertanya, Kenapa setelah saya upload File php saya Ke Database, Kok begini?

Ini kodenya:

template->load('template','absen/data'); }

function json_absen() { $this->datatable->select("a.NomorAbsen,CONCAT(p.nama_prodi,'/',unit.NM_UNIT) as ket,ta.TA,a.Semester,mk.NamaMK,a.SKS, a.NomorAbsen as action"); $this->datatable->from("tbl_absen as a"); $this->datatable->join("tbl_ta as ta","ta.ID=a.Ta",'left'); $this->datatable->join("tbl_mk as mk","mk.KodeMK=a.KD_MK",'left'); $this->datatable->join("tbl_unit as unit","unit.KD_UNIT=a.Unit",'left'); $this->datatable->join('tbl_prodi as p','p.kd_prodi=a.kd_prodi','left'); $this->datatable->where([ 'a.KD_DOSEN'=>$this->session->userdata("NIDN") ]); $this->datatable->edit_column('action', anchor('dosen/absen/detail/$1','detail') ,'action'); echo $this->datatable->generate(); }

function detail($act) { $data['absen']=$this->db->query("SELECT a.NomorAbsen,CONCAT(p.nama_prodi,'/',unit.NM_UNIT) as ket,ta.TA,a.Semester,mk.NamaMK,CONCAT(d.NamaDosen,d.Gelar) as ds, a.SKS FROM tbl_absen as a LEFT JOIN tbl_dosen as d ON a.KD_DOSEN=d.NIDN LEFT JOIN tbl_ta as ta ON ta.ID=a.Ta LEFT JOIN tbl_mk as mk ON mk.KodeMK=a.KD_MK LEFT JOIN tbl_prodi as p ON p.kd_prodi=a.kd_prodi LEFT JOIN tbl_unit as unit ON unit.KD_UNIT=a.Unit WHERE a.NomorAbsen IN('".$act."')")->row_array(); $data['mhs']=$this->db->query("SELECT * FROM tbl_absentemp as t LEFT JOIN tbl_mahasiswa as mhs ON mhs.nim=t.nim WHERE t.nomor_absen IN('".$act."')")->result_array(); $this->template->load('template','absen/detail',$data); }

function data($act) { $data['absen']=$this->db->query("SELECT a.NomorAbsen,CONCAT(p.nama_prodi,'/',unit.NM_UNIT) as ket,ta.TA,a.Semester,mk.NamaMK,CONCAT(d.NamaDosen,d.Gelar) as ds, a.SKS FROM tbl_absen as a LEFT JOIN tbl_dosen as d ON a.KD_DOSEN=d.NIDN LEFT JOIN tbl_ta as ta ON ta.ID=a.Ta LEFT JOIN tbl_mk as mk ON mk.KodeMK=a.KD_MK LEFT JOIN tbl_prodi as p ON p.kd_prodi=a.kd_prodi LEFT JOIN tbl_unit as unit ON unit.KD_UNIT=a.Unit WHERE a.NomorAbsen IN('".$act."')")->row_array(); $data['data']=$this->db->query("SELECT * FROM tbl_absenharian")->result_array(); $this->template->load('template','absen/dataabsen',$data); }

function create($act){ if($this->input->is_ajax_request()){ $this->response['success']=false; if($this->input->post('dosen')!=''){ $data=[ 'nomor_absen'=>$act, 'tgl'=>date("Y-m-d",strtotime($this->input->post('tgl'))), 'dosen'=>$this->input->post('hadir'), 'pengganti'=>$this->input->post('asdos'), 'keterangan'=>$this->input->post('ket') ]; if($this->db->insert('tbl_absenharian',$data)) { $this->response['success']=true; $this->response['url']=site_url('dosen/absen/data/'.$act); } }else{

$cek=$this->db->get_where('tbl_absen',[ 'NomorAbsen'=>$act, 'KD_DOSEN'=>$this->input->post('nidn') ])->num_rows(); if($cek > 0) { $this->response['success']=true; } }

echo json_encode($this->response); }else{ $this->template->load('template','absen/create'); }

}

function detaildata($act) { if($this->input->is_ajax_request()) { $this->response['success']=false; if($this->input->post('via')=='scan') { $cek_nim=$this->db->get_where('tbl_absentemp',['nim'=>$this->input->post('nim'),'nomor_absen'=>$this->input->post('absen')])->num_rows(); if($cek_nim > 0) { $data=[ 'id_absharian'=>$this->input->post('id_data'), 'nim'=>$this->input->post('nim') ]; if($this->db->get_where('tbl_abshariantemp',$data)->num_rows() > 0) { $data=[ 'id_absharian'=>$this->input->post('id_data'), 'nim'=>$this->input->post('nim'), 'ket'=>'hadir' ]; $this->db->where($data); $this->db->update('tbl_abshariantemp',$data); $this->response['success']=true; } else { $data=[ 'id_absharian'=>$this->input->post('id_data'), 'nim'=>$this->input->post('nim'), 'ket'=>'hadir' ]; $this->db->insert('tbl_abshariantemp',$data); $this->response['success']=true; } } } else { $cek_nim=$this->db->get_where('tbl_absentemp',['nim'=>$this->input->post('nim'),'nomor_absen'=>$this->input->post('absen')])->num_rows(); if($cek_nim > 0) { $data=[ 'id_absharian'=>$this->input->post('id_data'), 'nim'=>$this->input->post('nim') ]; if($this->db->get_where('tbl_abshariantemp',$data)->num_rows() > 0) { $data=[ 'id_absharian'=>$this->input->post('id_data'), 'nim'=>$this->input->post('nim'), 'ket'=>$this->input->post('ket') ]; $this->db->where($data); $this->db->update('tbl_abshariantemp',$data); $this->response['success']=true; } else { $data=[ 'id_absharian'=>$this->input->post('id_data'), 'nim'=>$this->input->post('nim'), 'ket'=>$this->input->post('ket') ]; $this->db->insert('tbl_abshariantemp',$data); $this->response['success']=true; } } } echo json_encode($this->response); } else { $data['absen']=$this->db->query("SELECT ah.nomor_absen, CONCAT(ah.nomor_absen,' - ',mk.NamaMK) as absen, ah.dosen as ketdos, ah.id_data, CONCAT(p.nama_prodi,'/',u.NM_UNIT) as unit, ta.TA, a.Semester, CONCAT(d.NamaDosen,d.Gelar) as dosen, DATE_FORMAT(ah.tgl,'%d-%M-%Y') as tgl, ah.pengganti, ah.keterangan FROM tbl_absenharian as ah INNER JOIN tbl_absen a ON a.NomorAbsen=ah.nomor_absen LEFT JOIN tbl_prodi as p ON p.kd_prodi=a.Kd_Prodi LEFT JOIN tbl_unit as u ON u.KD_UNIT=a.Unit LEFT JOIN tbl_ta as ta ON ta.ID=a.Ta LEFT JOIN tbl_dosen as d ON d.NIDN=a.KD_DOSEN LEFT JOIN tbl_mk as mk ON mk.KodeMK=a.KD_MK WHERE ah.id_data IN('".$act."')")->row_array(); $this->template->load('template','absen/detaildata',$data); } }

function json_data($act) { $this->datatable->select('att.nim,m.nama_mhs,m.gender,abt.ket'); $this->datatable->from('tbl_absentemp as att'); $this->datatable->join('tbl_abshariantemp as abt','abt.nim=att.nim','left'); $this->datatable->join('tbl_mahasiswa as m','m.nim=att.nim','left'); $this->datatable->join('tbl_absenharian as abh','abh.nomor_absen=att.nomor_absen','left'); $this->datatable->where('abh.id_data',$act); echo $this->datatable->generate(); } }

avatar Irfan225
@Irfan225

4 Kontribusi 0 Poin

Diperbarui 5 tahun yang lalu

Tanggapan

masukkan kode kamu di tag kode agar mudah dibaca

3 Jawaban:

kalau kamu baca errornya "syantax error, unexpected "[" pada bari ke 97 di file tersebut silahkan cek baris ke 97 dan perhatikan tanda ini "[" syntax error artinya ada yang salah dengan syntaxnya

avatar hilmanski
@hilmanski

2686 Kontribusi 2135 Poin

Dipost 5 tahun yang lalu

coba ganti ini <pre> $this-&gt;datatable-&gt;where(['a.KD_DOSEN'=&gt;$this-&gt;session-&gt;userdata("NIDN")]); // ganti jadi $this-&gt;datatable-&gt;where('a.KD_DOSEN',$this-&gt;session-&gt;userdata("NIDN")); </pre>

avatar dianarifr
@dianarifr

642 Kontribusi 316 Poin

Dipost 5 tahun yang lalu

Rapihkan codingan dulu, kalo pakai sublime text 3 Tekan CTRL + A Kemudian Tekan CTRL + SHIFT + P Kemudian Ketik Indentation: Reindent Lines

Kalo sudah rapih, sejajarkan tutup dan kurung di codingan, karena sangat berpengaruh terhadap error dan tidaknya suatu Codingan, hehehe :)

avatar AmateurCoding12
@AmateurCoding12

22 Kontribusi 0 Poin

Dipost 5 tahun yang lalu

Login untuk ikut Jawaban