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


PHP olc_db_perform函数代码示例

本文整理汇总了PHP中olc_db_perform函数的典型用法代码示例。如果您正苦于以下问题:PHP olc_db_perform函数的具体用法?PHP olc_db_perform怎么用?PHP olc_db_perform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: affiliate_insert

function affiliate_insert($sql_data_array, $affiliate_parent = 0)
{
    // LOCK TABLES
    //   olc_db_query("LOCK TABLES " . TABLE_AFFILIATE . " WRITE");
    if ($affiliate_parent > 0) {
        $affiliate_root_query = olc_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 = olc_db_fetch_array($affiliate_root_query)) {
            olc_db_query(SQL_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'] . BLANK);
            olc_db_query(SQL_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;
            olc_db_perform(TABLE_AFFILIATE, $sql_data_array);
            $affiliate_id = olc_db_insert_id();
        }
        // no parent -> new root
    } else {
        $sql_data_array['affiliate_lft'] = '1';
        $sql_data_array['affiliate_rgt'] = '2';
        olc_db_perform(TABLE_AFFILIATE, $sql_data_array);
        $affiliate_id = olc_db_insert_id();
        olc_db_query(SQL_UPDATE . TABLE_AFFILIATE . " set affiliate_root = '" . $affiliate_id . "' where affiliate_id = '" . $affiliate_id . "' ");
    }
    // UNLOCK TABLES
    olc_db_query("UNLOCK TABLES");
    return $affiliate_id;
}
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:28,代码来源:affiliate_insert.inc.php

示例2: olc_update_whos_online

function olc_update_whos_online($url = EMPTY_STRING)
{
    if (ISSET_CUSTOMER_ID) {
        $wo_customer_id = CUSTOMER_ID;
        $customer_query = olc_db_query(SELECT . "customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $_SESSION['customer_id'] . APOS);
        $customer = olc_db_fetch_array($customer_query);
        $wo_full_name = addslashes($customer['customers_firstname'] . BLANK . $customer['customers_lastname']);
    } else {
        $wo_full_name = $_SESSION['customers_status']['customers_status_name'];
        $wo_customer_id = 0;
    }
    $wo_session_id = olc_session_id();
    //$wo_ip_address = getenv('REMOTE_ADDR');
    olc_get_ip_info(&$smarty);
    $wo_ip_address = $_SESSION['CUSTOMERS_IP'];
    $pos = strpos($wo_ip_address, RPAREN);
    if ($pos !== false) {
        $wo_ip_address = substr($wo_ip_address, 0, $pos + 1);
    }
    if (!$url) {
        $url = addslashes(getenv('REQUEST_URI'));
    }
    $wo_last_page_url = str_replace(DIR_WS_CATALOG, EMPTY_STRING, $url);
    $pos = strpos($wo_last_page_url, 'start_debug');
    //Eliminate debugger parameters
    if ($pos === false) {
        $pos = strpos($wo_last_page_url, 'DBGSESSION');
        //Eliminate debugger parameters
    }
    if ($pos !== false) {
        $wo_last_page_url = substr($wo_last_page_url, 0, $pos - 1);
    }
    if (USE_AJAX) {
        $pos = strpos($wo_last_page_url, AJAX_ID);
        if ($pos !== false) {
            $wo_last_page_url = substr($wo_last_page_url, 0, $pos - 1) . substr($wo_last_page_url, $pos + strlen(AJAX_ID));
        }
    }
    $current_time = time();
    //Do garbage collection in session db
    _sess_gc(EMPTY_STRING);
    //Delete all from "whos_online" without a session entry
    //olc_db_query(DELETE_FROM . TABLE_WHOS_ONLINE. ' WHERE session_id NOT IN (SELECT sesskey FROM '.TABLE_SESSIONS.RPAREN);
    $sesskey = TABLE_SESSIONS . '.sesskey';
    olc_db_query('DELETE ' . TABLE_WHOS_ONLINE . '  FROM ' . TABLE_WHOS_ONLINE . COMMA_BLANK . TABLE_SESSIONS . ' WHERE ' . TABLE_WHOS_ONLINE . '.session_id = ' . $sesskey . ' AND ' . $sesskey . ' IS NULL');
    $sql_data = array('customer_id' => $wo_customer_id, 'full_name' => $wo_full_name, 'session_id' => $wo_session_id, 'time_last_click' => $current_time, 'last_page_url' => $wo_last_page_url);
    $sql_where = "session_id = '" . $wo_session_id . APOS;
    $stored_customer_query = olc_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where " . $sql_where);
    $stored_customer = olc_db_fetch_array($stored_customer_query);
    if ($stored_customer['count'] > 0) {
        $sql_action = 'update';
    } else {
        $sql_data = array_merge($sql_data, array('ip_address' => $wo_ip_address, 'time_entry' => $current_time));
        $sql_action = 'insert';
        $sql_where = EMPTY_STRING;
    }
    olc_db_perform(TABLE_WHOS_ONLINE, $sql_data, $sql_action, $sql_where);
}
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:58,代码来源:448.php

示例3: olc_get_languages

     $languages = olc_get_languages();
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $products_vpe_name_array = $_POST['products_vpe_name'];
         $language_id = $languages[$i]['id'];
         $sql_data_array = array('products_vpe_name' => olc_db_prepare_input($products_vpe_name_array[$language_id]));
         if ($action == 'insert') {
             if (!olc_not_null($products_vpe_id)) {
                 $next_id_query = olc_db_query("select max(products_vpe_id) as products_vpe_id from " . TABLE_PRODUCTS_VPE . "");
                 $next_id = olc_db_fetch_array($next_id_query);
                 $products_vpe_id = $next_id['products_vpe_id'] + 1;
             }
             $insert_sql_data = array('products_vpe_id' => $products_vpe_id, 'language_id' => $language_id);
             $sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);
             olc_db_perform(TABLE_PRODUCTS_VPE, $sql_data_array);
         } elseif ($action == 'save') {
             olc_db_perform(TABLE_PRODUCTS_VPE, $sql_data_array, 'update', "products_vpe_id = '" . $products_vpe_id . "' and language_id = '" . $language_id . APOS);
         }
     }
     if ($_POST['default'] == 'on') {
         olc_db_query(SQL_UPDATE . str_replace(HASH, $oID, $table_configuration));
         $default_products_vpe_id = $products_vpe_id;
     }
     //olc_redirect(olc_href_link(FILENAME_PRODUCTS_VPE, 'page=' . $_GET['page'] . '&oID=' . $products_vpe_id));
     break;
 case 'deleteconfirm':
     olc_db_query(DELETE_FROM . TABLE_PRODUCTS_VPE . " where products_vpe_id = '" . $oID . APOS);
     if ($default_products_vpe_id == $oID) {
         olc_db_query(SQL_UPDATE . str_replace(HASH, EMPTY_STRING, $table_configuration));
     }
     //olc_redirect(olc_href_link(FILENAME_PRODUCTS_VPE, 'page=' . $_GET['page']));
     break;
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:products_vpe.php

