-
Notifications
You must be signed in to change notification settings - Fork 0
/
awardDisplay.php
276 lines (217 loc) · 8 KB
/
awardDisplay.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/ideacss.css" />
<link rel="stylesheet" href="css/bootstrap.min.css"></link>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="stickytooltip.js">
</script>
<link rel="stylesheet" type="text/css" href="stickytooltip.css" />
<!-- bootstrap table scripts -->
<style type="text/css">
#caption {
position: relative;
}
#caption LevelImg {
position: absolute;
top: 0px;
right: 0px;
}
</style>
<script>
function exefunction(){
var lfckv = document.getElementById("everybox").checked;
}
</script>
<!-- end of the boostrap table script -->
<!-- popup the edit window -->
<script>
function pop_up(url){
window.open(url,'win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=400,height=325,directories=no,location=no')
}
</script>
<!-- end of the popup window -->
<title>IDEAPOOL Admin Page</title>
<!-- body style/ table margin -->
</head>
<body>
<?php
include('header.php');
?>
<nav class = "navbar navbar-inverse" role = "navigation">
<div class = "navbar-header" style="font-size:20px">
<a class = "navbar-brand" href = "adminPanel.php">Admin Panel</a>
</div>
<div style="font-size:20px">
<div class="nav">
<ul class = "nav navbar-nav pull-right">
<li class = "active"><a href = "index.php">Home</a></li>
<li class = "active"><a href = "adminPanel.php">Dashboard</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<a href="addAwards.php" class="btn btn-success" role="button" width="20em" height: 2em;>New Badge</a>
<div class="row">
<div class="col-md-12">
<br/>
<h4>All Badges Given for the Improvement </h4>
<br/>
<?php
include("database_connect.php");
if(mysqli_connect_errno()){
echo "failed to connect to MySQL.".mysqli_connect_error();
}
$query = "select * from reward where type = 'improvement'";
$result=mysqli_query($con,$query);
?>
<tr class="info">
<div class="row">
<?php while($row=mysqli_fetch_array($result)){
?>
<div class="col-xs-6 col-md-3">
<div class="thumbnail" data-tooltip="sticky1">
<div class="caption">
<img src="<?php echo $row['img']?>" height="120px" width="115px" align="middle">
<p>Badge ID : <?php echo $row['id'] ?></p>
<p>Badge Name : <?php echo $row['name']; ?></p>
<p>Badge Type : <?php echo $row['type'] ?></p>
<p>Badge Level : <?php echo $row['level'] ?></p>
<p>Badge PostCount : <?php echo $row['postcount'] ?></p>
<!--<p>Badge Description : <?php// echo $row['description'] ?></p>-->
<p><a href="viewAwards.php?sendId=<?= $row['id'] ?>" onclick="pop_up(this);return false;" class="btn btn-primary" role="button">View</a>
<button type="button" name="button" class="btn btn-success" onclick="javascript:Edit_id(<?php echo $row['id']; ?>)">Edit</button>
<button type="button" name="button" class="btn btn-danger" onclick="javascript:delete_id(<?php echo $row['id']; ?>)">Delete</button>
</div>
</div>
</div>
<?php
}
?>
</div>
<!--<button type="button" class="btn btn-primary" onclick="exefunction()"><center>Submit</center></button>-->
</div>
</div>
<div class="row">
<div class="col-md-12">
<br/>
<h4>All Badges Given for the Votes </h4>
<br/>
<?php
include("database_connect.php");
if(mysqli_connect_errno()){
echo "failed to connect to MySQL.".mysqli_connect_error();
}
$query = "select * from reward where type = 'vote'";
$result=mysqli_query($con,$query);
?>
<tr class="info">
<div class="row">
<?php while($row=mysqli_fetch_array($result)){
?>
<div class="col-xs-6 col-md-3">
<div class="thumbnail" data-tooltip="sticky2">
<div class="caption">
<img src="<?php echo $row['img']?>" height="120px" width="115px" align="middle">
<p>Badge ID : <?php echo $row['id'] ?></p>
<p>Badge Name : <?php echo $row['name']; ?></p>
<p>Badge Type : <?php echo $row['type'] ?></p>
<p>Badge Level : <?php echo $row['level'] ?></p>
<p>Badge PostCount : <?php echo $row['postcount'] ?></p>
<p><a href="viewAwards.php?sendId=<?= $row['id'] ?>" onclick="pop_up(this);return false;" class="btn btn-primary" role="button">View</a>
<button type="button" name="button" class="btn btn-success" onclick="javascript:Edit_id(<?php echo $row['id']; ?>)">Edit</button>
<button type="button" name="button" class="btn btn-danger" onclick="javascript:delete_id(<?php echo $row['id']; ?>)">Delete</button>
</div>
</div>
</div>
<?php
}
?>
</div>
<!--<button type="button" class="btn btn-primary" onclick="exefunction()"><center>Submit</center></button>-->
</div>
</div>
<div class="row">
<div class="col-md-12">
<br/>
<h4>All Badges Given for the Submissions </h4>
<br/>
<?php
include("database_connect.php");
if(mysqli_connect_errno()){
echo "failed to connect to MySQL.".mysqli_connect_error();
}
$query = "select * from reward where type = 'submission'";
$result=mysqli_query($con,$query);
?>
<tr class="info">
<div class="row">
<?php while($row=mysqli_fetch_array($result)){
?>
<div class="col-xs-6 col-md-3">
<div class="thumbnail" data-tooltip="sticky3">
<div class="caption">
<img src="<?php echo $row['img']?>" height="120px" width="115px" align="middle">
<p>Badge ID : <?php echo $row['id'] ?></p>
<p>Badge Name : <?php echo $row['name']; ?></p>
<p>Badge Type : <?php echo $row['type'] ?></p>
<p>Badge Level : <?php echo $row['level'] ?></p>
<p>Badge PostCount : <?php echo $row['postcount'] ?></p>
<p><a href="viewAwards.php?sendId=<?= $row['id'] ?>" onclick="pop_up(this);return false;" class="btn btn-primary" role="button">View</a>
<button type="button" name="button" class="btn btn-success" onclick="javascript:Edit_id(<?php echo $row['id']; ?>)">Edit</button>
<button type="button" name="button" class="btn btn-danger" onclick="javascript:delete_id(<?php echo $row['id']; ?>)">Delete</button>
</div>
</div>
</div>
<?php
}
?>
</div>
<!--<button type="button" class="btn btn-primary" onclick="exefunction()"><center>Submit</center></button>-->
</div>
</div>
<!--HTML for the tooltips-->
<div id="mystickytooltip" class="stickytooltip">
<div style="padding:5px">
<div id="sticky1" class="atip" style="width:400px">
<img src="images/Ta1.png" /><br />
This is a Reward Given for the Users Who has Posted number of Improvements to the IDEAPOOL
</div>
<div id="sticky2" class="atip" style="width:400px">
<img src="images/Ta2.png" /><br />This is a Reward Given for the Users Who has Exceeded The Desired number of Votes Count
</div>
<div id="sticky3" class="atip" style="width:400px">
<img src="images/Ta3.jpg" /><br />This is a Reward Given for the Users Who has Posted number of Submissions to the IDEAPOOL
</div>
</div>
<div class="stickystatus"></div>
</div>
</div>
</div>
</div>
<!-- popup box of delete-->
<script type="text/javascript">
function delete_id(id)
{
if(confirm('Are you sure you want To Remove This Badge?'))
{
window.location.href='award_delete.php?delete_id='+id;
}
}
function Edit_id(id)
{
if(confirm('Are you sure want To Edit This Badge ?'))
{
window.location.href='editawards.php?sendId='+id;
}
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<?php
include('footer.php');
?>
</body>
</html>