Subversion Repositories SmartDukaan

Rev

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

Rev 20325 Rev 20477
Line 695... Line 695...
695
				$options['conditions'] = array($type =>$search);			
695
				$options['conditions'] = array($type =>$search);			
696
			}else{
696
			}else{
697
				$options['conditions'] = array($type.' LIKE '=>"%$search%");			
697
				$options['conditions'] = array($type.' LIKE '=>"%$search%");			
698
			}
698
			}
699
		}else{
699
		}else{
700
			$options['conditions'] = array('date(User.created)'=>date('Y-m-d',time()));			
700
			$options['conditions'] = array('User.status'=>1, 'User.activated'=>null);
-
 
701
			$options['limit']=10;			
701
		}	
702
		}	
702
		// $db = ConnectionManager::getDataSource("default"); // name of your database connection
703
		// $db = ConnectionManager::getDataSource("default"); // name of your database connection
703
		// $last_act = $db->fetchAll("SELECT * from (SELECT * from daily_visitors order by visited desc) as x group by x.user_id ");
704
		// $last_act = $db->fetchAll("SELECT * from (SELECT * from daily_visitors order by visited desc) as x group by x.user_id ");
704
		$sql = "SELECT * from (SELECT * from daily_visitors order by visited desc) as x group by x.user_id ";
705
		$sql = "SELECT * from (SELECT * from daily_visitors order by visited desc) as x group by x.user_id ";
705
		$last_act = $this->User->query($sql);
706
		$last_act = $this->User->query($sql);
Line 1549... Line 1550...
1549
			$response = $this->make_request($url,json_encode($payload,JSON_NUMERIC_CHECK));
1550
			$response = $this->make_request($url,json_encode($payload,JSON_NUMERIC_CHECK));
1550
			$message = $response['response'][key($response['response'])];
1551
			$message = $response['response'][key($response['response'])];
1551
		}
1552
		}
1552
		$this->set(compact('message'));
1553
		$this->set(compact('message'));
1553
	}
1554
	}
-
 
1555
 
-
 
1556
	public function usercalled($id){
-
 
1557
		$this->User->id = $id;
-
 
1558
		if (!$this->User->exists()) {
-
 
1559
			throw new NotFoundException(__('Invalid user'));
-
 
1560
		} else {
-
 
1561
			if($this->User->save(array('status'=>2))){
-
 
1562
				$this->Session->setFlash(__('User upadated'));
-
 
1563
			} else {
-
 
1564
				$this->Session->setFlash(__('User could not be updated'));
-
 
1565
			}		
-
 
1566
		}
-
 
1567
		return $this->redirect($this->referer());
1554
	
1568
	}
-
 
1569
	public function userunreachable($user_id){
-
 
1570
		$this->User->id = $id;
-
 
1571
		if (!$this->User->exists()) {
-
 
1572
			throw new NotFoundException(__('Invalid user'));
-
 
1573
		} else {
-
 
1574
			if($this->User->save(array('status'=>3))){
-
 
1575
				$this->Session->setFlash(__('User upadated'));
-
 
1576
			} else {
-
 
1577
				$this->Session->setFlash(__('User could not be updated'));
-
 
1578
			}		
-
 
1579
		}
-
 
1580
		return $this->redirect($this->referer());
-
 
1581
	}
-
 
1582
 
1555
	public function getlost(){
1583
	public function getlost(){
1556
		
1584
		
1557
	}
1585
	}
1558
}
1586
}
1559
1587