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


PHP CORE_database::ErrorMsg方法代码示例

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


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

示例1: add

 function add($VAR)
 {
     $type = "add";
     $this->method["{$type}"] = explode(",", $this->method["{$type}"]);
     $db = new CORE_database();
     $group_id = $db->add($VAR, $this, $type);
     # add the new group to the account_group table:
     $db =& DB();
     $record_id = $db->GenID(AGILE_DB_PREFIX . 'account_group_id');
     $sql = "INSERT INTO " . AGILE_DB_PREFIX . "account_group SET\n\t\t\t\tid\t\t\t= " . $db->qstr($record_id) . ",\n\t\t\t\tsite_id \t= " . $db->qstr(DEFAULT_SITE) . ", \n\t\t\t\tdate_orig\t= " . $db->qstr(time()) . ",\n\t\t\t\tdate_expire = " . $db->qstr('0') . ",\n\t\t\t\tgroup_id\t= " . $db->qstr($group_id) . ",\n\t\t\t\taccount_id\t= " . $db->qstr(SESS_ACCOUNT) . ",\n\t\t\t\tactive\t\t= " . $db->qstr(1);
     $result = $db->Execute($sql);
     if ($result === false) {
         global $C_debug;
         $C_debug->error('list.inc.php', 'select_groups', $db->ErrorMsg());
         return;
     }
     # update the current user's authentication so the newly added group appears
     # as available to them
     global $C_auth;
     $C_auth->auth_update();
     return;
 }
开发者ID:chiranjeevjain,项目名称:agilebill,代码行数:22,代码来源:group.inc.php

示例2: view

    function view($VAR)
    {
        global $smarty;
        $this->construct();
        $type = "view";
        $this->method["{$type}"] = split(",", $this->method["{$type}"]);
        $db = new CORE_database();
        $db->view($VAR, $this, $type);
        ### Define the group mapping....
        $id = @$VAR['id'];
        ### Get the variables for this map plugin:
        $db =& DB();
        $sql = 'SELECT * FROM ' . AGILE_DB_PREFIX . 'db_mapping WHERE
			  id      = ' . $db->qstr(@$VAR["id"]) . ' AND
			  site_id = ' . $db->qstr(DEFAULT_SITE);
        $result = $db->Execute($sql);
        ### error reporting:
        if ($result === false) {
            global $C_debug;
            $C_debug->error('db_mapping.inc.php', 'view', $db->ErrorMsg());
            return;
        }
        $file = $result->fields['map_file'];
        $group_map = $result->fields['group_map'];
        if ($group_map != '') {
            $group_map = unserialize($group_map);
        } else {
            $group_map = array();
        }
        if ($file != '') {
            include_once PATH_PLUGINS . 'db_mapping/' . $file . '.php';
            eval('$_MAP = new map_' . strtoupper($file) . ';');
            ### If this map type is 'db' groups based:
            if ($_MAP->map['group_type'] == 'db' || $_MAP->map['group_type'] == 'db-status') {
                ### Connect to the DB & get the groups:
                $dbm = new db_mapping();
                $db = $dbm->DB_connect($id, 'false');
                eval('@$db_prefix = DB2_PREFIX' . strtoupper($file) . ';');
                $sql = "SELECT * FROM " . $db_prefix . "" . $_MAP->map['group_map']['table'] . "\n\t\t\t\t\t\t\t ORDER BY      " . $_MAP->map['group_map']['name'];
                $db2 = $db->Execute($sql);
                if ($db2 === false) {
                    global $C_debug;
                    $C_debug->error('db_mapping.inc.php', 'view', $db->ErrorMsg());
                    $smarty->assign('db_mapping_result', $db->ErrorMsg());
                    return;
                }
                ### get the remote groups...
                if ($db2->RecordCount() > 0) {
                    $i = 0;
                    while (!$db2->EOF) {
                        $smart[$i]['id'] = $db2->fields[$_MAP->map['group_map']['id']];
                        $smart[$i]['name'] = $db2->fields[$_MAP->map['group_map']['name']];
                        $db2->MoveNext();
                        $i++;
                    }
                    ### Get the local groups:
                    $db =& DB();
                    $sql = 'SELECT * FROM ' . AGILE_DB_PREFIX . 'group WHERE
							site_id = ' . $db->qstr(DEFAULT_SITE) . '
							ORDER BY name';
                    $groups = $db->Execute($sql);
                    if ($groups === false) {
                        global $C_debug;
                        $C_debug->error('db_mapping.inc.php', 'view', $db->ErrorMsg());
                        return;
                    }
                    if ($groups->RecordCount() > 0) {
                        $i = 0;
                        while (!$groups->EOF) {
                            $id = $groups->fields['id'];
                            $smartgr[$i]['id'] = $groups->fields['id'];
                            $smartgr[$i]['name'] = $groups->fields['name'];
                            for ($ii = 0; $ii < count($smart); $ii++) {
                                $rid = $smart[$ii]['id'];
                                $name = $smart[$ii]['name'];
                                $checked = false;
                                if (isset($group_map[$id][$rid]) && $group_map[$id][$rid] != false) {
                                    $checked = true;
                                }
                                $smartgr[$i]['remote'][$ii]['id'] = $rid;
                                $smartgr[$i]['remote'][$ii]['name'] = $name;
                                $smartgr[$i]['remote'][$ii]['check'] = $checked;
                            }
                            $groups->MoveNext();
                            $i++;
                        }
                        ### Define smarty vars
                        $smarty->assign('db_mapping_result', false);
                        $smarty->assign('db_mapping_template', 'db_mapping:group_map_' . $_MAP->map['group_type']);
                        $smarty->assign('db_mapping_groups', $smartgr);
                    } else {
                        global $C_translate;
                        $message = $C_translate->translate('no_local_groups', 'db_mapping', '');
                        $smarty->assign('db_mapping_result', $message);
                    }
                } else {
                    global $C_translate;
                    $message = $C_translate->translate('no_remote_groups', 'db_mapping', '');
                    $smarty->assign('db_mapping_result', $message);
                }
//.........这里部分代码省略.........
开发者ID:hbustun,项目名称:agilebill,代码行数:101,代码来源:db_mapping.inc.php


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