/
contactFormulaire.php
172 lines (172 loc) · 5.35 KB
/
contactFormulaire.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
<?php
include "include/connect.inc.php";
include "include/config.inc.php";
include "include/misc.inc.php";
include "include/functions.inc.php";
include "include/$dbsys.inc.php";
include "include/mincals.inc.php";
include "include/mrbs_sql.inc.php";
$grr_script_name = "contactFormulaire.php";
require_once("./include/settings.class.php");
if (!Settings::load())
die("Erreur chargement settings");
require_once("./include/session.inc.php");
include "include/language.inc.php";
?>
<?php
if ((Settings::get("authentification_obli") == 0) && (getUserName() == ''))
$type_session = "no_session";
print_header("", "", "", $type="with_session");
?>
<form class='contactreservation' id="contactreservation" name="contactreservation" action='form'>
<fieldset><legend><b>Vos coordonnées</b></legend>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div>
<input class="form-control" type="text" id="nom" size="8" name="nom" placeholder="Votre nom" />
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div>
<input class="form-control" type="text" size="8" id="prenom" name="prenom" placeholder="Votre prénom" />
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-envelope"></span></div>
<input class="form-control" type="text" id="email" size="8" name="email" placeholder="Votre adresse de courriel" />
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-earphone"></span></div>
<input class="form-control" type="text" size="8" maxlength="14" id="telephone" name="telephone" placeholder="Votre numéro de téléphone" />
</div>
</div>
</fieldset>
<fieldset>
<legend><b>Réservation</b></legend>
<label for="subject">Sujet :</label>
<textarea class="form-control" id="subject" name="sujet" cols="30" rows="4"></textarea><br/>
<label>Domaines : </label>
<select id="area" name="area" class="form-control">
<?php
$sql_areaName = "SELECT id, area_name FROM ".TABLE_PREFIX."_area ORDER BY area_name";
$res_areaName = grr_sql_query($sql_areaName);
for ($i = 0; ($row_areaName = grr_sql_row($res_areaName, $i)); $i++)
{
if (authUserAccesArea(getUserName(),$row_areaName[0]) == 1)
{
$id = $row_areaName[0];
$area_name = $row_areaName[1];
echo '<option onclick="" value="'.$id.'"> '.$area_name.'</option>'.PHP_EOL;
}
}
?>
</select>
<script>
$(document).ready(function()
{
var $domaine = $('#area');
var $salle = $('#room');
$domaine.on('change', function()
{
var id = $(this).attr("value");
if (id != '')
{
$salle.empty();
jQuery.ajax({
type: 'GET',
url: 'frmcontactlist.php',
data: {
id: id
},
success: function(returnData)
{
$("#room").html(returnData);
},
error: function(returnData)
{
alert('Erreur lors de l execution de la commande AJAX ');
}
});
}
});
});
</script>
<label>Ressources : </label>
<select id="room" name="room" class="form-control">
<optgroup label="Salles">
<option> SELECTIONNER UN DOMAINE </option>
</select>
</fieldset>
<fieldset><legend><b> Début de la réservaton</b></legend>
<?php
jQuery_DatePicker('start');
echo " <select name=\"heure\"> ";
for ($h = 1 ; $h < 24 ; $h++)
{
echo "<option value =\"$h\"> ".sprintf("%02d",$h)."h </option>".PHP_EOL;
}
echo "</select>";
echo " <select name=\"minutes\"> ";
for ($m = 00 ; $m < 60 ; $m = $m + 30)
{
echo "<option value =\"$m\"> ".sprintf("%02d",$m)."min </option>".PHP_EOL;
}
echo "</select>".PHP_EOL;
echo "<br><br>".PHP_EOL;
echo " <label for=\"duree\">Durée : </label><br /><div class=\"col-xs-2\"><input class=\"form-control\" type=\"text\" id=\"duree\" name=\"duree\" size=\"2\" maxlength=\"2\" tabindex=\"5\" /></div>".PHP_EOL;
echo " <div class=\"col-xs-1\">".PHP_EOL;
echo '<select name="typeDuree" class="form-control">'.PHP_EOL;
$units = array("heures");
for ($s = 0; $s < sizeof($units); $s++)
{
echo "<option value=\"$units[$s]\">$units[$s] </option>".PHP_EOL;
}
?>
</select>
</div>
</fieldset>
<br/>
<div id="planning" style="margin-left:0px;">
<div id="buttonsReservation" style="margin-left:0px;">
<input class="btn btn-primary" type="submit" name="submit" value="Envoyer la demande de réservation">
<input class="btn btn-primary" type="reset" name="cancel" value="Annuler">
<input class="btn btn-primary" type="button" name="retouraccueil" value="Retour à l'accueil" onClick="javascript:location.href='javascript:history.go(-1)'">
</div>
</div>
</form>
<script src="jquery.validate.js"></script>
<script >
jQuery.validator.setDefaults({
debug: true,
success: "valid",
onsubmit: true
});
$(" #contactreservation").validate({
rules: {
nom: {
required: true
},
prenom: {
required: true
},
email: {
required: true,
email: true
},
telephone: {
required: true,
digits: true
},
duree: {
required: true,
digits: true
}
}
});
</script>
</body>
</html>