当前位置: 首页>>代码示例>>PHP>>正文


PHP Team::update方法代码示例

本文整理汇总了PHP中Team::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Team::update方法的具体用法?PHP Team::update怎么用?PHP Team::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Team的用法示例。


在下文中一共展示了Team::update方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 public static function update($id)
 {
     $params = $_POST;
     $attributes = array('id' => $id, 'name' => $params['name'], 'year' => $params['year'], 'city' => $params['city']);
     $Team = new Team($attributes);
     $errors = $Team->errors();
     if (count($errors) != 0) {
         View::make('/Team/edit.html', array('errors' => $errors, 'attributes' => $attributes));
     } else {
         $Team->update();
         Redirect::to('/team/' . $Team->id, array('message' => 'Joukkuetta on muokattu onnistuneesti!'));
     }
 }
开发者ID:Jonharju,项目名称:Tsoha-Bootstrap,代码行数:13,代码来源:team_controller.php

示例2: _ops_update

function _ops_update()
{
    $OID = max(0, intval($_POST['OID']));
    $CID = max(0, intval($_POST['CID']));
    $msg = "";
    loginRequireMgmt();
    if (!loginCheckPermission(USER::MGMT_TEAM)) {
        redirect("errors/401");
    }
    $itemName = "Team";
    $urlPrefix = "mgmt_team";
    $object = new Team();
    if ($OID) {
        $object->retrieve($OID, $CID);
        if (!$object->exists()) {
            $msg = "{$itemName} not found!";
        } else {
            transactionBegin();
            $object->merge($_POST);
            if ($object->update()) {
                transactionCommit();
                $msg = "{$itemName} updated!";
            } else {
                transactionRollback();
                $msg = "{$itemName} update failed";
            }
        }
    } else {
        $object->merge($_POST);
        for ($retry = 0; $retry < PIN_RETRY_MAX; $retry++) {
            $pin = Team::generatePIN();
            if (Team::getFromPin($pin) === false) {
                // not a duplicate
                $object->set('pin', $pin);
                transactionBegin();
                if ($object->create() !== false) {
                    transactionCommit();
                    $msg = "{$itemName} created!";
                    break;
                }
            }
        }
        if ($retry >= PIN_RETRY_MAX) {
            transactionRollback();
            $msg = "{$itemName} Create failed";
        }
    }
    redirect("{$urlPrefix}/manage", $msg);
}
开发者ID:brata-hsdc,项目名称:brata.masterserver,代码行数:49,代码来源:ops_update.php

示例3: Team

            echo $rs["id_project"];
            ?>
', '#app_pane_body');
					}, 100);
					window.parent.boss.popup("Error ao deletar equipe.");
				</script>
				<?php 
        }
    } else {
        $model = new Team();
        $sql = array('id_team' => $pk, 'status' => '1');
        $fields = array("id_project");
        $rs = $model->get($sql);
        $rs = $rs[0];
        $model->fields = array('name' => $name, 'website' => $website, 'slug' => $slug);
        $update = $model->update($sql);
        if ($update) {
            ?>
			<script>
				var timePopup = setTimeout(function(){
					window.parent.boss.removeClass('modal_dialog', 'active');
					window.parent.boss.ajax.load('/app/team/view_team/?pk=<?php 
            echo $rs["id_project"];
            ?>
', '#app_pane_body');
				}, 100);
				window.parent.boss.popup("Sucesso ao editar equipe.");
			</script>
			<?php 
        } else {
            ?>
开发者ID:RenanPalmeira,项目名称:agil-framework,代码行数:31,代码来源:edit_team.php

示例4: catch

            $origteam->fetchdets();
        } catch (TeamException $e) {
            $mess = $e->getMessage();
            include 'php/wrongentry.php';
            exit(0);
        }
        // Check name changes
        $newteam = new Team($teamname);
        if (!$origteam->is_same($newteam)) {
            checkname($newteam);
            $origteam->updatename($newteam);
        }
        $origteam->Description = $teamdescr;
        $origteam->Division = $teamdiv;
        $origteam->Captain = new Player($captfirst, $captlast);
        $origteam->update();
        $Title = "Team {$origteam->display_name()} updated OK";
        break;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<?php 
$Title = "Team update complete";
include 'php/head.php';
?>
<body>
<script language="javascript" src="webfn.js"></script>
<?php 
$showadmmenu = true;
include 'php/nav.php';
开发者ID:Britgo,项目名称:Online-League,代码行数:31,代码来源:updindteam2.php

示例5: connectToEncryptedMySQL

<?php

require_once "/etc/apache2/capstone-mysql/encrypted-config.php";
require_once "your-class-file.php";
$pdo = connectToEncryptedMySQL("/etc/apache2/data-design/dfontaine1.ini");
// now procede to PDO normally
$team = new Team(null, 1, "this is from PHP");
$team->insert($pdo);
$team->setTeamContent("now I change the message");
$team->update($pdo);
$team->delete($pdo);
开发者ID:DenzylFontaine,项目名称:espn,代码行数:11,代码来源:team-shakedown.php


注:本文中的Team::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。