示例4: switch

//require(DIR_FS_CATALOG . DIR_WS_LANGUAGES . SESSION_LANGUAGE . '/admin/blacklist.php');
switch ($_GET['action']) {
    case 'insert':
    case 'save':
        $blacklist_id = olc_db_prepare_input($_GET['bID']);
        $blacklist_card_number = olc_db_prepare_input($_POST['blacklist_card_number']);
        $sql_data_array = array('blacklist_card_number' => $blacklist_card_number);
        if ($_GET['action'] == 'insert') {
            $insert_sql_data = array('date_added' => 'now()');
            $sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);
            olc_db_perform(TABLE_BLACKLIST, $sql_data_array);
            $blacklist_id = olc_db_insert_id();
        } elseif ($_GET['action'] == 'save') {
            $update_sql_data = array('last_modified' => 'now()');
            $sql_data_array = olc_array_merge($sql_data_array, $update_sql_data);
            olc_db_perform(TABLE_BLACKLIST, $sql_data_array, 'update', "blacklist_id = '" . olc_db_input($blacklist_id) . APOS);
        }
        /*      $manufacturers_image = olc_get_uploaded_file('manufacturers_image');
              $image_directory = olc_get_local_path(DIR_FS_CATALOG_IMAGES);
        
              if (is_uploaded_file($manufacturers_image['tmp_name'])) {
                if (!is_writeable($image_directory)) {
                  if (is_dir($image_directory)) {
                    $messageStack->add_session(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $image_directory), 'error');
                  } else {
                    $messageStack->add_session(sprintf(ERROR_DIRECTORY_DOES_NOT_EXIST, $image_directory), 'error');
                  }
                } else {
                  olc_db_query(SQL_UPDATE . TABLE_MANUFACTURERS . " set manufacturers_image = '" . $manufacturers_image['name'] . "' where manufacturers_id = '" . olc_db_input($manufacturers_id) . APOS);
                  olc_copy_uploaded_file($manufacturers_image, $image_directory);
                }
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:blacklist.php

示例5: olc_db_query

                // check if cusomer want newsletter
                $select_all = $status_all == 'yes';
                if ($select_all) {
                    $customers_query = olc_db_query($select . " FROM " . TABLE_CUSTOMERS . $where);
                } else {
                    $customers_query = olc_db_query($select . ",mail_key\n                                  FROM " . TABLE_NEWSLETTER_RECIPIENTS . $where . " and mail_status='1'");
                }
                $table = TABLE_MODULE_NEWSLETTER_TEMP . $id_post;
                $group = $groups[$i];
                while ($customers_data = olc_db_fetch_array($customers_query)) {
                    $email = $customers_data['customers_email_address'];
                    if ($select_all) {
                        $customers_data['mail_key'] = olc_encrypt_password($email);
                    }
                    $sql_data_array = array('customers_id' => $customers_data['customers_id'], 'customers_status' => $group, 'customers_firstname' => $customers_data['customers_firstname'], 'customers_lastname' => $customers_data['customers_lastname'], 'customers_email_address' => $email, 'customers_email_type' => $customers_data['customers_email_type'], 'mail_key' => $customers_data['mail_key'], 'date' => 'now()');
                    olc_db_perform($table, $sql_data_array);
                }
            }
            olc_redirect(olc_href_link(FILENAME_MODULE_NEWSLETTER));
        }
        break;
    case 'delete':
        olc_db_query(DELETE_FROM . TABLE_MODULE_NEWSLETTER . " WHERE newsletter_id='" . $id_get . APOS);
        olc_redirect(olc_href_link(FILENAME_MODULE_NEWSLETTER));
        break;
    case 'send':
        // max email package  -> should be in admin area!
        olc_redirect(olc_href_link(FILENAME_MODULE_NEWSLETTER, 'send=0,' . EMAIL_NEWSLETTER_PACAKGE_SIZE . '&id=' . $id_get));
}
// action for sending mails!
if ($_GET['send']) {
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:module_newsletter.php

示例6: array

                $sql_data_marray[$i] = array('coupon_name' => olc_db_prepare_input($_POST['coupon_name'][$language_id]), 'coupon_description' => olc_db_prepare_input($_POST['coupon_desc'][$language_id]));
            }
            if ($_GET['oldaction'] == 'voucheredit') {
                olc_db_perform(TABLE_COUPONS, $sql_data_array, 'update', "coupon_id='" . $_GET['cid'] . APOS);
                for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                    $language_id = $languages[$i]['id'];
                    $update = olc_db_query(SQL_UPDATE . TABLE_COUPONS_DESCRIPTION . " set coupon_name = '" . olc_db_prepare_input($_POST['coupon_name'][$language_id]) . "', coupon_description = '" . olc_db_prepare_input($_POST['coupon_desc'][$language_id]) . "' where coupon_id = '" . $_GET['cid'] . "' and language_id = '" . $language_id . APOS);
                }
            } else {
                $query = olc_db_perform(TABLE_COUPONS, $sql_data_array);
                $insert_id = olc_db_insert_id($query);
                for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                    $language_id = $languages[$i]['id'];
                    $sql_data_marray[$i]['coupon_id'] = $insert_id;
                    $sql_data_marray[$i]['language_id'] = $language_id;
                    olc_db_perform(TABLE_COUPONS_DESCRIPTION, $sql_data_marray[$i]);
                }
            }
        }
}
require DIR_WS_INCLUDES . 'header.php';
/*
if (USE_AJAX_ADMIN)
{
	$document_write=FALSE_STRING_S;
}
else
{
	$document_write=TRUE_STRING_S;
	echo '
<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:coupon_admin.php

示例7: olc_not_null

 if (empty($html_text)) {
     if (!($banners_image = new upload('banners_image', DIR_FS_CATALOG_IMAGES . 'banner/' . $banners_image_target))) {
         $banner_error = true;
     }
 }
 if (!$banner_error) {
     $db_image_location = olc_not_null($banners_image_local) ? $banners_image_local : $banners_image_target . $banners_image->filename;
     $sql_data_array = array('banners_title' => $banners_title, 'banners_url' => $banners_url, 'banners_image' => $db_image_location, 'banners_group' => $banners_group, 'banners_html_text' => $html_text);
     if ($action == 'insert') {
         $insert_sql_data = array('date_added' => 'now()', 'status' => '1');
         $sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);
         olc_db_perform(TABLE_BANNERS, $sql_data_array);
         $banners_id = olc_db_insert_id();
         $messageStack->add_session(SUCCESS_BANNER_INSERTED, 'success');
     } elseif ($action == 'update') {
         olc_db_perform(TABLE_BANNERS, $sql_data_array, 'update', 'banners_id = \'' . $banners_id . '\'');
         $messageStack->add_session(SUCCESS_BANNER_UPDATED, 'success');
     }
     $expires_date = olc_db_prepare_input($_POST['expires_date']);
     if ($expires_date) {
         list($day, $month, $year) = explode('.', $expires_date);
         $expires_date = $year . (strlen($month) == 1 ? '0' . $month : $month) . (strlen($day) == 1 ? '0' . $day : $day);
         $sql_update = " set expires_date = '" . $expires_date . "', expires_impressions = null";
     } else {
         $impressions = olc_db_prepare_input($_POST['impressions']);
         if ($impressions) {
             $sql_update = " set expires_impressions = '" . $impressions . "', expires_date = null";
         }
     }
     $date_scheduled = olc_db_prepare_input($_POST['date_scheduled']);
     if ($date_scheduled) {
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:banner_manager.php

示例8: olc_db_query

if ($_GET['action'] == "product_option_delete") {
    olc_db_query(DELETE_FROM . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . olc_db_input($_POST['oID']) . "' and orders_products_attributes_id = '" . olc_db_input($_POST['opAID']) . APOS);
    $products_query = olc_db_query("select products_id, products_price, products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = '" . $_POST['pID'] . APOS);
    $products = olc_db_fetch_array($products_query);
    $products_a_query = olc_db_query("select options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . $_POST['oID'] . "' and orders_products_id = '" . $_POST['opID'] . APOS);
    while ($products_a = olc_db_fetch_array($products_a_query)) {
        $total_price += $products_a['price_prefix'] . $products_a['options_values_price'];
    }
    $sa_price = olc_oe_get_products_attribute_price($total_price, $products['products_tax_class_id'], $price_special = '0', 1, $_POST['prefix'], $calculate_currencies = TRUE_STRING_S, $customers_status);
    $sp_price = olc_oe_products_price($_POST['pID'], $price_special = '0', 1, $customers_status);
    $inp_price = $sa_price + $sp_price;
    $final_price = $inp_price * $_POST['qTY'];
    $sql_data_array = array('products_price' => olc_db_prepare_input($inp_price));
    $update_sql_data = array('final_price' => olc_db_prepare_input($final_price));
    $sql_data_array = olc_array_merge($sql_data_array, $update_sql_data);
    olc_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array, 'update', 'orders_products_id = \'' . olc_db_input($_POST['opID']) . '\'');
    olc_redirect(olc_href_link(FILENAME_ORDERS_EDIT, 'edit_action=products&cID=' . $_POST['cID'] . '&oID=' . $_POST['oID']));
}
if ($_GET['action'] == "shipping_del") {
    olc_db_query(DELETE_FROM . TABLE_ORDERS_TOTAL . " where orders_total_id = '" . olc_db_input($_POST['otID']) . APOS);
    olc_redirect(olc_href_link(FILENAME_ORDERS_EDIT, 'edit_action=shipping&cID=' . $_POST['cID'] . '&oID=' . $_POST['oID']));
}
if ($_GET['action'] == "cod_del") {
    olc_db_query(DELETE_FROM . TABLE_ORDERS_TOTAL . " where orders_total_id = '" . olc_db_input($_POST['otID']) . APOS);
    olc_redirect(olc_href_link(FILENAME_ORDERS_EDIT, 'edit_action=shipping&cID=' . $_POST['cID'] . '&oID=' . $_POST['oID']));
}
// Löschfunktionen Ende
require DIR_WS_INCLUDES . 'header.php';
?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:orders_edit.php

示例9: Project

   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
   (c) 2002-2003 osCommercecoding standards www.oscommerce.com
   (c) 2004      XT - Commerce; www.xt-commerce.com

    Released under the GNU General Public License
   --------------------------------------------------------------*/
