<?php 
require_once "App.php";
$base  = new getResponse;
$session = $base->sessionTokens();
//print_r($session->islogin);
$uri = $base->setRequest();
$session->isLogin = true;
switch ($uri[2]) {
	case 'testing' :
     print_r($uri);
    	break;

        case 'log' :
        if($uri[3]=='login') :
          $base->Auth();
      elseif($uri[3] =='signout') :
          $base->logout();
        endif;
        break;
		case 'user' :
		$User  = new User;
		if($uri[3] =='add') :
			$User->add();
			elseif($uri[3]=='delete') : 
			$User->Remove();
			elseif($uri[3] == 'update') :
			$User->Update();
			elseif($uri[3] == 'active') :
			$User->Upstatus();
		endif;
		break;
		case 'applist' :
		$Applist  = new Applist;
		if($uri[3] =='add') :
			$Applist->add();
			elseif($uri[3]=='delete') : 
			$Applist->Remove();
			elseif($uri[3] == 'update') :
			$Applist->Update();
			elseif($uri[3] == 'active') :
			$Applist->Upstatus();
		endif;
		break;
		case 'setting' :
		$Setting  = new Setting;
		if($uri[3] =='add') :
			$Setting->add();
			elseif($uri[3]=='delete') : 
			$Setting->Remove();
			elseif($uri[3] == 'update') :
			$Setting->Update();
			elseif($uri[3] == 'featured') :
			$Setting->Upstatus();
			elseif($uri[3] == 'active') :
			$Setting->UpActive();
		endif;
		break;
		case 'account' :
		$Account  = new Account;
		if($uri[3] =='update'):
		$Account->Update();
		elseif($uri[3] == 'updateserver') :
		$Account->UpdateKey();
		endif;
		break;
		case 'usersetting' :
		$Usersetting  = new Usersetting;
		if($uri[3] =='update') :
			$Usersetting->Update();
		endif;
		break;
	default:
	 echo json_encode(["error"=>"response not found"]);
		break;
}

?>
