<?php
require_once('./includes/core.php');
require_once('./includes/session.php');


$RECALL = $_GET["RECALL"];

if(trim($RECALL) == "") {
    header("Location: bobz-err");
    exit;
}

$RECALL = urlencode($RECALL);
$AUTH = urlencode("225418/889699/4143854");

$r = @file("http://payment.allopass.com/api/checkcode.apu?code=$RECALL&auth=$AUTH");

if(substr($r[0],0,2)!= "OK") {
    header("Location: bobz-err");
    exit;
} else {
	mysql_query("UPDATE users SET bobz = bobz + 150 WHERE id = '".$user->id."' LIMIT 1");
	mysql_query("UPDATE users SET credits = credits + 15000 WHERE id = '".$user->id."' LIMIT 1"); // ajouté par Kamiil le 27/07/2010 15:15
	
	$time = date('d-m-Y H:i:s',mktime(date('H'),date('i'),date('s'),date('m'),date('d'),date('Y')));
	mysql_query("INSERT INTO bobz_payed (user,date,code) VALUES ('".$user->name."','".$time."','".$input->FilterText($RECALL)."')");
	header("Location: bobz-ok");
	// Ajout des bobz
	exit;
}
?>