<commit_before><!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Movie-Mania</title>

    <!-- Bootstrap Core CSS -->
    <link href="templateStuff/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="templateStuff/css/sb-admin.css" rel="stylesheet">

    <!-- Morris Charts CSS -->
    <link href="templateStuff/css/plugins/morris.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="templateStuff/font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
	.table{
		width: 400px;
	}
    	.navbar-header {
    		margin: 0 auto;
    		position: relative;
    	}
    	.bar {
    		margin-right: 2rem;
    		margin-left: 2rem;
    	}
    	.searchbar {
    		margin-left:7rem;
    	}
    	.strong {
    		font-weight: bold;
    		font-size: 1.5rem;
    	}
    	.movie_titles {
    		display: inline;
    	}
    </style>
</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.php">Movie Mania</a>
            </div>
            <button type="button" class="btn btn-default navbar-btn navbar-right bar">Login</button>
	    <button type="button" class="btn btn-default navbar-btn navbar-right bar">Sign up</button>
        <form method = "POST" action = "decider.php" class="navbar-form navbar-left searchbar" role="search">
            <div class="form-group">
                <input type="text" class="form-control" name='search' placeholder="Search">
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
           
            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav side-nav">
                    <li class="active">
                        <a href="index.php"><i class="fa fa-fw fa-home"></i> Home</a>
                    </li>
                    <li>
                        <a href="movies.php"><i class="fa fa-fw fa-film"></i> Movies</a>
                    </li>
                    <li>
                        <a href="actors.php"><i class="fa fa-fw fa-user"></i> Actors</a>
                    </li>
                    <li>
                        <a href="boxOffice.php"><i class="fa fa-fw fa-money"></i> Box Office</a>
                    </li>
                    <li>
                        <a href="error_page.php"><i class="fa fa-fw fa-calendar"></i> Year</a>
                    </li>
                    <li>
                        <a href="error_page.php"><i class="fa fa-fw fa-bar-chart-o"></i> Rating</a>
                    </li>
                    <li>
                        <a href="javascript:;" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-video-camera"></i> Genre <i class="fa fa-fw fa-caret-down"></i></a>
                        <ul id="demo" class="collapse pre-scrollable">
                            <li>
                                <a href="genre.php">All Genres</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Action">Action</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Adventure">Adventure</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Animation">Animation</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Biography">Biography</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Comedy">Comedy</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Crime">Crime</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Documentary">Documentary</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Drama">Drama</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Fantasy">Fantasy</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Film-Noir">Film-Noir</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=History">History</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Horror">Horror</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Music">Music</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Musical">Musical</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Mystery">Mystery</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Romance">Romance</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Sci-Fi">Sci-Fi</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Sports">Sports</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Thriller">Thriller</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=War">War</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Western">Western</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="error_page.php"><i class="fa fa-fw fa-gears"></i> Statistics</a>
                    </li>
                    <li>
                        <a href="error_page.php"><i class="fa fa-fw fa-file"></i> About Us</a>
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </nav>

        <div id="page-wrapper">

            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">
                            Search any Movie in our Database! <small>The most popular movies from each year</small>
                        </h1>
                        <ol class="breadcrumb">
                            <li class="active">
                                <i class="fa fa-arrow-right"><span class="">Movies</span></i>
                            </li>
                        </ol>
                    </div>
                </div>
                <!-- /.row -->

                <div class="row">
                    <div class="col-lg-12">
                        <div class="alert alert-info alert-dismissable">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                            <i class="fa fa-info-circle"></i>  <strong>Search Movies</strong> Search by Title or Genre                       
                        </div>
                    </div>
                </div>
                <!-- /.row -->


