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


PHP Rank::update方法代码示例

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


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

示例1: procede

 public function procede()
 {
     try {
         if ($this->oRequest->existParam('name')) {
             if ($this->oRequest->existParam('edit')) {
                 $oRank = new Rank($this->oRequest->getParam('name', 'string'), $this->oRequest->getParam('default', 'boolean'), $this->oRequest->getParam('edit', 'int'));
                 //Delete
                 if ($this->oRequest->existParam('delete') && $this->oRequest->getParam('delete', 'boolean')) {
                     $oRank->delete();
                     Logger::log('admin', Language::translate('RANKS_ADMIN_RANK_DELLOG') . $this->oRequest->getParam('name', 'string') . ' [' . $this->oCurrentUser->getLogin() . ']');
                     $this->oView->addAlert(Language::translate('RANKS_ADMIN_RANK_DEL'), 'success');
                 } else {
                     //Edit
                     $oRank->update();
                     Logger::log('admin', Language::translate('RANKS_ADMIN_RANK_UPDATELOG') . $this->oRequest->getParam('name', 'string') . ' [' . $this->oCurrentUser->getLogin() . ']');
                     $this->oView->addAlert(Language::translate('RANKS_ADMIN_RANK_UPDATE'), 'success');
                 }
             } else {
                 $oRank = new Rank($this->oRequest->getParam('name', 'string'), $this->oRequest->getParam('default', 'boolean'));
                 $oRank->store();
                 Logger::log('admin', Language::translate('RANKS_ADMIN_RANK_ADDLOG') . $this->oRequest->getParam('name', 'string') . ' [' . $this->oCurrentUser->getLogin() . ']');
                 $this->oView->addAlert(Language::translate('RANKS_ADMIN_RANK_ADD'), 'success');
             }
         }
     } catch (Exception $ex) {
         $this->oView->addAlert($ex, 'danger');
     } finally {
         $this->createView();
     }
 }
开发者ID:Jatax,项目名称:TKS,代码行数:30,代码来源:adminranks.controller.php

