當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。