git-svn-id: https://msi/svn/firstRepo/Service/branches/Manut_2.2.3@71 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
+18
-3
@@ -18,6 +18,21 @@ $app->get('/photo/publish/:imageID', function ($imageID) use ($app) {
|
||||
$mysqlconnetion->disconnetti();
|
||||
});
|
||||
|
||||
$app->get('/photo/set_cover/:imageID', function ($imageID) use ($app) {
|
||||
$mysqlconnetion = new MysqlClass;
|
||||
|
||||
$query = "select id_ricette from immagini where id = " . $imageID;
|
||||
$retObj = $mysqlconnetion->queryToObject($query, false);
|
||||
|
||||
$query = "update immagini set bCover = 0 where id_ricette = " . $retObj["id_ricette"];
|
||||
$mysqlconnetion->insertRecord($query);
|
||||
|
||||
$query = "update immagini set bCover = 1 where id = " . $imageID;
|
||||
$mysqlconnetion->insertRecord($query);
|
||||
|
||||
$mysqlconnetion->disconnetti();
|
||||
});
|
||||
|
||||
$app->delete('/photo/:imageID', function ($imageID) use ($app,$dirRicetteDropBox) {
|
||||
$mysqlconnetion = new MysqlClass;
|
||||
|
||||
@@ -55,9 +70,9 @@ $app->post('/photo', function () use ($app, $dirRicetteDropBox) {
|
||||
// istanza della classe
|
||||
$mysqlconnetion = new MysqlClass;
|
||||
//$mysqlconneti on->connetti();
|
||||
$query = "insert into immagini(id_ricette, type_format, from_profile_id, uploaded_date) " .
|
||||
$query = "insert into immagini(id_ricette, type_format, from_profile_id, uploaded_date, bCover) " .
|
||||
"values(" . $idRicette . ", '" . image_type_to_mime_type(exif_imagetype($tmpFileName)) .
|
||||
"', '" . $profileID . "', NOW())";
|
||||
"', '" . $profileID . "', NOW(), 0)";
|
||||
$newID = $mysqlconnetion->insertRecord($query);
|
||||
$ext = image_type_to_extension(exif_imagetype($tmpFileName), FALSE);
|
||||
|
||||
@@ -76,7 +91,7 @@ $app->post('/photo', function () use ($app, $dirRicetteDropBox) {
|
||||
|
||||
$thumb_link = makeThumbImage($dropBoxObj, $layer, 80, dirname($tmpFileName), $thumbFileName, $folder);
|
||||
|
||||
$query = "update immagini set (thumb_link = '" . $thumb_link . "', medium_link ='" . $medium_link . "', full_link = '" . $full_link ."' )" .
|
||||
$query = "update immagini set thumb_link = '" . $thumb_link . "', medium_link ='" . $medium_link . "', full_link = '" . $full_link ."'" .
|
||||
" where id=" . $newID;
|
||||
|
||||
$newID = $mysqlconnetion->insertRecord($query);
|
||||
|
||||
Reference in New Issue
Block a user