This repository has been archived by the owner on Dec 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpredictor.php
114 lines (95 loc) · 3.96 KB
/
predictor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!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>Film Success Predictor</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/simple-sidebar.css" rel="stylesheet">
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Sidebar JS-->
<script src="js/sidebar.js"></script>
<!-- AJAX request to search for information -->
<script type="text/javascript">
$(document).ready(function() {
// Hide return row
$("#return-row").hide();
$("#title-row").hide();
$("#prediction_form").on('submit', function (e) {
// Prevent form from actually submitting
e.preventDefault();
// AJAX call to get films
$.ajax({
url: 'prediction_calculator.php',
type: 'GET',
data: $("#prediction_form").serialize(),
success: function(result) {
$("#res-container").empty();
$("#title-row").show();
$("#return-row").show();
// Populate result container
resArray = JSON.parse(result);
$("#title-container").text("Domestic Gross Estimate is $" + resArray[0]);
for (var i = 1; i < resArray.length; i += 1) {
$("#res-container").append("<tr><td>" + resArray[i][0] + "</td><td>$" + resArray[i][1] + "</td></tr>");
}
},
});
});
});
</script>
</head>
<body>
<div id="wrapper">
<!-- Sidebar -->
<?php include('partials/sidebar.php') ?>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1>Film Success Predictor</h1>
<form action="prediction_calculator.php" id="prediction_form" method="get">
Comma Separated Actors <input type="textbox" name="actorList"/><br/>
Comma Separated Directors: <input type="textbox" name="director"/><br/>
Comma Separated Writers: <input type="textbox" name="writer"/><br/>
Distributor: <input type="textbox" name="distributor"/><br/>
Rating: <input type="textbox" name="rating"/><br/>
Genre: <input type="textbox" name="genre"/><br/>
Release Year: <input type="textbox" name="year"/><br/>
<input type="submit"/>
</form>
</div>
</div>
<div class="row" id="title-row">
<div class="col-lg-12" id="title-container" style="font-size:1.75em;">
</div>
</div>
<div class="row" id="return-row">
<div class="col-lg-12" style="font-size:1.75em;">
Look Below for Recent Movies had Similar Domestic Gross
</div>
<div class="col-lg-12">
<table class="table table-striped">
<thead><tr><th>Movie Title</th><th>Domestic Gross</th></tr></thead>
<tbody id="res-container">
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- /#page-content-wrapper -->
</div>
<!-- /#wrapper -->
</body>
</html>