Advertisement
Guest User

OpenCart Product Form

a guest
Sep 30th, 2015
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 91.84 KB | None | 0 0
  1. <?php echo $header; ?><?php echo $column_left; ?>
  2. <div id="content">
  3.   <div class="page-header">
  4.     <div class="container-fluid">
  5.       <div class="pull-right">
  6.         <button type="submit" form="form-product" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
  7.         <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
  8.      
  9.     </div>
  10.   </div>
  11.   <div class="container-fluid">
  12.     <?php if ($error_warning) { ?>
  13.     <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
  14.       <button type="button" class="close" data-dismiss="alert">&times;</button>
  15.     </div>
  16.     <?php } ?>
  17.     <div class="panel panel-default">
  18.       <div class="panel-heading">
  19.         <h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_form; ?></h3>
  20.       </div>
  21.       <div class="panel-body">
  22.         <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-product" class="form-horizontal">
  23.           <ul class="nav nav-tabs">
  24.             <li class="active"><a href="#tab-general" class="navtab" data-toggle="tab"><?php echo $tab_general; ?></a></li>
  25.             <li><a href="#tab-data" class="navtab" data-toggle="tab"><?php echo $tab_data; ?></a></li>
  26.             <li><a href="#tab-links" class="navtab" data-toggle="tab"><?php echo $tab_links; ?></a></li>
  27.             <li><a href="#tab-attribute" class="navtab" data-toggle="tab"><?php echo $tab_attribute; ?></a></li>
  28.             <li><a href="#tab-option" class="navtab" data-toggle="tab"><?php echo $tab_option; ?></a></li>
  29.             <li><a href="#tab-recurring" class="navtab" data-toggle="tab"><?php echo $tab_recurring; ?></a></li>
  30.             <li><a href="#tab-discount" class="navtab" data-toggle="tab"><?php echo $tab_discount; ?></a></li>
  31.             <li><a href="#tab-special" class="navtab" data-toggle="tab"><?php echo $tab_special; ?></a></li>
  32.             <li><a href="#tab-image" class="navtab" data-toggle="tab"><?php echo $tab_image; ?></a></li>
  33.             <li><a href="#tab-reward" class="navtab" data-toggle="tab"><?php echo $tab_reward; ?></a></li>
  34.             <li><a href="#tab-design" class="navtab" data-toggle="tab"><?php echo $tab_design; ?></a></li>
  35.           </ul>
  36.           <div class="tab-content">
  37.             <div class="tab-pane active" id="tab-general">
  38.               <ul class="nav nav-tabs" id="language">
  39.                 <?php foreach ($languages as $language) { ?>
  40.                 <li><a href="#language<?php echo $language['language_id']; ?>" class="navtab" data-toggle="tab"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a></li>
  41.                 <?php } ?>
  42.               </ul>
  43.               <div class="tab-content">
  44.                 <?php foreach ($languages as $language) { ?>
  45.                 <div class="tab-pane" id="language<?php echo $language['language_id']; ?>">
  46.                   <div class="form-group required">
  47.                     <label class="col-sm-2 control-label" for="input-name<?php echo $language['language_id']; ?>"><?php echo $entry_name; ?></label>
  48.                     <div class="col-sm-10">
  49.                       <input type="text" name="product_description[<?php echo $language['language_id']; ?>][name]" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['name'] : ''; ?>" placeholder="<?php echo $entry_name; ?>" id="input-name<?php echo $language['language_id']; ?>" class="form-control" />
  50.                       <?php if (isset($error_name[$language['language_id']])) { ?>
  51.                       <div class="text-danger"><?php echo $error_name[$language['language_id']]; ?></div>
  52.                       <?php } ?>
  53.                     </div>
  54.                   </div>
  55.                   <div class="form-group">
  56.                     <label class="col-sm-2 control-label" for="input-description<?php echo $language['language_id']; ?>"><?php echo $entry_description; ?></label>
  57.                     <div class="col-sm-10">
  58.                       <textarea name="product_description[<?php echo $language['language_id']; ?>][description]" placeholder="<?php echo $entry_description; ?>" id="input-description<?php echo $language['language_id']; ?>"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['description'] : ''; ?></textarea>
  59.                     </div>
  60.                   </div>
  61.                   <div class="form-group required">
  62.                     <label class="col-sm-2 control-label" for="input-meta-title<?php echo $language['language_id']; ?>"><?php echo $entry_meta_title; ?></label>
  63.                     <div class="col-sm-10">
  64.                       <input type="text" name="product_description[<?php echo $language['language_id']; ?>][meta_title]" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['meta_title'] : ''; ?>" placeholder="<?php echo $entry_meta_title; ?>" id="input-meta-title<?php echo $language['language_id']; ?>" class="form-control" />
  65.                       <?php if (isset($error_meta_title[$language['language_id']])) { ?>
  66.                       <div class="text-danger"><?php echo $error_meta_title[$language['language_id']]; ?></div>
  67.                       <?php } ?>
  68.                     </div>
  69.                   </div>
  70.                   <div class="form-group">
  71.                     <label class="col-sm-2 control-label" for="input-meta-description<?php echo $language['language_id']; ?>"><?php echo $entry_meta_description; ?></label>
  72.                     <div class="col-sm-10">
  73.                       <textarea name="product_description[<?php echo $language['language_id']; ?>][meta_description]" rows="5" placeholder="<?php echo $entry_meta_description; ?>" id="input-meta-description<?php echo $language['language_id']; ?>" class="form-control"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['meta_description'] : ''; ?></textarea>
  74.                     </div>
  75.                   </div>
  76.                   <div class="form-group">
  77.                     <label class="col-sm-2 control-label" for="input-meta-keyword<?php echo $language['language_id']; ?>"><?php echo $entry_meta_keyword; ?></label>
  78.                     <div class="col-sm-10">
  79.                       <textarea name="product_description[<?php echo $language['language_id']; ?>][meta_keyword]" rows="5" placeholder="<?php echo $entry_meta_keyword; ?>" id="input-meta-keyword<?php echo $language['language_id']; ?>" class="form-control"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['meta_keyword'] : ''; ?></textarea>
  80.                     </div>
  81.                   </div>
  82.                   <div class="form-group">
  83.                     <label class="col-sm-2 control-label" for="input-tag<?php echo $language['language_id']; ?>"><span data-toggle="tooltip" title="<?php echo $help_tag; ?>"><?php echo $entry_tag; ?></span></label>
  84.                     <div class="col-sm-10">
  85.                       <input type="text" name="product_description[<?php echo $language['language_id']; ?>][tag]" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['tag'] : ''; ?>" placeholder="<?php echo $entry_tag; ?>" id="input-tag<?php echo $language['language_id']; ?>" class="form-control" />
  86.                     </div>
  87.                   </div>
  88.                 </div>
  89.                 <?php } ?>
  90.               </div>
  91.             </div>
  92.             <div class="tab-pane" id="tab-data">
  93.               <div class="form-group">
  94.                 <label class="col-sm-2 control-label" for="input-image"><?php echo $entry_image; ?></label>
  95.                 <div class="col-sm-10">
  96.                   <a href="" id="thumb-image" data-toggle="image" class="img-thumbnail navtab"><img src="<?php echo $thumb; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
  97.                   <input type="hidden" name="image" value="<?php echo $image; ?>" id="input-image" />
  98.                 </div>
  99.               </div>            
  100.               <div class="form-group required">
  101.                 <label class="col-sm-2 control-label" for="input-model"><?php echo $entry_model; ?></label>
  102.                 <div class="col-sm-10">
  103.                   <input type="text" name="model" value="<?php echo $model; ?>" placeholder="<?php echo $entry_model; ?>" id="input-model" class="form-control" />
  104.                   <?php if ($error_model) { ?>
  105.                   <div class="text-danger"><?php echo $error_model; ?></div>
  106.                   <?php } ?>
  107.                 </div>
  108.               </div>
  109.               <div class="form-group">
  110.                 <label class="col-sm-2 control-label" for="input-sku"><span data-toggle="tooltip" title="<?php echo $help_sku; ?>"><?php echo $entry_sku; ?></span></label>
  111.                 <div class="col-sm-10">
  112.                   <input type="text" name="sku" value="<?php echo $sku; ?>" placeholder="<?php echo $entry_sku; ?>" id="input-sku" class="form-control" />
  113.                 </div>
  114.               </div>
  115.               <div class="form-group">
  116.                 <label class="col-sm-2 control-label" for="input-upc"><span data-toggle="tooltip" title="<?php echo $help_upc; ?>"><?php echo $entry_upc; ?></span></label>
  117.                 <div class="col-sm-10">
  118.                   <input type="text" name="upc" value="<?php echo $upc; ?>" placeholder="<?php echo $entry_upc; ?>" id="input-upc" class="form-control" />
  119.                 </div>
  120.               </div>
  121.               <div class="form-group">
  122.                 <label class="col-sm-2 control-label" for="input-ean"><span data-toggle="tooltip" title="<?php echo $help_ean; ?>"><?php echo $entry_ean; ?></span></label>
  123.                 <div class="col-sm-10">
  124.                   <input type="text" name="ean" value="<?php echo $ean; ?>" placeholder="<?php echo $entry_ean; ?>" id="input-ean" class="form-control" />
  125.                 </div>
  126.               </div>
  127.               <div class="form-group">
  128.                 <label class="col-sm-2 control-label" for="input-jan"><span data-toggle="tooltip" title="<?php echo $help_jan; ?>"><?php echo $entry_jan; ?></span></label>
  129.                 <div class="col-sm-10">
  130.                   <input type="text" name="jan" value="<?php echo $jan; ?>" placeholder="<?php echo $entry_jan; ?>" id="input-jan" class="form-control" />
  131.                 </div>
  132.               </div>
  133.               <div class="form-group">
  134.                 <label class="col-sm-2 control-label" for="input-isbn"><span data-toggle="tooltip" title="<?php echo $help_isbn; ?>"><?php echo $entry_isbn; ?></span></label>
  135.                 <div class="col-sm-10">
  136.                   <input type="text" name="isbn" value="<?php echo $isbn; ?>" placeholder="<?php echo $entry_isbn; ?>" id="input-isbn" class="form-control" />
  137.                 </div>
  138.               </div>
  139.               <div class="form-group">
  140.                 <label class="col-sm-2 control-label" for="input-mpn"><span data-toggle="tooltip" title="<?php echo $help_mpn; ?>"><?php echo $entry_mpn; ?></span></label>
  141.                 <div class="col-sm-10">
  142.                   <input type="text" name="mpn" value="<?php echo $mpn; ?>" placeholder="<?php echo $entry_mpn; ?>" id="input-mpn" class="form-control" />
  143.                 </div>
  144.               </div>
  145.               <div class="form-group">
  146.                 <label class="col-sm-2 control-label" for="input-location"><?php echo $entry_location; ?></label>
  147.                 <div class="col-sm-10">
  148.                   <input type="text" name="location" value="<?php echo $location; ?>" placeholder="<?php echo $entry_location; ?>" id="input-location" class="form-control" />
  149.                 </div>
  150.               </div>
  151.               <div class="form-group">
  152.                 <label class="col-sm-2 control-label" for="input-price"><?php echo $entry_price; ?></label>
  153.                 <div class="col-sm-10">
  154.                   <input type="text" name="price" value="<?php echo $price; ?>" placeholder="<?php echo $entry_price; ?>" id="input-price" class="form-control" />
  155.                 </div>
  156.               </div>
  157.               <div class="form-group">
  158.                 <label class="col-sm-2 control-label" for="input-tax-class"><?php echo $entry_tax_class; ?></label>
  159.                 <div class="col-sm-10">
  160.                   <select name="tax_class_id" id="input-tax-class" class="form-control">
  161.                     <option value="0"><?php echo $text_none; ?></option>
  162.                     <?php foreach ($tax_classes as $tax_class) { ?>
  163.                     <?php if ($tax_class['tax_class_id'] == $tax_class_id) { ?>
  164.                     <option value="<?php echo $tax_class['tax_class_id']; ?>" selected="selected"><?php echo $tax_class['title']; ?></option>
  165.                     <?php } else { ?>
  166.                     <option value="<?php echo $tax_class['tax_class_id']; ?>"><?php echo $tax_class['title']; ?></option>
  167.                     <?php } ?>
  168.                     <?php } ?>
  169.                   </select>
  170.                 </div>
  171.               </div>
  172.               <div class="form-group">
  173.                 <label class="col-sm-2 control-label" for="input-quantity"><?php echo $entry_quantity; ?></label>
  174.                 <div class="col-sm-10">
  175.                   <input type="text" name="quantity" value="<?php echo $quantity; ?>" placeholder="<?php echo $entry_quantity; ?>" id="input-quantity" class="form-control" />
  176.                 </div>
  177.               </div>
  178.               <div class="form-group">
  179.                 <label class="col-sm-2 control-label" for="input-minimum"><span data-toggle="tooltip" title="<?php echo $help_minimum; ?>"><?php echo $entry_minimum; ?></span></label>
  180.                 <div class="col-sm-10">
  181.                   <input type="text" name="minimum" value="<?php echo $minimum; ?>" placeholder="<?php echo $entry_minimum; ?>" id="input-minimum" class="form-control" />
  182.                 </div>
  183.               </div>
  184.               <div class="form-group">
  185.                 <label class="col-sm-2 control-label" for="input-subtract"><?php echo $entry_subtract; ?></label>
  186.                 <div class="col-sm-10">
  187.                   <select name="subtract" id="input-subtract" class="form-control">
  188.                     <?php if ($subtract) { ?>
  189.                     <option value="1" selected="selected"><?php echo $text_yes; ?></option>
  190.                     <option value="0"><?php echo $text_no; ?></option>
  191.                     <?php } else { ?>
  192.                     <option value="1"><?php echo $text_yes; ?></option>
  193.                     <option value="0" selected="selected"><?php echo $text_no; ?></option>
  194.                     <?php } ?>
  195.                   </select>
  196.                 </div>
  197.               </div>
  198.               <div class="form-group">
  199.                 <label class="col-sm-2 control-label" for="input-stock-status"><span data-toggle="tooltip" title="<?php echo $help_stock_status; ?>"><?php echo $entry_stock_status; ?></span></label>
  200.                 <div class="col-sm-10">
  201.                   <select name="stock_status_id" id="input-stock-status" class="form-control">
  202.                     <?php foreach ($stock_statuses as $stock_status) { ?>
  203.                     <?php if ($stock_status['stock_status_id'] == $stock_status_id) { ?>
  204.                     <option value="<?php echo $stock_status['stock_status_id']; ?>" selected="selected"><?php echo $stock_status['name']; ?></option>
  205.                     <?php } else { ?>
  206.                     <option value="<?php echo $stock_status['stock_status_id']; ?>"><?php echo $stock_status['name']; ?></option>
  207.                     <?php } ?>
  208.                     <?php } ?>
  209.                   </select>
  210.                 </div>
  211.               </div>
  212.               <div class="form-group">
  213.                 <label class="col-sm-2 control-label"><?php echo $entry_shipping; ?></label>
  214.                 <div class="col-sm-10">
  215.                   <label class="radio-inline">
  216.                     <?php if ($shipping) { ?>
  217.                     <input type="radio" name="shipping" value="1" checked="checked" />
  218.                     <?php echo $text_yes; ?>
  219.                     <?php } else { ?>
  220.                     <input type="radio" name="shipping" value="1" />
  221.                     <?php echo $text_yes; ?>
  222.                     <?php } ?>
  223.                   </label>
  224.                   <label class="radio-inline">
  225.                     <?php if (!$shipping) { ?>
  226.                     <input type="radio" name="shipping" value="0" checked="checked" />
  227.                     <?php echo $text_no; ?>
  228.                     <?php } else { ?>
  229.                     <input type="radio" name="shipping" value="0" />
  230.                     <?php echo $text_no; ?>
  231.                     <?php } ?>
  232.                   </label>
  233.                 </div>
  234.               </div>
  235.               <div class="form-group">
  236.                 <label class="col-sm-2 control-label" for="input-keyword"><span data-toggle="tooltip" title="<?php echo $help_keyword; ?>"><?php echo $entry_keyword; ?></span></label>
  237.                 <div class="col-sm-10">
  238.                   <input type="text" name="keyword" value="<?php echo $keyword; ?>" placeholder="<?php echo $entry_keyword; ?>" id="input-keyword" class="form-control" />
  239.                   <?php if ($error_keyword) { ?>
  240.                   <div class="text-danger"><?php echo $error_keyword; ?></div>
  241.                   <?php } ?>              
  242.                 </div>
  243.               </div>
  244.               <div class="form-group">
  245.                 <label class="col-sm-2 control-label" for="input-date-available"><?php echo $entry_date_available; ?></label>
  246.                 <div class="col-sm-3">
  247.                   <div class="input-group date">
  248.                     <input type="text" name="date_available" value="<?php echo $date_available; ?>" placeholder="<?php echo $entry_date_available; ?>" data-date-format="YYYY-MM-DD" id="input-date-available" class="form-control" />
  249.                     <span class="input-group-btn">
  250.                     <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
  251.                     </span></div>
  252.                 </div>
  253.               </div>
  254.               <div class="form-group">
  255.                 <label class="col-sm-2 control-label" for="input-length"><?php echo $entry_dimension; ?></label>
  256.                 <div class="col-sm-10">
  257.                   <div class="row">
  258.                     <div class="col-sm-4">
  259.                       <input type="text" name="length" value="<?php echo $length; ?>" placeholder="<?php echo $entry_length; ?>" id="input-length" class="form-control" />
  260.                     </div>
  261.                     <div class="col-sm-4">
  262.                       <input type="text" name="width" value="<?php echo $width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-width" class="form-control" />
  263.                     </div>
  264.                     <div class="col-sm-4">
  265.                       <input type="text" name="height" value="<?php echo $height; ?>" placeholder="<?php echo $entry_height; ?>" id="input-height" class="form-control" />
  266.                     </div>
  267.                   </div>
  268.                 </div>
  269.               </div>
  270.               <div class="form-group">
  271.                 <label class="col-sm-2 control-label" for="input-length-class"><?php echo $entry_length_class; ?></label>
  272.                 <div class="col-sm-10">
  273.                   <select name="length_class_id" id="input-length-class" class="form-control">
  274.                     <?php foreach ($length_classes as $length_class) { ?>
  275.                     <?php if ($length_class['length_class_id'] == $length_class_id) { ?>
  276.                     <option value="<?php echo $length_class['length_class_id']; ?>" selected="selected"><?php echo $length_class['title']; ?></option>
  277.                     <?php } else { ?>
  278.                     <option value="<?php echo $length_class['length_class_id']; ?>"><?php echo $length_class['title']; ?></option>
  279.                     <?php } ?>
  280.                     <?php } ?>
  281.                   </select>
  282.                 </div>
  283.               </div>
  284.               <div class="form-group">
  285.                 <label class="col-sm-2 control-label" for="input-weight"><?php echo $entry_weight; ?></label>
  286.                 <div class="col-sm-10">
  287.                   <input type="text" name="weight" value="<?php echo $weight; ?>" placeholder="<?php echo $entry_weight; ?>" id="input-weight" class="form-control" />
  288.                 </div>
  289.               </div>
  290.               <div class="form-group">
  291.                 <label class="col-sm-2 control-label" for="input-weight-class"><?php echo $entry_weight_class; ?></label>
  292.                 <div class="col-sm-10">
  293.                   <select name="weight_class_id" id="input-weight-class" class="form-control">
  294.                     <?php foreach ($weight_classes as $weight_class) { ?>
  295.                     <?php if ($weight_class['weight_class_id'] == $weight_class_id) { ?>
  296.                     <option value="<?php echo $weight_class['weight_class_id']; ?>" selected="selected"><?php echo $weight_class['title']; ?></option>
  297.                     <?php } else { ?>
  298.                     <option value="<?php echo $weight_class['weight_class_id']; ?>"><?php echo $weight_class['title']; ?></option>
  299.                     <?php } ?>
  300.                     <?php } ?>
  301.                   </select>
  302.                 </div>
  303.               </div>
  304.               <div class="form-group">
  305.                 <label class="col-sm-2 control-label" for="input-status"><?php echo $entry_status; ?></label>
  306.                 <div class="col-sm-10">
  307.                   <select name="status" id="input-status" class="form-control">
  308.                     <?php if ($status) { ?>
  309.                     <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
  310.                     <option value="0"><?php echo $text_disabled; ?></option>
  311.                     <?php } else { ?>
  312.                     <option value="1"><?php echo $text_enabled; ?></option>
  313.                     <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
  314.                     <?php } ?>
  315.                   </select>
  316.                 </div>
  317.               </div>
  318.               <div class="form-group">
  319.                 <label class="col-sm-2 control-label" for="input-sort-order"><?php echo $entry_sort_order; ?></label>
  320.                 <div class="col-sm-10">
  321.                   <input type="text" name="sort_order" value="<?php echo $sort_order; ?>" placeholder="<?php echo $entry_sort_order; ?>" id="input-sort-order" class="form-control" />
  322.                 </div>
  323.               </div>
  324.             </div>
  325.             <div class="tab-pane" id="tab-links">
  326.               <div class="form-group">
  327.                 <label class="col-sm-2 control-label" for="input-manufacturer"><span data-toggle="tooltip" title="<?php echo $help_manufacturer; ?>"><?php echo $entry_manufacturer; ?></span></label>
  328.                 <div class="col-sm-10">
  329.                   <input type="text" name="manufacturer" value="<?php echo $manufacturer ?>" placeholder="<?php echo $entry_manufacturer; ?>" id="input-manufacturer" class="form-control" />
  330.                   <input type="hidden" name="manufacturer_id" value="<?php echo $manufacturer_id; ?>" />
  331.                 </div>
  332.               </div>
  333.               <div class="form-group">
  334.                 <label class="col-sm-2 control-label" for="input-category"><span data-toggle="tooltip" title="<?php echo $help_category; ?>"><?php echo $entry_category; ?></span></label>
  335.                 <div class="col-sm-10">
  336.                   <input type="text" name="category" value="" placeholder="<?php echo $entry_category; ?>" id="input-category" class="form-control" />
  337.                   <div id="product-category" class="well well-sm" style="height: 150px; overflow: auto;">
  338.                     <?php foreach ($product_categories as $product_category) { ?>
  339.                     <div id="product-category<?php echo $product_category['category_id']; ?>"><i class="fa fa-minus-circle"></i> <?php echo $product_category['name']; ?>
  340.                       <input type="hidden" name="product_category[]" value="<?php echo $product_category['category_id']; ?>" />
  341.                     </div>
  342.                     <?php } ?>
  343.                   </div>
  344.                 </div>
  345.               </div>
  346.               <div class="form-group">
  347.                 <label class="col-sm-2 control-label" for="input-filter"><span data-toggle="tooltip" title="<?php echo $help_filter; ?>"><?php echo $entry_filter; ?></span></label>
  348.                 <div class="col-sm-10">
  349.                   <input type="text" name="filter" value="" placeholder="<?php echo $entry_filter; ?>" id="input-filter" class="form-control" />
  350.                   <div id="product-filter" class="well well-sm" style="height: 150px; overflow: auto;">
  351.                     <?php foreach ($product_filters as $product_filter) { ?>
  352.                     <div id="product-filter<?php echo $product_filter['filter_id']; ?>"><i class="fa fa-minus-circle"></i> <?php echo $product_filter['name']; ?>
  353.                       <input type="hidden" name="product_filter[]" value="<?php echo $product_filter['filter_id']; ?>" />
  354.                     </div>
  355.                     <?php } ?>
  356.                   </div>
  357.                 </div>
  358.               </div>
  359.               <div class="form-group">
  360.                 <label class="col-sm-2 control-label"><?php echo $entry_store; ?></label>
  361.                 <div class="col-sm-10">
  362.                   <div class="well well-sm" style="height: 150px; overflow: auto;">
  363.                     <div class="checkbox">
  364.                       <label>
  365.                         <?php if (in_array(0, $product_store)) { ?>
  366.                         <input type="checkbox" name="product_store[]" value="0" checked="checked" />
  367.                         <?php echo $text_default; ?>
  368.                         <?php } else { ?>
  369.                         <input type="checkbox" name="product_store[]" value="0" />
  370.                         <?php echo $text_default; ?>
  371.                         <?php } ?>
  372.                       </label>
  373.                     </div>
  374.                     <?php foreach ($stores as $store) { ?>
  375.                     <div class="checkbox">
  376.                       <label>
  377.                         <?php if (in_array($store['store_id'], $product_store)) { ?>
  378.                         <input type="checkbox" name="product_store[]" value="<?php echo $store['store_id']; ?>" checked="checked" />
  379.                         <?php echo $store['name']; ?>
  380.                         <?php } else { ?>
  381.                         <input type="checkbox" name="product_store[]" value="<?php echo $store['store_id']; ?>" />
  382.                         <?php echo $store['name']; ?>
  383.                         <?php } ?>
  384.                       </label>
  385.                     </div>
  386.                     <?php } ?>
  387.                   </div>
  388.                 </div>
  389.               </div>
  390.               <div class="form-group">
  391.                 <label class="col-sm-2 control-label" for="input-download"><span data-toggle="tooltip" title="<?php echo $help_download; ?>"><?php echo $entry_download; ?></span></label>
  392.                 <div class="col-sm-10">
  393.                   <input type="text" name="download" value="" placeholder="<?php echo $entry_download; ?>" id="input-download" class="form-control" />
  394.                   <div id="product-download" class="well well-sm" style="height: 150px; overflow: auto;">
  395.                     <?php foreach ($product_downloads as $product_download) { ?>
  396.                     <div id="product-download<?php echo $product_download['download_id']; ?>"><i class="fa fa-minus-circle"></i> <?php echo $product_download['name']; ?>
  397.                       <input type="hidden" name="product_download[]" value="<?php echo $product_download['download_id']; ?>" />
  398.                     </div>
  399.                     <?php } ?>
  400.                   </div>
  401.                 </div>
  402.               </div>
  403.               <div class="form-group">
  404.                 <label class="col-sm-2 control-label" for="input-related"><span data-toggle="tooltip" title="<?php echo $help_related; ?>"><?php echo $entry_related; ?></span></label>
  405.                 <div class="col-sm-10">
  406.                   <input type="text" name="related" value="" placeholder="<?php echo $entry_related; ?>" id="input-related" class="form-control" />
  407.                   <div id="product-related" class="well well-sm" style="height: 150px; overflow: auto;">
  408.                     <?php foreach ($product_relateds as $product_related) { ?>
  409.                     <div id="product-related<?php echo $product_related['product_id']; ?>"><i class="fa fa-minus-circle"></i> <?php echo $product_related['name']; ?>
  410.                       <input type="hidden" name="product_related[]" value="<?php echo $product_related['product_id']; ?>" />
  411.                     </div>
  412.                     <?php } ?>
  413.                   </div>
  414.                 </div>
  415.               </div>
  416.             </div>
  417.             <div class="tab-pane" id="tab-attribute">
  418.               <div class="table-responsive">
  419.                 <table id="attribute" class="table table-striped table-bordered table-hover">
  420.                   <thead>
  421.                     <tr>
  422.                       <td class="text-left"><?php echo $entry_attribute; ?></td>
  423.                       <td class="text-left"><?php echo $entry_text; ?></td>
  424.                       <td></td>
  425.                     </tr>
  426.                   </thead>
  427.                   <tbody>
  428.                     <?php $attribute_row = 0; ?>
  429.                     <?php foreach ($product_attributes as $product_attribute) { ?>
  430.                     <tr id="attribute-row<?php echo $attribute_row; ?>">
  431.                       <td class="text-left" style="width: 40%;"><input type="text" name="product_attribute[<?php echo $attribute_row; ?>][name]" value="<?php echo $product_attribute['name']; ?>" placeholder="<?php echo $entry_attribute; ?>" class="form-control" />
  432.                         <input type="hidden" name="product_attribute[<?php echo $attribute_row; ?>][attribute_id]" value="<?php echo $product_attribute['attribute_id']; ?>" /></td>
  433.                       <td class="text-left"><?php foreach ($languages as $language) { ?>
  434.                         <div class="input-group"><span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /></span>
  435.                           <textarea name="product_attribute[<?php echo $attribute_row; ?>][product_attribute_description][<?php echo $language['language_id']; ?>][text]" rows="5" placeholder="<?php echo $entry_text; ?>" class="form-control"><?php echo isset($product_attribute['product_attribute_description'][$language['language_id']]) ? $product_attribute['product_attribute_description'][$language['language_id']]['text'] : ''; ?></textarea>
  436.                         </div>
  437.                         <?php } ?></td>
  438.                       <td class="text-left"><button type="button" onclick="$('#attribute-row<?php echo $attribute_row; ?>').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
  439.                     </tr>
  440.                     <?php $attribute_row++; ?>
  441.                     <?php } ?>
  442.                   </tbody>
  443.                   <tfoot>
  444.                     <tr>
  445.                       <td colspan="2"></td>
  446.                       <td class="text-left"><button type="button" onclick="addAttribute();" data-toggle="tooltip" title="<?php echo $button_attribute_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
  447.                     </tr>
  448.                   </tfoot>
  449.                 </table>
  450.               </div>
  451.             </div>
  452.             <div class="tab-pane" id="tab-option">
  453.               <div class="row">
  454.                 <div class="col-sm-2">
  455.                   <ul class="nav nav-pills nav-stacked" id="option">
  456.                     <?php $option_row = 0; ?>
  457.                     <?php foreach ($product_options as $product_option) { ?>
  458.                     <li><a href="#tab-option<?php echo $option_row; ?>" data-toggle="tab" class="navtab"><i class="fa fa-minus-circle" onclick="$('a[href=\'#tab-option<?php echo $option_row; ?>\']').parent().remove(); $('#tab-option<?php echo $option_row; ?>').remove(); $('#option a:first').tab('show') class="navtab";"></i> <?php echo $product_option['name']; ?></a></li>
  459.                     <?php $option_row++; ?>
  460.                     <?php } ?>
  461.                     <li>
  462.                       <input type="text" name="option" value="" placeholder="<?php echo $entry_option; ?>" id="input-option" class="form-control navtab" />
  463.                     </li>
  464.                   </ul>
  465.                 </div>
  466.                 <div class="col-sm-10">
  467.                   <div class="tab-content">
  468.                     <?php $option_row = 0; ?>
  469.                     <?php $option_value_row = 0; ?>
  470.                     <?php foreach ($product_options as $product_option) { ?>
  471.                     <div class="tab-pane" id="tab-option<?php echo $option_row; ?>">
  472.                       <input type="hidden" name="product_option[<?php echo $option_row; ?>][product_option_id]" value="<?php echo $product_option['product_option_id']; ?>" />
  473.                       <input type="hidden" name="product_option[<?php echo $option_row; ?>][name]" value="<?php echo $product_option['name']; ?>" />
  474.                       <input type="hidden" name="product_option[<?php echo $option_row; ?>][option_id]" value="<?php echo $product_option['option_id']; ?>" />
  475.                       <input type="hidden" name="product_option[<?php echo $option_row; ?>][type]" value="<?php echo $product_option['type']; ?>" />
  476.                       <div class="form-group">
  477.                         <label class="col-sm-2 control-label" for="input-required<?php echo $option_row; ?>"><?php echo $entry_required; ?></label>
  478.                         <div class="col-sm-10">
  479.                           <select name="product_option[<?php echo $option_row; ?>][required]" id="input-required<?php echo $option_row; ?>" class="form-control">
  480.                             <?php if ($product_option['required']) { ?>
  481.                             <option value="1" selected="selected"><?php echo $text_yes; ?></option>
  482.                             <option value="0"><?php echo $text_no; ?></option>
  483.                             <?php } else { ?>
  484.                             <option value="1"><?php echo $text_yes; ?></option>
  485.                             <option value="0" selected="selected"><?php echo $text_no; ?></option>
  486.                             <?php } ?>
  487.                           </select>
  488.                         </div>
  489.                       </div>
  490.                       <?php if ($product_option['type'] == 'text') { ?>
  491.                       <div class="form-group">
  492.                         <label class="col-sm-2 control-label" for="input-value<?php echo $option_row; ?>"><?php echo $entry_option_value; ?></label>
  493.                         <div class="col-sm-10">
  494.                           <input type="text" name="product_option[<?php echo $option_row; ?>][value]" value="<?php echo $product_option['value']; ?>" placeholder="<?php echo $entry_option_value; ?>" id="input-value<?php echo $option_row; ?>" class="form-control" />
  495.                         </div>
  496.                       </div>
  497.                       <?php } ?>
  498.                       <?php if ($product_option['type'] == 'textarea') { ?>
  499.                       <div class="form-group">
  500.                         <label class="col-sm-2 control-label" for="input-value<?php echo $option_row; ?>"><?php echo $entry_option_value; ?></label>
  501.                         <div class="col-sm-10">
  502.                           <textarea name="product_option[<?php echo $option_row; ?>][value]" rows="5" placeholder="<?php echo $entry_option_value; ?>" id="input-value<?php echo $option_row; ?>" class="form-control"><?php echo $product_option['value']; ?></textarea>
  503.                         </div>
  504.                       </div>
  505.                       <?php } ?>
  506.                       <?php if ($product_option['type'] == 'file') { ?>
  507.                       <div class="form-group" style="display: none;">
  508.                         <label class="col-sm-2 control-label" for="input-value<?php echo $option_row; ?>"><?php echo $entry_option_value; ?></label>
  509.                         <div class="col-sm-10">
  510.                           <input type="text" name="product_option[<?php echo $option_row; ?>][value]" value="<?php echo $product_option['value']; ?>" placeholder="<?php echo $entry_option_value; ?>" id="input-value<?php echo $option_row; ?>" class="form-control" />
  511.                         </div>
  512.                       </div>
  513.                       <?php } ?>
  514.                       <?php if ($product_option['type'] == 'date') { ?>
  515.                       <div class="form-group">
  516.                         <label class="col-sm-2 control-label" for="input-value<?php echo $option_row; ?>"><?php echo $entry_option_value; ?></label>
  517.                         <div class="col-sm-3">
  518.                           <div class="input-group date">
  519.                             <input type="text" name="product_option[<?php echo $option_row; ?>][value]" value="<?php echo $product_option['value']; ?>" placeholder="<?php echo $entry_option_value; ?>" data-date-format="YYYY-MM-DD" id="input-value<?php echo $option_row; ?>" class="form-control" />
  520.                             <span class="input-group-btn">
  521.                             <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
  522.                             </span></div>
  523.                         </div>
  524.                       </div>
  525.                       <?php } ?>
  526.                       <?php if ($product_option['type'] == 'time') { ?>
  527.                       <div class="form-group">
  528.                         <label class="col-sm-2 control-label" for="input-value<?php echo $option_row; ?>"><?php echo $entry_option_value; ?></label>
  529.                         <div class="col-sm-10">
  530.                           <div class="input-group time">
  531.                             <input type="text" name="product_option[<?php echo $option_row; ?>][value]" value="<?php echo $product_option['value']; ?>" placeholder="<?php echo $entry_option_value; ?>" data-date-format="HH:mm" id="input-value<?php echo $option_row; ?>" class="form-control" />
  532.                             <span class="input-group-btn">
  533.                             <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
  534.                             </span></div>
  535.                         </div>
  536.                       </div>
  537.                       <?php } ?>
  538.                       <?php if ($product_option['type'] == 'datetime') { ?>
  539.                       <div class="form-group">
  540.                         <label class="col-sm-2 control-label" for="input-value<?php echo $option_row; ?>"><?php echo $entry_option_value; ?></label>
  541.                         <div class="col-sm-10">
  542.                           <div class="input-group datetime">
  543.                             <input type="text" name="product_option[<?php echo $option_row; ?>][value]" value="<?php echo $product_option['value']; ?>" placeholder="<?php echo $entry_option_value; ?>" data-date-format="YYYY-MM-DD HH:mm" id="input-value<?php echo $option_row; ?>" class="form-control" />
  544.                             <span class="input-group-btn">
  545.                             <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
  546.                             </span></div>
  547.                         </div>
  548.                       </div>
  549.                       <?php } ?>
  550.                       <?php if ($product_option['type'] == 'select' || $product_option['type'] == 'radio' || $product_option['type'] == 'checkbox' || $product_option['type'] == 'image') { ?>
  551.                       <div class="table-responsive">
  552.                         <table id="option-value<?php echo $option_row; ?>" class="table table-striped table-bordered table-hover">
  553.                           <thead>
  554.                             <tr>
  555.                               <td class="text-left"><?php echo $entry_option_value; ?></td>
  556.                               <td class="text-right"><?php echo $entry_quantity; ?></td>
  557.                               <td class="text-left"><?php echo $entry_subtract; ?></td>
  558.                               <td class="text-right"><?php echo $entry_price; ?></td>
  559.                               <td class="text-right"><?php echo $entry_option_points; ?></td>
  560.                               <td class="text-right"><?php echo $entry_weight; ?></td>
  561.                               <td></td>
  562.                             </tr>
  563.                           </thead>
  564.                           <tbody>
  565.                             <?php foreach ($product_option['product_option_value'] as $product_option_value) { ?>
  566.                             <tr id="option-value-row<?php echo $option_value_row; ?>">
  567.                               <td class="text-left"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][option_value_id]" class="form-control">
  568.                                   <?php if (isset($option_values[$product_option['option_id']])) { ?>
  569.                                   <?php foreach ($option_values[$product_option['option_id']] as $option_value) { ?>
  570.                                   <?php if ($option_value['option_value_id'] == $product_option_value['option_value_id']) { ?>
  571.                                   <option value="<?php echo $option_value['option_value_id']; ?>" selected="selected"><?php echo $option_value['name']; ?></option>
  572.                                   <?php } else { ?>
  573.                                   <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?></option>
  574.                                   <?php } ?>
  575.                                   <?php } ?>
  576.                                   <?php } ?>
  577.                                 </select>
  578.                                 <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>
  579.                               <td class="text-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']; ?>" placeholder="<?php echo $entry_quantity; ?>" class="form-control" /></td>
  580.                               <td class="text-left"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][subtract]" class="form-control">
  581.                                   <?php if ($product_option_value['subtract']) { ?>
  582.                                   <option value="1" selected="selected"><?php echo $text_yes; ?></option>
  583.                                   <option value="0"><?php echo $text_no; ?></option>
  584.                                   <?php } else { ?>
  585.                                   <option value="1"><?php echo $text_yes; ?></option>
  586.                                   <option value="0" selected="selected"><?php echo $text_no; ?></option>
  587.                                   <?php } ?>
  588.                                 </select></td>
  589.                               <td class="text-right"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][price_prefix]" class="form-control">
  590.                                   <?php if ($product_option_value['price_prefix'] == '+') { ?>
  591.                                   <option value="+" selected="selected">+</option>
  592.                                   <?php } else { ?>
  593.                                   <option value="+">+</option>
  594.                                   <?php } ?>
  595.                                   <?php if ($product_option_value['price_prefix'] == '-') { ?>
  596.                                   <option value="-" selected="selected">-</option>
  597.                                   <?php } else { ?>
  598.                                   <option value="-">-</option>
  599.                                   <?php } ?>
  600.                                 </select>
  601.                                 <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']; ?>" placeholder="<?php echo $entry_price; ?>" class="form-control" /></td>
  602.                               <td class="text-right"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][points_prefix]" class="form-control">
  603.                                   <?php if ($product_option_value['points_prefix'] == '+') { ?>
  604.                                   <option value="+" selected="selected">+</option>
  605.                                   <?php } else { ?>
  606.                                   <option value="+">+</option>
  607.                                   <?php } ?>
  608.                                   <?php if ($product_option_value['points_prefix'] == '-') { ?>
  609.                                   <option value="-" selected="selected">-</option>
  610.                                   <?php } else { ?>
  611.                                   <option value="-">-</option>
  612.                                   <?php } ?>
  613.                                 </select>
  614.                                 <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']; ?>" placeholder="<?php echo $entry_points; ?>" class="form-control" /></td>
  615.                               <td class="text-right"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][weight_prefix]" class="form-control">
  616.                                   <?php if ($product_option_value['weight_prefix'] == '+') { ?>
  617.                                   <option value="+" selected="selected">+</option>
  618.                                   <?php } else { ?>
  619.                                   <option value="+">+</option>
  620.                                   <?php } ?>
  621.                                   <?php if ($product_option_value['weight_prefix'] == '-') { ?>
  622.                                   <option value="-" selected="selected">-</option>
  623.                                   <?php } else { ?>
  624.                                   <option value="-">-</option>
  625.                                   <?php } ?>
  626.                                 </select>
  627.                                 <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']; ?>" placeholder="<?php echo $entry_weight; ?>" class="form-control" /></td>
  628.                               <td class="text-left"><button type="button" onclick="$(this).tooltip('destroy');$('#option-value-row<?php echo $option_value_row; ?>').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
  629.                             </tr>
  630.                             <?php $option_value_row++; ?>
  631.                             <?php } ?>
  632.                           </tbody>
  633.                           <tfoot>
  634.                             <tr>
  635.                               <td colspan="6"></td>
  636.                               <td class="text-left"><button type="button" onclick="addOptionValue('<?php echo $option_row; ?>');" data-toggle="tooltip" title="<?php echo $button_option_value_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
  637.                             </tr>
  638.                           </tfoot>
  639.                         </table>
  640.                       </div>
  641.                       <select id="option-values<?php echo $option_row; ?>" style="display: none;">
  642.                         <?php if (isset($option_values[$product_option['option_id']])) { ?>
  643.                         <?php foreach ($option_values[$product_option['option_id']] as $option_value) { ?>
  644.                         <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?></option>
  645.                         <?php } ?>
  646.                         <?php } ?>
  647.                       </select>
  648.                       <?php } ?>
  649.                     </div>
  650.                     <?php $option_row++; ?>
  651.                     <?php } ?>
  652.                   </div>
  653.                 </div>
  654.               </div>
  655.             </div>
  656.             <div class="tab-pane" id="tab-recurring">
  657.               <div class="table-responsive">
  658.                 <table class="table table-striped table-bordered table-hover">
  659.                   <thead>
  660.                     <tr>
  661.                       <td class="text-left"><?php echo $entry_recurring; ?></td>
  662.                       <td class="text-left"><?php echo $entry_customer_group; ?></td>
  663.                       <td class="text-left"></td>
  664.                     </tr>
  665.                   </thead>
  666.                   <tbody>
  667.                     <?php $recurring_row = 0; ?>
  668.                     <?php foreach ($product_recurrings as $product_recurring) { ?>
  669.                    
  670.                     <tr id="recurring-row<?php echo $recurring_row; ?>">
  671.                       <td class="text-left"><select name="product_recurring[<?php echo $recurring_row; ?>][recurring_id]" class="form-control">
  672.                           <?php foreach ($recurrings as $recurring) { ?>
  673.                           <?php if ($recurring['recurring_id'] == $product_recurring['recurring_id']) { ?>
  674.                           <option value="<?php echo $recurring['recurring_id']; ?>" selected="selected"><?php echo $recurring['name']; ?></option>
  675.                           <?php } else { ?>
  676.                           <option value="<?php echo $recurring['recurring_id']; ?>"><?php echo $recurring['name']; ?></option>
  677.                           <?php } ?>
  678.                           <?php } ?>
  679.                         </select></td>
  680.                       <td class="text-left"><select name="product_recurring[<?php echo $recurring_row; ?>][customer_group_id]" class="form-control">
  681.                           <?php foreach ($customer_groups as $customer_group) { ?>
  682.                           <?php if ($customer_group['customer_group_id'] == $product_recurring['customer_group_id']) { ?>
  683.                           <option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
  684.                           <?php } else { ?>
  685.                           <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
  686.                           <?php } ?>
  687.                           <?php } ?>
  688.                         </select></td>
  689.                       <td class="text-left"><button type="button" onclick="$('#recurring-row<?php echo $recurring_row; ?>').remove()" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
  690.                     </tr>
  691.                     <?php $recurring_row++; ?>
  692.                     <?php } ?>
  693.                   </tbody>
  694.                   <tfoot>
  695.                     <tr>
  696.                       <td colspan="2"></td>
  697.                       <td class="text-left"><button type="button" onclick="addRecurring()" data-toggle="tooltip" title="<?php echo $button_recurring_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
  698.                     </tr>
  699.                   </tfoot>
  700.                 </table>
  701.               </div>
  702.             </div>
  703.             <div class="tab-pane" id="tab-discount">
  704.               <div class="table-responsive">
  705.                 <table id="discount" class="table table-striped table-bordered table-hover">
  706.                   <thead>
  707.                     <tr>
  708.                       <td class="text-left"><?php echo $entry_customer_group; ?></td>
  709.                       <td class="text-right"><?php echo $entry_quantity; ?></td>
  710.                       <td class="text-right"><?php echo $entry_priority; ?></td>
  711.                       <td class="text-right"><?php echo $entry_price; ?></td>
  712.                       <td class="text-left"><?php echo $entry_date_start; ?></td>
  713.                       <td class="text-left"><?php echo $entry_date_end; ?></td>
  714.                       <td></td>
  715.                     </tr>
  716.                   </thead>
  717.                   <tbody>
  718.                     <?php $discount_row = 0; ?>
  719.                     <?php foreach ($product_discounts as $product_discount) { ?>
  720.                     <tr id="discount-row<?php echo $discount_row; ?>">
  721.                       <td class="text-left"><select name="product_discount[<?php echo $discount_row; ?>][customer_group_id]" class="form-control">
  722.                           <?php foreach ($customer_groups as $customer_group) { ?>
  723.                           <?php if ($customer_group['customer_group_id'] == $product_discount['customer_group_id']) { ?>
  724.                           <option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
  725.                           <?php } else { ?>
  726.                           <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
  727.                           <?php } ?>
  728.                           <?php } ?>
  729.                         </select></td>
  730.                       <td class="text-right"><input type="text" name="product_discount[<?php echo $discount_row; ?>][quantity]" value="<?php echo $product_discount['quantity']; ?>" placeholder="<?php echo $entry_quantity; ?>" class="form-control" /></td>
  731.                       <td class="text-right"><input type="text" name="product_discount[<?php echo $discount_row; ?>][priority]" value="<?php echo $product_discount['priority']; ?>" placeholder="<?php echo $entry_priority; ?>" class="form-control" /></td>
  732.                       <td class="text-right"><input type="text" name="product_discount[<?php echo $discount_row; ?>][price]" value="<?php echo $product_discount['price']; ?>" placeholder="<?php echo $entry_price; ?>" class="form-control" /></td>
  733.                       <td class="text-left" style="width: 20%;"><div class="input-group date">
  734.                           <input type="text" name="product_discount[<?php echo $discount_row; ?>][date_start]" value="<?php echo $product_discount['date_start']; ?>" placeholder="<?php echo $entry_date_start; ?>" data-date-format="YYYY-MM-DD" class="form-control" />
  735.                           <span class="input-group-btn">
  736.                           <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
  737.                           </span></div></td>
  738.                       <td class="text-left" style="width: 20%;"><div class="input-group date">
  739.                           <input type="text" name="product_discount[<?php echo $discount_row; ?>][date_end]" value="<?php echo $product_discount['date_end']; ?>" placeholder="<?php echo $entry_date_end; ?>" data-date-format="YYYY-MM-DD" class="form-control" />
  740.                           <span class="input-group-btn">
  741.                           <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
  742.                           </span></div></td>
  743.                       <td class="text-left"><button type="button" onclick="$('#discount-row<?php echo $discount_row; ?>').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
  744.                     </tr>
  745.                     <?php $discount_row++; ?>
  746.                     <?php } ?>
  747.                   </tbody>
  748.                   <tfoot>
  749.                     <tr>
  750.                       <td colspan="6"></td>
  751.                       <td class="text-left"><button type="button" onclick="addDiscount();" data-toggle="tooltip" title="<?php echo $button_discount_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
  752.                     </tr>
  753.                   </tfoot>
  754.                 </table>
  755.               </div>
  756.             </div>
  757.             <div class="tab-pane" id="tab-special">
  758.               <div class="table-responsive">
  759.                 <table id="special" class="table table-striped table-bordered table-hover">
  760.                   <thead>
  761.                     <tr>
  762.                       <td class="text-left"><?php echo $entry_customer_group; ?></td>
  763.                       <td class="text-right"><?php echo $entry_priority; ?></td>
  764.                       <td class="text-right"><?php echo $entry_price; ?></td>
  765.                       <td class="text-left"><?php echo $entry_date_start; ?></td>
  766.                       <td class="text-left"><?php echo $entry_date_end; ?></td>
  767.                       <td></td>
  768.                     </tr>
  769.                   </thead>
  770.                   <tbody>
  771.                     <?php $special_row = 0; ?>
  772.                     <?php foreach ($product_specials as $product_special) { ?>
  773.                     <tr id="special-row<?php echo $special_row; ?>">
  774.                       <td class="text-left"><select name="product_special[<?php echo $special_row; ?>][customer_group_id]" class="form-control">
  775.                           <?php foreach ($customer_groups as $customer_group) { ?>
  776.                           <?php if ($customer_group['customer_group_id'] == $product_special['customer_group_id']) { ?>
  777.                           <option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
  778.                           <?php } else { ?>
  779.                           <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
  780.                           <?php } ?>
  781.                           <?php } ?>
  782.                         </select></td>
  783.                       <td class="text-right"><input type="text" name="product_special[<?php echo $special_row; ?>][priority]" value="<?php echo $product_special['priority']; ?>" placeholder="<?php echo $entry_quantity; ?>" class="form-control" /></td>
  784.                       <td class="text-right"><input type="text" name="product_special[<?php echo $special_row; ?>][price]" value="<?php echo $product_special['price']; ?>" placeholder="<?php echo $entry_price; ?>" class="form-control" /></td>
  785.                       <td class="text-left" style="width: 20%;"><div class="input-group date">
  786.                           <input type="text" name="product_special[<?php echo $special_row; ?>][date_start]" value="<?php echo $product_special['date_start']; ?>" placeholder="<?php echo $entry_date_start; ?>" data-date-format="YYYY-MM-DD" class="form-control" />
  787.                           <span class="input-group-btn">
  788.                           <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
  789.                           </span></div></td>
  790.                       <td class="text-left" style="width: 20%;"><div class="input-group date">
  791.                           <input type="text" name="product_special[<?php echo $special_row; ?>][date_end]" value="<?php echo $product_special['date_end']; ?>" placeholder="<?php echo $entry_date_end; ?>" data-date-format="YYYY-MM-DD" class="form-control" />
  792.                           <span class="input-group-btn">
  793.                           <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
  794.                           </span></div></td>
  795.                       <td class="text-left"><button type="button" onclick="$('#special-row<?php echo $special_row; ?>').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
  796.                     </tr>
  797.                     <?php $special_row++; ?>
  798.                     <?php } ?>
  799.                   </tbody>
  800.                   <tfoot>
  801.                     <tr>
  802.                       <td colspan="5"></td>
  803.                       <td class="text-left"><button type="button" onclick="addSpecial();" data-toggle="tooltip" title="<?php echo $button_special_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
  804.                     </tr>
  805.                   </tfoot>
  806.                 </table>
  807.               </div>
  808.             </div>
  809.             <div class="tab-pane" id="tab-image">
  810.               <div class="table-responsive">
  811.                 <table id="images" class="table table-striped table-bordered table-hover">
  812.                   <thead>
  813.                     <tr>
  814.                       <td class="text-left"><?php echo $entry_image; ?></td>
  815.                       <td class="text-right"><?php echo $entry_sort_order; ?></td>
  816.                       <td></td>
  817.                     </tr>
  818.                   </thead>
  819.                   <tbody>
  820.                     <?php $image_row = 0; ?>
  821.                     <?php foreach ($product_images as $product_image) { ?>
  822.                     <tr id="image-row<?php echo $image_row; ?>">
  823.                       <td class="text-left"><a href="" id="thumb-image<?php echo $image_row; ?>" data-toggle="image" class="img-thumbnail navtab"><img src="<?php echo $product_image['thumb']; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a><input type="hidden" name="product_image[<?php echo $image_row; ?>][image]" value="<?php echo $product_image['image']; ?>" id="input-image<?php echo $image_row; ?>" /></td>
  824.                       <td class="text-right"><input type="text" name="product_image[<?php echo $image_row; ?>][sort_order]" value="<?php echo $product_image['sort_order']; ?>" placeholder="<?php echo $entry_sort_order; ?>" class="form-control" /></td>
  825.                       <td class="text-left"><button type="button" onclick="$('#image-row<?php echo $image_row; ?>').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
  826.                     </tr>
  827.                     <?php $image_row++; ?>
  828.                     <?php } ?>
  829.                   </tbody>
  830.                   <tfoot>
  831.                     <tr>
  832.                       <td colspan="2"></td>
  833.                       <td class="text-left"><button type="button" onclick="addImage();" data-toggle="tooltip" title="<?php echo $button_image_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
  834.                     </tr>
  835.                   </tfoot>
  836.                 </table>
  837.               </div>
  838.             </div>
  839.             <div class="tab-pane" id="tab-reward">
  840.               <div class="form-group">
  841.                 <label class="col-lg-2 control-label" for="input-points"><span data-toggle="tooltip" title="<?php echo $help_points; ?>"><?php echo $entry_points; ?></span></label>
  842.                 <div class="col-lg-10">
  843.                   <input type="text" name="points" value="<?php echo $points; ?>" placeholder="<?php echo $entry_points; ?>" id="input-points" class="form-control" />
  844.                 </div>
  845.               </div>
  846.               <div class="table-responsive">
  847.                 <table class="table table-bordered table-hover">
  848.                   <thead>
  849.                     <tr>
  850.                       <td class="text-left"><?php echo $entry_customer_group; ?></td>
  851.                       <td class="text-right"><?php echo $entry_reward; ?></td>
  852.                     </tr>
  853.                   </thead>
  854.                   <tbody>
  855.                     <?php foreach ($customer_groups as $customer_group) { ?>
  856.                     <tr>
  857.                       <td class="text-left"><?php echo $customer_group['name']; ?></td>
  858.                       <td class="text-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'] : ''; ?>" class="form-control" /></td>
  859.                     </tr>
  860.                     <?php } ?>
  861.                   </tbody>
  862.                 </table>
  863.               </div>
  864.             </div>
  865.             <div class="tab-pane" id="tab-design">
  866.               <div class="table-responsive">
  867.                 <table class="table table-bordered table-hover">
  868.                   <thead>
  869.                     <tr>
  870.                       <td class="text-left"><?php echo $entry_store; ?></td>
  871.                       <td class="text-left"><?php echo $entry_layout; ?></td>
  872.                     </tr>
  873.                   </thead>
  874.                   <tbody>
  875.                     <tr>
  876.                       <td class="text-left"><?php echo $text_default; ?></td>
  877.                       <td class="text-left"><select name="product_layout[0]" class="form-control">
  878.                           <option value=""></option>
  879.                           <?php foreach ($layouts as $layout) { ?>
  880.                           <?php if (isset($product_layout[0]) && $product_layout[0] == $layout['layout_id']) { ?>
  881.                           <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
  882.                           <?php } else { ?>
  883.                           <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
  884.                           <?php } ?>
  885.                           <?php } ?>
  886.                         </select></td>
  887.                     </tr>
  888.                     <?php foreach ($stores as $store) { ?>
  889.                     <tr>
  890.                       <td class="text-left"><?php echo $store['name']; ?></td>
  891.                       <td class="text-left"><select name="product_layout[<?php echo $store['store_id']; ?>]" class="form-control">
  892.                           <option value=""></option>
  893.                           <?php foreach ($layouts as $layout) { ?>
  894.                           <?php if (isset($product_layout[$store['store_id']]) && $product_layout[$store['store_id']] == $layout['layout_id']) { ?>
  895.                           <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
  896.                           <?php } else { ?>
  897.                           <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
  898.                           <?php } ?>
  899.                           <?php } ?>
  900.                         </select></td>
  901.                     </tr>
  902.                     <?php } ?>
  903.                   </tbody>
  904.                 </table>
  905.               </div>
  906.             </div>
  907.           </div>
  908.         </form>
  909.       </div>
  910.     </div>
  911.   </div>
  912.   <script type="text/javascript"><!--
  913. <?php foreach ($languages as $language) { ?>
  914. $('#input-description<?php echo $language['language_id']; ?>').summernote({height: 300});
  915. <?php } ?>
  916. //--></script>
  917.   <script type="text/javascript"><!--
  918. // Manufacturer
  919. $('input[name=\'manufacturer\']').autocomplete({
  920.     'source': function(request, response) {
  921.         $.ajax({
  922.             url: 'index.php?route=catalog/manufacturer/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request),
  923.             dataType: 'json',          
  924.             success: function(json) {
  925.                 json.unshift({
  926.                     manufacturer_id: 0,
  927.                     name: '<?php echo $text_none; ?>'
  928.                 });
  929.                
  930.                 response($.map(json, function(item) {
  931.                     return {
  932.                         label: item['name'],
  933.                         value: item['manufacturer_id']
  934.                     }
  935.                 }));
  936.             }
  937.         });
  938.     },
  939.     'select': function(item) {
  940.         $('input[name=\'manufacturer\']').val(item['label']);
  941.         $('input[name=\'manufacturer_id\']').val(item['value']);
  942.     }  
  943. });
  944.  
  945. // Category
  946. $('input[name=\'category\']').autocomplete({
  947.     'source': function(request, response) {
  948.         $.ajax({
  949.             url: 'index.php?route=catalog/category/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request),
  950.             dataType: 'json',          
  951.             success: function(json) {
  952.                 response($.map(json, function(item) {
  953.                     return {
  954.                         label: item['name'],
  955.                         value: item['category_id']
  956.                     }
  957.                 }));
  958.             }
  959.         });
  960.     },
  961.     'select': function(item) {
  962.         $('input[name=\'category\']').val('');
  963.        
  964.         $('#product-category' + item['value']).remove();
  965.        
  966.         $('#product-category').append('<div id="product-category' + item['value'] + '"><i class="fa fa-minus-circle"></i> ' + item['label'] + '<input type="hidden" name="product_category[]" value="' + item['value'] + '" /></div>');
  967.     }
  968. });
  969.  
  970. $('#product-category').delegate('.fa-minus-circle', 'click', function() {
  971.     $(this).parent().remove();
  972. });
  973.  
  974. // Filter
  975. $('input[name=\'filter\']').autocomplete({
  976.     'source': function(request, response) {
  977.         $.ajax({
  978.             url: 'index.php?route=catalog/filter/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request),
  979.             dataType: 'json',          
  980.             success: function(json) {
  981.                 response($.map(json, function(item) {
  982.                     return {
  983.                         label: item['name'],
  984.                         value: item['filter_id']
  985.                     }
  986.                 }));
  987.             }
  988.         });
  989.     },
  990.     'select': function(item) {
  991.         $('input[name=\'filter\']').val('');
  992.        
  993.         $('#product-filter' + item['value']).remove();
  994.        
  995.         $('#product-filter').append('<div id="product-filter' + item['value'] + '"><i class="fa fa-minus-circle"></i> ' + item['label'] + '<input type="hidden" name="product_filter[]" value="' + item['value'] + '" /></div>');  
  996.     }  
  997. });
  998.  
  999. $('#product-filter').delegate('.fa-minus-circle', 'click', function() {
  1000.     $(this).parent().remove();
  1001. });
  1002.  
  1003. // Downloads
  1004. $('input[name=\'download\']').autocomplete({
  1005.     'source': function(request, response) {
  1006.         $.ajax({
  1007.             url: 'index.php?route=catalog/download/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request),
  1008.             dataType: 'json',          
  1009.             success: function(json) {
  1010.                 response($.map(json, function(item) {
  1011.                     return {
  1012.                         label: item['name'],
  1013.                         value: item['download_id']
  1014.                     }
  1015.                 }));
  1016.             }
  1017.         });
  1018.     },
  1019.     'select': function(item) {
  1020.         $('input[name=\'download\']').val('');
  1021.        
  1022.         $('#product-download' + item['value']).remove();
  1023.        
  1024.         $('#product-download').append('<div id="product-download' + item['value'] + '"><i class="fa fa-minus-circle"></i> ' + item['label'] + '<input type="hidden" name="product_download[]" value="' + item['value'] + '" /></div>');
  1025.     }  
  1026. });
  1027.  
  1028. $('#product-download').delegate('.fa-minus-circle', 'click', function() {
  1029.     $(this).parent().remove();
  1030. });
  1031.  
  1032. // Related
  1033. $('input[name=\'related\']').autocomplete({
  1034.     'source': function(request, response) {
  1035.         $.ajax({
  1036.             url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request),
  1037.             dataType: 'json',          
  1038.             success: function(json) {
  1039.                 response($.map(json, function(item) {
  1040.                     return {
  1041.                         label: item['name'],
  1042.                         value: item['product_id']
  1043.                     }
  1044.                 }));
  1045.             }
  1046.         });
  1047.     },
  1048.     'select': function(item) {
  1049.         $('input[name=\'related\']').val('');
  1050.        
  1051.         $('#product-related' + item['value']).remove();
  1052.        
  1053.         $('#product-related').append('<div id="product-related' + item['value'] + '"><i class="fa fa-minus-circle"></i> ' + item['label'] + '<input type="hidden" name="product_related[]" value="' + item['value'] + '" /></div>');   
  1054.     }  
  1055. });
  1056.  
  1057. $('#product-related').delegate('.fa-minus-circle', 'click', function() {
  1058.     $(this).parent().remove();
  1059. });
  1060. //--></script>
  1061.   <script type="text/javascript"><!--
  1062. var attribute_row = <?php echo $attribute_row; ?>;
  1063.  
  1064. function addAttribute() {
  1065.     html  = '<tr id="attribute-row' + attribute_row + '">';
  1066.     html += '  <td class="text-left" style="width: 20%;"><input type="text" name="product_attribute[' + attribute_row + '][name]" value="" placeholder="<?php echo $entry_attribute; ?>" class="form-control" /><input type="hidden" name="product_attribute[' + attribute_row + '][attribute_id]" value="" /></td>';
  1067.     html += '  <td class="text-left">';
  1068.     <?php foreach ($languages as $language) { ?>
  1069.     html += '<div class="input-group"><span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /></span><textarea name="product_attribute[' + attribute_row + '][product_attribute_description][<?php echo $language['language_id']; ?>][text]" rows="5" placeholder="<?php echo $entry_text; ?>" class="form-control"></textarea></div>';
  1070.     <?php } ?>
  1071.     html += '  </td>';
  1072.     html += '  <td class="text-left"><button type="button" onclick="$(\'#attribute-row' + attribute_row + '\').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
  1073.     html += '</tr>';
  1074.    
  1075.     $('#attribute tbody').append(html);
  1076.    
  1077.     attributeautocomplete(attribute_row);
  1078.    
  1079.     attribute_row++;
  1080. }
  1081.  
  1082. function attributeautocomplete(attribute_row) {
  1083.     $('input[name=\'product_attribute[' + attribute_row + '][name]\']').autocomplete({
  1084.         'source': function(request, response) {
  1085.             $.ajax({
  1086.                 url: 'index.php?route=catalog/attribute/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request),
  1087.                 dataType: 'json',          
  1088.                 success: function(json) {
  1089.                     response($.map(json, function(item) {
  1090.                         return {
  1091.                             category: item.attribute_group,
  1092.                             label: item.name,
  1093.                             value: item.attribute_id
  1094.                         }
  1095.                     }));
  1096.                 }
  1097.             });
  1098.         },
  1099.         'select': function(item) {
  1100.             $('input[name=\'product_attribute[' + attribute_row + '][name]\']').val(item['label']);
  1101.             $('input[name=\'product_attribute[' + attribute_row + '][attribute_id]\']').val(item['value']);
  1102.         }
  1103.     });
  1104. }
  1105.  
  1106. $('#attribute tbody tr').each(function(index, element) {
  1107.     attributeautocomplete(index);
  1108. });
  1109. //--></script>
  1110.   <script type="text/javascript"><!--  
  1111. var option_row = <?php echo $option_row; ?>;
  1112.  
  1113. $('input[name=\'option\']').autocomplete({
  1114.     'source': function(request, response) {
  1115.         $.ajax({
  1116.             url: 'index.php?route=catalog/option/autocomplete&filter_name=' +  encodeURIComponent(request),
  1117.             dataType: 'json',          
  1118.             success: function(json) {
  1119.                 response($.map(json, function(item) {
  1120.                     return {
  1121.            
  1122.                         category: item['category'],
  1123.                         label: item['name'],
  1124.                         value: item['option_id'],
  1125.                         type: item['type'],
  1126.                         option_value: item['option_value']
  1127.                     }
  1128.                 }));
  1129.             }
  1130.         });
  1131.     },
  1132.     'select': function(item) {
  1133.         html  = '<div class="tab-pane" id="tab-option' + option_row + '">';
  1134.         html += '   <input type="hidden" name="product_option[' + option_row + '][product_option_id]" value="" />';
  1135.         html += '   <input type="hidden" name="product_option[' + option_row + '][name]" value="' + item['label'] + '" />';
  1136.         html += '   <input type="hidden" name="product_option[' + option_row + '][option_id]" value="' + item['value'] + '" />';
  1137.         html += '   <input type="hidden" name="product_option[' + option_row + '][type]" value="' + item['type'] + '" />';
  1138.        
  1139.         html += '   <div class="form-group">';
  1140.         html += '     <label class="col-sm-2 control-label" for="input-required' + option_row + '"><?php echo $entry_required; ?></label>';
  1141.         html += '     <div class="col-sm-10"><select name="product_option[' + option_row + '][required]" id="input-required' + option_row + '" class="form-control">';
  1142.         html += '         <option value="1"><?php echo $text_yes; ?></option>';
  1143.         html += '         <option value="0"><?php echo $text_no; ?></option>';
  1144.         html += '     </select></div>';
  1145.         html += '   </div>';
  1146.        
  1147.         if (item['type'] == 'text') {
  1148.             html += '   <div class="form-group">';
  1149.             html += '     <label class="col-sm-2 control-label" for="input-value' + option_row + '"><?php echo $entry_option_value; ?></label>';
  1150.             html += '     <div class="col-sm-10"><input type="text" name="product_option[' + option_row + '][value]" value="" placeholder="<?php echo $entry_option_value; ?>" id="input-value' + option_row + '" class="form-control" /></div>';
  1151.             html += '   </div>';
  1152.         }
  1153.        
  1154.         if (item['type'] == 'textarea') {
  1155.             html += '   <div class="form-group">';
  1156.             html += '     <label class="col-sm-2 control-label" for="input-value' + option_row + '"><?php echo $entry_option_value; ?></label>';
  1157.             html += '     <div class="col-sm-10"><textarea name="product_option[' + option_row + '][value]" rows="5" placeholder="<?php echo $entry_option_value; ?>" id="input-value' + option_row + '" class="form-control"></textarea></div>';
  1158.             html += '   </div>';           
  1159.         }
  1160.          
  1161.         if (item['type'] == 'file') {
  1162.             html += '   <div class="form-group" style="display: none;">';
  1163.             html += '     <label class="col-sm-2 control-label" for="input-value' + option_row + '"><?php echo $entry_option_value; ?></label>';
  1164.             html += '     <div class="col-sm-10"><input type="text" name="product_option[' + option_row + '][value]" value="" placeholder="<?php echo $entry_option_value; ?>" id="input-value' + option_row + '" class="form-control" /></div>';
  1165.             html += '   </div>';
  1166.         }
  1167.                        
  1168.         if (item['type'] == 'date') {
  1169.             html += '   <div class="form-group">';
  1170.             html += '     <label class="col-sm-2 control-label" for="input-value' + option_row + '"><?php echo $entry_option_value; ?></label>';
  1171.             html += '     <div class="col-sm-3"><div class="input-group date"><input type="text" name="product_option[' + option_row + '][value]" value="" placeholder="<?php echo $entry_option_value; ?>" data-date-format="YYYY-MM-DD" id="input-value' + option_row + '" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></div>';
  1172.             html += '   </div>';
  1173.         }
  1174.        
  1175.         if (item['type'] == 'time') {
  1176.             html += '   <div class="form-group">';
  1177.             html += '     <label class="col-sm-2 control-label" for="input-value' + option_row + '"><?php echo $entry_option_value; ?></label>';
  1178.             html += '     <div class="col-sm-10"><div class="input-group time"><input type="text" name="product_option[' + option_row + '][value]" value="" placeholder="<?php echo $entry_option_value; ?>" data-date-format="HH:mm" id="input-value' + option_row + '" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></div>';
  1179.             html += '   </div>';
  1180.         }
  1181.                
  1182.         if (item['type'] == 'datetime') {
  1183.             html += '   <div class="form-group">';
  1184.             html += '     <label class="col-sm-2 control-label" for="input-value' + option_row + '"><?php echo $entry_option_value; ?></label>';
  1185.             html += '     <div class="col-sm-10"><div class="input-group datetime"><input type="text" name="product_option[' + option_row + '][value]" value="" placeholder="<?php echo $entry_option_value; ?>" data-date-format="YYYY-MM-DD HH:mm" id="input-value' + option_row + '" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></div>';
  1186.             html += '   </div>';
  1187.         }
  1188.            
  1189.         if (item['type'] == 'select' || item['type'] == 'radio' || item['type'] == 'checkbox' || item['type'] == 'image') {
  1190.             html += '<div class="table-responsive">';
  1191.             html += '  <table id="option-value' + option_row + '" class="table table-striped table-bordered table-hover">';
  1192.             html += '    <thead>';
  1193.             html += '      <tr>';
  1194.             html += '        <td class="text-left"><?php echo $entry_option_value; ?></td>';
  1195.             html += '        <td class="text-right"><?php echo $entry_quantity; ?></td>';
  1196.             html += '        <td class="text-left"><?php echo $entry_subtract; ?></td>';
  1197.             html += '        <td class="text-right"><?php echo $entry_price; ?></td>';
  1198.             html += '        <td class="text-right"><?php echo $entry_option_points; ?></td>';
  1199.             html += '        <td class="text-right"><?php echo $entry_weight; ?></td>';
  1200.             html += '        <td></td>';
  1201.             html += '      </tr>';
  1202.             html += '    </thead>';
  1203.             html += '    <tbody>';
  1204.             html += '    </tbody>';
  1205.             html += '    <tfoot>';
  1206.             html += '      <tr>';
  1207.             html += '        <td colspan="6"></td>';
  1208.             html += '        <td class="text-left"><button type="button" onclick="addOptionValue(' + option_row + ');" data-toggle="tooltip" title="<?php echo $button_option_value_add; ?>" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>';
  1209.             html += '      </tr>';
  1210.             html += '    </tfoot>';
  1211.             html += '  </table>';
  1212.             html += '</div>';
  1213.            
  1214.             html += '  <select id="option-values' + option_row + '" style="display: none;">';
  1215.            
  1216.             for (i = 0; i < item['option_value'].length; i++) {
  1217.                 html += '  <option value="' + item['option_value'][i]['option_value_id'] + '">' + item['option_value'][i]['name'] + '</option>';
  1218.             }
  1219.  
  1220.             html += '  </select>'; 
  1221.             html += '</div>';  
  1222.         }
  1223.        
  1224.         $('#tab-option .tab-content').append(html);
  1225.            
  1226.         $('#option > li:last-child').before('<li><a href="#tab-option' + option_row + '" class="navtab" data-toggle="tab"><i class="fa fa-minus-circle" onclick="$(\'a[href=\\\'#tab-option' + option_row + '\\\']\').parent().remove(); $(\'#tab-option' + option_row + '\').remove(); $(\'#option a:first\').tab(\'show\')"></i> ' + item['label'] + '</li>');
  1227.        
  1228.         $('#option a[href=\'#tab-option' + option_row + '\']').tab('show');
  1229.        
  1230.         $('.date').datetimepicker({
  1231.             pickTime: false
  1232.         });
  1233.        
  1234.         $('.time').datetimepicker({
  1235.             pickDate: false
  1236.         });
  1237.        
  1238.         $('.datetime').datetimepicker({
  1239.             pickDate: true,
  1240.             pickTime: true
  1241.         });
  1242.                
  1243.         option_row++;
  1244.     }  
  1245. });
  1246. //--></script>
  1247.   <script type="text/javascript"><!--      
  1248. var option_value_row = <?php echo $option_value_row; ?>;
  1249.  
  1250. function addOptionValue(option_row) {  
  1251.     html  = '<tr id="option-value-row' + option_value_row + '">';
  1252.     html += '  <td class="text-left"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][option_value_id]" class="form-control">';
  1253.     html += $('#option-values' + option_row).html();
  1254.     html += '  </select><input type="hidden" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][product_option_value_id]" value="" /></td>';
  1255.     html += '  <td class="text-right"><input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][quantity]" value="" placeholder="<?php echo $entry_quantity; ?>" class="form-control" /></td>';
  1256.     html += '  <td class="text-left"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][subtract]" class="form-control">';
  1257.     html += '    <option value="1"><?php echo $text_yes; ?></option>';
  1258.     html += '    <option value="0"><?php echo $text_no; ?></option>';
  1259.     html += '  </select></td>';
  1260.     html += '  <td class="text-right"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][price_prefix]" class="form-control">';
  1261.     html += '    <option value="+">+</option>';
  1262.     html += '    <option value="-">-</option>';
  1263.     html += '  </select>';
  1264.     html += '  <input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][price]" value="" placeholder="<?php echo $entry_price; ?>" class="form-control" /></td>';
  1265.     html += '  <td class="text-right"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][points_prefix]" class="form-control">';
  1266.     html += '    <option value="+">+</option>';
  1267.     html += '    <option value="-">-</option>';
  1268.     html += '  </select>';
  1269.     html += '  <input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][points]" value="" placeholder="<?php echo $entry_points; ?>" class="form-control" /></td>'; 
  1270.     html += '  <td class="text-right"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][weight_prefix]" class="form-control">';
  1271.     html += '    <option value="+">+</option>';
  1272.     html += '    <option value="-">-</option>';
  1273.     html += '  </select>';
  1274.     html += '  <input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][weight]" value="" placeholder="<?php echo $entry_weight; ?>" class="form-control" /></td>';
  1275.     html += '  <td class="text-left"><button type="button" onclick="$(this).tooltip(\'destroy\');$(\'#option-value-row' + option_value_row + '\').remove();" data-toggle="tooltip" rel="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
  1276.     html += '</tr>';
  1277.    
  1278.     $('#option-value' + option_row + ' tbody').append(html);
  1279.         $('[rel=tooltip]').tooltip();
  1280.        
  1281.     option_value_row++;
  1282. }
  1283. //--></script>
  1284.   <script type="text/javascript"><!--
  1285. var discount_row = <?php echo $discount_row; ?>;
  1286.  
  1287. function addDiscount() {
  1288.     html  = '<tr id="discount-row' + discount_row + '">';
  1289.     html += '  <td class="text-left"><select name="product_discount[' + discount_row + '][customer_group_id]" class="form-control">';
  1290.     <?php foreach ($customer_groups as $customer_group) { ?>
  1291.     html += '    <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo addslashes($customer_group['name']); ?></option>';
  1292.     <?php } ?>
  1293.     html += '  </select></td>';    
  1294.     html += '  <td class="text-right"><input type="text" name="product_discount[' + discount_row + '][quantity]" value="" placeholder="<?php echo $entry_quantity; ?>" class="form-control" /></td>';
  1295.     html += '  <td class="text-right"><input type="text" name="product_discount[' + discount_row + '][priority]" value="" placeholder="<?php echo $entry_priority; ?>" class="form-control" /></td>';
  1296.     html += '  <td class="text-right"><input type="text" name="product_discount[' + discount_row + '][price]" value="" placeholder="<?php echo $entry_price; ?>" class="form-control" /></td>';
  1297.     html += '  <td class="text-left"><div class="input-group date"><input type="text" name="product_discount[' + discount_row + '][date_start]" value="" placeholder="<?php echo $entry_date_start; ?>" data-date-format="YYYY-MM-DD" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></td>';
  1298.     html += '  <td class="text-left"><div class="input-group date"><input type="text" name="product_discount[' + discount_row + '][date_end]" value="" placeholder="<?php echo $entry_date_end; ?>" data-date-format="YYYY-MM-DD" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></td>';
  1299.     html += '  <td class="text-left"><button type="button" onclick="$(\'#discount-row' + discount_row + '\').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
  1300.     html += '</tr>';   
  1301.    
  1302.     $('#discount tbody').append(html);
  1303.  
  1304.     $('.date').datetimepicker({
  1305.         pickTime: false
  1306.     });
  1307.    
  1308.     discount_row++;
  1309. }
  1310. //--></script>
  1311.   <script type="text/javascript"><!--
  1312. var special_row = <?php echo $special_row; ?>;
  1313.  
  1314. function addSpecial() {
  1315.     html  = '<tr id="special-row' + special_row + '">';
  1316.     html += '  <td class="text-left"><select name="product_special[' + special_row + '][customer_group_id]" class="form-control">';
  1317.     <?php foreach ($customer_groups as $customer_group) { ?>
  1318.     html += '      <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo addslashes($customer_group['name']); ?></option>';
  1319.     <?php } ?>
  1320.     html += '  </select></td>';    
  1321.     html += '  <td class="text-right"><input type="text" name="product_special[' + special_row + '][priority]" value="" placeholder="<?php echo $entry_priority; ?>" class="form-control" /></td>';
  1322.     html += '  <td class="text-right"><input type="text" name="product_special[' + special_row + '][price]" value="" placeholder="<?php echo $entry_price; ?>" class="form-control" /></td>';
  1323.     html += '  <td class="text-left" style="width: 20%;"><div class="input-group date"><input type="text" name="product_special[' + special_row + '][date_start]" value="" placeholder="<?php echo $entry_date_start; ?>" data-date-format="YYYY-MM-DD" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></td>';
  1324.     html += '  <td class="text-left" style="width: 20%;"><div class="input-group date"><input type="text" name="product_special[' + special_row + '][date_end]" value="" placeholder="<?php echo $entry_date_end; ?>" data-date-format="YYYY-MM-DD" class="form-control" /><span class="input-group-btn"><button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button></span></div></td>';
  1325.     html += '  <td class="text-left"><button type="button" onclick="$(\'#special-row' + special_row + '\').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
  1326.     html += '</tr>';
  1327.    
  1328.     $('#special tbody').append(html);
  1329.  
  1330.     $('.date').datetimepicker({
  1331.         pickTime: false
  1332.     });
  1333.        
  1334.     special_row++;
  1335. }
  1336. //--></script>
  1337.   <script type="text/javascript"><!--
  1338. var image_row = <?php echo $image_row; ?>;
  1339.  
  1340. function addImage() {
  1341.     html  = '<tr id="image-row' + image_row + '">';
  1342.     html += '  <td class="text-left"><a href="" id="thumb-image' + image_row + '"data-toggle="image" class="img-thumbnail navtab"><img src="<?php echo $placeholder; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /><input type="hidden" name="product_image[' + image_row + '][image]" value="" id="input-image' + image_row + '" /></td>';
  1343.     html += '  <td class="text-right"><input type="text" name="product_image[' + image_row + '][sort_order]" value="" placeholder="<?php echo $entry_sort_order; ?>" class="form-control" /></td>';
  1344.     html += '  <td class="text-left"><button type="button" onclick="$(\'#image-row' + image_row  + '\').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
  1345.     html += '</tr>';
  1346.    
  1347.     $('#images tbody').append(html);
  1348.    
  1349.     image_row++;
  1350. }
  1351. //--></script>
  1352.   <script type="text/javascript"><!--
  1353. var recurring_row = <?php echo $recurring_row; ?>;
  1354.  
  1355. function addRecurring() {
  1356.     recurring_row++;
  1357.    
  1358.     html  = '';
  1359.     html += '<tr id="recurring-row' + recurring_row + '">';
  1360.     html += '  <td class="left">';
  1361.     html += '    <select name="product_recurring[' + recurring_row + '][recurring_id]" class="form-control">>';
  1362.     <?php foreach ($recurrings as $recurring) { ?>
  1363.     html += '      <option value="<?php echo $recurring['recurring_id']; ?>"><?php echo $recurring['name']; ?></option>';
  1364.     <?php } ?>
  1365.     html += '    </select>';
  1366.     html += '  </td>';
  1367.     html += '  <td class="left">';
  1368.     html += '    <select name="product_recurring[' + recurring_row + '][customer_group_id]" class="form-control">>';
  1369.     <?php foreach ($customer_groups as $customer_group) { ?>
  1370.     html += '      <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>';
  1371.     <?php } ?>
  1372.     html += '    <select>';
  1373.     html += '  </td>';
  1374.     html += '  <td class="left">';
  1375.     html += '    <a onclick="$(\'#recurring-row' + recurring_row + '\').remove()" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></a>';
  1376.     html += '  </td>';
  1377.     html += '</tr>';
  1378.    
  1379.     $('#tab-recurring table tbody').append(html);
  1380. }
  1381. //--></script>
  1382.   <script type="text/javascript"><!--
  1383. $('.date').datetimepicker({
  1384.     pickTime: false
  1385. });
  1386.  
  1387. $('.time').datetimepicker({
  1388.     pickDate: false
  1389. });
  1390.  
  1391. $('.datetime').datetimepicker({
  1392.     pickDate: true,
  1393.     pickTime: true
  1394. });
  1395. //--></script>
  1396.   <script type="text/javascript"><!--
  1397. $('#language a:first').tab('show');
  1398. $('#option a:first').tab('show');
  1399. //--></script></div>
  1400. <script>
  1401. $("#products").on("click", "a:not(.navtab, #)", function (e) {
  1402.     $("#products").load($(this).attr("href"));
  1403.     e.preventDefault();
  1404. });
  1405. </script>
  1406.  
  1407.  
  1408.  
  1409. <?php echo $footer; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement