Example #1
0
 function delete(&$d)
 {
     #    global $ps_user;
     $db = new ps_DB();
     $user_info_id = vmGet($d, 'user_info_id');
     if (empty($user_info_id)) {
         $d['error'] = "Please provide an user info id!";
         return false;
     }
     if (is_array($user_info_id)) {
         foreach ($user_info_id as $affiliate) {
             $q = "DELETE FROM #__{vm}_affiliate WHERE user_id ='" . (int) $affiliate . "' ";
             $db->query($q);
         }
     } else {
         $q = "DELETE FROM #__{vm}_affiliate WHERE user_id ='" . (int) $user_info_id . "' ";
         $db->query($q);
     }
     return True;
 }
Example #2
0
 function save(&$d)
 {
     global $VM_LANG, $vmLogger;
     $ps_vendor_id = $_SESSION["ps_vendor_id"];
     $db = new ps_DB();
     $shipping_class = basename(vmGet($d, "shipping_class"));
     if (file_exists(CLASSPATH . "shipping/" . $shipping_class . ".php")) {
         include CLASSPATH . "shipping/" . $shipping_class . ".php";
         $_SHIPPING = new $shipping_class();
         if ($_SHIPPING->configfile_writeable()) {
             $_SHIPPING->write_configuration($d);
             $vmLogger->info($VM_LANG->_('VM_CONFIGURATION_CHANGE_SUCCESS', false));
             return True;
         } else {
             $vmLogger->err(sprintf($VM_LANG->_('VM_CONFIGURATION_CHANGE_FAILURE', false), CLASSPATH . "payment/" . $_SHIPPING->classname . ".cfg.php"));
             return false;
         }
     } else {
         $vmLogger->err('The shipping class file ' . CLASSPATH . "shipping/" . $d["shipping_class"] . ".php could not be found.");
         return false;
     }
 }
* @subpackage html
* @copyright Copyright (C) 2004-2008 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
vmCommonHTML::loadMooTools();
$function_id = vmGet($_REQUEST, 'function_id');
$module_id = vmGet($_REQUEST, 'module_id');
$option = empty($option) ? vmGet($_REQUEST, 'option', 'com_virtuemart') : $option;
if (!empty($function_id)) {
    $q = "SELECT * from #__{vm}_function where function_id='{$function_id}'";
    $db->query($q);
    $db->next_record();
}
//First create the object and let it print a form heading
$formObj = new formFactory($VM_LANG->_('PHPSHOP_FUNCTION_FORM_LBL'));
//Then Start the form
$formObj->startForm();
?>
 
  <table class="adminform">
    <tr> 
      <td colspan="2">&nbsp;</td>
    </tr>
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
//First create the object and let it print a form heading
$formObj =& new formFactory($VM_LANG->_('PHPSHOP_ZONE_MOD'));
//Then Start the form
$formObj->startForm();
$option = empty($option) ? vmGet($_REQUEST, 'option', 'com_virtuemart') : $option;
$zone_id = vmGet($_REQUEST, 'zone_id');
if (!empty($zone_id)) {
    $q = "SELECT * FROM #__{vm}_zone_shipping WHERE zone_id='{$zone_id}'";
    $db->query($q);
    $db->next_record();
}
?>
<br/>

<table class="adminform">
	<tr>
		<td valign="top">
			<div align="right"><strong><?php 
echo $VM_LANG->_('PHPSHOP_ZONE_FORM_NAME_LBL');
?>
:&nbsp;</strong></div>
Example #5
0
 function showRecommendForm($product_id)
 {
     global $VM_LANG, $vendor_store_name, $sess, $my;
     $sender_name = shopMakeHtmlSafe(vmGet($_REQUEST, 'sender_name', null));
     $sender_mail = shopMakeHtmlSafe(vmGet($_REQUEST, 'sender_mail', null));
     $recipient_mail = shopMakeHtmlSafe(vmGet($_REQUEST, 'recipient_mail', null));
     $message = shopMakeHtmlSafe(vmGet($_REQUEST, 'recommend_message'));
     echo '
 <form action="index2.php" method="post">
 
 <table border="0" cellspacing="2" cellpadding="1" width="80%">
   <tr>
     <td>' . $VM_LANG->_('EMAIL_FRIEND_ADDR') . '</td>
     <td><input type="text" name="recipient_mail" size="50" value="' . (!empty($recipient_mail) ? $recipient_mail : '') . '" /></td>
   </tr>
   <tr>
     <td>' . $VM_LANG->_('EMAIL_YOUR_NAME') . '</td>
     <td><input type="text" name="sender_name" size="50" value="' . (!empty($sender_name) ? $sender_name : $my->name) . '" /></td>
   </tr>
   <tr>
     <td>' . $VM_LANG->_('EMAIL_YOUR_MAIL') . '</td>
     <td><input type="text" name="sender_mail" size="50" value="' . (!empty($sender_mail) ? $sender_mail : $my->email) . '" /></td>
   </tr>
   <tr>
     <td colspan="2">' . $VM_LANG->_('VM_RECOMMEND_FORM_MESSAGE') . '</td>
   </tr>
   <tr>
     <td colspan="2">
       <textarea name="recommend_message" style="width: 100%; height: 200px">';
     if (!empty($message)) {
         echo stripslashes(str_replace(array('\\r', '\\n'), array("\r", "\n"), $message));
     } else {
         $msg = sprintf($VM_LANG->_('VM_RECOMMEND_MESSAGE', false), $vendor_store_name, $sess->url(URL . 'index.php?page=shop.product_details&product_id=' . $product_id, true));
         echo shopMakeHtmlSafe(stripslashes(str_replace('index2.php', 'index.php', $msg)));
     }
     echo '</textarea>
     </td>
   </tr>
 </table>
 
 <input type="hidden" name="option" value="com_virtuemart" />
 <input type="hidden" name="page" value="shop.recommend" />
 <input type="hidden" name="product_id" value="' . $product_id . '" />
 <input type="hidden" name="' . vmCreateHash() . '" value="1" />
 <input type="hidden" name="Itemid" value="' . $sess->getShopItemid() . '" />
 <input type="hidden" name="func" value="recommendProduct" />
 <input class="button" type="submit" name="submit" value="' . $VM_LANG->_('PHPSHOP_SUBMIT') . '" />
 <input class="button" type="button" onclick="window.close();" value="' . $VM_LANG->_('CMN_CANCEL') . '" />
 </form>
 ';
 }
        								'address_2' => $db->f("address_2"),
        								'state' => $db->f("state"),
        								'state_name' => $state_name,
        								'zip' => $db->f("zip"),
        								'city' => $db->f("city"),
        								'country' => $db->f('country')
        							), true );
	
	echo "</td></tr>";
}

