git-svn-id: https://msi/svn/firstRepo/Service/branches/Manut_2.2.3@58 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2016-01-31 16:13:42 +00:00
parent 5b0e7d9aa9
commit 98cd15fad6
3 changed files with 54 additions and 25 deletions
+18 -19
View File
@@ -33,6 +33,24 @@ $app->get('/typeqtys', function () use ($app) {
returnJson($app, $callbackFn, $retObj);
});
$app->get('/ricette/authors(/:startWith)', function ($startWith = "") use ($app) {
$callbackFn = $app->request()->get('callback');
$mysqlconnetion = new MysqlClass;
$query = "select distinct autore from ricette"
. " where 1 = 1";
if ($startWith != null && $startWith != "") {
$query = $query . " AND autore like '%" . $startWith . "%'";
}
$query = $query . " order by autore";
$retObj = $mysqlconnetion->queryToObject($query);
$mysqlconnetion->disconnetti();
returnJson($app, $callbackFn, $retObj);
});
$app->get('/ricette/:catID', function ($categoryID) use ($app) {
$callbackFn = $app->request()->get('callback');
$mysqlconnetion = new MysqlClass;
@@ -115,25 +133,6 @@ $app->get('/ricette/search/:numItems/:startItem(/:categoryId(/:difficolta(/:tito
returnJson($app, $callbackFn, $retObj);
});
$app->get('/ricette/authors(/:startWith)',
function ($startWith = "") use ($app) {
$callbackFn = $app->request()->get('callback');
$mysqlconnetion = new MysqlClass;
$query = "select distinct autore from ricette"
. " where 1 = 1";
if ($startWith != null && $startWith != "") {
$query = $query . " AND autore like '%" . $startWith . "%'";
}
$query = $query . " order by autore";
$retObj = $mysqlconnetion->queryToObject($query);
$mysqlconnetion->disconnetti();
returnJson($app, $callbackFn, $retObj);
});
$app->get('/ricetta/body/:itemID', function ($itemID) use ($app) {
$callbackFn = $app->request()->get('callback');
$mysqlconnetion = new MysqlClass;