/** * Prints an HTML dropdown box named $name using $arr to * load the drop down. If $value is in $arr, then $value * will be the selected option in the dropdown. * @author gday * @author soeren * * @param string $name The name of the select element * @param string $value The pre-selected value * @param array $arr The array containting $key and $val * @param int $size The size of the select element * @param string $multiple use "multiple=\"multiple\" to have a multiple choice select list * @param string $extra More attributes when needed * @return string HTML drop-down list */ function selectList($name, $value, &$arr, $size = 1, $multiple = "", $extra = "") { $html = ''; if (empty($arr)) { $arr = array(); } $html = "<select class=\"inputbox\" name=\"{$name}\" size=\"{$size}\" {$multiple} {$extra}>\n"; foreach ($arr as $key => $val) { $selected = ""; if (is_array($value)) { if (in_array($key, $value)) { $selected = "selected=\"selected\""; } } else { if (strtolower($value) == strtolower($key)) { $selected = "selected=\"selected\""; } } $html .= "<option value=\"{$key}\" {$selected}>" . shopMakeHtmlSafe($val); $html .= "</option>\n"; } $html .= "</select>\n"; return $html; }
<td class="iconcell"><?php echo vmToolTip($VM_LANG->_('VM_ADMIN_ENCRYPTION_FUNCTION_TIP')); ?> </td> </tr> <?php } ?> <tr> <td class="labelcell"><?php echo $VM_LANG->_('VM_ADMIN_ENCRYPTION_KEY'); ?> </td> <td> <input type="text" name="conf_ENCODE_KEY" class="inputbox" value="<?php echo shopMakeHtmlSafe(ENCODE_KEY); ?> " /> </td> <td class="iconcell"><?php echo vmToolTip($VM_LANG->_('VM_ADMIN_ENCRYPTION_KEY_TIP')); ?> </td> </tr> <tr> <td class="labelcell"> <input type="checkbox" name="conf_VM_STORE_CREDITCARD_DATA" id="conf_VM_STORE_CREDITCARD_DATA" class="inputbox" <?php if (@VM_STORE_CREDITCARD_DATA == '1') { echo "checked=\"checked\""; } ?>
function PrintIcon($link = '', $use_icon = true, $add_text = '') { global $VM_LANG, $mosConfig_live_site, $mosConfig_absolute_path, $cur_template, $Itemid; if (@VM_SHOW_PRINTICON == '1') { if (!$link) { $query_string = str_replace('only_page=1', 'only_page=0', vmAmpReplace(vmGet($_SERVER, 'QUERY_STRING'))); $link = 'index2.php?' . $query_string . '&pop=1' . (vmIsJoomla('1.5') ? '&tmpl=component' : ''); } // checks template image directory for image, if non found default are loaded if ($use_icon) { $text = vmCommonHTML::ImageCheck('printButton.png', '/images/M_images/', NULL, NULL, $VM_LANG->_('CMN_PRINT'), $VM_LANG->_('CMN_PRINT')); $text .= shopMakeHtmlSafe($add_text); } else { $text = '| ' . $VM_LANG->_('CMN_PRINT') . ' |'; } $isPopup = vmGet($_GET, 'pop'); if ($isPopup) { // Print Preview button - used when viewing page $html = '<span class="vmNoPrint"> <a href="javascript:void(0)" onclick="javascript:window.print(); return false;" title="' . $VM_LANG->_('CMN_PRINT') . '"> ' . $text . ' </a></span>'; return $html; } else { // Print Button - used in pop-up window return vmPopupLink($link, $text, 640, 480, '_blank', $VM_LANG->_('CMN_PRINT')); } } }
$columns = array("#" => "width=\"20\"", "<input type=\"checkbox\" name=\"toggle\" value=\"\" onclick=\"checkAll(" . $pageNav->limit . ")\" />" => "width=\"20\"", $VM_LANG->_('PHPSHOP_CATEGORY_FORM_NAME') => 'width="25%"', $VM_LANG->_('PHPSHOP_CATEGORY_FORM_DESCRIPTION') => 'width="30%"', $VM_LANG->_('PHPSHOP_PRODUCTS_LBL') => 'width="10%"', $VM_LANG->_('PHPSHOP_PRODUCT_LIST_PUBLISH') => 'width="5%"', $VM_LANG->_('PHPSHOP_MODULE_LIST_ORDER') => 'width="7%"', vmCommonHTML::getSaveOrderButton(min($nrows - $pageNav->limitstart, $pageNav->limit)) => 'width="8%"', $VM_LANG->_('E_REMOVE') => "width=\"5%\"", 'Id' => ''); $listObj->writeTableHeader($columns); $ibg = 0; if ($pageNav->limit < $nrows) { if ($pageNav->limitstart + $pageNav->limit < $nrows) { $nrows = $pageNav->limitstart + $pageNav->limit; } } for ($n = $pageNav->limitstart; $n < $nrows; $n++) { if (!isset($row_list[$n])) { $row_list[$n] = $n; } if (!isset($depth_list[$n])) { $depth_list[$n] = 0; } $catname = shopMakeHtmlSafe($categories[$row_list[$n]]["category_name"]); $listObj->newRow(); // The row number $listObj->addCell($pageNav->rowNumber($ibg)); // The Checkbox $listObj->addCell(vmCommonHTML::idBox($ibg, $categories[$row_list[$n]]["category_child_id"], false, "category_id")); // Which category depth level we are in? $repeat = $depth_list[$n] + 1; $tmp_cell = str_repeat(" ", $repeat) . "__|" . $repeat . "| " . "<a href=\"" . $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_category_form&category_id=" . $categories[$row_list[$n]]["category_child_id"] . "&category_parent_id=" . $categories[$row_list[$n]]["category_parent_id"] . "\">" . $catname . "</a>"; $listObj->addCell($tmp_cell); $desc = strlen($categories[$row_list[$n]]["category_description"]) > 255 ? mm_ToolTip($categories[$row_list[$n]]["category_description"], $VM_LANG->_('PHPSHOP_CATEGORY_FORM_DESCRIPTION')) : $categories[$row_list[$n]]["category_description"]; $listObj->addCell(" " . $desc); $listObj->addCell(ps_product_category::product_count($categories[$row_list[$n]]["category_child_id"]) . " <a href=\"" . $_SERVER['PHP_SELF'] . "?page=product.product_list&category_id=" . $categories[$row_list[$n]]["category_child_id"] . "&option=com_virtuemart" . "\">[ " . $VM_LANG->_('PHPSHOP_SHOW') . " ]</a>"); // Publish / Unpublish $tmp_cell = "<a href=\"" . $sess->url($_SERVER['PHP_SELF'] . "?page=product.product_category_list&category_id=" . $categories[$row_list[$n]]["category_child_id"] . "&func=changePublishState"); if ($categories[$row_list[$n]]["category_publish"] == 'N') {
), 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 ">" instead of ">"... // so we don't have to make safe if ">" is found if (strpos($v,">")===false) { $v = shopMakeHtmlSafe($v); } if( $k == 3 ) { echo $CURRENCY_DISPLAY->getFullValue( $v )."; "; } elseif( $k > 0 && $k < 4) { echo $v.'; '; } } echo "</td></tr>"; } unset( $row ); if( !isset($order_total) || $order_total > 0.00 ) { $payment_method_id = vmRequest::getInt( 'payment_method_id' ); $db->query("SELECT payment_method_id, payment_method_name FROM #__{vm}_payment_method WHERE payment_method_id='$payment_method_id'");
<br /> <a class="button" href="<?php echo $product_link ?>"><?php echo $VM_LANG->_('VM_RETURN_TO_PRODUCT') ?></a> <br /><br /> <form action="<?php echo $mm_action_url ?>index.php" method="post" name="emailForm" id="emailForm"> <label for="contact_name"><?php echo $VM_LANG->_('NAME_PROMPT') ?></label> <br /><input type="text" name="name" id="contact_name" size="80" class="inputbox" value="<?php echo $name ?>"><br /><br /> <label for="contact_mail"><?php echo $VM_LANG->_('EMAIL_PROMPT') ?></label> <br /><input type="text" id="contact_mail" name="email" size="80" label="Your email" class="inputbox" value="<?php echo $email ?>"><br /><br /> <label for="contact_text"><?php echo $VM_LANG->_('MESSAGE_PROMPT') ?></label><br /> <textarea rows="10" cols="60" name="text" id="contact_text" class="inputbox"><?php echo utf8_decode($subject) ?></textarea><br /> <input type="button" name="send" value="<?php echo $VM_LANG->_('SEND_BUTTON') ?>" class="button" onclick="validateEnquiryForm()" /> <input type="hidden" name="product_id" value="<?php echo $db_product->f("product_id") ?>" /> <input type="hidden" name="product_sku" value="<?php echo shopMakeHtmlSafe($db_product->f("product_sku")) ?>" /> <input type="hidden" name="set" value="1" /> <input type="hidden" name="func" value="productAsk" /> <input type="hidden" name="page" value="shop.ask" /> <input type="hidden" name="option" value="com_virtuemart" /> <input type="hidden" name="flypage" value="<?php echo $flypage ?>" /> <input type="hidden" name="Itemid" value="<?php echo $Itemid ?>" /> <input type="hidden" name="<?php echo $validate ?>" value="1" /> </form> <script type="text/javascript"><!-- function validateEnquiryForm() { if ( ( document.emailForm.text.value == "" ) || ( document.emailForm.email.value.search("@") == -1 ) || ( document.emailForm.email.value.search("[.*]" ) == -1 ) ) { alert( "<?php echo $VM_LANG->_('CONTACT_FORM_NC',false); ?>" ); } else if ( ( document.emailForm.email.value.search(";") != -1 ) || ( document.emailForm.email.value.search(",") != -1 ) || ( document.emailForm.email.value.search(" ") != -1 ) ) { alert( "You cannot enter more than one email address" );
/** * Build a Credit Card list for each CreditCard Payment Method * Uses JavsScript from mambojavascript: changeDynaList() * * @param ps_DB $db_cc * @return string */ function creditcard_lists(&$db_cc) { global $mainframe; if (vmIsJoomla('1.5')) { $document = JFactory::getDocument(); $document->addScript('includes/js/joomla.javascript.js'); } $db = new ps_DB(); $db_cc->next_record(); // Build the Credit Card lists for each CreditCard Payment Method $script = "<script language=\"javascript\" type=\"text/javascript\">\n"; $script .= "<!--\n"; $script .= "var originalOrder = '1';\n"; $script .= "var originalPos = '" . $db_cc->f("payment_method_name") . "';\n"; $script .= "var orders = new Array();\t// array in the format [key,value,text]\n"; $i = 0; $db_cc->reset(); while ($db_cc->next_record()) { $accepted_creditcards = explode(",", $db_cc->f("accepted_creditcards")); $cards = array(); foreach ($accepted_creditcards as $value) { if (!empty($value)) { $q = 'SELECT creditcard_code,creditcard_name FROM #__{vm}_creditcard WHERE creditcard_id=' . (int) $value; $db->query($q); $db->next_record(); $cards[$db->f('creditcard_code')] = shopMakeHtmlSafe($db->f('creditcard_name')); } } foreach ($cards as $code => $name) { $script .= "orders[" . $i++ . "] = new Array( '" . addslashes($db_cc->f("payment_method_name")) . "','{$code}','{$name}' );\n"; } } $script .= "function changeCreditCardList() { \n"; $script .= "var selected_payment = null;\n for (var i=0; i<document.adminForm.payment_method_id.length; i++)\n if (document.adminForm.payment_method_id[i].checked)\n selected_payment = document.adminForm.payment_method_id[i].id;\n"; $script .= "changeDynaList('creditcard_code',orders,selected_payment, originalPos, originalOrder);\n"; $script .= "}\n"; $script .= "//-->\n"; $script .= "</script>\n"; $script .= '<noscript>' . ps_html::selectList('creditcard_code', key($cards), $cards) . '</noscript>'; return $script; }
<textarea rows="10" cols="60" name="text" id="contact_text" class="inputbox"><?php echo utf8_decode($subject); ?> </textarea><br /> <input type="button" name="send" value="<?php echo $VM_LANG->_('SEND_BUTTON'); ?> " class="button" onclick="validateEnquiryForm()" /> <input type="hidden" name="product_id" value="<?php echo $db_product->f("product_id"); ?> " /> <input type="hidden" name="product_sku" value="<?php echo shopMakeHtmlSafe($db_product->f("product_sku")); ?> " /> <input type="hidden" name="set" value="1" /> <input type="hidden" name="func" value="productAsk" /> <input type="hidden" name="page" value="shop.ask" /> <input type="hidden" name="option" value="com_virtuemart" /> <input type="hidden" name="flypage" value="<?php echo $flypage; ?> " /> <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?> " />
* * Example: If you run * $tpl->set( "product_name", $product_name ); * The variable "product_name" will be available in the template under this name * with the value of $product_name * * */ // This part allows us to copy ALL properties from the product table // into the template $productData = $db_product->get_row(); $productArray = get_object_vars($productData); $productArray["product_id"] = $product_id; $productArray["product_full_image"] = $product_full_image; // to display the full image on flypage $productArray["product_thumb_image"] = $product_thumb_image; $productArray["product_name"] = shopMakeHtmlSafe($productArray["product_name"]); $tpl->set('productArray', $productArray); foreach ($productArray as $property => $value) { $tpl->set($property, $value); } // Assemble the thumbnail image as a link to the full image // This function is defined in the theme (theme.php) $product_image = $tpl->vmBuildFullImageLink($productArray); $tpl->set("product_id", $product_id); $tpl->set("product_name", $product_name); $tpl->set("product_image", $product_image); $tpl->set("more_images", $more_images); $tpl->set("images", $files['images']); $tpl->set("files", $files['files']); $tpl->set("file_list", $file_list); $tpl->set("edit_link", $edit_link);
<input type="text" class="inputbox" name="product_sku" value="<?php $db->sp("product_sku"); ?> " size="32" maxlength="64" /> </td> </tr> <tr class="row0"> <td width="21%"><div style="text-align:right;font-weight:bold;"> <?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_NAME'); ?> :</div> </td> <td width="79%"> <input type="text" class="inputbox" name="product_name" value="<?php echo shopMakeHtmlSafe($db->sf("product_name")); ?> " size="32" maxlength="255" /> </td> </tr> <tr class="row1"> <td width="21%"><div style="text-align:right;font-weight:bold;"> <?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_URL'); ?> :</div> </td> <td width="79%"> <input type="text" class="inputbox" name="product_url" value="<?php $db->sp("product_url"); ?>
* @subpackage html * @copyright Copyright (C) 2006-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__); $theme = vmGet($_REQUEST, 'theme', 'default'); $themepath = $mosConfig_absolute_path . '/components/com_virtuemart/themes/' . basename($theme); if (!file_exists($themepath)) { echo '<script type="text/javascript">alert(\'' . str_replace('{theme}', basename(shopMakeHtmlSafe($theme)), $VM_LANG->_('VM_ADMIN_THEME_NOT_EXISTS')) . '\');history.back();</script>'; exit; } if (!file_exists($themepath . '/theme.config.php')) { if (!fopen($themepath . '/theme.config.php', 'w')) { echo vmCommonHTML::getErrorField($VM_LANG->_('VM_ADMIN_THEME_CFG_NOT_EXISTS')); return; } } $current_config = file_get_contents($themepath . '/theme.config.php'); $parameter_xml_file = $themepath . '/theme.xml'; // get params definitions $params = new vmParameters($current_config, $parameter_xml_file, 'theme'); $title = ' <img src="' . VM_THEMEURL . 'images/administration/header/icon-48-config.png" align="middle" border="0" alt="' . $VM_LANG->_('VM_ADMIN_CFG_THEME_SETTINGS') . '" /> '; $title .= $VM_LANG->_('VM_ADMIN_CFG_THEME_SETTINGS'); //First create the object and let it print a form heading
if ($auth['user_id'] > 0) { $db->query('SELECT `vendor_id` FROM `#__{vm}_auth_user_vendor` WHERE `user_id` =' . $auth['user_id']); $db->next_record(); if ($db->f('vendor_id')) { $default_vendor = $db->f('vendor_id'); } } $_SESSION["ps_vendor_id"] = $ps_vendor_id = $default_vendor; $db = ps_vendor::get_vendor_details($ps_vendor_id); $_SESSION['minimum_pov'] = $db->f("vendor_min_pov"); $vendor_name = $db->f("vendor_name"); $vendor_store_name = $db->f("vendor_store_name"); $vendor_mail = $db->f("contact_email"); $vendor_url = $db->f("vendor_url"); $vendor_freeshipping = $db->f("vendor_freeshipping"); $vendor_image = "<img border=\"0\" src=\"" . IMAGEURL . "vendor/" . $db->f("vendor_full_image") . "\" alt=\"" . shopMakeHtmlSafe($vendor_name) . "\" />"; $vendor_full_image = $db->f("vendor_full_image"); $vendor_image_url = IMAGEURL . "vendor/" . $db->f("vendor_full_image"); $vendor_address = $db->f("vendor_address_1"); $vendor_address_2 = $db->f("vendor_address_2"); $vendor_city = $db->f("vendor_city"); $vendor_state = $db->f("vendor_state"); $vendor_state_name = $db->f("state_name"); $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");
/** * This creates a list footer (page navigation) * @param The core module name (e.g. "product") * @param The page name (e.g. "product_list" ) * @param The Keyword from a search by keyword * @param Additional varaibles to include as hidden input fields */ function writeFooter($keyword, $extra = "") { $footer = ""; if ($this->pageNav !== null) { if ($this->_resultsToShowPageNav <= $this->pageNav->total) { $footer = $this->pageNav->getListFooter(); } } else { $footer = ""; } if (!empty($extra)) { $extrafields = explode("&", $extra); array_shift($extrafields); foreach ($extrafields as $key => $value) { $field = explode("=", $value); $footer .= '<input type="hidden" name="' . $field[0] . '" value="' . @shopMakeHtmlSafe($field[1]) . '" />' . "\n"; } } $footer .= '</form>'; echo $footer; }
echo "<input type=\"checkbox\" name=\"category_publish\" value=\"Y\" checked=\"checked\" />"; } else { echo "<input type=\"checkbox\" name=\"category_publish\" value=\"Y\" />"; } ?> </td> </tr> <tr> <td width="21%" nowrap><div align="right"><?php echo $VM_LANG->_('PHPSHOP_CATEGORY_FORM_NAME'); ?> :</div></td> <td width="79%"> <input type="text" class="inputbox" name="category_name" size="60" value="<?php echo shopMakeHtmlSafe($db->sf('category_name')); ?> " /> </td> </tr> <tr> <td width="21%" valign="top" nowrap><div align="right"><?php echo $VM_LANG->_('PHPSHOP_CATEGORY_FORM_DESCRIPTION'); ?> :</div></td> <td width="79%" valign="top"><?php editorArea('editor1', $db->f("category_description"), 'category_description', '800', '300', '110', '40'); ?> </td> </tr> <tr>
<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); mm_showMyFileName(__FILE__); ?> <?php echo $buttons_header // The PDF, Email and Print buttons ?> <?php if( $this->get_cfg( 'showPathway' )) { echo "<div class=\"pathway\">$navigation_pathway</div>"; } if( $this->get_cfg( 'product_navigation', 1 )) { if( !empty( $previous_product )) { echo '<a class="previous_page" href="'.$previous_product_url.'">'.shopMakeHtmlSafe($previous_product['product_name']).'</a>'; } if( !empty( $next_product )) { echo '<a class="next_page" href="'.$next_product_url.'">'.shopMakeHtmlSafe($next_product['product_name']).'</a>'; } } ?> <br style="clear:both;" /> <table border="0" align="center" style="width: 100%;" > <tr> <td rowspan="1" colspan="2"> <h2 class="product_name"><?php echo $product_name; echo ' ' . $edit_link; ?></h2> </td> <td> </td> </tr> <tr> <td class="product_separator" colspan="2"> <?php echo $product_s_desc ?>
} ?> <tr class="sectiontableentry1"> <?php if ($_SESSION) { ?> <td align="right" valign="top"><b>$_SESSION:</b></td> <td colspan="3" valign="top"><?php while (list($key, $val) = each($_SESSION)) { if (is_object($val)) { echo shopMakeHtmlSafe($key) . '=> {Object}<br/>'; } elseif (is_array($val)) { echo shopMakeHtmlSafe($key) . '=> {Array}<br/>'; } else { echo shopMakeHtmlSafe($key) . '=>' . shopMakeHtmlSafe($val) . '<br/>'; } } ?> </td> <?php } else { echo "<td colspan=\"4\"><strong>Something's wrong with your Session Setup - the Session is empty. VirtueMart cannot run without\r\n Sessions!</strong></td>"; } ?> </tr> <tr class="sectiontableentry1"> <td align="right" valign="top"> </td> <td colspan="3" valign="top"> </td> </tr> <tr class="sectiontableentry2">
<input type="checkbox" class="inputbox" id="file_published" name="file_published" value="1" <?php if ($db->sf("file_published") == 1) { echo "checked=\"checked\""; } ?> size="16" /> </td> </tr> <tr> <td class="labelcell"><?php echo $VM_LANG->_('PHPSHOP_FILES_FORM_FILE_TITLE'); ?> :</td> <td> <input type="text" class="inputbox" name="file_title" size="32" value="<?php echo shopMakeHtmlSafe($db->sf("file_title")); ?> " /> </td> </tr> <tr> <td class="labelcell"><?php echo $VM_LANG->_('PHPSHOP_FILES_FORM_FILE_URL'); ?> :</td> <td> <input type="text" class="inputbox" name="file_url" value="<?php $db->sp("file_url"); ?> " size="32" /> </td>
/** * This function is used for the frontend to display a * complete link list of top-level categories * * @param int $category_id The category to be highlighted * @param string $links_css_class The css class that marks mainlevel links * @param string $list_css_class (deprecated) * @param string $highlighted_style The css styles that format the hightlighted category * @return string HTML code with the link list */ function get_category_tree($category_id = 0, $links_css_class = "mainlevel", $list_css_class = "mm123", $highlighted_style = "font-style:italic;") { global $sess; $categories = ps_product_category::getCategoryTreeArray(); // Get array of category objects $result = ps_product_category::sortCategoryTreeArray($categories); // Sort array of category objects $row_list = $result['row_list']; $depth_list = $result['depth_list']; $category_tmp = $result['category_tmp']; $nrows = sizeof($category_tmp); // Copy the Array into an Array with auto_incrementing Indexes $key = array_keys($categories); // Array of category table primary keys $nrows = $size = sizeOf($key); // Category count $html = ""; // Find out if we have subcategories to display $allowed_subcategories = array(); if (!empty($categories[$category_id]["category_parent_id"])) { // Find the Root Category of this category $root = $categories[$category_id]; $allowed_subcategories[] = $categories[$category_id]["category_parent_id"]; // Loop through the Tree up to the root while (!empty($root["category_parent_id"])) { $allowed_subcategories[] = $categories[$root["category_child_id"]]["category_child_id"]; $root = $categories[$root["category_parent_id"]]; } } // Fix the empty Array Fields if ($nrows < count($row_list)) { $nrows = count($row_list); } // Now show the categories for ($n = 0; $n < $nrows; $n++) { if (!isset($row_list[$n]) || !isset($category_tmp[$row_list[$n]]["category_child_id"])) { continue; } if ($category_id == $category_tmp[$row_list[$n]]["category_child_id"]) { $style = $highlighted_style; } else { $style = ""; } $allowed = false; if ($depth_list[$n] > 0) { // Subcategory! if (isset($root) && in_array($category_tmp[$row_list[$n]]["category_child_id"], $allowed_subcategories) || $category_tmp[$row_list[$n]]["category_parent_id"] == $category_id || $category_tmp[$row_list[$n]]["category_parent_id"] == @$categories[$category_id]["category_parent_id"]) { $allowed = true; } } else { $allowed = true; } $append = ""; if ($allowed) { if ($style == $highlighted_style) { $append = 'id="active_menu"'; } if ($depth_list[$n] > 0) { $css_class = "sublevel"; } else { $css_class = $links_css_class; } $catname = shopMakeHtmlSafe($category_tmp[$row_list[$n]]["category_name"]); $html .= ' <a title="' . $catname . '" style="display:block;' . $style . '" class="' . $css_class . '" href="' . $sess->url(URL . "index.php?page=shop.browse&category_id=" . $category_tmp[$row_list[$n]]["category_child_id"]) . '" ' . $append . '>' . str_repeat(" ", $depth_list[$n]) . $catname . ps_product_category::products_in_category($category_tmp[$row_list[$n]]["category_child_id"]) . '</a>'; } } return $html; }
$tpl->set('ps_product_attribute', $ps_product_attribute); $products[$i]['form_addtocart'] = $tpl->fetch('browse/includes/addtocart_form.tpl.php'); $products[$i]['has_addtocart'] = true; } else { $products[$i]['form_addtocart'] = ''; $products[$i]['has_addtocart'] = false; } $products[$i]['product_flypage'] = $url; $products[$i]['product_thumb_image'] = $product_thumb_image; $products[$i]['product_full_image'] = $product_full_image; $products[$i]['full_image_width'] = $full_image_width; $products[$i]['full_image_height'] = $full_image_height; // Unset these for the next product unset($full_image_width); unset($full_image_height); $products[$i]['product_name'] = shopMakeHtmlSafe($product_name); $products[$i]['product_s_desc'] = $product_s_desc; $products[$i]['product_details'] = $product_details; $products[$i]['product_rating'] = $product_rating; $products[$i]['product_price'] = $product_price; $products[$i]['product_price_raw'] = $product_price_raw; $products[$i]['product_sku'] = $db_browse->f("product_sku"); $products[$i]['product_weight'] = $db_browse->f("product_weight"); $products[$i]['product_weight_uom'] = $db_browse->f("product_weight_uom"); $products[$i]['product_length'] = $db_browse->f("product_length"); $products[$i]['product_width'] = $db_browse->f("product_width"); $products[$i]['product_height'] = $db_browse->f("product_height"); $products[$i]['product_lwh_uom'] = $db_browse->f("product_lwh_uom"); $products[$i]['product_in_stock'] = $db_browse->f("product_in_stock"); $products[$i]['product_available_date'] = $VM_LANG->convert(vmFormatDate($db_browse->f("product_available_date"), $VM_LANG->_('DATE_FORMAT_LC'))); $products[$i]['product_availability'] = $db_browse->f("product_availability");
$flypage = $ps_product->get_flypage($flypage_id); $category_id = vmGet($cart[$i], 'category_id', 0); if ($product_parent_id) { $url = $sess->url(URL . "index.php?page=shop.product_details&flypage={$flypage}&product_id={$product_parent_id}&category_id={$category_id}"); } else { $url = $sess->url(URL . "index.php?page=shop.product_details&flypage={$flypage}&category_id={$category_id}&product_id=" . $_SESSION['cart'][$i]["product_id"]); } $html = str_replace("_", " ", $ps_product->getDescriptionWithTax($_SESSION['cart'][$i]["description"], $_SESSION['cart'][$i]["product_id"])) . " "; if ($product_parent_id) { $db_detail = $ps_product->attribute_sql($cart[$i]["product_id"], $product_parent_id); while ($db_detail->next_record()) { $html .= $db_detail->f("attribute_value") . " "; } } $minicart[$ci]['url'] = $url; $minicart[$ci]['product_name'] = shopMakeHtmlSafe($ps_product->get_field($_SESSION['cart'][$i]["product_id"], "product_name")); $minicart[$ci]['quantity'] = $cart[$i]["quantity"]; $minicart[$ci]['price'] = $CURRENCY_DISPLAY->getFullValue($subtotal); $minicart[$ci]['attributes'] = $html; if (@$_SESSION['vmCartDirection']) { $i++; } else { $i--; } $ci++; } while ($i != $up_limit); //End loop through cart } if (!empty($_SESSION['coupon_discount'])) { $total -= $_SESSION['coupon_discount']; }
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 if ($product_parent_id) { $url = $sess->url(URL . basename($_SERVER['PHP_SELF']) . "?page=shop.product_details&flypage={$flypage}&product_id={$product_parent_id}"); } else { $url = $sess->url(URL . basename($_SERVER['PHP_SELF']) . "?page=shop.product_details&flypage={$flypage}&product_id=" . $_SESSION['cart'][$i]["product_id"]); } $product_rows[$i]['product_name'] = "<a href=\"{$url}\"><strong>" . shopMakeHtmlSafe($ps_product->get_field($_SESSION['cart'][$i]["product_id"], "product_name")) . "</strong></a><br />" . $ps_product->getDescriptionWithTax($_SESSION['cart'][$i]["description"], $_SESSION['cart'][$i]["product_id"]); // Display attribute values if this an item $product_rows[$i]['product_attributes'] = ""; if ($product_parent_id) { $db_detail = $ps_product->attribute_sql($cart[$i]["product_id"], $product_parent_id); while ($db_detail->next_record()) { $product_rows[$i]['product_attributes'] .= "<br />" . $db_detail->f("attribute_name") . " "; $product_rows[$i]['product_attributes'] .= "(" . $db_detail->f("attribute_value") . ")"; } } $product_rows[$i]['product_sku'] = $ps_product->get_field($cart[$i]["product_id"], "product_sku"); /* Product PRICE */ $my_taxrate = $ps_product->get_product_taxrate($cart[$i]["product_id"], $weight_subtotal); $tax = $my_taxrate * 100; $price = $ps_product->get_adjusted_attribute_price($cart[$i]["product_id"], $cart[$i]["description"]); $price['product_price'] = $GLOBALS['CURRENCY']->convert($price['product_price'], $price['product_currency']);
die('Direct Access to ' . basename(__FILE__) . ' is not allowed.'); } /** * * @version $Id: admin.update_result.php 1431 2008-06-20 17:46:57Z soeren_nb $ * @package VirtueMart * @subpackage html * @copyright Copyright (C) 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 * */ global $VM_LANG; require_once CLASSPATH . 'update.class.php'; vmUpdate::stepBar(3); if (!empty($_SESSION['vmupdatemessage'])) { echo '<div class="shop_info">' . shopMakeHtmlSafe($_SESSION['vmupdatemessage']) . '<br /><br /><br />' . $VM_LANG->_('VM_UPDATE_RESULT_TITLE') . ':<br />'; unset($_SESSION['vmupdatemessage']); require_once ADMINPATH . 'version.php'; echo $myVersion . '<br /><br /> <input class="vmicon vmicon32 vmicon-32-apply" type="button" onclick="document.location=\'' . $sess->url($_SERVER['PHP_SELF'] . '?page=store.index') . '\';" value="' . $VM_LANG->_('CMN_CONTINUE') . '" name="submitbutton" />'; echo '</div>'; } else { vmRedirect($sess->url($_SERVER['PHP_SELF'] . '?page=admin.update_check', false, false)); }
function recentProducts($product_id, $maxitems) { global $db, $VM_LANG, $sess; if ($maxitems == 0) { return; } $recentproducts = $_SESSION['recent']; //No recent products so return empty if ($recentproducts['idx'] == 0) { //return ""; } $tpl = new $GLOBALS['VM_THEMECLASS'](); $db = new ps_DB(); $dbp = new ps_DB(); $k = 0; $recent = array(); // Iterate through loop backwards (newest to oldest) for ($i = $recentproducts['idx'] - 1; $i >= 0; $i--) { //Check if on current product and don't display if ($recentproducts[$i]['product_id'] == $product_id) { continue; } // If we have not reached max products add the next product if ($k < $maxitems) { $prod_id = $recentproducts[$i]['product_id']; $category_id = $recentproducts[$i]['category_id']; $q = "SELECT product_name, category_name, c.category_flypage,product_s_desc,product_thumb_image "; $q .= "FROM #__{vm}_product as p,#__{vm}_category as c,#__{vm}_product_category_xref as cx "; $q .= "WHERE p.product_id = '{$prod_id}' "; $q .= "AND c.category_id = '{$category_id}' "; $q .= "AND p.product_id = cx.product_id "; $q .= "AND c.category_id=cx.category_id "; $q .= "AND p.product_publish='Y' "; $q .= "AND c.category_publish='Y' "; $q .= "LIMIT 0,1"; $db->query($q); if (!$db->next_record()) { continue; } if (!$this->is_product($prod_id)) { $prod_id_p = $this->get_field($prod_id, "product_parent_id"); $q = "SELECT product_name,category_name, c.category_flypage,product_s_desc,product_thumb_image "; $q .= "FROM #__{vm}_product as p,#__{vm}_category as c,#__{vm}_product_category_xref as cx "; $q .= "WHERE p.product_id = '{$prod_id_p}' "; $q .= "AND c.category_id = '{$category_id}' "; $q .= "AND p.product_id = cx.product_id "; $q .= "AND c.category_id=cx.category_id LIMIT 0,1"; $dbp->query($q); } $recent[$k]['product_s_desc'] = $db->f("product_s_desc"); if ($recent[$k]['product_s_desc'] == "" && !empty($prod_id_p)) { $recent[$k]['product_s_desc'] = $dbp->f("product_s_desc"); } $flypage = $db->f("category_flypage"); if (empty($flypage) && !empty($prod_id_p)) { $flypage = $dbp->sf("category_flypage"); } if (empty($flypage)) { $flypage = FLYPAGE; } $flypage = str_replace('shop.', '', $flypage); $flypage = stristr($flypage, '.tpl') ? $flypage : $flypage . '.tpl'; $recent[$k]['product_url'] = $sess->url("page=shop.product_details&product_id={$prod_id}&category_id={$category_id}&flypage={$flypage}"); $recent[$k]['category_url'] = $sess->url("page=shop.browse&category_id={$category_id}"); $recent[$k]['product_name'] = $db->f("product_name"); if ($recent[$k]['product_name'] == "" && !empty($prod_id_p)) { $recent[$k]['product_name'] = $dbp->f("product_name"); } $recent[$k]['product_name'] = shopMakeHtmlSafe($recent[$k]['product_name']); $recent[$k]['category_name'] = $db->f("category_name"); if ($recent[$k]['category_name'] == "" && !empty($prod_id_p)) { $recent[$k]['category_name'] = $dbp->f("category_name"); } $recent[$k]['product_thumb_image'] = $db->f("product_thumb_image"); if ($recent[$k]['product_thumb_image'] == "" && !empty($prod_id_p)) { $recent[$k]['product_thumb_image'] = $dbp->f("product_thumb_image"); } $k++; } } if ($k == 0) { return ""; } $tpl->set("recent_products", $recent); return $tpl->fetch('common/recent.tpl.php'); }
$columns = array("#" => "width=\"20\"", $VM_LANG->_('PHPSHOP_PRODUCT_LIST_NAME') => '', $VM_LANG->_('PHPSHOP_PRODUCT_LIST_SKU') => '', $VM_LANG->_('PHPSHOP_PRODUCT_INVENTORY_STOCK') => '', $VM_LANG->_('PHPSHOP_PRODUCT_INVENTORY_PRICE') => '', $VM_LANG->_('PHPSHOP_PRODUCT_INVENTORY_WEIGHT') => '', $VM_LANG->_('CMN_PUBLISHED') => 'width="5%"'); $listObj->writeTableHeader($columns); $db->query($list); $i = 0; while ($db->next_record()) { $listObj->newRow(); // The row number $listObj->addCell($pageNav->rowNumber($i)); // The product name and link $link = $_SERVER['PHP_SELF'] . "?page={$modulename}.product_form&limitstart={$limitstart}&keyword=" . urlencode($keyword) . "&product_id=" . $db->f("product_id") . "&product_parent_id=" . $product_parent_id; if ($vmLayout != 'standard') { $link .= "&no_menu=1&tmpl=component"; $link = defined('_VM_IS_BACKEND') ? str_replace('index2.php', 'index3.php', str_replace('index.php', 'index3.php', $link)) : str_replace('index.php', 'index2.php', $link); } $link = $sess->url($link); $text = shopMakeHtmlSafe($db->f("product_name")); if ($vmLayout == 'standard') { $tmpcell = vmCommonHTML::hyperLink($link, $text, '', 'Edit: ' . $text); } else { $tmpcell = vmCommonHTML::hyperLink($link, $text, '', 'Edit: ' . $text, 'onclick="parent.addSimplePanel( \'' . $db->getEscaped($db->f("product_name")) . '\', \'' . $link . '\' );return false;"'); } $listObj->addCell($tmpcell); $listObj->addCell($db->f("product_sku")); $listObj->addCell($db->f("product_in_stock")); $price = $ps_product->get_price($db->f("product_id")); if ($price) { if (!empty($price["item"])) { $tmp_cell = $price["product_price"]; } else { $tmp_cell = "none"; }
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> '; }
* * @version $Id: shop.recommend.php * @package VirtueMart * @subpackage html * @copyright Copyright (C) 2006 Alatis GmbH & Co. KG. 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__); global $ok; include_once CLASSPATH . 'ps_communication.php'; $vm_mainframe->addStyleSheet('templates/' . $mainframe->getTemplate()); if (empty($_POST['submit']) || !$ok) { $mainframe->setPageTitle($VM_LANG->_('VM_RECOMMEND_FORM_LBL')); echo '<h3>' . $VM_LANG->_('VM_RECOMMEND_FORM_LBL') . '</h3>'; ps_communication::showRecommendForm($product_id); } else { $mainframe->setPageTitle($VM_LANG->_('VM_RECOMMEND_FORM_LBL')); echo '<span class="contentheading">' . $VM_LANG->_('VM_RECOMMEND_DONE') . ' ' . shopMakeHtmlSafe(vmGet($_POST, 'recipient_mail')) . '</span> <br /> <br /> <br /> <a href="javascript:window.close();"> <span class="small">' . $VM_LANG->_('PROMPT_CLOSE') . '</span> </a>'; }