#!/usr/local/bin/php

<?php
  // main passed variable, decides which operation to perform
  if ( isset($_GET['o']) )
      $operation = $_GET['o'];
  else
      $operation = '';

  // mysql variables, change according to your own setup
  $mysql_host = "cse.unl.edu";
  $mysql_user = "cusack2";
  $mysql_pass = "ih8pwds";
  $mysql_database = "cusack2";

  // includes the html header thats the same for all pages
  include('top.htm');

  switch( $operation ){
  
    // Shows form for taking movie input
    case 1:
      include('form_movie.php');
    break;
    
    // Adds movie to Movies database, takes passed variables
    case 2:
      include('add_movie.php');
    break;
    
    // Shows form for taking person input
    case 3:
      include('form_person.php');
    break;
    
    // Adds person to People database, takes passed variables
    case 4:
      include('add_person.php');      
    break;
    
    // Shows form for taking actor input
    case 5:
      include('form_character.php');
    break;
    
    // Takes passed actor variables and adds to TheCast table
    case 6:
      include('add_character.php');
    break;
    
    case 7:
      include('form_crew.php');
    break;
    
    case 8:
      include('add_crew.php');
    break;
    
    //Displays entries in the Movies database
    case 9:
      include('display_movies.php');
    break;
    
    // Displays entries in the People database
    case 10:
      include('display_people.php');
    break;

    case 11:
      include('display_crew.php');
    break;
    
    case '':
      echo('Please select an operation to perform from the menu on the left.');
      //include('temp.php');
    break;
  }
  
  // includes the html footer thats the same for all pages
  include('bot.htm');
?> 
