forked from wrjac/backpacker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.php
136 lines (121 loc) · 4.41 KB
/
dashboard.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
session_start();
$str = "You are not logged in";
if(isset($_SESSION['id'])) {
echo $_SESSION['id'];
} else {
echo addslashes($str);
}
?>
<!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">
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="dashboard.css">
<title>BackPacker</title>
<link href="js/jquery.bootgrid.css" rel="stylesheet">
</head>
<body>
<header>
<div class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<a href="index.php" class="navbar-brand" id="logo">BackPacker</a>
</div>
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
<a href="#">
Dashboard
</a>
</li>
<li class ="sidebar-border">
</li>
<li>
<a href="dashboard.php">Gearlist</a>
</li>
<li>
<a href="trip.php">Trips</a>
</li>
</div>
<!-- /#sidebar-wrapper -->
<div class="navbar-collapse collapse" id="nav-bar-target">
<ul class="nav navbar-nav navbar-right">
<li class="login"><a href="login.html">Log In</a></li>
</ul>
</div>
</div>
</div>
</header>
<!--- This section needs to only display rows applicable to the AccountID signed in. We should probably update the ERD-->
<table id ="geargrid" class="table table-condensed table-hover table-striped" data-toggle="bootgrid" style="margin-left:212px;">
<thead>
<tr>
<th data-column-id="gearID" data type="numeric" style="color: white;">ID</th>
<th data-column-id="gearName" style="color: white;">Gear Name</th>
<th data-column-id="gearType" style="color: white;">Gear Type</th>
<th data-column-id="gearCost" data type="numeric" style="color: white;">Gear Cost</th>
<th data-column-id="gearRating" data type="numeric" style="color: white;">Gear Rating</th>
</tr>
</thead>
<tbody>
...
</tbody>
</table>
<!-- textboxes that allow a user to post data to their gear lits
Feel free to prettify this if you want
gearID, gearName, gearType, gearCost, gearRating
-->
<form action="insert.php" method="post">
Gear Name: <input type="text" name="gearNameformbox" />
Gear Type: <input type="text" name="gearTypeformbox" />
Gear Weight: <input type="number" name="gearWeightformbox" />
Gear Rating: <input type="number" name="gearRatingformbox" />
<input type="submit" />
</form>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery-1.11.1.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<!-- Include bootgrid plugin (below), -->
<script src="js/jquery.bootgrid.min.js"></script>
<!--- bootgrid js. Will add to this.
For documentation see: http://www.jquery-bootgrid.com/documentation
-->
<script langauge="javascript">
$("geargrid").bootgrid({
ajax: true,
post: function ()
{
return {
id: "1"
};
},
url: "localhost",
formatters: {
"commands": function(column, row)
{
return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.id + "\"><span class=\"fa fa-pencil\"></span></button> " +
"<button type=\"button\" class=\"btn btn-xs btn-default command-delete\" data-row-id=\"" + row.id + "\"><span class=\"fa fa-trash-o\"></span></button>";
}
}
}).on("loaded.rs.jquery.bootgrid", function()
{
grid.find(".command-edit").on("click", function(e)
{
/*Tentative actions. Users should be able to edit/delete using these commands*/
alert("You pressed edit on row: " + $(this).data("row-id"));
}).end().find(".command-delete").on("click", function(e)
{
alert("You pressed delete on row: " + $(this).data("row-id"));
});
});
</script>
</body>
</html>