本文整理汇总了PHP中ps_DB::next_record方法的典型用法代码示例。如果您正苦于以下问题:PHP ps_DB::next_record方法的具体用法?PHP ps_DB::next_record怎么用?PHP ps_DB::next_record使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ps_DB
的用法示例。
在下文中一共展示了ps_DB::next_record方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
/**
* Validates the input parameters onCountryAdd
*
* @param array $d
* @return boolean
*/
function validate_add($d)
{
global $vmLogger;
$db = new ps_DB();
if (!$d["country_name"]) {
$vmLogger->err("You must enter a name for the country.");
return False;
}
if (!$d["country_2_code"]) {
$vmLogger->err("You must enter a 2 symbol code for the country.");
return False;
}
if (!$d["country_3_code"]) {
$vmLogger->err('You must enter a 3 symbol code for the country.');
return False;
}
if ($d["country_name"]) {
$q = "SELECT count(*) as rowcnt from #__{vm}_country where";
$q .= " country_name='" . $db->getEscaped($d["country_name"]) . "'";
$db->query($q);
$db->next_record();
if ($db->f("rowcnt") > 0) {
$vmLogger->err("The given country name already exists.");
return False;
}
}
return True;
}
示例2: count
function validate_add($d)
{
global $VM_LANG;
$db = new ps_DB();
if (!$d["currency_name"]) {
$GLOBALS['vmLogger']->err($VM_LANG->_('VM_CURRENCY_ERR_NAME'));
return False;
}
if (!$d["currency_code"]) {
$GLOBALS['vmLogger']->err($VM_LANG->_('VM_CURRENCY_ERR_CODE'));
return False;
}
if ($d["currency_name"]) {
$q = "SELECT count(*) as rowcnt from #__{vm}_currency where";
$q .= " currency_name='" . $d["currency_name"] . "'";
$db->setQuery($q);
$db->query();
$db->next_record();
if ($db->f("rowcnt") > 0) {
$GLOBALS['vmLogger']->err($VM_LANG->_('VM_CURRENCY_ERR_EXISTS'));
return False;
}
}
return True;
}
示例3: authUser
function authUser($acc, $pwd)
{
if ($acc && $pwd) {
$db = new ps_DB();
$pwd = md5($pwd);
$sql = "select ID, name, authority from account where username='{$acc}' and password='{$pwd}' ";
$db->query($sql);
if ($db->next_record()) {
return $db->f('ID');
} else {
return 0;
}
} else {
return 0;
}
}
示例4: get
/**
* Retrieves a record with the specified ID from the table associated with this entitiy type
* In case of success, returns a ps_DB object with a prepared recordset
* In case of failure returns false
* @param mixed $id
* @return mixed
*/
function get($id)
{
$key = $this->getKey();
$table = $this->getTable();
$db = new ps_DB();
if (!empty($id)) {
$query = 'SELECT * FROM `' . $table . '` WHERE `' . $key . '`=';
if (is_numeric($id)) {
$query .= (int) $id;
} else {
$query .= '\'' . $db->getEscaped($id) . '\'';
}
$db->query($query);
$db->next_record();
}
return $db;
}
示例5: validate
/**
* Validates the Input Parameters on price add/update
*
* @param array $d
* @return boolean
*/
function validate(&$d)
{
global $vmLogger, $VM_LANG;
$valid = true;
if (!isset($d["product_price"]) || $d["product_price"] === '') {
$vmLogger->err($VM_LANG->_('VM_PRODUCT_PRICE_MISSING', false));
$valid = false;
}
if (empty($d["product_id"])) {
$vmLogger->err($VM_LANG->_('VM_PRODUCT_ID_MISSING', false));
$valid = false;
}
// convert all "," in prices to decimal points.
if (stristr($d["product_price"], ",")) {
$d['product_price'] = floatval(str_replace(',', '.', $d["product_price"]));
}
if (!$d["product_currency"]) {
$vmLogger->err($VM_LANG->_('VM_PRODUCT_PRICE_CURRENCY_MISSING', false));
$valid = false;
}
$d["price_quantity_start"] = intval(@$d["price_quantity_start"]);
$d["price_quantity_end"] = intval(@$d["price_quantity_end"]);
if ($d["price_quantity_end"] < $d["price_quantity_start"]) {
$vmLogger->err($VM_LANG->_('VM_PRODUCT_PRICE_QEND_LESS', false));
$valid = false;
}
$db = new ps_DB();
$q = "SELECT count(*) AS num_rows FROM #__{vm}_product_price WHERE";
if (!empty($d["product_price_id"])) {
$q .= " product_price_id != '" . $d['product_price_id'] . "' AND";
}
$q .= " shopper_group_id = '" . $d["shopper_group_id"] . "'";
$q .= " AND product_id = '" . $d['product_id'] . "'";
$q .= " AND product_currency = '" . $d['product_currency'] . "'";
$q .= " AND (('" . $d['price_quantity_start'] . "' >= price_quantity_start AND '" . $d['price_quantity_start'] . "' <= price_quantity_end)";
$q .= " OR ('" . $d['price_quantity_end'] . "' >= price_quantity_start AND '" . $d['price_quantity_end'] . "' <= price_quantity_end))";
$db->query($q);
$db->next_record();
if ($db->f("num_rows") > 0) {
$vmLogger->err($VM_LANG->_('VM_PRODUCT_PRICE_ALREADY', false));
$valid = false;
}
return $valid;
}
示例6: implode
/**
* Validates the Input Parameters onBeforeProductTypeAdd
* @author Zdenek Dvorak
* @param array $d
* @return boolean
*/
function validate_add(&$d)
{
global $VM_LANG;
if (empty($d["product_type_id"])) {
$GLOBALS['vmLogger']->err($VM_LANG->_('VM_PRODUCT_TYPE_ERR_SELECT'));
return False;
}
if (empty($d["product_id"])) {
$GLOBALS['vmLogger']->err($VM_LANG->_('VM_PRODUCT_TYPE_ERR_SELECT_PRODUCT'));
return false;
}
$db = new ps_DB();
$q = "SELECT product_id,COUNT(*) AS count FROM #__{vm}_product_product_type_xref ";
if (is_array($d["product_id"])) {
$product_ids = implode(",", $d["product_id"]);
$q .= "WHERE product_id IN (" . $product_ids . ") AND product_type_id='" . $d["product_type_id"] . "' GROUP BY product_id";
} else {
$q .= "WHERE product_id='" . $d["product_id"] . "' AND product_type_id='" . $d["product_type_id"] . "'";
}
$db->query($q);
if ($db->f("count") != 0 && sizeof($d["product_id"]) == 1) {
$GLOBALS['vmLogger']->err($VM_LANG->_('VM_PRODUCT_TYPE_ERR_ALREADY'));
return false;
} else {
$container = $d["product_id"];
while ($db->next_record()) {
foreach ($d["product_id"] as $prod_id) {
if ($prod_id != $db->f("product_id")) {
$temp[] = $prod_id;
}
}
$d["product_id"] = $temp;
unset($temp);
}
if (empty($d["product_id"])) {
$GLOBALS['vmLogger']->err($VM_LANG->_('VM_PRODUCT_TYPE_ERR_ALREADY'));
$d["product_id"] = $container;
return false;
}
return True;
}
}
示例7: while
function traverse_tree_down(&$mymenu_content, $category_id = '0', $level = '0')
{
static $ibg = 0;
global $mosConfig_live_site, $sess;
$level++;
$query = "SELECT category_name, category_id, category_child_id " . "FROM #__{vm}_category as a, #__{vm}_category_xref as b " . "WHERE a.category_publish='Y' AND " . " b.category_parent_id='{$category_id}' AND a.category_id=b.category_child_id " . "ORDER BY category_parent_id, list_order, category_name ASC";
$db = new ps_DB();
$db->query($query);
while ($db->next_record()) {
$itemid = '&Itemid=' . $sess->getShopItemid();
if ($ibg != 0) {
$mymenu_content .= ",";
}
$mymenu_content .= "\n[ '<img src=\"' + ctThemeXPBase + 'darrow.png\" alt=\"arr\" />','" . $db->f("category_name", false) . "','" . sefRelToAbs('index.php?option=com_virtuemart&page=shop.browse&category_id=' . $db->f("category_id") . $itemid) . "',null,'" . $db->f("category_name", false) . "'\n ";
$ibg++;
/* recurse through the subcategories */
$this->traverse_tree_down($mymenu_content, $db->f("category_child_id"), $level);
/* let's see if the loop has reached its end */
$mymenu_content .= "]";
}
}
示例8: foreach
/**
* Validates all input parameters onBeforeAdd
*
* @param array $d
* @return boolean
*/
function validate_add(&$d)
{
global $auth, $VM_LANG, $vmLogger, $vmInputFilter;
$valid = true;
$d['missing'] = "";
if (empty($auth['user_id'])) {
$vmLogger->err($VM_LANG->_('MUST_NOT_USE'));
$valid = false;
return $valid;
}
require_once CLASSPATH . 'ps_userfield.php';
$shippingFields = ps_userfield::getUserFields('shipping', false, '', true);
$skipFields = ps_userfield::getSkipFields();
foreach ($shippingFields as $field) {
if ($field->required == 0) {
continue;
}
if (in_array($field->name, $skipFields)) {
continue;
}
if (empty($d[$field->name])) {
$valid = false;
$vmLogger->err($VM_LANG->_('VM_ENTER_VALUE_FIELD') . ' "' . ($VM_LANG->_($field->title) != '' ? $VM_LANG->_($field->title) : $field->title) . '"');
}
}
if (empty($d['user_info_id'])) {
$db = new ps_DB();
$q = "SELECT user_id from #__{vm}_user_info ";
$q .= "WHERE address_type_name='" . $db->getEscaped($d["address_type_name"]) . "' ";
$q .= "AND address_type='" . $db->getEscaped($d["address_type"]) . "' ";
$q .= "AND user_id = " . (int) $d["user_id"];
$db->query($q);
if ($db->next_record()) {
$d['missing'] .= "address_type_name";
$vmLogger->warning($VM_LANG->_('VM_USERADDRESS_ERR_LABEL_EXISTS'));
$valid = false;
}
}
return $valid;
}
示例9:
function validate_update(&$d)
{
global $VM_LANG, $vmLogger;
/* init the database */
$coupon_db = new ps_DB();
$valid = true;
/* make sure the coupon_code does not exist */
$q = "SELECT coupon_code FROM #__{vm}_coupons WHERE coupon_code = '" . $coupon_db->getEscaped($d['coupon_code']) . "' AND coupon_id <> '" . $d['coupon_id'] . "'";
$coupon_db->query($q);
if ($coupon_db->next_record()) {
$vmLogger->err($VM_LANG->_('PHPSHOP_COUPON_CODE_EXISTS', false));
$valid = false;
}
if (empty($d['coupon_value']) || empty($d['coupon_code'])) {
$vmLogger->err($VM_LANG->_('PHPSHOP_COUPON_COMPLETE_ALL_FIELDS', false));
$valid = false;
}
if (!is_numeric($d['coupon_value'])) {
$vmLogger->err($VM_LANG->_('PHPSHOP_COUPON_VALUE_NOT_NUMBER', false));
$valid = false;
}
return $valid;
}
示例10: vmGet
/**
*/
function mail_question(&$d)
{
global $vmLogger, $Itemid, $_SESSION, $VM_LANG, $mosConfig_live_site, $mosConfig_lang, $sess;
$db = new ps_DB();
$product_id = (int) $d["product_id"];
$q = 'SELECT * FROM #__{vm}_product WHERE product_id=' . $product_id . ' AND product_publish=\'Y\'';
$db->query($q);
if (!$db->next_record()) {
$vmLogger->err($VM_LANG->_('NOT_AUTH', false));
return false;
}
if ($db->f("product_sku") != @$d["product_sku"]) {
$vmLogger->err($VM_LANG->_('NOT_AUTH', false));
return false;
}
$Itemid = $sess->getShopItemid();
$flypage = vmGet($_REQUEST, "flypage", null);
// product url
$product_url = $mosConfig_live_site . "/index.php?option=com_virtuemart&page=shop.product_details&flypage=" . urlencode($flypage) . "&product_id={$product_id}&Itemid={$Itemid}";
$dbv = new ps_DB();
$qt = "SELECT * from #__{vm}_vendor ";
$qt .= "WHERE vendor_id = '" . $_SESSION['ps_vendor_id'] . "'";
$dbv->query($qt);
$dbv->next_record();
$vendor_email = $dbv->f("contact_email");
$shopper_email = $d["email"];
$shopper_name = $d["name"];
$subject_msg = vmRequest::getVar('text', '', 'post');
$shopper_subject = sprintf($VM_LANG->_('VM_ENQUIRY_SHOPPER_EMAIL_SUBJECT'), $dbv->f("vendor_name"));
$shopper_msg = str_replace('{vendor_name}', $dbv->f("vendor_name"), $VM_LANG->_('VM_ENQUIRY_SHOPPER_EMAIL_MESSAGE'));
$shopper_msg = str_replace('{product_name}', $db->f("product_name"), $shopper_msg);
$shopper_msg = str_replace('{product_sku}', $db->f("product_sku"), $shopper_msg);
$shopper_msg = str_replace('{product_url}', $product_url, $shopper_msg);
$shopper_msg = vmHtmlEntityDecode($shopper_msg);
//
$vendor_subject = sprintf($VM_LANG->_('VM_ENQUIRY_VENDOR_EMAIL_SUBJECT'), $dbv->f("vendor_name"), $db->f("product_name"));
$vendor_msg = str_replace('{shopper_name}', $shopper_name, $VM_LANG->_('VM_ENQUIRY_VENDOR_EMAIL_MESSAGE'));
$vendor_msg = str_replace('{shopper_message}', $subject_msg, $vendor_msg);
$vendor_msg = str_replace('{shopper_email}', $shopper_email, $vendor_msg);
$vendor_msg = str_replace('{product_name}', $db->f("product_name"), $vendor_msg);
$vendor_msg = str_replace('{product_sku}', $db->f("product_sku"), $vendor_msg);
$vendor_msg = str_replace('{product_url}', $product_url, $vendor_msg);
$vendor_msg = vmHtmlEntityDecode($vendor_msg);
//END: set up text mail
/////////////////////////////////////
// Send text email
//
if (ORDER_MAIL_HTML == '0') {
// Mail receipt to the shopper
vmMail($vendor_email, $dbv->f("vendor_name"), $shopper_email, $shopper_subject, $shopper_msg, "");
// Mail receipt to the vendor
vmMail($shopper_email, $shopper_name, $vendor_email, $vendor_subject, $vendor_msg, "");
} elseif (ORDER_MAIL_HTML == '1') {
// Mail receipt to the vendor
$template = vmTemplate::getInstance();
$template->set_vars(array('vendorname' => $dbv->f("vendor_name"), 'subject' => nl2br($subject_msg), 'contact_name' => $shopper_name, 'contact_email' => $shopper_email, 'product_name' => $db->f("product_name"), 'product_s_description' => $db->f("product_s_desc"), 'product_url' => $product_url, 'product_sku' => $db->f("product_sku")));
if ($db->f("product_thumb_image")) {
$imagefile = pathinfo($db->f("product_thumb_image"));
$extension = $imagefile['extension'] == "jpg" ? "jpeg" : "jpeg";
$EmbeddedImages[] = array('path' => IMAGEPATH . "product/" . $db->f("product_thumb_image"), 'name' => "product_image", 'filename' => $db->f("product_thumb_image"), 'encoding' => "base64", 'mimetype' => "image/" . $extension);
$template->set('product_thumb', '<img src="cid:product_image" alt="product_image" border="0" />');
$body = $template->fetch('order_emails/enquiry_email.tpl.php');
$vendor_mail = vmMail($shopper_email, $shopper_name, $vendor_email, $vendor_subject, $body, $vendor_msg, true, null, null, $EmbeddedImages);
} else {
$template->set('product_thumb', '');
$body = $template->fetch('order_emails/enquiry_email.tpl.php');
$vendor_mail = vmMail($shopper_email, $shopper_name, $vendor_email, $vendor_subject, $body, $vendor_msg, true, null, null, null);
}
//Send sender confirmation email
$sender_mail = vmMail($vendor_email, $dbv->f("vendor_name"), $shopper_email, $shopper_subject, $shopper_msg, "");
if (!$vendor_mail || !$sender_mail) {
$vmLogger->debug('Something went wrong while sending the enquiry email to ' . $vendor_email . ' and ' . $shopper_email);
return false;
}
}
return true;
}
示例11:
$dbbt->query($q);
$dbbt->next_record();
$old_user = '';
if (!empty($user) && is_object($user)) {
$old_user = $user;
}
$user = $dbbt->record[0];
/** Retrieve Payment Info **/
$dbpm = new ps_DB();
$q = "SELECT * FROM `#__{vm}_payment_method` p, `#__{vm}_order_payment` op, `#__{vm}_orders` o ";
$q .= "WHERE op.order_id='{$order_id}' ";
$q .= "AND p.payment_method_id=op.payment_method_id ";
$q .= "AND o.user_id='" . $auth["user_id"] . "' ";
$q .= "AND o.order_id='{$order_id}' ";
$dbpm->query($q);
$dbpm->next_record();
$registrationfields = ps_userfield::getUserFields('registration', false, '', true, true);
$shippingfields = ps_userfield::getUserFields('shipping', false, '', true, true);
$tpl->set('db', $db);
$tpl->set('dbbt', $dbbt);
$tpl->set('dbpm', $dbpm);
$tpl->set('user', $user);
$tpl->set('order_id', $order_id);
$tpl->set('registrationfields', $registrationfields);
$tpl->set('shippingfields', $shippingfields);
$tpl->set('time_offset', $mosConfig_offset);
// Get the template for this page
echo $tpl->fetch('pages/account.order_details.tpl.php');
if (!empty($old_user) && is_object($old_user)) {
$user = $old_user;
}
示例12: updateRecords
//.........这里部分代码省略.........
$db->query();
/**
* Insert the User Billto & Shipto Info
*/
// First: get all the fields from the user field list to copy them from user_info into the order_user_info
$fields = array();
require_once CLASSPATH . 'ps_userfield.php';
$userfields = ps_userfield::getUserFields('', false, '', true, true);
foreach ($userfields as $field) {
if ($field->name == 'email') {
$fields[] = 'user_email';
} else {
$fields[] = $field->name;
}
}
$fieldstr = implode(',', $fields);
// Save current Bill To Address
$q = "INSERT INTO `#__{vm}_order_user_info` \n\t\t\t(`order_info_id`,`order_id`,`user_id`,address_type, " . $fieldstr . ") ";
$q .= "SELECT NULL, '{$order_id}', '" . $auth['user_id'] . "', address_type, " . $fieldstr . " FROM #__{vm}_user_info WHERE user_id='" . $auth['user_id'] . "' AND address_type='BT'";
$db->query($q);
// Save current Ship to Address if applicable
$q = "INSERT INTO `#__{vm}_order_user_info` \n\t\t\t(`order_info_id`,`order_id`,`user_id`,address_type, " . $fieldstr . ") ";
$q .= "SELECT NULL, '{$order_id}', '" . $auth['user_id'] . "', address_type, " . $fieldstr . " FROM #__{vm}_user_info WHERE user_id='" . $auth['user_id'] . "' AND user_info_id='" . $d['ship_to_info_id'] . "' AND address_type='ST'";
$db->query($q);
/**
* Insert all Products from the Cart into order line items;
* one row per product in the cart
*/
$dboi = new ps_DB();
for ($i = 0; $i < $cart["idx"]; $i++) {
$r = "SELECT product_id,product_in_stock,product_sales,product_parent_id,product_sku,product_name ";
$r .= "FROM #__{vm}_product WHERE product_id='" . $cart[$i]["product_id"] . "'";
$dboi->query($r);
$dboi->next_record();
$product_price_arr = $ps_product->get_adjusted_attribute_price($cart[$i]["product_id"], $cart[$i]["description"]);
$product_price = $GLOBALS['CURRENCY']->convert($product_price_arr["product_price"], $product_price_arr["product_currency"]);
if (empty($_SESSION['product_sess'][$cart[$i]["product_id"]]['tax_rate'])) {
$my_taxrate = $ps_product->get_product_taxrate($cart[$i]["product_id"]);
} else {
$my_taxrate = $_SESSION['product_sess'][$cart[$i]["product_id"]]['tax_rate'];
}
// Attribute handling
$product_parent_id = $dboi->f('product_parent_id');
$description = '';
if ($product_parent_id > 0) {
$db_atts = $ps_product->attribute_sql($dboi->f('product_id'), $product_parent_id);
while ($db_atts->next_record()) {
$description .= $db_atts->f('attribute_name') . ': ' . $db_atts->f('attribute_value') . '; ';
}
}
$description .= $ps_product->getDescriptionWithTax($_SESSION['cart'][$i]["description"], $dboi->f('product_id'));
$product_final_price = round($product_price * ($my_taxrate + 1), 2);
$vendor_id = $ps_vendor_id;
$fields = array('order_id' => $order_id, 'user_info_id' => $d["ship_to_info_id"], 'vendor_id' => $vendor_id, 'product_id' => $cart[$i]["product_id"], 'order_item_sku' => $dboi->f("product_sku"), 'order_item_name' => $dboi->f("product_name"), 'product_quantity' => $cart[$i]["quantity"], 'product_item_price' => $product_price, 'product_final_price' => $product_final_price, 'order_item_currency' => $GLOBALS['product_currency'], 'order_status' => 'P', 'product_attribute' => $description, 'cdate' => $timestamp, 'mdate' => $timestamp);
$db->buildQuery('INSERT', '#__{vm}_order_item', $fields);
$db->query();
// Update Stock Level and Product Sales, decrease - no matter if in stock or not!
$q = "UPDATE #__{vm}_product ";
$q .= "SET product_in_stock = product_in_stock - " . (int) $cart[$i]["quantity"];
$q .= " WHERE product_id = '" . $cart[$i]["product_id"] . "'";
$db->query($q);
$q = "UPDATE #__{vm}_product ";
$q .= "SET product_sales= product_sales + " . (int) $cart[$i]["quantity"];
$q .= " WHERE product_id='" . $cart[$i]["product_id"] . "'";
$db->query($q);
// Update stock of parent product, if all child products are sold, thanks Ragnar Brynjulfsson
示例13: while
(<?php
echo $VM_LANG->_('PHPSHOP_USER_FORM_ADD_SHIPTO_LBL');
?>
)</a>
<table class="adminlist">
<tr>
<td >
<?php
$qt = "SELECT * from #__{vm}_user_info WHERE user_id='{$user_id}' AND address_type='ST'";
$dbt = new ps_DB();
$dbt->query($qt);
if (!$dbt->num_rows()) {
echo "No shipping addresses.";
} else {
while ($dbt->next_record()) {
$url = $sess->url($_SERVER['PHP_SELF'] . "?page={$modulename}.user_address_form&user_id={$user_id}&user_info_id=" . $dbt->f("user_info_id"));
echo '» <a href="' . $sess->url($url) . '">';
echo $dbt->f("address_type_name") . "</a><br/>";
}
}
?>
</td>
</tr>
</table>
</fieldset>
<?php
}
require_once CLASSPATH . 'ps_userfield.php';
// Get only those fields that are NOT system fields
示例14: strrchr
$file->file_name = IMAGEPATH . 'product/' . $db->f('file_name');
$file->product_name = $db->f('product_name');
$file->file_url = IMAGEURL . 'product/' . $db->f('file_name');
$file->product_thumb_image = $db->f('product_thumb_image');
$file->file_title = $db->f('file_name');
$file->file_is_image = 1;
$file->file_product_id = $product_id;
$file->file_extension = strrchr($db->f('file_name'), '.');
$file->file_published = $db->f('product_publish');
$files[] = $file;
}
$dbf = new ps_DB();
$sql = 'SELECT attribute_value FROM #__{vm}_product_attribute WHERE `product_id` = ' . $product_id . ' AND attribute_name=\'download\'';
$dbf->query($sql);
$downloadFiles = array();
while ($dbf->next_record()) {
$downloadFiles[] = $dbf->f('attribute_value');
}
$q = "SELECT file_id, file_is_image, file_product_id, file_extension, file_url, file_published, file_name, file_title, file_image_thumb_height, file_image_thumb_width FROM #__{vm}_product_files ";
$q .= "WHERE file_product_id = '{$product_id}' ";
$q .= "ORDER BY file_is_image DESC";
$db->query($q);
$db->next_record();
if (!empty($files)) {
$db->record = array_merge($files, $db->record);
}
if ($db->num_rows() < 1 && $task != "cancel") {
vmRedirect($_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.file_form&product_id={$product_id}&no_menu=" . @$_REQUEST['no_menu']);
}
$db->reset();
$arr = array();
示例15: switch
function _tax_based_on_vendor_address($ship_to_info_id = '')
{
global $auth;
global $vmLogger;
switch (TAX_MODE) {
case '0':
return false;
case '1':
return true;
case '17749':
$ship_to_info_id = !empty($ship_to_info_id) ? $ship_to_info_id : vmGet($_REQUEST, 'ship_to_info_id');
$db = new ps_DB();
$q = "SELECT country FROM #__{vm}_user_info WHERE user_info_id='" . $ship_to_info_id . "'";
$db->query($q);
$db->next_record();
$ship_country = $db->f("country");
if (!array_key_exists('country', $auth) || empty($ship_country)) {
$vmLogger->debug('shopper\'s country is not known; defaulting to vendor-based tax');
return true;
}
if ($ship_to_info_id) {
$vmLogger->debug('shopper shipping in ' . $ship_country);
$auth_country = $ship_country;
} else {
$vmLogger->debug('shopper is in ' . $auth['country']);
$auth_country = $auth['country'];
}
return ps_checkout::country_in_eu_common_vat_zone($auth_country);
default:
$vmLogger->warning('unknown TAX_MODE "' . TAX_MODE . '"');
return true;
}
}