whoami7 - Manager
:
/
proc
/
self
/
root
/
home
/
papecmvm
/
www
/
application
/
controllers
/
admin
/
Upload File:
files >> //proc/self/root/home/papecmvm/www/application/controllers/admin/Portfolio_subcat.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); error_reporting(0); class Portfolio_subcat extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('alldata', "model"); $session_data=$this->session->all_userdata(); if(count($session_data)==5) { redirect('admin/starlogin'); } } public function index() { $data['view']=$this->model->getDatamodel('tbl_port_sub_cat'); $this->load->view("portfolio/portfolio_sub",$data); } //------ START: INSERT FUNCTION ------------------------------ public function add_portfoliocategory(){ if($this->input->post('save')=='save'){ $insertdata= array( 'pid'=>$this->input->post('pid'), 'ps_name'=>$this->input->post('ps_name'), ); $this->form_validation->set_rules('ps_name', 'ps_name', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->insertData('tbl_port_sub_cat',$insertdata); } /* $this->session->set_flashdata('msg', ' <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> Insert data successfully . </div>'); */ redirect('admin/portfolio_subcat'); }else{ $data['port']=$this->model->getDatamodel('tbl_portfolio_category'); $this->load->view("portfolio/portfolio_sub_add", $data); } } //------ END: INSERT FUNCTION ------------------------------ //------ START: EDIT FUNCTION ------------------------------ public function edit_portfoliocategory($encrypted_string){ $id = $this->model->decryptdata($encrypted_string); $where=array('psid'=>$id); if($this->input->post('save')=='save'){ $Updatedata= array( 'pid'=>$this->input->post('pid'), 'ps_name'=>$this->input->post('ps_name'), ); $this->form_validation->set_rules('ps_name', 'ps_name', 'required|xss_clean|regex_match[/^[^\`\~\@\#\$\%\^\*\[\]\{\}\;:<>=+"]+$/]'); if ($this->form_validation->run() == TRUE) { $this->model->UpdateData('tbl_port_sub_cat',$Updatedata,$where); } /* $this->session->set_flashdata('msg', ' <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> Update data successfully . </div>'); */ redirect('admin/Portfolio_subcat'); }else{ $data['port']=$this->model->getDatamodel('tbl_portfolio_category'); $data['view']=$this->model->DetailData('tbl_port_sub_cat',$where); $this->load->view("portfolio/portfolio_sub_add",$data); } } //------ END: EDIT FUNCTION ------------------------------ //------ START: DELETE FUNCTION ------------------------------ public function delete_portfoliocategory(){ $ids = explode('&',$this->input->post('ck')); $n=count($ids); for($i=0;$i<$n;$i++) { $id=explode('=',$ids[$i]); $where=array('psid'=>$id[1]); $getimages=$this->model->DetailData('tbl_port_sub_cat',$where); for($j=0;$j<count($getimages);$j++) { //echo $getimages[$j]['portfolio_image_path']."<br/>"; unlink("portfolio_images/".$getimages[$j]['portfolio_image_path']); } $this->model->DeleteData('tbl_port_sub_cat',$where); } /* $this->session->set_flashdata('msg', ' <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> Delete data successfully . </div>'); */ redirect('admin/portfolio_subcat'); } //------ END: DELETE FUNCTION ------------------------------- } /* End of file services.php */
Copyright ©2021 || Defacer Indonesia