| 10582 |
lgm |
1 |
<?php
|
|
|
2 |
if (!defined('BASEPATH'))
|
|
|
3 |
exit('No direct script access allowed');
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
/*
|
|
|
7 |
* Model for home
|
|
|
8 |
*/
|
|
|
9 |
|
|
|
10 |
Class Prestashop_model extends CI_Model {
|
|
|
11 |
|
|
|
12 |
var $url = '';
|
|
|
13 |
var $parser_model;
|
|
|
14 |
var $parser;
|
|
|
15 |
|
|
|
16 |
function __construct() {
|
|
|
17 |
|
|
|
18 |
// Call the Model constructor
|
|
|
19 |
parent::__construct();
|
|
|
20 |
//load appropriate parser
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
}
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
function prepareParams($data=array(),$display=null,$configurl=null)
|
|
|
27 |
{
|
|
|
28 |
if(isset($configurl) and $configurl=='product_list')
|
|
|
29 |
{
|
|
|
30 |
//category naming convetion
|
|
|
31 |
if(isset($data['category'])) {$data['id_category_default']=$data['category']; unset($data['category']);}
|
|
|
32 |
}
|
|
|
33 |
if(isset($configurl) and $configurl=='login')
|
|
|
34 |
{
|
|
|
35 |
//category naming convetion
|
|
|
36 |
unset($data['signin']);
|
|
|
37 |
if(isset($data['passwd'])) {$data['passwd']= md5($this->config->item('hashkey').$data['passwd']);}
|
|
|
38 |
}
|
|
|
39 |
if(isset($configurl) and $configurl=='signup')
|
|
|
40 |
{
|
|
|
41 |
//category naming convetion
|
|
|
42 |
unset($data['signup']);
|
|
|
43 |
if(isset($data['passwd'])) {$data['passwd']= md5($this->config->item('hashkey').$data['passwd']);}
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
$newdata =array();
|
|
|
47 |
if(isset($data) and !empty($data) and $configurl!='signup')
|
|
|
48 |
{
|
|
|
49 |
|
|
|
50 |
foreach($data as $key=>$d)
|
|
|
51 |
{
|
|
|
52 |
if($key!=='sort')
|
|
|
53 |
{
|
|
|
54 |
$newdata['filter['.$key.']']='['.$d.']';
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
}
|
|
|
58 |
}
|
|
|
59 |
if($configurl=='signup'){}
|
|
|
60 |
|
|
|
61 |
if(isset($display) and !empty($display))
|
|
|
62 |
{$newdata['display']=$display;}
|
|
|
63 |
else
|
|
|
64 |
{$newdata['display']='full';}
|
|
|
65 |
|
|
|
66 |
$newdata['ws_key'] = $this->config->item('apikey');
|
|
|
67 |
//return 'filter[price]=[300,5000]';
|
|
|
68 |
//print_r($newdata);
|
|
|
69 |
return $newdata;
|
|
|
70 |
}
|
|
|
71 |
function parse_response($responses=null,$module=array())
|
|
|
72 |
{
|
|
|
73 |
|
|
|
74 |
$response=array();
|
|
|
75 |
$data = $this->__xml_to_json($responses,$module);
|
|
|
76 |
if(isset($data['header']) and !empty($data['header']))
|
|
|
77 |
{
|
|
|
78 |
$response['header']= $this->__parser_seperator($data['header']);
|
|
|
79 |
|
|
|
80 |
}
|
|
|
81 |
if(isset($data['footer']) and !empty($data['footer']))
|
|
|
82 |
{
|
|
|
83 |
$response['footer']= $this->__parser_seperator($data['footer']);
|
|
|
84 |
|
|
|
85 |
}
|
|
|
86 |
if(isset($data['response']) and !empty($data['response']))
|
|
|
87 |
{
|
|
|
88 |
$response['response']= $this->__parser_seperator($data['response']);
|
|
|
89 |
|
|
|
90 |
}
|
|
|
91 |
//print_r($response);
|
|
|
92 |
return $response;
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
}
|
|
|
96 |
/*function parse_home_response($responses=null,$module=array())
|
|
|
97 |
{
|
|
|
98 |
|
|
|
99 |
$response=array();
|
|
|
100 |
$data = $this->__xml_to_json($responses,$module);
|
|
|
101 |
if(isset($data['header']) and !empty($data['header']))
|
|
|
102 |
{
|
|
|
103 |
$response['header']= $this->__parser_seperator($data['header']);
|
|
|
104 |
|
|
|
105 |
}
|
|
|
106 |
if(isset($data['footer']) and !empty($data['footer']))
|
|
|
107 |
{
|
|
|
108 |
$response['footer']= $this->__parser_seperator($data['footer']);
|
|
|
109 |
|
|
|
110 |
}
|
|
|
111 |
if(isset($data['response']) and !empty($data['response']))
|
|
|
112 |
{
|
|
|
113 |
$response['response']= $this->__parser_seperator($data['response']);
|
|
|
114 |
|
|
|
115 |
}
|
|
|
116 |
//print_r($response);
|
|
|
117 |
return $response;
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
}
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
|
|
|
124 |
function parse_productlist_response($responses=null,$module=array())
|
|
|
125 |
{
|
|
|
126 |
$response=array();
|
|
|
127 |
$data = $this->__xml_to_json($responses,$module);
|
|
|
128 |
if(isset($data['header']) and !empty($data['header']))
|
|
|
129 |
{
|
|
|
130 |
$response['header']= $this->__parser_seperator($data['header']);
|
|
|
131 |
|
|
|
132 |
}
|
|
|
133 |
if(isset($data['footer']) and !empty($data['footer']))
|
|
|
134 |
{
|
|
|
135 |
$response['footer']= $this->__parser_seperator($data['footer']);
|
|
|
136 |
|
|
|
137 |
}
|
|
|
138 |
if(isset($data['response']) and !empty($data['response']))
|
|
|
139 |
{
|
|
|
140 |
$response['response']= $this->__parser_seperator($data['response']);
|
|
|
141 |
|
|
|
142 |
}
|
|
|
143 |
//print_r($response);
|
|
|
144 |
return $response;
|
|
|
145 |
|
|
|
146 |
|
|
|
147 |
}
|
|
|
148 |
|
|
|
149 |
function parse_productinfo_response($responses=null,$module=array())
|
|
|
150 |
{
|
|
|
151 |
$response=array();
|
|
|
152 |
$data = $this->__xml_to_json($responses,$module);
|
|
|
153 |
if(isset($data['header']) and !empty($data['header']))
|
|
|
154 |
{
|
|
|
155 |
$response['header']= $this->__parser_seperator($data['header']);
|
|
|
156 |
|
|
|
157 |
}
|
|
|
158 |
if(isset($data['footer']) and !empty($data['footer']))
|
|
|
159 |
{
|
|
|
160 |
$response['footer']= $this->__parser_seperator($data['footer']);
|
|
|
161 |
|
|
|
162 |
}
|
|
|
163 |
if(isset($data['response']) and !empty($data['response']))
|
|
|
164 |
{
|
|
|
165 |
$response['response']= $this->__parser_seperator($data['response']);
|
|
|
166 |
|
|
|
167 |
}
|
|
|
168 |
//print_r($response);
|
|
|
169 |
return $response;
|
|
|
170 |
|
|
|
171 |
}
|
|
|
172 |
function parse_oauth_response($responses=null,$module=array())
|
|
|
173 |
{
|
|
|
174 |
$response=array();
|
|
|
175 |
$data = $this->__xml_to_json($responses,$module);
|
|
|
176 |
|
|
|
177 |
if(isset($data['header']) and !empty($data['header']))
|
|
|
178 |
{
|
|
|
179 |
$response['header']= $this->__parser_seperator($data['header']);
|
|
|
180 |
|
|
|
181 |
}
|
|
|
182 |
if(isset($data['footer']) and !empty($data['footer']))
|
|
|
183 |
{
|
|
|
184 |
$response['footer']= $this->__parser_seperator($data['footer']);
|
|
|
185 |
|
|
|
186 |
}
|
|
|
187 |
if(isset($data['response']) and !empty($data['response']))
|
|
|
188 |
{
|
|
|
189 |
$response['response']= $this->__parser_seperator($data['response']);
|
|
|
190 |
|
|
|
191 |
}
|
|
|
192 |
//print_r($response);
|
|
|
193 |
return $response;
|
|
|
194 |
|
|
|
195 |
}
|
|
|
196 |
*/
|
|
|
197 |
function __xml_to_json($responses=null,$module=array())
|
|
|
198 |
{
|
|
|
199 |
$responseseperate =array();
|
|
|
200 |
|
|
|
201 |
|
|
|
202 |
if(isset($module) and !empty($module))
|
|
|
203 |
{
|
|
|
204 |
if(isset($module['header']) and !empty($module['header']))
|
|
|
205 |
{
|
|
|
206 |
foreach($module['header'] as $header)
|
|
|
207 |
{
|
|
|
208 |
$i = $this->config->item($header);
|
|
|
209 |
if(isset($i['url']))
|
|
|
210 |
{$responseseperate['header'][$header][]=xml_to_json($responses[$header]['response'],array($header,''),array('id','language'));}
|
|
|
211 |
$responseseperate['header'][$header]['render']=@$i['render'];
|
|
|
212 |
}
|
|
|
213 |
}
|
|
|
214 |
if(isset($module['footer']) and !empty($module['footer']))
|
|
|
215 |
{
|
|
|
216 |
foreach($module['footer'] as $footer)
|
|
|
217 |
{
|
|
|
218 |
$i = $this->config->item($footer);
|
|
|
219 |
if(isset($i['url']))
|
|
|
220 |
{$responseseperate['footer'][$footer][]=xml_to_json($responses[$footer]['response'],array($footer,''),array('id','language'));}
|
|
|
221 |
$responseseperate['footer'][$footer]['render']=@$i['render'];
|
|
|
222 |
}
|
|
|
223 |
}
|
|
|
224 |
if(isset($module['response']) and !empty($module['response']))
|
|
|
225 |
{
|
|
|
226 |
foreach($module['response'] as $response)
|
|
|
227 |
{
|
|
|
228 |
$i = $this->config->item($response);
|
|
|
229 |
if(isset($i['url']))
|
|
|
230 |
{
|
|
|
231 |
if(isset($responses[$response]['response']))
|
|
|
232 |
$responseseperate['response'][$response][]=xml_to_json($responses[$response]['response'],array($response,''),array('id','language'));}
|
|
|
233 |
$responseseperate['response'][$response]['render']=@$i['render'];
|
|
|
234 |
}
|
|
|
235 |
}
|
|
|
236 |
|
|
|
237 |
|
|
|
238 |
}
|
|
|
239 |
//xml_to_json(response from api,find route element),ignoreelement and replace with parent id)
|
|
|
240 |
//print_r($responseseperate);
|
|
|
241 |
$response = $responseseperate;
|
|
|
242 |
//call parser and extract data as per requirement
|
|
|
243 |
return $response;
|
|
|
244 |
|
|
|
245 |
}
|
|
|
246 |
|
|
|
247 |
function __parser_seperator($data=array())
|
|
|
248 |
{
|
|
|
249 |
$newarray =array();
|
|
|
250 |
if(isset($data) and !empty($data))
|
|
|
251 |
{
|
|
|
252 |
foreach($data as $key=>$value)
|
|
|
253 |
{
|
|
|
254 |
$newarray[$key] = $this->$key($value);
|
|
|
255 |
}
|
|
|
256 |
}
|
|
|
257 |
return $newarray;
|
|
|
258 |
|
|
|
259 |
}
|
|
|
260 |
|
|
|
261 |
|
|
|
262 |
/*function top menu parser
|
|
|
263 |
* menu category paramter
|
|
|
264 |
*id,parentid,menuname,position,render*/
|
|
|
265 |
|
|
|
266 |
|
|
|
267 |
function top_menu($data=array())
|
|
|
268 |
{
|
|
|
269 |
|
|
|
270 |
$response =array();
|
|
|
271 |
if(isset($data[0]) and !empty($data[0]))
|
|
|
272 |
{
|
|
|
273 |
foreach($data[0] as $d)
|
|
|
274 |
{
|
|
|
275 |
if($d->id > 2)
|
|
|
276 |
{$childarray=array();
|
|
|
277 |
$childarray['id']=$d->id;
|
|
|
278 |
$childarray['parentid']=$d->id_parent;
|
|
|
279 |
$childarray['menuname']=$d->name;
|
|
|
280 |
$childarray['position']=$d->position;
|
|
|
281 |
if(array_key_exists($d->id_parent, $response))
|
|
|
282 |
{
|
|
|
283 |
$response[$d->id_parent]['child'][]=$childarray;
|
|
|
284 |
}
|
|
|
285 |
else
|
|
|
286 |
{
|
|
|
287 |
$response[$d->id][]=$childarray;
|
|
|
288 |
}
|
|
|
289 |
}
|
|
|
290 |
|
|
|
291 |
|
|
|
292 |
}
|
|
|
293 |
//print_r($response);
|
|
|
294 |
|
|
|
295 |
}
|
|
|
296 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
297 |
{$response['render']=$data['render'];}
|
|
|
298 |
|
|
|
299 |
return $response;
|
|
|
300 |
}
|
|
|
301 |
/*function top menu parser
|
|
|
302 |
* menu category paramter
|
|
|
303 |
*render*/
|
|
|
304 |
|
|
|
305 |
function search_bar($data=array())
|
|
|
306 |
{
|
|
|
307 |
$response =array();
|
|
|
308 |
|
|
|
309 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
310 |
{$response['render']=$data['render'];}
|
|
|
311 |
|
|
|
312 |
return $response;
|
|
|
313 |
|
|
|
314 |
}
|
|
|
315 |
function breadcrumb($data=array())
|
|
|
316 |
{
|
|
|
317 |
$response =array();
|
|
|
318 |
|
|
|
319 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
320 |
{$response['render']=$data['render'];}
|
|
|
321 |
|
|
|
322 |
return $response;
|
|
|
323 |
|
|
|
324 |
}
|
|
|
325 |
|
|
|
326 |
function authentication_bar($data=array())
|
|
|
327 |
{
|
|
|
328 |
$response =array();
|
|
|
329 |
|
|
|
330 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
331 |
{$response['render']=$data['render'];}
|
|
|
332 |
|
|
|
333 |
return $response;
|
|
|
334 |
|
|
|
335 |
}
|
|
|
336 |
function social_bar($data=array())
|
|
|
337 |
{
|
|
|
338 |
$response =array();
|
|
|
339 |
|
|
|
340 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
341 |
{$response['render']=$data['render'];}
|
|
|
342 |
|
|
|
343 |
return $response;
|
|
|
344 |
|
|
|
345 |
}
|
|
|
346 |
function subscribe_bar($data=array())
|
|
|
347 |
{
|
|
|
348 |
$response =array();
|
|
|
349 |
|
|
|
350 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
351 |
{$response['render']=$data['render'];}
|
|
|
352 |
|
|
|
353 |
return $response;
|
|
|
354 |
|
|
|
355 |
}
|
|
|
356 |
function footer_link($data=array())
|
|
|
357 |
{
|
|
|
358 |
$response =array();
|
|
|
359 |
|
|
|
360 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
361 |
{$response['render']=$data['render'];}
|
|
|
362 |
|
|
|
363 |
return $response;
|
|
|
364 |
|
|
|
365 |
}
|
|
|
366 |
|
|
|
367 |
//paramters for home banner - id,bannername,bannerimage,url
|
|
|
368 |
function home_banner($data=array())
|
|
|
369 |
{
|
|
|
370 |
$response =array();
|
|
|
371 |
if(isset($data[0]) and !empty($data[0]))
|
|
|
372 |
{
|
|
|
373 |
|
|
|
374 |
foreach($data[0] as $d)
|
|
|
375 |
{
|
|
|
376 |
$childarray=array();
|
|
|
377 |
$childarray['id']=$d->id;
|
|
|
378 |
$childarray['bannername']=$d->name;
|
|
|
379 |
$childarray['bannerimage']=$d->id_default_image;
|
|
|
380 |
$childarray['url']=$d->id_category_default;
|
|
|
381 |
$response[]=$childarray;
|
|
|
382 |
|
|
|
383 |
|
|
|
384 |
}
|
|
|
385 |
|
|
|
386 |
}
|
|
|
387 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
388 |
{$response['render']=$data['render'];}
|
|
|
389 |
|
|
|
390 |
return $response;
|
|
|
391 |
}
|
|
|
392 |
|
|
|
393 |
function home_menu($data=array())
|
|
|
394 |
{
|
|
|
395 |
|
|
|
396 |
$response =array();
|
|
|
397 |
if(isset($data[0]) and !empty($data[0]))
|
|
|
398 |
{
|
|
|
399 |
foreach($data[0] as $d)
|
|
|
400 |
{
|
|
|
401 |
if($d->id > 2)
|
|
|
402 |
{$childarray=array();
|
|
|
403 |
$childarray['id']=$d->id;
|
|
|
404 |
$childarray['parentid']=$d->id_parent;
|
|
|
405 |
$childarray['menuname']=$d->name;
|
|
|
406 |
$childarray['position']=$d->position;
|
|
|
407 |
if(array_key_exists($d->id_parent, $response))
|
|
|
408 |
{
|
|
|
409 |
$response[$d->id_parent]['child'][]=$childarray;
|
|
|
410 |
}
|
|
|
411 |
else
|
|
|
412 |
{
|
|
|
413 |
$response[$d->id][]=$childarray;
|
|
|
414 |
}
|
|
|
415 |
}
|
|
|
416 |
|
|
|
417 |
|
|
|
418 |
}
|
|
|
419 |
//print_r($response);
|
|
|
420 |
|
|
|
421 |
}
|
|
|
422 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
423 |
{$response['render']=$data['render'];}
|
|
|
424 |
|
|
|
425 |
return $response;
|
|
|
426 |
}
|
|
|
427 |
|
|
|
428 |
//product list
|
|
|
429 |
|
|
|
430 |
function product_list($data=array())
|
|
|
431 |
{
|
|
|
432 |
|
|
|
433 |
$response =array();
|
|
|
434 |
if(isset($data[0]) and count($data[0]) > 1)
|
|
|
435 |
{
|
|
|
436 |
|
|
|
437 |
|
|
|
438 |
foreach($data[0] as $d)
|
|
|
439 |
{
|
|
|
440 |
$childarray=array();
|
|
|
441 |
$childarray['id']=$d->id;
|
|
|
442 |
$childarray['productname']=$d->name;
|
|
|
443 |
$childarray['productprice']=$d->price;
|
|
|
444 |
$childarray['productimage']=$this->config->item('curl_base_url').'images/products/'.$d->id.'/'.$d->id_default_image;
|
|
|
445 |
$childarray['url']=base_url().'productinfo?id='.$d->id;
|
|
|
446 |
$response[]=$childarray;
|
|
|
447 |
|
|
|
448 |
|
|
|
449 |
}
|
|
|
450 |
|
|
|
451 |
}
|
|
|
452 |
else
|
|
|
453 |
{$response['error']='No Product Found!';}
|
|
|
454 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
455 |
{$response['render']=$data['render'];}
|
|
|
456 |
|
|
|
457 |
return $response;
|
|
|
458 |
|
|
|
459 |
}
|
|
|
460 |
function product_details($data=array())
|
|
|
461 |
{
|
|
|
462 |
$response =array();
|
|
|
463 |
if(isset($data[0]) and !empty($data[0]))
|
|
|
464 |
{
|
|
|
465 |
foreach($data[0] as $d)
|
|
|
466 |
{
|
|
|
467 |
$childarray=array();
|
|
|
468 |
$childarray['id']=$d->id;
|
|
|
469 |
$childarray['category']=$d->id_category_default;
|
|
|
470 |
$childarray['productname']=$d->name;
|
|
|
471 |
$childarray['productprice']=$d->price;
|
|
|
472 |
$childarray['productimage']=$d->id_default_image;
|
|
|
473 |
$childarray['shortdescription']=$d->description_short;
|
|
|
474 |
$childarray['fulldescription']=$d->description;
|
|
|
475 |
$childarray['url']=$d->link_rewrite;
|
|
|
476 |
$response[]=$childarray;
|
|
|
477 |
|
|
|
478 |
|
|
|
479 |
}
|
|
|
480 |
|
|
|
481 |
}
|
|
|
482 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
483 |
{$response['render']=$data['render'];}
|
|
|
484 |
|
|
|
485 |
return $response;
|
|
|
486 |
|
|
|
487 |
}
|
|
|
488 |
|
|
|
489 |
function login($data=array())
|
|
|
490 |
{
|
|
|
491 |
$response =array();
|
|
|
492 |
if(isset($data[0]) and count($data[0]) == 0)
|
|
|
493 |
{
|
|
|
494 |
$response['redirect']='login';
|
|
|
495 |
$response['msg']='Invalid Login Credential!';
|
|
|
496 |
|
|
|
497 |
}
|
|
|
498 |
if(isset($data[0][0]) and !empty($data[0][0]))
|
|
|
499 |
{
|
|
|
500 |
$inputdata =$data[0][0];
|
|
|
501 |
if(isset($inputdata) and count($inputdata) ==0)
|
|
|
502 |
{
|
|
|
503 |
$response['redirect']='login';
|
|
|
504 |
$response['msg']='Invalid Login Credential!';
|
|
|
505 |
|
|
|
506 |
}
|
|
|
507 |
else
|
|
|
508 |
{
|
|
|
509 |
$response['authorized']=array('id'=>$inputdata->id,'fname'=>$inputdata->firstname,'lname'=>$inputdata->lastname,'email'=>$inputdata->email,'status'=>$inputdata->active);
|
|
|
510 |
$response['redirect']='home';
|
|
|
511 |
$response['msg']='Logged-in Successfully!';
|
|
|
512 |
|
|
|
513 |
}
|
|
|
514 |
|
|
|
515 |
|
|
|
516 |
|
|
|
517 |
|
|
|
518 |
}
|
|
|
519 |
|
|
|
520 |
|
|
|
521 |
|
|
|
522 |
|
|
|
523 |
|
|
|
524 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
525 |
{$response['render']=$data['render'];}
|
|
|
526 |
//print_r($response);
|
|
|
527 |
return $response;
|
|
|
528 |
|
|
|
529 |
}
|
|
|
530 |
function signup($data=array())
|
|
|
531 |
{
|
|
|
532 |
$response =array();
|
|
|
533 |
if(isset($data[0]) and count($data[0]) == 0)
|
|
|
534 |
{
|
|
|
535 |
$response['redirect']='signup';
|
|
|
536 |
$response['msg']='Invalid Signup Credential!';
|
|
|
537 |
|
|
|
538 |
}
|
|
|
539 |
if(isset($data[0][0]) and !empty($data[0][0]))
|
|
|
540 |
{
|
|
|
541 |
$inputdata =$data[0][0];
|
|
|
542 |
|
|
|
543 |
|
|
|
544 |
$response['authorized']=array('id'=>$inputdata->id,'fname'=>$inputdata->firstname,'lname'=>$inputdata->lastname,'email'=>$inputdata->email);
|
|
|
545 |
$response['redirect']='home';
|
|
|
546 |
$response['msg']='Successfully Registered!';
|
|
|
547 |
|
|
|
548 |
}
|
|
|
549 |
|
|
|
550 |
|
|
|
551 |
|
|
|
552 |
|
|
|
553 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
554 |
{$response['render']=$data['render'];}
|
|
|
555 |
//print_r($response);
|
|
|
556 |
return $response;
|
|
|
557 |
|
|
|
558 |
}
|
|
|
559 |
function forgetpassword($data=array())
|
|
|
560 |
{
|
|
|
561 |
$response =array();
|
|
|
562 |
|
|
|
563 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
564 |
{$response['render']=$data['render'];}
|
|
|
565 |
|
|
|
566 |
return $response;
|
|
|
567 |
|
|
|
568 |
}
|
|
|
569 |
|
|
|
570 |
function carts($data=array())
|
|
|
571 |
{
|
|
|
572 |
$response =array();
|
|
|
573 |
|
|
|
574 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
575 |
{$response['render']=$data['render'];}
|
|
|
576 |
|
|
|
577 |
return $response;
|
|
|
578 |
|
|
|
579 |
}
|
|
|
580 |
|
|
|
581 |
function addcart($data=array())
|
|
|
582 |
{
|
|
|
583 |
$response =array();
|
|
|
584 |
|
|
|
585 |
//if added successfully
|
|
|
586 |
//pass parameter as msg in response
|
|
|
587 |
|
|
|
588 |
return $response;
|
|
|
589 |
|
|
|
590 |
}
|
|
|
591 |
|
|
|
592 |
function updatecart($data=array())
|
|
|
593 |
{
|
|
|
594 |
$response =array();
|
|
|
595 |
|
|
|
596 |
//if added successfully
|
|
|
597 |
//pass parameter as msg in response
|
|
|
598 |
|
|
|
599 |
return $response;
|
|
|
600 |
|
|
|
601 |
}
|
|
|
602 |
|
|
|
603 |
function deletecart($data=array())
|
|
|
604 |
{
|
|
|
605 |
$response =array();
|
|
|
606 |
|
|
|
607 |
//if added successfully
|
|
|
608 |
//pass parameter as msg in response
|
|
|
609 |
|
|
|
610 |
return $response;
|
|
|
611 |
|
|
|
612 |
}
|
|
|
613 |
|
|
|
614 |
function login_process($data=array())
|
|
|
615 |
{
|
|
|
616 |
$response =array();
|
|
|
617 |
|
|
|
618 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
619 |
{$response['render']=$data['render'];}
|
|
|
620 |
|
|
|
621 |
return $response;
|
|
|
622 |
|
|
|
623 |
}
|
|
|
624 |
function shipping_process($data=array())
|
|
|
625 |
{
|
|
|
626 |
$response =array();
|
|
|
627 |
|
|
|
628 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
629 |
{$response['render']=$data['render'];}
|
|
|
630 |
|
|
|
631 |
return $response;
|
|
|
632 |
|
|
|
633 |
}
|
|
|
634 |
function orderconfirmation_process($data=array())
|
|
|
635 |
{
|
|
|
636 |
$response =array();
|
|
|
637 |
|
|
|
638 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
639 |
{$response['render']=$data['render'];}
|
|
|
640 |
|
|
|
641 |
return $response;
|
|
|
642 |
|
|
|
643 |
}
|
|
|
644 |
function billing_process($data=array())
|
|
|
645 |
{
|
|
|
646 |
$response =array();
|
|
|
647 |
|
|
|
648 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
649 |
{$response['render']=$data['render'];}
|
|
|
650 |
|
|
|
651 |
return $response;
|
|
|
652 |
|
|
|
653 |
}
|
|
|
654 |
function payment_process($data=array())
|
|
|
655 |
{
|
|
|
656 |
$response =array();
|
|
|
657 |
|
|
|
658 |
if(isset($data['render']) and !empty($data['render']))
|
|
|
659 |
{$response['render']=$data['render'];}
|
|
|
660 |
|
|
|
661 |
return $response;
|
|
|
662 |
|
|
|
663 |
}
|
|
|
664 |
|
|
|
665 |
|
|
|
666 |
|
|
|
667 |
|
|
|
668 |
}
|