-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathajax.php
38 lines (24 loc) · 1.18 KB
/
ajax.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
<?php
require_once("Admin/includes/init.php");
if(isset($_POST['image_name'])){
$image = $_POST['image_name'];
$sql = mysqli_query($database->conn,"SELECT * FROM photos WHERE filename = '$image' ");
while ($row = mysqli_fetch_array($sql)) {
$id = $row['id'];
}
$_SESSION['filename_id_front'] = $id;
}
if(isset($_POST['photo_id'])){
$photo_id = $_POST['photo_id'];
$photo = Photo::find_by_id( $photo_id);
?>
<hr style="color: #f5f5f5" class="hide-on-large-only">
<p><img src="Admin/photo_uploads/<?php echo $photo->filename ?>" class="responsive-img" width="150"></p>
<p><i class="fa fa-check-square-o"></i><b> Photo Title:</b> <?php echo $photo->title ?></p>
<p><i class="fa fa-user"></i><b> Photo Arthur:</b> <?php echo $photo->author ?></p>
<p><i class="fa fa-calendar"></i><b> Date:</b> <?php echo date('d-M-y - h:i:a', strtotime($photo->date)) ?></p>
<p><i class="fa fa-book"></i><b> Description:</b> <?php echo substr($photo->description, 0,100) ?></p>
<p class="right"><a href="single.php?single_post=<?php echo $photo->id ?>" class="r btn green accent-4 btn-md">Read more</a></p>
<?php
}
?>