Advertisement
Guest User

product_form.tpl

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