<?php

/* Author: Kariya TN
Author URL: http://www.kariya.gq
By : http://www.kariya-host.com*/

    session_start();


// the IP address to query
$ipppir = $_SERVER['REMOTE_ADDR']; // the IP address to query
$queipy = @unserialize(file_get_contents('http://ip-api.com/php/'.$ipppir));
if($queipy && $queipy['status'] == 'success') {


 function g_contriy($name){
    global $queipy ;
    $get_ipc=$queipy["{$name}"];
    $replace="Israel";
    $replace_to="Palestine";
    $comm_ip = str_replace($replace, $replace_to, $get_ipc);

    echo $comm_ip;

  }
}
$pti_zone=$queipy['timezone'];
/*'status' => 'success',
  'country' => 'COUNTRY',
  'countryCode' => 'COUNTRY CODE',
  'region' => 'REGION CODE',
  'regionName' => 'REGION NAME',
  'city' => 'CITY',
  'zip' => ZIP CODE,
  'lat' => LATITUDE,
  'lon' => LONGITUDE,
  'timezone' => 'TIME ZONE',
  'isp' => 'ISP NAME',
  'org' => 'ORGANIZATION NAME',
  'as' => 'AS NUMBER - NAME',
  'query' => 'IP ADDRESS USED FOR QUERY',*/

  if( ! ini_get('date.timezone') )
{
    date_default_timezone_set($pti_zone);
}

require"include/timezones.php"; // GET Time Zones


// the islamhouse to praytime    أوقات الصلاة
$g_date= date('Y/m/d');
$g_tzone= $timezones["{$queipy['timezone']}"];
$g_tzn= $t_zones["{$queipy['timezone']}"];
 $ipslir = $g_date."/Makkah/".$queipy['lat']."/".$queipy['lon']."/".$g_tzone."/json";
 $salet ="http://api.islamhouse.com/v1/Ng69VNhATakCUy13/services/praytime/get-times/".$ipslir;
  $saleto = file_get_contents($salet);
/* {
    date: "2014-08-13",
    method: "Makkah: Umm al-Qura University, Makkah",
    latitude: "30.0599153",
    longtude: "31.2620199",
    timezone: "+3",
    times: [
    "04:52",
    "06:21",
    "13:00",
    "16:36",
    "19:38",
    "19:38",
    "21:08"
    ]
}*/

$obj_sale = json_decode($saleto);

//  صور البلدان
$totcy=$queipy['countryCode'] ;
require"include/background.php"; // GET background country

$myAr=$mycoun["{$totcy}"];
 if(!isset($mycoun["{$totcy}"])) {
$randco_keys=array_rand($mytitif);
$cty_vd ="http://account.kariya-host.com/api/bg/".$mytitif[$randco_keys];
}else{
$randco_keys=array_rand($myAr);
$cty_vd ="http://account.kariya-host.com/api/bg/".$myAr[$randco_keys];
}

    ?>