-
ALGLAVE Ivan authored
Added autocomplete input field for all ingredients on the advanced search page and fixed inclusion issues in php by duplicating Doonees.inc.php
ALGLAVE Ivan authoredAdded autocomplete input field for all ingredients on the advanced search page and fixed inclusion issues in php by duplicating Doonees.inc.php
AdvancedSearch.php 1.03 KiB
<!DOCTYPE html>
<html>
<head>
<title>Drinkpedia</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/AdvancedSearch.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type = "text/javascript" src="scripts/DataQuery.js"></script>
</head>
<body>
<form autocomplete="off">
<div class="autocomplete" style="width:300px;">
<h2>Rechercher un aliment : </h2>
<input id="myInput" autocomplete="off" type="text" name="myIngredient" placeholder="Ingrédient">
</div>
</form>
<script src="scripts/DataQuery.js"></script>
<script src="scripts/Functions.js"></script>
<script>
let allIngredients = [<?php include 'scripts/Functions.php'; $first = true; foreach(getAllIngredients() as $ingredient) { if(!$first) echo ','; else $first = false; echo '"' . $ingredient . '"'; } ?>];
autocomplete(document.getElementById("myInput"), allIngredients);
</script>
</body>
</html>