parent
ef6b71e19b
commit
1cc1128b00
@ -0,0 +1,3 @@
|
||||
RewriteEngine on
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule . index.php [L]
|
@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace model;
|
||||
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
|
||||
class Student extends User
|
||||
{
|
||||
public string $nickname;
|
||||
private bool $extraTime;
|
||||
|
||||
/**
|
||||
* @param String $nickname
|
||||
* @param bool $extraTime
|
||||
*/
|
||||
#[Pure] public function __construct(string $id, string $mail, string $nom, string $prenom, string $nickname, bool $extraTime)
|
||||
{
|
||||
parent::__construct($id,$mail, $nom, $prenom);
|
||||
$this->nickname = $nickname;
|
||||
$this->extraTime = $extraTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isExtraTime(): bool
|
||||
{
|
||||
return $this->extraTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $extraTime
|
||||
*/
|
||||
public function setExtraTime(bool $extraTime): void
|
||||
{
|
||||
$this->extraTime = $extraTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String $nickname
|
||||
*/
|
||||
public function setNickname(string $nickname): void
|
||||
{
|
||||
$this->nickname = $nickname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
namespace modeles;
|
||||
class Teacher extends User
|
||||
{
|
||||
|
||||
protected function createVocabulary(){
|
||||
|
||||
}
|
||||
|
||||
protected function modifyVocabulary(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>My account</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="author" content="" />
|
||||
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
|
||||
<!-- Font Awesome icons (free version)-->
|
||||
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
|
||||
<!-- Google fonts-->
|
||||
<link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet" />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
|
||||
rel="stylesheet" />
|
||||
<!-- Core theme CSS (includes Bootstrap)-->
|
||||
<link href="css/styles.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<section>
|
||||
<h1>Add words</h1>
|
||||
{% if user is defined %}
|
||||
<form action="index.php" method="GET">
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="hidden" name="action" value="addVocabList">
|
||||
<input type="hidden" name="userID" value="{{user}}">
|
||||
<input type="text" name="listName" placeholder="list name" required>
|
||||
</td>
|
||||
</tr>
|
||||
{% for i in 0..1 %}
|
||||
<tr>
|
||||
<td><input type="text" name="frenchWord{{i}}" placeholder="french word"></td>
|
||||
<td><input type="text" name="englishWord{{i}}" placeholder="english word"></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr><td colspan="2"><input type="submit" value="Add"></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,105 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Personne - formulaire</title>
|
||||
<script type="text/javascript">
|
||||
function clearForm(oForm) {
|
||||
const elements = oForm.elements;
|
||||
oForm.reset();
|
||||
|
||||
for (i = 0; i < elements.length; i++) {
|
||||
field_type = elements[i].type.toLowerCase();
|
||||
|
||||
switch (field_type) {
|
||||
case "text":
|
||||
case "password":
|
||||
case "textarea":
|
||||
case "hidden":
|
||||
elements[i].value = "";
|
||||
break;
|
||||
|
||||
case "radio":
|
||||
case "checkbox":
|
||||
if (elements[i].checked) {
|
||||
elements[i].checked = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case "select-one":
|
||||
case "select-multi":
|
||||
elements[i].selectedIndex = -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- on vérifie les données provenant du modèle -->
|
||||
{% if dVue is defined %}
|
||||
<div align="center">
|
||||
{% if dVueEreur is defined and dVueEreur|length >0 %}
|
||||
<h2>ERREUR !!!!!</h2>
|
||||
{% for value in dVueEreur %}
|
||||
<p>{{value}}</p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<h2>Personne - formulaire</h2>
|
||||
<hr />
|
||||
<!-- affichage de données provenant du modèle -->
|
||||
{{dVue.data}}
|
||||
|
||||
<form method="post" name="myform" id="myform">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Nom</td>
|
||||
<td>
|
||||
<input name="txtNom" value="{{dVue.nom}}" type="text" size="20" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Age</td>
|
||||
<td>
|
||||
<input
|
||||
name="txtAge"
|
||||
value="{{dVue.age}}"
|
||||
type="text"
|
||||
size="3"
|
||||
required
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr></tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td><input type="submit" value="Envoyer" /></td>
|
||||
<td><input type="reset" value="Rétablir" /></td>
|
||||
<td>
|
||||
<input
|
||||
type="button"
|
||||
value="Effacer"
|
||||
onclick="clearForm(this.form);"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- action !!!!!!!!!! -->
|
||||
<input type="hidden" name="action" value="validationFormulaire" />
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>Erreur !!<br />utilisation anormale de la vuephp</p>
|
||||
{% endif %}
|
||||
<p>
|
||||
Essayez de mettre du code html dans nom -> Correspond à une attaque de type injection
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in new issue