Viewing file: system.php (6.98 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php require('ums_controller.php'); class System extends Ums_controller { public $data; function index() { $this->load->model($this->config->item('ums_folder').'m_umsystem','m_umsystem'); $m_umsystem=$this->m_umsystem; $this->data['system'] = $m_umsystem->get()->result(); $this->output('v_umSystemShow'); } function umSystemAdd(){ if($this->input->post('submit')){ //SAVE $this->load->model($this->config->item('ums_folder').'m_umsystem','m_umsystem'); $m_umsystem=$this->m_umsystem; $m_umsystem->StID = $this->input->post('StID'); $m_umsystem->StNameT = $this->input->post('StNameT'); $m_umsystem->StNameE = $this->input->post('StNameE'); $m_umsystem->StAbbrT = $this->input->post('StAbbrT'); $m_umsystem->StAbbrE = $this->input->post('StAbbrE'); $m_umsystem->StDesc = $this->input->post('StDesc'); $m_umsystem->StURL = $this->input->post('StURL'); $m_umsystem->StIcon = $this->input->post('StIcon'); $m_umsystem->insert(); redirect(site_url().'/'.$this->config->item('ums_folder').'system'); } $this->output('v_umSystemForm'); } function umSystemEdit(){ $StID = $this->input->post('id'); $this->load->model($this->config->item('ums_folder').'m_umsystem','m_umsystem'); $m_umsystem=$this->m_umsystem; if($StID==''){ if($this->input->post('submit')){ //SAVE $m_umsystem->StID = $this->input->post('StID'); $m_umsystem->StNameT = $this->input->post('StNameT'); $m_umsystem->StNameE = $this->input->post('StNameE'); $m_umsystem->StAbbrT = $this->input->post('StAbbrT'); $m_umsystem->StAbbrE = $this->input->post('StAbbrE'); $m_umsystem->StDesc = $this->input->post('StDesc'); $m_umsystem->StURL = $this->input->post('StURL'); $m_umsystem->StIcon = $this->input->post('StIcon'); $m_umsystem->update(); redirect(site_url().'/'.$this->config->item('ums_folder').'system'); } redirect(site_url().'/'.$this->config->item('ums_folder').'system'); } $m_umsystem->StID = $StID; $this->data['system'] = $m_umsystem->get_by_key(); $this->data['edit'] = true; $this->output('v_umSystemForm'); } function umSystemDelete(){ $StID = $this->input->post('id'); $this->load->model($this->config->item('ums_folder').'m_umsystem','m_umsystem'); $m_umsystem=$this->m_umsystem; $m_umsystem->StID = $StID; $m_umsystem->delete(); $this->load->model($this->config->item('ums_folder').'m_ummenu','m_ummenu'); $m_ummenu=$this->m_ummenu; $m_ummenu->MnStID = $StID; $m_ummenu->deleteSystem(); redirect(site_url().'/'.$this->config->item('ums_folder').'system'); } function umMenuShow(){ $StID = $this->input->post('id'); $this->load->model($this->config->item('ums_folder').'m_umsystem','m_umsystem'); $m_umsystem=$this->m_umsystem; $m_umsystem->StID = $StID; $this->data['system'] = $m_umsystem->get_by_key(); $this->data['StID'] = $StID; $this->data['menu'] = $this->umMenuShowRe(0,$StID); $this->output('v_umMenuShow'); } function umMenuShowRe($MnID,$StID){ $this->load->model($this->config->item('ums_folder').'m_ummenu','m_ummenu'); $m_ummenu=$this->m_ummenu; $menu = $m_ummenu->RSByParentMn($MnID,$StID); if($menu->num_rows>0){ foreach($menu->result() as $row){ //echo $row->MnID.'|'; $result[$row->MnID]['data'] = $row; $result[$row->MnID]['child'] = $this->umMenuShowRe($row->MnID,$StID); } return $result; } else { return false; } } function umMenuAdd(){ if($this->input->post('submit')){ //SAVE $MnID = $this->input->post('MnID'); $StID = $this->input->post('StID'); $MnLevel = $this->input->post('MnLevel'); $this->load->model($this->config->item('ums_folder').'m_ummenu','m_ummenu'); $m_ummenu = $this->m_ummenu; $m_ummenu->MnStID = $StID; $lastMnID = $m_ummenu->lastMnID(); if($lastMnID>0){ $MnIDNew = ($lastMnID)+1; } else { $MnIDNew = str_pad($StID, 7 , "0")+1; } $m_ummenu->MnID = $MnIDNew; $m_ummenu->MnSeq = $MnIDNew; $m_ummenu->MnIcon = ''; $m_ummenu->MnNameT = $this->input->post('MnNameT'); $m_ummenu->MnNameE = $this->input->post('MnNameE'); $m_ummenu->MnURL = $this->input->post('MnURL'); $m_ummenu->MnDesc = $this->input->post('MnDesc'); $m_ummenu->MnToolbar = ''; $m_ummenu->MnToolbarSeq = 0; $m_ummenu->MnToolbarIcon = ''; $m_ummenu->MnParentMnID = $MnID; $m_ummenu->MnLevel = $MnLevel+1; $m_ummenu->insert(); $value = array('id'=>$StID); $this->redirectPost("system/umMenuShow",$value); } else { $MnID = $this->input->post('MnID'); $StID = $this->input->post('StID'); $MnLevel = $this->input->post('MnLevel'); $this->data['MnID'] = $MnID; $this->data['StID'] = $StID; $this->data['MnLevel'] = $MnLevel; // System $this->load->model($this->config->item('ums_folder').'m_umsystem','m_umsystem'); $m_umsystem=$this->m_umsystem; $m_umsystem->StID = $StID; $this->data['system'] = $m_umsystem->get_by_key(); $this->output('v_umMenuForm'); } } function umMenuEdit(){ if($this->input->post('submit')){ //SAVE $this->load->model($this->config->item('ums_folder').'m_ummenu','m_ummenu'); $m_ummenu = $this->m_ummenu; $m_ummenu->MnNameT = $this->input->post('MnNameT'); $m_ummenu->MnNameE = $this->input->post('MnNameE'); $m_ummenu->MnURL = $this->input->post('MnURL'); $m_ummenu->MnDesc = $this->input->post('MnDesc'); $m_ummenu->MnID = $this->input->post('MnID'); $m_ummenu->updateMenu(); $StID = $this->input->post('StID'); $value = array('id'=>$StID); $this->redirectPost("system/umMenuShow",$value); } else { $this->load->model($this->config->item('ums_folder').'m_ummenu','m_ummenu'); $m_ummenu=$this->m_ummenu; $MnID = $this->input->post('MnID'); $StID = $this->input->post('StID'); $MnLevel = $this->input->post('MnLevel'); $this->data['MnID'] = $MnID; $this->data['StID'] = $StID; $this->data['MnLevel'] = $MnLevel; $this->data['menu'] = $m_ummenu->getByKey($MnID); // System $this->load->model($this->config->item('ums_folder').'m_umsystem','m_umsystem'); $m_umsystem=$this->m_umsystem; $m_umsystem->StID = $StID; $this->data['system'] = $m_umsystem->get_by_key(); $this->data['edit'] = true; $this->output('v_umMenuForm'); } } function umMenuDelete(){ $this->load->model($this->config->item('ums_folder').'m_ummenu','m_ummenu'); $m_ummenu=$this->m_ummenu; $MnID = $this->input->post('MnID'); $m_ummenu->MnID = $MnID; $m_ummenu->deleteMenu(); $StID = $this->input->post('StID'); $value = array('id'=>$StID); $this->redirectPost("system/umMenuShow",$value); } function umMenuSaveSeq(){ $this->load->model($this->config->item('ums_folder').'m_ummenu','m_ummenu'); $m_ummenu=$this->m_ummenu; foreach($_POST as $key=>$val){ $m_ummenu->MnID = $key; $m_ummenu->MnSeq = $val; $m_ummenu->SaveSeq(); } $StID = $this->input->post('StID'); $value = array('id'=>$StID); $this->redirectPost("system/umMenuShow",$value); } function umShowGroup(){ $this->output('v_home'); } function umQuestion(){ $this->output('v_home'); } }
|