require 'includes/database_tables.php'; global $filelayout, $filelayout_count, $filelayout_sql, $langcode, $fileheaders; $orders_status = $HTTP_GET_VARS['orders_status']; //elari check default language_id from configuration table DEFAULT_LANGUAGE $epdlanguage_query = tep_db_query("select languages_id, name from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_LANGUAGE . "'"); if (tep_db_num_rows($epdlanguage_query)) { $epdlanguage = tep_db_fetch_array($epdlanguage_query); $epdlanguage_id = $epdlanguage['languages_id']; $epdlanguage_name = $epdlanguage['name']; } else { echo 'Strange but there is no default language to work... That may not happen, just in case... '; } $langcode = ep_get_languages(); if ($dltype != '') { // if dltype is set, then create the filelayout. Otherwise it gets read from the uploaded file ep_create_filelayout($dltype, $orders_status); // get the right filelayout for this download } //******************************* //******************************* // E N D // INITIALIZATION //******************************* //******************************* if ($download == 'stream' or $download == 'tempfile') { //******************************* //******************************* // DOWNLOAD FILE //******************************* //******************************* $filestring = "";
'v_tax_class_title', 'v_manufacturers_name', 'v_manufacturers_id', 'v_products_dim_type', 'v_products_length', 'v_products_width', 'v_products_height', 'v_products_upc' ); $langcode = ep_get_languages(); if ($dltype != ''){ // if dltype is set, then create the filelayout. Otherwise it gets read from the uploaded file ep_create_filelayout($dltype); // get the right filelayout for this download } if ($download == 'stream' or $download == 'tempfile'){ $sFile = ''; // this holds the csv file we want to download $result = $dbconn->Execute($filelayout_sql); // Here we need to allow for the mapping of internal field names to external field names // default to all headers named like the internal ones // the field mapping array only needs to cover those fields that need to have their name changed if ( count($fileheaders) != 0 ){ $filelayout_header = $fileheaders; // if they gave us fileheaders for the dl, then use them
//####### witalik :zdes' tablicy dlja vhodjaschego fajla (import) global $default_these; $default_these = array('v_products_image', 'v_categories_id', 'v_products_price', 'v_products_quantity', 'v_products_weight', 'v_date_avail', 'v_date_added', 'v_instock', 'v_tax_class_title', 'v_manufacturers_name', 'v_manufacturers_id', 'v_products_dim_type', 'v_products_length', 'v_products_width', 'v_products_height'); //elari check default language_id from configuration table DEFAULT_LANGUAGE $epdlanguage_query = olc_db_query("select languages_id, name from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_LANGUAGE . APOS); if (olc_db_num_rows($epdlanguage_query)) { $epdlanguage = olc_db_fetch_array($epdlanguage_query); $epdlanguage_id = $epdlanguage['languages_id']; $epdlanguage_name = $epdlanguage['name']; } else { echo 'Strange but there is no default language to work... That may not happen, just in case... '; } $langcode = ep_get_languages(); if ($dltype != '') { // if dltype is set, then create the filelayout. Otherwise it gets read from the uploaded file ep_create_filelayout($dltype); // get the right filelayout for this download } //******************************* //******************************* // E N D // INITIALIZATION //******************************* //******************************* if ($download == 'stream' or $download == 'tempfile') { //******************************* //******************************* // DOWNLOAD FILE //******************************* //******************************* $filestring = "";
$default_these[] = 'v_products_price'; $default_these[] = 'v_products_quantity'; $default_these[] = 'v_products_weight'; $default_these[] = 'v_status_current'; $default_these[] = 'v_date_avail'; $default_these[] = 'v_date_added'; $default_these[] = 'v_tax_class_title'; $default_these[] = 'v_manufacturers_name'; $default_these[] = 'v_manufacturers_id'; $filelayout = ''; $filelayout_count = ''; $filelayout_sql = ''; $fileheaders = ''; if (!empty($_GET['dltype'])) { // if dltype is set, then create the filelayout. Otherwise it gets read from the uploaded file list($filelayout, $filelayout_count, $filelayout_sql, $fileheaders) = ep_create_filelayout($_GET['dltype'], $attribute_options_array, $languages, $custom_fields); // get the right filelayout for this download } //******************************* //******************************* // E N D // INITIALIZATION //******************************* //******************************* //******************************* //******************************* // DOWNLOAD FILE (EXPORT) //******************************* //******************************* if (!empty($_GET['download']) && ($_GET['download'] == 'stream' or $_GET['download'] == 'activestream' or $_GET['download'] == 'tempfile')) { $filestring = "";