Ejemplo n.º 1
0
<?php

require_once 'lister.php';
if (isset($_POST['catid'])) {
    echo json_encode(listTasksByCategory($_POST['catid']));
} else {
    if (isset($_POST['userid'])) {
        echo json_encode(listTasksByUser($_POST['userid']));
    } else {
        echo json_encode(listTasksByCategory(0));
    }
}
Ejemplo n.º 2
0
<?php

require_once 'php/lister.php';
require_once 'php/task_class.php';
$tasks = array();
if (isset($_GET['Categoryid'])) {
    $catid = $_GET['Categoryid'];
    $tasks = listTasksByCategory($catid);
} else {
    if (isset($_GET['userid'])) {
        $userid = $_GET['userid'];
        $tasks = listTasksByUser($userid);
    } else {
        $tasks = listTasksByCategory(0);
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <!-- jQuery library -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- Latest compiled JavaScript -->
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <!--font source-->
    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">