git-svn-id: https://msi/svn/firstRepo/Service/trunk@23 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2014-12-10 15:19:03 +00:00
parent 4f363403ca
commit f7d8f47f57
30 changed files with 4732 additions and 3053 deletions
+20 -4
View File
@@ -33,7 +33,7 @@ $app->get('/typeqtys', function () use ($app) {
returnJson($app, $callbackFn, $retObj);
});
$app->get('/categoryitems/:catID', function ($categoryID) use ($app) {
$app->get('/ricette/:catID', function ($categoryID) use ($app) {
$callbackFn = $app->request()->get('callback');
$mysqlconnetion = new MysqlClass;
//$mysqlconnetion->connetti();
@@ -48,7 +48,7 @@ $app->get('/categoryitems/:catID', function ($categoryID) use ($app) {
returnJson($app, $callbackFn, $retObj);
});
$app->get('/categoryitems/:categoryID/mostvote(/:numItems)', function ($categoryID, $numItems = 10) use ($app) {
$app->get('/ricette/:categoryID/mostvote(/:numItems)', function ($categoryID, $numItems = 10) use ($app) {
$callbackFn = $app->request()->get('callback');
$mysqlconnetion = new MysqlClass;
//$mysqlconnetion->connetti();
@@ -63,7 +63,7 @@ $app->get('/categoryitems/:categoryID/mostvote(/:numItems)', function ($category
returnJson($app, $callbackFn, $retObj);
});
$app->get('/categoryitems/:categoryID/lastinserted(/:numItems)', function ($categoryID, $numItems = 10) use ($app) {
$app->get('/ricette/:categoryID/lastinserted(/:numItems)', function ($categoryID, $numItems = 10) use ($app) {
$callbackFn = $app->request()->get('callback');
$mysqlconnetion = new MysqlClass;
//$mysqlconnetion->connetti();
@@ -78,7 +78,23 @@ $app->get('/categoryitems/:categoryID/lastinserted(/:numItems)', function ($cate
returnJson($app, $callbackFn, $retObj);
});
$app->get('/categoryitems/search/:numItems(/:categoryId(/:difficolta(/:titolo)))',
$app->get('/ricette/lastinserted/:profileID', function ($profileID) use ($app) {
$callbackFn = $app->request()->get('callback');
$mysqlconnetion = new MysqlClass;
//$mysqlconnetion->connetti();
$query = "select ID as ricetta_id, titolo, autore FROM ricette WHERE data_creazione > ( SELECT PenultimoAccesso FROM profilo " .
"WHERE `ProfiloID` = '" . $profileID . "' ) order by Data_creazione desc, titolo, autore";
$retObj = $mysqlconnetion->queryToObject($query);
$mysqlconnetion->disconnetti();
foreach ($retObj as $ele) {
$ele["titolo"] = html_entity_decode($ele["titolo"], ENT_COMPAT | ENT_HTML401, 'ISO-8859-1');
}
returnJson($app, $callbackFn, $retObj);
});
$app->get('/ricette/search/:numItems(/:categoryId(/:difficolta(/:titolo)))',
function ($numItems = 10, $categoryId = 0, $difficolta = 0, $titolo = "") use ($app) {
$callbackFn = $app->request()->get('callback');
//$filterItem = json_decode($app->request()->post('post'));