Exemplo n.º 1
0
<?php

if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$m = new Film();
if (!isset($_GET["id"])) {
    $_GET["id"] = 1;
}
$user = $page->users->getById($page->users->currentUserId());
$cpapi = $user['cp_api'];
$cpurl = $user['cp_url'];
$page->smarty->assign('cpapi', $cpapi);
$page->smarty->assign('cpurl', $cpurl);
$data = $m->getUpcoming($_GET["id"]);
//print_r(json_decode($data["info"])->movies);die();
if (!$data || $data["info"] == "") {
    $page->smarty->assign("nodata", "No upcoming data.");
} else {
    $data = json_decode($data["info"]);
    if (isset($data->error)) {
        $page->smarty->assign("nodata", $data->error);
    } else {
        if (!isset($data->movies)) {
            $page->smarty->assign("nodata", 'Unspecified error.');
        } else {
            $page->smarty->assign('data', $data->movies);
            switch ($_GET["id"]) {
                case Film::SRC_BOXOFFICE:
                    $page->title = "Box Office";
                    break;