当前位置: 首页>>代码示例>>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;未经允许,请勿转载。