|
@@ 309-329 (lines=21) @@
|
| 306 |
|
break; |
| 307 |
|
|
| 308 |
|
// **************************************************************************************************************** |
| 309 |
|
case 'unrecommend': // ArrĂȘter de recommander un produit |
| 310 |
|
// **************************************************************************************************************** |
| 311 |
|
$opRedirect = '?op=products'; |
| 312 |
|
if (isset($_GET['product_id'])) { |
| 313 |
|
$product_id = (int)$_GET['product_id']; |
| 314 |
|
$product = null; |
| 315 |
|
$product = $h_oledrion_products->get($product_id); |
| 316 |
|
if (is_object($product)) { |
| 317 |
|
$product->unsetRecommended(); |
| 318 |
|
if ($h_oledrion_products->insert($product, true)) { |
| 319 |
|
OledrionUtility::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . $opRedirect, 1); |
| 320 |
|
} else { |
| 321 |
|
OledrionUtility::redirect(_AM_OLEDRION_SAVE_PB, $baseurl . $opRedirect, 4); |
| 322 |
|
} |
| 323 |
|
} else { |
| 324 |
|
OledrionUtility::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl . $opRedirect, 4); |
| 325 |
|
} |
| 326 |
|
} else { |
| 327 |
|
OledrionUtility::redirect(_AM_OLEDRION_ERROR_1, $baseurl . $opRedirect, 4); |
| 328 |
|
} |
| 329 |
|
break; |
| 330 |
|
|
| 331 |
|
// **************************************************************************************************************** |
| 332 |
|
case 'recommend': // Recommander un produit |
|
@@ 332-352 (lines=21) @@
|
| 329 |
|
break; |
| 330 |
|
|
| 331 |
|
// **************************************************************************************************************** |
| 332 |
|
case 'recommend': // Recommander un produit |
| 333 |
|
// **************************************************************************************************************** |
| 334 |
|
$opRedirect = '?op=products'; |
| 335 |
|
if (isset($_GET['product_id'])) { |
| 336 |
|
$product_id = (int)$_GET['product_id']; |
| 337 |
|
$product = null; |
| 338 |
|
$product = $h_oledrion_products->get($product_id); |
| 339 |
|
if (is_object($product)) { |
| 340 |
|
$product->setRecommended(); |
| 341 |
|
if ($h_oledrion_products->insert($product, true)) { |
| 342 |
|
OledrionUtility::redirect(_AM_OLEDRION_SAVE_OK, $baseurl . $opRedirect, 1); |
| 343 |
|
} else { |
| 344 |
|
OledrionUtility::redirect(_AM_OLEDRION_SAVE_PB, $baseurl . $opRedirect, 4); |
| 345 |
|
} |
| 346 |
|
} else { |
| 347 |
|
OledrionUtility::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl . $opRedirect, 4); |
| 348 |
|
} |
| 349 |
|
} else { |
| 350 |
|
OledrionUtility::redirect(_AM_OLEDRION_ERROR_1, $baseurl . $opRedirect, 4); |
| 351 |
|
} |
| 352 |
|
break; |
| 353 |
|
|
| 354 |
|
// **************************************************************************************************************** |
| 355 |
|
case 'add': // Ajout d'un produit |