Advertisement
Guest User

Untitled

a guest
Jan 28th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <?php
  2. #models
  3. require_once("models/User.php");
  4. require_once("models/Spot.php");
  5.  
  6. class Android {
  7.  
  8. static function process(){
  9. $json = json_decode(file_get_contents("php://input"));
  10. $function = $json->function;
  11.  
  12. switch($function){
  13. case "login":
  14. self::login();
  15. break;
  16.  
  17. case "getSpots":
  18. break;
  19.  
  20. }
  21.  
  22. $response = json_encode($arr);
  23. echo $response;
  24. }
  25.  
  26. static function login() {
  27.  
  28. $username = $json->username;
  29. $password = $json->password;
  30. $login = User::login_js($username,$password);
  31.  
  32. if($login == true) {
  33. $arr = array('succes'=>'true','function' => $function);
  34. } else {
  35. $arr = array('succes'=>'false');
  36. }
  37.  
  38. return $arr;
  39. }
  40. }
  41.  
  42. new Android::process()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement