<?php

    $getInfo = json_decode( file_get_contents('php://input'), true );
    $action = $_SERVER['REQUEST_METHOD'];
    // if ($action != 'POST' || !$getInfo['resName'] || $getInfo['resName'] === null) {
        $abc = array(
            "SERVER_NAME" => "INFINITY",
            "Font_URL" => "https://fonts.googleapis.com/css?family=Kanit",
            "Font" => "Kanit",
            "COLOR_1" => "rgba(41, 159, 255, 0.75)"
        );
        $data = array(
            "isSuccess" => true,
            "message" => "success",
            "data" => "verified",
            "additional" => $abc
        );
        echo json_encode($data);
        die();
    // }

    // require_once('dbconfig.php');
    // require_once('function.php');
    // $db = new Database( 'localhost' , 'licensecheck', 'root' , '' ); // Connect To Database
    // set_error_handler('errHandle');
    
    // $resName = $getInfo['resName'];
    // $keyCheck = $getInfo['key'];
    // $action = $getInfo['action'];
    // $ipCheck = getIPAddress();
    // $isFoundUser = null;
    
    // foreach ($db->query('SELECT user FROM license WHERE token = '.'"'. $keyCheck .'"'.'AND resources = "'. $resName .'"') as $value) {
    //     $isFoundUser = $value['user'];
    // }
    
    // if($isFoundUser === null){
    //     $data1 = array("state" => "notfound");
    //     echo json_encode($data1);
    // }else{
    //     $isactived = getIp($db , $isFoundUser , $keyCheck , $resName , $ipCheck);
    //     $devname = getDevName($db , $isFoundUser , $keyCheck , $resName);
    //     if($action === 'active'){
    //         if ( !$isactived ){
    //             $datax = array("name"=> "supsibz", "dev"=> $devname,"state" => "activing" ,"a"  => "");
    //             echo json_encode($datax);
    //             dsh($db,$resName , $devname , $isFoundUser , false);
    //         }else{
    //             $data3 = array("name"=> $isFoundUser, "dev"=> $devname,"state" => "actived" ,"resname" => $resName ,"a" => $ipCheck);
    //             echo json_encode($data3);
    //             dsh($db, $resName , $devname , $isFoundUser , true);
    //         }      
    //     }
    // }  

?>