Example #1
0
 /**
  * Updates a Vendor (and the Store) Record
  *
  * @param array $d
  * @return boolean
  */
 function update(&$d)
 {
     global $vendor_currency, $VM_LANG;
     $db = new ps_DB();
     $timestamp = time();
     if (!$this->validate_update($d)) {
         return False;
     }
     if (!vmImageTools::process_images($d)) {
         return false;
     }
     foreach ($d as $key => $value) {
         if (!is_array($value)) {
             $d[$key] = addslashes($value);
         }
     }
     $d['display_style'][1] = ps_vendor::checkCurrencySymbol($d['display_style'][1]);
     $d['display_style'] = implode("|", $d['display_style']);
     if (empty($d['vendor_accepted_currencies'])) {
         $d['vendor_accepted_currencies'] = array($vendor_currency);
     }
     $fields = array('vendor_name' => $d["vendor_name"], 'contact_last_name' => $d["contact_last_name"], 'contact_first_name' => $d["contact_first_name"], 'contact_middle_name' => $d["contact_middle_name"], 'contact_title' => $d["contact_title"], 'contact_phone_1' => $d["contact_phone_1"], 'contact_phone_2' => $d["contact_phone_2"], 'contact_fax' => $d["contact_fax"], 'contact_email' => $d["contact_email"], 'vendor_phone' => $d["vendor_phone"], 'vendor_address_1' => $d["vendor_address_1"], 'vendor_address_2' => $d["vendor_address_2"], 'vendor_city' => $d["vendor_city"], 'vendor_state' => $d["vendor_state"], 'vendor_country' => $d["vendor_country"], 'vendor_zip' => $d["vendor_zip"], 'vendor_store_name' => $d["vendor_store_name"], 'vendor_store_desc' => $d["vendor_store_desc"], 'vendor_thumb_image' => $d["vendor_thumb_image"], 'vendor_full_image' => $d["vendor_full_image"], 'vendor_currency' => $d["vendor_currency"], 'vendor_url' => $d["vendor_url"], 'mdate' => $timestamp, 'vendor_terms_of_service' => $d["vendor_terms_of_service"], 'vendor_min_pov' => $d["vendor_min_pov"], 'vendor_currency_display_style' => $d["display_style"], 'vendor_freeshipping' => $d['vendor_freeshipping'], 'vendor_accepted_currencies' => implode(',', $d['vendor_accepted_currencies']), 'vendor_address_format' => $d['vendor_address_format'], 'vendor_date_format' => $d['vendor_date_format']);
     if (!empty($d["vendor_category_id"])) {
         $fields['vendor_category_id'] = $d["vendor_category_id"];
     }
     if (!empty($d["vendor_image_path"])) {
         $fields['vendor_image_path'] = $d["vendor_image_path"];
     }
     $db->buildQuery('UPDATE', '#__{vm}_vendor', $fields, 'WHERE vendor_id = ' . $d["vendor_id"]);
     $db->query();
     if ($d['vendor_id'] == 1) {
         $GLOBALS['vmLogger']->info($VM_LANG->_('VM_STORE_UPDATED'));
     } else {
         $GLOBALS['vmLogger']->info($VM_LANG->_('VM_VENDOR_UPDATED'));
     }
     return True;
 }
Example #2
0
<?php 
$tabs->endTab();
$tabs->startTab($VM_LANG->_('PHPSHOP_SHOPPER_FORM_LBL'), "third-page");
?>
<fieldset style="width:48%;"><legend><?php 
echo $VM_LANG->_('PHPSHOP_SHOPPER_FORM_LBL');
?>
</legend>
<table class="adminform">  
    <tr> 
        <td style="text-align:right;"><?php 
echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_VENDOR');
?>
:</td>
        <td><?php 
ps_vendor::list_vendor($db->f("vendor_id"));
?>
</td>
    </tr>
	<tr> 
        <td nowrap="nowrap" style="text-align:right;" width="38%" ><?php 
echo $VM_LANG->_('PHPSHOP_USER_FORM_PERMS');
?>
:</td> 
        <td width="62%" > 
                <?php 
if (!isset($ps_perms)) {
    $ps_perms = new ps_perm();
}
$ps_perms->list_perms("perms", $db->sf("perms"));
?>
<style type="text/css">
<!--
.Stil1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.Stil2 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>
</head>
<body>

<table width="100%" align="center" border="0" cellspacing="0" cellpadding="10">
  <tr valign="top"> 
    <td width=53% align="left" class="Stil1"><?php 
