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


PHP CORE_database::qstr方法代码示例

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


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

 function update($VAR)
 {
     if ($VAR['setup_currency_id'] != DEFAULT_CURRENCY) {
         $curr = true;
     } else {
         $curr = false;
     }
     # make sure the index.php file is not included at the end:
     if (!empty($VAR['setup_ssl_url'])) {
         $VAR['setup_ssl_url'] = eregi_replace('index.php', '', $VAR['setup_ssl_url']);
     }
     if (!empty($VAR['setup_nonssl_url'])) {
         $VAR['setup_nonssl_url'] = eregi_replace('index.php', '', $VAR['setup_nonssl_url']);
     }
     # Validate trailing slash is on the end of the URL:
     if (!empty($VAR['setup_ssl_url']) && !ereg('/$', $VAR['setup_ssl_url'])) {
         $VAR['setup_ssl_url'] .= '/';
     }
     # Validate trailing slash is on the end of the URL:
     if (!empty($VAR['setup_nonssl_url']) && !ereg('/$', $VAR['setup_nonssl_url'])) {
         $VAR['setup_nonssl_url'] .= '/';
     }
     $type = "update";
     $this->method["{$type}"] = explode(",", $this->method["{$type}"]);
     $db = new CORE_database();
     $rs = $db->update($VAR, $this, $type);
     if ($rs && $curr) {
         /* Start: Update all sessions & accounts */
         $db =& DB();
         $sql = "UPDATE " . AGILE_DB_PREFIX . "session \n\t\t\t\t\tSET\n\t\t\t\t\tcurrency_id = " . $db->qstr($VAR['setup_currency_id']) . "\n\t\t\t\t\tWHERE\n\t\t\t\t\tsite_id \t= " . $db->qstr(DEFAULT_SITE) . " AND\n\t\t\t\t\tcurrency_id != " . $db->qstr($VAR['setup_currency_id']);
         $rs = $db->Execute($sql);
         $sql = "UPDATE " . AGILE_DB_PREFIX . "account \n\t\t\t\t\tSET\n\t\t\t\t\tcurrency_id = " . $db->qstr($VAR['setup_currency_id']) . "\n\t\t\t\t\tWHERE\n\t\t\t\t\tsite_id \t= " . $db->qstr(DEFAULT_SITE) . " AND\n\t\t\t\t\tcurrency_id != " . $db->qstr($VAR['setup_currency_id']);
         $rs = $db->Execute($sql);
         /* End: SQL Insert Statement */
     }
     # Clear out the cache entry
     if (defined("AGILE_CORE_CACHE_DIR") && AGILE_CORE_CACHE_DIR != '') {
         $tfile = AGILE_CORE_CACHE_DIR . "core-setup";
         if (file_exists($tfile)) {
             unlink(AGILE_CORE_CACHE_DIR . "core-setup");
         }
     }
 }
开发者ID:sluther,项目名称:agilebill,代码行数:43,代码来源:setup.inc.php

示例3: add

 function add($VAR)
 {
     # defaults for 'recurring' product
     if ($VAR["product_price_type"] == "1") {
         $VAR['product_price_recurr_default'] = "1";
         $VAR['product_price_recurr_type'] = "0";
         $VAR['product_price_recurr_week'] = "1";
         $VAR['product_price_recurr_weekday'] = "1";
         # Set default recurring prices: (monthly only)
         $db =& DB();
         $sql = 'SELECT id FROM ' . AGILE_DB_PREFIX . 'group WHERE
                         site_id             = ' . $db->qstr(DEFAULT_SITE) . ' AND
                         pricing		        = ' . $db->qstr('1');
         $rs = $db->Execute($sql);
         while (!$rs->EOF) {
             $i = $rs->fields['id'];
             $recur_price[0][$i]['price_base'] = '';
             $recur_price[0][$i]['price_setup'] = '';
             @($recur_price[1][$i]['price_base'] = $VAR['product_price_base']);
             @($recur_price[1][$i]['price_setup'] = $VAR['product_price_setup']);
             $recur_price[2][$i]['price_base'] = '';
             $recur_price[2][$i]['price_setup'] = '';
             $recur_price[3][$i]['price_base'] = '';
             $recur_price[3][$i]['price_setup'] = '';
             $recur_price[4][$i]['price_base'] = '';
             $recur_price[4][$i]['price_setup'] = '';
             $recur_price[5][$i]['price_base'] = '';
             $recur_price[5][$i]['price_setup'] = '';
             $rs->MoveNext();
         }
         $recur_price[0]['show'] = "0";
         $recur_price[1]['show'] = "1";
         $recur_price[2]['show'] = "0";
         $recur_price[3]['show'] = "0";
         $recur_price[4]['show'] = "0";
         $recur_price[5]['show'] = "0";
         @($VAR['product_price_group'] = $recur_price);
     }
     # Defaults for product groups:
     $VAR['product_group_avail'] = array('0');
     $this->product_construct();
     $type = "add";
     $this->method["{$type}"] = explode(",", $this->method["{$type}"]);
     $db = new CORE_database();
     $result = $db->add($VAR, $this, $type);
     # Create a translate record for this product:
     if ($result) {
         $db =& DB();
         $id = $db->GenID(AGILE_DB_PREFIX . 'product_translate_id');
         $sql = 'INSERT INTO ' . AGILE_DB_PREFIX . 'product_translate SET
                         site_id             = ' . $db->qstr(DEFAULT_SITE) . ',
                         id                  = ' . $db->qstr($id) . ',
                         product_id          = ' . $db->qstr($result) . ',
                         language_id         = ' . $db->qstr(DEFAULT_LANGUAGE) . ',
                         name                = ' . $db->qstr(@$VAR["translate_name"]) . ',
                         description_short   = ' . $db->qstr(@$VAR["translate_description_short"]) . ',
                         description_full    = ' . $db->qstr(@$VAR["translate_description_full"]);
         $db->Execute($sql);
     }
 }
开发者ID:nicsopon,项目名称:agilebill,代码行数:60,代码来源:product.inc.php

示例4: add

 function add($VAR)
 {
     $type = "add";
     $this->method["{$type}"] = split(",", $this->method["{$type}"]);
     $db = new CORE_database();
     $id = $db->add($VAR, $this, $type);
     if ($id && !empty($VAR['faq_question'])) {
         # Insert translation
         $db =& DB();
         $idx = $db->GenID(AGILE_DB_PREFIX . 'faq_translate_id');
         $sql = "INSERT INTO\t" . AGILE_DB_PREFIX . "faq_translate\n\t\t\t\t\tSET\n\t\t\t\t\tsite_id = " . DEFAULT_SITE . ",\n\t\t\t\t\tid = {$idx},\n\t\t\t\t\tfaq_id = {$id},\n\t\t\t\t\tdate_orig = " . time() . ",\n\t\t\t\t\tdate_last = " . time() . ",\n\t\t\t\t\tlanguage_id = '" . DEFAULT_LANGUAGE . "',\n\t\t\t\t\tanswer = " . $db->qstr(@$VAR['faq_answer']) . ",\n\t\t\t\t\tquestion = " . $db->qstr(@$VAR['faq_question']);
         $db->Execute($sql);
     }
 }
开发者ID:ntws,项目名称:agilebill,代码行数:14,代码来源:faq.inc.php

示例5: delete

 function delete($VAR)
 {
     $this->associated_DELETE[] = array('table' => 'invoice_commission', 'field' => 'affiliate_commission_id');
     $db = new CORE_database();
     $db->mass_delete($VAR, $this, "");
     # Delete all associated discounts:
     if (isset($VAR['id'])) {
         $id = $VAR['id'];
         for ($i = 0; $i < count($id); $i++) {
             if ($id[$i] != '') {
                 $q = '%Affiliate Commission ID ' . $id[$i] . '%';
                 $db =& DB();
                 $sql = "DELETE FROM " . AGILE_DB_PREFIX . "discount WHERE\n\t\t\t\t\t\t   notes     LIKE " . $db->qstr($q) . " AND\n\t\t\t\t\t\t   site_id    = " . $db->qstr(DEFAULT_SITE);
                 $result = $db->Execute($sql);
             }
         }
     } else {
         $id = $VAR['delete_id'];
         $q = '%Affiliate Commission ID ' . $id . '%';
         $db =& DB();
         $sql = "DELETE FROM " . AGILE_DB_PREFIX . "discount WHERE\n\t\t\t\tnotes     LIKE " . $db->qstr($q) . " AND\n\t\t\t\tsite_id    = " . $db->qstr(DEFAULT_SITE);
         $result = $db->Execute($sql);
     }
 }
开发者ID:chiranjeevjain,项目名称:agilebill,代码行数:24,代码来源:affiliate_commission.inc.php

