Subversion Repositories SmartDukaan

Rev

Rev 21067 | Rev 21069 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21067 Rev 21068
Line 337... Line 337...
337
		        			$this->request->data['activated'] = 1;        		
337
		        			$this->request->data['activated'] = 1;        		
338
		        		}
338
		        		}
339
	        		}		        		
339
	        		}		        		
340
	        	}
340
	        	}
341
	        	
341
	        	
342
	        	if(!empty($_FILES['storeImage'])) {
342
	        	if(!empty($this->request->data['storeImage']) {
343
	        		$tmpStoreImage = $_FILES['storeImage']['tmp_name'];
343
	        		$tmpStoreImage = $this->request->data['storeImage'];
344
	        		$tmpSupportDocument = $_FILES['supportDocument']['tmp_name'];
344
	        		$tmpSupportDocument =$this->request->data['supportDocument'];
345
	        		if(!$this->saveToDocs($id, $tmpStoreImage, $tmpSupportDocument)){
345
	        		if(!$this->saveToDocs($id, $tmpStoreImage, $tmpSupportDocument)){
346
	        			$result = array('success'=>false,'message'=> 'Could not update docs please try after some time');
346
	        			$result = array('success'=>false,'message'=> 'Could not update docs please try after some time');
347
	        			$updateRequired=false;
347
	        			$updateRequired=false;
348
	        		}
348
	        		}
349
	        	}
349
	        	}
Line 1594... Line 1594...
1594
 
1594
 
1595
	public function getlost(){
1595
	public function getlost(){
1596
		
1596
		
1597
	}
1597
	}
1598
	
1598
	
1599
	function saveToDocs($userId, $tmpStoreImg, $tmpSupportDoc) {
1599
	function saveToDocs($userId, $storeImg, $supportDocImg) {
1600
		$storeDoc = '/RetailerDocs/'.$userId.'storeImg';
1600
		$storeDoc = '/RetailerDocs/'.$userId.'storeImg';
1601
		$supportDoc = '/RetailerDocs/'.$userId.'supportImg';
1601
		$supportDoc = '/RetailerDocs/'.$userId.'supportImg';
-
 
1602
		
-
 
1603
		$data = base64_decode($storeImg);
-
 
1604
		
1602
		$storeImgUploaded = move_uploaded_file($tmpStoreImg, $storeDoc);
1605
		file_put_contents($storeDoc, base64_decode($storeImg));
1603
		$supportDocUploaded = move_uploaded_file($tmpSupportDoc, $supportDoc);
1606
		file_put_contents($supportDoc, base64_decode($supportDoc));
-
 
1607
 
1604
		if($storeImgUploaded && $supportDocUploaded) {
1608
		if($storeImgUploaded && $supportDocUploaded) {
1605
			$this->User->query("insert into user_docs (user_id, store_doc, support_doc, created) values ($userId, '$storeDoc', '$supportDoc', now())");
1609
			$this->User->query("insert into user_docs (user_id, store_doc, support_doc, created) values ($userId, '$storeDoc', '$supportDoc', now())");
1606
			return true; 
1610
			return true; 
1607
		} else {
1611
		} else {
1608
			return false;
1612
			return false;