// Print out the Selected Shipping Method
if(!ps_checkout::noShippingMethodNecessary()) {

	echo '<tr><td valign="top"><strong>'.$VM_LANG->_('PHPSHOP_INFO_MSG_SHIPPING_METHOD') . ":</strong></td>";
	$rate_details = explode( "|", urldecode(urldecode(vmGet($_REQUEST,'shipping_rate_id'))) );
	echo '<td>';
	foreach( $rate_details as $k => $v ) {
		// thepisu: old sample data cointaned "&gt;" instead of ">"... 
		// so we don't have to make safe if "&gt;" is found
		if (strpos($v,"&gt;")===false) {
			$v = shopMakeHtmlSafe($v);
		}
		if( $k == 3 ) {
			echo $CURRENCY_DISPLAY->getFullValue( $v )."; ";
		} elseif( $k > 0 && $k < 4) {
			echo $v.'; ';
		}
	}
	echo "</td></tr>";
}
            $action = $mm_action_url . 'index.php?option=com_user&amp;task=login';
            // Login return URL
            $uri = JFactory::getURI();
            $url = $uri->toString(array('path', 'query', 'fragment'));
            $return = base64_encode($url);
            // Lost password
            $reset = JRoute::_('index.php?option=com_user&amp;view=reset');
            // User name reminder (Joomla 1.5 only)
            $remind_url = JRoute::_('index.php?option=com_user&amp;view=remind');
        } else {
            // Login URL
            $action = $mm_action_url . 'index.php?option=login';
            // Login return URL
            $return = $sess->url($mm_action_url . 'index.php?' . $_SERVER['QUERY_STRING']);
            // Lost password url
            $reset = sefRelToAbs('index.php?option=com_registration&amp;task=lostPassword&amp;Itemid=' . (int) vmGet($_REQUEST, 'Itemid', 0));
            // Set user name reminder to nothing
            $remind_url = '';
        }
        ?>
 	  
		<tr>
		  <td colspan="2" align="left" valign="top" style="margin: 0px; padding: 0px;">
			<form action="<?php 
        echo $action;
        ?>
" method="post" name="login" id="login">
			<label for="username_vm_login"><?php 
        echo $VM_LANG->_('USERNAME');
        ?>
</label><br/>
Example #8
0
/**
 * Checks if the Request is a XML HTTP Request (via Ajax)
 * @since 1.1.1
 * @return boolean
 */
function vmIsXHR()
{
    return strtolower(vmGet($_SERVER, 'HTTP_X_REQUESTED_WITH')) == 'xmlhttprequest' || vmGet($_REQUEST, 'ajax_request') == '1';
}
* @subpackage html
* @copyright Copyright (C) 2004-2008 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
include_class("vendor");
global $ps_vendor;
$shopper_group_id = vmGet($_REQUEST, 'shopper_group_id', null);
$option = vmGet($_REQUEST, 'option', 'com_virtuemart');
//First create the object and let it print a form heading
$formObj = new formFactory($VM_LANG->_('PHPSHOP_SHOPPER_GROUP_FORM_LBL'));
//Then Start the form
$formObj->startForm();
if (!empty($shopper_group_id)) {
    $q = "SELECT * FROM #__{vm}_shopper_group ";
    $q .= "WHERE shopper_group_id='{$shopper_group_id}'";
    if (!$perm->check("admin")) {
        $q .= " AND vendor_id = '{$ps_vendor_id}'";
    }
    $db->query($q);
    $db->next_record();
}
?>
<table class="adminform">
Example #10
0
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
global $ps_product_category;
$old_category_id = vmGet($_REQUEST, 'old_category_id');
if ($old_category_id) {
    $category_id = $old_category_id;
}
$products = vmGet($_POST, 'product_id');
$count = count($products);
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" name="adminForm">';
$clean_products = array();
for ($i = 0; $i < $count; $i++) {
    $clean_products[$i] = intval($products[$i]);
    echo '<input type="hidden" name="product_id[]" value="' . $clean_products[$i] . '" />';
}
$products = $clean_products;
$db->query('SELECT `product_name` FROM `#__{vm}_product` WHERE `product_id` IN(' . implode(',', $products) . ') ORDER BY `product_name`');
echo "\n<h1 class=\"header\">" . $VM_LANG->_('VM_PRODUCTS_MOVE_LBL') . "</h1>\n";
echo '<table class="adminform"><tr>';
echo '<th>' . $VM_LANG->_('VM_PRODUCTS_MOVE_TO_CATEGORY') . "</th>\n";
echo '<th>' . sprintf($VM_LANG->_('VM_PRODUCTS_MOVE_LIST'), $count) . "</th>\n";
echo '</tr><tr>';
echo '<td valign="top">';
 /**
  * Retrieves the Shopper Group Info of the SG specified by $id
  *
  * @param int $id
  * @param boolean $default_group
  * @return array
  */
 function get_shoppergroup_by_id($id, $default_group = false)
 {
     $ps_vendor_id = vmGet($_SESSION, 'ps_vendor_id', 1);
     $db = new ps_DB();
     $q = "SELECT #__{vm}_shopper_group.shopper_group_id, show_price_including_tax, `default`, shopper_group_discount \r\n    \t\tFROM `#__{vm}_shopper_group`";
     if (!empty($id) && !$default_group) {
         $q .= ",`#__{vm}_shopper_vendor_xref`";
         $q .= " WHERE #__{vm}_shopper_vendor_xref.user_id='" . $id . "' AND ";
         $q .= "#__{vm}_shopper_group.shopper_group_id=#__{vm}_shopper_vendor_xref.shopper_group_id";
     } else {
         $q .= " WHERE #__{vm}_shopper_group.vendor_id='{$ps_vendor_id}' AND `default`='1'";
     }
     $db->query($q);
     if ($db->next_record()) {
         //not sure that is is filled in database (Steve)
         $group["shopper_group_id"] = $db->f("shopper_group_id");
         $group["shopper_group_discount"] = $db->f("shopper_group_discount");
         $group["show_price_including_tax"] = $db->f("show_price_including_tax");
         $group["default_shopper_group"] = $db->f("default");
     } else {
         $q = "SELECT #__{vm}_shopper_group.shopper_group_id, show_price_including_tax, `default`, shopper_group_discount \r\n    \t\t\t\tFROM `#__{vm}_shopper_group`\r\n    \t\t\t\tWHERE #__{vm}_shopper_group.vendor_id='{$ps_vendor_id}' AND `default`='1'";
         $db->query($q);
         $db->next_record();
         $group["shopper_group_id"] = $db->f("shopper_group_id");
         $group["shopper_group_discount"] = $db->f("shopper_group_discount");
         $group["show_price_including_tax"] = $db->f("show_price_including_tax");
         $group["default_shopper_group"] = $db->f("default");
     }
     return $group;
 }
