-
Notifications
You must be signed in to change notification settings - Fork 0
/
survey_report_user.php
255 lines (90 loc) · 3.33 KB
/
survey_report_user.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
<?php include 'db_connect.php' ?>
<?php
$answers = $conn->query("SELECT distinct(survey_id) from answers where user_id ={$_SESSION['login_id']}");
?>
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div>
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div>
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div>
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div>
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div>
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div>
<div class="col-lg-12">
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div>
</div>
<div class="row">
<?php
$mail = $_SESSION['login_email'];
$survey = $conn->query("SELECT s.id, s.title, s.description, s.start_date, s.end_date FROM survey_set AS s, users as u WHERE FIND_IN_SET(s.title,u.serv) and u.email = '".$mail."' ");
while($row=$survey->fetch_assoc()):
?>
<div class="col-md-3 py-1 px-1 survey-item">
<div class="card card-outline card-primary">
<div class="card-header">
<h3 class="card-title" style="text-align:center;"><?php echo ucwords($row['title']) ?></h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse">
</button>
</div>
</div>
<div class="card-body" style="display: block;">
<div class="row">
<hr class="border-primary">
<div class="d-flex justify-content-center w-100 text-center">
<a href="index.php?page=view_survey_report_user&id=<?php
$usid = $_SESSION['login_id'];
echo $row['id'] ?>&usid=<?php echo $usid ?>" class="btn btn-outline-primary"><i class="fa fa-poll"></i> Visualiser</a>
</div>
<br>
<br/>
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div>
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div><div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div>
<div class="d-flex w-100 justify-content-center align-items-center mb-2">
</div>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
<script>
function find_survey(){
start_load()
var filter = $('#filter').val()
filter = filter.toLowerCase()
console.log(filter)
$('.survey-item').each(function(){
var txt = $(this).text()
if((txt.toLowerCase()).includes(filter) == true){
$(this).toggle(true)
}else{
$(this).toggle(false)
}
if($('.survey-item:visible').length <= 0){
$('#ns').show()
}else{
$('#ns').hide()
}
})
end_load()
}
$('#search').click(function(){
find_survey()
})
$('#filter').keypress(function(e){
if(e.which == 13){
find_survey()
return false;
}
})
</script>