當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Services::updateService方法代碼示例

本文整理匯總了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);
}
開發者ID:hoangnhonline,項目名稱:vinawatch,代碼行數:17,代碼來源:Services.php

示例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';
開發者ID:hughnguy,項目名稱:php,代碼行數:31,代碼來源:services.php


注:本文中的Services::updateService方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。