| 12694 |
anikendra |
1 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
2 |
|
|
|
3 |
class Contact extends MY_Controller {
|
|
|
4 |
|
|
|
5 |
public $layoutName ='';
|
|
|
6 |
|
|
|
7 |
function __construct() {
|
|
|
8 |
|
|
|
9 |
// Call the CI_controller constructor
|
|
|
10 |
parent::__construct();
|
|
|
11 |
|
|
|
12 |
$this->layout->setlayout('layout/layout_main');
|
|
|
13 |
$this->load->model('contact_model');
|
|
|
14 |
$this->layoutName= $this->layout->getLayout();
|
|
|
15 |
$this->layoutName =substr($this->layoutName , 0, strrpos($this->layoutName , "/")).'/';
|
|
|
16 |
//print_r($this->session->userdata);
|
|
|
17 |
|
|
|
18 |
}
|
|
|
19 |
public function index()
|
|
|
20 |
{
|
|
|
21 |
if(!isset($_POST['submit'])){
|
|
|
22 |
// $authorized = $this->session->userdata('authorized');
|
|
|
23 |
// if(isset($authorized) and !empty($authorized['id']))
|
|
|
24 |
// {
|
|
|
25 |
// //if user logged-in
|
|
|
26 |
// $_GET['customerId'] = $authorized['id'];
|
|
|
27 |
// }
|
|
|
28 |
//standard array
|
|
|
29 |
$data = array();
|
|
|
30 |
$this->lessphp->object()->ccompile('assets/css/profile.less','assets/css/profile.css');
|
|
|
31 |
$data['stylesheet'] = 'profile.css';
|
|
|
32 |
$data['title'] = 'Contact us | saholic.com';
|
|
|
33 |
$data['response']=$this->contact_model->getOrder($this->input->get(),$this->input->post(),$this->config->item('contactUs'));
|
|
|
34 |
$this->layout->view('contact/contact_view',$data);
|
|
|
35 |
}elseif(isset($_POST['submit'])){
|
|
|
36 |
if(isset($_POST['category']) && !empty($_POST['category'])){
|
|
|
37 |
$authorized = $this->session->userdata('authorized');
|
|
|
38 |
if(isset($authorized) && !empty($authorized)){
|
|
|
39 |
$_POST['userId'] = $authorized['Id'];
|
|
|
40 |
if($authorized['isLoggedIn'] == 1){
|
|
|
41 |
$_POST['isLoggedIn'] = 'true';
|
|
|
42 |
}
|
|
|
43 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
44 |
$_POST['isLoggedIn'] = 'false';
|
|
|
45 |
}
|
|
|
46 |
}
|
|
|
47 |
$_POST['communication_type'] = $_POST['category'];
|
|
|
48 |
$contactConfig = $this->config->item('contactUs');
|
|
|
49 |
$this->lessphp->object()->ccompile('assets/css/profile.less','assets/css/profile.css');
|
|
|
50 |
$data['stylesheet'] = 'profile.css';
|
|
|
51 |
$data['response']=$this->contact_model->getOrder($this->input->get(),$this->input->post(),$contactConfig);
|
|
|
52 |
if(isset($data['response']['response']['contact_us'][0]->response) && !empty($data['response']['response']['contact_us'][0]->response)){
|
|
|
53 |
//print_r($data['response']['response']['contact_us'][0]->response);
|
|
|
54 |
$this->layout->view('contact/contact_view',$data);
|
|
|
55 |
}else{
|
|
|
56 |
redirect(base_url().'contact-us');
|
|
|
57 |
}
|
|
|
58 |
}
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
public function returnProduct(){
|
|
|
64 |
$params = array();
|
|
|
65 |
$authorized = $this->session->userdata('authorized');
|
|
|
66 |
if(isset($authorized) && !empty($authorized)){
|
|
|
67 |
$params['userId'] = $authorized['Id'];
|
|
|
68 |
if($authorized['isLoggedIn'] == 1){
|
|
|
69 |
$params['isLoggedIn'] = 'true';
|
|
|
70 |
}
|
|
|
71 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
72 |
$params['isLoggedIn'] = 'false';
|
|
|
73 |
}
|
|
|
74 |
}
|
|
|
75 |
$configUrl = $this->config->item('returnProduct');
|
|
|
76 |
$configUrl = $configUrl['url'];
|
|
|
77 |
$url = $this->config->item('curl_base_url').$configUrl;
|
|
|
78 |
$this->mcurl->add_call('returnProduct','get',$url,$params);
|
|
|
79 |
$response = $this->mcurl->execute($url);
|
|
|
80 |
$data['response'] = $response['returnProduct']['response'];
|
|
|
81 |
print_r($data['response']);
|
|
|
82 |
|
|
|
83 |
}
|
|
|
84 |
|
|
|
85 |
public function cancelOd(){
|
|
|
86 |
$params = array();
|
|
|
87 |
$authorized = $this->session->userdata('authorized');
|
|
|
88 |
if(isset($authorized) && !empty($authorized)){
|
|
|
89 |
$params['userId'] = $authorized['Id'];
|
|
|
90 |
if($authorized['isLoggedIn'] == 1){
|
|
|
91 |
$params['isLoggedIn'] = 'true';
|
|
|
92 |
}
|
|
|
93 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
94 |
$params['isLoggedIn'] = 'false';
|
|
|
95 |
}
|
|
|
96 |
}
|
|
|
97 |
$configUrl = $this->config->item('cancelOrder');
|
|
|
98 |
$configUrl = $configUrl['url'];
|
|
|
99 |
$url = $this->config->item('curl_base_url').$configUrl;
|
|
|
100 |
$this->mcurl->add_call('cancelOrder','get',$url,$params);
|
|
|
101 |
$response = $this->mcurl->execute($url);
|
|
|
102 |
$data['response'] = $response['cancelOrder']['response'];
|
|
|
103 |
print_r($data['response']);
|
|
|
104 |
|
|
|
105 |
}
|
|
|
106 |
|
|
|
107 |
public function deliveryPb(){
|
|
|
108 |
$params = array();
|
|
|
109 |
$authorized = $this->session->userdata('authorized');
|
|
|
110 |
if(isset($authorized) && !empty($authorized)){
|
|
|
111 |
$params['userId'] = $authorized['Id'];
|
|
|
112 |
if($authorized['isLoggedIn'] == 1){
|
|
|
113 |
$params['isLoggedIn'] = 'true';
|
|
|
114 |
}
|
|
|
115 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
116 |
$params['isLoggedIn'] = 'false';
|
|
|
117 |
}
|
|
|
118 |
}
|
|
|
119 |
$configUrl = $this->config->item('deliveryProblem');
|
|
|
120 |
$configUrl = $configUrl['url'];
|
|
|
121 |
$url = $this->config->item('curl_base_url').$configUrl;
|
|
|
122 |
$this->mcurl->add_call('deliveryProblem','get',$url,$params);
|
|
|
123 |
$response = $this->mcurl->execute($url);
|
|
|
124 |
$data['response'] = $response['deliveryProblem']['response'];
|
|
|
125 |
print_r($data['response']);
|
|
|
126 |
|
|
|
127 |
}
|
|
|
128 |
|
|
|
129 |
public function paymentStat(){
|
|
|
130 |
$params = array();
|
|
|
131 |
$authorized = $this->session->userdata('authorized');
|
|
|
132 |
if(isset($authorized) && !empty($authorized)){
|
|
|
133 |
$params['userId'] = $authorized['Id'];
|
|
|
134 |
if($authorized['isLoggedIn'] == 1){
|
|
|
135 |
$params['isLoggedIn'] = 'true';
|
|
|
136 |
}
|
|
|
137 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
138 |
$params['isLoggedIn'] = 'false';
|
|
|
139 |
}
|
|
|
140 |
}
|
|
|
141 |
$configUrl = $this->config->item('paymentStatus');
|
|
|
142 |
$configUrl = $configUrl['url'];
|
|
|
143 |
$url = $this->config->item('curl_base_url').$configUrl;
|
|
|
144 |
$this->mcurl->add_call('paymentStatus','get',$url,$params);
|
|
|
145 |
$response = $this->mcurl->execute($url);
|
|
|
146 |
$data['response'] = $response['paymentStatus']['response'];
|
|
|
147 |
print_r($data['response']);
|
|
|
148 |
}
|
|
|
149 |
|
|
|
150 |
public function orderStat(){
|
|
|
151 |
$params = array();
|
|
|
152 |
$authorized = $this->session->userdata('authorized');
|
|
|
153 |
if(isset($authorized) && !empty($authorized)){
|
|
|
154 |
$params['userId'] = $authorized['Id'];
|
|
|
155 |
if($authorized['isLoggedIn'] == 1){
|
|
|
156 |
$params['isLoggedIn'] = 'true';
|
|
|
157 |
}
|
|
|
158 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
159 |
$params['isLoggedIn'] = 'false';
|
|
|
160 |
}
|
|
|
161 |
}
|
|
|
162 |
$configUrl = $this->config->item('orderStatus');
|
|
|
163 |
$configUrl = $configUrl['url'];
|
|
|
164 |
$url = $this->config->item('curl_base_url').$configUrl;
|
|
|
165 |
$this->mcurl->add_call('orderStatus','get',$url,$params);
|
|
|
166 |
$response = $this->mcurl->execute($url);
|
|
|
167 |
$data['response'] = $response['orderStatus']['response'];
|
|
|
168 |
print_r($data['response']);
|
|
|
169 |
}
|
|
|
170 |
|
|
|
171 |
}
|
|
|
172 |
|
|
|
173 |
|
|
|
174 |
|
|
|
175 |
/* End of file welcome.php */
|
|
|
176 |
/* Location: ./application/controllers/welcome.php */
|