| 12694 |
anikendra |
1 |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
2 |
|
|
|
3 |
class Myaccount 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 |
$authorized = $this->session->userdata('authorized');
|
|
|
16 |
if(!isset($authorized) || empty($authorized)){
|
|
|
17 |
$method = $this->router->fetch_method();
|
|
|
18 |
if(strcasecmp($method, 'wallet') == 0){
|
|
|
19 |
$this->session->set_userdata('location','my-wallet');
|
|
|
20 |
}elseif(strcasecmp($method, 'recharges') == 0){
|
|
|
21 |
$this->session->set_userdata('location','my-recharges');
|
|
|
22 |
}
|
|
|
23 |
redirect(base_url().'auth/login');
|
|
|
24 |
}
|
|
|
25 |
$this->layout->setlayout('layout/layout_main');
|
|
|
26 |
$this->load->model('myaccount_model');
|
|
|
27 |
$this->layoutName= $this->layout->getLayout();
|
|
|
28 |
$this->layoutName =substr($this->layoutName , 0, strrpos($this->layoutName , "/")).'/';
|
|
|
29 |
//print_r($this->session->userdata);
|
|
|
30 |
|
|
|
31 |
}
|
|
|
32 |
public function index()
|
|
|
33 |
{
|
|
|
34 |
redirect(base_url().'myaccount/closed');
|
|
|
35 |
$authorized = $this->session->userdata('authorized');
|
|
|
36 |
if(isset($authorized) && !empty($authorized)){
|
|
|
37 |
$_GET['userId'] = $authorized['Id'];
|
|
|
38 |
if($authorized['isLoggedIn'] == 1){
|
|
|
39 |
$_GET['isLoggedIn'] = 'true';
|
|
|
40 |
}
|
|
|
41 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
42 |
$_GET['isLoggedIn'] = 'false';
|
|
|
43 |
}
|
|
|
44 |
}
|
|
|
45 |
//standard array
|
|
|
46 |
$configdata = $this->config->item('myaccount');
|
|
|
47 |
$cachemodule = array('header','footer');
|
|
|
48 |
$configdata = getCache($configdata,$cachemodule);
|
|
|
49 |
$data = array();
|
|
|
50 |
$this->lessphp->object()->ccompile('assets/css/profile.less','assets/css/profile.css');
|
|
|
51 |
$data['stylesheet'] = 'profile.css';
|
|
|
52 |
$data['response']=$this->myaccount_model->getOrder($this->input->get(),$this->input->post(),$configdata['module']);
|
|
|
53 |
if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
|
|
|
54 |
{
|
|
|
55 |
foreach($cachemodule as $cm)
|
|
|
56 |
{
|
|
|
57 |
if(isset($configdata[$cm]) and !empty($configdata[$cm]))
|
|
|
58 |
{
|
|
|
59 |
$data['response'][$cm]=$configdata[$cm];
|
|
|
60 |
}
|
|
|
61 |
}
|
|
|
62 |
}
|
|
|
63 |
setCache($configdata['module'],$cachemodule,$data['response']);
|
|
|
64 |
$this->layout->view('myaccount/account_view',$data);
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
public function closed(){
|
|
|
68 |
$this->load->helper('text');
|
|
|
69 |
$authorized = $this->session->userdata('authorized');
|
|
|
70 |
if(isset($authorized) && !empty($authorized)){
|
|
|
71 |
$_GET['userId'] = $authorized['Id'];
|
|
|
72 |
if($authorized['isLoggedIn'] == 1){
|
|
|
73 |
$_GET['isLoggedIn'] = 'true';
|
|
|
74 |
}
|
|
|
75 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
76 |
$_GET['isLoggedIn'] = 'false';
|
|
|
77 |
}
|
|
|
78 |
}
|
|
|
79 |
//standard array
|
|
|
80 |
$configdata = $this->config->item('completed-orders');
|
|
|
81 |
//$checkConfig = $this->config->item('home');
|
|
|
82 |
$cachemodule = array('header','footer');
|
|
|
83 |
$configdata = getCache($configdata,$cachemodule);
|
|
|
84 |
$data = array();
|
|
|
85 |
$this->lessphp->object()->ccompile('assets/css/profile.less','assets/css/profile.css');
|
|
|
86 |
$data['stylesheet'] = 'profile.css';
|
|
|
87 |
$data['response']=$this->myaccount_model->getOrder($this->input->get(),$this->input->post(),$configdata['module']);
|
|
|
88 |
if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
|
|
|
89 |
{
|
|
|
90 |
foreach($cachemodule as $cm)
|
|
|
91 |
{
|
|
|
92 |
if(isset($configdata[$cm]) and !empty($configdata[$cm]))
|
|
|
93 |
{
|
|
|
94 |
$data['response'][$cm]=$configdata[$cm];
|
|
|
95 |
}
|
|
|
96 |
}
|
|
|
97 |
}
|
|
|
98 |
setCache($configdata['module'],$cachemodule,$data['response']);
|
|
|
99 |
$this->layout->view('myaccount/account_view',$data);
|
|
|
100 |
}
|
|
|
101 |
|
|
|
102 |
public function failed(){
|
|
|
103 |
|
|
|
104 |
$authorized = $this->session->userdata('authorized');
|
|
|
105 |
if(isset($authorized) && !empty($authorized)){
|
|
|
106 |
$_GET['userId'] = $authorized['Id'];
|
|
|
107 |
if($authorized['isLoggedIn'] == 1){
|
|
|
108 |
$_GET['isLoggedIn'] = 'true';
|
|
|
109 |
}
|
|
|
110 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
111 |
$_GET['isLoggedIn'] = 'false';
|
|
|
112 |
}
|
|
|
113 |
}
|
|
|
114 |
//standard array
|
|
|
115 |
$data = array();
|
|
|
116 |
$this->lessphp->object()->ccompile('assets/css/profile.less','assets/css/profile.css');
|
|
|
117 |
$data['stylesheet'] = 'profile.css';
|
|
|
118 |
$data['response']=$this->myaccount_model->getOrder($this->input->get(),$this->input->post(),$this->config->item('failed-orders'));
|
|
|
119 |
//if(isset($data['response']['response']['track_order']))
|
|
|
120 |
$this->layout->view('myaccount/account_view',$data);
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
public function purchases(){
|
|
|
124 |
|
|
|
125 |
$authorized = $this->session->userdata('authorized');
|
|
|
126 |
if(isset($authorized) && !empty($authorized)){
|
|
|
127 |
$_GET['userId'] = $authorized['Id'];
|
|
|
128 |
if($authorized['isLoggedIn'] == 1){
|
|
|
129 |
$_GET['isLoggedIn'] = 'true';
|
|
|
130 |
}
|
|
|
131 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
132 |
$_GET['isLoggedIn'] = 'false';
|
|
|
133 |
}
|
|
|
134 |
}
|
|
|
135 |
//standard array
|
|
|
136 |
$data = array();
|
|
|
137 |
$data['response']=$this->myaccount_model->getOrder($this->input->get(),$this->input->post(),$this->config->item('mypurchases'));
|
|
|
138 |
//if(isset($data['response']['response']['track_order']))
|
|
|
139 |
$this->layout->view('trackorder/trackorder_view',$data);
|
|
|
140 |
}
|
|
|
141 |
public function order(){
|
|
|
142 |
$last = $this->uri->total_segments();
|
|
|
143 |
$orderId = $this->uri->segment($last);
|
|
|
144 |
$authorized = $this->session->userdata('authorized');
|
|
|
145 |
if(isset($authorized) && !empty($authorized)){
|
|
|
146 |
$_GET['userId'] = $authorized['Id'];
|
|
|
147 |
if($authorized['isLoggedIn'] == 1){
|
|
|
148 |
$_GET['isLoggedIn'] = 'true';
|
|
|
149 |
}
|
|
|
150 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
151 |
$_GET['isLoggedIn'] = 'false';
|
|
|
152 |
}
|
|
|
153 |
}
|
|
|
154 |
//standard array
|
|
|
155 |
$data = array();
|
|
|
156 |
$configdata = $this->config->item('order');
|
|
|
157 |
//$checkConfig = $this->config->item('home');
|
|
|
158 |
$cachemodule = array('header','footer');
|
|
|
159 |
$configdata = getCache($configdata,$cachemodule);
|
|
|
160 |
$data = array();
|
|
|
161 |
$this->lessphp->object()->ccompile('assets/css/profile.less','assets/css/profile.css');
|
|
|
162 |
$data['stylesheet'] = 'profile.css';
|
|
|
163 |
$data['response']=$this->myaccount_model->getOrder($this->input->get(),$this->input->post(),$configdata['module']);
|
|
|
164 |
if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
|
|
|
165 |
{
|
|
|
166 |
foreach($cachemodule as $cm)
|
|
|
167 |
{
|
|
|
168 |
if(isset($configdata[$cm]) and !empty($configdata[$cm]))
|
|
|
169 |
{
|
|
|
170 |
$data['response'][$cm]=$configdata[$cm];
|
|
|
171 |
}
|
|
|
172 |
}
|
|
|
173 |
}
|
|
|
174 |
setCache($configdata['module'],$cachemodule,$data['response']);
|
|
|
175 |
//if(isset($data['response']['response']['track_order']))
|
|
|
176 |
$this->layout->view('myaccount/account_view',$data);
|
|
|
177 |
}
|
|
|
178 |
|
|
|
179 |
public function wallet(){
|
|
|
180 |
|
|
|
181 |
$authorized = $this->session->userdata('authorized');
|
|
|
182 |
if(isset($authorized) && !empty($authorized)){
|
|
|
183 |
$_GET['userId'] = $authorized['Id'];
|
|
|
184 |
if($authorized['isLoggedIn'] == 1){
|
|
|
185 |
$_GET['isLoggedIn'] = 'true';
|
|
|
186 |
}
|
|
|
187 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
188 |
$_GET['isLoggedIn'] = 'false';
|
|
|
189 |
}
|
|
|
190 |
}else{
|
|
|
191 |
redirect(base_url().'auth/login');
|
|
|
192 |
}
|
|
|
193 |
//standard array
|
|
|
194 |
$configdata = $this->config->item('my-wallet');
|
|
|
195 |
//$checkConfig = $this->config->item('home');
|
|
|
196 |
$cachemodule = array('header','footer');
|
|
|
197 |
$configdata = getCache($configdata,$cachemodule);
|
|
|
198 |
$data = array();
|
|
|
199 |
$data['response']=$this->myaccount_model->getOrder($this->input->get(),$this->input->post(),$configdata['module']);
|
|
|
200 |
if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
|
|
|
201 |
{
|
|
|
202 |
foreach($cachemodule as $cm)
|
|
|
203 |
{
|
|
|
204 |
if(isset($configdata[$cm]) and !empty($configdata[$cm]))
|
|
|
205 |
{
|
|
|
206 |
$data['response'][$cm]=$configdata[$cm];
|
|
|
207 |
}
|
|
|
208 |
}
|
|
|
209 |
}
|
|
|
210 |
setCache($configdata['module'],$cachemodule,$data['response']);
|
|
|
211 |
if(isset($data['response']['response']['wallet'][0]) && !empty($data['response']['response']['wallet'][0])){
|
|
|
212 |
$this->lessphp->object()->ccompile('assets/css/profile.less','assets/css/profile.css');
|
|
|
213 |
$data['stylesheet'] = 'profile.css';
|
|
|
214 |
$this->layout->view('myaccount/account_view',$data);
|
|
|
215 |
}else{
|
|
|
216 |
redirect(base_url());
|
|
|
217 |
}
|
|
|
218 |
}
|
|
|
219 |
public function recharges(){
|
|
|
220 |
|
|
|
221 |
$authorized = $this->session->userdata('authorized');
|
|
|
222 |
if(isset($authorized) && !empty($authorized)){
|
|
|
223 |
$_GET['userId'] = $authorized['Id'];
|
|
|
224 |
if($authorized['isLoggedIn'] == 1){
|
|
|
225 |
$_GET['isLoggedIn'] = 'true';
|
|
|
226 |
}
|
|
|
227 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
228 |
$_GET['isLoggedIn'] = 'false';
|
|
|
229 |
}
|
|
|
230 |
}else{
|
|
|
231 |
redirect(base_url().'auth/login');
|
|
|
232 |
}
|
|
|
233 |
//standard array
|
|
|
234 |
$configdata = $this->config->item('my-recharges');
|
|
|
235 |
//$checkConfig = $this->config->item('home');
|
|
|
236 |
$cachemodule = array('header','footer');
|
|
|
237 |
$configdata = getCache($configdata,$cachemodule);
|
|
|
238 |
$data = array();
|
|
|
239 |
$data['response']=$this->myaccount_model->getOrder($this->input->get(),$this->input->post(),$configdata['module']);
|
|
|
240 |
if(isset($cachemodule) and !empty($cachemodule) && !isset($api))
|
|
|
241 |
{
|
|
|
242 |
foreach($cachemodule as $cm)
|
|
|
243 |
{
|
|
|
244 |
if(isset($configdata[$cm]) and !empty($configdata[$cm]))
|
|
|
245 |
{
|
|
|
246 |
$data['response'][$cm]=$configdata[$cm];
|
|
|
247 |
}
|
|
|
248 |
}
|
|
|
249 |
}
|
|
|
250 |
setCache($configdata['module'],$cachemodule,$data['response']);
|
|
|
251 |
if(isset($data['response']['response']['myrecharges'][0]) && !empty($data['response']['response']['myrecharges'][0])){
|
|
|
252 |
$this->lessphp->object()->ccompile('assets/css/profile.less','assets/css/profile.css');
|
|
|
253 |
$data['stylesheet'] = 'profile.css';
|
|
|
254 |
$this->layout->view('myaccount/account_view',$data);
|
|
|
255 |
}else{
|
|
|
256 |
redirect(base_url());
|
|
|
257 |
}
|
|
|
258 |
}
|
|
|
259 |
public function contact($email,$orderId,$subject,$message,$awb){
|
|
|
260 |
$configUrl = $this->config->item('contact');
|
|
|
261 |
$configUrl = $configUrl['url'];
|
|
|
262 |
$url = $this->config->item('curl_base_url').$configUrl;
|
|
|
263 |
$params = array();
|
|
|
264 |
$params['email'] = urldecode($email);
|
|
|
265 |
$params['order_id'] = $orderId;
|
|
|
266 |
$params['subject'] = urldecode($subject);
|
|
|
267 |
$params['message'] = urldecode($message);
|
|
|
268 |
$params['communication_type'] = 2;
|
|
|
269 |
if($awb == 'null'){
|
|
|
270 |
$params['awb'] = '';
|
|
|
271 |
}else{
|
|
|
272 |
$params['awb'] = urldecode($awb);
|
|
|
273 |
}
|
|
|
274 |
$this->mcurl->add_call('contact','post',$url,$params);
|
|
|
275 |
$response = $this->mcurl->execute($url);
|
|
|
276 |
$data['response'] = $response['contact']['response'];
|
|
|
277 |
$response = $this->magento_model->payment_submit($data);
|
|
|
278 |
echo json_encode($response[0]);
|
|
|
279 |
}
|
|
|
280 |
|
|
|
281 |
public function refund($orderId){
|
|
|
282 |
$configUrl = $this->config->item('contact');
|
|
|
283 |
$configUrl = $configUrl['url'];
|
|
|
284 |
$url = $this->config->item('curl_base_url').$configUrl;
|
|
|
285 |
$params = array();
|
|
|
286 |
//$params['email'] = urldecode($email);
|
|
|
287 |
$params['order_id'] = $orderId;
|
|
|
288 |
// $params['subject'] = urldecode($subject);
|
|
|
289 |
// $params['message'] = urldecode($message);
|
|
|
290 |
$params['communication_type'] = 2;
|
|
|
291 |
// if($awb == 'null'){
|
|
|
292 |
// $params['awb'] = '';
|
|
|
293 |
// }else{
|
|
|
294 |
// $params['awb'] = urldecode($awb);
|
|
|
295 |
// }
|
|
|
296 |
$this->mcurl->add_call('contact','post',$url,$params);
|
|
|
297 |
$response = $this->mcurl->execute($url);
|
|
|
298 |
$data['response'] = $response['contact']['response'];
|
|
|
299 |
$response = $this->magento_model->payment_submit($data);
|
|
|
300 |
echo json_encode($response[0]);
|
|
|
301 |
}
|
|
|
302 |
public function showAddress(){
|
|
|
303 |
$configUrl = $this->config->item('shipping_process');
|
|
|
304 |
$configUrl = $configUrl['url'];
|
|
|
305 |
$url = $this->config->item('curl_base_url').$configUrl;
|
|
|
306 |
$params = array();
|
|
|
307 |
$authorized = $this->session->userdata('authorized');
|
|
|
308 |
if(isset($authorized) && !empty($authorized)){
|
|
|
309 |
$params['userId'] = $authorized['Id'];
|
|
|
310 |
if($authorized['isLoggedIn'] == 1){
|
|
|
311 |
$params['isLoggedIn'] = 'true';
|
|
|
312 |
}
|
|
|
313 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
314 |
$params['isLoggedIn'] = 'false';
|
|
|
315 |
}
|
|
|
316 |
}
|
|
|
317 |
$this->mcurl->add_call('address','get',$url,$params);
|
|
|
318 |
$response = $this->mcurl->execute($url);
|
|
|
319 |
$data['response'] = $response['address']['response'];
|
|
|
320 |
$addresses = json_decode($data['response']);
|
|
|
321 |
$addresslist = '';
|
|
|
322 |
if(isset($addresses->defaultAddress) && !empty($addresses->defaultAddress)){
|
|
|
323 |
$defaultAddress = $addresses->defaultAddress;
|
|
|
324 |
$addresslist .= '<div class="deliver-here">';
|
|
|
325 |
foreach ($addresses->addresses as $address) {
|
|
|
326 |
$addresslist .= '<div class="deliver-address';
|
|
|
327 |
if($addresses->defaultAddress == $address->id){
|
|
|
328 |
$addresslist .= ' selected-add" id="'.$address->id.'" data-type="'.$address->type.'" onclick="changeAddress(\''.$address->id.'\',\''.$address->type.'\',\''.$address->pin.'\')">';
|
|
|
329 |
}else{
|
|
|
330 |
$addresslist .='" id="'.$address->id.'" data-type="'.$address->type.'" onclick="changeAddress(\''.$address->id.'\',\''.$address->type.'\',\''.$address->pin.'\')">';
|
|
|
331 |
}
|
|
|
332 |
$addresslist .= '<div>'.$address->name.'</div><div>'.$address->line1.'</div>';
|
|
|
333 |
if(isset($address->line2) && !empty($address->line2)) {
|
|
|
334 |
$addresslist .='<div>'.$address->line2.'</div>';
|
|
|
335 |
}
|
|
|
336 |
$addresslist .= '<div>'.$address->city.', '.$address->pin.'</div>';
|
|
|
337 |
if(isset($address->state) && !empty($address->state)) {
|
|
|
338 |
$addresslist .= '<div>'.$address->state.'</div>';
|
|
|
339 |
}
|
|
|
340 |
$addresslist .='</div>';
|
|
|
341 |
}
|
|
|
342 |
//$addresslist .='</div>';
|
|
|
343 |
$addresslist .= '<div class="add-address" onclick="showAddressForm();">+ Add new Address</div></div><input type="hidden" id="default" value="'.$defaultAddress.'"/>';
|
|
|
344 |
echo $addresslist;
|
|
|
345 |
}
|
|
|
346 |
else{
|
|
|
347 |
echo $addresslist;
|
|
|
348 |
}
|
|
|
349 |
}
|
|
|
350 |
public function modifyAddress($orderId,$addressId,$days){
|
|
|
351 |
if(isset($orderId) && isset($addressId) && isset($days)){
|
|
|
352 |
$configUrl = $this->config->item('modifyAddress');
|
|
|
353 |
$configUrl = $configUrl['url'];
|
|
|
354 |
$url = $this->config->item('curl_base_url').$configUrl;
|
|
|
355 |
$params = array();
|
|
|
356 |
$params['orderId'] = $orderId;
|
|
|
357 |
$params['addressId'] = $addressId;
|
|
|
358 |
$params['days'] = $days;
|
|
|
359 |
$this->mcurl->add_call('address','post',$url,$params);
|
|
|
360 |
$response = $this->mcurl->execute($url);
|
|
|
361 |
$data['response'] = $response['address']['response'];
|
|
|
362 |
print_r($data['response']);
|
|
|
363 |
}
|
|
|
364 |
}
|
|
|
365 |
public function saveAddress($name,$line1,$line2=null,$state,$city,$pincode,$phone){
|
|
|
366 |
if(isset($name) && isset($line1) && isset($state) && isset($city) && isset($pincode) && isset($phone)){
|
|
|
367 |
if(is_numeric($pincode) && is_numeric($phone)){
|
|
|
368 |
$configUrl = $this->config->item('shipping_process');
|
|
|
369 |
$configUrl = $configUrl['url'];
|
|
|
370 |
$url = $this->config->item('curl_base_url').$configUrl;
|
|
|
371 |
$params = array();
|
|
|
372 |
$params['name'] = urldecode($name);
|
|
|
373 |
$params['line1'] = urldecode($line1);
|
|
|
374 |
if(isset($line2) && !empty($line2) && $line2 != 'null'){
|
|
|
375 |
$params['line2'] = urldecode($line2);
|
|
|
376 |
}
|
|
|
377 |
$params['city'] = urldecode($city);
|
|
|
378 |
$params['state'] = urldecode($state);
|
|
|
379 |
$params['pin'] = $pincode;
|
|
|
380 |
$params['pnone'] = $phone;
|
|
|
381 |
$authorized = $this->session->userdata('authorized');
|
|
|
382 |
if(isset($authorized) && !empty($authorized)){
|
|
|
383 |
$params['userId'] = $authorized['Id'];
|
|
|
384 |
if($authorized['isLoggedIn'] == 1){
|
|
|
385 |
$params['isLoggedIn'] = 'true';
|
|
|
386 |
}
|
|
|
387 |
elseif(isset($authorized['isLoggedIn']) && empty($authorized['isLoggedIn'])) {
|
|
|
388 |
$params['isLoggedIn'] = 'false';
|
|
|
389 |
}
|
|
|
390 |
}
|
|
|
391 |
$this->mcurl->add_call('address','post',$url,$params);
|
|
|
392 |
$response = $this->mcurl->execute($url);
|
|
|
393 |
$data['response'] = $response['address']['response'];
|
|
|
394 |
$addresses = json_decode($data['response']);
|
|
|
395 |
$addresslist = '';
|
|
|
396 |
if(isset($addresses->defaultAddress) && !empty($addresses->defaultAddress)){
|
|
|
397 |
$defaultAddress = $addresses->defaultAddress;
|
|
|
398 |
$addresslist .= '<div class="deliver-here">';
|
|
|
399 |
foreach ($addresses->addresses as $address) {
|
|
|
400 |
$addresslist .= '<div class="deliver-address';
|
|
|
401 |
if($addresses->defaultAddress == $address->id){
|
|
|
402 |
$addresslist .= ' selected-add" id="'.$address->id.'" data-type="'.$address->type.'" onclick="changeAddress(\''.$address->id.'\',\''.$address->type.'\',\''.$address->pin.'\')">';
|
|
|
403 |
}else{
|
|
|
404 |
$addresslist .='" id="'.$address->id.'" data-type="'.$address->type.'" onclick="changeAddress(\''.$address->id.'\',\''.$address->type.'\',\''.$address->pin.'\')">';
|
|
|
405 |
}
|
|
|
406 |
$addresslist .= '<div>'.$address->name.'</div><div>'.$address->line1.'</div>';
|
|
|
407 |
if(isset($address->line2) && !empty($address->line2)) {
|
|
|
408 |
$addresslist .='<div>'.$address->line2.'</div>';
|
|
|
409 |
}
|
|
|
410 |
$addresslist .= '<div>'.$address->city.', '.$address->pin.'</div>';
|
|
|
411 |
if(isset($address->state) && !empty($address->state)) {
|
|
|
412 |
$addresslist .= '<div>'.$address->state.'</div>';
|
|
|
413 |
}
|
|
|
414 |
$addresslist .='</div>';
|
|
|
415 |
}
|
|
|
416 |
$addresslist .= '<div class="add-address" onclick="showAddressForm();">+ Add new Address</div></div><input type="hidden" id="default" value="'.$defaultAddress.'"/>';
|
|
|
417 |
echo $addresslist;
|
|
|
418 |
}
|
|
|
419 |
else{
|
|
|
420 |
echo $addresslist;
|
|
|
421 |
}
|
|
|
422 |
}
|
|
|
423 |
}
|
|
|
424 |
}
|
|
|
425 |
|
|
|
426 |
|
|
|
427 |
}
|
|
|
428 |
|
|
|
429 |
/* End of file welcome.php */
|
|
|
430 |
/* Location: ./application/controllers/welcome.php */
|