439 main.html

Large diffs are not rendered by default.

@@ -0,0 +1,296 @@
<?php
session_start();
if(!isset($_SESSION["user"]))
{
header("Refresh:1; url=main.html", true, 303);
}
?>

<!DOCTYPE html>
<html>
<head>


<link rel="stylesheet" type="text/css" href="css/styles.css">
<link href="https://fonts.googleapis.com/css?family=Audiowide" rel="stylesheet">
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
body {
font-family: 'Varela Round', sans-serif;
}
.modal-login {
color: #636363;
width: 350px;
}
.modal-login .modal-content {
padding: 20px;
border-radius: 5px;
border: none;
}
.modal-login .modal-header {
border-bottom: none;
position: relative;
justify-content: center;
}
.modal-login h4 {
text-align: center;
font-size: 26px;
margin: 30px 0 -15px;
}
.modal-login .form-control:focus {
border-color: #70c5c0;
}
.modal-login .form-control, .modal-login .btn {
min-height: 40px;
border-radius: 3px;
}
.modal-login .close {
position: absolute;
top: -5px;
right: -5px;
}
.modal-login .modal-footer {
background: #ecf0f1;
border-color: #dee4e7;
text-align: center;
justify-content: center;
margin: 0 -20px -20px;
border-radius: 5px;
font-size: 13px;
}
.modal-login .modal-footer a {
color: #999;
}
.modal-login .avatar {
position: absolute;
margin: 0 auto;
left: 0;
right: 0;
top: -70px;
width: 95px;
height: 95px;
border-radius: 50%;
z-index: 9;
background: #60c7c1;
padding: 15px;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
}
.modal-login .avatar img {
width: 100%;
}
.modal-login.modal-dialog {
margin-top: 80px;
}
.modal-login .btn {
color: #fff;
border-radius: 4px;
background: #60c7c1;
text-decoration: none;
transition: all 0.4s;
line-height: normal;
border: none;
}
.modal-login .btn:hover, .modal-login .btn:focus {
background: #45aba6;
outline: none;
}
.trigger-btn {
display: inline-block;
margin: 10px auto;
}
.modal-dialog {
width: 400px;
}
.modal-content {
width: 400px;
}
.modal-body{
padding-left: 50px;
padding-right:50px;
}
button{
display: inline-block;
margin:0 5px 0 0;
padding:15px 30px;
font-size: 24px;
line-height: 0.9;
appearance:none;
box-shadow: none;
border-radius: 0;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
button.flat{
color:#fff;
background-color: #00d3a3;
text-shadow:-1px 1px #417cb8;
border: none;
}
button.flat:hover{
background-color: #00b180;
text-shadow:-1px 1px #27496d;
}
button.flat:active{
background-color: #00b180;
text-shadow:-1px 1px #193047;
}
#email{
width:340px;
height:40px;
}
.inline-actions{
position: absolute;
right: 0;
bottom: 20px;
z-index: 1;
overflow: hidden;
}
.check-icn{
background: url(../assets/icons/checkmark-sm.png) center center no-repeat;
width:34px;
height:34px;
}
.right-inner-addon {
position: relative;
}
.right-inner-addon input {
padding-right: 30px;
}
.right-inner-addon button {
position: absolute;
right: -5px;
pointer-events: none;
}
#search{
}
button.success,button.create{
background-color: #00d3a3;
}
button.fail{
background-color: #ffc000;
}
button.create{
background-color: #00d3a3;
color:#fff;
}
button.create:hover, button.create:active{
background-color: #00b180;
color:#fff;
}
input[type="text"], input[type="email"],input[type="password"]{
background-color : #f7f7f7;
outline: none;
border: 2px solid #e7e7e7 !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
}
input[type="text"]:focus, input[type="email"]:focus,input[type="password"]:focus{
background-color : #e7e7e7;
outline: none;
border: 2px solid #e7e7e7 !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
}
div.scrollmenu {
background-color: white;
overflow: auto;
white-space: nowrap;
}
div.scrollmenu a {
display: inline-block;
color: white;
text-align: center;
padding: 14px;
text-decoration: none;
}
div.scrollmenu a:hover {
background-color: #777;
}


</style>





<style type="text/css">
.tile {display: inline-block; border: 1px solid grey; background: silver; padding: 4px; text-align: center; font-size: 15px;width:250px; position:relative; }
.link-spanner{display: inline-block; position:absolute;width:100%;height:100%;top:0; left:0; z-index:1; }
</style>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

