Exemple #1
0
<?php

include_once 'bootstrap.php';
$post = array('email' => $_POST['login'], 'password' => $_POST['password']);
if (empty($post['email']) || empty($post['password'])) {
    header('Location: http://' . Config::get('domain'));
}
$userToken = ApiCaller::get('usertoken/create', $post);
if ($userToken->status == 1) {
    $_SESSION['app']->userToken = $userToken->data;
    $userData = ApiCaller::get('user/get', array(), true);
    if ($userData->status == 1) {
        $_SESSION['user'] = $userData->data;
        setcookie('uid', $_SESSION['user']->id, time() + 60 * 60 * 24 * 7, '/');
        // 1 week
        setcookie('__utmf', md5($_SESSION['user']->id), time() + 60 * 60 * 24 * 7, '/');
        // 1 week
    }
}
header('Location: http://' . Config::get('domain'));
<?php

include_once 'bootstrap.php';
switch ($_POST['productType']) {
    case 'resource':
        $_POST['productType'] = 1;
        break;
    case 'product':
        $_POST['productType'] = 2;
        break;
    default:
        die('wtf?');
        break;
}
$data = array('name' => $_POST['name'], 'product' => (int) $_POST['resource'], 'productType' => (int) $_POST['productType']);
if (empty($data['name']) || empty($data['product']) || empty($data['productType'])) {
    header('Location: http://' . Config::get('domain'));
}
$response = ApiCaller::get('company/create', $data, true);
if ($response->status) {
    $_SESSION['user']->gold -= Company::CREATION_COST;
}
header('Location: http://' . Config::get('domain') . '/companies.htm');
<?php

$products = ApiCaller::get('product/list');
$products = $products->data;
$resources = ApiCaller::get('resource/list');
$resources = $resources->data;
?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:og="http://ogp.me/ns#"
  xmlns:fb="http://www.facebook.com/2008/fbml">
<head>

    <meta property="fb:admins" content="100001950649351" />
    <meta property="fb:app_id" content="202930519772507" />     
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="keywords" content="e-sim, mmog, browser game, free game, multiplayer game, social game"/>
    <meta name="description" content="Free strategic browser game. Fight, earn money, manage businesses"/>
    <meta property="og:site_name" content="e-Sim"/>
    <base href="http://<?php 
echo Config::get('domain');
?>
/">
    
    
    <meta http-equiv="Last-Modified" content="2013-12-08 12:58:57" />
    <meta property="og:image" content="images/PrimeraLogo.png"/>
    <meta property="og:description" content="Free strategic browser game. Fight, earn money, manage businesses. Join us, let's have some fun together, help your ecountry to grow."/>