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


PHP Rank::delete方法代码示例

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


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

     $NbUsers = $userManager->rowCount();
     if (isset($_['id']) && $NbUsers > 1) {
         $userManager->delete(array('id' => $_['id']));
         Functions::goback("setting", "user");
     } else {
         Functions::goback("setting", "user", "&error=Impossible de supprimer le dernier utilisateur.");
     }
     break;
 case 'access_delete_rank':
     if (!$myUser->can('configuration', 'd')) {
         exit('ERREUR: Permissions insuffisantes.');
     }
     $rankManager = new Rank();
     $Nbrank = $rankManager->rowCount();
     if (isset($_['id']) && $Nbrank > 1) {
         $rankManager->delete(array('id' => $_['id']));
         Functions::goback("setting", "access");
         header('location:setting.php?section=access');
     } else {
         Functions::goback("setting", "access", "&error=Impossible de supprimer le dernier rang.");
     }
     break;
 case 'access_add_rank':
     $right_toverify = isset($_['id']) ? 'u' : 'c';
     if (!$myUser->can('configuration', $right_toverify)) {
         exit('ERREUR: Permissions insuffisantes.');
     }
     $rank = new Rank();
     if ($right_toverify == "u") {
         $rank = $rank->load(array("id" => $_['id']));
     }
开发者ID:parrain27,项目名称:yana-server,代码行数:31,代码来源:action.php

示例3: Member

$cID = $cOptObj->findConsoleIDByName("Manage Ranks");
$cOptObj->select($cID);
$member = new Member($mysqli);
$checkMember = $member->select($_SESSION['btUsername']);
if ($checkMember) {
    if ($member->authorizeLogin($_SESSION['btPassword'])) {
        //$cID = $cOptObj->findConsoleIDByName("Add New Rank");
        $memberInfo = $member->get_info();
        if ($member->hasAccess($cOptObj)) {
            $rank = new Rank($mysqli);
            if ($rank->select($_POST['rID'])) {
                $rankInfo = $rank->get_info_filtered();
                if (!isset($_POST['confirm']) || $_POST['confirm'] == "") {
                    echo "\n\t\t\t\t\t\tAre you sure you want to delete the rank <b>" . $rankInfo['name'] . "?</b>\n\t\t\t\t\t";
                } else {
                    if ($rank->countMembers() > 0) {
                        echo "\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\t\$('#deleteMessage').html('There are currently members with the rank of <b>" . $rankInfo['name'] . "</b>.  Please change all members with this rank before deleting it.');\n\t\t\t\t\t\t\t\t\$('#deleteDiv').dialog({\n\t\t\t\t\t\t\t\t\ttitle: 'Manage Ranks - Delete Rank',\n\t\t\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t\t\t'OK': function() { \$(this).dialog('close'); }\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\t";
                    } else {
                        if ($rank->delete()) {
                            echo "";
                            echo "\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfunction refreshRanks() {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\t\$('#deleteMessage').html('<b>" . $rankInfo['name'] . "</b> successfully deleted!');\n\t\t\t\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\t\t\t\$('#contentDiv').fadeOut(400);\n\t\t\t\t\t\t\t\t\$('#deleteDiv').dialog({\n\t\t\t\t\t\t\t\t\ttitle: 'Manage Ranks - Delete Rank',\n\t\t\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t\t\t'OK': function() {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/manageranks/main.php', { }, function(data) {\n\t\t\t\t\t\t\t\t\t\t\t\t\$('#contentDiv').html(data).fadeIn(400);\n\t\t\t\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close'); \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t\t";
                        } else {
                            echo "";
                            echo "\n\t\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\t\$('#deleteMessage').html('Unable to delete rank from the database.  Please contact the website administrator.');\n\t\t\t\t\t\t\t\t\$('#deleteDiv').dialog({\n\t\t\t\t\t\t\t\t\ttitle: 'Manage Ranks - Delete Rank',\n\t\t\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\t\t\tresizeable: false,\n\t\t\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t\t\t'OK': function() { \$(this).dialog('close'); }\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t\t";
                        }
                    }
                }
            }
        }
    }
}
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:delete.php

示例4: extract

                if ($do == 'create') {
                    extract($_POST);
                    Rank::create($name, $division, $abbrev, $paygrade);
                    Event::addEvent('Rank ' . $name . ' has been created.', $_SESSION['user'], 1);
                }
            }
        } else {
            if ($action == 'delete') {
                if ($do == 'none') {
                    ?>
        <a onclick="load('ranks', 'delete', 'delete', {id: '<?php 
                    echo $_GET['id'];
                    ?>
'})">Continue?</a> (<b>NOTE:</b> This action cannot be reversed!)
        <?php 
                } else {
                    if ($do == 'delete') {
                        $ranks = new Rank($_GET['id']);
                        $ranks->delete();
                        Event::addEvent('Rank ' . $ranks->getName() . ' has been deleted.', $_SESSION['user'], 3);
                        ?>
        <script>
            load('ranks', 'none', 'none', {});
        </script>
        <?php 
                    }
                }
            }
        }
    }
}
开发者ID:Keshaun1222,项目名称:IRIN,代码行数:31,代码来源:ranks.php


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