Merge pull request #32 from ThomasRubini/appreciations

Appreciations view
This commit is contained in:
AntLafI 2023-01-20 10:13:18 +01:00 committed by GitHub
commit 42c3a1dab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<section>
<header>
<img src="<?= $A_view["PROFILE_IMG"] ?>" alt="profile picture">
<h3> <?= $A_view["NAME"] ?> </h3>
<p> <?= $A_view["COMMENT"] ?> </p>
</header>
<p> <?= $A_view["NOTE"] ?> </p>
<p> <?= $A_view["DATE"] ?> </p>
</section>

View File

@ -0,0 +1,57 @@
<?php
$appreciations = array(
array(
"NAME" => "test",
"PROFILE_IMG" => "1.jpg",
"COMMENT" => "j'me présente, je m'appelle henry",
"NOTE" => "2",
"DATE" => DATE("2020-07-08")
),
array(
"NAME" => "test",
"PROFILE_IMG" => "1.jpg",
"COMMENT" => "j'me présente, je m'appelle henry",
"NOTE" => "2",
"DATE" => DATE("2020-07-08")
),
array(
"NAME" => "test",
"PROFILE_IMG" => "1.jpg",
"COMMENT" => "j'me présente, je m'appelle henry",
"NOTE" => "2",
"DATE" => DATE("2020-07-08")
),
array(
"NAME" => "AAAA",
"PROFILE_IMG" => "/static/img/recipes/1.jpg",
"COMMENT" => "j'me présente, je m'appelle henry",
"NOTE" => "2",
"DATE" => DATE("2020-07-08")
),
);
?>
<section>
<h1> Appréciations: </h1>
<form method="POST" action="/">
<label for="comment">Entrez votre commentaire :</label>
<input type="text" name="comment" id="comment" placeholder="Commentaire">
<label for="note">Laissez une note :</label>
<input type="radio" name="note" id="note" value="0"> 0
<input type="radio" name="note" id="note" value="1" title="1"> 1
<input type="radio" name="note" id="note" value="2" title="2"> 2
<input type="radio" name="note" id="note" value="3" title="3" required> 3
<input type="radio" name="note" id="note" value="4" title="4"> 4
<input type="radio" name="note" id="note" value="5" title="5"> 5
<input type="submit" value="Envoyer">
</form>
<?php
foreach ($appreciations as $appreciation){
View::show("appreciations/appreciation", $appreciation);
}
?>
</section>

View File

@ -34,4 +34,8 @@
<p>By <?= $A_view["AUTHOR_USERNAME"] ?></p>
<?php
View::show("appreciations/view")//need to be linked with recipe?
?>
</main>