require 'includes/application_top.php';
include DIR_FS_LANGUAGES . SESSION_LANGUAGE . '/admin/customers.php';
if ($_GET['action']) {
    switch ($_GET['action']) {
        case 'save':
            $memo_title = olc_db_prepare_input($_POST['memo_title']);
            $memo_text = olc_db_prepare_input($_POST['memo_text']);
            if ($memo_text != '' && $memo_title != '') {
                $sql_data_array = array('customers_id' => $_POST['id'], 'memo_date' => date("Y-m-d"), 'memo_title' => $memo_title, 'memo_text' => nl2br($memo_text), 'poster_id' => $_SESSION['customer_id']);
                olc_db_perform(TABLE_CUSTOMERS_MEMO, $sql_data_array);
            }
            break;
        case 'remove':
            olc_db_query(DELETE_FROM . TABLE_CUSTOMERS_MEMO . " WHERE memo_id = '" . $_GET['mID'] . APOS);
            break;
    }
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php 
echo HTML_PARAMS;
?>
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:popup_memo.php

示例10: olc_get_languages

     $languages = olc_get_languages();
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $shipping_status_name_array = $_POST['shipping_status_name'];
         $language_id = $languages[$i]['id'];
         $sql_data_array = array('shipping_status_name' => olc_db_prepare_input($shipping_status_name_array[$language_id]));
         if ($_GET['action'] == 'insert') {
             if (!olc_not_null($shipping_status_id)) {
                 $next_id_query = olc_db_query("select max(shipping_status_id) as shipping_status_id from " . TABLE_SHIPPING_STATUS . "");
                 $next_id = olc_db_fetch_array($next_id_query);
                 $shipping_status_id = $next_id['shipping_status_id'] + 1;
             }
             $insert_sql_data = array('shipping_status_id' => $shipping_status_id, 'language_id' => $language_id);
             $sql_data_array = olc_array_merge($sql_data_array, $insert_sql_data);
             olc_db_perform(TABLE_SHIPPING_STATUS, $sql_data_array);
         } elseif ($_GET['action'] == 'save') {
             olc_db_perform(TABLE_SHIPPING_STATUS, $sql_data_array, 'update', "shipping_status_id = '" . olc_db_input($shipping_status_id) . "' and language_id = '" . $language_id . APOS);
         }
     }
     if ($shipping_status_image = new upload('shipping_status_image', DIR_WS_ICONS)) {
         olc_db_query(SQL_UPDATE . TABLE_SHIPPING_STATUS . " set shipping_status_image = '" . $shipping_status_image->filename . "' where shipping_status_id = '" . olc_db_input($shipping_status_id) . APOS);
     }
     if ($_POST['default'] == 'on') {
         olc_db_query(SQL_UPDATE . TABLE_CONFIGURATION . " set configuration_value = '" . olc_db_input($shipping_status_id) . "' where configuration_key = 'DEFAULT_SHIPPING_STATUS_ID'");
     }
     olc_redirect(olc_href_link(FILENAME_SHIPPING_STATUS, 'page=' . $_GET['page'] . '&oID=' . $shipping_status_id));
     break;
 case 'deleteconfirm':
     $oID = olc_db_prepare_input($_GET['oID']);
     $shipping_status_query = olc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_SHIPPING_STATUS_ID'");
     $shipping_status = olc_db_fetch_array($shipping_status_query);
     if ($shipping_status['configuration_value'] == $oID) {
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:shipping_status.php

示例11: olc_connect_and_get_config

function olc_connect_and_get_config($configuration_groups, $admin_path_prefix)
{
    global $connected;
    if (!$connected) {
        global $prefix_only;
        // include the list of project database tables
        require $admin_path_prefix . DIR_WS_INCLUDES . 'database_tables.php';
        require_once DIR_FS_INC . 'olc_db_connect.inc.php';
        require_once DIR_FS_INC . 'olc_db_error.inc.php';
        require_once DIR_FS_INC . 'olc_db_fetch_array.inc.php';
        require_once DIR_FS_INC . 'olc_db_input.inc.php';
        require_once DIR_FS_INC . 'olc_db_insert_id.inc.php';
        require_once DIR_FS_INC . 'olc_db_data_seek.inc.php';
        require_once DIR_FS_INC . 'olc_db_num_rows.inc.php';
        require_once DIR_FS_INC . 'olc_db_query.inc.php';
        require_once DIR_FS_INC . 'olc_db_close.inc.php';
        require_once DIR_FS_INC . 'olc_db_prepare_input.inc.php';
        require_once DIR_FS_INC . 'olc_db_perform.inc.php';
        require_once DIR_FS_INC . 'olc_db_free_result.inc.php';
        require_once DIR_FS_INC . 'olc_db_close.inc.php';
        require_once DIR_FS_INC . 'olc_db_output.inc.php';
        require_once DIR_FS_INC . 'olc_db_input.inc.php';
        require_once DIR_FS_INC . 'olc_db_prepare_input.inc.php';
        require_once DIR_FS_INC . 'olc_not_null.inc.php';
        include_once DIR_FS_INC . 'olc_error_handler.inc.php';
        // make a connection to the database
        //Multiple DB-servers are not supported (yet!), only multiple DBs on the same server
        //define('MULTI_DB_SERVER',defined('DB_SERVER_1'));
        define('MULTI_DB_SERVER', false);
        $db_connect_error = 'Kann keine Verbindung zur Datenbank "%s" herstellen!/Can not connect to database "%s"!';
        if (MULTI_DB_SERVER) {
            include_once DIR_FS_INC . 'olc_db_get_db_link.inc.php';
            ${$link_1} = olc_db_connect(DB_SERVER_1, DB_SERVER_USERNAME_1, DB_SERVER_PASSWORD_1, DB_DATABASE_1, 'db_link_1') or die(sprintf($db_connect_error, DB_DATABASE_1, DB_DATABASE_1));
        }
        olc_db_connect() or die(sprintf($db_connect_error, DB_DATABASE, DB_DATABASE));
    }
    global $current_template_text, $current_template_db;
    // set the application parameters
    $where = EMPTY_STRING;
    for ($i = 0, $n = sizeof($configuration_groups); $i < $n; $i++) {
        if ($i > 0) {
            $where .= SQL_OR;
        }
        $where .= 'configuration_group_id=' . $configuration_groups[$i];
    }
    if ($n > 0) {
        $where = SQL_WHERE . $where;
    }
    $configuration_text = 'configuration';
    $configuration_u_text = $configuration_text . UNDERSCORE;
    $configuration_value_text = $configuration_u_text . 'value';
    $configuration_key_text = $configuration_u_text . 'key';
    $select = SELECT . $configuration_key_text . COMMA_BLANK;
    $table = TABLE_PREFIX_INDIVIDUAL . $configuration_text;
    $from = SQL_FROM . $table;
    $configuration_query = olc_db_query($select . $configuration_value_text . $from . $where);
    while ($configuration = olc_db_fetch_array($configuration_query)) {
        $s = $configuration[$configuration_key_text];
        $s1 = $configuration[$configuration_value_text];
        if ($s != $current_template_text) {
            define($s, $s1);
        } else {
            $current_template_db = $s1;
        }
    }
    $key = 'olc_CONVERSION_DONE';
    if (!defined($key)) {
        //Adjust "use"- and "set"-function-names form "olc_..." to "olc_"...
        $use_function_text = 'use_function';
        $set_function_text = 'set_function';
        $olc_text = 'olc_';
        $olc_text = 'olc_';
        $configuration_query = olc_db_query($select . $configuration_value_text . COMMA_BLANK . $use_function_text . COMMA_BLANK . $set_function_text . $from . $where);
        while ($configuration = olc_db_fetch_array($configuration_query)) {
            $s = $configuration[$use_function_text];
            $s1 = $configuration[$set_function_text];
            $sql_array = array();
            if ($s) {
                $sql_array[$use_function_text] = str_replace($olc_text, $olc_text, $s);
            }
            if ($s1) {
                $sql_array[$set_function_text] = str_replace($olc_text, $olc_text, $s1);
            }
            if (sizeof($sql_array) > 0) {
                olc_db_perform($table, $sql_array, UPDATE, $configuration_key_text . EQUAL . APOS . $configuration[$configuration_key_text] . APOS);
            }
        }
        $sql_array = array($configuration_key_text => $key, $configuration_value_text => true);
        olc_db_perform($table, $sql_array);
    }
    define('DO_GROUP_CHECK', GROUP_CHECK == TRUE_STRING_S);
    define('DO_IMAGE_ON_THE_FLY', PRODUCT_IMAGE_ON_THE_FLY == TRUE_STRING_S);
    define('CURRENT_SCRIPT', basename($_SERVER['PHP_SELF']));
    define('USE_CACHE', false);
    //Force Smarty cache off (this is a heap of crap!)
}
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:96,代码来源:olc_connect_and_get_config.inc.php

示例12: while

            while (list($name, $value) = each($products)) {
                $sql_data_array[$name] = $value;
            }
            $sql_data_array['customers_basket_id'] = $basket_id;
            olc_db_perform(TABLE_CUSTOMERS_BASKET_SAVE, $sql_data_array);
        }
        //Save cart products attributes
        $product_query = olc_db_query($sql_select . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . $where_cid);
        if (olc_db_num_rows($product_query) > 0) {
            $sql_data_array = array();
            while ($products = olc_db_fetch_array($product_query)) {
                while (list($name, $value) = each($products)) {
                    $sql_data_array[$name] = $value;
                }
                $sql_data_array['customers_basket_id'] = $basket_id;
                olc_db_perform(TABLE_CUSTOMERS_BASKET_ATTRIBUTES_SAVE, $sql_data_array);
            }
        }
        $force_cart_update_only = true;
        unset($_SESSION['checked_saved_carts']);
        $_SESSION[$id_saved_carts_text] = $basket_id;
        $show_form = true;
        $error_message = olc_get_smarty_config_variable($smarty, 'shopping_cart', 'text_saved_cart');
        $error_message = str_replace(HASH, $cart_name, $error_message);
    } else {
        $show_form = true;
        $error_message = olc_get_smarty_config_variable($smarty, 'boxes', 'text_empty_cart');
    }
} else {
    $show_form = true;
}
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:cart_save.php

