-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·153 lines (144 loc) · 5.08 KB
/
index.php
File metadata and controls
executable file
·153 lines (144 loc) · 5.08 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
session_start();
if(!isset($_SESSION['user_id']))
header("location: login.php");
if(!isset($_SESSION['selection']))
$_SESSION['selection'] = 'Weekend';
$con=mysql_connect("localhost","four","password");
if (!$con) {
die('Could not connect to MySQL: ' . mysql_error());
}
else{
if ( !mysql_select_db("477b"))
{
echo "Can't connect to 477b";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<script src = "https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
var simResults = <?php echo $_SESSION['results'];?>;
</script>
<title>TraffX - Map</title>
<meta charset="utf-8">
<link href = style.css rel = "stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
var setting = "b1";
$(document).ready(function(){
$("#map").click(function(){
window.open ('index.php','_self',false)
});
$("#settings").click(function(){
window.open ('settings.php','_self',false)
});
$("#matrix").click(function(){
window.open ('matrix.php','_self',false)
});
$("#logout").click(function(){
window.open ('scripts/logout.php','_self',false)
});
<?php
$check = mysql_query("SELECT name FROM runs WHERE user_id='".$_SESSION['user_id']."'");
while($row = mysql_fetch_row($check))
{
echo("$(\"#".$row[0]."\").click(function(){setting = \"".$row[0]."\";window.open (\"scripts/switch.php?selection=".$row[0]."&last=index\",'_self',false);});");
}
?>
$("#go").click(function(){
document.adjust.submit();
});
$("#add").click(function(){
document.adder.submit();
});
});
</script>
</head>
<body>
<div id="nav">
<img src = "logo.gif" width = "250px" style="margin-left:50px;float:right;"/>
<div id ="buttons">
<div class="tabs" id="map">Map</div>
<div class="tabs" id = "settings">Settings</div>
<div class="tabs" id = "matrix">Matrix</div>
<div class="tabs" id = "logout">Log Out</div>
</div>
</div>
<div id="master">
<div id="content">
<canvas id = "canvas" width="600px" height="400px"></canvas>
<script src = "scripts/canvas.js">
</script>
<center>
<div id = "go">
GO
</div>
</center>
</div>
<div id ="sidebar">
<?php
$check = mysql_query("SELECT name FROM runs WHERE user_id='".$_SESSION['user_id']."'");
while($row = mysql_fetch_row($check))
{
if($row[0] != $_SESSION['selection'])
echo("<div class =\"config\" id=\"".$row[0]."\">".$row[0]."</div>");
else
echo("<div class =\"config\" id=\"".$row[0]."\"style = \"background-color:orange\">".$row[0]."</div>");
}
?>
</div>
<form action = "scripts/addRun.php" method = "post" name = "adder" id="adder">
<input type = text style="width:290px;height:30px;background-color:black;color:white;font-size:75%" name = "name">
<div id = "add">
ADD
</div>
</form>
<form action = "analyzer/losangeles.php" method = "post" name = "adjust">
<table id ="times">
<tr>
<td>Start Time</td>
<td>
<select name = "start">
<script>
for(test = 0;test < 24;test++)
{
if(test ==0)
document.write("<option value='"+test+"'>"+12+":00AM</option>");
else if(test < 12)
document.write("<option value='"+test+"'>"+test+":00AM</option>");
else if(test ==12)
document.write("<option value='"+test+"'>"+12+":00PM</option>");
else
document.write("<option value='"+test+"'>"+(test-12)+":00PM</option>");
}
</script>
</select>
</td></tr>
<tr>
<td>End Time</td>
<td>
<select name = "end">
<script>
for(test = 0;test < 24;test++)
{
if(test ==0)
document.write("<option value='"+test+"'>"+12+":00AM</option>");
else if(test < 12)
document.write("<option value='"+test+"'>"+test+":00AM</option>");
else if(test ==12)
document.write("<option value='"+test+"'>"+12+":00PM</option>");
else
document.write("<option value='"+test+"'>"+(test-12)+":00PM</option>");
}
</script>
</select>
</td></tr>
</table>
</form>
<br>
</div>
</body>
</html>