本文整理匯總了PHP中Services::updateService方法的典型用法代碼示例。如果您正苦於以下問題:PHP Services::updateService方法的具體用法?PHP Services::updateService怎麽用?PHP Services::updateService使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Services
的用法示例。
在下文中一共展示了Services::updateService方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Services
<?php
$url = "../index.php?mod=services&act=list";
require_once "../model/Services.php";
$model = new Services();
$service_id = (int) $_POST['service_id'];
$service_name_vi = $model->processData($_POST['service_name_vi']);
$service_name_en = $model->processData($_POST['service_name_en']);
$service_name_safe_vi = $model->changeTitle($service_name_vi);
$service_name_safe_en = $model->changeTitle($service_name_en);
if ($service_id > 0) {
$model->updateService($service_id, $service_name_vi, $service_name_en, $service_name_safe_vi, $service_name_safe_en);
header('location:' . $url);
} else {
$model->insertService($service_name_vi, $service_name_en, $service_name_safe_vi, $service_name_safe_en);
header('location:' . $url);
}
示例2: elseif
//============================================================================================
// Load the page requested by the user
//============================================================================================
if (!isset($_GET['page'])) {
$render = true;
$thisPage = 'services';
$services = $model->getService();
$l10n->addResource(__DIR__ . '/l10n/services.json');
$viewFile = 'views/services.php';
} elseif ($_GET['page'] === "create-service") {
header('Content-Type: application/json; charset=utf-8');
echo json_encode($model->saveService($_POST));
$loggers['audit']->info("Service created");
exit;
} elseif ($_GET['page'] === "update-service") {
$model->updateService($_POST, $_POST['id']);
$loggers['audit']->info("Service {$_POST['id']} updated");
echo $_POST['id'];
} elseif ($_GET['page'] === "edit-service-dialog") {
header('Content-Type: application/json; charset=utf-8');
echo json_encode($model->getService($_POST['id']));
exit;
} elseif ($_GET['page'] === "remove-service") {
$model->removeService($_POST['id']);
$loggers['audit']->info("Service {$_POST['id']} deleted");
}
/**
* View rendering
*/
if (isset($render) && $render) {
require FS_PHP . '/header.php';