You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.5 KiB
PHP
43 lines
1.5 KiB
PHP
<?php
|
|
|
|
function unfollowButton($where, $item_id){
|
|
echo "<form method=\"POST\">
|
|
<button type=\"submit\" name=\"";
|
|
|
|
if($where == "list"){
|
|
echo "beer\" value=\"$item_id\" formaction=\"controller/unfollow.php\">Remove from My Beer List";
|
|
}else echo "brewery\" value=\"$item_id\" formaction=\"controller/unfollow.php\">Unfollow Brewery";
|
|
|
|
echo "</button></form></br>";
|
|
}
|
|
|
|
function followButton($where, $item_id){
|
|
|
|
echo "<form method=\"POST\">
|
|
<button type=\"submit\" name=\"";
|
|
|
|
|
|
if($where == "list"){
|
|
echo "beer\" value=\"$item_id\" formaction=\"controller/follow.php\">Add to My Beer List";
|
|
}else echo "brewery\" value=\"$item_id\" formaction=\"controller/follow.php\">Follow Brewery";
|
|
|
|
echo "</button></form></br>";
|
|
}
|
|
|
|
function showStars($beer_id, $rating){
|
|
|
|
for ($i = 1; $i <= $rating; $i++) {
|
|
echo "<form method=\"POST\" action=\"controller/rate.php\">";
|
|
echo "<input class=\"login\" type=\"text\" name=\"$beer_id\" value=\"$i\"></input>";
|
|
echo "<input class=\"Star\" type=\"image\" alt=\"Rate !\" src=\"src/starY.png\" value=\"\">";
|
|
echo "</form>";
|
|
}
|
|
|
|
for ($i = ++$rating ; $i <= 10; $i++) {
|
|
echo "<form method=\"POST\" action=\"controller/rate.php\">";
|
|
echo "<input class=\"login\" type=\"text\" name=\"$beer_id\" value=\"$i\"></input>";
|
|
echo "<input class=\"Star\" type=\"image\" alt=\"Rate !\" src=\"src/starN.png\" value=\"\" >";
|
|
echo "</form>";
|
|
}
|
|
}
|