-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcandidates.php
173 lines (141 loc) · 4.63 KB
/
candidates.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
162
163
164
165
166
167
168
169
170
171
172
173
<?php /*
Copyright 2015 Cédric Levieux, Parti Pirate
This file is part of Recrutement.
Recrutement is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Recrutement is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Recrutement. If not, see <http://www.gnu.org/licenses/>.
*/
include_once("header.php");
require_once("engine/bo/CandidateBo.php");
require_once("engine/bo/CandidateQuestionBo.php");
$candidateBo = CandidateBo::newInstance($connection, $config);
$candidateQuestionBo = CandidateQuestionBo::newInstance($connection, $config);
$candidates = array();
if ($isConnected) {
$candidates = $candidateBo->getByFilters(array());
}
?>
<div class="container theme-showcase" role="main">
<ol class="breadcrumb">
<li><a href="backoffice.php"><?php echo lang("breadcrumb_backoffice"); ?></a></li>
<li class="active"><?php echo lang("breadcrumb_candidates"); ?></li>
</ol>
<?php
if (count($candidates)) {
?>
<div class="text-center">
<div id="positions" class="btn-group" role="group" aria-label="...">
<button value="candidate" type="button" class="btn btn-default active">Candidat-e</button>
<button value="substitute" type="button" class="btn btn-default active">Suppléant-e</button>
<button value="representative" type="button" class="btn btn-default active">Mandataire</button>
</div>
<div id="sexes" class="btn-group" role="group" aria-label="...">
<button value="male" type="button" class="btn btn-default active"><i class="fa fa-mars"></i></button>
<button value="female" type="button" class="btn btn-default active"><i class="fa fa-venus"></i></button>
</div>
<div id="contacted" class="btn-group" role="group" aria-label="...">
<button value="none-answered" type="button" class="btn btn-default active">À contacter</button>
<button value="some-answered" type="button" class="btn btn-default active">Doit être complété</button>
<button value="all-answered" type="button" class="btn btn-default active">A répondu à tout</button>
</div>
Nombre de personnes : <span class="found_persons"><?php echo count($candidates); ?></span>
</div>
<br>
<div class="row header">
<div class="col-md-3">
Identité (et genre civil)
</div>
<div class="col-md-2">
Téléphone
</div>
<div class="col-md-3">
Mail
</div>
<div class="col-md-2">
Positions
</div>
<div class="col-md-2">
Circonscriptions
</div>
</div>
<?php
}
?>
<div class="row-striped row-hover">
<?php
foreach($candidates as $candidate) {
$candidateQuestions = $candidateQuestionBo->getByFilters(array("cas_candidature_id" => $candidate["can_id"]));
$answered = 0;
foreach($candidateQuestions as $question) {
if ($question["cas_answer"]) {
$answered++;
}
}
if ($answered == 0) {
$answerClass = "none-answered";
}
else if ($answered == count($candidateQuestions)) {
$answerClass = "all-answered";
}
else {
$answerClass = "some-answered";
}
?>
<div class="row data <?php echo $answerClass; ?> <?php echo str_replace(",", " ", $candidate["can_positions"]); ?> <?php echo $candidate["can_sex"]; ?>">
<div class="col-md-3">
<a href="candidate.php?id=<?php echo $candidate["can_id"]?>"><?php echo $candidate["can_firstname"]; ?> <?php echo $candidate["can_lastname"]; ?></a>
<?php
if ($candidate["can_sex"]) {?>
<i class="fa fa-<?php
if ($candidate["can_sex"] == "male") {
echo "mars";
}
else if ($candidate["can_sex"] == "female") {
echo "venus";
}
?>"></i>
<?php
}
?>
</div>
<div class="col-md-2">
<?php echo $candidate["can_telephone"]; ?>
</div>
<div class="col-md-3">
<?php echo $candidate["can_mail"]; ?>
</div>
<div class="col-md-2">
<?php
$tPositions = array();
if ($candidate["can_positions"]) {
$positions = explode(",", $candidate["can_positions"]);
foreach($positions as $position) {
$tPositions[] = lang("candidate_position_$position");
}
}
echo implode(", ", $tPositions);
?>
</div>
<div class="col-md-2">
<?php
echo str_replace(",", ", ", $candidate["can_circos"]);
?>
</div>
</div>
<?php
}
?>
</div>
<?php include("connect_button.php"); ?>
</div>
<div class="lastDiv"></div>
<?php include("footer.php");?>
</body>
</html>