Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Data_Guru extends CI_Controller{
- public function index()
- {
- $data['guru']=$this->m_guru->tampil_data()->result();
- $this->load->view('admin/page');
- $this->load->view('admin/header');
- $this->load->view('admin/sidebar');
- $this->load->view('admin/data_guru',$data);
- $this->load->view('admin/footer');
- }
- public function tambah_aksi()
- {
- $nama_guru = $this->input->post('nama_guru');
- $alamat = $this->input->post('alamat');
- $jk = $this->input->post('jk');
- $status = $this->input->post('status');
- $no = $this->input->post('no');
- $data = array(
- 'nama_guru' => $nama_guru,
- 'alamat ' => $alamat,
- 'jk' => $jk,
- 'status' => $status,
- 'no_hp' => $no,
- );
- $this->m_guru->tambah_guru($data,'tb_guru');
- redirect('admin/data_guru');
- }
- public function edit($nip)
- {
- $where = array('nip' =>$nip);
- $data['guru'] = $this->m_guru->edit_guru($where, 'tb_guru')->result();
- $this->load->view('template/sidebar');
- $this->load->view('template/header');
- $this->load->view('template/edit_guru',$data);
- $this->load->view('template/page');
- $this->load->view('template/footer');
- }
- public function update()
- {
- $nip = $this->input->post('nip');
- $nama_guru = $this->input->post('nama_guru');
- $alamat = $this->input->post('alamat');
- $jk = $this->input->post('jk');
- $status = $this->input->post('status');
- $no = $this->input->post('no');
- $data = array(
- 'nama_guru' => $nama_guru,
- 'alamat ' => $alamat,
- 'jk' => $jk,
- 'status' => $status,
- 'no_hp' => $no,
- );
- $where = array(
- 'nip' => $nip
- );
- $this->m_guru->update($where, $data, 'tb_guru');
- redirect('admin/data_guru');
- }
- public function hapus($nip)
- {
- $where = array('nip' => $nip);
- $this->m_guru->hapus_data($where, 'tb_guru');
- redirect('admin/data_guru');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement