fetchByAssoc($GLOBALS['db']->query("select * from ecmproducts where id='".$product_id."'")); $rrr=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select * from ecmproductcategories where id='".$r['product_category_id']."'")); $rrrs=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select * from ecmproductcategories where id='".$r['product_subcategory_id']."'")); $ww=$GLOBALS['db']->query("select * from ecmproduct_language where language='".$langg."' and ecmproduct_id='".$product_id."'"); while($rr=$GLOBALS['db']->fetchByAssoc($ww)){ $ean=$rr['ean']; $lang[$rr['language']]['ean']=$rr['ean']; $lang[$rr['language']]['remarks']=$rr['remarks']; $lang[$rr['language']]['product_name']=''; $lang[$rr['language']]['product_s_desc']=''; $lang[$rr['language']]['product_desc']=''; if($import_srp_price){ $rr['price']=$r['srp_price']; } else{ $rpr=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select id from ecmpricebooks where name like 'leobite".$langg."%'")); $rlang=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select price from ecmpricebooks_ecmproducts where ecmpricebook_id='".$rpr['id']."' and ecmproduct_id='".$product_id."'")); $rr['price']=$rlang['price']; } $lang[$rr['language']]['product_price']=$rr['price']; //$lang[$rr['language']]['category']=$rrr['name_'.$rr['language']]; } if($r['product_picture']){ $images[$i]['id']=$product_id."_1"; $images[$i]['content']=base64_encode(file_get_contents("modules/EcmProducts/upload/images/big/".$r['product_picture'])); $exp=explode(".",$r['product_picture']); $images[$i]['filename']=$r['product_picture']; if($exp[count($exp)-1]=="jpeg")$exp[count($exp)-1]="jpg"; $images[$i]['extension']=$exp[count($exp)-1]; $i++; } $ww=$GLOBALS['db']->query("select * from notes where parent_type='EcmProducts' and deleted='0' and parent_id='".$product_id."'"); while($rr=$GLOBALS['db']->fetchByAssoc($ww)){ if(eregi(" kar ",$rr['name']))continue; if($rr['file_mime_type']=="image/jpeg" || $rr['file_mime_type']=="image/jpg" || $rr['file_mime_type']=="image/png" || $rr['file_mime_type']=="image/gif"){ $images[$i]['id']=$rr['id']; $images[$i]['content']=base64_encode(file_get_contents("cache/upload/".$rr['id'])); $images[$i]['filename']=$rr['filename']; $exp=explode("/",$rr['file_mime_type']); if($exp[1]=="jpeg")$exp[1]="jpg"; $images[$i]['extension']=$exp[1]; $i++; } } if($r['packing_front_picture']){ $images[$i]['id']=$product_id."_2"; $images[$i]['content']=base64_encode(file_get_contents("modules/EcmProducts/upload/images/big/".$r['packing_front_picture'])); $exp=explode(".",$r['packing_front_picture']); $images[$i]['filename']=$r['packing_front_picture']; if($exp[count($exp)-1]=="jpeg")$exp[count($exp)-1]="jpg"; $images[$i]['extension']=$exp[count($exp)-1]; } $rmuid=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select first_name,last_name,user_name from users where id='".$r['modified_user_id']."'")); $rbean=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select email_id from emails_beans where bean_id='".$r['modified_user_id']."' and bean_module='Users' and deleted='0'")); $remail=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select email_address from email_addresses where id='".$rbean['email_id']."'")); $modified=$rmuid['user_name']; if($remail['email_address'])$modified=', '.$remail['email_address']; $xml.=' '.$modified.' '.$r['vendor_id'].' 0 '.$r['code'].' '.$r['selling_price'].' '.$ean.' '.$product_id.'_1 '.$product_id.'_1 N '.$r['product_brutto_weight'].' kg 0.0000 0.0000 0.0000 '.$r['unit_id'].' '.$r['ems_qty_in_stock'].' N 0 '.$r['date_entered'].' '.$r['date_modified'].' 23% 23 0 0 '; if($r['product_subcategory_id']){ $xml.=' '; } $xml.=''; foreach($images as $img){ $xml.=' '.$img['id'].' '.$img['content'].' '.$img['filename'].' '.$img['extension'].' '; } $xml.=' '; foreach($lang as $k=>$v){ $xml.='<'.$k.'>'; foreach($v as $kk=>$vv){ $xml.='<'.$kk.'>'.$vv.''; } $xml.=''; } $xml.=' '; return $xml; } ?>