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


PHP doDrop函数代码示例

本文整理汇总了PHP中doDrop函数的典型用法代码示例。如果您正苦于以下问题:PHP doDrop函数的具体用法?PHP doDrop怎么用?PHP doDrop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: doDrop

/**
 * Drop a sequence
 */
function doDrop($confirm, $msg = '')
{
    global $data, $misc;
    global $lang;
    if (empty($_REQUEST['sequence']) && empty($_REQUEST['ma'])) {
        doDefault($lang['strspecifysequencetodrop']);
        exit;
    }
    if ($confirm) {
        $misc->printTrail('sequence');
        $misc->printTitle($lang['strdrop'], 'pg.sequence.drop');
        $misc->printMsg($msg);
        echo "<form action=\"sequences.php\" method=\"post\">\n";
        //If multi drop
        if (isset($_REQUEST['ma'])) {
            foreach ($_REQUEST['ma'] as $v) {
                $a = unserialize(htmlspecialchars_decode($v, ENT_QUOTES));
                echo "<p>", sprintf($lang['strconfdropsequence'], $misc->printVal($a['sequence'])), "</p>\n";
                printf('<input type="hidden" name="sequence[]" value="%s" />', htmlspecialchars($a['sequence']));
            }
        } else {
            echo "<p>", sprintf($lang['strconfdropsequence'], $misc->printVal($_REQUEST['sequence'])), "</p>\n";
            echo "<input type=\"hidden\" name=\"sequence\" value=\"", htmlspecialchars($_REQUEST['sequence']), "\" />\n";
        }
        echo "<p><input type=\"checkbox\" id=\"cascade\" name=\"cascade\" /> <label for=\"cascade\">{$lang['strcascade']}</label></p>\n";
        echo "<p><input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
        echo $misc->form;
        echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n";
        echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" /></p>\n";
        echo "</form>\n";
    } else {
        if (is_array($_POST['sequence'])) {
            $msg = '';
            $status = $data->beginTransaction();
            if ($status == 0) {
                foreach ($_POST['sequence'] as $s) {
                    $status = $data->dropSequence($s, isset($_POST['cascade']));
                    if ($status == 0) {
                        $msg .= sprintf('%s: %s<br />', htmlentities($s), $lang['strsequencedropped']);
                    } else {
                        $data->endTransaction();
                        doDefault(sprintf('%s%s: %s<br />', $msg, htmlentities($s), $lang['strsequencedroppedbad']));
                        return;
                    }
                }
            }
            if ($data->endTransaction() == 0) {
                // Everything went fine, back to the Default page....
                $_reload_browser = true;
                doDefault($msg);
            } else {
                doDefault($lang['strsequencedroppedbad']);
            }
        } else {
            $status = $data->dropSequence($_POST['sequence'], isset($_POST['cascade']));
            if ($status == 0) {
                $_reload_browser = true;
                doDefault($lang['strsequencedropped']);
            } else {
                doDrop(true, $lang['strsequencedroppedbad']);
            }
        }
    }
}
开发者ID:hardikk,项目名称:HNH,代码行数:67,代码来源:sequences.php

示例2: doSaveCreate

     } else {
         doSaveCreate();
     }
     break;
 case 'create':
     doCreate();
     break;
 case 'drop':
     if (isset($_POST['drop'])) {
         doDrop(false);
     } else {
         doDefault();
     }
     break;
 case 'confirm_drop':
     doDrop(true);
     break;
 case 'save_edit':
     if (isset($_POST['cancel'])) {
         doDefault();
     } else {
         doSaveEdit();
     }
     break;
 case 'edit':
     doEdit();
     break;
 case 'properties':
     doProperties();
     break;
 default:
开发者ID:yxwzaxns,项目名称:DaoCloud_phpPgAdmin,代码行数:31,代码来源:functions.php

示例3: doAlter

 case 'alter':
     doAlter();
     break;
 case 'save_alter':
     if (isset($_POST['alter'])) {
         doSaveAlter();
     } else {
         doDefault();
     }
     break;
 case 'confirm_drop':
     doDrop(true);
     break;
 case 'drop':
     if (isset($_POST['drop'])) {
         doDrop(false);
     } else {
         doDefault();
     }
     break;
 case 'properties':
     doProperties();
     break;
 case 'confchangepassword':
     doChangePassword(true);
     break;
 case 'changepassword':
     if (isset($_REQUEST['ok'])) {
         doChangePassword(false);
     } else {
         doAccount();
开发者ID:hardikk,项目名称:HNH,代码行数:31,代码来源:roles.php


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