本文整理汇总了PHP中tep_db_insert_id函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_db_insert_id函数的具体用法?PHP tep_db_insert_id怎么用?PHP tep_db_insert_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_db_insert_id函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: newUpload
function newUpload($jng_sp_id, $type, $filename, $upload_by)
{
$upload_data = array('jng_sp_id' => $jng_sp_id, 'type' => $type, 'filename' => $filename, 'upload_time' => date('Y-m-d H:i:s'), 'upload_by' => $upload_by);
tep_db_perform('jng_sp_upload', $upload_data);
$upload_id = tep_db_insert_id();
return $upload_id;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:7,代码来源:jng_sp_upload.php
示例2: affiliate_insert
function affiliate_insert($sql_data_array, $affiliate_parent = 0)
{
// LOCK TABLES
tep_db_query("LOCK TABLES " . TABLE_AFFILIATE . " WRITE");
if ($affiliate_parent > 0) {
$affiliate_root_query = tep_db_query("select affiliate_root, affiliate_rgt, affiliate_lft�from " . TABLE_AFFILIATE . " where affiliate_id = '" . $affiliate_parent . "' ");
// Check if we have a parent affiliate
if ($affiliate_root_array = tep_db_fetch_array($affiliate_root_query)) {
tep_db_query("update " . TABLE_AFFILIATE . " SET affiliate_lft = affiliate_lft + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_lft > " . $affiliate_root_array['affiliate_rgt'] . " AND affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
tep_db_query("update " . TABLE_AFFILIATE . " SET affiliate_rgt = affiliate_rgt + 2 WHERE affiliate_root = '" . $affiliate_root_array['affiliate_root'] . "' and affiliate_rgt >= " . $affiliate_root_array['affiliate_rgt'] . " ");
$sql_data_array['affiliate_root'] = $affiliate_root_array['affiliate_root'];
$sql_data_array['affiliate_lft'] = $affiliate_root_array['affiliate_rgt'];
$sql_data_array['affiliate_rgt'] = $affiliate_root_array['affiliate_rgt'] + 1;
tep_db_perform(TABLE_AFFILIATE, $sql_data_array);
$affiliate_id = tep_db_insert_id();
}
// no parent -> new root
} else {
$sql_data_array['affiliate_lft'] = '1';
$sql_data_array['affiliate_rgt'] = '2';
tep_db_perform(TABLE_AFFILIATE, $sql_data_array);
$affiliate_id = tep_db_insert_id();
tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_root = '" . $affiliate_id . "' where affiliate_id = '" . $affiliate_id . "' ");
}
// UNLOCK TABLES
tep_db_query("UNLOCK TABLES");
return $affiliate_id;
}
开发者ID:digideskio,项目名称:oscmax2,代码行数:28,代码来源:affiliate_functions.php
示例3: add
function add($products_id, $type, $links_id, $prepared = false)
{
if (is_array($links_id) && count($links_id) > 0) {
if (!$prepared) {
$products_id = tep_db_prepare_input($products_id);
$type = tep_db_prepare_input($type);
}
$plids = array();
foreach ($links_id as $lid) {
if (!$prepared) {
$lid = tep_db_prepare_input($lid);
}
if (intval($lid) != 0 && $products_id != $lid) {
//$check_exist = tep_db_query("SELECT products_linking_id FROM products_linking WHERE products_id=$products_id AND type='$type' AND links_id=$lid");
$check_exist = tep_db_query("SELECT products_linking_id FROM products_linking WHERE products_id={$products_id} AND links_id={$lid}");
if (tep_db_num_rows($check_exist) == 0) {
$sda = array();
$sda['products_id'] = $products_id;
$sda['type'] = $type;
$sda['links_id'] = $lid;
$sda['date_added'] = date('Y-m-d H:i:s');
tep_db_perform('products_linking', $sda);
$plids[] = tep_db_insert_id();
}
}
}
} else {
if ($links_id != '') {
$links = explode(',', $links_id);
$plids = $this->add($products_id, $type, $links, $prepared);
}
}
return $plids;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:34,代码来源:products_linking_php4.php
示例4: createNew
public function createNew($order_currency, $username)
{
/*
$sda = array();
$sda['elements_suppliers_id'] = $this->suppliers_id;
$sda['currency'] = $order_currency;
$sda['date_created'] = date('Y-m-d');
$sda['status'] = '0';
$sda['created_by'] = $username;
tep_db_perform('elements_orders', $sda);
*/
//USED THIS, SO PO NUMBER GENERATED WHEN INSERT, REDUCE SAME PO NUMBER USED BY TWO SUPPLIERS AT THE SAME TIME
$q = "INSERT INTO elements_orders";
$q .= " (";
$q .= " po_number";
$q .= ",elements_suppliers_id";
$q .= ",currency";
$q .= ",date_created";
$q .= ",status";
$q .= ",created_by";
$q .= " )";
$q .= " SELECT CONCAT(LPAD(MONTH(NOW()),2,0),'-',LPAD((IFNULL(MAX(SUBSTRING(po_number,4,3)*1)+1,1)), 3, '0')) po_number";
//po_number e.g: 01-001, 12-999 (MONTH-INCREMENT)
$q .= " ," . $this->suppliers_id;
$q .= " ,'{$order_currency}'";
$q .= " ,'" . date('Y-m-d') . "'";
$q .= " ,'0'";
$q .= " ,'{$username}'";
$q .= " FROM elements_orders WHERE date_created LIKE '" . date('Y-m') . "%'";
tep_db_query($q);
$this->orders_id = tep_db_insert_id();
$this->loadDetail();
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:33,代码来源:elements_order.php
示例5: store
/**
*
* @return
*/
function store()
{
$new_entry = true;
if (isset($this->fields['doba_log_id']) && $this->fields['doba_log_id'] > 0) {
$new_entry = false;
}
if ($new_entry) {
$sql = 'insert into DobaLog set ';
} else {
$sql = 'update DobaLog set ';
}
$cnt = 0;
foreach ($this->fields as $i => $f) {
if ($cnt > 0) {
$sql .= ',';
}
$sql .= $i . '="' . $f . '"';
++$cnt;
}
if (!$new_entry) {
$sql .= ' where doba_log_id=' . $this->fields['doba_log_id'];
}
if ($cnt > 0) {
$store = tep_db_query($sql);
$this->doba_log_id(tep_db_insert_id());
return true;
}
return false;
}
开发者ID:paraspatel2020,项目名称:cs4550-oscommerce,代码行数:33,代码来源:DobaLog.php
示例6: createNew
function createNew($package_code = '', $package_type = null)
{
$counter = 0;
if ($package_code == '') {
$counter++;
$prefix = !is_null($package_type) ? 'JG' : 'RET';
$dateprefix = date('ymd');
$package_code = $prefix . '-' . $dateprefix . '-' . $counter;
}
$check_code_exist = tep_db_query("SELECT packages_id FROM minierp_packages WHERE packages_code='{$package_code}'");
while (tep_db_num_rows($check_code_exist) > 0) {
if ($counter > 0) {
$old_counter = $dateprefix . '-' . $counter;
$counter++;
$new_counter = $dateprefix . '-' . $counter;
$package_code = str_replace($old_counter, $new_counter, $package_code);
} else {
$package_code .= '-New';
}
$check_code_exist = tep_db_query("SELECT packages_id FROM minierp_packages WHERE packages_code='{$package_code}'");
}
$psda = array();
//$psda['logistic_partners'] = 'SPN';
$psda['packages_code'] = $package_code;
if (!is_null($package_type)) {
$psda['package_type'] = $package_type;
}
tep_db_perform('minierp_packages', $psda);
$new_id = tep_db_insert_id();
return $new_id;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:minierp_packages.php
示例7: create
function create($name, $type, $code, $is_active, $pic, $address_street, $address_postcode, $address_city, $address_country_id)
{
$sql_data_array = array('name' => $name, 'warehouse_type' => $type, 'warehouse_code' => $code, 'is_active' => $is_active, 'pic' => $pic, 'address_street' => $address_street, 'address_postcode' => $address_postcode, 'address_city' => $address_city, 'address_country_id' => $address_country_id);
tep_db_perform('jng_warehouses', $sql_data_array);
$jng_warehouses_id = tep_db_insert_id();
return $jng_warehouses_id;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:7,代码来源:jng_warehouses.php
示例8: createNewCategoryTop
/**
* Create a new category top
* @param String $name Name of new category top
* @param Boolean $is_using_size True if category is using size instead of length
* @return Int ID of new category top or 0 if insert failed
*/
public static function createNewCategoryTop($name, $is_using_size)
{
$sda = array();
$sda[self::COLNAME_NAME] = $name;
$sda[self::COLNAME_SIZE] = $is_using_size ? '1' : '0';
tep_db_perform(self::TABLENAME, $sda);
return tep_db_insert_id();
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:14,代码来源:CategoryTop.php
示例9: add
function add($products_id, $price, $price_old, $options, $prepared = false)
{
if (!$prepared) {
$products_id = tep_db_prepare_input($products_id);
$price = tep_db_prepare_input($price);
foreach ($options as $key => $value) {
$options[$key] = tep_db_prepare_input($value);
}
}
//$get_vs = tep_db_query("SELECT virtual_stock FROM jng_sp_catalog WHERE jng_sp_catalog_id=$jng_sp_catalog_id");
//$vs = tep_db_fetch_array($get_vs);
/*
$sda = array( 'jng_sp_catalog_id'=>$jng_sp_catalog_id,
'sp_extra_id'=>'3',
'sp_extra_name'=>'Länge',
'sp_extra_value'=>$new_length,
'sp_extra_price'=>$new_length_price,
'virtual_stock'=>$vs['virtual_stock']
);
tep_db_perform('jng_sp_catalog_extra', $sda);
*/
//check if any existing options exist - start
$check_filter = " WHERE products_id={$products_id}";
foreach ($options as $key => $value) {
$check_filter .= " AND {$key}='{$value}'";
}
$check_query = tep_db_query("SELECT products_articles_id FROM products_articles {$check_filter}");
if (tep_db_num_rows($check_query) == 0) {
$update = true;
//check if same with default length
if (array_key_exists('length', $options)) {
$cq = "SELECT IFNULL(pc.products_length, pnc.products_length) AS products_length FROM products p";
$cq .= " LEFT JOIN products_configurator pc ON pc.products_id=p.products_id";
$cq .= " LEFT JOIN products_non_configurator pnc ON pnc.products_id=p.products_id";
$cq .= " WHERE p.products_id={$products_id}";
$cr = tep_db_query($cq);
$cd = tep_db_fetch_array($cr);
if ($cd['products_length'] == $options['length']) {
$update = false;
}
}
} else {
$update = false;
}
if ($update) {
$sda = array('products_id' => $products_id, 'price' => $price, 'price_old' => $price_old);
foreach ($options as $key => $value) {
$sda[$key] = $value;
}
tep_db_perform('products_articles', $sda);
$products_articles_id = tep_db_insert_id();
} else {
$products_articles_id = '0';
}
return $products_articles_id;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:56,代码来源:products_articles.php
示例10: addExtraDesignImage
function addExtraDesignImage($design_id, $design_image, $createby)
{
$sda = array();
$sda['project_id'] = $design_id;
$sda['project_image'] = $design_image;
$sda['create_by'] = $createby;
$sda['create_date'] = date('Y-m-d H:i:s');
tep_db_perform('projectplan_images', $sda);
$newid = tep_db_insert_id();
return $newid;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:11,代码来源:project_plan_newdesign.php
示例11: create
function create($bundle_name, $bundle_desc)
{
$result = null;
$bundle_id = $this->id;
if (is_null($bundle_id)) {
$this->detail['bundle_name'] = $bundle_name;
$this->detail['bundle_desc'] = $bundle_desc;
tep_db_perform('products_bundle', $this->detail);
$this->id = tep_db_insert_id();
}
return $result;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:12,代码来源:products_bundle.php
示例12: addDownload
function addDownload($jng_sp_id, $type, $filename, $process_status, $download_by = 'auto-download', $info = '')
{
$dsda = array();
$dsda['jng_sp_id'] = $jng_sp_id;
$dsda['type'] = $type;
$dsda['filename'] = $filename;
$dsda['process_status'] = $process_status;
$dsda['download_time'] = date('Y-m-d H:i:s');
$dsda['download_by'] = $download_by;
$dsda['info'] = $info;
tep_db_perform('jng_sp_download', $dsda);
return tep_db_insert_id();
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:13,代码来源:jng_sp_download.php
示例13: addNewDescription
function addNewDescription($design_id, $design_description, $updateby, $reminder)
{
$sdo = array();
$sdo['reminder'] = $reminder;
$result = tep_db_perform('projectplan_newdesign', $sdo, 'update', "project_id={$design_id}");
$sda = array();
$sda['project_id'] = $design_id;
$sda['project_description'] = $design_description;
$sda['last_update_by'] = $updateby;
$sda['last_update_time'] = date('Y-m-d H:i:s');
tep_db_perform('projectplan_description', $sda);
$newid = tep_db_insert_id();
return $newid;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:14,代码来源:project_plan_comment.php
示例14: install_ORP_to_sql
function install_ORP_to_sql($gid = 0)
{
$old_table_name = tep_db_fetch_array(tep_db_query("SHOW TABLES LIKE 'products_options_products'"));
if (tep_not_null($old_table_name)) {
tep_db_query("RENAME TABLE products_options_products TO products_related_products");
}
$insert_relationship_table = "CREATE TABLE IF NOT EXISTS `products_related_products` (\n `pop_id` int(11) NOT NULL auto_increment,\n `pop_products_id_master` int(11) NOT NULL default '0',\n `pop_products_id_slave` int(11) NOT NULL default '0',\n `pop_order_id` smallint(6) NOT NULL default '0',\n PRIMARY KEY (`pop_id`)\n ) CHARACTER SET utf8 COLLATE utf8_unicode_ci;";
tep_db_query($insert_relationship_table);
if (!$gid) {
tep_db_query("INSERT INTO `configuration_group` VALUES ( '', 'Related Products', 'Optional Related Products module', '999', '1' )");
$set_group_id = tep_db_insert_id();
} else {
$set_group_id = $gid;
}
tep_db_query("INSERT INTO `configuration`\n VALUES ('', 'Current Version', 'RELATED_PRODUCTS_VERSION_INSTALLED', '4.0', 'This key is used by the SQL install to automatically update your database during upgrades. It is read only.', " . $set_group_id . ", '0', NULL, now(), NULL , 'tep_version_readonly('),\n ('', 'Display Thumbnail Images', 'RELATED_PRODUCTS_SHOW_THUMBS', 'True', 'Show Product Image', " . $set_group_id . ", '1', NULL, now(), NULL , 'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Display Product Name', 'RELATED_PRODUCTS_SHOW_NAME', 'True', 'Show Product Name', " . $set_group_id . ", 2, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Display Product Model', 'RELATED_PRODUCTS_SHOW_MODEL', 'False', 'Show Product Model', " . $set_group_id . ", 3, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Display Price', 'RELATED_PRODUCTS_SHOW_PRICE', 'True', 'Show Product Price', " . $set_group_id . ", 4, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Display Quantity Available', 'RELATED_PRODUCTS_SHOW_QUANTITY', 'False', 'Show Product Quantity', " . $set_group_id . ", 5, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Display Buy Now Button', 'RELATED_PRODUCTS_SHOW_BUY_NOW', 'False', 'Show Buy Now Button', " . $set_group_id . ", 6, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Split Display Into Rows','RELATED_PRODUCTS_USE_ROWS','False','Set this option to True to display Related Products in multiple rows.'," . $set_group_id . ", 7,NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Define Number of Items Per Row','RELATED_PRODUCTS_PER_ROW','3','Maximum number of items to display per row when Split Display Into Rows is set to True.'," . $set_group_id . ", 8,NULL, now(),NULL,''),\n ('', 'Define Number of Items to Display', 'RELATED_PRODUCTS_MAX_DISP', '0', 'Maximum number of Related Products to display. 0 is unlimited.', " . $set_group_id . ", 9, NULL, now(),NULL,''),\n ('', 'Use Random Display Order', 'RELATED_PRODUCTS_RANDOMIZE', 'False', 'Adds random sort order to products displayed. Recommended if maximum number of products is set.', " . $set_group_id . ", 10, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Admin Display: Maximum Rows', 'RELATED_PRODUCTS_MAX_ROW_LISTS_OPTIONS', '10', 'Sets the maximum number of rows to display per page.', " . $set_group_id . ", 11, NULL, now(),NULL,''),\n ('', 'Admin Display: Drop-Down List Maximum Length', 'RELATED_PRODUCTS_MAX_NAME_LENGTH', '25', 'Sets the maximum length (in characters) of product name displayed in drop-down lists. Enter \\'0\\' to set this option to false.', " . $set_group_id . ", 12, NULL, now(),NULL,''),\n ('', 'Admin Display: Display List Maximum Length', 'RELATED_PRODUCTS_MAX_DISPLAY_LENGTH', '0', 'Sets the maximum length (in characters) of product name displayed in list. Enter \\'0\\' to set this option to false.', " . $set_group_id . ", 13, NULL, now(),NULL,''),\n ('', 'Admin Display: Use Product Model', 'RELATED_PRODUCTS_ADMIN_USE_MODEL', 'False', 'Uses Product Model in lists. When Product Name is also selected, Product Model is displayed first.', " . $set_group_id . ", 14, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Admin Display: Use Product Name', 'RELATED_PRODUCTS_ADMIN_USE_NAME', 'True', 'Uses Product Name in lists. When Product Model is also selected, Product Model is displayed first.', " . $set_group_id . ", 15, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Admin Display: Combine Model and Name separator', 'RELATED_PRODUCTS_ADMIN_MODEL_SEPARATOR', ': ', 'Enter the characters you would like to separate Model from Name, when using both. Leave empty if only using Model.', " . $set_group_id . ", 16, NULL, now(),NULL,''),\n ('', 'Admin Function: Use Delete Confirmation', 'RELATED_PRODUCTS_CONFIRM_DELETE', 'True', 'When set to True, a confirmation box will pop-up when deleting an association. Set to False to Delete without confirmation.', " . $set_group_id . ", 17, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),'),\n ('', 'Admin Function: Combine Insert with Inherit', 'RELATED_PRODUCTS_INSERT_AND_INHERIT', 'True', 'When set to True, clicking on Inherit will also Insert the product association. When False, Inherit works as before.', " . $set_group_id . ", 18, NULL, now(),NULL,'tep_cfg_select_option(array(\\'True\\', \\'False\\'),')\n ");
}
开发者ID:templatemonster,项目名称:oscommerce,代码行数:16,代码来源:sql_setup_related_products.php
示例15: create
function create($s_name, $s_address, $s_contact, $s_phone, $s_outsourced = null, $s_scheduled = null, $safety_delivery_time = '0')
{
$s_outsourced = $s_outsourced == '1' ? '1' : '0';
$s_scheduled = $s_scheduled == '1' ? '1' : '0';
$sda = array();
$sda['suppliers_name'] = $s_name;
$sda['suppliers_address'] = $s_address;
$sda['suppliers_contact_person'] = $s_contact;
$sda['suppliers_contact_number'] = $s_phone;
$sda['suppliers_outsourced'] = $s_outsourced;
$sda['suppliers_scheduled'] = $s_scheduled;
$sda['safety_delivery_time'] = $safety_delivery_time;
tep_db_perform('elements_suppliers', $sda);
$this->id = tep_db_insert_id();
$this->setDetail($s_name, $s_address, $s_contact, $s_phone, $s_outsourced, $s_scheduled, $safety_delivery_time);
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:16,代码来源:elements_suppliers.php
示例16: add
function add($user_id, $name, $prior, $status, $createby, $eta = null)
{
$sda = array();
$sda['user_id'] = $user_id;
$sda['name'] = $name;
$sda['priority'] = $prior;
if (!is_null($eta)) {
$sda['estimated_time'] = $eta;
}
$sda['status'] = $status;
$sda['create_by'] = $createby;
$sda['create_date'] = date('Y-m-d H:i:s');
tep_db_perform('minierp_todos', $sda);
$newid = tep_db_insert_id();
return $newid;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:16,代码来源:minierp_todos.php
示例17: create_temp_customer
function create_temp_customer($customer_info)
{
global $customer_id, $customer_first_name, $customer_default_address_id, $customer_country_id, $customer_zone_id, $billto, $sendto;
$query = tep_db_query("SELECT c.customers_id as customer_id, c.customers_firstname, c.customers_default_address_id as customer_default_address_id, ab.entry_country_id as customer_country_id, ab.entry_zone_id as customer_zone_id FROM " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab WHERE c.customers_id = ab.customers_id AND c.customers_default_address_id = ab.address_book_id AND c.customers_email_address = '" . $customer_info['EMAIL'] . "'");
if (tep_db_num_rows($query) > 0) {
$data = tep_db_fetch_array($query);
$customer_id = $data['customer_id'];
$customer_first_name = $data['customer_first_name'];
$customer_default_address_id = $data['customer_default_address_id'];
$customer_country_id = $data['customer_country_id'];
$customer_zone_id = $data['customer_zone_id'];
} else {
$_SESSION['temp_password'] = tep_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
$sql_data_array = array('customers_firstname' => $customer_info['FIRSTNAME'], 'customers_lastname' => $customer_info['LASTNAME'], 'customers_email_address' => $customer_info['EMAIL'], 'customers_validation' => '1', 'customers_password' => tep_encrypt_password($_SESSION['temp_password']));
tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
$customer_id = tep_db_insert_id();
$sql_query = tep_db_query("SELECT countries_id FROM " . TABLE_COUNTRIES . " WHERE countries_iso_code_2 = '" . $customer_info['SHIPTOCOUNTRYCODE'] . "'");
if (tep_db_num_rows($sql_query) == 0) {
$sql_query = tep_db_query("SELECT countries_id FROM " . TABLE_COUNTRIES . " WHERE countries_iso_code_2 = '" . $customer_info['COUNTRYCODE'] . "'");
}
$country = tep_db_fetch_array($sql_query);
$customer_country_id = $country['countries_id'];
$zone = tep_db_fetch_array(tep_db_query("SELECT zone_id FROM " . TABLE_ZONES . " WHERE zone_country_id = '" . $country['countries_id'] . "' AND zone_code = '" . $customer_info['SHIPTOSTATE'] . "'"));
if (tep_not_null($zone['zone_id'])) {
$customer_zone_id = $zone['zone_id'];
$state = '';
} else {
$customer_zone_id = '0';
$state = $customer_info['SHIPTOSTATE'];
}
$customer_first_name = $customer_info['FIRSTNAME'];
$customer_last_name = $customer_info['LASTNAME'];
$sql_data_array = array('customers_id' => $customer_id, 'entry_firstname' => $customer_first_name, 'entry_lastname' => $customer_last_name, 'entry_telephone' => $customer_info['PHONENUM'], 'entry_street_address' => $customer_info['SHIPTOSTREET'], 'entry_postcode' => $customer_info['SHIPTOZIP'], 'entry_city' => $customer_info['SHIPTOCITY'], 'entry_country_id' => $customer_country_id, 'entry_zone_id' => $customer_zone_id, 'entry_state' => $state);
tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
$customer_default_address_id = tep_db_insert_id();
$billto = $customer_default_address_id;
$sendto = $customer_default_address_id;
tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int) $customer_default_address_id . "' where customers_id = '" . (int) $customer_id . "'");
tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int) $customer_id . "', '0', now())");
$_SESSION['paypalxc_create_account'] = '1';
}
$_SESSION['customer_id'] = $customer_id;
$_SESSION['customer_first_name'] = $customer_first_name;
$_SESSION['customer_default_address_id'] = $customer_default_address_id;
$_SESSION['customer_country_id'] = $customer_country_id;
$_SESSION['customer_zone_id'] = $customer_zone_id;
}
开发者ID:resultsonlyweb,项目名称:loaded6-template,代码行数:47,代码来源:paypalxc_applicationtop_bottom.php
示例18: createNewUser
/**
* Create a new Manobo user
* @param String $username Username to be used for login
* @param String $password Password to be used for login
* @param String $email User's email address
* @param Int $active_status Use active status, 0=inactive / 1=active
* @param String $skype_id User's Skype ID
* @return Int return new id or 0 if failed because username already exist
*/
function createNewUser($username, $password, $email, $active_status, $skype_id)
{
$users = $this->retrieveList("username='{$username}'");
if (count($users) > 0) {
//username already exist
$result = 0;
} else {
$data = array();
$data['username'] = $username;
$data['password'] = md5($password);
$data['email'] = $email;
$data['status'] = $active_status;
$data['skype_id'] = $skype_id;
$data['show_todo'] = '0';
tep_db_perform('minierp_users', $data);
$result = tep_db_insert_id();
}
return $result;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:28,代码来源:minierp_users.php
示例19: create
function create($user_id, $team, $posted_by, $posted_date, $message)
{
global $obj_notifications;
$sda = array();
$sda['user_id'] = $user_id;
$sda['department'] = $team;
$sda['posted_by'] = $posted_by;
$sda['posted_date'] = $posted_date;
$sda['message'] = $message;
tep_db_perform('walls', $sda);
$this->id = tep_db_insert_id();
$this->getDetail();
if ($this->user_id > 0) {
$notification_targets = array();
$notification_targets[] = $this->user_id;
$notification_message = $obj_notifications->messageTemplateWallPost($this->user_name, $this->excerpt, 'your');
$obj_notifications->broadcast($notification_targets, $notification_message, $this->posted_by_name, 'open=wall&id=' . $this->id);
}
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:19,代码来源:wall_post.php
示例20: add
function add($process, $process_time, $process_method, $process_data_submit, $process_data_result = null)
{
if (is_array($process_data_submit)) {
$process_data_submit = serialize($process_data_submit);
}
if (is_array($process_data_result)) {
$process_data_result = serialize($process_data_result);
}
if (is_null($process_data_result)) {
$process_data_result = 'null';
}
$sda = array();
$sda['log_process'] = $process;
$sda['log_process_time'] = $process_time;
$sda['log_process_method'] = $process_method;
$sda['log_process_data_submit'] = $process_data_submit;
$sda['log_process_data_result'] = $process_data_result;
tep_db_perform('payone_log', $sda);
$log_id = tep_db_insert_id();
return $log_id;
}
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:21,代码来源:payone_logger.php
注:本文中的tep_db_insert_id函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论