forked from MumbaiHackathon/tech-next-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
view.php
147 lines (130 loc) · 4.6 KB
/
view.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
<?php
session_start(0);
mysql_connect("localhost","root","devansh");
$d=mysql_select_db("digi");
if(!$d)
echo("Couldn't Connect to database");
if (isset($_SESSION['name']))//already loggedin
{
$name = $_SESSION['name'];
$sql="SELECT * FROM files WHERE name='$name'";
$q=mysql_query($sql);
$count=mysql_num_rows($q);
while($row=mysql_fetch_assoc($q))
{
$fname=$row['file'];
?>
<div class="card">
<div class="item">
<center>
<h4><?php echo '<a target="_blank" href="uploads/'.$fname.'">
<img src="uploads/'.$fname.'" alt="Image">
</a>'?></h4>
<!-- <h3><?php echo "User:".$row['name'] ?></h3> -->
<h4><?php echo "File:".$row['file'] ?></h4>
<h4><?php echo "Type:".$row['type'] ?></h4>
<h4><?php echo "Size:".$row['size']." KB " ?></h4>
<h5><?php echo "Upload time:".$row['uploadtime'] ?></h5>
</div>
</div>
<?php
}
}
else//not loggedin
header('Location:login.html');
?>
<!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">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="images/tn.jpeg">
<title>View Files</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="navbar-fixed-top.css" rel="stylesheet">
<link href="signin.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<style>
img{width: 150px;
height: 150px;
}
.img {
border: 1px solid #ddd; /* Gray border */
border-radius: 4px; /* Rounded border */
padding: 5px; /* Some padding */
width: 150px;/* Set a small width */
}
/* Add a hover effect (blue shadow) */
img:hover {
box-shadow: 0 0 2px 1px rgba(0, 140, 186, 0.5);
}
#footer{
background: linear-gradient(to right,#e6f3ff,#80c1ff);
/* background: linear-gradient(to right,#ffffff,#737373); */
width:100% ;
padding: 10px;
box-shadow: 2px 2px 4px black;
}
.card {
display: inline-block;
background: linear-gradient(to right,#e6f3ff,#80c1ff);
/* Add shadows to create the "card" effect */
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.4);
transition: 0.3s;
width: 300px;
margin: 50px 25px 50px;
}
.navbar{
background: linear-gradient(to left,#e6f3ff,#80c1ff);
box-shadow: 2px 2px 4px black;
}
/* On mouse-over, add a deeper shadow */
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,1.2);
}
/* Add some padding inside the card container */
.item {
padding: 2px 16px;
}
</style>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="home.php">TechNext.</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li ><a href="user.php">User</a></li>
<li ><a href="upload.php">Upload</a></li>
<li class="active"><a href="view.php">View</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div id="body">
<center>
</div>
</center>
</div>
<div id="footer"><center>
<h3 id="ftext">
By <a href="about.php">DjDecoders</a></h3>
<h4 id="ftext"><b>All Rights reserved © 2017 </b></h4></center>
</div>
</body>
</html>