application/modules/hr/controllers/Hr.php
// memanggil data di database untuk di kirim ke view
memanggil data di database untuk di kirim ke view
memanggil data di database untuk di kirim ke view
public function termination_list()
	{
		$this->load->helper('url');
		$list = $this->termin->get_datatables();
		$data = array();
		$no = $_POST['start'];
		foreach ($list as $a) {
			$no++;
			$row = array();
			$row[] = $a->nik_pim;
			$row[] = $a->empname;
			$row[] = $this->date_indonesia($a->datejoin);
			$row[] = $this->date_indonesia($a->dateterminate);
			$row[] = $a->terminatetype;
			$row[] = $a->reasonofresign;
			$row[] = '<a class="btn btn-sm btn-danger"" href="javascript:void(0)" title="Edit" onclick="edit('."'".$a->empcode."'".')"><i class="glyphicon glyphicon-pencil"></i> Edit</a>';
			$data[] = $row;
		}
		$output = array(
						"draw" => $_POST['draw'],
						"recordsTotal" => $this->termin->count_all(),
						"recordsFiltered" => $this->termin->count_filtered(),
						"data" => $data,
				);
		echo json_encode($output);
	}
public function termination_list ( ) { $ this -> load -> helper ( 'url' ) ; $ list = $ this -> termin -> get_datatables ( ) ; $ data = array ( ) ; $ no = $ _POST [ 'start' ] ; foreach ( $ list as $ a ) { $ no ++ ; $ row = array ( ) ; $ row [ ] = $ a -> nik_pim ; $ row [ ] = $ a -> empname ; $ row [ ] = $ this -> date_indonesia ( $ a -> datejoin ) ; $ row [ ] = $ this -> date_indonesia ( $ a -> dateterminate ) ; $ row [ ] = $ a -> terminatetype ; $ row [ ] = $ a -> reasonofresign ; $ row [ ] = '<a class="btn btn-sm btn-danger"" href="javascript:void(0)" title="Edit" onclick="edit(' . " ' " . $ a -> empcode . " ' " . ')"><i class="glyphicon glyphicon-pencil"></i> Edit</a>' ; $ data [ ] = $ row ; } $ output = array ( " draw " => $ _POST [ 'draw' ] , " recordsTotal " => $ this -> termin -> count_all ( ) , " recordsFiltered " => $ this -> termin -> count_filtered ( ) , " data " => $ data , ) ; echo json_encode ( $ output ) ; }
memanggil data di database untuk di kirim ke view
memanggil data di database untuk di kirim ke view
//add html for action //output to json format