本文整理汇总了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;
}
示例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);
}
}
示例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);
}
}