fetchByAssoc ( $GLOBALS ['db']->query ( "select srp_price_eur,product_category_id,srp_price,name,code,product_picture,packing_front_picture, ean, ean2 from ecmproducts where id='" . $id . "' and deleted='0'" ) ); if ($price == "srp_price" || $price == "") { if ($symbol == 'PLN') $price = number_format ( $r ['srp_price'], 2, ',', ' ' ); else if ($symbol == 'EUR') $price = number_format ( $r ['srp_price_eur'], 2, ',', ' ' ); $price.=' '.$symbol; } else if ($price == "pricebook_price") { $pr = $GLOBALS ['db']->fetchByAssoc ( $GLOBALS ['db']->query ( "SELECT pp.price, p.currency_value FROM ecmpricebooks_ecmproducts as pp INNER JOIN ecmpricebooks AS p ON pp.ecmpricebook_id=p.id where pp.ecmpricebook_id='" . $_SESSION ['pricebook_id'] . "' and pp.ecmproduct_id='" . $id . "' and pp.deleted='0'" ) ); if ($pr['currency_value']=='' || is_null($pr['currency_value'])) $pr['currency_value'] = 1; if ($symbol != 'PLN') $pr['price'] = $pr['price'] / $pr['currency_value']; $price = format_number($pr['price']); $price.=' '.$symbol; } else { $pr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT pp.price, p.exchange_rate_id FROM ecmprices_ecmproducts AS pp INNER JOIN ecmprices AS p ON pp.ecmprice_id=p.id WHERE pp.ecmprice_id='$price' AND pp.ecmproduct_id='$id'")); $c = new Currency; $c->retrieve($pr['exchange_rate_id']); $symbol = $c->iso4217; unset($c); $price = format_number($pr['price']).' '.$symbol; } if ($parent_type=='EcmQuotes') { $pr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT price_netto FROM ecmquoteitems WHERE id='$parent_item_id' AND deleted='0'")); $price = format_number($pr['price_netto']).' '.$symbol; } $product_picture = 'modules/EcmProducts/upload/images/big/' . $r ['product_picture']; if (file_exists ( 'modules/EcmProducts/upload/images/big/' . $r ['packing_front_picture'] )) $packing_front_picture = 'modules/EcmProducts/upload/images/big/' . $r ['packing_front_picture']; $rr = $GLOBALS ['db']->fetchByAssoc ( $GLOBALS ['db']->query ( "select ean,long_description,short_description from ecmproduct_language where ecmproduct_id='" . $id . "' and deleted='0' and lower(language)='" . $lang . "'" ) ); $ld = $rr ['long_description']; if (! $rr ['ean']) { $rrr = $GLOBALS ['db']->fetchByAssoc ( $GLOBALS ['db']->query ( "select ean from ecmproduct_language where ecmproduct_id='" . $id . "' and language='pl'" ) ); $rr ['ean'] = $rrr ['ean']; } if ($ean == 2) { $r ['ean'] = $r ['ean2']; } if ($ean == 0) { $r['ean'] = ''; } if ($rr ['short_description'] && $rr ['short_description'] != '') $r ['name'] = $rr ['short_description']; //create description $tmp = explode(' ', $ld); $description = ''; $paste = false; foreach ($tmp as $line) { if ($paste && strpos($line,'strong')!=false) break; if ($paste) $description.=$line; if (strpos($line, trim($description_label))) $paste = true; } $specification = ''; $paste = false; foreach ($tmp as $line) { if ($paste && strpos($line,'strong')!=false) break; if ($paste) $specification.=$line; if (strpos($line, trim($specification_label))) $paste = true; } //$specification = str_replace(" @page { margin: 5mm; } div.div_main_style { width:289mm; min-width:289mm; height:200mm; min-height:200mm ; !important; background: url("https://'.$_SERVER['HTTP_HOST'].'/modules/EcmProducts/card_images/background.jpg") 50% 0 no-repeat; background-size: contain; } table.table_main_style { margin-top: 25mm; width:289mm; min-width:289mm; height:150mm; min-height:150mm !important; } * { font-family: chelvetica; }
 '; if ($show_price==1) { //$html.=' //
'.$price.'
//'; $html.='

'.$price.'

'; } $html.='

' . html_entity_decode($r['name']) . '

<-- indeks, ean -->
'.$index_lbl.':  '.$r['code'].'
EAN:  '.$r['ean'].'  
 
'.$description_label.'  
 
'.html_entity_decode($description).'  
 
'.$specification_label.'  
'.html_entity_decode($specification).'
'; $p->WriteHTML ( $html ); // echo $html; return $p; } function prepareName($t) { $a1 = array ( """, "a", "ą", "b", "c", "ć", "d", "e", "ę", "f", "g", "h", "i", "j", "k", "l", "ł", "m", "n", "ń", "o", "ó", "p", "q", "r", "s", "ś", "t", "u", "v", "w", "x", "y", "z", "ż", "ź" ); $a2 = array ( '"', "A", "Ą", "B", "C", "Ć", "D", "E", "Ę", "F", "G", "H", "I", "J", "K", "L", "Ł", "M", "N", "Ń", "O", "Ó", "P", "Q", "R", "S", "Ś", "T", "U", "V", "W", "X", "Y", "Z", "Ż", "Ź" ); $t = str_replace ( $a1, $a2, $t ); return iconv ( "UTF-8", "ISO-8859-2", $t ); } ?>