-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmatrix.php
More file actions
128 lines (118 loc) · 4.31 KB
/
matrix.php
File metadata and controls
128 lines (118 loc) · 4.31 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
<?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>
<title>TraffX - Matrix</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=matrix\",'_self',false);});");
}
?>
$("#go").click(function(){
document.adjust.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">
<div style = "overflow:scroll;width:600px;height=400px">
<form action = "scripts/updateMatrix.php" method = "post" name = "adjust">
<table style="color:white;font-size:125%">
<?php
$check = mysql_query("SELECT matrix FROM runs WHERE user_id='".$_SESSION['user_id']."' AND name = '".$_SESSION['selection']."'");
$row = mysql_fetch_row($check);
parse_str($row[0], $elements);
$size = 66;
echo("<tr><td width='50px'>Exit</td>");
for($i = 0; $i <= $size;$i++)
{
echo("<td width='50px'><center>".($i)."</center></td>");
}
echo("</tr>");
for($i = 0;$i <= $size;$i++)
{
echo ("<tr><td width = '50px'><center>".($i)."</center></td>");
for($j = 0;$j <= $size;$j++)
{
echo("<td width = '50px'>");
if($j != $i)
{
echo("<input type = 'text' size = '3' name = '".$i."-".$j."' value = ".$elements["".$i."-".$j].">");
}
echo("</td>");
}
echo("</tr>");
}
?>
</table>
</form>
</div>
<center>
<div id = "go">
SAVE
</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>
<br>
</div>
</body>
</html>