<?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 'log' :
        if($uri[3]=='login') :
          $base->Auth();
      elseif($uri[3] =='signout') :
          $base->logout();
        endif;
        break;
		case 'widget' :
		$Widget  = new Widget;
		if($uri[3] =='add') :
			$Widget->add();
			elseif($uri[3]=='delete') : 
			$Widget->Remove();
			elseif($uri[3] == 'update') :
			$Widget->Update();
			elseif($uri[3] == 'active') :
			$Widget->Upstatus();
		endif;
		break;
		case 'account' :
		$Account  = new Account;
		if($uri[3] =='update'):
			$Account->Update();
		elseif($uri[3] == 'updateserver') :
			$Account->UpdateKey();
		endif;
		break;
	default:
	 echo json_encode(["error"=>"response not found"]);
		break;
}

?>