echo ps_vendor::formatted_store_address(true);
?>
</td>
    <td width="47%" align="right"><img src="cid:vendor_image" alt="vendor_image" border="0" /></td>
  </tr>
  <tr>
      <td colspan="2" class="Stil1"><?php 
echo $order_header_msg;
?>
</td>
  </tr>    
  <tr bgcolor="white"> 
    <td colspan="2">
      <h3 class="Stil2"><?php 
echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_PO_LBL');
?>
Example #4
0
" size="32" />
			      </td>
			    </tr>
			    <tr> 
			      <td colspan="2" align="center" >&nbsp;</td>
			    </tr>
			  </table>
			  </fieldset>
	      <br />
	      <fieldset><legend><?php 
echo $VM_LANG->_('PHPSHOP_CURRENCY_DISPLAY');
?>
</legend>
	      <table class="adminform"><?php 
/* Decode vendor_currency_display_style */
$currency_display = ps_vendor::get_currency_display_style($db->f("vendor_currency_display_style"));
?>
		    <tr> 
		      <td class="labelcell"><?php 
echo $VM_LANG->_('PHPSHOP_STORE_FORM_CURRENCY');
?>
: </td>
		      <td width="78%" > 
		        <?php 
$ps_html->list_currency("vendor_currency", $db->sf("vendor_currency"));
?>
		      </td>
		    </tr>
		    <tr>
		      <td class="labelcell"><?php 
echo $VM_LANG->_('PHPSHOP_CURRENCY_SYMBOL');
Example #5
0
$vendor_state = empty($vendor_state) ? "" : $db->f("vendor_state");
$vendor_country = $db->f("vendor_country");
$vendor_country_2_code = $db->f("country_2_code");
$vendor_country_3_code = $db->f("country_3_code");
$vendor_zip = $db->f("vendor_zip");
$vendor_phone = $db->f("vendor_phone");
$vendor_store_desc = $db->f("vendor_store_desc");
$vendor_currency = $db->f("vendor_currency");
$vendor_currency_display_style = $db->f("vendor_currency_display_style");
$vendor_accepted_currencies = $db->f("vendor_accepted_currencies");
$vendor_address_format = $db->f('vendor_address_format');
$vendor_date_format = $db->f('vendor_date_format');
$_SESSION["vendor_currency"] = $vendor_currency;
// see /classes/currency_convert.php
vmSetGlobalCurrency();
$currency_display = ps_vendor::get_currency_display_style($vendor_currency_display_style);
if ($GLOBALS['product_currency'] != $vendor_currency) {
    $currency_display["symbol"] = $GLOBALS['product_currency'];
}
/** load Currency Display Class **/
require_once CLASSPATH . 'currency/class_currency_display.php';
/**
 *  @global CurrencyDisplay $GLOBALS['CURRENCY_DISPLAY']
 *  @global CurrencyDisplay $CURRENCY_DISPLAY
 */
$CURRENCY_DISPLAY = $GLOBALS['CURRENCY_DISPLAY'] = new CurrencyDisplay($currency_display["id"], $currency_display["symbol"], $currency_display["nbdecimal"], $currency_display["sdecimal"], $currency_display["thousands"], $currency_display["positive"], $currency_display["negative"]);
// Include the theme
if (file_exists(VM_THEMEPATH . 'theme.php')) {
    include VM_THEMEPATH . 'theme.php';
} elseif (file_exists($mosConfig_absolute_path . '/components/' . $option . '/themes/default/theme.php')) {
    include $mosConfig_absolute_path . '/components/' . $option . '/themes/default/theme.php';
* @version $Id: product.product_display.php 1339 2008-04-01 17:43:24Z soeren_nb $
* @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 . 'ps_vendor.php';
$ps_vendor = new ps_vendor();
$db2 = new ps_DB();
$product_id = vmGet($vars, 'product_id', 0);
if (empty($product_id)) {
    include PAGEPATH . 'product.product_list.php';
    return;
}
$product_parent_id = vmGet($_REQUEST, 'product_parent_id', 0);
$vars["product_parent_id"] = vmget($vars, 'product_parent_id', 0);
if ($product_parent_id == $vars["product_parent_id"]) {
    if ($func == "productAdd") {
        $action = $VM_LANG->_('PHPSHOP_PRODUCT_DISPLAY_ADD_ITEM_LBL');
    } else {
        $action = $VM_LANG->_('PHPSHOP_PRODUCT_DISPLAY_UPDATE_ITEM_LBL');
    }
    $info_label = $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ITEM_INFO_LBL');