<?php
ini_set("display_errors", 0);
$oecapi_file;
function oecapi_read_file() {
	$oecapi_started_reading = true;
	$oecapi_file = file(__DIR__.'/ecommerce.txt');
	return $oecapi_file;
}
function oecapi_register($product,$quantity,$price,$ip) {
	$data = array(date("d.m.Y - H:i",time()),$product,$quantity,$price,$ip,unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.substr($_SERVER['REMOTE_ADDR'],0,-2)))['geoplugin_countryName']);
	file_put_contents(__DIR__.'/ecommerce.txt',implode(', ',$data).'
',FILE_APPEND);
}
?>