whoami7 - Manager
:
/
proc
/
self
/
root
/
home
/
papecmvm
/
www
/
application
/
controllers
/
admin
/
Upload File:
files >> //proc/self/root/home/papecmvm/www/application/controllers/admin/Menumanagement.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ob_start(); error_reporting(0); class Menumanagement extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata','model'); } public function index() { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $data['page']=$this->model->getDatamodel($lang.'tblcontent'); $data['menugroup']=$this->model->getDatamodel('tblmenugroup'); $this->db->order_by("menu_position", "asc"); $this->db->select('*'); $where= array('menugroup' => $data['menugroup'][0]['menugroup_id']); $this->db->where($where); $this->db->from($lang.'tblmenu'); $data['menu'] = $this->db->get()->result_array(); $this->load->view("menu/menu_view",$data); } public function menuviewload($id) { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $this->db->order_by("menu_position", "asc"); $this->db->select('*'); $where= array('menugroup' =>$id); $this->db->where($where); $this->db->from($lang.'tblmenu'); $data['menu'] = $this->db->get()->result_array(); $where=array('menugroup_id'=>$id); $data['menugroup']=$this->model->DetailData('tblmenugroup',$where); $this->load->view("menu/menulist",$data); } public function addgroup() { $shortcode='['.str_replace(" ",'-',$this->input->post('menugroupname')).']'; $insertdata=array('menugroupname'=>$this->input->post('menugroupname'), 'menushortcode'=>$shortcode); $this->form_validation->set_rules('menugroupname', 'menugroupname', 'required|xss_clean|regex_match[/^[a-zA-Z ]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->insertdata('tblmenugroup',$insertdata); } redirect('admin/menumanagement'); } public function deletegroup($id) { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $where=array('menugroup_id'=>$id); $this->model->DeleteData('tblmenugroup',$where); $where=array('menugroup'=>$id); $this->model->DeleteData($lang.'tblmenu',$where); } public function addmenu() { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $menugroupid=$this->input->post('menugroup'); $lable=explode(",",$this->input->post('lable')); $menu=explode(",",$this->input->post('menu')); $url=explode(",",$this->input->post('url')); $count=1; $obj = json_decode($this->input->post('postions'),true); $where = array('menugroup'=>$menugroupid); $this->model->deleteData($lang.'tblmenu',$where); for ($a=0; $a <count($obj) ; $a++)//Level One { $Insertmenu=array('menu_name'=>$menu[$count], 'menu_displayname'=>$lable[$count], 'menu_content'=>$obj[$a]['id'], 'menu_position'=>$count, 'menugroup'=>$menugroupid, 'menu_url'=>$url[$count] ); $count++; $this->model->insertData($lang.'tblmenu',$Insertmenu); if (isset($obj[$a]['children'])) { for ($b=0; $b <count($obj[$a]['children']) ; $b++) //Level Two { $Insertmenu=array('menu_name'=>$menu[$count], 'menu_displayname'=>$lable[$count], 'menu_content'=>$obj[$a]['children'][$b]['id'], 'menu_position'=>$count, 'menugroup'=>$menugroupid, 'submenu'=>$obj[$a]['id'], 'menu_url'=>$url[$count] ); $count++; $this->model->insertData($lang.'tblmenu',$Insertmenu); if (isset($obj[$a]['children'][$b]['children'])) { for ($c=0; $c <count($obj[$a]['children'][$b]['children']) ; $c++)//Level Three { $Insertmenu=array('menu_name'=>$menu[$count], 'menu_displayname'=>$lable[$count], 'menu_content'=>$obj[$a]['children'][$b]['children'][$c]['id'], 'menu_position'=>$count, 'menugroup'=>$menugroupid, 'submenu'=>$obj[$a]['children'][$b]['id'], 'menu_url'=>$url[$count] ); $count++; $this->model->insertData($lang.'tblmenu',$Insertmenu); if (isset($obj[$a]['children'][$b]['children'][$c]['children'])) { for ($d=0; $d <count($obj[$a]['children'][$b]['children'][$c]['children']) ; $d++) //Level Four { $Insertmenu=array('menu_name'=>$menu[$count], 'menu_displayname'=>$lable[$count], 'menu_content'=>$obj[$a]['children'][$b]['children'][$c]['children'][$d]['id'], 'menu_position'=>$count, 'menugroup'=>$menugroupid, 'submenu'=>$obj[$a]['children'][$b]['children'][$c]['id'], 'menu_url'=>$url[$count] ); $count++; $this->model->insertData($lang.'tblmenu',$Insertmenu); if (isset($obj[$a]['children'][$b]['children'][$c]['children'][$d]['children'])) { for ($e=0; $e <count($obj[$a]['children'][$b]['children'][$c]['children'][$d]['children']) ; $e++) //Level Five { $Insertmenu=array('menu_name'=>$menu[$count], 'menu_displayname'=>$lable[$count], 'menu_content'=>$obj[$a]['children'][$b]['children'][$c]['children'][$d]['children'][$e]['id'], 'menu_position'=>$count, 'menugroup'=>$menugroupid, 'submenu'=>$obj[$a]['children'][$b]['children'][$c]['children'][$d]['id'], 'menu_url'=>$url[$count] ); $count++; $this->model->insertData($lang.'tblmenu',$Insertmenu); }//End Level Five } }//End Level Four } } //End Level Three } } //End Level Two } }//End Level One echo ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Navigation Data successfully save. </div>'; } public function Menustu() { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $content['view']=array(); $data=$this->input->post('pageid'); $malestr = str_replace("pageid=", "", $data); $page=explode("&",$malestr); for ($i=0; $i <count($page) ; $i++) { $where = array('content_id' => $page[$i]); $get=$this->model->DetailData($lang.'tblcontent',$where); array_push($content['view'],$get); } $this->load->view('menu/menustucture',$content); } public function deleteMenuData($encrypted_string,$menugroup) { $session_data=$this->session->all_userdata(); $lang=$session_data['lang']; $id =$encrypted_string; $where=array('menu_content'=>$id,'menugroup'=>$menugroup); $this->model->DeleteData($lang.'tblmenu',$where); $where=array('submenu'=>$id,'menugroup'=>$menugroup); $this->model->DeleteData($lang.'tblmenu',$where); echo ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Navigation Data successfully Deleted. </div>'; } }
Copyright ©2021 || Defacer Indonesia