/
home.php
231 lines (190 loc) · 8.38 KB
/
home.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?php
include_once 'autoload.inc.php';
include_once 'init.inc.php';
$p = new webpage("Iut Stage");
$p->appendToHead(<<<head
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
head
);
$p->appendCssUrl("style/bootstrap-3.3.5-dist/css/bootstrap.min.css");
$p->appendCssUrl("style/searchEngine.css");
$p->appendCssUrl("style/style.css");
$p->appendJsUrl("js/request.js");
//inclusion de la barre de navigation
include_once "navbar.inc.php";
$p->appendContent(<<<HTML
<div class="container">
<!-- Main component for a primary marketing message or call to action -->
<div class="jumbotron">
<h1>Recherche de stage</h1>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#stages">Stages</a></li>
<li><a data-toggle="tab" href="#recruteur">Espace Recruteur</a></li>
</ul>
<div class="tab-content" style="margin-top:15px;">
<div id="stages" class="tab-pane fade in active">
<div role="tabpanel" class="tab-pane active" id="stage">
<form name="searchEngine" class="form-inline searchEngine" onSubmit="return false;">
<div class="form-group">
<input name ="poste" type="text" class="form-control" placeholder="Quel poste ?">
</div>
<div class="form-group">
<input name="ville" type="text" class="form-control" placeholder="Ville, Pays ...">
</div>
<button name="submit" type="submit" class="btn btn-default">Rechercher</button>
<!--Recherche Avancée -->
<a href="#" data-toggle="collapse" data-target="#demo" style="text-decoration:none;">Recherche avancée >></a>
<div id="demo" class="collapse">
<p class="bg-primary" style="margin-top:8px;"><strong><em>Formations: </em></strong></p>
<div class="row"> <!-- ROW 1 -->
<div class="col-md-4">
<div class="checkbox">
<label>
<input name="liste_select" type="checkbox" value="développement logiciel"> Développement logiciel
</label>
</div>
<div class="checkbox">
<label>
<input name="liste_select" type="checkbox" value="développement web"> Développement web
</label>
</div>
<div class="checkbox ">
<label>
<input name="liste_select" type="checkbox" value="Commerce" > Commerce, vente, distribution
</label>
</div>
</div><!--end Colone -->
<div class="col-md-4">
<div class="checkbox">
<label>
<input name="liste_select" type="checkbox" value="marketing"> Communication, Marketing, Media
</div>
<div class="checkbox">
<label>
<input name="liste_select" type="checkbox" value="informatique industrielle"> Informatique industrielle
</label>
</div>
<div class="checkbox ">
<label>
<input name="liste_select" type="checkbox" value="réseau"> Réseau/Télécommunication
</label>
</div>
</div><!--end Colone -->
<div class="col-md-4">
<div class="checkbox">
<label>
<input name="liste_select" type="checkbox" value="Sciences"> Sciences, technologies
</label>
</div>
<div class="checkbox ">
<label>
<input name="liste_select" type="checkbox" value="Gestion"> Gestion, management
</label>
</div>
<div class="checkbox ">
<label>
<input name="liste_select" type="checkbox" value="Ressource humaine"> Ressource humaine
</label>
</div>
</div><!--end Colone -->
</div> <!--end row 1-->
</div>
</form>
</div>
</div>
<div id="recruteur" class="tab-pane fade">
<p>TO DO :</br>
- Select (entreprise) si l'user en a.<br/>
- formulaire pour crée un stage
</p>
</div>
</div>
</div>
HTML
);
$p->appendContent(<<<HTML
<table class="table table-striped">
<thead>
<tr> <th>Date</th> <th>Entreprise</th> <th>Intitulé du poste</th> <th>Lieu</th> </tr>
</thead>
<tbody id="liste_ajax">
</tbody>
</table>
<nav style="text-align:center;">
<ul class="pagination">
<li class="disabled">
<a href="#" aria-label="Previous"><span aria-hidden="true">«</span></a>
</li>
<li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
<li>
<a href="#" aria-label="Next"><span aria-hidden="true">»</span></a>
</li>
</ul>
</nav>
</div> <!-- /container -->
HTML
);
$p->appendToFooter(<<<Footer
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="style/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
Footer
);
$p->appendToFooter(<<<JS
<script>
// Fonction appelée au chargement complet de la page
window.onload = function () {
var valeurs = [];
new Request(
{
url : "searchEngine.php",
method : 'get',
handleAs : 'text',
parameters : { poste: '%' , ville: '%', domaines: valeurs},
onSuccess : function(res) {
document.getElementById("liste_ajax").innerHTML = res ;
},
onError : function(status, message) {
window.alert('Error ' + status + ': ' + message) ;
}
}) ;
document.forms['searchEngine'].onsubmit = function () {return false ; }
document.forms['searchEngine'].elements['submit'].onclick = function(){
var form = document.forms['searchEngine'];
var varPoste = form.elements['poste'].value;
var varVille = form.elements['ville'].value;
var valeurs = [];
$('input:checked[name=liste_select]').each(function() {
valeurs.push($(this).val());
});
console.log(valeurs);
new Request(
{
url : "searchEngine.php",
method : 'get',
handleAs : 'text',
parameters : { poste: varPoste , ville: varVille, domaines: valeurs},
onSuccess : function(res) {
document.getElementById("liste_ajax").innerHTML = res ;
},
onError : function(status, message) {
window.alert('Error ' + status + ': ' + message) ;
}
}) ;
}
}
</script>
JS
);
echo $p->toHTML();