Subversion Repositories SmartDukaan

Rev

Rev 11032 | Rev 11108 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10841 lgm 1
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
 
3
class Faq extends MY_Controller {
4
 
5
public $layoutName ='';
6
 
7
  function __construct() {
8
 
9
    // Call the CI_controller constructor
10
    parent::__construct();
11
    $admin = $this->session->userdata('admin');
12
    if(!isset($admin) || empty($admin)) {
13
      redirect(base_url().'authorize');
14
    }
15
    $this->layout->setlayout('layout/layout_main');
16
    $this->load->model('faq_model');
17
    $this->layoutName= $this->layout->getLayout();
18
    $this->layoutName =substr($this->layoutName , 0, strrpos($this->layoutName , "/")).'/';
19
    // print_r($this->session->all_userdata());
20
 
21
 
22
  }
23
  public function index(){
24
   $data = array();
25
    //get cache 
26
    $configdata =array();
27
    $configdata = $this->config->item('faq');
28
    $cachemodule = array('header','footer');
29
    $configdata = getCache($configdata,$cachemodule);
30
    //end of get cache
31
    $this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
32
    $data['stylesheet'] = 'recharge.css';
11012 lgm 33
    $data['title'] = 'Frequently asked quesitons | saholic.com';
10841 lgm 34
    $data['response']=$this->faq_model->getHome($this->input->get(),$this->input->post(),$this->config->item('faq'));
35
    $this->layout->view('faq/faq_view',$data);
36
  }
37
 
38
  public function privacy(){
39
   // $data = array();
40
    //get cache 
41
    $configdata =array();
42
    $configdata = $this->config->item('faq');
43
    $cachemodule = array('header','footer');
44
    $configdata = getCache($configdata,$cachemodule);
45
    //end of get cache
46
    $this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
47
    $data['stylesheet'] = 'recharge.css';
11012 lgm 48
    $data['title'] = 'Privacy Policy | saholic.com';
10841 lgm 49
    $data['response']=$this->faq_model->getHome($this->input->get(),$this->input->post(),$this->config->item('faq'));
50
    $this->layout->view('faq/privacy_policy',$data);
51
  }
52
 
53
  public function terms(){
54
   // $data = array();
55
    //get cache 
56
    $configdata =array();
57
    $configdata = $this->config->item('faq');
58
    $cachemodule = array('header','footer');
59
    $configdata = getCache($configdata,$cachemodule);
60
    //end of get cache
61
    $this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
62
    $data['stylesheet'] = 'recharge.css';
11012 lgm 63
    $data['title'] = 'Terms & Conditions | saholic.com';
10841 lgm 64
    $data['response']=$this->faq_model->getHome($this->input->get(),$this->input->post(),$this->config->item('faq'));
65
    $this->layout->view('faq/terms_conditions',$data);
66
  }
11032 lgm 67
  public function emi(){
68
   $data = array();
69
    //get cache 
70
    $configdata =array();
71
    $configdata = $this->config->item('payment');
11071 lgm 72
    $checkConfig = $this->config->item('payment');
11032 lgm 73
    unset($configdata['response'][0]);
74
    unset($configdata['response'][2]);
11071 lgm 75
    unset($checkConfig['response'][0]);
76
    unset($checkConfig['response'][2]);
11032 lgm 77
    $cachemodule = array('header','footer','response');
78
    $configdata = getCache($configdata,$cachemodule);
79
    $newData = array();
11071 lgm 80
    foreach ($checkConfig['response'] as $key => $value) {
11032 lgm 81
      $newData[] = $value;
82
    }
83
    $newparams = array();
84
    if(isset($configdata['response'])){
85
      foreach($newData as $key => $value){
86
        if(!array_key_exists($value,$configdata['response'])){
87
          $api = 1;
88
        }
89
      }
90
    }
91
    //end of get cache
92
    $this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
93
    $data['stylesheet'] = 'recharge.css';
94
    if(isset($api) && $api == 1){
11071 lgm 95
      $data['response']=$this->faq_model->getHome($this->input->get(),$this->input->post(),$checkConfig);
11032 lgm 96
    }elseif(!isset($api)){
97
      $data['response']=$this->faq_model->getHome($this->input->get(),$this->input->post(),$configdata['module']);
98
    }
99
    //print_r($data['response']);
100
    $tmp = $data['response'];
101
    //set cache to output or renew cache
102
    if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
103
    {
104
      foreach($cachemodule as $cm)
105
      {
106
        if(isset($configdata[$cm]) and !empty($configdata[$cm]))
107
        {
108
          $data['response'][$cm]=$configdata[$cm];
109
        }
110
      }
111
    }
112
    if(isset($data['response']['response'])){
113
      foreach($newData as $key => $value){
114
        if(!array_key_exists($value,$data['response']['response'])){
115
          $noCache = 1;
116
        }
117
      }
118
    }
119
    //print_r($newparams);
120
    if(!isset($noCache)){
121
      setCache($configdata['module'],$cachemodule,$data['response']);
122
    }
123
    //end of set cache\
124
    $this->layout->view('faq/faq_view',$data);
125
  }
10841 lgm 126
}
127
 
128
/* End of file welcome.php */
129
/* Location: ./application/controllers/welcome.php */