-
Notifications
You must be signed in to change notification settings - Fork 0
/
userprofile.php
134 lines (121 loc) · 4.42 KB
/
userprofile.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
<html>
<head>
<link rel="stylesheet" type="text/css" href="node_modules\bootstrap\dist\css\bootstrap.css">
<link rel="stylesheet" type="text/css" href="node_modules\bootstrap\dist\css\animate.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="node_modules\bootstrap\dist\js\bootstrap.js"></script>
<script>
$(document).ready(function()
{
$('#search').keyup(function()
{
searchTable($(this).val());
});
});
function searchTable(inputVal)
{
var table = $('#tblData');
table.find('tr').each(function(index, row)
{
var allCells = $(row).find('td');
if(allCells.length > 0)
{
var found = false;
allCells.each(function(index, td)
{
var regExp = new RegExp(inputVal, 'i');
if(regExp.test($(td).text()))
{
found = true;
return false;
}
});
if(found == true)$(row).show();else $(row).hide();
}
});
}
</script>
<style>
.img{
position:absolute;
}
h2,h3{
padding-left: 85px;
padding-top: -5px;
}
.img{
padding-top: 30px;
}
body{
background-image:url("img/bg2.jpg");
color: #fff;
background-repeat: no-repeat;
background-attachment: fixed;
}
a:link{
color: #fff;
}
.table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
background-color: #000;
}
</style>
</head>
<body>
<!--navigation menu start-->
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="index.php">FCC Status Viewer</a>
</div>
<ul class="nav navbar-nav">
<li><a href="index.php">Home</a></li>
<li><a href="userlist.php">User List</a></li>
<li><a href="http://fcc-status.herokuapp.com" target="_blank">Live View</a></li>
<li class="active"><a href="userprofile.php">User Profile</a></li>
<li><a href="userexcluder.php">User Excluder</a></li>
<li><a href="activity.php">Activity Report</a></li>
<li><a href="message.php">Message to Campsite</a></li>
</ul>
</div>
</nav>
<!--navigation menu end-->
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<input type="text" placeholder="Enter the camper Name" class="form form-control" id="search"/>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h1><span class="label label-lg label-primary col-lg-12">Select the User to view Individual Activity</span></h1>
</div>
</div>
<table class="table table-hover" id="tblData">
<?php
$link = mysqli_connect('localhost','root','','mini');
if (!$link) {
die('Could not connect to MySQL: ' . mysql_error());
}
$qry="select `user`.`name`,`user`.`uname`,`user`.`url`,`user`.`uid`,`daily_update`.`points` from `user`,`daily_update` where `user`.`uid`=`daily_update`.`uid` and `daily_update`.`r_date`='".date("Y-m-d")."' and `user`.`excluder`='N' ORDER BY `daily_update`.`points` DESC";
$res=mysqli_query($link,$qry) or die (mysqli_error($link));
$count=0;
$str="<tr>";
while($row = mysqli_fetch_array($res, MYSQL_ASSOC)) {
$count++;
$str=$str."<td class=\"col-lg-4\">
<a href=\"profile.php?uid=".$row["uid"]."\"><div class=\"img\" >
<img src=".$row["url"]." width=\"75px\" height=\"75px\" />
</div>
<span><h2>".$row["name"]."</h2></span>
<span><h3>".$row["points"]."</h3></span></a>
</td>";
if($count%3==0)
$str=$str."</tr><tr>";
echo $str;
$str="";
}
?>
</table>
</div>
</body>
</html>