<?php

Class Location extends MY_BackendController{
    public function __construct(){
        parent::__construct();
    }

    public function index(){
        $data['_inactive_loading'] = true;
        $this->view('backend/setting/location',$data);
    }

    public function insert(){
        $post = $this->input->post();
        $this->load->model("Location_model");
        $this->Location_model->insert($post);
        redirect("backend/location");
    }

    public function edit(){
        $id = $this->input->get('id');
        $this->load->model("Location_model");
        $data = $this->Location_model->get_id($id);
        $data['_inactive_loading'] = true;
       
        $this->view('backend/setting/edit',$data);

    }

    public function update(){
        $post = $this->input->post();
       
        $this->load->model("Location_model");
        $this->Location_model->update($post,$post['id']);
        redirect('backend/location');
    }

    public function delete(){
        $ids = $this->input->post();
        $this->load->model("Location_model");
        foreach($ids as $id){
            $this->Location_model->delete($id);
        }
        redirect('backend/location');
    }
}