<?php
        
    if(isset($_POST['submit'])){
        $title = $_POST['title'];
	    echo "About $title";
	    $conn = pg_connect("host=dbhost-pgsql.cs.missouri.edu dbname=cs3380f14grp12 user=cs3380f14grp12 password=<PASSWORD>");

        $query1 = "SELECT DISTINCT ON (title) * FROM movie WHERE (title = $1)";
        pg_prepare($conn,"titlesearch",$query1);
        $result1 = pg_execute($conn,"titlesearch",array($title));
	  
        echo "<table class='table table-striped'>";
	    echo "<tbody>";
	  
	    $i=0;
        while($line = pg_fetch_array($result1,null,PGSQL_ASSOC)){
            foreach($line as $col_value){
	            $fieldname=pg_field_name($result1,$i);
                echo "\t\t<tr><td>$fieldname</td><td>$col_value</td></tr>\n";
                $i=$i+1;
	        }
        }

	    echo "</tbody>\n";
        echo "</table>\n";


        pg_free_result($result1);

        pg_close($conn);
    }

?>

<?php
    if(isset($_POST['search'])){
       $title = $_POST['title2'];
       echo "About $title";
       $conn = pg_connect("host=dbhost-pgsql.cs.missouri.edu dbname=cs3380f14grp12 user=cs3380f14grp12 password=<PASSWORD>");

       $query1 = "SELECT DISTINCT ON (title) * FROM movie WHERE (title = $1)";
       pg_prepare($conn,"titlesearch",$query1);
       $result1 = pg_execute($conn,"titlesearch",array($title));

       echo "<table class='table table-striped'>";
       echo "<tbody>";

       $i=0;
       while($line = pg_fetch_array($result1,null,PGSQL_ASSOC)){
            foreach($line as $col_value){
               $fieldname=pg_field_name($result1,$i);
               echo "\t\t<tr><td>$fieldname</td><td>$col_value</td></tr>\n";
               $i=$i+1;
            }
       }

       echo "</tbody>\n";
       echo "</table>\n";


       pg_free_result($result1);

       pg_close($conn);
    }
?>

