Esempio n. 1
0
<?php

header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
require_once '../model/database.php';
require_once '../model/alphabet.php';
$id = filter_input(INPUT_GET, 'id');
$letter = array();
$letter = alphabet\getLetter($id);
echo json_encode($letter);
Esempio n. 2
0
    case 'prev_letter':
        $prevLetter = filter_input(INPUT_GET, 'id');
        $random = getRandomAnimal($prevLetter);
        if ($prevLetter == 0) {
            $prevLetter = 26;
        }
        $randomAnimal = animals\getAnimal($random);
        $correctAnimal = animals\getAnimal($prevLetter);
        array_push($animals, $randomAnimal, $correctAnimal);
        $animalList = shuffle_assoc($animals);
        $currentLetter = alphabet\getLetter($prevLetter);
        include 'app_window.php';
        break;
    case 'app_directions':
        $first_letter = 1;
        $firstRandomLetter = getRandomAnimal($first_letter);
        $secondRandomLetter = getRandomAnimal($firstRandomLetter);
        $randomAnimal = animals\getAnimal($secondRandomLetter);
        $correctAnimal = animals\getAnimal($firstRandomLetter);
        array_push($animals, $randomAnimal, $correctAnimal);
        $animalList = $animals;
        $currentLetter = alphabet\getLetter($firstRandomLetter);
        include 'app_directions.php';
        break;
    case 'return_object':
        include 'return_object.php';
        break;
    case 'alphabet':
        include 'abc_object.php';
        break;
}