Subversion Repositories SmartDukaan

Rev

Rev 11845 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11845 Rev 12159
Line 2... Line 2...
2
if (!defined('BASEPATH'))
2
if (!defined('BASEPATH'))
3
	exit('No direct script access allowed');
3
	exit('No direct script access allowed');
4
 
4
 
5
 
5
 
6
/*
6
/*
7
 * Model for home
7
 * Model for Private Deals
8
 */ 
8
 */ 
9
 
9
 
10
Class Privatedeal_model extends CI_Model {
10
Class Privatedeal_model extends CI_Model {
11
 
11
 
12
	var $url = '';
12
	var $url = '';
Line 23... Line 23...
23
		$this->load->model($model);
23
		$this->load->model($model);
24
		$this->parser = $this-> $model;
24
		$this->parser = $this-> $model;
25
		
25
		
26
		
26
		
27
	}
27
	}
28
/*
-
 
29
	function index($get=array(),$post=array(),$module=array())
-
 
30
	{
-
 
31
		
28
 
32
		//add_call( KEY, METHOD, URL, array of PARAMS, array of CURL_OPTS )
-
 
33
		$this->curlURL('privatedeals/1','get',$get);
-
 
34
		$responses = $this->mcurl->execute();
-
 
35
		$responses = $this->parser->parse_response($responses);
-
 
36
		return $responses;
-
 
37
	}
-
 
38
*/
-
 
39
	function getProducts($get=array(),$post=array(),$module=array(), $userId,$page=1)
29
	function getProducts($get=array(),$post=array(),$module=array(), $userId,$page=1)
40
	{
30
	{
41
		$output =array();
31
		$output =array();
42
		if(isset($module) and !empty($module))
32
		if(isset($module) and !empty($module))
43
		{
33
		{
Line 77... Line 67...
77
				}
67
				}
78
			}
68
			}
79
 
69
 
80
			
70
			
81
		}
71
		}
82
		
72
				
83
		//add_call( KEY, METHOD, URL, array of PARAMS, array of CURL_OPTS )
-
 
84
		//$this->curlURL('products','get',$get);
-
 
85
		$responses = $this->mcurl->execute();
73
		$responses = $this->mcurl->execute();
86
		if(isset($responses) and !empty($responses))
74
		if(isset($responses) and !empty($responses))
87
		$responses = $this->parser->parse_response($responses,$module);
75
		$responses = $this->parser->parse_response($responses,$module);
88
	
76
	
89
		
77
		
Line 102... Line 90...
102
				$display=$productsurl['display'];
90
				$display=$productsurl['display'];
103
			}
91
			}
104
			if(empty($parameter)) {
92
			if(empty($parameter)) {
105
				$parameter=$productsurl['params'];
93
				$parameter=$productsurl['params'];
106
			}			
94
			}			
107
			/*
-
 
108
			if(isset($parameter) and !empty($parameter) and $methodtype=='get')
-
 
109
			{
95
			
110
				$params = $this->parser->prepareParams($parameter,$display,$configurl);
-
 
111
 
-
 
112
			}
-
 
113
			if(isset($parameter) and !empty($parameter) and $methodtype=='post')
-
 
114
			{
-
 
115
				$params = $this->parser->prepareParams($parameter,$display,$configurl);
-
 
116
				$methodtype ='post';
-
 
117
			}
-
 
118
			if(!isset($parameter) || empty($parameter))
-
 
119
				{$params =$this->parser->prepareParams('',$display,$configurl);}
-
 
120
			*/
-
 
121
			if(isset($userId) && $userId != null){
96
			if(isset($userId) && $userId != null){
122
				$url .= '/'.$page.'/?isLoggedIn=true&userId='.$userId;
97
				$url .= '/'.$page.'/?isLoggedIn=true&userId='.$userId;
123
			}
98
			}
124
			/*
99
			
125
			if(isset($query) && $query != null){
-
 
126
				$params = $query;
-
 
127
			}		
-
 
128
			return $this->mcurl->add_call($configurl,$methodtype,$url,$params);
-
 
129
			*/
-
 
130
			return $this->mcurl->add_call($configurl,$methodtype,$url);
100
			return $this->mcurl->add_call($configurl,$methodtype,$url);
131
		} else {
101
		} else {
132
			return '';
102
			return '';
133
		}
103
		}
134
	}
104
	}