Example #12
0
/* make sure this is the checkout screen */
if ($cart["idx"] == 0) {
    echo $VM_LANG->_('PHPSHOP_EMPTY_CART');
    $checkout = False;
} else {
    $checkout = True;
    $payment_method_id = vmGet($_REQUEST, "payment_method_id");
    $total = 0;
    // Added for the zone shipping module
    $vars["zone_qty"] = 0;
    $weight_total = 0;
    $weight_subtotal = 0;
    $tax_total = 0;
    $shipping_total = $shipping_tax = 0;
    $order_total = 0;
    $coupon_discount = vmGet($_SESSION, 'coupon_discount', 0);
    $coupon_discount_before = $coupon_discount_after = $payment_discount_before = $payment_discount_after = $tax = $shipping = false;
    $product_rows = array();
    for ($i = 0; $i < $cart["idx"]; $i++) {
        // Added for the zone shipping module
        $vars["zone_qty"] += $cart[$i]["quantity"];
        if ($i % 2) {
            $product_rows[$i]['row_color'] = "sectiontableentry2";
        } else {
            $product_rows[$i]['row_color'] = "sectiontableentry1";
        }
        // Get product parent id if exists
        $product_parent_id = $ps_product->get_field($cart[$i]["product_id"], "product_parent_id");
        // Get flypage for this product
        $flypage = $ps_product->get_flypage($cart[$i]["product_id"]);
        // Build URL based on whether item or product
Example #13
0
 /**
  * Updates a given Credit Card Record
  *
  * @param array $d
  * @return boolean
  */
 function update(&$d)
 {
     global $VM_LANG;
     $db = new ps_DB();
     $timestamp = time();
     if (!$this->validate_update($d)) {
         $d["error"] = $this->error;
         return False;
     }
     $fields = array('vendor_id' => $_SESSION["ps_vendor_id"], 'creditcard_name' => vmGet($d, 'creditcard_name'), 'creditcard_code' => vmGet($d, 'creditcard_code'));
     $db->buildQuery('UPDATE', '#__{vm}_creditcard', $fields, 'WHERE creditcard_id=' . (int) $d["creditcard_id"]);
     if ($db->query()) {
         $GLOBALS['vmLogger']->info($VM_LANG->_('VM_CREDITCARD_UPDATED'));
         $_REQUEST['creditcard_id'] = $db->last_insert_id();
         return true;
     }
     return false;
 }
$vmLayout = vmGet($_COOKIE, 'vmLayout', 'standard');
// Change the Layout Type if it is provided through GET
if (!empty($_GET['vmLayout'])) {
    $vmLayout = $_GET['vmLayout'] == 'standard' ? $_GET['vmLayout'] : 'extended';
}
// Remember the Cookie for 1 Week
ob_get_level() or ob_start();
setcookie('vmLayout', $vmLayout, time() + 604800);
// pages, which are called through index3.php are PopUps, they should not need a menu (but it can be overridden by $_REQUEST['no_menu'])
$no_menu_default = strstr($_SERVER['SCRIPT_NAME'], 'index3.php') ? 1 : 0;
$no_menu = $_REQUEST['no_menu'] = vmGet($_REQUEST, 'no_menu', $no_menu_default);
// Display the toolbar?
$no_toolbar = vmGet($_REQUEST, 'no_toolbar', 0);
// Display just the naked page without toolbar, menu and footer?
$only_page_default = strstr($_SERVER['SCRIPT_NAME'], 'index3.php') ? 1 : 0;
$only_page = $_REQUEST['only_page'] = vmGet($_REQUEST, 'only_page', $only_page_default);
if (empty($page) || empty($_REQUEST['page'])) {
    if (!empty($_REQUEST['amp;page'])) {
        $page = $_REQUEST['amp;page'];
        foreach ($_REQUEST as $key => $val) {
            if (strstr($key, 'amp;')) {
                $key = str_replace('amp;', '', $key);
                $_REQUEST[$key] = $val;
            }
        }
    } else {
        $page = vmget($_SESSION, 'last_page', 'store.index');
    }
}
$limit = $vm_mainframe->getUserStateFromRequest("viewlistlimit", 'limit', $mosConfig_list_limit);
$limitstart = $vm_mainframe->getUserStateFromRequest("view{$page}{$product_id}{$category_id}limitstart", 'limitstart', 0);
Example #15
0
     $search_string = $mm_action_url . "index.php?option=com_virtuemart&amp;Itemid={$Itemid}&amp;category_id={$category_id}&amp;page={$modulename}.browse";
     $search_string .= empty($manufacturer_id) ? '' : "&amp;manufacturer_id={$manufacturer_id}";
     $search_string .= empty($keyword) ? '' : '&amp;keyword=' . urlencode($keyword);
     if (!empty($keyword1)) {
         $search_string .= "&amp;keyword1=" . urlencode($keyword1);
         $search_string .= "&amp;search_category=" . urlencode($search_category);
         $search_string .= "&amp;search_limiter={$search_limiter}";
         if (!empty($keyword2)) {
             $search_string .= "&amp;keyword2=" . urlencode($keyword2);
             $search_string .= "&amp;search_op=" . urlencode($search_op);
         }
     }
     if (!empty($product_type_id)) {
         foreach ($_REQUEST as $key => $value) {
             if (substr($key, 0, 13) == "product_type_") {
                 $val = vmGet($_REQUEST, $key);
                 if (is_array($val)) {
                     foreach ($val as $var) {
                         $search_string .= "&" . $key . "[]=" . urlencode($var);
                     }
                 } else {
                     $search_string .= "&" . $key . "=" . urlencode($val);
                 }
             }
         }
     }
 }
 $tpl->set('VM_BROWSE_ORDERBY_FIELDS', $VM_BROWSE_ORDERBY_FIELDS);
 if ($DescOrderBy == "DESC") {
     $icon = "sort_desc.png";
     $selected = array("selected=\"selected\"", "");
Example #16
0
</span><br />
	<?php 
echo JText::_('COM_VIRTUEMART_UPDATE_WARNING_TEXT');
?>
</div>
<div class="shop_info">
	<span style="font-style: italic;"><?php 
echo JText::_('COM_VIRTUEMART_UPDATE_PATCH_DETAILS');
?>
</span><br />
	<ul>
		<li><?php 
echo JText::_('COM_VIRTUEMART_UPDATE_PATCH_DESCRIPTION');
?>
: <?php 
echo vmGet($packageContents, 'description', null, JREQUEST_ALLOWHTML);
?>
</li>
		<li><?php 
echo JText::_('COM_VIRTUEMART_UPDATE_PATCH_DATE');
?>
: <?php 
echo $packageContents['releasedate'];
?>
</li>
	</ul>
</div>
<table class="adminlist" cellspacing="0" cellpadding="0">
	<thead>
	  <tr>
	    <th class="title"><?php 
Example #17
0
 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;
     }
 }
