<?php
defined( '_JEXEC' ) or die( 'Прямой доступ к файлу невозможен' );
if(!class_exists('modPriceHelper')) require(JPATH_SITE . DS . 'modules' . DS . 'mod_eprice'.DS.'helper.php');
$vendorId = '1';//ID продавца
$categoryModel = VmModel::getModel('category');
$productModel = VmModel::getModel('product');
$category_id = 0; //ID основной родительской категории
$p = 10;// Ограничение глубины вложенности категорий
$select = '';
$line = 3;
$selected = $params->get('cat_id');
$SelectCategory = modPriceHelper::GetPriceCategorySelect($category_id, $vendorId, $categoryModel, $p, $select, $selected);
$formId = $params->get('formId');
if(isset($_POST['price'.$formId])) {
/*//Считываем текущее время
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$tstart = $mtime; */
//if ($_POST['cat_id']!=='0'){
$PriceParam['categoryId'] = $_POST['cat_id'.$formId];
//}else{
// $PriceParam['categoryId'] = $params->get('cat_id');
//}
$PriceParam['ShowLines'] = $_POST['showlines'.$formId];
$PriceParam['article'] = $_POST['artic'.$formId];
$PriceParam['desc'] = $_POST['desc'.$formId];
$PriceParam['sklad'] = $_POST['sklad'.$formId];
$PriceParam['photo'] = $_POST['photo'.$formId];
$PriceParam['ExportType'] = $_POST['export_type'.$formId];
$PriceParam['filename'] = $params->get('filename');
$PriceParam['page_size'] = $params->get('page_size');
if ($_POST['filename'.$formId]!=='0'){
$PriceParam['filename'] = $_POST['filename'.$formId];
}else{
$PriceParam['filename'] = $params->get('filename');
}
if ($_POST['save'.$formId]){
$PriceParam['save'] = $_POST['save'.$formId];
}else{
$PriceParam['save'] = $params->get('save');
}
$PriceParam['vendorId'] = '1';
$PriceParam['name_url'] = $params->get('name_url');
$PriceParam['category_url'] = $params->get('category_url');
$PriceParam['header']['txt_c'] = $params->get('header_txt_c');
$PriceParam['header']['txt_r'] = $params->get('header_txt_r');
$PriceParam['header']['txt_size'] = $params->get('header_txt_size');
$PriceParam['header']['font'] = $params->get('header_txt_font');
$PriceParam['header']['txt_color'] = str_replace('#', '', $params->get('header_txt_color'));
$PriceParam['header']['bg_color'] = str_replace('#', '', $params->get('header_bg_color'));
$PriceParam['header']['htsize'] = $params->get('htsize');
$PriceParam['header']['htfont'] = $params->get('htfont');
$PriceParam['header']['htcolor'] = str_replace('#', '', $params->get('htcolor'));
$PriceParam['header']['hbcolor'] = str_replace('#', '', $params->get('hbcolor'));
$PriceParam['header']['hbrcolor'] = str_replace('#', '', $params->get('hbrcolor'));
$PriceParam['header']['img'] = $params->get('header_img');
$PriceParam['body']['txt_size'] = $params->get('body_txt_size');
$PriceParam['body']['font'] = $params->get('body_txt_font');
$PriceParam['body']['txt_color'] = str_replace('#', '', $params->get('body_txt_color'));
$PriceParam['body']['bg_color'] = str_replace('#', '', $params->get('body_bg_color'));
$PriceParam['body']['bbrcolor'] = str_replace('#', '', $params->get('bbrcolor'));
$PriceParam['cat']['txt_size'] = $params->get('cat_txt_size');
$PriceParam['cat']['font'] = $params->get('cat_txt_font');
$PriceParam['cat']['txt_color'] = str_replace('#', '', $params->get('cat_txt_color'));
$PriceParam['cat']['bg_color'] = str_replace('#', '', $params->get('cat_bg_color'));
$PriceParam['cat']['cbrcolor'] = str_replace('#', '', $params->get('cbrcolor'));
$PriceParam['nomer'] = 1;
$PriceParam['wPhoto'] = 0;
modPriceHelper::GetPrice( $category_id, $vendorId, $categoryModel, $productModel, $line, $PriceParam);
/*//Делаем все то же самое, чтобы получить текущее время
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$tend = $mtime;
$totaltime = ($tend - $tstart);
printf ('<script type="text/javascript">alert("Прайс сгенерирован за %f секунд !");</script>', $totaltime); */
}
require JModuleHelper::getLayoutPath('mod_eprice', $params->get('layout', 'default'));
?>
[свернуть]