-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatadev.txt
157 lines (123 loc) · 5.57 KB
/
datadev.txt
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
<div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Joueur</span>
</div>
<input id="name" type="text" class="form-control" placeholder="Username" required>
<input id="year" type="number" class="form-control" placeholder="Age" required>
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Link Profil</span>
</div>
<input id="link" type="url" class="form-control" placeholder="Link" required>
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Alliance</span>
</div>
<select id="alliance" class="form-control" id="listAlliance"></select>
<select id="role" class="form-control" id="listRole"></select>
</div>
<div id="dquestion" class="input-group-inline mb-3">
<input id="absence" type="text" class="form-control" placeholder="Absence(s) programmés ?" required>
<br>
<textarea id="motivation" rows="10" class="form-control" placeholder="Motivation ?" required></textarea>
<br>
<input id="tuvous" type="text" class="form-control" placeholder="Tu / vous ?" required>
<br>
<input id="trouve" type="text" class="form-control" placeholder="comment nous a tu trouvé ?" required>
<br>
<select id="gender" class="form-control" id="Gender" required>
<option value="Homme">Homme</option>
<option value="Femme">Femme</option>
</select>
<br>
<input id="interconnect" type="text" class="form-control" placeholder="Intervalle de connections ?" required>
<br>
<textarea id="other" rows="10" class="form-control" placeholder="ok as tu des choses a rajouté qui te semble pertinent ?" required></textarea>
<br>
</div>
<button id="btnSubmit" class="btn btn-dark btn-block">Enregistrer</button>
</div>
<script>
$('#btnSubmit').click(() => {
var name = $('#name').val();
var year = $('#year').val();
var link = $('#link').val();
var alliance = $('#alliance').val();
var role = $('#role').val();
var absence = $('#absence').val();
var motivation = $('#motivation').val();
var tuvous = $('#tuvous').val();
var trouve = $('#trouve').val();
var gender = $('#gender').val();
var interconnect = $('#interconnect').val();
var other = $('#other').val();
console.log(name, year, link, alliance, role, absence, motivation, tuvous, trouve, gender, interconnect, other);
});
</script>
<form action="./home.php" method="GET">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Joueur</span>
</div>
<input name="name" type="text" class="form-control" placeholder="Username" required>
<input name="year" type="number" class="form-control" placeholder="Age">
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Link Profil</span>
</div>
<input name="link" type="url" class="form-control" placeholder="Link" required>
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Alliance</span>
</div>
<select name="alliance" class="form-control" id="listAlliance"></select>
<select name="role" class="form-control" id="listRole"></select>
</div>
<div id="dquestion" class="input-group-inline mb-3">
<textarea name="candidature" rows="10" class="form-control" placeholder="Candidature"></textarea>
<br>
<textarea name="entretien" rows="10" class="form-control" placeholder="entretien"></textarea>
<br>
</div>
<button type="submit" class="btn btn-dark btn-block" value="submit">Enregistrer</button>
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$username = 'Program';
$servername = "localhost";
$password = "HelloWords42";
$port = 27017;
$conn = new mysqli($servername, $username, $password, '', $port);
$db = mysqli_select_db($conn, "rh");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
};
if (!$conn->set_charset('utf8')) {
printf("Erreur lors du chargement du jeu de caractères utf8 : %s\n", $mysqli->error);
};
$name = mysqli_escape_string($conn, $_GET['name']);
$link = mysqli_escape_string($conn, $_GET['link']);
$candidature = mysqli_escape_string($conn, $_GET['candidature']);
$entretien = mysqli_escape_string($conn, $_GET['entretien']);
$sql = "INSERT INTO rh.player (nameplayer, linkplayer, entretienplayer, candidatureplayer, allianceplayer, roleplayer)
VALUES ('" . $name ."', '" . $link . "', '" . $entretien ."', '" . $candidature . "')";
if ($conn->query($sql) != TRUE) {
echo "Error: " . $sql . "<br>" . $conn->error;
} else { echo 'Success'; };
};
$conn->close();
?>
######## Style.css ########
.option {
position: absolute;
height: 100%;
left: 0;
top: 10%;
right: 0;
width: 100%;
}