Exemple #1
0
    echo json_encode($result);
});
$app->post('/commentary/delete', function () {
    $request = \Slim\Slim::getInstance()->request();
    $commentary = json_decode($_POST["json"]);
    $commentaryDAO = new Commentary();
    $commentaryDAO->delete($commentary);
    $result = array();
    $result["success"] = true;
    echo json_encode($result);
});
$app->post('/commentary/list', function () {
    $request = \Slim\Slim::getInstance()->request();
    $commentary = json_decode($_POST["json"]);
    $commentaryDAO = new Commentary();
    $result = $commentaryDAO->list_($commentary);
    if (sizeof($result) > 0) {
        echo json_encode($result);
    } else {
        echo json_encode(array("id" => "false"));
    }
});
$app->post('/commentary/getallbyplace', function () {
    $request = \Slim\Slim::getInstance()->request();
    $commentary = json_decode($_POST["json"]);
    $commentaryDAO = new Commentary();
    $result = $commentaryDAO->listall($commentary);
    if (sizeof($result) > 0) {
        $result["success"] = true;
    } else {
        $result["success"] = false;