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/laciasmara.com/public_html/shop/application/controllers/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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



class Configuration extends Admin_Controller

{



   function __construct()

   {

      parent::__construct();

      $this->load->model('configuration_m');

      $this->load->helper('rajaongkir');

      $this->load->model('customer_m');

   }



   function index()

   {

      redirect('admin/configuration/edit');

   }



   //to EDIT workshop in admin

   public function edit($id = 1)

   {



      $this->data['configuration'] = $this->configuration_m->get($id);



      //get all province data from RajaOngkir.com API

      $this->data['provinces'] = get_rajaongkir_data('province'); //get from helper file  



      //get all initial districts based on stored province

      $this->db->select('shop_province_id')->from('configuration')->where('id_configuration', 1);

      $current_province_id = $this->db->get()->row()->shop_province_id;



      $this->data['districts'] = get_rajaongkir_data('city?province=' . (int) $current_province_id); //get from helper file 



      //get all initial subdistricts based on stored districts

      $this->db->select('shop_district_id')->from('configuration')->where('id_configuration', 1);

      $current_distirct_id = $this->db->get()->row()->shop_district_id;



      $this->data['subdistricts'] = get_rajaongkir_data('subdistrict?city=' . (int) $current_distirct_id); //get from helper file 





      error_reporting(0);

      $this->data['choosen_free_shipping_region'] = $this->db->select('*')->from('free_shipping_region')->order_by('province_id', 'ASC')->get()->result();

      $this->data['choosen_free_shipping_global'] = $this->db->select('*')->from('free_shipping_global')->get()->row();





      //validation check in action 

      $config = array(

         array(

            'field'   => 'veritrans_server_key',

            'label'   => 'Veritrans Production Server Key',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'veritrans_client_key',

            'label'   => 'Veritrans Production Client Key',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'veritrans_sandbox_server_key',

            'label'   => 'Veritrans Sandbox Server Key',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'veritrans_sandbox_client_key',

            'label'   => 'Veritrans Sandbox Client Key',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'website_name',

            'label'   => 'Website Name',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'province',

            'label'   => 'province',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'district',

            'label'   => 'district',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'subdistrict',

            'label'   => 'sub district',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'browser_title',

            'label'   => 'Browser Title',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'meta_description',

            'label'   => 'Meta Description',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'bank',

            'label'   => 'Bank',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'bank1',

            'label'   => 'Bank1',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'from_email',

            'label'   => 'From Email',

            'rules'   => 'trim|required|valid_email'

         ),

         array(

            'field'   => 'phone',

            'label'   => 'Phone',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'free_shipping',

            'label'   => 'Email Subject',

            'rules'   => 'trim|numeric'

         ),

         array(

            'field'   => 'category_image_width',

            'label'   => 'category_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'category_image_height',

            'label'   => 'category_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'category_thumbnail_width',

            'label'   => 'category_thumbnail_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'category_thumbnail_height',

            'label'   => 'category_thumbnail_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'brand_logo_width',

            'label'   => 'brand_logo_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'brand_logo_height',

            'label'   => 'brand_logo_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'brand_image_width',

            'label'   => 'brand_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'brand_image_height',

            'label'   => 'brand_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'product_image_width',

            'label'   => 'product_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'product_image_height',

            'label'   => 'product_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'product_image_large_width',

            'label'   => 'product_image_large_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'product_image_large_height',

            'label'   => 'product_image_large_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'product_image_small_width',

            'label'   => 'product_image_small_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'product_image_small_height',

            'label'   => 'product_image_small_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'product_image_thumbnail_height',

            'label'   => 'product_image_thumbnail_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'logo_image_width',

            'label'   => 'logo_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'logo_image_height',

            'label'   => 'logo_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'home_slideshow_width',

            'label'   => 'home_slideshow_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'home_slideshow_height',

            'label'   => 'home_slideshow_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'blog_image_width',

            'label'   => 'blog_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'blog_image_height',

            'label'   => 'blog_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'blog_thumbnail_width',

            'label'   => 'blog_thumbnail_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'blog_thumbnail_height',

            'label'   => 'blog_thumbnail_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'products_displayed',

            'label'   => 'products_displayed',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'google_analytic_id',

            'label'   => 'google_analytic_id',

            'rules'   => 'trim'

         ),

         array(

            'field'   => 'facebook',

            'label'   => 'facebook',

            'rules'   => 'trim'

         ),

         array(

            'field'   => 'twitter',

            'label'   => 'twitter',

            'rules'   => 'trim'

         ),

         array(

            'field'   => 'instagram',

            'label'   => 'instagram',

            'rules'   => 'trim'

         ),

         array(

            'field'   => 'youtube',

            'label'   => 'youtube',

            'rules'   => 'trim'

         ),

         array(

            'field'   => 'email_smtp_host',

            'label'   => 'email_smtp_host',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'email_smtp_port',

            'label'   => 'email_smtp_port',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'email_smtp_password',

            'label'   => 'email_smtp_password',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'email_smtp',

            'label'   => 'email_smtp',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'veritrans_fee',

            'label'   => 'veritrans_fee',

            'rules'   => 'trim|decimal|required'

         ),

         array(

            'field'   => 'veritrans_admin',

            'label'   => 'veritrans_admin',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'virtualaccount_admin',

            'label'   => 'virtualaccount_admin',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'shopdelivery_duration',

            'label'   => 'shopdelivery_duration',

            'rules'   => 'trim'

         ),

         array(

            'field'   => 'shopdelivery_fee',

            'label'   => 'shopdelivery_fee',

            'rules'   => 'trim|numeric'

         ),



         array(

            'field'   => 'staticbanner1_image_height',

            'label'   => 'staticbanner1_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner2_image_height',

            'label'   => 'staticbanner2_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner3_image_height',

            'label'   => 'staticbanner3_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner4_image_height',

            'label'   => 'staticbanner4_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner5_image_height',

            'label'   => 'staticbanner5_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner6_image_height',

            'label'   => 'staticbanner6_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner1_image_width',

            'label'   => 'staticbanner1_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner2_image_width',

            'label'   => 'staticbanner2_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner3_image_width',

            'label'   => 'staticbanner3_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner4_image_width',

            'label'   => 'staticbanner4_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner5_image_width',

            'label'   => 'staticbanner5_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'staticbanner6_image_width',

            'label'   => 'staticbanner6_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'featuredproduct_image_width',

            'label'   => 'featuredproduct_image_width',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'featuredproduct_image_height',

            'label'   => 'featuredproduct_image_height',

            'rules'   => 'trim|numeric|required'

         ),

         array(

            'field'   => 'primary_color_theme',

            'label'   => 'primary_color_theme',

            'rules'   => 'trim|required'

         ),

         array(

            'field'   => 'website_ip',

            'label'   => 'primary_color_theme',

            'rules'   => 'trim'

         ),

         array(

            'field'   => 'cart_abandon_notification',

            'label'   => 'cart abandon notification',

            'rules'   => 'trim|numeric|required'

         ),

         // array(

         //    'field'   => 'top_menu_position',

         //    'label'   => 'top_menu_position',

         //    'rules'   => 'trim|required|numeric'

         // ),



      );



      $this->load->library('form_validation');

      $this->form_validation->set_error_delimiters('<div class="error">', '</div>'); //above is to add class to form validation error, to be styled        

      $this->form_validation->set_rules($config);

      $this->form_validation->set_error_delimiters('<div class="error">', '</div>');



      if ($this->form_validation->run($this) == TRUE) {



         //get max image width and height from configuration table

         $this->db->select('logo_image_width, logo_image_height')->from('configuration')->where('id_configuration', 1);

         $image_dimension = $this->db->get()->row();



         //check & processing logo upload files  

         if ($_FILES['logo']['size'] !== 0) {



            $config['upload_path'] = './uploads/';

            $config['allowed_types'] = 'jpg|png';

            $config['max_size']  = '300';

            $config['max_width']  = $image_dimension->logo_image_width;

            $config['max_height']  = $image_dimension->logo_image_height;



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

            $this->upload->initialize($config);



            if (! $this->upload->do_upload('logo')) {



               //echo $this->upload->display_errors(); die();



               $this->session->set_flashdata('error', '<br>

                    <p style="background:orange; color:white; padding:5px; font-weight:bold;">Image Upload Error. Wrong format or size.</p>');



               redirect('admin/configuration/edit/');

            } else {

               $logo = $this->upload->data();

               $logo_filename = $logo['file_name'];

            }

         }



         //check & processing logo upload files  

         if ($_FILES['midtrans_logo']['size'] !== 0) {



            $config['upload_path'] = './uploads/';

            $config['allowed_types'] = 'jpg|png';

            $config['max_size']  = '300';

            $config['max_width']  = '600';

            $config['max_height']  = '600';



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

            $this->upload->initialize($config);



            if (! $this->upload->do_upload('midtrans_logo')) {



               //echo $this->upload->display_errors(); die();



               $this->session->set_flashdata('error', '<br>

                    <p style="background:orange; color:white; padding:5px; font-weight:bold;">Image Upload Error. Wrong format or size.</p>');



               redirect('admin/configuration/edit/');

            } else {

               $midtrans_logo = $this->upload->data();

               $midtrans_logo_filename = $midtrans_logo['file_name'];

            }

         }



         //check & processing website icon upload files  

         if ($_FILES['website_icon']['size'] !== 0) {



            $config2['upload_path'] = './uploads/';

            $config2['allowed_types'] = 'jpg|png';

            $config2['max_size']  = '50';

            $config2['max_width']  = '200';

            $config2['max_height']  = '200';



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

            $this->upload->initialize($config2);



            if (! $this->upload->do_upload('website_icon')) {



               //echo $this->upload->display_errors(); die();



               $this->session->set_flashdata('error2', '<br>

                    <p style="background:orange; color:white; padding:5px; font-weight:bold;">Website Icon Upload Error. Wrong format or size.</p>');



               redirect('admin/configuration/edit/');

            } else {

               $website_icon = $this->upload->data();

               $website_icon_filename = $website_icon['file_name'];

            }

         }



         //check & processing logo upload files  

         if ($_FILES['image_not_available']['size'] !== 0) {



            $config['upload_path'] = './uploads/';

            $config['allowed_types'] = 'jpg|png|gif';

            $config['max_size']  = '200';

            $config['max_width']  = '800';

            $config['max_height']  = '800';



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

            $this->upload->initialize($config);



            if (! $this->upload->do_upload('image_not_available')) {



               //echo $this->upload->display_errors(); die();



               $this->session->set_flashdata('image_not_available', '<br>

                    <p style="background:orange; color:white; padding:5px; font-weight:bold;">Image Upload Error. Wrong format or size.</p>');



               redirect('admin/configuration/edit/');

            } else {

               $image_not_available = $this->upload->data();

               $image_not_available_filename = $image_not_available['file_name'];

            }

         }



         $data = array(

            'veritrans_server_key' => $this->input->post('veritrans_server_key'),

            'veritrans_client_key' => $this->input->post('veritrans_client_key'),

            'veritrans_sandbox_server_key' => $this->input->post('veritrans_sandbox_server_key'),

            'veritrans_sandbox_client_key' => $this->input->post('veritrans_sandbox_client_key'),

            'veritrans_production_mode' => $this->input->post('veritrans_production_mode'),

            'website_name' => $this->input->post('website_name'),

            'shop_province_id' => (int) $this->input->post('province'),

            'shop_district_id' => (int) $this->input->post('district'),

            'shop_subdistrict_id' => (int) $this->input->post('subdistrict'),

            'bank' => $this->input->post('bank'),

            'bank1' => $this->input->post('bank1'),

            'time_duration_pending_to_cancel' => $this->input->post('td_p2c'),

            'time_duration_not_paid_to_cancel' => $this->input->post('td_np2c'),

            'time_duration_payment_reminder' => $this->input->post('td_pr'),

            'from_email' => $this->input->post('from_email'),

            'phone' => $this->input->post('phone'),

            'browser_title' => $this->input->post('browser_title'),

            'meta_description' => $this->input->post('meta_description'),

            /* 'product_comparison' => $this->input->post('product_comparison'), */

            'category_image_width' => $this->input->post('category_image_width'),

            'category_image_height' => $this->input->post('category_image_height'),

            'category_thumbnail_width' => $this->input->post('category_thumbnail_width'),

            'category_thumbnail_height' => $this->input->post('category_thumbnail_height'),

            'brand_image_width' => $this->input->post('brand_image_width'),

            'brand_image_height' => $this->input->post('brand_image_height'),

            'brand_logo_width' => $this->input->post('brand_logo_width'),

            'brand_logo_height' => $this->input->post('brand_logo_height'),

            'product_image_width' => $this->input->post('product_image_width'),

            'product_image_height' => $this->input->post('product_image_height'),

            'product_image_large_width' => $this->input->post('product_image_large_width'),

            'product_image_large_height' => $this->input->post('product_image_large_height'),

            'product_image_small_width' => $this->input->post('product_image_small_width'),

            'product_image_small_height' => $this->input->post('product_image_small_height'),

            'product_image_thumbnail_width' => $this->input->post('product_image_thumbnail_width'),

            'product_image_thumbnail_height' => $this->input->post('product_image_thumbnail_height'),

            'logo_image_width' => $this->input->post('logo_image_width'),

            'logo_image_height' => $this->input->post('logo_image_height'),

            'home_slideshow_width' => $this->input->post('home_slideshow_width'),

            'home_slideshow_height' => $this->input->post('home_slideshow_height'),

            'blog_image_width' => $this->input->post('blog_image_width'),

            'blog_image_height' => $this->input->post('blog_image_height'),

            'blog_thumbnail_width' => $this->input->post('blog_thumbnail_width'),

            'blog_thumbnail_height' => $this->input->post('blog_thumbnail_height'),

            'products_displayed' => $this->input->post('products_displayed'),

            'google_analytic_id' => $this->input->post('google_analytic_id'),

            'google_analytic_info' => $this->input->post('google_analytic_info'),

            'tawkto_id' => $this->input->post('tawkto_id'),

            'tawkto_info' => $this->input->post('tawkto_info'),

            'facebook' => $this->input->post('facebook'),

            'twitter' => $this->input->post('twitter'),

            'instagram' => $this->input->post('instagram'),

            'youtube' => $this->input->post('youtube'),

            'email_smtp_host' => $this->input->post('email_smtp_host'),

            'email_smtp_port' => $this->input->post('email_smtp_port'),

            'email_smtp' => $this->input->post('email_smtp'),

            'email_smtp_password' => $this->input->post('email_smtp_password'),



            'staticbanner1_image_width' => $this->input->post('staticbanner1_image_width'),



            'staticbanner1_image_height' => $this->input->post('staticbanner1_image_height'),



            'staticbanner2_image_width' => $this->input->post('staticbanner2_image_width'),



            'staticbanner2_image_height' => $this->input->post('staticbanner2_image_height'),



            'staticbanner3_image_width' => $this->input->post('staticbanner3_image_width'),



            'staticbanner3_image_height' => $this->input->post('staticbanner3_image_height'),



            'staticbanner4_image_width' => $this->input->post('staticbanner4_image_width'),



            'staticbanner4_image_height' => $this->input->post('staticbanner4_image_height'),



            'staticbanner5_image_width' => $this->input->post('staticbanner5_image_width'),



            'staticbanner5_image_height' => $this->input->post('staticbanner5_image_height'),



            'staticbanner6_image_width' => $this->input->post('staticbanner6_image_width'),



            'staticbanner6_image_height' => $this->input->post('staticbanner6_image_height'),

            'featuredproduct_image_width' => $this->input->post('featuredproduct_image_width'),

            'featuredproduct_image_height' => $this->input->post('featuredproduct_image_height'),



            'ppn_active' => $this->input->post('ppn_active'),

            'jne_reg' => $this->input->post('jne_reg'),

            'jne_yes' => $this->input->post('jne_yes'),

            'jne_oke' => $this->input->post('jne_oke'),

            'tiki_reg' => $this->input->post('tiki_reg'),

            'tiki_ons' => $this->input->post('tiki_ons'),

            'tiki_eco' => $this->input->post('tiki_eco'),

            'pos_regular' => $this->input->post('pos_regular'),

            'pos_express' => $this->input->post('pos_express'),

            'rpx_regular' => $this->input->post('rpx_regular'),

            'rpx_retail' => $this->input->post('rpx_retail'),

            'sicepat_reg' => $this->input->post('sicepat_reg'),

            'sicepat_best' => $this->input->post('sicepat_best'),

            'sicepat_priority' => $this->input->post('sicepat_priority'),

            'jnt_express' => $this->input->post('jnt_express'),

            'shop_delivery' => $this->input->post('shop_delivery'),

            'gosend' => $this->input->post('gosend'),

            'gosend_fee' => $this->input->post('gosend_fee'),

            'gosend_minimum_fee' => $this->input->post('gosend_minimum_fee'),

            'free_shipping_type_subsidi' => $this->input->post('free_shipping_type_subsidi'),

            'shopdelivery_duration' => $this->input->post('shopdelivery_duration'),

            'free_shipping_shop_area' => $this->input->post('free_shipping_shop_area'),

            'free_shipping_type' => $this->input->post('free_shipping_type'),



            'type_cond_prov_free_shipping' => $this->input->post('type_cond_prov_free_shipping'),

            'cond_more_prov_free_shipping' => $this->input->post('cond_more_prov_free_shipping'),

            'cond_less_prov_free_shipping' => $this->input->post('cond_less_prov_free_shipping'),



            'shopdelivery_fee' => $this->input->post('shopdelivery_fee'),

            'veritrans_fee' => $this->input->post('veritrans_fee'),

            'veritrans_admin' => $this->input->post('veritrans_admin'),

            'virtualaccount_admin' => $this->input->post('virtualaccount_admin'),

            'bank_transfer' => $this->input->post('bank_transfer'),

            'bank_transfer1' => $this->input->post('bank_transfer1'),

            'midtrans' => $this->input->post('midtrans'),

            'credit_card' => $this->input->post('credit_card'),

            'permata_va' => $this->input->post('permata_va'),

            'bni_va' => $this->input->post('bni_va'),

            'mandiri_bill' => $this->input->post('mandiri_bill'),

            'akulaku' => $this->input->post('akulaku'),

            'gopay' => $this->input->post('gopay'),

            'cod' => $this->input->post('cod'),

            'primary_color_theme' => $this->input->post('primary_color_theme'),

            'website_active' => $this->input->post('website_active'),

            'website_ip' => str_replace(' ', '', $this->security->xss_clean($this->input->post('website_ip'))),

            'shop_latitude' => $this->input->post('shop_latitude'),

            'shop_longitude' => $this->input->post('shop_longitude'),

            'show_product_sku' => $this->input->post('show_product_sku'),

            'show_product_weight' => $this->input->post('show_product_weight'),

            'show_product_stock' => $this->input->post('show_product_stock'),

            'website_default_language' => $this->input->post('website_default_language'),

            'default_carrier' => $this->input->post('default_carrier'),

            'cart_abandon_notification' => $this->security->xss_clean($this->input->post('cart_abandon_notification')),

            // 'top_menu_position' => $this->input->post('top_menu_position'),

         );



         str_replace(',', '', $this->input->post('product_attributes'));



         if ($this->input->post('free_shipping') == '') {

            $data['free_shipping'] = NULL;

         } else {

            $data['free_shipping'] = (int) $this->input->post('free_shipping');

         }



         //image upload

         if (isset($logo_filename)) {

            $data['logo'] = $logo_filename;

         }



         //midtrans logo upload

         if (isset($midtrans_logo_filename)) {

            $data['midtrans_logo'] = $midtrans_logo_filename;

         }



         //image upload

         if (isset($website_icon_filename)) {

            $data['website_icon'] = $website_icon_filename;

         }



         //image upload

         if (isset($image_not_available_filename)) {

            $data['image_not_available'] = $image_not_available_filename;

         }



         $this->configuration_m->edit_configuration($id, $data);



         if ($this->input->post('free_shipping_type') == 'region') {

            //insert into region free shipping method

            //delete all current region free shipping method

            $this->db->where('configuration_id', 1);

            $this->db->delete('free_shipping_region');



            $region_province   = $this->input->post('region_province');

            $count_rp          = count($region_province);

            for ($fsm = 0; $fsm < $count_rp; $fsm++) {

               $data_sm = array(

                  'configuration_id'   => 1,

                  'province_id' => $region_province[$fsm],

               );

               $this->db->insert('free_shipping_region', $data_sm);

            }

            //insert into region free shipping method

         }

         if ($this->input->post('free_shipping_type') == 'global') {

            $data_sm = array(

               'min_transaction'          => $this->security->xss_clean($this->input->post('min_transaction')),

            );

            $this->db->where('configuration_id', 1);

            $this->db->update('free_shipping_global', $data_sm);

         }



         //update modules





         $data_module = array(

            'home_slideshow' => $this->input->post('home_slideshow'),

            'static_banner' => $this->input->post('static_banner'),

            'new_arrival' => $this->input->post('new_arrival'),

            'best_seller' => $this->input->post('best_seller'),

            'featured' => $this->input->post('featured'),

            'flashsale' => $this->input->post('flashsale'),

            'testimonial' => $this->input->post('testimonial'),

            'brand' => $this->input->post('brand'),

            'blog' => $this->input->post('blog'),

            'kategori_kolom' => $this->input->post('kategori_kolom'),

            'best_seller_kolom' => $this->input->post('best_seller_kolom'),

            'brand_kolom' => $this->input->post('brand_kolom'),

            'price_kolom' => $this->input->post('price_kolom'),

            'product_review' => $this->input->post('product_review'),

            'newsletter' => $this->input->post('newsletter'),

            'live_chat' => $this->input->post('live_chat'),

            'language' => $this->input->post('language')

         );

         $this->db->where('id', 1);

         $this->db->update('modules', $data_module);



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



         redirect('admin/configuration/edit');

      }



      $this->db->select('*')->from('modules')->where('id', 1);

      $this->data['modules'] = $this->db->get()->result();



      $this->data['error'] = '';

      $this->data['subview'] = 'admin/configuration/edit';

      $this->load->view('admin/templates/header', $this->data_header);

      $this->load->view('admin/_layout_main', $this->data);

      $this->load->view('admin/templates/footer');

   }



   //To delete logo file from server, and from database

   public function delete_logo()

   {



      //get image file name for deletion

      $this->db->select('logo')->from('configuration')->where('id_configuration', 1);

      $image = $this->db->get()->row();



      //Delete the actual image file from server. FCPATH is codeigniter base path

      unlink(FCPATH . '/uploads/' . $image->logo);



      //Delete logo field from configuration database

      $data = array(

         'logo' => '',

      );



      $this->db->where('id_configuration', 1);

      $this->db->update('configuration', $data);



      $this->session->set_flashdata('success', '<br><p style="background:green; color:white; padding:5px; font-weight:bold;">Logo Delete Successful</p>');



      redirect('admin/configuration/edit');

   }



   //To delete midtrans logo file from server, and from database

   public function delete_midtrans_logo()

   {



      //get image file name for deletion

      $this->db->select('midtrans_logo')->from('configuration')->where('id_configuration', 1);

      $midtrans_logo = $this->db->get()->row();



      //Delete the actual image file from server. FCPATH is codeigniter base path

      unlink(FCPATH . '/uploads/' . $midtrans_logo->midtrans_logo);



      //Delete logo field from configuration database

      $data = array(

         'midtrans_logo' => '',

      );



      $this->db->where('id_configuration', 1);

      $this->db->update('configuration', $data);



      $this->session->set_flashdata('success', '<br><p style="background:green; color:white; padding:5px; font-weight:bold;">Midtrans Logo Delete Successful</p>');



      redirect('admin/configuration/edit');

   }



   //To delete website icon from server, and from database

   public function delete_website_icon()

   {



      //get image file name for deletion

      $this->db->select('website_icon')->from('configuration')->where('id_configuration', 1);

      $website_icon = $this->db->get()->row()->website_icon;



      //Delete the actual image file from server. FCPATH is codeigniter base path

      unlink(FCPATH . '/uploads/' . $website_icon);



      //Delete website_icon field from configuration database

      $data = array(

         'website_icon' => '',

      );



      $this->db->where('id_configuration', 1);

      $this->db->update('configuration', $data);



      $this->session->set_flashdata('success', '<br><p style="background:green; color:white; padding:5px; font-weight:bold;">Website Icon Delete Successful</p>');



      redirect('admin/configuration/edit');

   }



   public function delete_image_not_available()

   {



      //get image file name for deletion

      $this->db->select('image_not_available')->from('configuration')->where('id_configuration', 1);

      $image_not_available = $this->db->get()->row()->image_not_available;



      //Delete the actual image file from server. FCPATH is codeigniter base path

      unlink(FCPATH . '/uploads/' . $image_not_available);



      //Delete website_icon field from configuration database

      $data = array(

         'image_not_available' => '',

      );



      $this->db->where('id_configuration', 1);

      $this->db->update('configuration', $data);



      $this->session->set_flashdata('success', '<br><p style="background:green; color:white; padding:5px; font-weight:bold;">Image Placeholder Delete Successful</p>');



      redirect('admin/configuration/edit');

   }

}


https://t.me/RX1948 - 2025