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


PHP Update::u0003方法代码示例

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


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

示例1: admin_controller

function admin_controller()
{
    global $mysqli, $session, $route, $updatelogin;
    // Allow for special admin session if updatelogin property is set to true in settings.php
    // Its important to use this with care and set updatelogin to false or remove from settings
    // after the update is complete.
    if ($updatelogin || $session['admin']) {
        $sessionadmin = true;
    }
    // if ($session['userid']==4) $sessionadmin = true;
    if ($sessionadmin) {
        if ($route->action == 'view') {
            $result = view("Modules/admin/admin_main_view.php", array());
        }
        if ($route->action == 'db') {
            $applychanges = get('apply');
            if (!$applychanges) {
                $applychanges = false;
            } else {
                $applychanges = true;
            }
            require "Modules/admin/update_class.php";
            require_once "Lib/dbschemasetup.php";
            $update = new Update($mysqli);
            $updates = array();
            $updates[] = array('title' => "Database schema", 'description' => "", 'operations' => db_schema_setup($mysqli, load_db_schema(), $applychanges));
            if (!$updates[0]['operations']) {
                // In future versions we could check against db version number as to what updates should be applied
                $updates[] = $update->u0001($applychanges);
                //$updates[] = $update->u0002($applychanges);
                $updates[] = $update->u0003($applychanges);
                $updates[] = $update->u0004($applychanges);
            }
            $result = view("Modules/admin/update_view.php", array('applychanges' => $applychanges, 'updates' => $updates));
        }
        if ($route->action == 'users' && $session['write'] && $session['admin']) {
            $result = view("Modules/admin/userlist_view.php", array());
        }
        if ($route->action == 'userlist' && $session['write'] && $session['admin']) {
            $data = array();
            $result = $mysqli->query("SELECT id,username,email FROM users");
            while ($row = $result->fetch_object()) {
                $data[] = $row;
            }
            $result = $data;
        }
        if ($route->action == 'setuser' && $session['write'] && $session['admin']) {
            $_SESSION['userid'] = intval(get('id'));
            header("Location: ../user/view");
        }
    }
    return array('content' => $result);
}
开发者ID:EMT,项目名称:MyHomeEnergyPlanner,代码行数:53,代码来源:admin_controller.php


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