<?php
date_default_timezone_set('America/New York');
include("common.php");
include("classMySQL.php");
$db = new db_mysql($server_name, $userdb, $passdb, $databasename,"");
include("function.php");
require_once('class.phpmailer.php');
include("class.smtp.php");
mysql_connect($server_name, $userdb, $passdb) or die ("Could not connect to database");
mysql_select_db($databasename);
if($autoexchange == 1){
$page = file_get_contents('https://api.cryptonator.com/api/ticker/usd-idr');
$my_array = json_decode($page, true);
$data = $my_array['ticker']["price"];
$datac=floor($data);
if($data){
	
mysql_query("UPDATE configuration SET kurs='".$datac."' WHERE id='1'");
}
}

mysql_close();
?>