<script>

$(document).ready(function() {

// send off the query
$.ajax({
type: "GET",
url: "location.php",
success: function(data)//should be data

{ var pd = JSON.parse(data);
$(document.body).append('<p>Found ' + pd.length + ' movies showing within 5 miles of your zipcode ' + ':</p>');
$.each(pd, function() {
var encoded = encodeURI(this.title);
var movieData = '<div class="tile"><img src="' + this.photo + '"><br/> <a href="newtheatre.html?title=' + encoded + '"> <span class ="link-spanner"></span> </a> ';//DB CHECK if right
movieData += this.title;
if (this.ratings) { movieData += ' (' + this.ratings[0].code + ') </div>' };
$(document.body).append(movieData);
});
},

});
});

// callback to handle the results
/* function dataHandler(data) {
$(document.body).append('<p>Found ' + data.length + ' movies showing within 5 miles of ' + zipCode+':</p>');
var movie = data.hits;
$.each(data, function(index, movie) {
var movieData = '<div class="tile"><img src="http://developer.tmsimg.com/' + movie.preferredImage.uri + '?api_key='+apikey+'"><br/> <a href="newtheatre.html"> <span class ="link-spanner"></span> </a> ';
movieData += movie.title;
if (movie.ratings) { movieData += ' (' + movie.ratings[0].code + ') </div>' };
$(document.body).append(movieData);
});
}*/

</script>
</head>
<body>

<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="main2.html">CAN WE COME UP WITH A NAME LMAO</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="main2.html">Home</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<!--<button class="flat" data-toggle="modal" data-target="#MyModal"> Sign Up</button>-->
<!--<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>-->
<li><a href="main.html" class="trigger-btn glyphicon glyphicon-log-out" >Logout</a></li>
</ul>
</div>
</nav>


</body>
</html>

@@ -24,12 +24,14 @@
<title></title>

<script type="text/javascript">
var movie = "<?php $movie = $_GET['title']; echo $movie ?>";

$(window).load(function(){
$.ajax ({

type: "GET",
url: "theatre_location.php",

data: "title=" + movie,

error: function(xhr, status, error) {alert( "error Message: \r\nNumeric code is: " + xhr.status + " \r\nError is " + error );},
success: function(result){
@@ -40,7 +42,12 @@

$("#photo").html('<img src ="' + parsed_result["b"][0]["photo"] + '">')
$("#desc").html(parsed_result["b"][0]["description"]);
$("#rNrt").html(parsed_result["b"][0]["mpaa"] + ', ' + parsed_result["b"][0]["hours"] + '&ensp;' + parsed_result["b"][0]["mins"] );
var rating = parsed_result["b"][0]["mpaa"];
if(rating == null)
{
rating = "NR";
}//havent test this out
$("#rNrt").html(rating + ', ' + parsed_result["b"][0]["hours"] + '&ensp;' + parsed_result["b"][0]["mins"] );


$.each(parsed_result.a, function() // .a works same as ["a"] (.a contains theatre names, showtimes, and purchase links )
@@ -83,76 +90,14 @@
}


$("tbody").append(' <tr> <td >' + theatre + '</td> <td >' + showtime + ' </td> </tr> ');
$("tbody").append(' <tr> <td >' + theatre + '</td> <td >' + showtime + ' </td><hr> </tr> <hr> ');
});


},

});

// ================= GENERATE DUMMY TABLE
//var n = 0;
//var TOTAL_ROWS = 30;
//for (var i = 0; i < TOTAL_ROWS; ++i) {
// appendItem();
//}


//function appendItem() {
// var d = "";
//var item = $(".template").clone().removeClass("template");
// item.find(".num").text(++n);
//item.addClass(++n);
//item.hide();
// var rp = "aMC :)";
// var timelist = ["10","12"];
// for (var i = 0; i < timelist.length; i++)
// { d += timelist[i] ;
// d = d + '&emsp;';
// }
// $("tbody").append(' <tr> <td >' + rp + '</td> <td >' + d + ' </td> </tr> ');




//}

// ================= SHOW ONLY FEW ROWS BY DEFAULT

/*
var howMany = 3;
showDefaultRows();
function showDefaultRows() {
var complete = 0;
$(".table-item").each(function () {
if (++complete > howMany) {
return;
}
$(this).show();
});
}
*/
// ================= ON CLICK
/*
$(".btn").on("click", function () {
var complete = 0;
var showMore = 5;
howMany += showMore;
$(".table-item").each(function () {
if (++complete > howMany) {
return;
}
$(this).fadeIn();
});
}); */


});

