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


PHP CORE_database::GenID方法代码示例

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


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

示例3: 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


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