本文整理汇总了PHP中project::update方法的典型用法代码示例。如果您正苦于以下问题:PHP project::update方法的具体用法?PHP project::update怎么用?PHP project::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类project
的用法示例。
在下文中一共展示了project::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: project
<h1><?php
echo $lang['common_projects'];
?>
</h1>
<?php
$projectInst = new project();
if (!$loginInst->isCustomer()) {
#######################################################################
## perform action
$status = 1;
if (tool::securePost('action') == "save" && tool::securePost('id')) {
# fill project with submitted data
$projectInst->id = tool::securePost('id');
$projectInst->fill(tool::securePostAll());
$status = $projectInst->update();
} elseif (tool::securePost('action') == "save") {
$projectInst->fill(tool::securePostAll());
$status = $projectInst->insert();
}
if (tool::securePost('action') == "delete") {
$projectInst->id = tool::securePost('id');
$projectInst->delete();
}
if (tool::securePost('action') == "edit") {
$status = 0;
$projectInst->activate(tool::securePost('id'));
}
#######################################################################
## make edit / new form
if (!$status) {
示例2: user
<?php
session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/common.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/project.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/user.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/config.class.php";
$objuser = new user();
$objuser->checkLoginAjax();
if (is_array($_POST)) {
$objproject = new project();
$objproject->update($_POST);
if (isset($_SESSION['tempfilename'])) {
$fp = fopen($_SESSION['tempfilename'], 'r');
$content = fread($fp, $_SESSION['filesize']);
fclose($fp);
$objproject->addfile($_SESSION['filename'], $_SESSION['filetype'], $_SESSION['filesize'], $content, $_POST['projectid']);
}
echo "script: messageBox('Project Updated',function() { window.location='account.php'; });";
}