=$L->Str('product_number')?> = $item['id']?>
/*
if(!$item['user_rating']) { ?>
=$L->Str('rate_this_product');?>:
} else { ?>
=$L->Str('your_rate');?>:
=$item['user_rating']?>
} ?> */ ?>
=$L->Str('rating');?>
=$item['rating']?> =$L->Str('rating_count');?> =$item['rating_count']?>
if($open) { ?>
$documents = Products_Documents::getInstance()->getList($item['id']);
$deliveries = Products_Delivery::getInstance()->getList(['active'=>1]);
if(!empty($documents)) {
?>
}
}
?>
if($item['action']) { ?>
=$L->Str('till_action_end')?>
0
=$L->Str('days_short')?>
0
=$L->Str('hours_short')?>
0
=$L->Str('min_short')?>
0
} ?>
if(!$open) { ?>
=$item['good_name']?>
} else { ?>
=$L->StrT('goods','title', $item['id'], $item['title'])?>
} ?>
if($item['title_2']) { ?>
=$item['title_2']?>
} ?>
if(!empty($item['labels_array'])) { ?>
foreach($labelsList as $label) {
if(!isset($item['labels_array'][$label['id']]))
continue;
?>
=$label['name']?>
} ?>
} ?>
if(isset($item['saved_money']) && $item['saved_money']>0) { ?>
=$L->Str('save_money_text')?>
=$item['saved_money']?> EUR =$L->Str('monthly')?>
, =$L->Str('buyoff')?>
=$item['buyofftime']?> =$item['buyofftime_text']?>
} ?>
if(!$open) { ?>
} ?>
€ =$actual_price_arr[0]?>.=$actual_price_arr[1]?>
if($item['measure']) { ?>
=getVar('for')?>
=$item['equals_units']?>
=$item['measure_text'] ? " ".$item['measure_text'] : ""?>
} ?>
if($item['price_old']>0) { ?>
€=$item['price_old']?>
} ?>
=$L->Str('purchase_for_company')?> ?
=$L->Str('get_a_discount')?>
if($open) { ?>
=$L->Str('free')?>, =$L->Str('delivery_direction_4')?> if($item['stock']>0) { ?> =$L->Str('available_at_once')?> } ?>
<\?=$L->Str('free')?\>, <\?=$L->Str('delivery_direction_2')?\> <\? if($item['stock']>0) { ?\>
<\?=$L->Str('available_at_once')?\> <\? } ?\>
*/ ?>
if($deliveries[2]['free_delivery_riga']>0) { ?>
=getVar('delivery_courier')?> =getVar('in_riga')?> =getVar('above')?> €=$deliveries[2]['free_delivery_riga']?> bez maksas
} else { ?>
=getVar('delivery_courier')?> =getVar('in_riga')?>=$L->Str('free')?>
} ?>
if($deliveries[2]['free_delivery_latvia']>0) { ?>
=getVar('delivery_courier')?> =getVar('in_latvia')?> =getVar('above')?> €=$deliveries[2]['free_delivery_latvia']?> bez maksas
} else { ?>
=getVar('delivery_courier')?> =getVar('in_latvia')?> =$L->Str('free')?>
} ?>
} ?>
$data = ob_get_clean();
return $data;
}
public static function goodsBlock($items ) {
$html='';
$products = new Products();
$L = Core_Language::getInstance();
$labels = new Products_Labels;
$labelsList = $labels->getList();
ob_start();
?>
';
foreach ($items as $item) {
$thumb = $products->getThumbnail($item['id'],'t');
$bigpic = $products->getThumbnail($item['id'],'');
$link = $products -> getLink($item['id']);
$title= htmlspecialchars($item['title']);
$link = $products -> getLink($item['id']);
$html .= '
';
}
$html .= '
';
}
return $html;
}
public static function partnersBoxDefault2(array $items, $open=false) {
$html='';
$products = new Partners();
$L = Core_Language::getInstance();
if (!empty($items)) {
//print_r($items);
$html .= '';
foreach ($items as $item) {
$thumb = $products->getThumbnail($item['id'],'t');
$bigpic = $products->getThumbnail($item['id'],'');
$link = $products -> getLink($item['id']);
$title= htmlspecialchars($item['title']);
$link = $products -> getLink($item['id']);
$html .= '
';
}
$html .= '
';
}
return $html;
}
public static function videoBoxDefault(array $items, $open=false) {
$html='';
$products = new Video();
$L = Core_Language::getInstance();
if (!empty($items)) {
//print_r($items);
$html .= '';
$vid = new Projects_Video();
foreach ($items as $item) {
$all_vids = $vid->getVideos($item['id']);
$images = $products -> getImages($item['id']);
$photos ='';
if (!empty($images) && count($images)>1) {
$photos .= '
';
$i=0;
foreach ($images as $img) {
$i++;
if(!$open && $i>6) continue;
$img['picture'] = htmlspecialchars($img['picture']);
$photos .= '
';
}
}
$photos .= '
';
$videos ='';
$vids = array();
foreach ($all_vids as $video) {
if(!$open && !$video['isthumb'])
continue;
$vids[]=$video;
}
if (!empty($vids)) {
$videos .= '
';
$i=0;
foreach ($vids as $video) {
$videos .= $video['embed2'].'
';
}
$videos .= '
';
}
$title= htmlspecialchars($item['title']);
$link = $products -> getLink($item['id']);
$short_description = strip_tags($L->StrT('projects','descr', $item['id'], ''));
$item['short_desc'] = strlen($short_description)>520 ? mb_substr(strip_tags($short_description),0,520,'UTF8').'...' : $short_description;
$thumb_small = '
.')
';
$thumb_large = '
.')
';
$html .= '
';
if($show_description) {
if(!$open) $html .= '
'.$thumb_small.$item['short_desc'].'
';
else
$html .= '
'.$thumb_large. $L->StrT('projects','descr', $item['id'], '').'
';
}
if(!empty($vids)) {
$html .= '
';
$html .= ''.$videos.'';
$html .= ''.$photos.'';
$html .='
';
$html .='
';
} else {
$html .= '
'.$photos.'';
}
if(!$open) $html .='
';
$html .='
';
}
$html .= '
';
}
return $html;
}
public static function projectShortBoxDefault(array $all_items,$gallery=false,$thumb=true,$go_link='') {
$html='';
$items = $all_items;
$products = new Projects();
$L = Core_Language::getInstance();
if (!empty($items)) {
$all_link = '/projects/'.$go_link;
$html .= '';
foreach ($items as $item) {
if($gallery) {
$images = $products -> getImages($item['id']);
$photos ='';
if (!empty($images) && count($images)>1) {
$photos .= '
';
$i=0;
foreach ($images as $img) {
$i++;
if($i>5) continue;
$img['picture'] = htmlspecialchars($img['picture']);
$photos .= '
';
}
}
$photos .= '
';
}
$title= htmlspecialchars($item['title']);
$link = $products -> getLink($item['id']);
$short_description = strip_tags($L->StrT('projects','descr', $item['id'], $item['descr']));
$item['short_desc'] = strlen($short_description)>520 ? mb_substr(strip_tags($short_description),0,520,'UTF8').'...' : $short_description;
$thumb_small = '';
$html .= '
';
$html .= '
';
$html .= '
';
}
//$html .='
';
$html .= '
';
}
return $html;
}
public static function blogShortBoxDefault(array $all_items,$gallery=false,$thumb=true,$go_link='') {
$html='';
$items = $all_items;
$products = new Projects();
$L = Core_Language::getInstance();
if (!empty($items)) {
$link_base = '/blog/';
$html .= '';
foreach ($items as $item) {
$title= htmlspecialchars($item['title']);
$html .= '
';
$html .= '
';
$html .= '
'.$item['title'].'';
$html .= '
';
if($thumb) $html .= '

';
$html .='
';
$html .= ' '.$item['short_desc'].'
';
$html .= '';
//$html .= '
'.$item['human_date'].'
';
$html .= '
';
$html .='
';
$html .= '
';
$html .= '
';
}
$html .= '
';
}
return $html;
}
public static function blogBoxDefault($item) {
$html='';
$L = Core_Language::getInstance();
if (!empty($item)) {
$html .= '';
$title= htmlspecialchars($item['title']);
$html .= '
';
$html .= '
';
$html .= '
'.$item['title'].'
';
$html .= '
';
if($item['image']) $html .= '

';
$html .='
';
$html .= ' '.$item['text'].'
';
$html .= '';
//$html .= '
'.$item['human_date'].'
';
$html .= '
';
$html .= '
';
$html .= '
';
$html .= '
';
}
return $html;
}
public static function reviewsBoxDefault(array $items) {
$html='';
$products = new Reviews();
$L = Core_Language::getInstance();
if (!empty($items)) {
//$all_link = '/reviews/'.$go_link;
$html .= '';
foreach ($items as $item) {
$title= htmlspecialchars($item['title']);
//$short_description = strip_tags($L->StrT('content','descr', $item['id'], $item['descr']));
//$item['short_desc'] = strlen($short_description)>520 ? mb_substr(strip_tags($short_description),0,520,'UTF8').'...' : $short_description;
$thumb_small = '';
$html .= '
';
$html .= '
';
$html .= '
';
//if($thumb) $html .= '
.')
';
$html .='
';
$html .= ''.$item['title'].'';
$html .= $item['descr'];
$html .= '';
//$html .= '
'.$item['human_date'].'
';
$html .= '
';
$html .= '
';
$html .= '
';
}
// $html .='
';
$html .= '
';
}
return $html;
}
static function show_work_galleries($galleries,$type=1) {
global $L;
$Gallery = new WorksGallery();
//$DB = Core_Database::getInstance();
ob_start();
?>
foreach ($galleries as $gall) {
$images = $Gallery -> getImages($gall['id'], 1);
if (!empty($images)) {
$count = count($images);
$thumb = $images[0]['picture_2'];
} else {
if($gall['icon'])
$thumb = $dest = '/images/worksgallery/'.$gall['icon'];
else $thumb='';
}
$style= 'width:140px';
if($thumb && file_exists($_SERVER['DOCUMENT_ROOT'].$thumb)) {
$size = getimagesize($_SERVER['DOCUMENT_ROOT'].$thumb);
if($size[0]>$size[1]) {
$style='width:140px';
}
if($size[0]<$size[1] || $size[0]==$size[1] ) {
$style='height:120px';
}
}
$link = '?'.Tools_Http::replaceUrl($_GET, 'gid', $gall['id']);
$data=explode(' ',$gall['created']);
if(!$type)
$link .=$gall['type']=='gallery' ? '&gallery' : '';
if ($thumb) {
?>
if($gall['images']) { ?>
=$gall['images']?>
} ?>