Exemple #1
0
function doGet()
{
    global $smarty;
    global $db;
    require_once "./config.php";
    $db = connectToDatabase();
    smartysetup();
    $mvname = $_GET['mvn'];
    $query = 'movie = ?';
    $mvm = new Moviemains();
    $infos = $mvm->Find($query, $mvname);
    /**single movie*/
    $mcomms = array();
    $mpics = array();
    $querys = 'fk_movie = ?';
    $mvs = new Moviesupps();
    $supinfos = array();
    $supinfos = $mvs->Find($querys, $infos[0]->id);
    foreach ($supinfos as $supin) {
        $mcomms[] = $supin->photocomment;
        $mpics[] = $supin->photo;
    }
    $snums = count($mpics) - 1;
    $smarty->assign('num', $snums);
    $smarty->assign('name', $mvname);
    $smarty->assign('cat', $infos[0]->mgroup);
    $smarty->assign('info', $infos[0]->info);
    $smarty->assign('comms', $mcomms);
    $smarty->assign('pics', $mpics);
    $smarty->display('SearchResult.tpl');
}
Exemple #2
0
function doPost()
{
    global $smarty;
    global $db;
    require_once "./config.php";
    $db = connectToDatabase();
    smartysetup();
    $movies = array();
    $namelinks = array();
    if (isset($_POST['mvcategory'])) {
        $cat = filter_input(INPUT_POST, 'mvcategory', FILTER_SANITIZE_STRING);
        $mvm = new Moviemains();
        $query = "mgroup = ?";
        $movies = $mvm->Find($query, $cat);
        foreach ($movies as $tm) {
            $namelinks[] = $tm->movie;
        }
        $smarty->assign('mvks', $namelinks);
        $smarty->assign('cat', $cat);
        $smarty->display('SearchReport.tpl');
    }
}