Subversion Repositories SmartDukaan

Rev

Rev 11012 | Rev 11071 | 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');
72
    unset($configdata['response'][0]);
73
    unset($configdata['response'][2]);
74
    $cachemodule = array('header','footer','response');
75
    $configdata = getCache($configdata,$cachemodule);
76
    $newData = array();
77
    foreach ($configdata['response'] as $key => $value) {
78
      $newData[] = $value;
79
    }
80
    $newparams = array();
81
    if(isset($configdata['response'])){
82
      foreach($newData as $key => $value){
83
        if(!array_key_exists($value,$configdata['response'])){
84
          $api = 1;
85
        }
86
      }
87
    }
88
    //end of get cache
89
    $this->lessphp->object()->ccompile('assets/css/recharge.less','assets/css/recharge.css');
90
    $data['stylesheet'] = 'recharge.css';
91
    if(isset($api) && $api == 1){
92
      $data['response']=$this->faq_model->getHome($this->input->get(),$this->input->post(),$configdata);
93
    }elseif(!isset($api)){
94
      $data['response']=$this->faq_model->getHome($this->input->get(),$this->input->post(),$configdata['module']);
95
    }
96
    //print_r($data['response']);
97
    $tmp = $data['response'];
98
    //set cache to output or renew cache
99
    if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
100
    {
101
      foreach($cachemodule as $cm)
102
      {
103
        if(isset($configdata[$cm]) and !empty($configdata[$cm]))
104
        {
105
          $data['response'][$cm]=$configdata[$cm];
106
        }
107
      }
108
    }
109
    if(isset($data['response']['response'])){
110
      foreach($newData as $key => $value){
111
        if(!array_key_exists($value,$data['response']['response'])){
112
          $noCache = 1;
113
        }
114
      }
115
    }
116
    //print_r($newparams);
117
    if(!isset($noCache)){
118
      setCache($configdata['module'],$cachemodule,$data['response']);
119
    }
120
    //end of set cache\
121
    $this->layout->view('faq/faq_view',$data);
122
  }
10841 lgm 123
}
124
 
125
/* End of file welcome.php */
126
/* Location: ./application/controllers/welcome.php */