Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function dataunitkerja()
- {
- $dataunitkerja = $this->unit_kerja_m->get_all();
- $no = 1;
- foreach ($dataunitkerja as $duk) {
- $tbody = array();
- $tbody[] = $no++;
- $tbody[] = $duk['E1Kode'];
- $tbody[] = $duk['E2Kode'];
- $tbody[] = $duk['E2Nama'];
- $tbody[] = $duk['EStatus'];
- $aksi= "<button class='btn btn-sm btn-success ubah-data' data-toggle='modal' data-Id=".$duk['Id']."><i class='fas fa-edit'></i></button>".' '."<button class='btn btn-danger btn-sm hapus' id='Id' data-toggle='modal' data-Id=".$duk['Id']."><i class='fas fa-trash-alt'></i></button>";
- $tbody[] = $aksi;
- $data[] = $tbody;
- }
- if ($dataunitkerja) {
- echo json_encode(array('data' => $data));
- }else{
- echo json_encode(array('data' => 0));
- }
- }
- public function hapusunitkerja()
- {
- $Id = $this->input->post('Id');
- $data = $this->unit_kerja_m->hapusunitkerja($Id);
- echo json_encode($data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement