<?php
$module_dir = "im_cinemas";

$admin_view = false;
if(isset($_SESSION['user_id']) && intval($_SESSION['user_id']) > 0) {
    $admin_view = true;
}
//$admin_view = false;

require_once(dirname(__FILE__) . "/config.php");
require_once(dirname(__FILE__) . "/im_functions.php");
require_once(dirname(__FILE__) . "/../../imCinemaAdmin/classes/Str.php");

if(isset($_POST['media_ajax'])) {
    require_once(dirname(__FILE__) . "/media_ajax.php");
}

/*if(isset($_req_data['content_code'])) {
    require_once(dirname(__FILE__) . "/im_movie.php");
}*/


if(isset($_REQUEST['movie_slug'])) {

    require_once(dirname(__FILE__) . "/im_movie.php");
}


if(file_exists(dirname(__FILE__) . "/im_cinemas_init.php")) {
    include(dirname(__FILE__) . "/im_cinemas_init.php");
}
else {
    echo "<br/><b>".dirname(__FILE__) . "/im_cinemas_init.php does not exist</b>";
}

$show_default = true;

if(isset($module_params['module_mode']) && $module_params['module_mode'] != "null") {
    $module_mode_file = dirname(__FILE__) . "/im_" . $module_params['module_mode'] . ".php";
    if(file_exists($module_mode_file)) {
        require_once($module_mode_file);
        $show_default = false;
    }
}


if($show_default && file_exists(dirname(__FILE__) . "/im_cinemas_default.php")) {
    include(dirname(__FILE__) . "/im_cinemas_default.php");
}