<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 
/**
* @version $Id: product.csv_upload.php,v 1.4 2005/01/27 19:34:03 soeren_nb Exp $
* @package mambo-phpShop
* @subpackage HTML
* @copyright (C) 2004-2005 Soeren Eberhardt
*
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* mambo-phpShop is Free Software.
* mambo-phpShop comes with absolute no warranty.
*
* www.mambo-phpshop.net
*/
mm_showMyFileName( __FILE__ );
?>
<table>
    <tr>
        <td colspan="5"><img src="<?php echo IMAGEURL ?>ps_image/csv.gif" alt="CSV Upload" border="0" />
          <span class="sectionname">
            <? echo $PHPSHOP_LANG->_PHPSHOP_PRODUCT_CSV_UPLOAD ?>
          </span><br /><br />
        </td>
    </tr>
    <tr>
      <td valign="top" width="10%">
        <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" name="CSV_FORM" enctype="multipart/form-data">
            <input type="hidden" name="func" value="product_csv" />
            <input type="hidden" name="page" value="product.mycsv" />
            <input type="hidden" name="option" value="com_phpshop" />
            <input type="hidden" name="no_html" value="0" />
            Delimiter:
      </td>
      <td valign="top" width="10%">
            <input type="radio" name="csv_delimiter" checked="checked" value="," />
              <span class="sectionname">,</span><br />
            <input type="radio" name="csv_delimiter" value=";" />
              <span class="sectionname">;</span>
      </td>
      <?php
      if ( (float)substr(phpversion(), 0, 3) >= 4.3) {
        $cols = 5; ?>
        <td valign="top" width="15%">Field Enclosure Char:</td>
        <td valign="top" width="15%">
            <input type="radio" name="csv_enclosurechar" checked="checked" value='"' />
              <span class="sectionname">"</span><br />
            <input type="radio" name="csv_enclosurechar" value="'" />
              <span class="sectionname">'</span><br />
            <input type="radio" name="csv_enclosurechar" value="" />
              none
        </td>
      <?php 
      }
      else
        $cols = 3; ?>
      <td align="left" width="50%">
        <input type="submit" class="button" onclick="javascript: document.CSV_FORM.func.value='export_csv'; document.CSV_FORM.no_html.value='1';" value="Export to CSV" />
      </td>
    </tr>
    <tr>
      <td colspan="<?php echo $cols; ?>">
            <input type="file" name="file" /><br />
            <input type="submit" class="button" name="submit" value="submit" />
        </form>
      </td>
    </tr>
    <tr>
      <td colspan="5">
            <h3>How to use csv upload:</h3><br />
            First you need a csv file with the required product information.<br /><br />
            
            <strong>The following product information can be included:</strong><br />
              product_sku<br />
              product_s_desc<br />
              product_desc<br />
              product_thumb_image<br />
              product_full_image<br />
              product_weight<br />
              product_weight_uom<br />
              product_length<br />
              product_width<br />
              product_height<br />
              product_lwh_uom<br />
              product_in_stock<br />
              product_available_date<br />
              product_special<br />
              product_discount_id<br />
              product_name<br />
              product_price<br />
              category_path<br />
              manufacturer_id<br /><br />
            
            <strong>Minimum required information is</strong><br />
              product_sku<br />
              product_name<br />
              product_price<br />
              category_path<br />
            <br />
            But you must have 19 fields!<br /><br />
            <strong>Example:</strong><br />
            <span class="message">"product_sku1","product_s_desc","product_desc","TN_pic1.jpg","pic1.jpg","","","","","","","7","","N","","product_name1","87.78","category/level1/level2","1"
            <br />
            <br />
            As you can see, you must provide the optional fields even when they are empty!</span>
            <br />
            <strong>category_path</strong> is a slash delimited string which begins<br />
            with a top-level category and follows with sub-categories,<br />
            e.g. <br />
            <strong>category/sub-category_1/sub_category_2</strong><br /><br />
            
            <strong>product_thumb_image</strong> and <strong>product_full_image</strong><br />
            are the names of the respective image files. You will<br />
            need to FTP the image directly to the <i>/shop_image/product</i> folder.<br /><br />
            
            In the table "mos_pshop_csv", each of the above product fields<br />
            is assigned a number which represents it's position<br />
            in the delimited line. You can change these to suit the<br />
            positions in your own lines. If you don't change the table, please<br />
            order your data in the csv file like the field name listed above!<br /><br />
            
        </td>
    </tr>
</table>
