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


PHP oosDBGetConn函数代码示例

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


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

示例1: oosGetPageType

 /**
  * Return Page Type
  *
  * @return array
  */
  function oosGetPageType() {

    $page_type_array = array();

    // Get database information
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();

    $page_type_sql = "SELECT page_type_id, page_type_name
                      FROM " . $oostable['page_type'] . "
                      WHERE page_type_languages_id = '" . intval($_SESSION['language_id']) . "'
                      ORDER BY page_type_id";
    $page_type_result = $dbconn->Execute($page_type_sql);
    while ($page_type = $page_type_result->fields) {
      $page_type_array[] = array('id' => $page_type['page_type_id'],
                                 'text' => $page_type['page_type_name']
                                    );
      // Move that ADOdb pointer!
      $page_type_result->MoveNext();
    }

    // Close result set
    $page_type_result->Close();

    return $page_type_array;
  }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:31,代码来源:content_page_type.php

示例2: create_plugin_instance

 function create_plugin_instance()
 {
     // Get database information
     $dbconn =& oosDBGetConn();
     $oostable =& oosDBGetTables();
     if (isset($_SESSION['customer_id'])) {
         $wo_customer_id = $_SESSION['customer_id'];
         $wo_full_name = addslashes($_SESSION['customer_first_name'] . ' ' . $_SESSION['customer_lastname']);
     } else {
         $wo_customer_id = '';
         $wo_full_name = 'Guest';
     }
     $wo_session_id = oos_session_id();
     $wo_ip_address = $_SESSION['session_ip_address'];
     $wo_last_page_url = addslashes(oos_server_get_var('REQUEST_URI'));
     $current_time = time();
     $xx_mins_ago = $current_time - 900;
     // remove entries that have expired
     $whos_onlinetable = $oostable['whos_online'];
     $dbconn->Execute("DELETE FROM {$whos_onlinetable}\n                        WHERE time_last_click < '" . oos_db_input($xx_mins_ago) . "'");
     $whos_onlinetable = $oostable['whos_online'];
     $query = "SELECT COUNT(*) AS total\n                FROM {$whos_onlinetable}\n                WHERE session_id = '" . oos_db_input($wo_session_id) . "'";
     $stored_customer = $dbconn->Execute($query);
     if ($stored_customer->fields['total'] > 0) {
         $whos_onlinetable = $oostable['whos_online'];
         $query = "UPDATE {$whos_onlinetable}" . " SET customer_id = ?, full_name = ?, ip_address = ?, time_last_click = ?, last_page_url = ?" . " WHERE session_id = ?";
         $result =& $dbconn->Execute($query, array((string) $wo_customer_id, (string) $wo_full_name, (string) $wo_ip_address, (string) $current_time, (string) $wo_last_page_url, (string) $wo_session_id));
     } else {
         $whos_onlinetable = $oostable['whos_online'];
         $dbconn->Execute("INSERT INTO " . $whos_onlinetable . "\n                     (customer_id,\n                      full_name,\n                      session_id,\n                      ip_address,\n                      time_entry,\n                      time_last_click,\n                      last_page_url) VALUES ('" . oos_db_input($wo_customer_id) . "',\n                                             '" . oos_db_input($wo_full_name) . "',\n                                             '" . oos_db_input($wo_session_id) . "',\n                                             '" . oos_db_input($wo_ip_address) . "',\n                                             '" . oos_db_input($current_time) . "',\n                                             '" . oos_db_input($current_time) . "',\n                                             '" . oos_db_input($wo_last_page_url) . "')");
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:33,代码来源:oos_event_whos_online.php

示例3: __construct

    public function __construct()
    {

        $this->currencies = array();

        // Get database information
        $dbconn =& oosDBGetConn();
        $oostable =& oosDBGetTables();

        $query = "SELECT code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value
                  FROM " . $oostable['currencies'];
        $result =& $dbconn->Execute($query);

        while ($currencies = $result->fields) {
            $this->currencies[$currencies['code']] = array('title' => $currencies['title'],
                                                           'symbol_left' => $currencies['symbol_left'],
                                                           'symbol_right' => $currencies['symbol_right'],
                                                           'decimal_point' => $currencies['decimal_point'],
                                                           'thousands_point' => $currencies['thousands_point'],
                                                           'decimal_places' => $currencies['decimal_places'],
                                                           'value' => $currencies['value']);
           // Move that ADOdb pointer!
           $result->MoveNext();
        }
    }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:25,代码来源:class_currencies.php

示例4: oos_expire_featured

/**
 * Auto expire featured products
 */
function oos_expire_featured()
{
    // Get database information
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();
    $featuredtable = $oostable['featured'];
    $sql = "SELECT featured_id\n            FROM {$featuredtable}\n            WHERE status = '1'\n              AND now() >= expires_date\n              AND expires_date > 0";
    if (USE_DB_CACHE == '1') {
        $featured_result = $dbconn->CacheExecute(15, $sql);
    } else {
        $featured_result = $dbconn->Execute($sql);
    }
    if (!$featured_result) {
        return;
    }
    if ($featured_result->RecordCount() > 0) {
        while ($featured = $featured_result->fields) {
            oos_set_featured_status($featured['featured_id'], '0');
            // Move that ADOdb pointer!
            $featured_result->MoveNext();
        }
        // Close result set
        $featured_result->Close();
    }
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:28,代码来源:function_featured.php

示例5: oos_gv_account_update

 /**
  * Update the Customers GV account
  *
  * @param $customer_id
  * @param $gv_id
  */
  function oos_gv_account_update($customer_id, $gv_id) {

    // Get database information
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();

    $coupon_gv_query = "SELECT coupon_amount
                        FROM " . $oostable['coupons'] . "
                        WHERE coupon_id = '" . $gv_id . "'";
    $coupon_gv_result =& $dbconn->Execute($coupon_gv_query);
    $coupon_gv = $coupon_gv_result->fields;

    if ($customer_gv_result->RecordCount() > 0) {
      $customer_gv_query = "SELECT amount 
                            FROM " . $oostable['coupon_gv_customer'] . "
                            WHERE customer_id = '" . $customer_id . "'";
      $customer_gv_result =& $dbconn->Execute($customer_gv_query);

      $customer_gv = $customer_gv_result->fields;
      $new_gv_amount = $customer_gv['amount'] + $coupon_gv['coupon_amount'];

      $gv_query = "UPDATE " . $oostable['coupon_gv_customer'] . "
                   SET amount = '" . $new_gv_amount . "'";
      $result =& $dbconn->Execute($gv_query);
    } else {
      $gv_query = "INSERT INTO " . $oostable['coupon_gv_customer'] . " 
                  (customer_id, amount) VALUES ('" . $customer_id . "', '" . $coupon_gv['coupon_amount'] . "'";
      $result =& $dbconn->Execute($gv_query);
    }
  }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:36,代码来源:function_coupon.php

示例6: oos_expire_spezials

/**
 * Auto expire products on special
 */
function oos_expire_spezials()
{

    // Get database information
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();

    $specialstable = $oostable['specials'];
    $query = "SELECT specials_id
              FROM $specialstable
              WHERE status = '1'
                AND now() >= expires_date
                AND expires_date > 0";
    if (USE_DB_CACHE == '1') {
        $result =& $dbconn->CacheExecute(3600, $query);
    } else {
        $result =& $dbconn->Execute($query);
    }
    if (!$result) {return;}

    if ($result->RecordCount() > 0) {
        while ($specials = $result->fields)
        {
            oos_set_specials_status($specials['specials_id'], '0');

            // Move that ADOdb pointer!
            $result->MoveNext();
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:33,代码来源:function_spezials.php

示例7: _GetCustomerSessions

 /**
  * This will return a list of customers with sessions. Handles
  * either the mysql or file ase
  *
  * Returns an empty array if the check sessions flag is not true
  * (empty array means same SQL statement can be used) !!!!!
  *
  *
  * @return string
  */
  function _GetCustomerSessions() {

    $cust_ses_ids = 0;

    if (RCS_CHECK_SESSIONS == '1') {
      $dbconn =& oosDBGetConn();
      $oostable =& oosDBGetTables();

      // remove entries that have expired
      $xx_mins_ago = (time() - 900);
      $whos_onlinetable = $oostable['whos_online'];
      $dbconn->Execute("DELETE FROM $whos_onlinetable WHERE time_last_click < '" . $xx_mins_ago . "'");

      $whos_onlinetable = $oostable['whos_online'];
      $sql = "SELECT customer_id FROM $whos_onlinetable";
      $whos_online_result = $dbconn->Execute($sql);
      while ($whos_online = $whos_online_result->fields) {
        $cust_ses_ids .= ', ' . $whos_online['customer_id'];

         // Move that ADOdb pointer!
        $whos_online_result->MoveNext();
      }

     # $cust_ses_ids = substr($cust_ses_ids, 2);
    }

    return $cust_ses_ids;
  }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:38,代码来源:recover_cart_sales.php

示例8: smarty_function_oos_address_label

/**
 * Smarty {oos_address_label} function plugin
 *
 * Type:     function
 * Name:     oos_address_label
 * Version:  1.0
 * -------------------------------------------------------------
 */

function smarty_function_oos_address_label($params, &$smarty)
{

    $customers_id = '';
    $address_id = 1;
    $html = true;
    $boln = '';
    $eoln = '<br>';

    MyOOS_CoreApi::requireOnce('lib/smarty/libs/plugins/shared.escape_special_chars.php');
    MyOOS_CoreApi::requireOnce('lib/smarty-plugins/myoos/function.oos_address_format.php');

    foreach($params as $_key => $_val) {
      $$_key = smarty_function_escape_special_chars($_val);
    }

    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();

    $address_result = $dbconn->Execute("SELECT entry_firstname AS firstname, entry_lastname AS lastname, entry_company AS company, entry_street_address AS street_address, entry_suburb AS suburb, entry_city AS city, entry_postcode AS postcode, entry_state AS state, entry_zone_id AS zone_id, entry_country_id AS country_id FROM " . $oostable['address_book'] . " WHERE customers_id = '" . (int)$customers_id . "' AND address_book_id = '" . (int)$address_id . "'");
    $address = $address_result->fields;

    $format_id = oos_get_address_format_id($address['country_id']);


    return smarty_function_oos_address_format(array('address_format_id' => $format_id,
                                                    'address'   => $address,
                                                    'html'      => $html),
                                                  $smarty);


}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:41,代码来源:function.oos_address_label.php

示例9: set

 function set($sLang = '')
 {
     if (!empty($sLang) && $this->exists($sLang) === true) {
         $this->language = $this->get($sLang);
     } else {
         $this->language = $this->get(DEFAULT_LANGUAGE);
     }
     /*
             if (!isset($_COOKIE['language']) || (isset($_COOKIE['language']) && ($_COOKIE['language'] != $this->language['iso_639_2']))) {
               oos_setcookie('language', $this->language['iso_639_2'], time()+60*60*24*90);
             }
     */
     $_SESSION['language'] = $this->language['iso_639_2'];
     $_SESSION['language_id'] = $this->language['id'];
     $_SESSION['iso_639_1'] = $this->language['iso_639_1'];
     $_SESSION['languages_name'] = $this->language['name'];
     if (isset($_SESSION['customer_id'])) {
         $dbconn =& oosDBGetConn();
         $oostable =& oosDBGetTables();
         $sLanguage = oos_var_prep_for_os($this->language['iso_639_2']);
         $customerstable = $oostable['customers'];
         $query = "UPDATE {$customerstable} SET customers_language =? WHERE customers_id =?";
         $result =& $dbconn->Execute($query, array($sLanguage, (int) $_SESSION['customer_id']));
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:25,代码来源:class_language.php

示例10: oosGetSystemInformation

 /**
  * Retreive server information
  *
  * @return array
  */
  function oosGetSystemInformation() {

    // Get database information
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();

    $db_host = $dbconn->host;
    $db_database = $dbconn->database;
    $phpv = phpversion();


    $db_result = $dbconn->ServerInfo($oostable['countries']);

    list($system, $host, $kernel) = preg_split('/[\s,]+/', @exec('uname -a'), 5);

    return array('date' => oos_datetime_short(date('Y-m-d H:i:s')),
                 'system' => $_ENV["OS"],
                 'kernel' => $kernel,
                 'host' => $host,
                 'ip' => gethostbyname($host),
                 'uptime' => @exec('uptime'),
                 'HTTP_SERVER' => $_SERVER['SERVER_SOFTWARE'],
                 'php' => $phpv,
                 'zend' => (function_exists('zend_version') ? zend_version() : ''),
                 'db_server' => $db_host,
                 'db_ip' => gethostbyname(OOS_DB_SERVER),
                 'db_version' => OOS_DB_TYPE . $db_result['description'],
                 'db_database' => $db_database);
  }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:34,代码来源:server_info.php

示例11: __construct

    /**
     * Constructor
     */
    public function __construct($nCurrentPageNumber, $max_rows_per_page, &$sql_result, &$query_num_rows)
    {


        $dbconn =& oosDBGetConn();
        if (empty($nCurrentPageNumber) || !is_numeric($nCurrentPageNumber)) $nCurrentPageNumber = 1;

        $pos_to = strlen($sql_result);
        $pos_from = strpos($sql_result, ' FROM', 0);

        $pos_group_by = strpos($sql_result, ' GROUP BY', $pos_from);
        if (($pos_group_by < $pos_to) && ($pos_group_by != false)) $pos_to = $pos_group_by;

        $pos_having = strpos($sql_result, ' HAVING', $pos_from);
        if (($pos_having < $pos_to) && ($pos_having != false)) $pos_to = $pos_having;

        $pos_order_by = strpos($sql_result, ' ORDER BY', $pos_from);
        if (($pos_order_by < $pos_to) && ($pos_order_by != false)) $pos_to = $pos_order_by;

        $pos_limit = strpos($sql_result, ' LIMIT', $pos_from);
        if (($pos_limit < $pos_to) && ($pos_limit != false)) $pos_to = $pos_limit;

        $pos_procedure = strpos($sql_result, ' PROCEDURE', $pos_from);
        if (($pos_procedure < $pos_to) && ($pos_procedure != false)) $pos_to = $pos_procedure;

        $offset = ($max_rows_per_page * ($nCurrentPageNumber - 1));
        if ($offset < 0) $offset = 0;
        $sql_result .= " LIMIT " . max($offset, 0) . ", " . $max_rows_per_page;

        $sql = "SELECT COUNT(*) AS total " . substr($sql_result, $pos_from, ($pos_to - $pos_from));
        $reviews_count = $dbconn->Execute($sql);
        $query_num_rows = $reviews_count->fields['total'];
    }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:36,代码来源:class_split_page_results.php

示例12: oos_count_products_in_category

/**
 * Return the number of products in a category
 *
 * @param $category_id
 * @param $include_inactive
 * @return string
 */
function oos_count_products_in_category($category_id, $include_inactive = false)
{
    $products_count = 0;
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();
    $productstable = $oostable['products'];
    $products_to_categoriestable = $oostable['products_to_categories'];
    if ($include_inactive == true) {
        $products = $dbconn->Execute("SELECT COUNT(*) AS total FROM {$productstable} p, {$products_to_categoriestable} p2c WHERE p.products_id = p2c.products_id AND p2c.categories_id = '" . intval($category_id) . "'");
    } else {
        $products = $dbconn->Execute("SELECT COUNT(*) AS total FROM {$productstable} p, {$products_to_categoriestable} p2c WHERE p.products_id = p2c.products_id AND p.products_status >= '1' AND p2c.categories_id = '" . intval($category_id) . "'");
    }
    $products_count += $products->fields['total'];
    $nGroupID = intval($_SESSION['member']->group['id']);
    $categoriestable = $oostable['categories'];
    $child_categories_result = $dbconn->Execute("SELECT categories_id FROM {$categoriestable} WHERE ( access = '0' OR access = '" . intval($nGroupID) . "' ) AND parent_id = '" . intval($category_id) . "'");
    if ($child_categories_result->RecordCount()) {
        while ($child_categories = $child_categories_result->fields) {
            $products_count += oos_count_products_in_category($child_categories['categories_id'], $include_inactive);
            // Move that ADOdb pointer!
            $child_categories_result->MoveNext();
        }
    }
    return $products_count;
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:32,代码来源:block_categories.php

示例13: oosGeoZonesPullDown

 /**
  * Output a form pull down menu with geo zones
  *
  * @param $parameters
  * @param $selected
  * @return string
  */
  function oosGeoZonesPullDown($parameters, $selected = '') {

    $select_string = '<select ' . $parameters . '>';

    // Get database information
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();

    $geo_zonestable = $oostable['geo_zones'];
    $zones_sql = "SELECT geo_zone_id, geo_zone_name
                  FROM $geo_zonestable
                  ORDER BY geo_zone_name";
    $result = $dbconn->Execute($zones_sql);
    while ($zones = $result->fields) {
      $select_string .= '<option value="' . $zones['geo_zone_id'] . '"';
      if ($selected == $zones['geo_zone_id']) $select_string .= ' selected="selected"';
      $select_string .= '>' . $zones['geo_zone_name'] . '</option>';

      // Move that ADOdb pointer!
      $result->MoveNext();
    }

    // Close result set
    $result->Close();

    $select_string .= '</select>';

    return $select_string;
  }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:36,代码来源:tax_rates.php

示例14: walk

function walk($item1)
{
    $item1 = str_replace('	', '|', $item1);
    $item1 = str_replace('"', '', $item1);
    $item1 = str_replace("\n", '', $item1);
    $item1 = str_replace("\r", '', $item1);
    //$item1 = str_replace("",'',$item1);
    $item1 = str_replace('"', '\\"', $item1);
    $item1 = str_replace("'", '\\"', $item1);
    // echo $item1."<br>";
    $item1 = chop($item1);
    echo $item1 . "<br>";
    $items = explode("|", $item1);
    $products_id = $items[0];
    $products_model = $items[1];
    $products_name = $items[2];
    $products_tax_class_id = $items[3];
    $products_status = $items[4];
    $products_price = $items[5];
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();
    $tax_ratestable = $oostable['tax_rates'];
    $query = "SELECT tax_rate FROM {$tax_ratestable} WHERE tax_class_id = '" . intval($products_tax_class_id) . "'";
    $tax = $dbconn->GetOne($query);
    $price = $products_price / ($tax + 100) * 100;
    $productstable = $oostable['products'];
    $dbconn->Execute("UPDATE {$productstable} set products_price = '" . $price . "', products_status = '" . intval($products_status) . "' where products_id = '" . intval($products_id) . "'");
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:28,代码来源:import_excel.php

示例15: remove

 function remove()
 {
     $dbconn =& oosDBGetConn();
     $oostable =& oosDBGetTables();
     $configurationtable = $oostable['configuration'];
     $dbconn->Execute("DELETE FROM {$configurationtable} WHERE configuration_key in ('" . implode("', '", $this->config_item()) . "')");
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:8,代码来源:oos_event_featured.php


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