示例13: array

 $sql_data_array = array('customers_id' => $user_id, 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country, 'address_date_added' => 'now()', 'address_last_modified' => 'now()');
 $sql_data_array['entry_gender'] = $gender;
 $sql_data_array['entry_company'] = $company;
 if (ACCOUNT_SUBURB == 'true') {
     $sql_data_array['entry_suburb'] = $suburb;
 }
 if (ACCOUNT_STATE == 'true') {
     if ($zone_id > 0) {
         $sql_data_array['entry_zone_id'] = $zone_id;
         $sql_data_array['entry_state'] = '';
     } else {
         $sql_data_array['entry_zone_id'] = '0';
         $sql_data_array['entry_state'] = $state;
     }
 }
 olc_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
 $address_id = olc_db_insert_id();
 olc_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . $address_id . "' where customers_id = '" . (int) $user_id . "'");
 olc_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int) $user_id . "', '0', now())");
 // create smarty elements
 $smarty = new Smarty();
 $smarty->assign('GENDER', $gender);
 $smarty->assign('FIRSTNAME', $firstname);
 $smarty->assign('LASTNAME', $lastname);
 $smarty->assign('EMAIL', $email_address);
 $smarty->assign('PASSWORT', $password);
 $smarty->caching = false;
 $txt_mail_customer = $smarty->fetch(DIR_FS_CATALOG . 'kunden_import_mail.txt');
 $mail_subject = "Unser neuer Onlineshop";
 /*
 echo "<pre>\n";
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:import_export_customer.php

示例14: olc_db_perform

            if (ACCOUNT_GENDER == TRUE_STRING_S) {
                $sql_data_array['affiliate_gender'] = $affiliate_gender;
            }
            if (ACCOUNT_COMPANY == TRUE_STRING_S) {
                $sql_data_array['affiliate_company'] = $affiliate_company;
                $sql_data_array['affiliate_company_taxid'] = $affiliate_company_taxid;
            }
            if (ACCOUNT_SUBURB == TRUE_STRING_S) {
                $sql_data_array['affiliate_suburb'] = $affiliate_suburb;
            }
            if (ACCOUNT_STATE == TRUE_STRING_S) {
                $sql_data_array['affiliate_state'] = $affiliate_state;
                $sql_data_array['affiliate_zone_id'] = $affiliate_zone_id;
            }
            $sql_data_array['affiliate_date_account_last_modified'] = 'now()';
            olc_db_perform(TABLE_AFFILIATE, $sql_data_array, 'update', "affiliate_id = '" . olc_db_input($affiliate_id) . APOS);
            olc_redirect(olc_href_link(FILENAME_AFFILIATE, olc_get_all_get_params(array('acID', 'action')) . 'acID=' . $affiliate_id));
            break;
        case 'deleteconfirm':
            $affiliate_id = olc_db_prepare_input($_GET['acID']);
            affiliate_delete(olc_db_input($affiliate_id));
            olc_redirect(olc_href_link(FILENAME_AFFILIATE, olc_get_all_get_params(array('acID', 'action'))));
            break;
    }
}
require DIR_WS_INCLUDES . 'header.php';
?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
    <td class="columnLeft2" nowrap="nowrap" valign="top"><table border="0" cellspacing="1" cellpadding="1" class="columnLeft" nowrap="nowrap">
<!-- left_navigation //-->
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:affiliate_affiliates.php

示例15: array

        }
        $sql_data_array = array($affiliate . 'id' => $_SESSION[$affiliate . 'ref'], $affiliate . 'clientdate' => $affiliate_clientdate, $affiliate . 'clientbrowser' => $affiliate_clientbrowser, $affiliate . 'clientip' => $affiliate_clientip, $affiliate . 'clientreferer' => $affiliate_clientreferer, $affiliate . 'products_id' => $affiliate_products_id, $affiliate . 'banner_id' => $affiliate_banner_id);
        olc_db_perform(TABLE_AFFILIATE_CLICKTHROUGHS, $sql_data_array);
        $_SESSION[$affiliate . 'clickthroughs_id'] = olc_db_insert_id();
        // Banner has been clicked, update stats:
        if ($affiliate_banner_id && $_SESSION[$affiliate . 'ref']) {
            $today = date('Y-m-d');
            $sql = "select * from " . TABLE_AFFILIATE_BANNERS_HISTORY . " where affiliate_banners_id = '" . $affiliate_banner_id . "' and  affiliate_banners_affiliate_id = '" . $_SESSION[$affiliate . 'ref'] . "' and affiliate_banners_history_date = '" . $today . APOS;
            $banner_stats_query = olc_db_query($sql);
            // Banner has been shown today
            if (olc_db_fetch_array($banner_stats_query)) {
                olc_db_query(SQL_UPDATE . TABLE_AFFILIATE_BANNERS_HISTORY . " set affiliate_banners_clicks = affiliate_banners_clicks + 1 where affiliate_banners_id = '" . $affiliate_banner_id . "' and affiliate_banners_affiliate_id = '" . $_SESSION[$affiliate . 'ref'] . "' and affiliate_banners_history_date = '" . $today . APOS);
                // Initial entry if banner has not been shown
            } else {
                $sql_data_array = array($affiliate . 'banners_id' => $affiliate_banner_id, $affiliate . 'banners_products_id' => $affiliate_products_id, $affiliate . 'banners_affiliate_id' => $_SESSION[$affiliate . 'ref'], $affiliate . 'banners_clicks' => '1', $affiliate . 'banners_history_date' => $today);
                olc_db_perform(TABLE_AFFILIATE_BANNERS_HISTORY, $sql_data_array);
            }
        }
        // Set Cookie if the customer comes back and orders it counts
        setcookie($affiliate . 'ref', $_SESSION[$affiliate . 'ref'], time() + AFFILIATE_COOKIE_LIFETIME);
    }
    if ($_COOKIE[$affiliate . 'ref']) {
        // Customer comes back and is registered in cookie
        $_SESSION[$affiliate . 'ref'] = $_COOKIE[$affiliate . 'ref'];
    }
}
////
// Compatibility to older Snapshots
// set the type of request (secure or not)
if (!isset($request_type)) {
    $request_type = getenv(HTTPS) != null ? SSL : NONSSL;
开发者ID:BackupTheBerlios,项目名称:ol-commerce-svn,代码行数:31,代码来源:affiliate_application_top.php


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