CONTROL_APP::ctl_belong PHP Метод

ctl_belong() публичный Метод

public ctl_belong ( )
    function ctl_belong()
    {
        if (!isset($this->adminLogged["admin_allow"]["app"]["edit"]) && !$this->is_super) {
            return array("alert" => "x050303");
        }
        $_num_appId = fn_getSafe(fn_get("app_id"), "int", 0);
        $_str_key = fn_getSafe(fn_get("key"), "txt", "");
        $_str_keyBelong = fn_getSafe(fn_get("key_belong"), "txt", "");
        if ($_num_appId < 1) {
            return array("alert" => "x050203");
        }
        $_arr_appRow = $this->mdl_app->mdl_read($_num_appId);
        if ($_arr_appRow["alert"] != "y050102") {
            return $_arr_appRow;
        }
        $_arr_search = array("app_id" => $_num_appId, "key" => $_str_key, "key_belong" => $_str_keyBelong);
        $_num_userCount = $this->mdl_user->mdl_count($_arr_search);
        $_arr_page = fn_page($_num_userCount);
        //取得分页数据
        $_str_query = http_build_query($_arr_search);
        $_arr_userRows = $this->mdl_user->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_arr_search);
        $_arr_searchView = array("key" => $_str_keyBelong, "app_id" => $_num_appId);
        $_arr_userViews = $this->mdl_user->mdl_list_view($_arr_searchView);
        $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "userRows" => $_arr_userRows, "userViews" => $_arr_userViews, "appRow" => $_arr_appRow);
        $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
        $this->obj_tpl->tplDisplay("app_belong.tpl", $_arr_tplData);
        return array("alert" => "y050302");
    }

Usage Example

Пример #1
0
        $arr_appRow = $ctl_app->ctl_show();
        if ($arr_appRow["alert"] != "y190102") {
            header("Location: " . BG_URL_ADMIN . "ctl.php?mod=alert&act_get=show&alert=" . $arr_appRow["alert"]);
            exit;
        }
        break;
    case "form":
        //创建、编辑表单
        $arr_appRow = $ctl_app->ctl_form();
        if ($arr_appRow["alert"] != "y190102") {
            header("Location: " . BG_URL_ADMIN . "ctl.php?mod=alert&act_get=show&alert=" . $arr_appRow["alert"]);
            exit;
        }
        break;
    case "belong":
        //用户授权
        $arr_appRow = $ctl_app->ctl_belong();
        if ($arr_appRow["alert"] != "y190302") {
            header("Location: " . BG_URL_ADMIN . "ctl.php?mod=alert&act_get=show&alert=" . $arr_appRow["alert"]);
            exit;
        }
        break;
    default:
        //列出
        $arr_appRow = $ctl_app->ctl_list();
        if ($arr_appRow["alert"] != "y190302") {
            header("Location: " . BG_URL_ADMIN . "ctl.php?mod=alert&act_get=show&alert=" . $arr_appRow["alert"]);
            exit;
        }
        break;
}