<?php
    if(!isset($_POST['search']) && !isset($POST['submit'])){
       if ($_POST['title3']) {
           $title = $_POST['title3'];
           echo "<h3>About <u><strong>$title</strong></u></h3>";
           $conn = pg_connect("host=dbhost-pgsql.cs.missouri.edu dbname=cs3380f14grp12 user=cs3380f14grp12 password=<PASSWORD>");

           $query1 = "SELECT DISTINCT ON (title) * FROM movie WHERE (title = $1)";
           pg_prepare($conn,"titlesearch",$query1);
           $result1 = pg_execute($conn,"titlesearch",array($title));

           echo "<table class='table table-striped'>";
           echo "<tbody>";

           $i=0;
           while($line = pg_fetch_array($result1,null,PGSQL_ASSOC)){
                foreach($line as $col_value){
                   $fieldname=pg_field_name($result1,$i);
                   echo "\t\t<tr><td><strong>$fieldname</strong></td><td>$col_value</td></tr>\n";
                   $i=$i+1;
                }
           }

           echo "</tbody>\n";
           echo "</table>\n";


           pg_free_result($result1);

           pg_close($conn);
        }
    }

    session_start();
    if (isset($_SESSION['title']) {
        $title = $_SESSION['title'];
           echo "<h3>About <u><strong>$title</strong></u></h3>";
           $conn = pg_connect("host=dbhost-pgsql.cs.missouri.edu dbname=cs3380f14grp12 user=cs3380f14grp12 password=<PASSWORD>");

           $query1 = "SELECT DISTINCT ON (title) * FROM movie WHERE (title = $1)";
           pg_prepare($conn,"titlesearch",$query1);
           $result1 = pg_execute($conn,"titlesearch",array($title));

           echo "<table class='table table-striped'>";
           echo "<tbody>";

           $i=0;
           while($line = pg_fetch_array($result1,null,PGSQL_ASSOC)){
                foreach($line as $col_value){<commit_msg>Changed the genres page, so when you click on a movie title, it brings up that movie's profile page<commit_after><!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Movie-Mania</title>

    <!-- Bootstrap Core CSS -->
    <link href="templateStuff/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="templateStuff/css/sb-admin.css" rel="stylesheet">

    <!-- Morris Charts CSS -->
    <link href="templateStuff/css/plugins/morris.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="templateStuff/font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
	.table{
		width: 400px;
	}
    	.navbar-header {
    		margin: 0 auto;
    		position: relative;
    	}
    	.bar {
    		margin-right: 2rem;
    		margin-left: 2rem;
    	}
    	.searchbar {
    		margin-left:7rem;
    	}
    	.strong {
    		font-weight: bold;
    		font-size: 1.5rem;
    	}
    	.movie_titles {
    		display: inline;
    	}
    </style>
</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.php">Movie Mania</a>
            </div>
            <button type="button" class="btn btn-default navbar-btn navbar-right bar">Login</button>
	    <button type="button" class="btn btn-default navbar-btn navbar-right bar">Sign up</button>
        <form method = "POST" action = "decider.php" class="navbar-form navbar-left searchbar" role="search">
            <div class="form-group">
                <input type="text" class="form-control" name='search' placeholder="Search">
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
           
            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav side-nav">
                    <li class="active">
                        <a href="index.php"><i class="fa fa-fw fa-home"></i> Home</a>
                    </li>
                    <li>
                        <a href="movies.php"><i class="fa fa-fw fa-film"></i> Movies</a>
                    </li>
                    <li>
                        <a href="actors.php"><i class="fa fa-fw fa-user"></i> Actors</a>
                    </li>
                    <li>
                        <a href="boxOffice.php"><i class="fa fa-fw fa-money"></i> Box Office</a>
                    </li>
                    <li>
                        <a href="error_page.php"><i class="fa fa-fw fa-calendar"></i> Year</a>
                    </li>
                    <li>
                        <a href="error_page.php"><i class="fa fa-fw fa-bar-chart-o"></i> Rating</a>
                    </li>
                    <li>
                        <a href="javascript:;" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-video-camera"></i> Genre <i class="fa fa-fw fa-caret-down"></i></a>
                        <ul id="demo" class="collapse pre-scrollable">
                            <li>
                                <a href="genre.php">All Genres</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Action">Action</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Adventure">Adventure</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Animation">Animation</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Biography">Biography</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Comedy">Comedy</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Crime">Crime</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Documentary">Documentary</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Drama">Drama</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Fantasy">Fantasy</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Film-Noir">Film-Noir</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=History">History</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Horror">Horror</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Music">Music</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Musical">Musical</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Mystery">Mystery</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Romance">Romance</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Sci-Fi">Sci-Fi</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Sports">Sports</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Thriller">Thriller</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=War">War</a>
                            </li>
                            <li>
                                <a href="genre.php?genre=Western">Western</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="error_page.php"><i class="fa fa-fw fa-gears"></i> Statistics</a>
                    </li>
                    <li>
                        <a href="error_page.php"><i class="fa fa-fw fa-file"></i> About Us</a>
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </nav>

        <div id="page-wrapper">

            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">
                            Search any Movie in our Database! <small>The most popular movies from each year</small>
                        </h1>
                        <ol class="breadcrumb">
                            <li class="active">
                                <i class="fa fa-arrow-right"><span class="">Movies</span></i>
                            </li>
                        </ol>
                    </div>
                </div>
                <!-- /.row -->

                <div class="row">
                    <div class="col-lg-12">
                        <div class="alert alert-info alert-dismissable">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                            <i class="fa fa-info-circle"></i>  <strong>Search Movies</strong> Search by Title or Genre                       
                        </div>
                    </div>
                </div>
                <!-- /.row -->


<?php
        
    if(isset($_POST['submit'])){
        $title = $_POST['title'];
	    echo "About $title";
	    $conn = pg_connect("host=dbhost-pgsql.cs.missouri.edu dbname=cs3380f14grp12 user=cs3380f14grp12 password=<PASSWORD>");

        $query1 = "SELECT DISTINCT ON (title) * FROM movie WHERE (title = $1)";
        pg_prepare($conn,"titlesearch",$query1);
        $result1 = pg_execute($conn,"titlesearch",array($title));
	  
        echo "<table class='table table-striped'>";
	    echo "<tbody>";
	  
	    $i=0;
        while($line = pg_fetch_array($result1,null,PGSQL_ASSOC)){
            foreach($line as $col_value){
	            $fieldname=pg_field_name($result1,$i);
                echo "\t\t<tr><td>$fieldname</td><td>$col_value</td></tr>\n";
                $i=$i+1;
	        }
        }

	    echo "</tbody>\n";
        echo "</table>\n";


        pg_free_result($result1);

        pg_close($conn);
    }

?>

<?php
    if(isset($_POST['search'])){
       $title = $_POST['title2'];
       echo "About $title";
       $conn = pg_connect("host=dbhost-pgsql.cs.missouri.edu dbname=cs3380f14grp12 user=cs3380f14grp12 password=<PASSWORD>");

       $query1 = "SELECT DISTINCT ON (title) * FROM movie WHERE (title = $1)";
       pg_prepare($conn,"titlesearch",$query1);
       $result1 = pg_execute($conn,"titlesearch",array($title));

       echo "<table class='table table-striped'>";
       echo "<tbody>";

       $i=0;
       while($line = pg_fetch_array($result1,null,PGSQL_ASSOC)){
            foreach($line as $col_value){
               $fieldname=pg_field_name($result1,$i);
               echo "\t\t<tr><td>$fieldname</td><td>$col_value</td></tr>\n";
               $i=$i+1;
            }
       }

       echo "</tbody>\n";
       echo "</table>\n";


       pg_free_result($result1);

       pg_close($conn);
    }
?>

<?php
    if(!isset($_POST['search']) && !isset($POST['submit'])){
       if ($_POST['title3']) {
           $title = $_POST['title3'];
           echo "<h3>About <u><strong>$title</strong></u></h3>";
           $conn = pg_connect("host=dbhost-pgsql.cs.missouri.edu dbname=cs3380f14grp12 user=cs3380f14grp12 password=<PASSWORD>");

           $query1 = "SELECT DISTINCT ON (title) * FROM movie WHERE (title = $1)";
           pg_prepare($conn,"titlesearch",$query1);
           $result1 = pg_execute($conn,"titlesearch",array($title));

           echo "<table class='table table-striped'>";
           echo "<tbody>";

           $i=0;
           while($line = pg_fetch_array($result1,null,PGSQL_ASSOC)){
                foreach($line as $col_value){
                   $fieldname=pg_field_name($result1,$i);
                   echo "\t\t<tr><td><strong>$fieldname</strong></td><td>$col_value</td></tr>\n";
                   $i=$i+1;
                }
           }

           echo "</tbody>\n";
           echo "</table>\n";


           pg_free_result($result1);

           pg_close($conn);
        }
    }

    session_start();
    if (isset($_SESSION['title'])) {
        $title = $_SESSION['title'];
           echo "<h3>About <u><strong>$title</strong></u></h3>";
           $conn = pg_connect("host=dbhost-pgsql.cs.missouri.edu dbname=cs3380f14grp12 user=cs3380f14grp12 password=<PASSWORD>");

           $query1 = "SELECT DISTINCT ON (title) * FROM movie WHERE (title = $1)";
           pg_prepare($conn,"titlesearch",$query1);
           $result1 = pg_execute($conn,"titlesearch",array($title));

           echo "<table class='table table-striped'>";
           echo "<tbody>";

           $i=0;
           while($line = pg_fetch_array($result1,null,PGSQL_ASSOC)){
                foreach($line as $col_value){
{'fraction_non_alphanumeric': 0.15402073958129525, 'fraction_numerical': 0.010800234787712776, 'mean_word_length': 1.2674119421524266, 'pattern_counts': {'":': 0, '<': 599, '<?xml version=': 0, '>': 597, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 46, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5025857', 'n_tokens_mistral': 7678, 'n_tokens_neox': 7217, 'n_words': 1273}