forked from bindumareedu/PhotoFlock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphotos.php
208 lines (195 loc) · 10.5 KB
/
photos.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<!-- Favicon icon -->
<link rel="icon" type="image/png" sizes="16x16" href="../assets/images/favicon.png">
<title>Dashboard</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/dashboard-style.css" rel="stylesheet">
<!-- You can change the theme colors from here -->
<link href="css/default-dark.css" id="theme" rel="stylesheet">
<link href="css/sidebar.scss" rel="stylesheet">
<!-- Favicon -->
<link rel="icon" href="img/core-img/favicon.ico">
<!-- Core Style CSS -->
<link rel="stylesheet" href="css/core-style.css">
<link rel="stylesheet" href="style.css">
<!-- Responsive CSS -->
<link href="css/responsive.css" rel="stylesheet">
<!-- <link href="netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> -->
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="fix-header card-no-border fix-sidebar">
<style>
.w3-row-padding img {
width: 500px;
margin-right: 3%;
margin-bottom: 3%;
}
</style>
<?php
session_start();
if (isset($_SESSION['username'])){
$username = $_SESSION['username'];
}
?>
<!-- Gradient Background Overlay -->
<div class="gradient-background-overlay"></div>
<!-- Header Area Start -->
<header class="header-area">
<div class="container-fluid h-100">
<div class="row h-100 align-items-center">
<div class="col-12 h-100">
<div class="main-menu h-100">
<nav class="navbar h-100 navbar-expand-lg">
<!-- Logo Area -->
<a class="navbar-brand" href="#"><img src="img/core-img/logo.png" width="240px" height="100px" alt="Logo" style="margin-left: -25%;"></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#studioMenu" aria-controls="studioMenu" aria-expanded="false" aria-label="Toggle navigation"><i class="fa fa-bars"></i> Menu</button>
<div class="collapse navbar-collapse" id="studioMenu">
<!-- Menu Area Start -->
<ul class="navbar-nav ml-auto">
</li>
<li class="nav-item">
<a class="nav-link" href="backend/logout.php"><i class="mdi mdi-logout"></i><span class="hide-menu">Logout</span></a>
</li>
</ul>
</div>
</nav>
</div>
</div>
</div>
</div>
</header>
<!-- Header Area End -->
<!-- ============================================================== -->
<!-- Left Sidebar - style you can find in sidebar.scss -->
<!-- ============================================================== -->
<aside class="left-sidebar">
<!-- Sidebar scroll-->
<div class="scroll-sidebar" style="padding-top:5%;">
<!-- Sidebar navigation-->
<nav class="sidebar-nav">
<ul id="sidebarnav">
<li> <a class="waves-effect waves-dark" href="pages-profile.php" aria-expanded="false"><i class="mdi mdi-account-check"></i><span class="hide-menu">Profile</span></a></li>
<li> <a class="waves-effect waves-dark" href="dashboard.php" aria-expanded="false"><i class="mdi mdi-gauge"></i><span class="hide-menu">Dashboard</span></a></li>
<li> <a class="waves-effect waves-dark" href="photos.php" aria-expanded="false"><i class="mdi mdi-image"></i><span class="hide-menu">Photos</span></a></li>
<li> <a class="waves-effect waves-dark" href="profile-photo.php" aria-expanded="false"><i class="mdi mdi-face"></i><span class="hide-menu">Profile Photo</span></a></li>
</ul>
</nav>
<!-- End Sidebar navigation -->
</div>
<!-- End Sidebar scroll-->
</aside>
<!-- ============================================================== -->
<!-- End Left Sidebar - style you can find in sidebar.scss -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Page wrapper -->
<!-- ============================================================== -->
<div class="page-wrapper">
<!-- ============================================================== -->
<!-- Container fluid -->
<!-- ============================================================== -->
<div class="container-fluid">
<!-- ============================================================== -->
<!-- Bread crumb and right sidebar toggle -->
<!-- ============================================================== -->
<div class="row page-titles">
<div class="col-md-6 align-self-center">
<h3 class="text-themecolor">Photos</h3>
<!-- <button class="btn btn-success">Upload Photos</button> -->
</div>
<!-- <div class="col-md-6">
<form method="post" action="save_path.php" enctype='multipart/form-data'>
<input type='file' name='file' />
<button class="btn btn-success" type='submit'>Upload Photos</button>
</form>
</div> -->
</div>
<form class="form-inline" method="post" action="save_path.php" enctype='multipart/form-data' style="margin-bottom:3%;">
<input type="hidden" name="username" value="<?php echo htmlspecialchars($username);?>">
<input type='file' name='file' />
<select class="form-control" name="category" style="margin-right:0.5%">
<option value="" selected disabled>Category</option>
<option>Portraits</option>
<option>Weddings</option>
<option>Studio</option>
<option>Fashion</option>
<option>Lifestyle</option>
<option>Nature</option>
<option>Other</option>
</select>
<input type="text" placeholder="tags" class="form-control form-control-line" name="tags" style="margin-right:0.5%">
<input class="btn btn-success" type='submit' value='Upload Photos' name='but_upload'>
<!-- <button class="btn btn-success" type='submit'name='but_upload'>Upload Photos</button> -->
</form>
<div class="w3-row-padding">
<div class="w3-half ">
<?php
session_start();
if(isset($_SESSION['username'])){
$username = $_SESSION['username'];
require('backend/connect.php');
$query="SELECT name FROM public.imagestore WHERE photographer_id='$username'";
$result = pg_query($connection, $query) or die('Query failed: ' . pg_last_error());
if(pg_num_rows($result) > 0){
$i=0;
$arr=pg_fetch_all($result);
while($i < pg_num_rows($result))
{
$img_file="upload/".$arr[$i]['name'];
echo '<img src="'.$img_file.'">';
$i=$i+1;
}
}
else {
echo '<script language="javascript">';
echo "alert('No images!')";
echo '</script>';
}
}
pg_close($connection);
?>
</div>
</div>
<!-- ============================================================== -->
<!-- End Bread crumb and right sidebar toggle -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Start Page Content -->
<!-- ============================================================== -->
</div>
</div>
</div>
<!-- ============================================================== -->
<!-- All Jquery -->
<!-- ============================================================== -->
<script src="js/jquery/jquery-2.2.4.min.js"></script>
<!-- Bootstrap tether Core JavaScript -->
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- slimscrollbar scrollbar JavaScript -->
<script src="js/perfect-scrollbar.jquery.min.js"></script>
<!--Wave Effects -->
<script src="js/waves.js"></script>
<!--Menu sidebar -->
<script src="js/sidebarmenu.js"></script>
<!--Custom JavaScript -->
<script src="js/custom.min.js"></script>
<script>
</script>
</body>
</html>