Advertisement
Guest User

Untitled

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