mobimob Posted March 14, 2006 Posted March 14, 2006 Hi, I have the Customers_Export function installed in my shop. It works fine, but the only thing I'm missing is the name of the order, witch the customers have bought. Is the anyway that I can see that also in the file (.CSV), that is generated with this file: <?php require('includes/application_top.php'); if (!$HTTP_GET_VARS['submit']) { ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//DE"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#CCCC33"> <!-- header //--> <?php require(DIR_WS_INCLUDES.'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2" > <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES.'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td><td> <!-- body_text //--> <?php echo "Export and Save Customer Data onto your Local Machine"; echo '<form action="'. $phpself.'">'; echo '<input type="submit" value="Export" name="submit"></form>'; ?> </td> </table> <!-- footer //--> <center><font color="#666666" size="2"></font></center> <!-- footer_eof //--> <br> </body> </html> <?php } else { $contents="Firstname,Lastname,Gender,DOB,Company,Address,Zip,City,State,Country,Phone, Email,Fax\n"; $user_query = mysql_query('select c.*, adb.* from customers as c left join address_book as adb on c.customers_id = adb.customers_id'); while($row = mysql_fetch_array($user_query)) { if ($row[customers_gender]=="m") { $gender = "Male"; } else { $gender = "Female"; } if ($row[entry_country_id] == 81) { $land="Deutschland"; } else { $country_query = mysql_query("select countries_name from countries where countries_id = '" . $row[entry_country_id] . "';"); $landq = mysql_fetch_array($country_query); $land=$landq[countries_name]; } if ($row[entry_zone_id] != 0) { $state_query = mysql_query("select zone_name from zones where zone_id = '" . $row[entry_zone_id ] . "';"); $stateq = mysql_fetch_array($state_query); $state =$stateq[zone_name]; } $contents.=$row[customers_firstname].","; $contents.=$row[customers_lastname].","; $contents.=$gender.","; $contents.=$row[customers_dob].","; $contents.=$row[entry_company].","; $contents.=$row[entry_street_address].","; $contents.=$row[entry_postcode].","; $contents.=$row[entry_city].","; //$contents.=$row[entry_state].","; $contents.=$state.","; $contents.=$land.","; $contents.=$row[customers_telephone].","; $contents.=$row[customers_email_address].","; $contents.=$row[customers_fax]."\n"; } Header("Content-Disposition: attachment; filename=export.csv"); print $contents; } require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Hope that anyone can help me fast!:) Thanks in advance... /Malte Denmark
Recommended Posts
Archived
This topic is now archived and is closed to further replies.