$controller->deleteDevice($deviceId); break; case "addType": $value = $_POST['typeName']; $controller->createType($value); break; case "updateType": $crypto = decrypt($_POST['crypto']); $value = $_POST['value']; $explode = explode('|', $crypto); $typeId = $explode[1]; $controller->updateType($typeId, $value); break; case "deleteType": $typeId = decrypt($_POST['value']); $controller->deleteType($typeId); break; case "addBrand": $value = $_POST['brandName']; $controller->createBrand($value); break; case "updateBrand": $crypto = decrypt($_POST['crypto']); $value = $_POST['value']; $explode = explode('|', $crypto); $brandId = $explode[1]; $controller->updateBrand($brandId, $value); break; case "deleteBrand": $brandId = decrypt($_POST['value']); $controller->deleteBrand($brandId);