Advertisement
Guest User

vq2-admin_view_template_catalog_product_form.tpl

a guest
Sep 17th, 2012
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 63.55 KB | None | 0 0
  1. <?php echo $header; ?>
  2. <div id="content">
  3.   <div class="breadcrumb">
  4.     <?php foreach ($breadcrumbs as $breadcrumb) { ?>
  5.     <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
  6.     <?php } ?>
  7.   </div>
  8.   <?php if ($error_warning) { ?>
  9.   <div class="warning"><?php echo $error_warning; ?></div>
  10.   <?php } ?>
  11.   <div class="box">
  12.     <div class="heading">
  13.       <h1><img src="view/image/product.png" alt="" /> <?php echo $heading_title; ?></h1>
  14.       <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a onclick="sav_con()" class="button"><span><?php echo $button_save_continue; ?></span></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a></div><script language="javascript">
  15.     function sav_con(){
  16.         $('#form').append('<input type="hidden" id="save_continue" name="save_continue" value="1"  />');
  17.         $('#form').submit();
  18.    }
  19.     </script>
  20.     </div>
  21.     <div class="content">
  22.       <div id="tabs" class="htabs"><a href="#tab-general"><?php echo $tab_general; ?></a><a href="#tab-data"><?php echo $tab_data; ?></a><a href="#tab-links"><?php echo $tab_links; ?></a><a href="#tab-attribute"><?php echo $tab_attribute; ?></a><a href="#tab-option"><?php echo $tab_option; ?></a><a href="#tab-discount"><?php echo $tab_discount; ?></a><a href="#tab-special"><?php echo $tab_special; ?></a><a href="#tab-image"><?php echo $tab_image; ?></a><a href="#tab-reward"><?php echo $tab_reward; ?></a><a href="#tab-design"><?php echo $tab_design; ?></a></div>
  23.       <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
  24.         <div id="tab-general">
  25.           <div id="languages" class="htabs">
  26.             <?php foreach ($languages as $language) { ?>
  27.             <a href="#language<?php echo $language['language_id']; ?>"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a>
  28.             <?php } ?>
  29.           </div>
  30.           <?php foreach ($languages as $language) { ?>
  31.           <div id="language<?php echo $language['language_id']; ?>">
  32.             <table class="form">
  33.               <tr>
  34.                 <td><span class="required">*</span> <?php echo $entry_name; ?></td>
  35.                 <td><input type="text" name="product_description[<?php echo $language['language_id']; ?>][name]" size="100" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['name'] : ''; ?>" />
  36.                   <?php if (isset($error_name[$language['language_id']])) { ?>
  37.                   <span class="error"><?php echo $error_name[$language['language_id']]; ?></span>
  38.                   <?php } ?></td>
  39.  
  40.                     <tr>
  41.                         <td><?php echo $entry_title_tag; ?> <sup><a href="javascript:titlerPop();">?</a></sup></td>
  42.                         <td><input type="text" size="100" name="product_description[<?php echo $language['language_id']; ?>][title_tag]" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['title_tag'] : ''; ?>" /></td>
  43.                     </tr>
  44.                
  45.               </tr>
  46.               <tr>
  47.                 <td><?php echo $entry_meta_description; ?></td>
  48.                 <td><textarea name="product_description[<?php echo $language['language_id']; ?>][meta_description]" cols="40" rows="5"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['meta_description'] : ''; ?></textarea></td>
  49.  
  50.             <tr>
  51.               <td><?php echo $entry_meta_title; ?></td>
  52.               <td><input type="text" name="product_description[<?php echo $language['language_id']; ?>][meta_title]" size="100" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['meta_title'] : ''; ?>"></td>
  53.            
  54.               </tr>
  55.               <tr>
  56.                 <td><?php echo $entry_meta_keyword; ?></td>
  57.                 <td><textarea name="product_description[<?php echo $language['language_id']; ?>][meta_keyword]" cols="40" rows="5"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['meta_keyword'] : ''; ?></textarea></td>
  58.               </tr>
  59.               <tr>
  60.                 <td><?php echo $entry_description; ?></td>
  61.                 <td><textarea name="product_description[<?php echo $language['language_id']; ?>][description]" id="description<?php echo $language['language_id']; ?>"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['description'] : ''; ?></textarea></td>
  62.               </tr>
  63.               <tr>
  64.                 <td><?php echo $entry_tag; ?></td>
  65.                 <td><input type="text" name="product_tag[<?php echo $language['language_id']; ?>]" value="<?php echo isset($product_tag[$language['language_id']]) ? $product_tag[$language['language_id']] : ''; ?>" size="80" /></td>
  66.               </tr>
  67.             </table>
  68.           </div>
  69.           <?php } ?>
  70.         </div>
  71.         <div id="tab-data">
  72.           <table class="form">
  73.             <tr>
  74.               <td><span class="required">*</span> <?php echo $entry_model; ?></td>
  75.               <td><input type="text" name="model" value="<?php echo $model; ?>" />
  76.                 <?php if ($error_model) { ?>
  77.                 <span class="error"><?php echo $error_model; ?></span>
  78.                 <?php } ?></td>
  79.             </tr>
  80.             <tr>
  81.               <td><?php echo $entry_sku; ?></td>
  82.               <td><input type="text" name="sku" value="<?php echo $sku; ?>" /></td>
  83.             </tr>
  84.             <tr>
  85.               <td><?php echo $entry_upc; ?></td>
  86.               <td><input type="text" name="upc" value="<?php echo $upc; ?>" /></td>
  87.             </tr>
  88.             <tr>
  89.               <td><?php echo $entry_location; ?></td>
  90.               <td><input type="text" name="location" value="<?php echo $location; ?>" /></td>
  91.             </tr>
  92.             <tr>
  93.               <td><?php echo $entry_price; ?></td>
  94.               <td><input type="text" name="price" value="<?php echo $price; ?>" /></td>
  95.             </tr>
  96.             <tr>
  97.               <td><?php echo $entry_tax_class; ?></td>
  98.               <td><select name="tax_class_id">
  99.                   <option value="0"><?php echo $text_none; ?></option>
  100.                   <?php foreach ($tax_classes as $tax_class) { ?>
  101.                   <?php if ($tax_class['tax_class_id'] == $tax_class_id) { ?>
  102.                   <option value="<?php echo $tax_class['tax_class_id']; ?>" selected="selected"><?php echo $tax_class['title']; ?></option>
  103.                   <?php } else { ?>
  104.                   <option value="<?php echo $tax_class['tax_class_id']; ?>"><?php echo $tax_class['title']; ?></option>
  105.                   <?php } ?>
  106.                   <?php } ?>
  107.                 </select></td>
  108.             </tr>
  109.             <tr>
  110.               <td><?php echo $entry_quantity; ?></td>
  111.               <td><input type="text" name="quantity" value="<?php echo $quantity; ?>" size="2" /></td>
  112.             </tr>
  113.             <tr>
  114.               <td><?php echo $entry_minimum; ?></td>
  115.               <td><input type="text" name="minimum" value="<?php echo $minimum; ?>" size="2" /></td>
  116.             </tr>
  117.             <tr>
  118.               <td><?php echo $entry_subtract; ?></td>
  119.               <td><select name="subtract">
  120.                   <?php if ($subtract) { ?>
  121.                   <option value="1" selected="selected"><?php echo $text_yes; ?></option>
  122.                   <option value="0"><?php echo $text_no; ?></option>
  123.                   <?php } else { ?>
  124.                   <option value="1"><?php echo $text_yes; ?></option>
  125.                   <option value="0" selected="selected"><?php echo $text_no; ?></option>
  126.                   <?php } ?>
  127.                 </select></td>
  128.             </tr>
  129.             <tr>
  130.               <td><?php echo $entry_stock_status; ?></td>
  131.               <td><select name="stock_status_id">
  132.                   <?php foreach ($stock_statuses as $stock_status) { ?>
  133.                   <?php if ($stock_status['stock_status_id'] == $stock_status_id) { ?>
  134.                   <option value="<?php echo $stock_status['stock_status_id']; ?>" selected="selected"><?php echo $stock_status['name']; ?></option>
  135.                   <?php } else { ?>
  136.                   <option value="<?php echo $stock_status['stock_status_id']; ?>"><?php echo $stock_status['name']; ?></option>
  137.                   <?php } ?>
  138.                   <?php } ?>
  139.                 </select></td>
  140.             </tr>
  141.             <tr>
  142.               <td><?php echo $entry_shipping; ?></td>
  143.               <td><?php if ($shipping) { ?>
  144.                 <input type="radio" name="shipping" value="1" checked="checked" />
  145.                 <?php echo $text_yes; ?>
  146.                 <input type="radio" name="shipping" value="0" />
  147.                 <?php echo $text_no; ?>
  148.                 <?php } else { ?>
  149.                 <input type="radio" name="shipping" value="1" />
  150.                 <?php echo $text_yes; ?>
  151.                 <input type="radio" name="shipping" value="0" checked="checked" />
  152.                 <?php echo $text_no; ?>
  153.                 <?php } ?></td>
  154.             </tr>
  155.             <tr>
  156.               <td><?php echo $entry_keyword; ?></td>
  157.               <td><input type="text" name="keyword" value="<?php echo $keyword; ?>" /></td>
  158.             </tr>
  159.             <tr>
  160.              
  161.             <td><?php echo $entry_image; ?></td>
  162.             <td><img src="<?php echo $thumb; ?>" alt="" id="thumb" class="image" onclick="image_upload('image', 'thumb');" /><br />
  163.             <input size="60" type="text" name="image" value="<?php echo $image; ?>" id="image" /> <span id="image_exists"></span></td>
  164.            
  165.  
  166.  
  167.                   <a onclick="image_upload('image', 'thumb');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb').attr('src', '<?php echo $no_image; ?>'); $('#image').attr('value', '');"><?php echo $text_clear; ?></a></div></td>
  168.             </tr>
  169.             <tr>
  170.               <td><?php echo $entry_date_available; ?></td>
  171.               <td><input type="text" name="date_available" value="<?php echo $date_available; ?>" size="12" class="date" /></td>
  172.             </tr>
  173.             <tr>
  174.               <td><?php echo $entry_dimension; ?></td>
  175.               <td><input type="text" name="length" value="<?php echo $length; ?>" size="4" />
  176.                 <input type="text" name="width" value="<?php echo $width; ?>" size="4" />
  177.                 <input type="text" name="height" value="<?php echo $height; ?>" size="4" /></td>
  178.             </tr>
  179.             <tr>
  180.               <td><?php echo $entry_length; ?></td>
  181.               <td><select name="length_class_id">
  182.                   <?php foreach ($length_classes as $length_class) { ?>
  183.                   <?php if ($length_class['length_class_id'] == $length_class_id) { ?>
  184.                   <option value="<?php echo $length_class['length_class_id']; ?>" selected="selected"><?php echo $length_class['title']; ?></option>
  185.                   <?php } else { ?>
  186.                   <option value="<?php echo $length_class['length_class_id']; ?>"><?php echo $length_class['title']; ?></option>
  187.                   <?php } ?>
  188.                   <?php } ?>
  189.                 </select></td>
  190.             </tr>
  191.             <tr>
  192.               <td><?php echo $entry_weight; ?></td>
  193.               <td><input type="text" name="weight" value="<?php echo $weight; ?>" /></td>
  194.             </tr>
  195.             <tr>
  196.               <td><?php echo $entry_weight_class; ?></td>
  197.               <td><select name="weight_class_id">
  198.                   <?php foreach ($weight_classes as $weight_class) { ?>
  199.                   <?php if ($weight_class['weight_class_id'] == $weight_class_id) { ?>
  200.                   <option value="<?php echo $weight_class['weight_class_id']; ?>" selected="selected"><?php echo $weight_class['title']; ?></option>
  201.                   <?php } else { ?>
  202.                   <option value="<?php echo $weight_class['weight_class_id']; ?>"><?php echo $weight_class['title']; ?></option>
  203.                   <?php } ?>
  204.                   <?php } ?>
  205.                 </select></td>
  206.             </tr>
  207.             <tr>
  208.               <td><?php echo $entry_status; ?></td>
  209.               <td><select name="status">
  210.                   <?php if ($status) { ?>
  211.                   <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
  212.                   <option value="0"><?php echo $text_disabled; ?></option>
  213.                   <?php } else { ?>
  214.                   <option value="1"><?php echo $text_enabled; ?></option>
  215.                   <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
  216.                   <?php } ?>
  217.                 </select></td>
  218.             </tr>
  219.             <tr>
  220.               <td><?php echo $entry_sort_order; ?></td>
  221.               <td><input type="text" name="sort_order" value="<?php echo $sort_order; ?>" size="2" /></td>
  222.             </tr>
  223.           </table>
  224.         </div>
  225.         <div id="tab-links">
  226.           <table class="form">
  227.             <tr>
  228.               <td><?php echo $entry_manufacturer; ?></td>
  229.               <td><select name="manufacturer_id">
  230.                   <option value="0" selected="selected"><?php echo $text_none; ?></option>
  231.                   <?php foreach ($manufacturers as $manufacturer) { ?>
  232.                   <?php if ($manufacturer['manufacturer_id'] == $manufacturer_id) { ?>
  233.                   <option value="<?php echo $manufacturer['manufacturer_id']; ?>" selected="selected"><?php echo $manufacturer['name']; ?></option>
  234.                   <?php } else { ?>
  235.                   <option value="<?php echo $manufacturer['manufacturer_id']; ?>"><?php echo $manufacturer['name']; ?></option>
  236.                   <?php } ?>
  237.                   <?php } ?>
  238.                 </select></td>
  239.             </tr>
  240.             <tr>
  241.               <td><?php echo $entry_category; ?></td>
  242.               <td><div class="scrollbox">
  243.                   <?php $class = 'odd'; ?>
  244.                   <?php foreach ($categories as $category) { ?>
  245.                   <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
  246.                   <div class="<?php echo $class; ?>">
  247.                     <?php if (in_array($category['category_id'], $product_category)) { ?>
  248.                     <input type="checkbox" name="product_category[]" value="<?php echo $category['category_id']; ?>" checked="checked" />
  249.                     <?php echo $category['name']; ?>
  250.                     <?php } else { ?>
  251.                     <input type="checkbox" name="product_category[]" value="<?php echo $category['category_id']; ?>" />
  252.                     <?php echo $category['name']; ?>
  253.                     <?php } ?>
  254.                   </div>
  255.                   <?php } ?>
  256.                 </div>
  257.                 <a onclick="$(this).parent().find(':checkbox').attr('checked', true);"><?php echo $text_select_all; ?></a> / <a onclick="$(this).parent().find(':checkbox').attr('checked', false);"><?php echo $text_unselect_all; ?></a></td>
  258.             </tr>
  259.             <tr>
  260.               <td><?php echo $entry_store; ?></td>
  261.               <td><div class="scrollbox">
  262.                   <?php $class = 'even'; ?>
  263.                   <div class="<?php echo $class; ?>">
  264.                     <?php if (in_array(0, $product_store)) { ?>
  265.                     <input type="checkbox" name="product_store[]" value="0" checked="checked" />
  266.                     <?php echo $text_default; ?>
  267.                     <?php } else { ?>
  268.                     <input type="checkbox" name="product_store[]" value="0" />
  269.                     <?php echo $text_default; ?>
  270.                     <?php } ?>
  271.                   </div>
  272.                   <?php foreach ($stores as $store) { ?>
  273.                   <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
  274.                   <div class="<?php echo $class; ?>">
  275.                     <?php if (in_array($store['store_id'], $product_store)) { ?>
  276.                     <input type="checkbox" name="product_store[]" value="<?php echo $store['store_id']; ?>" checked="checked" />
  277.                     <?php echo $store['name']; ?>
  278.                     <?php } else { ?>
  279.                     <input type="checkbox" name="product_store[]" value="<?php echo $store['store_id']; ?>" />
  280.                     <?php echo $store['name']; ?>
  281.                     <?php } ?>
  282.                   </div>
  283.                   <?php } ?>
  284.                 </div></td>
  285.             </tr>
  286.             <tr>
  287.               <td><?php echo $entry_download; ?></td>
  288.               <td><div class="scrollbox">
  289.                   <?php $class = 'odd'; ?>
  290.                   <?php foreach ($downloads as $download) { ?>
  291.                   <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
  292.                   <div class="<?php echo $class; ?>">
  293.                     <?php if (in_array($download['download_id'], $product_download)) { ?>
  294.                     <input type="checkbox" name="product_download[]" value="<?php echo $download['download_id']; ?>" checked="checked" />
  295.                     <?php echo $download['name']; ?>
  296.                     <?php } else { ?>
  297.                     <input type="checkbox" name="product_download[]" value="<?php echo $download['download_id']; ?>" />
  298.                     <?php echo $download['name']; ?>
  299.                     <?php } ?>
  300.                   </div>
  301.                   <?php } ?>
  302.                 </div></td>
  303.             </tr>
  304.             <tr>
  305.               <td><?php echo $entry_related; ?></td>
  306.               <td><input type="text" name="related" value="" /></td>
  307.             </tr>
  308.             <tr>
  309.               <td>&nbsp;</td>
  310.               <td><div id="product-related" class="scrollbox">
  311.                   <?php $class = 'odd'; ?>
  312.                   <?php foreach ($product_related as $product_related) { ?>
  313.                   <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
  314.                   <div id="product-related<?php echo $product_related['product_id']; ?>" class="<?php echo $class; ?>"> <?php echo $product_related['name']; ?><img src="view/image/delete.png" />
  315.                     <input type="hidden" name="product_related[]" value="<?php echo $product_related['product_id']; ?>" />
  316.                   </div>
  317.                   <?php } ?>
  318.                 </div></td>
  319.             </tr>
  320.           </table>
  321.         </div>
  322.         <div id="tab-attribute">
  323.           <table id="attribute" class="list">
  324.             <thead>
  325.               <tr>
  326.                 <td class="left"><?php echo $entry_attribute; ?></td>
  327.                 <td class="left"><?php echo $entry_text; ?></td>
  328.                 <td></td>
  329.               </tr>
  330.             </thead>
  331.             <?php $attribute_row = 0; ?>
  332.             <?php foreach ($product_attributes as $product_attribute) { ?>
  333.             <tbody id="attribute-row<?php echo $attribute_row; ?>">
  334.               <tr>
  335.                 <td class="left"><input type="text" name="product_attribute[<?php echo $attribute_row; ?>][name]" value="<?php echo $product_attribute['name']; ?>" />
  336.                   <input type="hidden" name="product_attribute[<?php echo $attribute_row; ?>][attribute_id]" value="<?php echo $product_attribute['attribute_id']; ?>" /></td>
  337.                 <td class="left"><?php foreach ($languages as $language) { ?>
  338.                   <textarea name="product_attribute[<?php echo $attribute_row; ?>][product_attribute_description][<?php echo $language['language_id']; ?>][text]" cols="40" rows="5"><?php echo isset($product_attribute['product_attribute_description'][$language['language_id']]) ? $product_attribute['product_attribute_description'][$language['language_id']]['text'] : ''; ?></textarea>
  339.                   <img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" align="top" /><br />
  340.                   <?php } ?></td>
  341.                 <td class="left"><a onclick="$('#attribute-row<?php echo $attribute_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
  342.               </tr>
  343.             </tbody>
  344.             <?php $attribute_row++; ?>
  345.             <?php } ?>
  346.             <tfoot>
  347.               <tr>
  348.                 <td colspan="2"></td>
  349.                 <td class="left"><a onclick="addAttribute();" class="button"><?php echo $button_add_attribute; ?></a></td>
  350.               </tr>
  351.             </tfoot>
  352.           </table>
  353.         </div>
  354.         <div id="tab-option">
  355.           <div id="vtab-option" class="vtabs">
  356.             <?php $option_row = 0; ?>
  357.             <?php foreach ($product_options as $product_option) { ?>
  358.             <a href="#tab-option-<?php echo $option_row; ?>" id="option-<?php echo $option_row; ?>"><?php echo $product_option['name']; ?>&nbsp;<img src="view/image/delete.png" alt="" onclick="$('#vtabs a:first').trigger('click'); $('#option-<?php echo $option_row; ?>').remove(); $('#tab-option-<?php echo $option_row; ?>').remove(); return false;" /></a>
  359.             <?php $option_row++; ?>
  360.             <?php } ?>
  361.             <span id="option-add">
  362.             <input name="option" value="" style="width: 130px;" />
  363.             &nbsp;<img src="view/image/add.png" alt="<?php echo $button_add_option; ?>" title="<?php echo $button_add_option; ?>" /></span></div>
  364.           <?php $option_row = 0; ?>
  365.           <?php $option_value_row = 0; ?>
  366.           <?php foreach ($product_options as $product_option) { ?>
  367.           <div id="tab-option-<?php echo $option_row; ?>" class="vtabs-content">
  368.             <input type="hidden" name="product_option[<?php echo $option_row; ?>][product_option_id]" value="<?php echo $product_option['product_option_id']; ?>" />
  369.             <input type="hidden" name="product_option[<?php echo $option_row; ?>][name]" value="<?php echo $product_option['name']; ?>" />
  370.             <input type="hidden" name="product_option[<?php echo $option_row; ?>][option_id]" value="<?php echo $product_option['option_id']; ?>" />
  371.             <input type="hidden" name="product_option[<?php echo $option_row; ?>][type]" value="<?php echo $product_option['type']; ?>" />
  372.             <table class="form">
  373.               <tr>
  374.                 <td><?php echo $entry_required; ?></td>
  375.                 <td><select name="product_option[<?php echo $option_row; ?>][required]">
  376.                     <?php if ($product_option['required']) { ?>
  377.                     <option value="1" selected="selected"><?php echo $text_yes; ?></option>
  378.                     <option value="0"><?php echo $text_no; ?></option>
  379.                     <?php } else { ?>
  380.                     <option value="1"><?php echo $text_yes; ?></option>
  381.                     <option value="0" selected="selected"><?php echo $text_no; ?></option>
  382.                     <?php } ?>
  383.                   </select></td>
  384.               </tr>
  385.               <?php if ($product_option['type'] == 'text') { ?>
  386.               <tr>
  387.                 <td><?php echo $entry_option_value; ?></td>
  388.                 <td><input type="text" name="product_option[<?php echo $option_row; ?>][option_value]" value="<?php echo $product_option['option_value']; ?>" /></td>
  389.               </tr>
  390.               <?php } ?>
  391.               <?php if ($product_option['type'] == 'textarea') { ?>
  392.               <tr>
  393.                 <td><?php echo $entry_option_value; ?></td>
  394.                 <td><textarea name="product_option[<?php echo $option_row; ?>][option_value]" cols="40" rows="5"><?php echo $product_option['option_value']; ?></textarea></td>
  395.               </tr>
  396.               <?php } ?>
  397.               <?php if ($product_option['type'] == 'file') { ?>
  398.               <tr style="display: none;">
  399.                 <td><?php echo $entry_option_value; ?></td>
  400.                 <td><input type="text" name="product_option[<?php echo $option_row; ?>][option_value]" value="<?php echo $product_option['option_value']; ?>" /></td>
  401.               </tr>
  402.               <?php } ?>
  403.               <?php if ($product_option['type'] == 'date') { ?>
  404.               <tr>
  405.                 <td><?php echo $entry_option_value; ?></td>
  406.                 <td><input type="text" name="product_option[<?php echo $option_row; ?>][option_value]" value="<?php echo $product_option['option_value']; ?>" class="date" /></td>
  407.               </tr>
  408.               <?php } ?>
  409.               <?php if ($product_option['type'] == 'datetime') { ?>
  410.               <tr>
  411.                 <td><?php echo $entry_option_value; ?></td>
  412.                 <td><input type="text" name="product_option[<?php echo $option_row; ?>][option_value]" value="<?php echo $product_option['option_value']; ?>" class="datetime" /></td>
  413.               </tr>
  414.               <?php } ?>
  415.               <?php if ($product_option['type'] == 'time') { ?>
  416.               <tr>
  417.                 <td><?php echo $entry_option_value; ?></td>
  418.                 <td><input type="text" name="product_option[<?php echo $option_row; ?>][option_value]" value="<?php echo $product_option['option_value']; ?>" class="time" /></td>
  419.               </tr>
  420.               <?php } ?>
  421.             </table>
  422.             <?php if ($product_option['type'] == 'select' || $product_option['type'] == 'radio' || $product_option['type'] == 'checkbox' || $product_option['type'] == 'image') { ?>
  423.             <table id="option-value<?php echo $option_row; ?>" class="list">
  424.               <thead>
  425.                 <tr>
  426.                   <td class="left"><?php echo $entry_option_value; ?></td>
  427.                   <td class="right"><?php echo $entry_quantity; ?></td>
  428.                   <td class="left"><?php echo $entry_subtract; ?></td>
  429.                   <td class="right"><?php echo $entry_price; ?></td>
  430.                   <td class="right"><?php echo $entry_option_points; ?></td>
  431.                   <td class="right"><?php echo $entry_weight; ?></td>
  432.                   <td></td>
  433.                 </tr>
  434.               </thead>
  435.               <?php foreach ($product_option['product_option_value'] as $product_option_value) { ?>
  436.               <tbody id="option-value-row<?php echo $option_value_row; ?>">
  437.                 <tr>
  438.                   <td class="left"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][option_value_id]">
  439.                       <?php if (isset($option_values[$product_option['option_id']])) { ?>
  440.                       <?php foreach ($option_values[$product_option['option_id']] as $option_value) { ?>
  441.                       <?php if ($option_value['option_value_id'] == $product_option_value['option_value_id']) { ?>
  442.                       <option value="<?php echo $option_value['option_value_id']; ?>" selected="selected"><?php echo $option_value['name']; ?></option>
  443.                       <?php } else { ?>
  444.                       <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?></option>
  445.                       <?php } ?>
  446.                       <?php } ?>
  447.                       <?php } ?>
  448.                     </select>
  449.                     <input type="hidden" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][product_option_value_id]" value="<?php echo $product_option_value['product_option_value_id']; ?>" /></td>
  450.                   <td class="right"><input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][quantity]" value="<?php echo $product_option_value['quantity']; ?>" size="3" /></td>
  451.                   <td class="left"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][subtract]">
  452.                       <?php if ($product_option_value['subtract']) { ?>
  453.                       <option value="1" selected="selected"><?php echo $text_yes; ?></option>
  454.                       <option value="0"><?php echo $text_no; ?></option>
  455.                       <?php } else { ?>
  456.                       <option value="1"><?php echo $text_yes; ?></option>
  457.                       <option value="0" selected="selected"><?php echo $text_no; ?></option>
  458.                       <?php } ?>
  459.                     </select></td>
  460.                   <td class="right"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][price_prefix]">
  461.                       <?php if ($product_option_value['price_prefix'] == '+') { ?>
  462.                       <option value="+" selected="selected">+</option>
  463.                       <?php } else { ?>
  464.                       <option value="+">+</option>
  465.                       <?php } ?>
  466.                       <?php if ($product_option_value['price_prefix'] == '-') { ?>
  467.                       <option value="-" selected="selected">-</option>
  468.                       <?php } else { ?>
  469.                       <option value="-">-</option>
  470.                       <?php } ?>
  471.                     </select>
  472.                     <input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][price]" value="<?php echo $product_option_value['price']; ?>" size="5" /></td>
  473.                   <td class="right"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][points_prefix]">
  474.                       <?php if ($product_option_value['points_prefix'] == '+') { ?>
  475.                       <option value="+" selected="selected">+</option>
  476.                       <?php } else { ?>
  477.                       <option value="+">+</option>
  478.                       <?php } ?>
  479.                       <?php if ($product_option_value['points_prefix'] == '-') { ?>
  480.                       <option value="-" selected="selected">-</option>
  481.                       <?php } else { ?>
  482.                       <option value="-">-</option>
  483.                       <?php } ?>
  484.                     </select>
  485.                     <input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][points]" value="<?php echo $product_option_value['points']; ?>" size="5" /></td>
  486.                   <td class="right"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][weight_prefix]">
  487.                       <?php if ($product_option_value['weight_prefix'] == '+') { ?>
  488.                       <option value="+" selected="selected">+</option>
  489.                       <?php } else { ?>
  490.                       <option value="+">+</option>
  491.                       <?php } ?>
  492.                       <?php if ($product_option_value['weight_prefix'] == '-') { ?>
  493.                       <option value="-" selected="selected">-</option>
  494.                       <?php } else { ?>
  495.                       <option value="-">-</option>
  496.                       <?php } ?>
  497.                     </select>
  498.                     <input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][weight]" value="<?php echo $product_option_value['weight']; ?>" size="5" /></td>
  499.                   <td class="left"><a onclick="$('#option-value-row<?php echo $option_value_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
  500.                 </tr>
  501.               </tbody>
  502.               <?php $option_value_row++; ?>
  503.               <?php } ?>
  504.               <tfoot>
  505.                 <tr>
  506.                   <td colspan="6"></td>
  507.                   <td class="left"><a onclick="addOptionValue('<?php echo $option_row; ?>');" class="button"><?php echo $button_add_option_value; ?></a></td>
  508.                 </tr>
  509.               </tfoot>
  510.             </table>
  511.             <select id="option-values<?php echo $option_row; ?>" style="display: none;">
  512.               <?php if (isset($option_values[$product_option['option_id']])) { ?>
  513.               <?php foreach ($option_values[$product_option['option_id']] as $option_value) { ?>
  514.               <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?></option>
  515.               <?php } ?>
  516.               <?php } ?>
  517.             </select>
  518.             <?php } ?>
  519.           </div>
  520.           <?php $option_row++; ?>
  521.           <?php } ?>
  522.         </div>
  523.         <div id="tab-discount">
  524.           <table id="discount" class="list">
  525.             <thead>
  526.               <tr>
  527.                 <td class="left"><?php echo $entry_customer_group; ?></td>
  528.                 <td class="right"><?php echo $entry_quantity; ?></td>
  529.                 <td class="right"><?php echo $entry_priority; ?></td>
  530.                 <td class="right"><?php echo $entry_price; ?></td>
  531.                 <td class="left"><?php echo $entry_date_start; ?></td>
  532.                 <td class="left"><?php echo $entry_date_end; ?></td>
  533.                 <td></td>
  534.               </tr>
  535.             </thead>
  536.             <?php $discount_row = 0; ?>
  537.             <?php foreach ($product_discounts as $product_discount) { ?>
  538.             <tbody id="discount-row<?php echo $discount_row; ?>">
  539.               <tr>
  540.                 <td class="left"><select name="product_discount[<?php echo $discount_row; ?>][customer_group_id]">
  541.                     <?php foreach ($customer_groups as $customer_group) { ?>
  542.                     <?php if ($customer_group['customer_group_id'] == $product_discount['customer_group_id']) { ?>
  543.                     <option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
  544.                     <?php } else { ?>
  545.                     <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
  546.                     <?php } ?>
  547.                     <?php } ?>
  548.                   </select></td>
  549.                 <td class="right"><input type="text" name="product_discount[<?php echo $discount_row; ?>][quantity]" value="<?php echo $product_discount['quantity']; ?>" size="2" /></td>
  550.                 <td class="right"><input type="text" name="product_discount[<?php echo $discount_row; ?>][priority]" value="<?php echo $product_discount['priority']; ?>" size="2" /></td>
  551.                 <td class="right"><input type="text" name="product_discount[<?php echo $discount_row; ?>][price]" value="<?php echo $product_discount['price']; ?>" /></td>
  552.                 <td class="left"><input type="text" name="product_discount[<?php echo $discount_row; ?>][date_start]" value="<?php echo $product_discount['date_start']; ?>" class="date" /></td>
  553.                 <td class="left"><input type="text" name="product_discount[<?php echo $discount_row; ?>][date_end]" value="<?php echo $product_discount['date_end']; ?>" class="date" /></td>
  554.                 <td class="left"><a onclick="$('#discount-row<?php echo $discount_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
  555.               </tr>
  556.             </tbody>
  557.             <?php $discount_row++; ?>
  558.             <?php } ?>
  559.             <tfoot>
  560.               <tr>
  561.                 <td colspan="6"></td>
  562.                 <td class="left"><a onclick="addDiscount();" class="button"><?php echo $button_add_discount; ?></a></td>
  563.               </tr>
  564.             </tfoot>
  565.           </table>
  566.         </div>
  567.         <div id="tab-special">
  568.           <table id="special" class="list">
  569.             <thead>
  570.               <tr>
  571.                 <td class="left"><?php echo $entry_customer_group; ?></td>
  572.                 <td class="right"><?php echo $entry_priority; ?></td>
  573.                 <td class="right"><?php echo $entry_price; ?></td>
  574.                 <td class="left"><?php echo $entry_date_start; ?></td>
  575.                 <td class="left"><?php echo $entry_date_end; ?></td>
  576.                 <td></td>
  577.               </tr>
  578.             </thead>
  579.             <?php $special_row = 0; ?>
  580.             <?php foreach ($product_specials as $product_special) { ?>
  581.             <tbody id="special-row<?php echo $special_row; ?>">
  582.               <tr>
  583.                 <td class="left"><select name="product_special[<?php echo $special_row; ?>][customer_group_id]">
  584.                     <?php foreach ($customer_groups as $customer_group) { ?>
  585.                     <?php if ($customer_group['customer_group_id'] == $product_special['customer_group_id']) { ?>
  586.                     <option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
  587.                     <?php } else { ?>
  588.                     <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
  589.                     <?php } ?>
  590.                     <?php } ?>
  591.                   </select></td>
  592.                 <td class="right"><input type="text" name="product_special[<?php echo $special_row; ?>][priority]" value="<?php echo $product_special['priority']; ?>" size="2" /></td>
  593.                 <td class="right"><input type="text" name="product_special[<?php echo $special_row; ?>][price]" value="<?php echo $product_special['price']; ?>" /></td>
  594.                 <td class="left"><input type="text" name="product_special[<?php echo $special_row; ?>][date_start]" value="<?php echo $product_special['date_start']; ?>" class="date" /></td>
  595.                 <td class="left"><input type="text" name="product_special[<?php echo $special_row; ?>][date_end]" value="<?php echo $product_special['date_end']; ?>" class="date" /></td>
  596.                 <td class="left"><a onclick="$('#special-row<?php echo $special_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
  597.               </tr>
  598.             </tbody>
  599.             <?php $special_row++; ?>
  600.             <?php } ?>
  601.             <tfoot>
  602.               <tr>
  603.                 <td colspan="5"></td>
  604.                 <td class="left"><a onclick="addSpecial();" class="button"><?php echo $button_add_special; ?></a></td>
  605.               </tr>
  606.             </tfoot>
  607.           </table>
  608.         </div>
  609.         <div id="tab-image">
  610.           <table id="images" class="list">
  611.             <thead>
  612.               <tr>
  613.                 <td class="left"><?php echo $entry_image; ?></td>
  614.                 <td class="right"><?php echo $entry_sort_order; ?></td>
  615.                 <td></td>
  616.               </tr>
  617.             </thead>
  618.             <?php $image_row = 0; ?>
  619.             <?php foreach ($product_images as $product_image) { ?>
  620.            
  621.             <tbody id="image-row<?php echo $image_row; ?>">
  622.             <tr>
  623.              <td class="left"><img src="<?php echo $product_image['thumb']; ?>" alt="" id="thumb<?php echo $image_row; ?>" class="image" onclick="image_upload('image<?php echo $image_row; ?>', 'thumb<?php echo $image_row; ?>');" /><br />
  624.              <input size="60" type="text" name="product_image[<?php echo $image_row; ?>]" value="<?php echo $product_image['image']; ?>" id="image<?php echo $image_row; ?>"  /> <span id="image_exists<?php echo $image_row; ?>"></span></td>
  625.              <td class="left"><a onclick="$('#image-row<?php echo $image_row; ?>').remove();" class="button"><span><?php echo $button_remove; ?></span></a></td>   
  626.            
  627.  
  628.  
  629.  
  630.  
  631.                     <a onclick="image_upload('image<?php echo $image_row; ?>', 'thumb<?php echo $image_row; ?>');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb<?php echo $image_row; ?>').attr('src', '<?php echo $no_image; ?>'); $('#image<?php echo $image_row; ?>').attr('value', '');"><?php echo $text_clear; ?></a></div></td>
  632.                 <td class="right"><input type="text" name="product_image[<?php echo $image_row; ?>][sort_order]" value="<?php echo $product_image['sort_order']; ?>" size="2" /></td>
  633.                 <td class="left"><a onclick="$('#image-row<?php echo $image_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
  634.               </tr>
  635.             </tbody>
  636.             <?php $image_row++; ?>
  637.             <?php } ?>
  638.             <tfoot>
  639.               <tr>
  640.                 <td colspan="2"></td>
  641.                 <td class="left"><a onclick="addImage();" class="button"><?php echo $button_add_image; ?></a></td>
  642.               </tr>
  643.             </tfoot>
  644.           </table>
  645.         </div>
  646.         <div id="tab-reward">
  647.           <table class="form">
  648.             <tr>
  649.               <td><?php echo $entry_points; ?></td>
  650.               <td><input type="text" name="points" value="<?php echo $points; ?>" /></td>
  651.             </tr>
  652.           </table>
  653.           <table class="list">
  654.             <thead>
  655.               <tr>
  656.                 <td class="left"><?php echo $entry_customer_group; ?></td>
  657.                 <td class="right"><?php echo $entry_reward; ?></td>
  658.               </tr>
  659.             </thead>
  660.             <?php foreach ($customer_groups as $customer_group) { ?>
  661.             <tbody>
  662.               <tr>
  663.                 <td class="left"><?php echo $customer_group['name']; ?></td>
  664.                 <td class="right"><input type="text" name="product_reward[<?php echo $customer_group['customer_group_id']; ?>][points]" value="<?php echo isset($product_reward[$customer_group['customer_group_id']]) ? $product_reward[$customer_group['customer_group_id']]['points'] : ''; ?>" /></td>
  665.               </tr>
  666.             </tbody>
  667.             <?php } ?>
  668.           </table>
  669.         </div>
  670.         <div id="tab-design">
  671.           <table class="list">
  672.             <thead>
  673.               <tr>
  674.                 <td class="left"><?php echo $entry_store; ?></td>
  675.                 <td class="left"><?php echo $entry_layout; ?></td>
  676.               </tr>
  677.             </thead>
  678.             <tbody>
  679.               <tr>
  680.                 <td class="left"><?php echo $text_default; ?></td>
  681.                 <td class="left"><select name="product_layout[0][layout_id]">
  682.                     <option value=""></option>
  683.                     <?php foreach ($layouts as $layout) { ?>
  684.                     <?php if (isset($product_layout[0]) && $product_layout[0] == $layout['layout_id']) { ?>
  685.                     <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
  686.                     <?php } else { ?>
  687.                     <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
  688.                     <?php } ?>
  689.                     <?php } ?>
  690.                   </select></td>
  691.               </tr>
  692.             </tbody>
  693.             <?php foreach ($stores as $store) { ?>
  694.             <tbody>
  695.               <tr>
  696.                 <td class="left"><?php echo $store['name']; ?></td>
  697.                 <td class="left"><select name="product_layout[<?php echo $store['store_id']; ?>][layout_id]">
  698.                     <option value=""></option>
  699.                     <?php foreach ($layouts as $layout) { ?>
  700.                     <?php if (isset($product_layout[$store['store_id']]) && $product_layout[$store['store_id']] == $layout['layout_id']) { ?>
  701.                     <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
  702.                     <?php } else { ?>
  703.                     <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
  704.                     <?php } ?>
  705.                     <?php } ?>
  706.                   </select></td>
  707.               </tr>
  708.             </tbody>
  709.             <?php } ?>
  710.           </table>
  711.         </div>
  712.       </form>
  713.     </div>
  714.   </div>
  715. </div>
  716. <script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script>
  717. <script type="text/javascript"><!--
  718. <?php foreach ($languages as $language) { ?>
  719. CKEDITOR.replace('description<?php echo $language['language_id']; ?>', {
  720.     filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
  721.     filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
  722.     filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
  723.     filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
  724.     filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
  725.     filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'
  726. });
  727. <?php } ?>
  728. //--></script>
  729. <script type="text/javascript"><!--
  730. $('input[name=\'related\']').autocomplete({
  731.     delay: 0,
  732.     source: function(request, response) {
  733.         $.ajax({
  734.             url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
  735.             dataType: 'json',
  736.             success: function(json) {      
  737.                 response($.map(json, function(item) {
  738.                     return {
  739.                         label: item.name,
  740.                         value: item.product_id
  741.                     }
  742.                 }));
  743.             }
  744.         });
  745.        
  746.     },
  747.     select: function(event, ui) {
  748.         $('#product-related' + ui.item.value).remove();
  749.        
  750.         $('#product-related').append('<div id="product-related' + ui.item.value + '">' + ui.item.label + '<img src="view/image/delete.png" /><input type="hidden" name="product_related[]" value="' + ui.item.value + '" /></div>');
  751.  
  752.         $('#product-related div:odd').attr('class', 'odd');
  753.         $('#product-related div:even').attr('class', 'even');
  754.                
  755.         return false;
  756.     },
  757.     focus: function(event, ui) {
  758.      return false;
  759.   }
  760. });
  761.  
  762. $('#product-related div img').live('click', function() {
  763.     $(this).parent().remove();
  764.    
  765.     $('#product-related div:odd').attr('class', 'odd');
  766.     $('#product-related div:even').attr('class', 'even');  
  767. });
  768. //--></script>
  769. <script type="text/javascript"><!--
  770. var attribute_row = <?php echo $attribute_row; ?>;
  771.  
  772. function addAttribute() {
  773.     html  = '<tbody id="attribute-row' + attribute_row + '">';
  774.    html += '  <tr>';
  775.     html += '    <td class="left"><input type="text" name="product_attribute[' + attribute_row + '][name]" value="" /><input type="hidden" name="product_attribute[' + attribute_row + '][attribute_id]" value="" /></td>';
  776.     html += '    <td class="left">';
  777.     <?php foreach ($languages as $language) { ?>
  778.     html += '<textarea name="product_attribute[' + attribute_row + '][product_attribute_description][<?php echo $language['language_id']; ?>][text]" cols="40" rows="5"></textarea><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" align="top" /><br />';
  779.    <?php } ?>
  780.     html += '    </td>';
  781.     html += '    <td class="left"><a onclick="$(\'#attribute-row' + attribute_row + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
  782.     html += '  </tr>'; 
  783.    html += '</tbody>';
  784.    
  785.     $('#attribute tfoot').before(html);
  786.    
  787.     attributeautocomplete(attribute_row);
  788.    
  789.     attribute_row++;
  790. }
  791.  
  792. $.widget('custom.catcomplete', $.ui.autocomplete, {
  793.     _renderMenu: function(ul, items) {
  794.         var self = this, currentCategory = '';
  795.        
  796.         $.each(items, function(index, item) {
  797.             if (item.category != currentCategory) {
  798.                 ul.append('<li class="ui-autocomplete-category">' + item.category + '</li>');
  799.                
  800.                 currentCategory = item.category;
  801.             }
  802.            
  803.             self._renderItem(ul, item);
  804.         });
  805.     }
  806. });
  807.  
  808. function attributeautocomplete(attribute_row) {
  809.     $('input[name=\'product_attribute[' + attribute_row + '][name]\']').catcomplete({
  810.         delay: 0,
  811.         source: function(request, response) {
  812.             $.ajax({
  813.                 url: 'index.php?route=catalog/attribute/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
  814.                 dataType: 'json',
  815.                 success: function(json) {  
  816.                     response($.map(json, function(item) {
  817.                         return {
  818.                             category: item.attribute_group,
  819.                             label: item.name,
  820.                             value: item.attribute_id
  821.                         }
  822.                     }));
  823.                 }
  824.             });
  825.         },
  826.         select: function(event, ui) {
  827.             $('input[name=\'product_attribute[' + attribute_row + '][name]\']').attr('value', ui.item.label);
  828.             $('input[name=\'product_attribute[' + attribute_row + '][attribute_id]\']').attr('value', ui.item.value);
  829.            
  830.             return false;
  831.         },
  832.         focus: function(event, ui) {
  833.             return false;
  834.         }
  835.     });
  836. }
  837.  
  838. $('#attribute tbody').each(function(index, element) {
  839.     attributeautocomplete(index);
  840. });
  841. //--></script>
  842. <script type="text/javascript"><!--
  843. var option_row = <?php echo $option_row; ?>;
  844.  
  845. $('input[name=\'option\']').catcomplete({
  846.     delay: 0,
  847.     source: function(request, response) {
  848.         $.ajax({
  849.             url: 'index.php?route=catalog/option/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
  850.             dataType: 'json',
  851.             success: function(json) {
  852.                 response($.map(json, function(item) {
  853.                     return {
  854.                         category: item.category,
  855.                         label: item.name,
  856.                         value: item.option_id,
  857.                         type: item.type,
  858.                         option_value: item.option_value
  859.                     }
  860.                 }));
  861.             }
  862.         });
  863.     },
  864.     select: function(event, ui) {
  865.         html  = '<div id="tab-option-' + option_row + '" class="vtabs-content">';
  866.         html += '   <input type="hidden" name="product_option[' + option_row + '][product_option_id]" value="" />';
  867.         html += '   <input type="hidden" name="product_option[' + option_row + '][name]" value="' + ui.item.label + '" />';
  868.         html += '   <input type="hidden" name="product_option[' + option_row + '][option_id]" value="' + ui.item.value + '" />';
  869.         html += '   <input type="hidden" name="product_option[' + option_row + '][type]" value="' + ui.item.type + '" />';
  870.         html += '   <table class="form">';
  871.         html += '     <tr>';
  872.         html += '       <td><?php echo $entry_required; ?></td>';
  873.         html += '       <td><select name="product_option[' + option_row + '][required]">';
  874.         html += '         <option value="1"><?php echo $text_yes; ?></option>';
  875.         html += '         <option value="0"><?php echo $text_no; ?></option>';
  876.         html += '       </select></td>';
  877.         html += '     </tr>';
  878.        
  879.         if (ui.item.type == 'text') {
  880.             html += '     <tr>';
  881.             html += '       <td><?php echo $entry_option_value; ?></td>';
  882.             html += '       <td><input type="text" name="product_option[' + option_row + '][option_value]" value="" /></td>';
  883.             html += '     </tr>';
  884.         }
  885.        
  886.         if (ui.item.type == 'textarea') {
  887.             html += '     <tr>';
  888.             html += '       <td><?php echo $entry_option_value; ?></td>';
  889.             html += '       <td><textarea name="product_option[' + option_row + '][option_value]" cols="40" rows="5"></textarea></td>';
  890.             html += '     </tr>';                      
  891.         }
  892.          
  893.         if (ui.item.type == 'file') {
  894.             html += '     <tr style="display: none;">';
  895.             html += '       <td><?php echo $entry_option_value; ?></td>';
  896.             html += '       <td><input type="text" name="product_option[' + option_row + '][option_value]" value="" /></td>';
  897.             html += '     </tr>';          
  898.         }
  899.                        
  900.         if (ui.item.type == 'date') {
  901.             html += '     <tr>';
  902.             html += '       <td><?php echo $entry_option_value; ?></td>';
  903.             html += '       <td><input type="text" name="product_option[' + option_row + '][option_value]" value="" class="date" /></td>';
  904.             html += '     </tr>';          
  905.         }
  906.        
  907.         if (ui.item.type == 'datetime') {
  908.             html += '     <tr>';
  909.             html += '       <td><?php echo $entry_option_value; ?></td>';
  910.             html += '       <td><input type="text" name="product_option[' + option_row + '][option_value]" value="" class="datetime" /></td>';
  911.             html += '     </tr>';          
  912.         }
  913.        
  914.         if (ui.item.type == 'time') {
  915.             html += '     <tr>';
  916.             html += '       <td><?php echo $entry_option_value; ?></td>';
  917.             html += '       <td><input type="text" name="product_option[' + option_row + '][option_value]" value="" class="time" /></td>';
  918.             html += '     </tr>';          
  919.         }
  920.        
  921.         html += '  </table>';
  922.            
  923.         if (ui.item.type == 'select' || ui.item.type == 'radio' || ui.item.type == 'checkbox' || ui.item.type == 'image') {
  924.             html += '  <table id="option-value' + option_row + '" class="list">';
  925.             html += '    <thead>';
  926.             html += '      <tr>';
  927.             html += '        <td class="left"><?php echo $entry_option_value; ?></td>';
  928.             html += '        <td class="right"><?php echo $entry_quantity; ?></td>';
  929.             html += '        <td class="left"><?php echo $entry_subtract; ?></td>';
  930.             html += '        <td class="right"><?php echo $entry_price; ?></td>';
  931.             html += '        <td class="right"><?php echo $entry_option_points; ?></td>';
  932.             html += '        <td class="right"><?php echo $entry_weight; ?></td>';
  933.             html += '        <td></td>';
  934.             html += '      </tr>';
  935.             html += '    </thead>';
  936.             html += '    <tfoot>';
  937.             html += '      <tr>';
  938.             html += '        <td colspan="6"></td>';
  939.             html += '        <td class="left"><a onclick="addOptionValue(' + option_row + ');" class="button"><?php echo $button_add_option_value; ?></a></td>';
  940.             html += '      </tr>';
  941.             html += '    </tfoot>';
  942.             html += '  </table>';
  943.            html += '  <select id="option-values' + option_row + '" style="display: none;">';
  944.            
  945.            for (i = 0; i < ui.item.option_value.length; i++) {
  946.                 html += '  <option value="' + ui.item.option_value[i]['option_value_id'] + '">' + ui.item.option_value[i]['name'] + '</option>';
  947.            }
  948.  
  949.             html += '  </select>';         
  950.             html += '</div>';  
  951.         }
  952.        
  953.         $('#tab-option').append(html);
  954.        
  955.         $('#option-add').before('<a href="#tab-option-' + option_row + '" id="option-' + option_row + '">' + ui.item.label + '&nbsp;<img src="view/image/delete.png" alt="" onclick="$(\'#vtab-option a:first\').trigger(\'click\'); $(\'#option-' + option_row + '\').remove(); $(\'#tab-option-' + option_row + '\').remove(); return false;" /></a>');
  956.        
  957.         $('#vtab-option a').tabs();
  958.        
  959.         $('#option-' + option_row).trigger('click');       
  960.        
  961.         $('.date').datepicker({dateFormat: 'yy-mm-dd'});
  962.         $('.datetime').datetimepicker({
  963.             dateFormat: 'yy-mm-dd',
  964.             timeFormat: 'h:m'
  965.         });
  966.            
  967.         $('.time').timepicker({timeFormat: 'h:m'});
  968.                
  969.         option_row++;
  970.        
  971.         return false;
  972.     },
  973.     focus: function(event, ui) {
  974.      return false;
  975.   }
  976. });
  977. //--></script>
  978. <script type="text/javascript"><!--    
  979. var option_value_row = <?php echo $option_value_row; ?>;
  980.  
  981. function addOptionValue(option_row) {  
  982.     html  = '<tbody id="option-value-row' + option_value_row + '">';
  983.     html += '  <tr>';
  984.     html += '    <td class="left"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][option_value_id]">';
  985.     html += $('#option-values' + option_row).html();
  986.     html += '    </select><input type="hidden" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][product_option_value_id]" value="" /></td>';
  987.     html += '    <td class="right"><input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][quantity]" value="" size="3" /></td>';
  988.     html += '    <td class="left"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][subtract]">';
  989.     html += '      <option value="1"><?php echo $text_yes; ?></option>';
  990.     html += '      <option value="0"><?php echo $text_no; ?></option>';
  991.     html += '    </select></td>';
  992.     html += '    <td class="right"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][price_prefix]">';
  993.     html += '      <option value="+">+</option>';
  994.     html += '      <option value="-">-</option>';
  995.     html += '    </select>';
  996.     html += '    <input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][price]" value="" size="5" /></td>';
  997.     html += '    <td class="right"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][points_prefix]">';
  998.     html += '      <option value="+">+</option>';
  999.     html += '      <option value="-">-</option>';
  1000.     html += '    </select>';
  1001.     html += '    <input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][points]" value="" size="5" /></td>';  
  1002.     html += '    <td class="right"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][weight_prefix]">';
  1003.     html += '      <option value="+">+</option>';
  1004.     html += '      <option value="-">-</option>';
  1005.     html += '    </select>';
  1006.     html += '    <input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][weight]" value="" size="5" /></td>';
  1007.     html += '    <td class="left"><a onclick="$(\'#option-value-row' + option_value_row + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
  1008.     html += '  </tr>';
  1009.     html += '</tbody>';
  1010.    
  1011.     $('#option-value' + option_row + ' tfoot').before(html);
  1012.  
  1013.     option_value_row++;
  1014. }
  1015. //--></script>
  1016. <script type="text/javascript"><!--
  1017. var discount_row = <?php echo $discount_row; ?>;
  1018.  
  1019. function addDiscount() {
  1020.     html  = '<tbody id="discount-row' + discount_row + '">';
  1021.     html += '  <tr>';
  1022.    html += '    <td class="left"><select name="product_discount[' + discount_row + '][customer_group_id]">';
  1023.    <?php foreach ($customer_groups as $customer_group) { ?>
  1024.    html += '      <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>';
  1025.    <?php } ?>
  1026.     html += '    </select></td>';      
  1027.    html += '    <td class="right"><input type="text" name="product_discount[' + discount_row + '][quantity]" value="" size="2" /></td>';
  1028.    html += '    <td class="right"><input type="text" name="product_discount[' + discount_row + '][priority]" value="" size="2" /></td>';
  1029.     html += '    <td class="right"><input type="text" name="product_discount[' + discount_row + '][price]" value="" /></td>';
  1030.    html += '    <td class="left"><input type="text" name="product_discount[' + discount_row + '][date_start]" value="" class="date" /></td>';
  1031.     html += '    <td class="left"><input type="text" name="product_discount[' + discount_row + '][date_end]" value="" class="date" /></td>';
  1032.     html += '    <td class="left"><a onclick="$(\'#discount-row' + discount_row + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
  1033.     html += '  </tr>'; 
  1034.    html += '</tbody>';
  1035.    
  1036.     $('#discount tfoot').before(html);
  1037.        
  1038.     $('#discount-row' + discount_row + ' .date').datepicker({dateFormat: 'yy-mm-dd'});
  1039.    
  1040.     discount_row++;
  1041. }
  1042. //--></script>
  1043. <script type="text/javascript"><!--
  1044. var special_row = <?php echo $special_row; ?>;
  1045.  
  1046. function addSpecial() {
  1047.     html  = '<tbody id="special-row' + special_row + '">';
  1048.     html += '  <tr>';
  1049.    html += '    <td class="left"><select name="product_special[' + special_row + '][customer_group_id]">';
  1050.    <?php foreach ($customer_groups as $customer_group) { ?>
  1051.    html += '      <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>';
  1052.    <?php } ?>
  1053.     html += '    </select></td>';      
  1054.    html += '    <td class="right"><input type="text" name="product_special[' + special_row + '][priority]" value="" size="2" /></td>';
  1055.     html += '    <td class="right"><input type="text" name="product_special[' + special_row + '][price]" value="" /></td>';
  1056.    html += '    <td class="left"><input type="text" name="product_special[' + special_row + '][date_start]" value="" class="date" /></td>';
  1057.     html += '    <td class="left"><input type="text" name="product_special[' + special_row + '][date_end]" value="" class="date" /></td>';
  1058.     html += '    <td class="left"><a onclick="$(\'#special-row' + special_row + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
  1059.     html += '  </tr>';
  1060.    html += '</tbody>';
  1061.    
  1062.     $('#special tfoot').before(html);
  1063.  
  1064.     $('#special-row' + special_row + ' .date').datepicker({dateFormat: 'yy-mm-dd'});
  1065.    
  1066.     special_row++;
  1067. }
  1068. //--></script>
  1069. <script type="text/javascript"><!--
  1070.  
  1071.               $(document).ready(function() {
  1072.                 $('#image').keyup(function() {
  1073.                     $('#image_exists').html('');
  1074.                     $.ajax({
  1075.                         url: 'index.php?route=common/filemanager/exists&token=<?php echo $token; ?>',
  1076.                         type: 'POST',
  1077.                         data: 'source=' + encodeURIComponent($('#image').attr('value')),
  1078.                         dataType: 'json',
  1079.                         success: function(data) {
  1080.                             if (data.exists == "1") {
  1081.                                 if ($('#image').attr('value')) {
  1082.                                     $.ajax({
  1083.                                         url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>',
  1084.                                         type: 'POST',
  1085.                                         data: 'image=' + encodeURIComponent($('#image').attr('value')),
  1086.                                         dataType: 'text',
  1087.                                         success: function(data) {
  1088.                                             $('#thumb').replaceWith('<img src="' + data + '" alt="" id="thumb" class="image" onclick="image_upload(\'image\', \'thumb\');" />');
  1089.                                         }
  1090.                                     });
  1091.                                 }
  1092.                                 $('#image_exists').html('<span style="color: #A5BD71;">Found</span>');
  1093.                             } else {
  1094.                                 $('#image_exists').html('<span style="color: #FF9999;">Not Found</span>');
  1095.                             }
  1096.                         }
  1097.                     });
  1098.                 });
  1099.             });
  1100. function image_upload(field, thumb) {
  1101.     $('#dialog').remove();
  1102.    
  1103.     $('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
  1104.    
  1105.     $('#dialog').dialog({
  1106.         title: '<?php echo $text_image_manager; ?>',
  1107.         close: function (event, ui) {
  1108.             if ($('#' + field).attr('value')) {
  1109.                 $.ajax({
  1110.                     url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).attr('value')),
  1111.                     dataType: 'text',
  1112.                     success: function(text) {
  1113.                         $('#' + thumb).replaceWith('<img src="' + text + '" alt="" id="' + thumb + '" />');
  1114.                     }
  1115.                 });
  1116.             }
  1117.         }, 
  1118.         bgiframe: false,
  1119.         width: 800,
  1120.         height: 400,
  1121.         resizable: false,
  1122.         modal: false
  1123.     });
  1124. };
  1125. //--></script>
  1126. <script type="text/javascript"><!--
  1127. var image_row = <?php echo $image_row; ?>;
  1128.  
  1129. function addImage() {
  1130.    
  1131.             html  = '<tbody id="image-row' + image_row + '">';
  1132.             html += '<tr>';
  1133.             html += '<td class="left"><img src="<?php echo $no_image; ?>" alt="" id="thumb' + image_row + '" class="image" onclick="image_upload(\'image' + image_row + '\', \'thumb' + image_row + '\');" /><br /><input size="60" type="text" name="product_image[' + image_row + ']" value="" id="image' + image_row + '" /> <span id="image_exists' + image_row + '"></span></td>';
  1134.             html += '<td class="left"><a onclick="$(\'#image-row' + image_row  + '\').remove();" class="button"><span><?php echo $button_remove; ?></span></a></td>';
  1135.             html += '</tr>';
  1136.            
  1137.  
  1138.  
  1139.  
  1140.  
  1141.     html += '  </tr>';
  1142.     html += '</tbody>';
  1143.    
  1144.     $('#images tfoot').before(html);
  1145.    
  1146.     image_row++;
  1147. }
  1148. //--></script>
  1149. <script type="text/javascript" src="view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script>
  1150. <script type="text/javascript"><!--
  1151. $('.date').datepicker({dateFormat: 'yy-mm-dd'});
  1152. $('.datetime').datetimepicker({
  1153.     dateFormat: 'yy-mm-dd',
  1154.     timeFormat: 'h:m'
  1155. });
  1156. $('.time').timepicker({timeFormat: 'h:m'});
  1157. //--></script>
  1158. <script type="text/javascript"><!--
  1159. $('#tabs a').tabs();
  1160. $('#languages a').tabs();
  1161. $('#vtab-option a').tabs();
  1162. //--></script>
  1163.  
  1164.                     <script type="text/javascript">
  1165.                         function titlerPop() {
  1166.                             var html = '<h3 style="text-align: center; border-bottom: 1px solid black; padding-bottom: 10px;">OpenCart Title Tag Editor</h3>';
  1167.                             html += '<div style="text-align: justify;"><p>With the OpenCart Title Tag Editor, you can change the value of the HTML &lt;title&gt; tag for product, category, and information pages.</p>';
  1168.                             html += '<p>To use the default OpenCart title, simply leave this field blank.</p>';
  1169.                             html += '<p>If you like this plugin, please consider sending the developer a donation.  Thank you!</p></div>';
  1170.                             html += '<div style="text-align: center;"><a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=V4DWSBKYEPPHW">';
  1171.                             html += '<img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0">';
  1172.                             html += '</a></div>';
  1173.                             newWin = window.open('','titlerpop', 'height=330,width=400,menubar=no,status=no,location=no,toolbar=no');
  1174.                             newWin.document.body.innerHTML = html;
  1175.                             newWin.document.title = "Title Tag Editor";
  1176.                         }
  1177.                     </script>
  1178.                
  1179. <?php echo $footer; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement