本文整理汇总了PHP中olc_db_fetch_array函数的典型用法代码示例。如果您正苦于以下问题:PHP olc_db_fetch_array函数的具体用法?PHP olc_db_fetch_array怎么用?PHP olc_db_fetch_array使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了olc_db_fetch_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: olc_address_label
function olc_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = NEW_LINE)
{
$address_query = olc_db_query("\n\t\tselect\n\t\tentry_firstname as firstname,\n\t\tentry_lastname as lastname,\n\t\tentry_company as company,\n\t\tentry_street_address as street_address,\n\t\tentry_suburb as suburb,\n\t\tentry_city as city,\n\t\tentry_postcode as postcode,\n\t\tentry_state as state,\n\t\tentry_zone_id as zone_id,\n\t\tentry_country_id as country_id\n\t\tfrom " . TABLE_ADDRESS_BOOK . "\n\t\twhere customers_id = '" . $customers_id . "' and address_book_id = '" . $address_id . APOS);
$address = olc_db_fetch_array($address_query);
$format_id = olc_get_address_format_id($address['country_id']);
return olc_address_format($format_id, $address, $html, $boln, $eoln);
}
示例2: olc_display_banner
function olc_display_banner($action, $identifier)
{
if ($action == 'dynamic') {
$banners_query = olc_db_query(SELECT_COUNT . " as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . APOS);
$banners = olc_db_fetch_array($banners_query);
if ($banners['count'] > 0) {
$banner = olc_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . APOS);
} else {
return '<b>OLC ERROR! (olc_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</b>';
}
} elseif ($action == 'static') {
if (is_array($identifier)) {
$banner = $identifier;
} else {
$banner_query = olc_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . $identifier . APOS);
if (olc_db_num_rows($banner_query)) {
$banner = olc_db_fetch_array($banner_query);
} else {
return '<b>OLC ERROR! (olc_display_banner(' . $action . ', ' . $identifier . ') -> Banner with id \'' . $identifier . '\' not found, or status inactive</b>';
}
}
} else {
return '<b>OLC ERROR! (olc_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'' . HTML_B_END;
}
if (olc_not_null($banner['banners_html_text'])) {
$banner_string = $banner['banners_html_text'];
} else {
$banner_string = HTML_A_START . olc_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . olc_image(DIR_WS_IMAGES . 'banner/' . $banner['banners_image'], $banner['banners_title']) . HTML_A_END;
}
olc_update_banner_display_count($banner['banners_id']);
return $banner_string;
}
示例3: olc_get_path
function olc_get_path($current_category_id = EMPTY_STRING)
{
global $cPath_array;
if (olc_not_null($current_category_id)) {
$cp_size = sizeof($cPath_array);
if ($cp_size == 0) {
$cPath_new = $current_category_id;
} else {
$cPath_new = EMPTY_STRING;
$sql0 = "select parent_id from " . TABLE_CATEGORIES . " where categories_id = '#'";
$sql = str_replace(HASH, $cPath_array[$cp_size - 1], $sql0);
$last_category_query = olc_db_query($sql);
$last_category = olc_db_fetch_array($last_category_query);
$sql = str_replace(HASH, $current_category_id, $sql0);
$current_category_query = olc_db_query($sql);
$current_category = olc_db_fetch_array($current_category_query);
if ($last_category['parent_id'] == $current_category['parent_id']) {
for ($i = 0, $n = $cp_size - 1; $i < $n; $i++) {
$cPath_new .= UNDERSCORE . $cPath_array[$i];
}
} else {
for ($i = 0; $i < $cp_size; $i++) {
$cPath_new .= UNDERSCORE . $cPath_array[$i];
}
}
$cPath_new .= UNDERSCORE . $current_category_id;
if (substr($cPath_new, 0, 1) == UNDERSCORE) {
$cPath_new = substr($cPath_new, 1);
}
}
} else {
$cPath_new = implode(UNDERSCORE, $cPath_array);
}
return 'cPath=' . $cPath_new;
}
示例4: olc_get_categoriesstatus_for_product
function olc_get_categoriesstatus_for_product($product_id)
{
$categorie_query = olc_db_query("\n\tSELECT\n\tcategories_id\n\tFROM " . TABLE_PRODUCTS_TO_CATEGORIES . "\n\tWHERE products_id=" . $product_id);
while ($categorie_data = olc_db_fetch_array($categorie_query)) {
return olc_check_categories_status($categorie_data['categories_id']) >= 1;
}
}
示例5: olc_random_select
function olc_random_select($query, $rows = 1)
{
global $random_rows;
$random_product = '';
$random_query = olc_db_query($query);
$num_rows = olc_db_num_rows($random_query);
if ($num_rows > 1) {
$num_rows1 = $num_rows - 1;
for ($row = 1; $row <= $rows; $row++) {
$tries = 0;
$random_row = olc_rand(0, $num_rows1);
$random_row_store = "|" . $random_row . "|";
$include_row = true;
while (!(strpos($random_rows, $random_row_store) === false)) {
$tries++;
if ($tries > 10) {
$include_row = false;
break;
} else {
$random_row = olc_rand(0, $num_rows1);
}
}
if ($include_row) {
$random_rows .= $random_row_store;
olc_db_data_seek($random_query, $random_row);
$random_product[] = olc_db_fetch_array($random_query);
}
}
} else {
if ($num_rows > 0) {
$random_product[] = olc_db_fetch_array($random_query);
}
}
return $random_product;
}
示例6: olc_get_download
function olc_get_download($content_id)
{
$content_query = olc_db_query("SELECT\n\t\t\t\t\tcontent_file,\n\t\t\t\t\tcontent_read\n\t\t\t\t\tFROM " . TABLE_PRODUCTS_CONTENT . "\n\t\t\t\t\tWHERE content_id='" . $content_id . APOS);
$content_data = olc_db_fetch_array($content_query);
// update file counter
olc_db_query("SQL_UPDATE \n\t\t\t" . TABLE_PRODUCTS_CONTENT . " \n\t\t\tSET content_read='" . ($content_data['content_read'] + 1) . "'\n\t\t\tWHERE content_id='" . $content_id . APOS);
// original filename
$filename = DIR_FS_CATALOG . 'media/products/' . $content_data['content_file'];
$backup_filename = DIR_FS_CATALOG . 'media/products/backup/' . $content_data['content_file'];
// create md5 hash id from original file
$orign_hash_id = md5_file($filename);
clearstatcache();
// create new filename with timestamp
$timestamp = str_replace('.', '', microtime());
$timestamp = str_replace(BLANK, '', $timestamp);
$new_filename = DIR_FS_CATALOG . 'media/products/' . $timestamp . strstr($content_data['content_file'], '.');
// rename file
rename($filename, $new_filename);
if (file_exists($new_filename)) {
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=" . $new_filename);
@readfile($new_filename);
// rename file to original name
rename($new_filename, $filename);
$new_hash_id = md5_file($filename);
clearstatcache();
// check hash id of file again, if not same, get backup!
if ($new_hash_id != $orign_hash_id) {
copy($backup_filename, $filename);
}
}
}
示例7: get_category_tree
function get_category_tree($parent_id = '0', $spacing = EMPTY_STRING, $exclude = EMPTY_STRING, $category_tree_array = EMPTY_STRING, $include_itself = false, $cPath = EMPTY_STRING)
{
if ($parent_id == 0) {
$cPath = EMPTY_STRING;
} else {
$cPath .= $parent_id . '_';
}
if (!is_array($category_tree_array)) {
$category_tree_array = array();
}
if (sizeof($category_tree_array) < 1 && $exclude != '0') {
$category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);
}
if ($include_itself) {
$category_query = olc_db_query("\n\t\t\tselect cd.categories_name\n\t\t\tfrom " . TABLE_CATEGORIES_DESCRIPTION . " cd\n\t\t\tWHERE c.categories_status = '1' AND cd.language_id = '" . SESSION_LANGUAGE_ID . "'\n\t\t\tand cd.categories_id = '" . $parent_id . APOS);
$category = olc_db_fetch_array($category_query);
$category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']);
}
$categories_query = olc_db_query("\n\t\tselect\n\t\tc.categories_id,\n\t\tcd.categories_name,\n\t\tc.parent_id\n\t\tfrom " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd\n\t\twhere c.categories_id = cd.categories_id\n\t\tand cd.language_id = '" . SESSION_LANGUAGE_ID . "'\n\t\tand c.parent_id = '" . $parent_id . "'\n\t\tand c.categories_status = '1'\n\t\torder by c.sort_order, cd.categories_name");
while ($categories = olc_db_fetch_array($categories_query)) {
$categories_id = $categories['categories_id'];
if ($exclude != $categories_id) {
$category_tree_array[] = array('id' => $categories_id, 'text' => $spacing . $categories['categories_name'], 'link' => olc_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath . $categories_id, NONSSL, false, true, false), 'pcount' => olc_count_products_in_category($categories_id));
$category_tree_array = get_category_tree($categories_id, $spacing . ' ', $exclude, $category_tree_array, false, $cPath);
}
}
return $category_tree_array;
}
示例8: 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;
}
示例9: table
function table()
{
global $order;
if (!$order) {
include_once ADMIN_PATH_PREFIX . DIR_WS_CLASSES . 'order.php';
$order = new order();
}
$order_delivery_country = $order->delivery['country'];
$this->code = 'table';
$this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
$this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
$this->icon = '';
$this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
$this->enabled = strtolower(MODULE_SHIPPING_TABLE_STATUS) == TRUE_STRING_S ? true : false;
if ($this->enabled == true && (int) MODULE_SHIPPING_TABLE_ZONE > 0) {
$check_flag = false;
$check_query = olc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . "\n\t\t\twhere geo_zone_id = '" . MODULE_SHIPPING_TABLE_ZONE . "'\n\t\t\tand zone_country_id = '" . $order_delivery_country['id'] . "' order by zone_id");
while ($check = olc_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
}
if ($check_flag == false) {
$this->enabled = false;
}
}
}
示例10: update_status
function update_status()
{
global $order;
$customer_id = $_SESSION['customer_id'];
$check_order_query = olc_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . $customer_id . APOS);
$order_check = olc_db_num_rows($check_order_query);
if ($order_check >= MODULE_PAYMENT_INVOICE_MIN_ORDER) {
$check_flag = false;
} else {
if ($this->enabled == true && (int) MODULE_PAYMENT_INVOICE_ZONE > 0) {
$check_flag = false;
$check_query = olc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_INVOICE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while ($check = olc_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
}
}
if ($check_flag == false) {
$this->enabled = false;
}
}
if ($this->enabled == true) {
if ($order->content_type == 'virtual') {
$this->enabled = false;
}
}
}
示例11: olc_get_products_special_price
function olc_get_products_special_price($product_id)
{
global $special_info;
$product_query = olc_db_query("select specials_new_products_price, expires_date from " . TABLE_SPECIALS . " where products_id = '" . $product_id . "' and status");
$special_info = olc_db_fetch_array($product_query);
return $special_info['specials_new_products_price'];
}
示例12: olc_get_countries
function olc_get_countries($countries_id = '', $with_iso_codes = false)
{
$countries_id_text = 'countries_id';
$countries_name_text = 'countries_name';
$select = "select countries_name";
$select_countries_id = $select . ", " . $countries_id_text;
$from = " from " . TABLE_COUNTRIES;
$countries_array = array();
if (olc_not_null($countries_id)) {
$where = $from . " where countries_id = '" . $countries_id . APOS;
if ($with_iso_codes) {
$countries_iso_code_text = 'countries_iso_code_';
$countries_iso_code_2_text = $countries_iso_code_text . '2';
$countries_iso_code_3_text = $countries_iso_code_text . '3';
$countries = olc_db_query($select_countries_id . ", " . $countries_iso_code_2_text . $where);
$countries_values = olc_db_fetch_array($countries);
$countries_array = array($countries_name_text => $countries_values[$countries_name_text], $countries_iso_code_2_text => $countries_values[$countries_iso_code_2_text], $countries_iso_code_3_text => $countries_values[$countries_iso_code_3_text]);
} else {
$countries = olc_db_query($select . $where);
$countries_values = olc_db_fetch_array($countries);
$countries_array = array($countries_name_text => $countries_values[$countries_name_text]);
}
} else {
$countries = olc_db_query($select_countries_id . $from . " order by " . $countries_name_text);
while ($countries_values = olc_db_fetch_array($countries)) {
$countries_array[] = array($countries_id_text => $countries_values[$countries_id_text], $countries_name_text => $countries_values[$countries_name_text]);
}
}
return $countries_array;
}
示例13: olc_get_vpe_name
function olc_get_vpe_name($vpeID)
{
$vpe_query = "SELECT products_vpe_name FROM " . TABLE_PRODUCTS_VPE . " WHERE language_id='" . SESSION_LANGUAGE_ID . "' and products_vpe_id='" . $vpeID . APOS;
$vpe_query = olc_db_query($vpe_query);
$vpe = olc_db_fetch_array($vpe_query);
return $vpe['products_vpe_name'];
}
示例14: update_status
function update_status()
{
global $order;
if ($this->enabled == true && (int) MODULE_PAYMENT_BARZAHL_ZONE > 0) {
$check_flag = false;
$check_query = olc_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_BARZAHL_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while ($check = olc_db_fetch_array($check_query)) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
}
if ($check_flag == false) {
$this->enabled = false;
}
}
if ($this->enabled == true) {
if ($order->content_type == 'virtual') {
$this->enabled = false;
}
}
}
示例15: olc_get_products_stock
function olc_get_products_stock($products_id)
{
$products_id = olc_get_prid($products_id);
$stock_query = olc_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . APOS);
$stock_values = olc_db_fetch_array($stock_query);
return $stock_values['products_quantity'];
}