@@ -168,11 +113,11 @@

<div class="container">
<img id="photo" align="left"height="250">
<h2 id = "title">The Avengers</h2>
<h2 id = "title"></h2>
<p id = "rd" > </p>
<p id = "rNrt">PG-13, 2 hr 29 min</p>
<p id ="desc">Iron Man, Thor, the Hulk and the rest of the Avengers unite to battle their most powerful enemy yet -- the evil Thanos. On a mission to collect all six Infinity Stones, Thanos plans to use the artifacts to inflict his twisted will on reality. The fate of the planet and existence itself has never been more uncertain as everything the Avengers have fought for has led up to this moment.</p>
<table class="table table-hover">
<p id = "rNrt"></p>
<p id ="desc"> </p>
<table class="table table-hover">
<thead>
<tr>
<th>Theater</th>
@@ -182,14 +127,15 @@ <h2 id = "title">The Avengers</h2>
<tbody>
<tr class="template">

<td id = "theatre">what?</td>
<td id="st" > 9:00 &ensp; 10:00 </td>
</tr>
<td id = "theatre"></td>
<td id="st" > </td>

</tr>
</tbody>

</table>

<button class="btn">Show more</button>


<script>
// tell the embed parent frame the height of the content
@@ -0,0 +1,62 @@


<?php
/*
//include ('redirect.php');
error_reporting(-1);
ini_set('display_errors', false);
include ('client.php');
$firstname = $_POST['fName'];
$lastname = $_POST['lName'];
$email = $_POST['email'];
$user = $_POST['user'];
$password = $_POST['pass'];
$response = registration($email,$firstname,$lastname,$password, $user);
if($response != true)
{
header("Refresh:2; url=main.html", true, 303);
// redirect("registration failed !!", "main.html", 3);
}
else
{
echo "thank you for registering!!:)";
header("Refresh:2; url=newtheatre.html", true, 303);
// redirect("Thank you for registering!!!", "newtheatre.html", 3);
}
*/


ini_set("display_errors", 1);
//ini_set("log_errors",1);
//ini_set("error_log", "/tmp/error.log");
//error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT);
//error_log("Hello, errors!");
include ('client.php');
$firstname = $_POST['fName'];
$lastname = $_POST['lName'];
$user = $_POST['user'];
$email = $_POST['email'];
$password = $_POST['pass'];
$zipcode = $_POST['zipcode'];
$response = registration($email,$firstname,$lastname, $password, $user, $zipcode);
if($response != true)
{
echo "Registration Failed. Please try a different email";
header( "Refresh:1; url=main.html", true, 303);
}
else
{
echo "Thank you for Registering!. Please Log in now.";
header( "Refresh:1; url=main.html", true, 303);
}

?>

@@ -1,5 +1,14 @@
<?php

session_start();
if(!isset($_SESSION["user"]))
{
header("Refresh:1; url=main.html", true, 303);
}
$movie = $_GET['title'];
//echo " movie is: $movie";
//$movie = mysqli_real_escape_string($movie);
//$date = $_SESSION["date"];
//$zip = $_SESSION["zipcode"];
($db = mysqli_connect ( 'localhost', 'root', 'root', 'example' ) );
if (mysqli_connect_errno())
{
@@ -9,8 +18,9 @@

mysqli_select_db($db, 'example' );
$a1 = array();
$movie = mysqli_real_escape_string($db,$movie);

$s = "select showtimes.theatre_name, showtimes.time, showtimes.link from theatres JOIN showtimes on theatres.theatre_name = showtimes.theatre_name where showtimes.title= 'A Quiet Place' and showtimes.date = '2018-04-23' and theatres.zipcode = '07011'";
$s = "select showtimes.theatre_name, showtimes.time, showtimes.link from theatres JOIN showtimes on theatres.theatre_name = showtimes.theatre_name where showtimes.title= '$movie' and showtimes.date = '2018-04-25' and theatres.zipcode = '07011'";
$t = mysqli_query($db,$s) or die (mysqli_error($db));
while ($r = mysqli_fetch_array($t, MYSQLI_ASSOC))
{
@@ -58,7 +68,7 @@

}

$s = "select * from movie_info where title = 'A Quiet Place'";
$s = "select * from movie_info where title = '$movie'";
$t = mysqli_query($db,$s) or die (mysqli_error($db));
$r = mysqli_fetch_array($t, MYSQLI_ASSOC);