示例2: filterArray

     }
 }
 if ($countErrors > 0) {
     $_POST = filterArray($_POST);
     $_POST['submit'] = false;
 } else {
     // EVERYTHING IS OK
     $newRank = new Rank($mysqli);
     $arrColumns = array("rankcategory_id", "name", "description", "imageurl", "ordernum", "autodays", "hiderank", "promotepower", "autodisable", "color", "imagewidth", "imageheight");
     $arrValues = array($_POST['rankcat'], $_POST['rankname'], $_POST['rankdesc'], $rankImgURL, $intNewRankOrderNum, isset($_POST['autodays']) ? $_POST['autodays'] : 0, isset($_POST['hiderank']) ? $_POST['hiderank'] : 0, isset($_POST['promoterank']) ? $_POST['promoterank'] : 0, isset($_POST['autodisable']) ? $_POST['autodisable'] : 0, $_POST['rankcolor'], $_POST['rankimagewidth'], $_POST['rankimageheight']);
     if ($newRank->addNew($arrColumns, $arrValues)) {
         // Added Rank! Now give the rank its privileges
         $newRankInfo = $newRank->get_info_filtered();
         // If maximum rank is set to "(this rank)", set the promotepower to the new rank's rank_id
         if ($_POST['promoterank'] == -1) {
             $newRank->update(array("promotepower"), array($newRankInfo['rank_id']));
         }
         $arrColumns = array("rank_id", "console_id");
         $privObj = new Basic($mysqli, "rank_privileges", "privilege_id");
         $result = $mysqli->query("SELECT * FROM " . $dbprefix . "console ORDER BY sortnum");
         $rankOptions = "";
         while ($row = $result->fetch_assoc()) {
             $strPostVarName = "consoleid_" . $row['console_id'];
             if (isset($_POST[$strPostVarName]) && $_POST[$strPostVarName] == 1) {
                 $arrValues = array($newRankInfo['rank_id'], $row['console_id']);
                 $privObj->addNew($arrColumns, $arrValues);
             }
         }
         $manageRanksCID = $consoleObj->findConsoleIDByName("Manage Ranks");
         echo "\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t<p align='center'>\n\t\t\t\t\tSuccessfully Added New Rank: <b>" . $newRankInfo['name'] . "</b>!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Add New Rank', '" . $MAIN_ROOT . "members/console.php?cID=" . $manageRanksCID . "', 'successBox');\n\t\t\t</script>\n\t\t";
     } else {
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:addrank.php

示例3: elseif

     if (!$uploadFile->uploadFile()) {
         $countErrors++;
         $dispError .= "<b>&middot;</b> Unable to upload rank image file.  Please make sure the file extension is either .jpg, .png, .gif or .bmp<br>";
     } else {
         $rankImgURL = "images/ranks/" . $uploadFile->getUploadedFileName();
         $arrUpdateValues[] = $rankImgURL;
         $arrUpdateColumns[] = "imageurl";
     }
 } elseif ($_POST['rankimageurl'] != "") {
     $arrUpdateValues[] = $_POST['rankimageurl'];
     $arrUpdateColumns[] = "imageurl";
 }
 if ($countErrors == 0) {
     // No errors after checking/uploading new rank image
     $rank->select($_GET['rID']);
     $rank->update($arrUpdateColumns, $arrUpdateValues);
     if ($resortRanks) {
         $rank->resortOrder();
     }
     $rankInfo = $rank->get_info_filtered();
     // Update privileges
     $result = $mysqli->query("DELETE FROM " . $dbprefix . "rank_privileges WHERE rank_id = '" . $rankInfo['rank_id'] . "'");
     if ($result) {
         $arrColumns = array("rank_id", "console_id");
         $privObj = new Basic($mysqli, "rank_privileges", "privilege_id");
         $result = $mysqli->query("SELECT * FROM " . $dbprefix . "console ORDER BY sortnum");
         $rankOptions = "";
         while ($row = $result->fetch_assoc()) {
             $strPostVarName = "consoleid_" . $row['console_id'];
             if (isset($_POST[$strPostVarName]) && $_POST[$strPostVarName] == 1) {
                 $arrValues = array($rankInfo['rank_id'], $row['console_id']);
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:edit.php

示例4: extract

                        </select>
                    </td>
                </tr>
                <tr>
                    <td colspan="2"><button id="edit" name="edit" class="btn btn-primary" type="button" onclick="editRank()">Edit</button></td>
                </tr>
            </table>
        </form>
        <div id="loading" class="alert alert-info" role="alert" style="display: none">

        </div>
        <?php 
        } else {
            if ($do == 'edit') {
                extract($_POST);
                $rank->update($name, $division, $abbrev, $paygrade);
                Event::addEvent('Rank ' . $ranks->getName() . ' has been modified.', $_SESSION['user'], 2);
            }
        }
    } else {
        if ($action == 'create') {
            if ($do == 'none') {
                ?>
        <form action="#" method="post">
            <table>
                <tr>
                    <th><label for="name">Rank Name:</label></th>
                    <td><input type="text" id="name" name="name" required/></td>
                </tr>
                <tr>
                    <th><label for="abbrev">Rank Abbreviation:</label>&nbsp;&nbsp;</th>
开发者ID:Keshaun1222,项目名称:IRIN,代码行数:31,代码来源:ranks.php

示例5: array

        // No errors... Add to DB
        $arrColumns = array("name", "imageurl", "ordernum", "hidecat", "useimage", "description", "imagewidth", "imageheight", "color");
        $arrValues = array($_POST['catname'], $strCatImageURL, $intNewCatOrderNum, $_POST['hidecat'], $_POST['useimage'], $_POST['catdesc'], $_POST['catimagewidth'], $_POST['catimageheight'], $_POST['rankcolor']);
        $newCat = new RankCategory($mysqli);
        if ($newCat->addNew($arrColumns, $arrValues)) {
            // Added New Category... Now set the ranks in this category
            $newCatInfo = $newCat->get_info();
            $rankObj = new Rank($mysqli);
            $result = $mysqli->query("SELECT * FROM " . $dbprefix . "ranks WHERE rank_id != '1'");
            while ($row = $result->fetch_assoc()) {
                $postVar = "rankid_" . $row['rank_id'];
                if (isset($_POST[$postVar]) && $_POST[$postVar] == 1) {
                    if ($rankObj->select($row['rank_id'])) {
                        $arrColumn = array("rankcategory_id");
                        $arrValue = array($newCatInfo['rankcategory_id']);
                        $rankObj->update($arrColumn, $arrValue);
                    }
                }
            }
            echo "\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t<p align='center'>\n\t\t\t\t\tSuccessfully Added New Rank Category!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Add New Rank Category', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t</script>\n\t\t\t";
        } else {
            $_POST['submit'] = false;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to add category.  Please try again.<br>";
        }
    } else {
        $_POST['submit'] = false;
    }
}
if (!isset($_POST['submit']) || !$_POST['submit']) {
    $result = $mysqli->query("SELECT * FROM " . $dbprefix . "rankcategory ORDER BY ordernum DESC");
    $orderoptions = "";
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:addrankcategory.php


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