Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Welcome extends CI_Controller {
- function __construct()
- {
- parent::__construct();
- $this->load->helper(array('url'));
- $this->load->model('modvsiswa');
- $this->load->database();
- }
- public function index()
- {
- $this->load->view('welcome_message');
- }
- 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