PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Randy Gerritse  >  IMDBSearch  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: overview of the movies already stored in the local database
Class: IMDBSearch
Search the Internet Movie DataBase
Author: By
Last change:
Date: 12 years ago
Size: 1,992 bytes
 

Contents

Class file image Download
<?
/* Displays movies in the local database
    Don't modify without written authorization
    Created by: Randy Gerritse
    Email: randy@randy.nu
    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>
'
;
?>