This repository has been archived by the owner on Jul 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
178 lines (153 loc) · 4.5 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Bienvenue</title>
<style>
@font-face {
font-family: 'cairo';
src: url('fonts/Cairo-SemiBold.ttf')
}
* {
font-family: cairo;
}
body {
margin: 0;
background: url('img/bg.svg');
background-size: cover;
padding: 0;
font-family: sans-serif;
background-attachment: fixed;
}
body>div:first-child {
float: left;
width: 100%;
min-height: 320px;
}
body>div:first-child>div {
float: left;
}
body>div:first-child>div:first-child>h3 {
padding: 60px 50px;
font-size: 28px;
color: #383838;
width: 60vw;
box-sizing: border-box;
}
body>div:first-child>div:not(:first-child) {
width: 400px;
}
.theme-container {
padding: 460px 12vw;
}
.theme-container>div {
background-color: #e5e2eb;
border: #696969 solid 1px;
border-radius: 3px;
}
.theme {
color: #242323;
font-size: 18px;
padding: 20px;
height: 40px;
}
.theme:not(:last-child) {
border-bottom: #696969 solid 1px;
}
.theme>* {
float: left;
}
.theme>button {
float: right;
}
.theme-name {
padding-right: 50px;
}
.signup-login {
padding: 20px;
margin-left: 50px;
}
.signup-login>a, button {
padding: 6px 20px;
text-decoration: none;
color: #262626;
border-radius: 6px;
border: 1px solid #0006;
background-color: #3aff00c7;
margin-left: 50px;
}
.signup-login>a:hover, button:hover {
background-color: #34d123;
}
</style>
</head>
<body>
<div style="min-height: 450px">
<div>
<h3>Bienvenue Sur Le Site Web d'Enregistrement de Doctorat.</h3>
<div class="signup-login">
<a class="signup-login" href="inscription-etudiant.php">Sign up</a>
<a class="signup-login" href="login.html">Log in</a>
</div>
</div>
<div>
<img src="/img/front.png">
</div>
</div>
<div style="position: absolute; background-color: greenyellow; width: 100%; height: 350px; z-index: -1"></div>
<div style="top: 350px; position: absolute; background-image: linear-gradient(to bottom, greenyellow, rgba(0, 0, 0, 0)); width: 100%; height: 120px; z-index: -1"></div>
<div class="theme-container">
<div>
<?php
require_once "root.php";
/** @var $connection mysqli*/
$result = $connection->query("SELECT conc_id, theme, d_insc_debut, d_insc_fin FROM concours");
if ($result) {
for ($i = 0; $i < $result->num_rows; ++$i) {
$row = $result->fetch_array(MYSQLI_ASSOC);
$conc_id = $row['conc_id'];
$theme = $row['theme'];
$d_insc_debut = date('d/m/Y', strtotime($row['d_insc_debut']));
$d_insc_fin = date('d/m/Y', strtotime($row['d_insc_fin']));
echo <<<THEME
<div class="theme">
<div style="display: none">$conc_id</div>
<div class="theme-name">$theme</div>
<img src="img/calendar.png" alt="d'après">
<div>$d_insc_debut à $d_insc_fin</div>
<button onclick="goToInscription(this.parentNode.children.item(0).innerHTML);">Choisissez ce thème</button>
</div>
THEME;
}
} else {
die(<<<NO_THEMES
<div class="theme">
<div style="background-color: orangered" class="theme-name">Pas encore de thèmes, retournez à nouveau à un autre moment.</div>
</div>
NO_THEMES
);
}
?>
<div id="form-container">
</div>
<script>
let form = document.createElement('form');
form.style.display = 'none';
document.getElementById('form-container').append(form);
form.setAttribute("method", "get");
form.setAttribute("action", `inscription-etudiant.php`);
let hiddenInput = document.createElement('input');
hiddenInput.type = 'hidden';
hiddenInput.name = 'conc_id';
form.append(hiddenInput);
function goToInscription(conc_id) {
hiddenInput.value = conc_id;
form.submit();
}
</script>
</div>
</div>
</body>
</html>