-
Notifications
You must be signed in to change notification settings - Fork 0
/
explore.php
161 lines (152 loc) · 7.18 KB
/
explore.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
<?php
include 'admin/db_connect.php';
?>
<style>
#portfolio .img-fluid{
width: calc(100%);
height: 30vh;
z-index: -1;
position: relative;
padding: 1em;
}
.vacancy-list{
cursor: pointer;
}
span.hightlight{
background: yellow;
}
.carousel,.carousel-inner,.carousel-item{
max-height: 30vh !important
}
header.masthead {
min-height: 20vh !important;
height: 20vh !important
}
.row-items{
position: relative;
}
.card-left{
left:0;
}
.card-right{
right:0;
}
.rtl{
direction: rtl ;
}
</style>
<header class="masthead">
</header>
<section id="list">
<div class="container-fluid mt-3 pt-2">
<h4 class="text-center">Arts In Our Gallery</h4>
<hr class="divider">
<div class="row-items">
<div class="col-lg-12">
<?php
$cp ='offset-md-2';
$rtl ='rtl';
$fs = $conn->query("SELECT * FROM arts_fs where status = 0");
while($row = $fs->fetch_assoc()):
$fs_aid[$row['art_id']] = $row;
endwhile;
$arts = $conn->query("SELECT a.*,u.name as aname FROM arts a inner join users u on u.id = a.artist_id where a.id not in (SELECT art_id FROM arts_fs where status = 1) and status = 1 order by rand()");
while($row = $arts->fetch_assoc()):
$trans = get_html_translation_table(HTML_ENTITIES,ENT_QUOTES);
unset($trans["\""], $trans["<"], $trans[">"], $trans["<h2"]);
$desc = strtr(html_entity_decode($row['art_description']),$trans);
$desc=str_replace(array("<li>","</li>"), array("",","), $desc);
if($cp == 'offset-md-2'){
$cp = '';
}else{
$cp = 'offset-md-2';
}
if($rtl == 'rtl'){
$rtl = '';
}else{
$rtl = 'rtl';
}
?>
<div class="row">
<div class="col-md-10 <?php echo $cp ?>">
<div class="card vacancy-list" data-id="<?php echo $row['id'] ?>">
<div class="card-body">
<div class="row <?php echo $rtl ?>">
<div class="col-md-4">
<div id="imagesCarousel_<?php echo $row['id'] ?>" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<?php
$images = array();
$fpath = 'admin/assets/uploads/artist_'.$row['id'];
$images= scandir($fpath);
$i = 1;
foreach($images as $k => $v):
if(!in_array($v,array('.','..'))):
$active = $i == 1 ? 'active' : '';
?>
<div class="carousel-item <?php echo $active ?>">
<img class="d-block w-100" src="<?php echo $fpath.'/'.$v ?>" alt="">
</div>
<?php
$i++;
else:
unset($images[$v]);
endif;
endforeach;
?>
<a class="carousel-control-prev" href="#imagesCarousel_<?php echo $row['id'] ?>" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#imagesCarousel_<?php echo $row['id'] ?>" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
<div class="col-md-8">
<h3><b class="filter-txt"><?php echo ucwords($row['art_title']) ?></b></h3>
<span><small>Artist: <?php echo ucwords($row['aname']) ?></small></span>
<br>
<?php if(isset($fs_aid[$row['id']])): ?>
<div <?php echo !empty($rtl) ? "style='direction:ltr'" : '' ?>>
<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[$row['id']]['price'],2) ?></span>
<span class="badge badge-primary"><a href="javascript:void(0)" class="order_this text-white" data-attr="<?php echo $fs_aid[$row['id']]['id'] ?>">Buy</a></span>
</div>
<?php endif; ?>
<hr>
<larger class="truncate filter-txt"><?php echo strip_tags($desc) ?></larger>
<br>
<hr class="divider" style="max-width: calc(80%)">
<a class="btn btn-primary <?php echo empty($rtl) ? "float-right" : '' ?> read_more" href="index.php?page=view_art&id=<?php echo $row['id'] ?>">Read More</a>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
</section>
<script>
// $('.card.vacancy-list').click(function(){
// location.href = "index.php?page=view_vacancy&id="+$(this).attr('data-id')
// })
$('#filter').keyup(function(e){
var filter = $(this).val()
$('.card.vacancy-list .filter-txt').each(function(){
var txto = $(this).html();
txt = txto
if((txt.toLowerCase()).includes((filter.toLowerCase())) == true){
$(this).closest('.card').toggle(true)
}else{
$(this).closest('.card').toggle(false)
}
})
})
</script>