Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class controllerku extends CI_Controller {
- public function autocomplete(){
- $this->load->model('modvsiswa');
- $q = $_REQUEST['term'];
- $cn = new modvsiswa();
- $data = $cn->siswaPerpusUnregister($q);
- $count = count($data);
- $jumlah = 0;
- $jumlah = ($count > 0 ? '' : '');
- $response = array();
- foreach ($data as $val => $r){
- array_push($response, array("id"=>$r['nis'],"label"=>$r['nis']." = ".$r['nama'],"value"=>$r['nis']));
- }
- echo json_encode($response);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement