Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: Settings.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Settings extends MY_Controller { public function __construct(){ parent::__construct(); $this->load->model('Ecomm_model'); $this->load->helper('ecomm_helper'); } public function index() { if($this->input->method() == 'post') { $action_for=$this->input->post('action_for'); $data_setting = $this->Ecomm_model->get_settings(); switch ($action_for) { case 'products_settings': $data = array( 'delivery_field' => $this->input->post('delivery_field') ? $this->input->post('delivery_field') : 'false', 'maxbuy_field' => $this->input->post('maxbuy_field') ? $this->input->post('maxbuy_field') : 'false', 'product_out_of_stock_message'=> $this->input->post('product_out_of_stock_message'), 'product_out_of_stock_image' => $this->input->post('stock_out_img'), 'default_delivery_charges' => $this->input->post('delivery_amount'), 'cart_amount_for_free_delivery' => $this->input->post('cart_min_amount') ); if ($data['delivery_field'] == 1){ $data['default_delivery_charges'] = '0'; $data['cart_amount_for_free_delivery'] = '0'; } if($_FILES['product_out_of_stock_image']['error']!=4) { if(file_exists(FCPATH.'assets/images/ecomm/'.$data_setting->product_out_of_stock_image)){ unlink(FCPATH.'assets/images/ecomm/'.$data_setting->product_out_of_stock_image); } $config['upload_path'] = FCPATH.'assets/images/ecomm/out_of_stock/'; $config['allowed_types'] = 'jpg|png|jpeg|gif'; $image = date('dmYhis').'_'.rand(0,99999).".".pathinfo($_FILES['product_out_of_stock_image']['name'], PATHINFO_EXTENSION); $config['file_name'] = $image; $this->load->library('upload', $config); if (!$this->upload->do_upload('product_out_of_stock_image')) { $messge = array('message' => $this->upload->display_errors(),'class' => 'alert alert-danger'); $this->session->set_flashdata('response_msg', $messge); redirect(base_url($this->config->item('apanel_name').'/ecomm/settings').get_query_string()); } $data = array_merge($data, array("product_out_of_stock_image"=>$image)); } $data = $this->security->xss_clean($data); if($this->Ecomm_model->update($data, '1','tbl_gf_ecomm_settings')){ $messge = array('message' => $this->lang->line('update_msg'),'class' => 'alert alert-success'); $this->session->set_flashdata('response_msg', $messge); } redirect(base_url($this->config->item('apanel_name').'/ecomm/settings').get_query_string()); break; default: $data = $this->security->xss_clean($data); if($this->Ecomm_model->update($data, '1','tbl_gf_ecomm_settings')){ $messge = array('message' => $this->lang->line('update_msg'),'class' => 'alert alert-success'); $this->session->set_flashdata('response_msg', $messge); } break; } redirect(base_url($this->config->item('apanel_name').'/ecomm/settings').get_query_string()); } $this->data['page_title'] = 'Settings'; $this->data['current_page'] = 'Settings'; $this->data['settings_row'] = $this->Ecomm_model->get_settings(); $this->data['view'] = 'admin/ecomm/settings'; $this->load->view('admin/layouts/default1', $this->data); } }