Example #18
0
* @copyright Copyright (C) 2004-2005 Soeren Eberhardt. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
if (!isset($_REQUEST["order_id"]) || empty($_REQUEST["order_id"])) {
    echo $VM_LANG->_('VM_CHECKOUT_ORDERIDNOTSET');
} else {
    include CLASSPATH . "payment/ps_paypal.cfg.php";
    $order_id = intval(vmGet($_REQUEST, "order_id"));
    $q = "SELECT order_id, order_status FROM #__{vm}_orders WHERE ";
    $q .= "#__{vm}_orders.user_id= " . $auth["user_id"] . " ";
    $q .= "AND #__{vm}_orders.order_id= {$order_id} ";
    $db->query($q);
    if ($db->next_record()) {
        $order_status = $db->f("order_status");
        $d['order_id'] = $db->f("order_id");
        //if($_REQUEST['x_response_code'] == '1') {
        if (substr($_REQUEST['result'], 0, 2) == '00') {
            // UPDATE THE ORDER STATUS to 'PAID'
            $d['order_status'] = "D";
            require_once CLASSPATH . 'ps_order.php';
            $ps_order = new ps_order();
            $ps_order->order_status_update($d);
            ?>
Example #19
0
 /**
  * validate order export module update
  * @param array
  * @return bool
  * @author Manfred Dennerlein Rodelo <*****@*****.**>
  */
 function validate_update(&$d)
 {
     global $vmLogger, $VM_LANG;
     $db = new ps_DB();
     if (!$d['export_id']) {
         $vmLogger->err($VM_LANG->_('VM_EXPORT_ERR_UPDATE_SELECT'));
         return False;
     }
     if (!$d['export_name']) {
         $vmLogger->err($VM_LANG->_('VM_EXPORT_ERR_MODULE_NAME'));
         return False;
     }
     if (!file_exists(CLASSPATH . 'export/' . $d['export_class'] . '.php')) {
         $vmLogger->err($VM_LANG->_('VM_EXPORT_ERR_CLASS_NOT_EXIST'));
         return false;
     }
     $d['export_config'] = vmGet($_POST, 'export_config', '', VMREQUEST_ALLOWHTML);
     $d['export_config'] = addslashes($d['export_config']);
     return True;
 }
 * @package VirtueMart
 * @subpackage html
 * @copyright Copyright (C) 2004-2007 soeren - All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
 *
 * http://virtuemart.net
 */
mm_showMyFileName(__FILE__);
require_once CLASSPATH . "pageNavigation.class.php";
require_once CLASSPATH . "htmlTools.class.php";
$country_id = vmGet($_REQUEST, 'country_id');
if (is_array($country_id)) {
    $country_id = $country_id[0];
}
if (empty($country_id)) {
    vmRedirect($_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=admin.country_list", "A country ID could not be found");
}
$db->query("SELECT country_name FROM #__{vm}_country WHERE country_id='{$country_id}'");
$db->next_record();
$title = $VM_LANG->_('PHPSHOP_STATE_LIST_LBL') . " " . $db->f("country_name");
$q = "SELECT SQL_CALC_FOUND_ROWS * FROM #__{vm}_state ";
$search = '';
if (!empty($keyword)) {
    $search .= "AND ( state_name LIKE '%{$keyword}%' OR ";
    $search .= "state_2_code LIKE '%{$keyword}%' OR ";
    $search .= "state_3_code LIKE '%{$keyword}%' ";
*
* @version $Id: store.shipping_module_form.php 1584 2008-12-04 20:41:32Z soeren_nb $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2008 soeren - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
$shipping_module = vmGet($_REQUEST, 'shipping_module', null);
if ($shipping_module) {
    if (!(include CLASSPATH . 'shipping/' . basename($shipping_module))) {
        vmRedirect($_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=store.shipping_modules", str_replace('{shipping_module}', $shipping_module, $VM_LANG->_('VM_SHIPPING_MODULE_CLASSERROR')));
    } else {
        $classname = basename($shipping_module, ".php");
        if (class_exists($classname)) {
            $_SHIPPING = new $classname();
        }
    }
    $ps_html->writableIndicator(CLASSPATH . "shipping/" . basename($shipping_module, ".php") . '.cfg.php');
    ?>
  <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
  <script type="text/javascript" src="<?php 
    echo $mosConfig_live_site;
    ?>
 /**
  * Updates an Order Status
  *
  * @param array $d
  * @return boolean
  */
 function update(&$d)
 {
     global $VM_LANG;
     $db = new ps_DB();
     $ps_vendor_id = $_SESSION["ps_vendor_id"];
     if (!$this->validate_update($d)) {
         return False;
     }
     $fields = array('order_status_code' => vmGet($d, 'order_status_code'), 'order_status_name' => vmGet($d, 'order_status_name'), 'order_status_description' => vmGet($d, 'order_status_description'), 'list_order' => vmRequest::getInt('list_order'));
     $db->buildQuery('UPDATE', $this->_table_name, $fields, "WHERE order_status_id=" . (int) $d["order_status_id"] . " AND vendor_id={$ps_vendor_id}");
     if ($db->query() !== false) {
         $GLOBALS['vmLogger']->info($VM_LANG->_('VM_ORDERSTATUS_UPDATED'));
         return true;
     }
     return false;
 }
Example #23
0
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
global $ps_shopper_group, $ps_product;
global $acl, $database;
include_class('shopper');
include_class('product');
if (!isset($ps_shopper_group)) {
    $ps_shopper_group = new ps_shopper_group();
}
$user_id = intval(vmGet($_REQUEST, 'user_id'));
$cid = vmRequest::getVar('cid', array(0), '', 'array');
if (!empty($user_id)) {
    $q = "SELECT * FROM #__users AS u LEFT JOIN #__{vm}_user_info AS ui ON id=user_id ";
    $q .= "WHERE id={$user_id} ";
    $q .= "AND (address_type='BT' OR address_type IS NULL ) ";
    $q .= "AND gid <= " . $my->gid;
    $db->query($q);
    $db->next_record();
}
// Set up the CMS General User Information
$row = new mosUser($database);
$row->load((int) $user_id);
if ($user_id) {
    $query = "SELECT *" . "\n FROM #__contact_details" . "\n WHERE user_id = " . (int) $row->id;
    $database->setQuery($query);
Example #24
0
 /**
  * Assembles the string "quantity_options" for storage in the product table
  *
  * @param array $d
  * @return string
  */
 function set_quantity_options(&$d)
 {
     return vmGet($d, 'quantity_box') . "," . vmRequest::getInt('quantity_start') . "," . vmRequest::getInt('quantity_end') . "," . vmRequest::getInt('quantity_step');
 }
Example #25
0
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
global $vendor_currency, $user;
require_once CLASSPATH . 'ps_order_status.php';
require_once CLASSPATH . 'ps_userfield.php';
require_once CLASSPATH . 'ps_checkout.php';
require_once CLASSPATH . 'ps_product.php';
$ps_product = new ps_product();
$tpl = vmTemplate::getInstance();
$print = vmGet($_REQUEST, 'pop', 0);
$order_id = vmGet($_REQUEST, 'order_id', 0);
$tpl->set('print', $print);
$tpl->set('order_id', $order_id);
$db = new ps_DB();
$q = "SELECT * FROM `#__{vm}_orders` WHERE ";
$q .= "user_id=" . $auth["user_id"] . " AND order_id='{$order_id}'";
$db->query($q);
if ($db->next_record()) {
    $mainframe->setPageTitle($VM_LANG->_('PHPSHOP_ACC_ORDER_INFO') . ' : ' . $VM_LANG->_('PHPSHOP_ORDER_LIST_ID') . ' ' . $db->f('order_id'));
    require_once CLASSPATH . 'ps_product_category.php';
    // Set the CMS pathway
    $pathway = array();
    $pathway[] = $vm_mainframe->vmPathwayItem($VM_LANG->_('PHPSHOP_ACCOUNT_TITLE'), $sess->url(SECUREURL . 'index.php?page=account.index'));
    $pathway[] = $vm_mainframe->vmPathwayItem($VM_LANG->_('PHPSHOP_ACC_ORDER_INFO'));
    $vm_mainframe->vmAppendPathway($pathway);
    // Set the internal VirtueMart pathway
Example #26
0
    /**
     * Show all configuration parameters for this payment method
     * @returns boolean False when the Payment method has no configration
     */
    function show_configuration()
    {
        global $VM_LANG, $sess;
        $db = new ps_DB();
        $payment_method_id = vmGet($_REQUEST, 'payment_method_id', null);
        /** Read current Configuration ***/
        require_once CLASSPATH . "payment/" . $this->classname . ".cfg.php";
        ?>
      <table>
        <tr><td colspan="3"><hr/></td></tr>
        <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_PAYMENT_CVV2');
        ?>
</strong></td>
            <td>
                <select name="MO_CHECK_CARD_CODE" class="inputbox">
                <option <?php 
        if (MO_CHECK_CARD_CODE == 'YES') {
            echo "selected=\"selected\"";
        }
        ?>
 value="YES">
                <?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_YES');
        ?>
</option>
                <option <?php 
        if (MO_CHECK_CARD_CODE == 'NO') {
            echo "selected=\"selected\"";
        }
        ?>
 value="NO">
                <?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_NO');
        ?>
</option>
                </select>
            </td>
            <td><?php 
        echo $VM_LANG->_('PHPSHOP_PAYMENT_CVV2_TOOLTIP');
        ?>
</td>
        </tr>
        <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_MONTRADA_USERNAME');
        ?>
</strong></td>
            <td>
                <input type="text" name="MO_USERNAME" class="inputbox" value="<?php 
        echo MO_USERNAME;
        ?>
" />
            </td>
        </tr>
        <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_MONTRADA_PASSWORD');
        ?>
</strong></td>
            <td>
                <input type="text" name="MO_PASSWORD" class="inputbox" value="<?php 
        echo MO_PASSWORD;
        ?>
" />
            </td>
        </tr>        
        <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYMENT_ORDERSTATUS_SUCC');
        ?>
</strong></td>
            <td>
                <select name="MO_VERIFIED_STATUS" class="inputbox" >
                <?php 
        $q = "SELECT order_status_name,order_status_code FROM #__{vm}_order_status ORDER BY list_order";
        $db->query($q);
        $order_status_code = array();
        $order_status_name = array();
        while ($db->next_record()) {
            $order_status_code[] = $db->f("order_status_code");
            $order_status_name[] = $db->f("order_status_name");
        }
        for ($i = 0; $i < sizeof($order_status_code); $i++) {
            echo "<option value=\"" . $order_status_code[$i];
            if (MO_VERIFIED_STATUS == $order_status_code[$i]) {
                echo "\" selected=\"selected\">";
            } else {
                echo "\">";
            }
            echo $order_status_name[$i] . "</option>\n";
        }
        ?>
                    </select>
            </td>
            <td><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYMENT_ORDERSTATUS_SUCC_EXPLAIN');
        ?>
</td>
        </tr>
        <tr>
            <td><strong><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYMENT_ORDERSTATUS_FAIL');
        ?>
</strong></td>
            <td>
                <select name="MO_INVALID_STATUS" class="inputbox" >
                <?php 
        for ($i = 0; $i < sizeof($order_status_code); $i++) {
            echo "<option value=\"" . $order_status_code[$i];
            if (MO_INVALID_STATUS == $order_status_code[$i]) {
                echo "\" selected=\"selected\">";
            } else {
                echo "\">";
            }
            echo $order_status_name[$i] . "</option>\n";
        }
        ?>
                    </select>
            </td>
            <td><?php 
        echo $VM_LANG->_('PHPSHOP_ADMIN_CFG_PAYMENT_ORDERSTATUS_FAIL_EXPLAIN');
        ?>
</td>
        </tr>
      </table>
   <?php 
        // return false if there's no configuration
        return true;
    }
    	<input name="checkbutton" id="checkbutton" type="button" value="<?php 
echo $VM_LANG->_('VM_UPDATE_CHECK_CHECKNOW');
?>
" onclick="performUpdateCheck();" style="<?php 
echo $checkbutton_style;
?>
font-weight:bold;" />
    	<input name="downloadbutton" id="downloadbutton" type="submit" value="<?php 
echo $VM_LANG->_('VM_UPDATE_CHECK_DLUPDATE');
?>
" style="<?php 
echo $downloadbutton_style;
?>
font-weight:bold;" />
    	<span id="versioncheckresult"><?php 
echo vmGet($_SESSION, 'vmLatestVersion');
?>
</span>
    </td>
  </tr>
</table>
<?php 
$tabs->endTab();
$tabs->startTab('Upload a Patch', 'upload_patch');
?>
 <div style="padding: 20px;">
 <h2 class="vmicon vmicon32 vmicon-32-upload" name="patchupload">Upload a Patch Package</h2>
  	<input type="file" name="uploaded_package" class="inputbox" />
  	<br />
  	<br />
  	&nbsp;&nbsp;&nbsp;<input type="submit" value="Upload &amp; Preview" />
Example #28
0
 /**
  * Writes the configuration file of the current theme
  *
  * @param array $d
  */
 function writeThemeConfig(&$d)
 {
     global $page, $VM_LANG, $vmLogger;
     $my_config_array = array();
     $config = "<?php\r\nif( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );\r\n/**\r\n* The configuration file for the " . basename(VM_THEMEPATH) . " theme\r\n*\r\n* @package VirtueMart\r\n* @subpackage themes\r\n* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php\r\n* VirtueMart is free software. This version may have been modified pursuant\r\n* to the GNU General Public License, and as distributed it includes or\r\n* is derivative of works licensed under the GNU General Public License or\r\n* other free or open source software licenses.\r\n* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.\r\n*\r\n* http://virtuemart.net\r\n*/\r\n?>\r\n";
     $params = vmGet($_POST, 'params', '');
     if (is_array($params)) {
         $txt = array();
         foreach ($params as $k => $v) {
             $txt[] = "{$k}={$v}";
         }
         if (is_callable(array('mosParameters', 'textareaHandling'))) {
             $_POST['params'] = mosParameters::textareaHandling($txt);
         } else {
             $total = count($txt);
             for ($i = 0; $i < $total; $i++) {
                 if (strstr($txt[$i], "\n")) {
                     $txt[$i] = str_replace("\n", '<br />', $txt[$i]);
                 }
             }
             $_POST['params'] = implode("\n", $txt);
         }
     }
     $config .= $_POST['params'];
     if ($fp = fopen(VM_THEMEPATH . "theme.config.php", "w")) {
         fputs($fp, $config, strlen($config));
         fclose($fp);
         if (!empty($_REQUEST['ajax_request'])) {
             $vmLogger->info($VM_LANG->_('VM_CONFIGURATION_CHANGE_SUCCESS', false));
         } else {
             $task = vmGet($_REQUEST, 'task', '');
             if ($task == 'apply') {
                 $page = 'admin.theme_config_form';
                 $theme = '&theme=' . basename(VM_THEMEURL);
             } else {
                 $page = 'admin.show_cfg';
                 $theme = '';
             }
             if (!empty($_REQUEST['ajax_request'])) {
                 $vmLogger->info($VM_LANG->_('VM_CONFIGURATION_CHANGE_SUCCESS', false));
             } else {
                 vmRedirect($_SERVER['PHP_SELF'] . "?page={$page}{$theme}&option=com_virtuemart", $VM_LANG->_('VM_CONFIGURATION_CHANGE_SUCCESS'));
             }
         }
         return true;
     } else {
         $vmLogger->err($VM_LANG->_('VM_CONFIGURATION_CHANGE_FAILURE', false) . ' (' . VM_THEMEPATH . "theme.config.php)");
         return false;
     }
 }
 /**
  * This is a general function to safely open a connection to a server,
  * post data when needed and read the result.
  * Tries using cURL and switches to fopen/fsockopen if cURL is not available
  * @since VirtueMart 1.1.0
  * @static 
  * @param string $url
  * @param string $postData
  * @param array $headers
  * @param resource $fileToSaveData
  * @return mixed
  */
 function handleCommunication($url, $postData = '', $headers = array(), $fileToSaveData = null)
 {
     global $vmLogger;
     $urlParts = parse_url($url);
     if (!isset($urlParts['port'])) {
         $urlParts['port'] = 80;
     }
     if (!isset($urlParts['scheme'])) {
         $urlParts['scheme'] = 'http';
     }
     if (isset($urlParts['query'])) {
         $urlParts['query'] = '?' . $urlParts['query'];
     }
     if (isset($urlParts['path'])) {
         $urlParts['path'] = $urlParts['path'] . vmGet($urlParts, 'query');
     }
     // Check proxy
     if (trim(@VM_PROXY_URL) != '') {
         if (!stristr(VM_PROXY_URL, 'http')) {
             $proxyURL['host'] = VM_PROXY_URL;
             $proxyURL['scheme'] = 'http';
         } else {
             $proxyURL = parse_url(VM_PROXY_URL);
         }
     } else {
         $proxyURL = '';
     }
     if (function_exists("curl_init") && function_exists('curl_exec')) {
         $vmLogger->debug('Using the cURL library for communicating with ' . $urlParts['host']);
         $CR = curl_init();
         curl_setopt($CR, CURLOPT_URL, $url);
         // just to get sure the script doesn't die
         curl_setopt($CR, CURLOPT_TIMEOUT, 30);
         if (!empty($headers)) {
             // Add additional headers if provided
             curl_setopt($CR, CURLOPT_HTTPHEADER, $headers);
         }
         curl_setopt($CR, CURLOPT_FAILONERROR, true);
         if ($postData) {
             curl_setopt($CR, CURLOPT_POSTFIELDS, $postData);
             curl_setopt($CR, CURLOPT_POST, 1);
         }
         if (is_resource($fileToSaveData)) {
             curl_setopt($CR, CURLOPT_FILE, $fileToSaveData);
         } else {
             curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1);
         }
         // Do we need to set up the proxy?
         if (!empty($proxyURL)) {
             $vmLogger->debug('Setting up proxy: ' . $proxyURL['host'] . ':' . VM_PROXY_PORT);
             //curl_setopt($CR, CURLOPT_HTTPPROXYTUNNEL, true);
             curl_setopt($CR, CURLOPT_PROXY, $proxyURL['host']);
             curl_setopt($CR, CURLOPT_PROXYPORT, VM_PROXY_PORT);
             // Check if the proxy needs authentication
             if (trim(@VM_PROXY_USER) != '') {
                 $vmLogger->debug('Using proxy authentication!');
                 curl_setopt($CR, CURLOPT_PROXYUSERPWD, VM_PROXY_USER . ':' . VM_PROXY_PASS);
             }
         }
         if ($urlParts['scheme'] == 'https') {
             // No PEER certificate validation...as we don't have
             // a certificate file for it to authenticate the host www.ups.com against!
             curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0);
             //curl_setopt($CR, CURLOPT_SSLCERT , "/usr/locale/xxxx/clientcertificate.pem");
         }
         $result = curl_exec($CR);
         $error = curl_error($CR);
         if (!empty($error) && stristr($error, '502') && !empty($proxyURL)) {
             $vmLogger->debug('Switching to NTLM authenticaton.');
             curl_setopt($CR, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
             $result = curl_exec($CR);
             $error = curl_error($CR);
         }
         curl_close($CR);
         if (!empty($error)) {
             $vmLogger->err($error);
             return false;
         } else {
             return $result;
         }
     } else {
         if ($postData) {
             if (!empty($proxyURL)) {
                 // If we have something to post we need to write into a socket
                 if ($proxyURL['scheme'] == 'https') {
                     $protocol = 'ssl';
                 } else {
                     $protocol = 'http';
                 }
                 $fp = fsockopen("{$protocol}://" . $proxyURL['host'], VM_PROXY_PORT, $errno, $errstr, $timeout = 30);
             } else {
                 // If we have something to post we need to write into a socket
                 if ($urlParts['scheme'] == 'https') {
                     $protocol = 'ssl';
                 } else {
                     $protocol = $urlParts['scheme'];
                 }
                 $fp = fsockopen("{$protocol}://" . $urlParts['host'], $urlParts['port'], $errno, $errstr, $timeout = 30);
             }
         } else {
             if (!empty($proxyURL)) {
                 // Do a read-only fopen transaction
                 $fp = fopen($proxyURL['scheme'] . '://' . $proxyURL['host'] . ':' . VM_PROXY_PORT, 'rb');
             } else {
                 // Do a read-only fopen transaction
                 $fp = fopen($urlParts['scheme'] . '://' . $urlParts['host'] . ':' . $urlParts['port'] . $urlParts['path'], 'rb');
             }
         }
         if (!$fp) {
             //error tell us
             $vmLogger->err("Possible server error! - {$errstr} ({$errno})\n");
             return false;
         } else {
             $vmLogger->debug('Connection opened to ' . $urlParts['host']);
         }
         if ($postData) {
             $vmLogger->debug('Now posting the variables.');
             //send the server request
             if (!empty($proxyURL)) {
                 fputs($fp, "POST " . $urlParts['host'] . ':' . $urlParts['port'] . $urlParts['path'] . " HTTP/1.0\r\n");
                 fputs($fp, "Host: " . $proxyURL['host'] . "\r\n");
                 if (trim(@VM_PROXY_USER) != '') {
                     fputs($fp, "Proxy-Authorization: Basic " . base64_encode(VM_PROXY_USER . ':' . VM_PROXY_PASS) . "\r\n\r\n");
                 }
             } else {
                 fputs($fp, 'POST ' . $urlParts['path'] . " HTTP/1.0\r\n");
                 fputs($fp, 'Host:' . $urlParts['host'] . "\r\n");
             }
             fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
             fputs($fp, "Content-length: " . strlen($postData) . "\r\n");
             fputs($fp, "Connection: close\r\n\r\n");
             fputs($fp, $postData . "\r\n\r\n");
         } else {
             if (!empty($proxyURL)) {
                 fputs($fp, "GET " . $urlParts['host'] . ':' . $urlParts['port'] . $urlParts['path'] . " HTTP/1.0\r\n");
                 fputs($fp, "Host: " . $proxyURL['host'] . "\r\n");
                 if (trim(@VM_PROXY_USER) != '') {
                     fputs($fp, "Proxy-Authorization: Basic " . base64_encode(VM_PROXY_USER . ':' . VM_PROXY_PASS) . "\r\n\r\n");
                 }
             } else {
                 fputs($fp, 'GET ' . $urlParts['path'] . " HTTP/1.0\r\n");
                 fputs($fp, 'Host:' . $urlParts['host'] . "\r\n");
             }
         }
         // Add additional headers if provided
         foreach ($headers as $header) {
             fputs($fp, $header . "\r\n");
         }
         $data = "";
         while (!feof($fp)) {
             $data .= @fgets($fp, 4096);
         }
         fclose($fp);
         // If didnt get content-lenght, something is wrong, return false.
         if (trim($data) == '') {
             $vmLogger->err('An error occured while communicating with the server ' . $urlParts['host'] . '. It didn\'t reply (correctly). Please try again later, thank you.');
             return false;
         }
         $result = trim($data);
         if (is_resource($fileToSaveData)) {
             fwrite($fileToSaveData, $result);
             return true;
         } else {
             return $result;
         }
     }
 }
*
* http://virtuemart.net
*/
$temp = vmGet($_REQUEST, 'product_id', 0);
$return_args = vmGet($_REQUEST, 'return_args');
$option = empty($option) ? vmGet($_REQUEST, 'option', 'com_virtuemart') : $option;
$title = '<img src="' . IMAGEURL . 'ps_image/categories.gif" border="0" />' . $VM_LANG->_('PHPSHOP_PRODUCT_PRODUCT_TYPE_FORM_LBL');
$product_id = array();
if (sizeof($temp) == 1) {
    //$product_id = (int)$product_id[0];
    if (is_array($temp)) {
        $product_id[] = $temp[0];
    } else {
        $product_id[] = $temp;
    }
    $product_parent_id = vmGet($_REQUEST, 'product_parent_id', 0);
    if (!empty($product_parent_id)) {
        $title .= " " . $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ITEM_LBL') . ": ";
    } else {
        $title .= " " . $VM_LANG->_('PHPSHOP_PRODUCT') . ": ";
    }
    $url = $_SERVER['PHP_SELF'] . "?page={$modulename}.product_form&product_id={$product_id}&product_parent_id={$product_parent_id}";
    $title .= "<a href=\"" . $sess->url($url) . "\">" . $ps_product->get_field($product_id[0], "product_name") . "</a>";
} else {
    $product_id = $temp;
    $title .= $VM_LANG->_('VM_PRODUCT_PRODUCT_TYPE_ADD_MULTIPLE_PRODUCTS');
}
//First create the object and let it print a form heading
$formObj = new formFactory($title);
//Then Start the form
$formObj->startForm();