micha2003 Posted April 22, 2006 Report Share Posted April 22, 2006 hallo Kann mir jemand helfen, wo wird hier die reihenfolge der daten die geschrieben werden festgelegt function process($file) { @xtc_set_time_limit(0); require(DIR_FS_CATALOG.DIR_WS_CLASSES . 'xtcPrice.php'); $xtPrice = new xtcPrice($_POST['currencies'],$_POST['status']); $schema = 'merchantCategory offerID name brand description deeplink imageURL prices'."\n"; $schema = 'offerID Nr.2;brand Nr.4;name Nr.3;merchantCategory Nr.1;description Nr.5;L?SCHEN;imageURL Nr.7;deeplink Nr.6;prices Nr.8;L?SCHEN'."\n"; $export_query =xtc_db_query("SELECT p.products_id, pd.products_name, pd.products_description,pd.products_short_description, p.products_model, p.products_ean, p.products_image, p.products_price, p.products_status, p.products_date_available, p.products_shippingtime, p.products_discount_allowed, pd.products_meta_keywords, p.products_tax_class_id, p.products_date_added, m.manufacturers_name FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_MANUFACTURERS . " m ON p.manufacturers_id = m.manufacturers_id LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id AND pd.language_id = '".$_SESSION['languages_id']."' LEFT JOIN " . TABLE_SPECIALS . " s ON p.products_id = s.products_id WHERE p.products_status = 1 ORDER BY p.products_date_added DESC, pd.products_name"); // get product categorie $categorie_query=xtc_db_query("SELECT categories_id FROM ".TABLE_PRODUCTS_TO_CATEGORIES." WHERE products_id='".$products['products_id']."'"); while ($categorie_data=xtc_db_fetch_array($categorie_query)) { $categories=$categorie_data['categories_id']; } while ($products = xtc_db_fetch_array($export_query)) { $products_price = $xtPrice->xtcGetPrice($products['products_id'], $format=false, 1, $products['products_tax_class_id'], ''); // remove trash $products_description = strip_tags($products['products_description']); $products_description = str_replace(" "," ",$products_description); $products_description = str_replace(" "," ",$products_description); $products_description = str_replace(";",", ",$products_description); $products_description = str_replace("'",", ",$products_description); $products_description = str_replace("\n"," ",$products_description); $products_description = str_replace("\r"," ",$products_description); $products_description = str_replace("\t"," ",$products_description); $products_description = str_replace("\v"," ",$products_description); $products_description = str_replace("","," \"",$products_description); $products_description = str_replace("&qout,"," \"",$products_description); $products_description = str_replace(chr(13)," ",$products_description); $products_short_description = strip_tags($products['products_short_description']); $products_short_description = str_replace(" "," ",$products_short_description); $products_short_description = str_replace(" "," ",$products_short_description); $products_short_description = str_replace(";",", ",$products_short_description); $products_short_description = str_replace("'",", ",$products_short_description); $products_short_description = str_replace("\n"," ",$products_short_description); $products_short_description = str_replace("\r"," ",$products_short_description); $products_short_description = str_replace("\t"," ",$products_short_description); $products_short_description = str_replace("\v"," ",$products_short_description); $products_short_description = str_replace("","," \"",$products_short_description); $products_short_description = str_replace("&qout,"," \"",$products_short_description); $products_short_description = str_replace(chr(13)," ",$products_short_description); $products_short_description = substr($products_short_description, 0, 255); $products_description = substr($products_description, 0, 65536); $cat = $this->buildCAT($categories); if ($products['products_image'] != ''){ $image = HTTP_CATALOG_SERVER . DIR_WS_CATALOG_THUMBNAIL_IMAGES .$products['products_image']; }else{ $image = ''; } //create content $schema .= $products['products_id'] .";". $products['manufacturers_name'].";". $products['products_name'].";". substr($cat,0,strlen($cat)-2).";". $products_short_description.";". $products_description.";". $image.";". HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'product_info.php?'.$_POST['campaign'].xtc_product_link($products['products_id'], $products['products_name']) . "; EUR" . number_format($products_price,2,'.',''). ";" . $products['products_ean'] ."\n"; } // create File $fp = fopen(DIR_FS_DOCUMENT_ROOT.'export/' . $file, "w+"); fputs($fp, $schema); fclose($fp); switch ($_POST['export']) { case 'yes': // send File to Browser $extension = substr($file, -3); $fp = fopen(DIR_FS_DOCUMENT_ROOT.'export/' . $file,"rb"); $buffer = fread($fp, filesize(DIR_FS_DOCUMENT_ROOT.'export/' . $file)); fclose($fp); header('Content-type: application/x-octet-stream'); header('Content-disposition: attachment; filename=' . $file); echo $buffer; exit; break; } } function buildCAT($catID) { if (isset($this->CAT[$catID])) { return $this->CAT[$catID]; } else { $cat=array(); $tmpID=$catID; while ($this->getParent($catID)!=0 || $catID!=0) { $cat_select=xtc_db_query("SELECT categories_name FROM ".TABLE_CATEGORIES_DESCRIPTION." WHERE categories_id='".$catID."' and language_id='".$_SESSION['languages_id']."'"); $cat_data=xtc_db_fetch_array($cat_select); $catID=$this->getParent($catID); $cat[]=$cat_data['categories_name']; } $catStr=''; for ($i=count($cat);$i>0;$i--) { $catStr.=$cat[$i=1].' > '; } $this->CAT[$tmpID]=$catStr; return $this->CAT[$tmpID]; } } function getParent($catID) { if (isset($this->PARENT[$catID])) { return $this->PARENT[$catID]; } else { $parent_query=xtc_db_query("SELECT parent_id FROM ".TABLE_CATEGORIES." WHERE categories_id='".$catID."'"); $parent_data=xtc_db_fetch_array($parent_query); $this->PARENT[$catID]=$parent_data['parent_id']; return $parent_data['parent_id']; } } function display() { $customers_statuses_array = xtc_get_customers_statuses(); // build Currency Select $curr=''; $currencies=xtc_db_query("SELECT code FROM ".TABLE_CURRENCIES); while ($currencies_data=xtc_db_fetch_array($currencies)) { $curr.=xtc_draw_radio_field('currencies', $currencies_data['code'],true).$currencies_data['code'].' '; } $campaign_array = array(array('id' => '', 'text' => TEXT_NONE)); $campaign_query = xtc_db_query("select campaigns_name, campaigns_refID from ".TABLE_CAMPAIGNS." order by campaigns_id"); while ($campaign = xtc_db_fetch_array($campaign_query)) { $campaign_array[] = array ('id' => 'refID='.$campaign['campaigns_refID'].'&', 'text' => $campaign['campaigns_name'],); } return array('text' => EXPORT_STATUS_TYPE.' '. EXPORT_STATUS.' '. xtc_draw_pull_down_menu('status',$customers_statuses_array, '1').' '. CURRENCY.' '. CURRENCY_DESC.' '. $curr. CAMPAIGNS.' '. CAMPAIGNS_DESC.' '. xtc_draw_pull_down_menu('campaign',$campaign_array).' '. EXPORT_TYPE.' '. EXPORT.' '. xtc_draw_radio_field('export', 'no',false).EXPORT_NO.' '. xtc_draw_radio_field('export', 'yes',true).EXPORT_YES.' '. ' ' . xtc_button(BUTTON_EXPORT) . xtc_button_link(BUTTON_CANCEL, xtc_href_link(FILENAME_MODULE_EXPORT, 'set=' . $_GET['set'] . '&module=pangora'))); } function check() { if (!isset($this->_check)) { $check_query = xtc_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PANGORA_STATUS'"); $this->_check = xtc_db_num_rows($check_query); } return $this->_check; } Link to comment Share on other sites More sharing options...
aggrosoft Posted April 22, 2006 Report Share Posted April 22, 2006 Hi, steht doch hier create mfg aggro Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.