Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php defined('BASEPATH') OR exit('No direct script access allowed');
- class Admin extends CI_Controller {
- function __construct(){
- parent::__construct();
- if($this->session->userdata('id_user') <> '1'){
- redirect('login');
- }
- }
- public $layout = 'Admin/layout';
- public function index(){
- $data = array('title' => 'Admin', 'main_view' => 'Admin/home');
- $this->load->view($this->layout, $data);
- }
- public function tambahharga(){
- $data = array('title' => 'Tambah Harga', 'main_view' => 'Admin/Harga/harga_baru');
- $this->load->view($this->layout, $data);
- }
- function datareklame(){
- $keyword_reklame = $this->uri->segment(3);
- $data = $this->db->query("SELECT * from tb_reklame where nama_reklame like '%$keyword_reklame%'");
- foreach($data->result() as $row){
- $arr['query'] = $keyword_reklame%
- $arr['suggestions'][] = array(
- 'value' =>$row->nama_reklame,
- 'id_reklame' =>$row->id_reklame,
- 'keterangan' => $row->keterangan,
- 'alamat' => $row->alamat
- );
- }
- echo json_encode($arr);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment