Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ALGLAVE Ivan
Drinkpedia
Commits
81751df1
Commit
81751df1
authored
Nov 26, 2020
by
ALGLAVE Ivan
Browse files
d
parent
1d78f30e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Home.php
View file @
81751df1
...
...
@@ -12,7 +12,7 @@
<div
class=
"topnav"
>
<button
id=
"tabBtnI"
class=
"active"
value=
"Hierarchy.php"
onclick=
"tabButtonClicked(this)"
>
Hiérarchie
</button>
<button
id=
"tabBtnA"
value=
"AdvancedSearch.php"
onclick=
"tabButtonClicked(this)"
>
Avancé
</button>
<button
id=
"tabBtn
C
"
value=
"
Cocktail
s.php"
onclick=
"tabButtonClicked(this)"
>
Cocktail
s
</button>
<button
id=
"tabBtn
R
"
value=
"
Recipe
s.php"
onclick=
"tabButtonClicked(this)"
>
Recette
s
</button>
<button
id=
"tabBtnMA"
class=
"right"
value=
"MyAccount.php"
onclick=
"tabButtonClicked(this)"
>
Mon Compte
</button>
<button
id=
"tabBtnF"
class=
"right"
value=
"MyFavouriteRecipes.php"
onclick=
"tabButtonClicked(this)"
>
Favoris
</button>
</div>
...
...
@@ -52,6 +52,10 @@
{
showRecipe
(
m_value
);
}
else
if
(
m_event
==
'
hierarchyDisplay
'
)
{
switchView
(
'
Hierarchy.php?element="
'
+
m_value
+
'
"
'
);
}
}
function
hideRecipe
()
...
...
RecipeList.php
0 → 100644
View file @
81751df1
<!DOCTYPE html>
<html>
<head>
<title>
Drinkpedia
</title>
<meta
charset=
"UTF-8"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/RecipeList.css"
>
</head>
<body>
<ul>
<?php
include
"Donnees.inc.php"
;
$recipesIds
=
explode
(
'|'
,
$_GET
[
'ids'
]);
foreach
(
$recipesIds
as
$id
)
{
echo
'<li>'
;
echo
'<div>'
;
$recipe
=
$Recettes
[(
int
)
$id
];
echo
$recipe
[
'titre'
];
echo
'</div>'
;
echo
'</li>'
;
}
?>
</ul>
</body>
</html>
\ No newline at end of file
css/RecipeList.css
0 → 100644
View file @
81751df1
table
,
td
,
tr
,
th
{
border-width
:
1px
;
border-color
:
1px
;
}
\ No newline at end of file
scripts/DataQuery.js
View file @
81751df1
var
scripts_location
=
"
scripts/DataQuery.php
"
;
var
arg_name_func
=
"
functionname
"
;
var
arg_name_args
=
"
arguments
"
;
function
query
(
func_name
,
args
,
callback
)
{
$
.
post
(
scripts_location
,
{
arg_name_func
:
func_name
,
arg_name_args
:
args
},
callback
);
}
function
getRecipes
(
wanted_ingredients
=
[],
unwanted_ingredients
=
[],
max_unsatisfied
=
0
,
allow_missing
=
true
,
allow_unwanted
=
true
,
callback
)
{
$
.
post
(
"
scripts/DataQuery.php
"
,
{
'
functionname
'
:
'
getRecipe
'
,
'
arguments
'
:
[
wanted_ingredients
,
unwanted_ingredients
,
max_unsatisfied
,
allow_missing
,
allow_unwanted
]
}
,
callback
);
query
(
'
getRecipe
'
,
[
wanted_ingredients
,
unwanted_ingredients
,
max_unsatisfied
,
allow_missing
,
allow_unwanted
],
callback
);
}
function
getIngredients
(
parent_category
=
'
Aliment
'
,
callback
)
{
$
.
post
(
"
scripts/DataQuery.php
"
,
{
'
functionname
'
:
'
getIngredients
'
,
'
arguments
'
:
[
parent_category
]},
callback
);
query
(
'
getIngredients
'
,
[
parent_category
],
callback
);
}
function
getRecipeImage
(
id
,
callback
)
{
query
(
'
getRecipeImage
'
,
[
id
],
callback
);
}
\ No newline at end of file
scripts/DataQuery.php
View file @
81751df1
...
...
@@ -16,6 +16,10 @@
{
echo
getIngredients
(
$_POST
[
'arguments'
][
0
]);
}
else
if
(
$funcName
==
'getRecipeImage'
)
{
echo
getRecipeImage
(
$_POST
[
'arguments'
][
0
]);
}
else
{
echo
'error - unknown func'
;
...
...
scripts/Functions.php
View file @
81751df1
...
...
@@ -74,4 +74,16 @@ function getIngredients($parent_category)
return
$res
;
}
function
getRecipeImage
(
$id
)
{
include
"../Donnees.inc.php"
;
$name
=
$Recettes
[
$id
];
$formatted_name
=
implode
(
'_'
,
explode
(
' '
,
$name
))
.
'.jpg'
;
if
(
file_exists
(
'../Photos/'
.
$formatted_name
))
return
$formatted_name
;
else
return
''
;
}
?>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment