PHP File Manager
Editing File: Settings.php
<?php /* * Copyright (C) Wayne Purton-Smith - All Rights Reserved * Unauthorized copying of this file or removing this paragraph, via any medium is strictly prohibited * Proprietary and confidential * Written by Wayne Purton-Smith <waynepurtonsmith@hotmail.co.uk> February 2014 */ class Settings extends CI_Controller { public function index() { if($this->input->post('update_settings')) { $this->common->saveSettings($this->input->post()); redirect('/settings'); exit; } if($this->input->post('save_delivery_types')) { $this->orders->saveDeliveryTypes($this->input->post()); redirect('/settings'); exit; } if($this->input->post('save_locations')) { $this->common->saveOriginLocations($this->input->post()); redirect('/settings'); exit; } if($this->input->post('get_rate')) { $rate_info = $this->orders->getPostcodeRates($this->input->post('get_rate')); exit_with_json(array('success' => !empty($rate_info), 'rate' => $rate_info)); } if($this->input->post('save_rate')) { exit_with_json(array('success' => $this->orders->savePostcodeRate($this->input->post(), $this->input->post('rate_id')), 'msg' => $this->common->getResponseMessage())); } if($this->input->post('delete_rate')) { exit_with_json(array('success' => $this->orders->deletePostcodeRate($this->input->post('delete_rate')))); } $head_data['page_title'] = 'Main settings'; $this->load->view('header', $head_data); $data['settings'] = array ( 'main_site_title' => array('Site title ' . help_link('settings-site-title'), 'This title is displayed on every web page', NULL, 'col-sm-6'), 'meta_description' => array('Meta description' . help_link('settings-meta-description'), 'This is typically shown on the small description in search engines', NULL, 'col-sm-9'), 'meta_keywords' => array('Meta keywords', 'Not mainly used by search engines, but this is typically used for reference.<br />Must be separated by commas', NULL, 'col-sm-9'), 'maps_api_key' => array('Maps key', 'Only used for the Google Maps service. <a href="https://code.google.com/apis/console/" target="_blank">Obtain an API key here</a>', NULL, 'col-sm-7'), 'google_analytics_code' => array('Google Analytics', 'You can enter your Google Analytics tracking ID to retrieve statistics from Google. <a href="http://www.google.com/analytics/" target="_blank">Get one here</a>', NULL, 'col-sm-2') ); $data['shop_settings'] = array ( 'common' => array ( 'vat' => array('VAT', 'Changing this will only affect future orders', '%'), 'vat_number' => array('VAT number'), 'minimum_items' => array('Minimum items', 'The minimum number of items needed to checkout. Leave blank to disable'), ), 'delivery' => array ( 'delivery_free_over' => array('Free delivery', 'If an order total goes over this amount, the delivery charge will be free. Leave blank to disable', '£'), ), 'paypal' => array ( 'paypal_id' => array('PayPal Merchant ID', 'You can find this in your PayPal profile details'), 'paypal_pdt_token' => array('PayPal PDT ID', 'This is typically recommended in order to confirm payments after checkouts.<br />Fallbacks to IPN checking if PDT is not provided'), 'paypal_api_username' => array('PP API username', 'You should be able to find your <a href="https://www.paypal.com/uk/cgi-bin/webscr?cmd=_profile-api-signature" target="_blank">PayPal API credentials here</a>'), 'paypal_api_password' => array('PP API password'), 'paypal_api_signature' => array('PP API signature') ) ); $data['status_types'] = $this->orders->getOrderStatuses(); $data['delivery_types'] = array_merge($this->orders->getDeliveryTypes(), array(-1)); $data['origin_locations'] = (($origin_locations = $this->common->getOriginLocations())) ? $origin_locations : array(-1); $data['postcode_rates'] = $this->orders->getPostcodeRates(); $this->load->view('settings', $data); $this->load->view('footer'); } public function notes($mode = NULL, $sub_mode = NULL) { if(!wayne()) { redirect('/'); exit; } if($mode == 'delete') { exit_with_json(array('success' => $this->notes->delete($sub_mode))); } else if($mode == 'solve') { exit_with_json(array('success' => $this->notes->solve($sub_mode))); } $head_data['page_title'] = 'Page notes'; $this->load->view('header', $head_data); $data['page_notes'] = $this->notes->get(NULL, NULL, true); $this->load->view('page-notes', $data); $this->load->view('footer'); } }
Cancel