DataQuery.php 815 Bytes
Newer Older
ALGLAVE Ivan's avatar
ALGLAVE Ivan committed
1
2
3
4
5
6
7
8
9
10
11
12
<?php

    include "Functions.php";

    $funcName = $_POST['functionname'];

    if($funcName == 'test')
    {
        echo 'test';
    }
    else if($funcName == 'getRecipes')
    {
13
14
        $str = '';
        foreach($_POST['arguments'] as $arg) $str = $str . ' - ' . $arg;
ALGLAVE Ivan's avatar
ALGLAVE Ivan committed
15
        echo getRecipesForJS($_POST['arguments'][0], $_POST['arguments'][1], $_POST['arguments'][2], $_POST['arguments'][3], $_POST['arguments'][4]);
ALGLAVE Ivan's avatar
ALGLAVE Ivan committed
16
17
18
19
20
    }
    else if($funcName == 'getIngredients')
    {
        echo getIngredients($_POST['arguments'][0]);
    }
ALGLAVE Ivan's avatar
d    
ALGLAVE Ivan committed
21
22
23
24
    else if($funcName == 'getRecipeImage')
    {
        echo getRecipeImage($_POST['arguments'][0]);
    }
25
26
27
28
    else if($funcName == 'getAllIngredients')
    {
        echo implode('|', getAllIngredients());
    }
ALGLAVE Ivan's avatar
ALGLAVE Ivan committed
29
30
31
32
33
34
    else
    {
        echo 'error - unknown func';
    }

?>