load->model('Menu_model'); } function list_menu() { if($this->session->userdata('id')==""){redirect('admin/login');} $data['men']=$this->Menu_model->list_menu(); $this->load->view('admin/menu/list',$data); } function update_menu() { if($this->session->userdata('id')==""){redirect('admin/login');} if($this->input->post('add')) { $checkhide=$this->input->post('checkhide'); $pri_id=$this->input->post('pri_id'); foreach($pri_id as $key=>$val) { $PID=$pri_id[$key]; $VAL=$checkhide[$key]; $table="menu"; $where=array("id"=>$PID); $rvalue=array("status"=>$VAL); $result=$this->commonsql_model->updateTable($table,$where,$rvalue); } if($result) { $this->session->set_userdata('suc','successfully Updated'); redirect('admin/cmenu'); } else { $this->session->set_userdata('err','Please try again'); redirect('admin/cmenu'); } } } } ?>