-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_art.php
98 lines (94 loc) · 2.68 KB
/
view_art.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
<!-- this one complet we can live -->
<?php include 'admin/db_connect.php' ?>
<?php
if(isset($_GET['id'])){
$qry = $conn->query("SELECT a.*,u.name as aname FROM arts a inner join users u on u.id = a.artist_id where a.id= ".$_GET['id']);
foreach($qry->fetch_array() as $k => $val){
$$k=$val;
}
$fs = $conn->query("SELECT * FROM arts_fs where art_id = $id ");
if($fs->num_rows > 0):
$fs_aid = $fs->fetch_array();
endif;
}
?>
<style type="text/css">
.imgs{
margin: .5em;
max-width: calc(100%);
max-height: calc(100%);
}
.imgs img{
max-width: calc(100%);
max-height: calc(100%);
cursor: pointer;
}
#content{
border-left:1px solid gray;
}
header.masthead {
min-height: 20vh !important;
height: 20vh !important
}
</style>
<header class="masthead">
</header>
<section>
<div class="container-field">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="row">
<?php
$images = array();
if(isset($id)){
$fpath = 'admin/assets/uploads/artist_'.$id;
$images= scandir($fpath);
}
foreach($images as $k => $v):
if(!in_array($v,array('.','..'))):
?>
<div class="imgs">
<img src="<?php echo $fpath.'/'.$v ?>" alt="">
</div>
<?php
else:
unset($imaaaaaaaages[$v]);
endif;
endforeach;
?>
</div>
</div>
<!-- here u need to check how and what actully this whould work -->
<div class="col-md-8" id="content">
<h4 class="text-center"><b><?php echo ucwords($art_title) ?></b></h4>
<hr class="divider">
<center><small><?php echo ucwords($aname) ?></small></center>
<center>
<?php if(isset($fs_aid)): ?>
<div>
<span class="badge badge-success">For Sale</span>
<span class="badge badge-secondary"><i class="fa fa-tag"></i> <?php echo number_format($fs_aid['price'],2) ?></span>
<span class="badge badge-primary"><a href="javascript:void(0)" class="order_this text-white" data-id="<?php echo $fs_aid['id'] ?>">Buy</a></span>
</div>
<?php endif; ?>
</center>
<br>
<?php echo html_entity_decode($art_description); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<script>
$('.imgs img').click(function(){
viewer_modal($(this).attr('src'))
})
$('.order_this').click(function(){
uni_modal("Request Order","manage_order.php?fs_id="+$(this).attr('data-id'))
})
</script>