示例6: add

    function add($VAR)
    {
        global $C_translate, $C_debug;
        $VAR['htaccess_dir_htaccess'] = '# Error!';
        $this->validated = true;
        ### Change the path...
        if (isset($VAR['htaccess_dir_path']) && $VAR['htaccess_dir_path'] != '') {
            # trim whitspaces
            $VAR['htaccess_dir_path'] = trim($VAR['htaccess_dir_path']);
            # replace all forward slashes with back slashes
            $VAR['htaccess_dir_path'] = ereg_replace('\\\\', '/', $VAR['htaccess_dir_path']);
            # add the final trailing slash if missing
            if (!ereg('[/]$', $VAR['htaccess_dir_path'])) {
                $VAR['htaccess_dir_path'] = $VAR['htaccess_dir_path'] . '/';
            }
        }
        if (isset($VAR['htaccess_dir_path']) && $VAR['htaccess_dir_path'] != '') {
            ################################################################
            ### VERIFY LOCAL PATH & WRITABILITY!
            @($filename = $VAR['htaccess_dir_path'] . '.htaccess');
            @($id = $VAR['htaccess_dir_htaccess_id']);
            $db =& DB();
            $sql = 'SELECT name FROM ' . AGILE_DB_PREFIX . 'htaccess WHERE
						   site_id     = ' . $db->qstr(DEFAULT_SITE) . ' AND
						   id          = ' . $db->qstr($id);
            $result = $db->Execute($sql);
            @($name = $result->fields['name']);
            ### Check path
            $path = $VAR['htaccess_dir_path'];
            if (is_dir($path)) {
                ### Check if is writable!
                if (!is_writable($path)) {
                    ## Path not writable!
                    $this->validated = false;
                    $this->val_error[] = array('field' => 'none', 'field_trans' => $C_translate->translate('error', 'core', ""), 'error' => $C_translate->translate('path_auth', 'htaccess_dir', ""));
                }
            } else {
                ### Path broken!
                $this->validated = false;
                $this->val_error[] = array('field' => 'none', 'field_trans' => $C_translate->translate('error', 'core', ""), 'error' => $C_translate->translate('path_broke', 'htaccess_dir', ""));
            }
        }
        ####################################################################
        ### If validation was failed, skip the db insert &
        ### set the errors & origonal fields as Smarty objects,
        ### and change the page to be loaded.
        ####################################################################
        if (!$this->validated) {
            global $smarty;
            # set the errors as a Smarty Object
            $smarty->assign('form_validation', $this->val_error);
            # set the page to be loaded
            if (!defined("FORCE_PAGE")) {
                define('FORCE_PAGE', $VAR['_page_current']);
            }
            return;
        }
        ####################################################################
        ### Create the record/verify fields
        $type = "add";
        $this->method["{$type}"] = explode(",", $this->method["{$type}"]);
        $db = new CORE_database();
        $dir_id = $db->add($VAR, $this, $type);
        ####################################################################
        ### Create the .htaccess file
        if (isset($dir_id) && $dir_id > 0) {
            ### GENERATE THE EXCLUDE LIST
            $exclude_list = $this->exclude_list();
            ### GENERATE THE .HTACCESS FILE
            $nl = "\n";
            $data = $this->htaccess_extra . 'RewriteEngine on' . $nl;
            if (empty($VAR['htaccess_dir_recursive'])) {
                $data .= 'RewriteRule   ^(.*)/.*$      -                  [L]' . $nl;
            }
            $data .= 'RewriteRule ' . $exclude_list . '$ htaccess_index.php?_HTACCESS_ID=' . $id . '&_HTACCESS_DIR_ID=' . $dir_id;
            ### Update the db record
            $db =& DB();
            $sql = "UPDATE " . AGILE_DB_PREFIX . "htaccess_dir SET\n\t\t\t\t   htaccess = " . $db->qstr($data) . " WHERE\n\t\t\t\t   id       = " . $db->qstr($dir_id) . " AND\n\t\t\t\t   site_id  = " . $db->qstr(DEFAULT_SITE);
            $result = $db->Execute($sql);
            ### WRITE THE LOCAL .HTACCESS FILE
            $fp = fopen($filename, "w+");
            fwrite($fp, $data);
            fclose($fp);
            ### WRITE THE htaccess_index.php FILE
            $php_filename = $VAR['htaccess_dir_path'] . 'htaccess_index.php';
            $data = $this->create_php();
            $fp = fopen($php_filename, "w+");
            fwrite($fp, $data);
            fclose($fp);
        }
    }
开发者ID:sluther,项目名称:agilebill,代码行数:91,代码来源:htaccess_dir.inc.php

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