本文整理汇总了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';