<?
 
/*    Displays movies in the local database
 
    Don't modify without written authorization
 
    Created by: Randy Gerritse
 
    Email: [email protected]
 
    ©2003, All rights reserved.
 
    ================================================================================ */
 
 
require("init.php");
 
 
echo '
 
<html>
 
<head>
 
<title>Randy\'s amazing ratings page</title>
 
</head>
 
<body>
 
';
 
flush();
 
 
$movz = $connection->execute($sql->getAllMovies(),1);
 
if (count($movz) > 0) {
 
    foreach ($movz as $move) {
 
        echo '
 
        <table cellspacing="3" width="600">
 
        <tr>
 
            <td colspan="2" valign="top">
 
                <b><u>'.$move["title"].'</u></b><br>
 
            </td>
 
            <td valign="top" align="right" rowspan="'.count($move).'">
 
                '.($move["cover"] != "" ? '<img align="right" src="'.$move["cover"].'" border="0">' : '').'
 
            </td>
 
        </tr>
 
        <tr>
 
            <td valign="top">
 
                <b>Rating: </b>
 
            </td>
 
            <td valign="top">
 
                '.$move["rating"].'
 
            </td>
 
        </tr>
 
        <tr>
 
            <td valign="top">
 
                <b>Tagline: </b>
 
            </td>
 
            <td valign="top">
 
                '.$move["tagline"].'
 
            </td>
 
        </tr>
 
        <tr>
 
            <td valign="top">
 
                <b>Outline: </b>
 
            </td>
 
            <td valign="top">
 
                '.$move["outline"].'
 
            </td>
 
        </tr>
 
        <tr>
 
            <td valign="top">
 
                <b>Large outline: </b>
 
            </td>
 
            <td valign="top">
 
                '.$move["outlinemore"].'
 
            </td>
 
        </tr>
 
        <tr>
 
            <td valign="top">
 
                <b>Cast: </b>
 
            </td>
 
            <td valign="top">
 
        ';
 
        $cazt = $connection->execute($sql->getCast($move["id"]),1);
 
        if (count($cazt) > 0) {
 
            echo '<table cellspace="3">';
 
            $i = 0;
 
            foreach ($cazt as $actorz) {
 
                echo '
 
                <tr><td><strong>'.$actorz["name"].'</strong>:</td><td>'.$actorz["part"].'</td></tr>
 
                ';
 
                $i++;
 
                if ($i == 5) {
 
                    echo '<tr><td colspan="2">Limited to 5</td></tr>';
 
                    break;
 
                }
 
            }
 
            echo '</table>';
 
        }
 
        
 
        echo '
 
            </td>
 
        </tr>
 
        </table>
 
        <hr>
 
        ';
 
        flush();
 
    }
 
} else
 
    echo "No movies found";
 
 
echo '
 
</body>
 
</html>
 
';
 
?>
 
 |