break; case "add_part_to_unit": addComponentToUnit($_GET['unit'],$_GET['part_id']); break; case "add_unit": //could test for required fields here $new_unit_id = createUnit($_GET['pl'],$_GET['name'],$_GET['description'],$_GET['make_id'],$_GET['ref_figure_id']); if ($_GET['pl'] == 8) { header("Location: part_finder.php?pl=".$_GET['pl']."&ring_gears_unit_id=".$new_unit_id); } else { header("Location: part_finder.php?pl=".$_GET['pl']."&unit=".$new_unit_id."&make=".$_GET['make_id']); } exit(0); break; case "delete_unit": $new_unit_id = deleteUnit($_GET['unit'],$_GET['pl']); if ($_GET['pl'] == 8) { header("Location: part_finder.php?pl=".$_GET['pl']); exit(0); } break; case "edit_unit_name": $ignore_return = updateUnitName($_GET['unit'],$_GET['unit_name']); break; case "add_unit_make": $ignore_return = addUnitMake ($_GET['unit'],$_GET['make_id']); header("Location: system_editor_unit_makes.php?rd=".urlencode($_GET['rd'])."&unit=".$_GET['unit']); exit(0); break; case "remove_unit_make": $ignore_return = removeUnitMake ($_GET['unit'],$_GET['make_id']);
* @apiGroup Unit * * * @apiSuccess {Unit} Unit Unit * @apiPermission Author of the Unit * @apiDescription Here you can describe the function. * */ $app->put('/unit/parent', function () use($app) { include_once 'libs/unit.php'; updateUnitParent($app->request->getBody()); }); /** * * @api {DELETE} /unit/:id Delete a Unit * @apiName deleteUnit * @apiGroup Channel * @apiVersion 1.0.0 * @apiDescription Delete this unit entirly. This means all Overlays and Items as well as well as from all Channels. * * @apiParam {Number} id Id of Unit to delete * * @apiPermission Author of the Parent Channel * @apiUse NotPermitted * @apiUse MissingParameter * */ $app->delete('/unit/:id', function ($id) use($app) { include_once 'libs/unit.php'; deleteUnit($id); });
} elseif ($request->type == "deleteTypeIngredient") { deleteTypeIngredient($bdd, $request->id); } elseif ($request->type == "getListRecipes") { $list = getListRecipes($bdd, $request->num_page, $request->type_recette); echo json_encode($list); } elseif ($request->type == "deleteRecipe") { deleteRecipe($bdd, $request->id); } elseif ($request->type == "getListUnits") { $list = getListUnits($bdd); echo json_encode($list); } elseif ($request->type == "addUnit") { addUnit($bdd, $request->nom, $request->type_unite); } elseif ($request->type == "updateUnit") { updateUnit($bdd, $request->id, $request->nom, $request->type_unite); } elseif ($request->type == "deleteUnit") { deleteUnit($bdd, $request->id); } } /** * Récupère la liste des unités * * @param bdd * Base de données * @param type_unite * Type d'unité : * - 1 -> Unité pour les portions * - 2 -> Unité de temps * - 3 -> Unité de poids * * @return array * Table des unités
<?php require_once dirname(__FILE__) . '/function/func_product.php'; session_start(); $idUnit = $_GET['idunit']; $get_countUnit = GetcountProductOrder($idUnit); $countUnit = $get_countUnit['countUnit']; if ($countUnit >= 1) { echo "2"; } else { $delUnit = deleteUnit($idUnit); echo "1"; }