-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.php
28 lines (22 loc) · 769 Bytes
/
api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
include_once 'db/pdo_manager.php';
switch ($_GET['void']){
case ('get_categories'):
//echo 'get_categories';
//$bdManager = pdo_manager::getDB();
$bdManager = new pdo_manager();
$categories = $bdManager->getCategories();
header('Content-Type: text/xml; charset=utf-8');
echo ($categories);
break;
case ('get_tests_by_category'):
$category = $_GET['category'];
//$bdManager = pdo_manager::getDB();
$bdManager = new pdo_manager();
$tests = $bdManager->getTestsByCategory($category);
header('Content-Type: text/xml; charset=utf-8');
echo ($tests);
break;
default:
echo 'Who are you?)';
}