Overview

Packages

  • controller
  • models
  • None

Classes

  • Ajax
  • Article
  • Cache
  • Employee
  • Firefly
  • gmreader
  • gmsite
  • Home
  • Link
  • Merchant
  • Model_article
  • Model_cache
  • Model_employee
  • Model_firefly
  • Model_gmreader
  • Model_gmsite
  • Model_link
  • Model_merchant
  • Model_reference
  • Model_user
  • Reference
  • Setting
  • User

Functions

  • check_permission
  • data_status
  • data_status_select
  • dump_html_tree
  • employee_select
  • file_get_html
  • generate_page
  • gerenate_pager_from_table
  • get_desc_asc
  • get_url_support
  • is_admin
  • is_loggedin
  • link_extractor
  • merchant_status
  • reference_reverter
  • role_select
  • siteinfo
  • str_get_html
  • yes_no
  • yesno_select
  • Overview
  • Package
  • Class
 1: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 2: 
 3: /**
 4:  * The Setting class is the controller used for settings tab.
 5:  *
 6:  * @package   Controller
 7:  * @version   0.01
 8:  * @since     2014-04-03
 9:  * @author    Rizwan Ali <riz@bitspro.com>
10:  */
11: 
12: class Setting extends CI_Controller {
13: 
14: 
15:     /**
16:      * Load cache driver so that we can clear it with clean function
17:      *
18:      * @since   2014-04-03
19:      * @author  Rizwan Ali <riz@bitspro.com>
20:      */
21: 
22:     function __construct(){
23:         parent::__construct();
24:         $this->load->driver('cache', array('backup' => 'file'));
25:     }
26: 
27:     /**
28:      * Allow admin to remove any duplicate indexes from the database
29:      *
30:      * @param null
31:      *
32:      * @return  view
33:      *
34:      * @since   2014-04-03
35:      * @author  Rizwan Ali <riz@bitspro.com>
36:      *
37:      */
38: 
39:     public function duplicate_index()
40:     {
41:         $duplicate_index = $this->db->select('index_title')->from('xenon_index')->group_by('index_title')->having('count(*) >',1)->get();
42:         if($duplicate_index->num_rows() > 0){
43:             $index_titles = array();
44:             foreach($duplicate_index->result() as $index){
45:                 $index_titles[] = $index->index_title;
46:             }
47:         }
48:         $this->load->view('head');
49:         $this->load->view('setting/duplicate_index',array('index_titles'=>$index_titles));
50:         $this->load->view('foot');
51:     }
52: 
53:     /**
54:      * Landing page for settings tab
55:      *
56:      * @param null
57:      *
58:      * @return  view
59:      *
60:      * @since   2015-12-28
61:      * @author  Rizwan Ali <riz@bitspro.com>
62:      *
63:      */
64: 
65:     public function index(){
66:         $this->load->view('head');
67:         $this->load->view('setting/landing');
68:         $this->load->view('foot');
69:     }
70: 
71: 
72:     /**
73:      * Allows admin to clean object cache, depending on type it cleans admin or services cache
74:      *
75:      * @param string $type
76:      *
77:      * @return string|redirect
78:      *
79:      * @since   2014-04-03
80:      * @author  Rizwan Ali <riz@bitspro.com>
81:      */
82:     public function clean($type = ''){
83:         if($type == ''){
84:             if($this->cache->file->clean()!==FALSE){
85:                 redirect('employee');
86:             }else{
87:                 $this->load->view('head');
88:                 echo 'Cache deletion failed.';
89:                 $this->load->view('foot');
90:             }
91:         }else if($type == 'services'){
92:             header('Location:http://services.greenmedicineworks.com/_clean_it');
93:         }
94:     }
95: }?>
API documentation generated by ApiGen