-
Notifications
You must be signed in to change notification settings - Fork 1
/
map_filter_side.php
94 lines (71 loc) · 3.49 KB
/
map_filter_side.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
<?php
$tags_main = array("basic food items availability","basic food items cost","discrimination","disturbance","restriction of movement","suspected covid-19 case","water availability","water cost", "social distancing", "no health care workers", "social distancing", "shortage of masks", "observance of measures to curb Covid-19 virus");
//$sq_qry = "SELECT `tag_name`, COUNT(`tag_item_id`) as `tag_items` FROM `ort_posts_tags` GROUP BY `tag_name` order by `tag_name` ";
$sq_qry = "SELECT `ort_posts_tags`.`tag_name` , COUNT(`ort_posts_tags`.`tag_record_id`) AS `tag_items` FROM `ort_posts_tags` INNER JOIN `ort_posts` ON (`ort_posts_tags`.`tag_item_id` = `ort_posts`.`post_entry_id`) WHERE (`ort_posts`.`published` ='1') and (`ort_posts_tags`.`tag_published` ='1') and (`ort_posts`.`post_country` LIKE '%') GROUP BY `ort_posts_tags`.`tag_name` ORDER BY `ort_posts_tags`.`tag_name` ASC; ";
// echobr($sq_qry);
$rs_qry = $cndb->dbQuery($sq_qry);
$k = null;
$filta_tots = array();
$filta_form = array();
$filta_cols = array();
$filta_cols_dat = array();
if($cndb->recordCount($rs_qry) > 0) {
$i = 0;
while($cn_qry_a = $cndb->fetchRow($rs_qry)){
$cn_qry = array_map("clean_output", $cn_qry_a);
$tag_name = $cn_qry['tag_name'];
$tag_items = $cn_qry['tag_items'];
/*$tag_rec = '<li class="linegraydotx padd5x"><span class="nom"> '.clean_title($tag_name, 1).' </span> <span class="num_box label label-info">'.$tag_items.'</span></li>';*/
/*<input type="checkbox" class="nom_chk" id="chk_'.$i.'" >*/
$tag_rec = '<label class="lebo_filta"> <span class="nom"> '.clean_title($tag_name, 1).' </span> <span class="num_box labelX label-infoX">'.$tag_items.'</span></label>';
if(in_array($tag_name, $tags_main)){
$filta_form['main'][] = $tag_rec;
} else {
$filta_form['others'][] = $tag_rec;
}
/*$filta_form[] = '<div class="row"><span class="bold"> '.$tag_name.' </span> <span class="num_box">'.$tag_items.'</span></div>';*/
$i++;
}
}
?>
<form id="frm_search" name="frm_search">
<input type="hidden" class="gg_checks" name="data_form" value="indoor" />
<div class="col-md-12" id="filtaz" style="position:relative">
<div class="accordion-wrap">
<div class="accordion-box" id="acc_6">
<div class="panel panel-default">
<div class="panel-heading"><a href="#faq-one" data-toggle="collapse" class="panel-title accord-title"><h4><i class="fas fa-tagx fa-plus"></i> Main Tags <span class="filterhint">Click for more</span></h4> </a></div>
<div class="panel-collapse collapse in" id="faq-one">
<div class="nano" style="height:250px">
<div class="nano-content">
<?php
if(!empty($filta_form['main'])){
echo implode(' ', $filta_form['main']);
}else{
echo "No post tags from this country";
}
?>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><a href="#faq-two" data-toggle="collapse" class="panel-title accord-title"><h4> <i class="fas fa-tagsx fa-plus"></i> Other Tags <span class="filterhint">Click for more</span></h4> </a></div>
<div class="panel-collapse collapse in" id="faq-two">
<div class="nano" style="height:250px">
<div class="nano-content">
<?php
if(!empty($filta_form['others'])){
echo implode(' ', $filta_form['others']);
}else{
echo "No post tags from this country";
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>