daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Jan 28th, 2016 21 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         $arr = self::login();
  23.         $response = json_encode($arr);
  24.         echo $response;
  25.     }
  26.  
  27.     static function login() {
  28.  
  29.         $username = $json->username;
  30.         $password = $json->password;
  31.         $login = User::login_js($username,$password);
  32.  
  33.         if($login == true) {
  34.             $arr = array('succes'=>'true','function' => $function);
  35.         } else {
  36.             $arr = array('succes'=>'false');
  37.         }
  38.        
  39.         return $arr;
  40.     }
  41. }
  42.  
  43. Android::process()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top