<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <?php if ($success) { ?>
  <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
<style type="text/css">		
.focusField {
	color: #000;
	border: solid 2px #EEEEEE !important;
	background: #FFEEEE !important;
}
.editable {
	color: #000;
	border: 1px solid #ccc;	
	background: none;
	cursor: pointer;
}
</style>
      <h1><img src="view/image/product.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a target="_blank" href="<?php echo $insert; ?>" class="button"><?php echo $button_insert; ?></a><a onclick="$('#form').attr('action', '<?php echo $edit_list; ?>'); $('#form').submit();" class="button"><?php echo $button_edit_list; ?></a><a onclick="$('#form').attr('action', '<?php echo $copy; ?>'); $('#form').submit();" class="button"><?php echo $button_copy; ?></a><a onclick="$('form').submit();" class="button"><?php echo $button_delete; ?></a></div>
    </div>
    <div class="content">
<div class="row">
			<div class="col-sm-12">
			<form action="<?php echo $delete; ?>" method="post" enctype="multipart/form-data" id="form_chk_column">
				<label for="input-name" class="control-label">Editable Fields</label>
				<input type="checkbox" onclick="$('.editable_fields input[type*=\'checkbox\']').prop('checked', this.checked);" /> Select All 
				<button type="button" data-toggle="tooltip" onclick="$('#form_chk_column').attr('action', '<?php echo $edit_list_column; ?>'); $('#form_chk_column').submit();" class="btn btn-primary btn-sm"><i class="fa fa-retweet"></i><?php echo ' Save Selected Checkbox'; ?></button>
				<div class="form-group editable_fields">
					
					
					<div class="col-sm-2-cust">
						<p><input type="checkbox" name="img_edit" <?php if(isset($cache_data['img_edit']) == 'on') { echo  'checked="checked"'; } ?> /> Image</p>
						<p><input type="checkbox" name="product_name_edit" checked="checked" /> Product Name</p>
						<p><input type="checkbox" name="desc_edit"  <?php if(isset($cache_data['desc_edit']) == 'on') { echo  'checked="checked"'; } ?> /> Product Description</p>
						<?php /* ?><p><input type="checkbox" name="meta_title_edit"  /> Meta Title</p><?php */ ?>
						<p><input type="checkbox" name="meta_desc_edit"  <?php if(isset($cache_data['meta_desc_edit']) == 'on') { echo  'checked="checked"'; } ?> /> Meta Description</p>
						<p><input type="checkbox" name="meta_keyword_edit"  <?php if(isset($cache_data['meta_keyword_edit']) == 'on') { echo  'checked="checked"'; } ?> /> Meta Keyword</p>
						<p><input type="checkbox" name="tag_edit"  <?php if(isset($cache_data['tag_edit']) == 'on') { echo  'checked="checked"'; } ?> /> Product Tags</p>
					</div>
					<div class="col-sm-2-cust">
						<p><input type="checkbox" name="model_edit" checked="checked" /> Model</p>
						<p><input type="checkbox" name="price_edit" checked="checked" /> Price</p>
						<p><input type="checkbox" name="qty_edit" checked="checked" /> Quantity</p>
						<p><input type="checkbox" name="status_edit" checked="checked" /> Status</p>
						<p><input type="checkbox" name="sku_edit" <?php if(isset($cache_data['sku_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> SKU</p>
						<p><input type="checkbox" name="upc_edit" <?php if(isset($cache_data['upc_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> UPC</p>
						<p><input type="checkbox" name="ean_edit" <?php if(isset($cache_data['ean_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> EAN</p>
					</div>
					<div class="col-sm-2-cust">
						<p><input type="checkbox" name="jan_edit" <?php if(isset($cache_data['jan_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> JAN</p>
						<p><input type="checkbox" name="isbn_edit" <?php if(isset($cache_data['isbn_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> ISBN</p>
						<p><input type="checkbox" name="mpn_edit" <?php if(isset($cache_data['mpn_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> MPN</p>
						<p><input type="checkbox" name="location_edit" <?php if(isset($cache_data['location_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Location</p>
						<p><input type="checkbox" name="category_edit" <?php if(isset($cache_data['category_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Categories</p>
						<p><input type="checkbox" name="filter_edit" <?php if(isset($cache_data['filter_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Filter</p>
						<p><input type="checkbox" name="download_edit" <?php if(isset($cache_data['download_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Download</p>
					</div>
					<div class="col-sm-2-cust">
						<p><input type="checkbox" name="manufacturer_edit" <?php if(isset($cache_data['manufacturer_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Manufacturer</p>
						<p><input type="checkbox" name="related_prod_edit" <?php if(isset($cache_data['related_prod_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Related Products</p>
						<p><input type="checkbox" name="taxclass_edit" <?php if(isset($cache_data['taxclass_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> TAX Class</p>
						<p><input type="checkbox" name="min_qty_edit" <?php if(isset($cache_data['min_qty_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Minimum Quantity</p>
						<p><input type="checkbox" name="requiresshipping_edit" <?php if(isset($cache_data['requiresshipping_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Requires Shipping</p>
						<p><input type="checkbox" name="seokeyword_edit" <?php if(isset($cache_data['seokeyword_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> SEO Keyword</p>
						<p><input type="checkbox" name="subtract_edit" <?php if(isset($cache_data['subtract_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Subtract Stock</p>
					</div>
					<div class="col-sm-2-cust">
						<p><input type="checkbox" name="dimension_edit" <?php if(isset($cache_data['dimension_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Dimension (L x W x H)</p>
						<p><input type="checkbox" name="length_edit" <?php if(isset($cache_data['length_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Length Class</p>
						<p><input type="checkbox" name="weight_edit" <?php if(isset($cache_data['weight_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Weight</p>
						<p><input type="checkbox" name="weight_class_edit" <?php if(isset($cache_data['weight_class_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Weight Class</p>
						<p><input type="checkbox" name="date_avilable_edit" <?php if(isset($cache_data['date_avilable_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Date Available</p>
						<p><input type="checkbox" name="sort_order_edit" <?php if(isset($cache_data['sort_order_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Sort Order</p>
						<p><input type="checkbox" name="view_edit" <?php if(isset($cache_data['view_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Product Viewed</p>
					</div>
					<div class="col-sm-2-cust">
						<p><input type="checkbox" name="points_edit" <?php if(isset($cache_data['points_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Points</p>
						<p><input type="checkbox" name="stock_status_edit" <?php if(isset($cache_data['stock_status_edit']) == 'on') { echo  'checked="checked"'; } ?>  /> Stock Status</p>	
					</div>
					<script type="text/javascript">
						$("input:checkbox:not(:checked)").each(function() {
							var column = "table ." + $(this).attr("name");
							$(column).hide();
						});

						$("input:checkbox").click(function(){
							var column = "table ." + $(this).attr("name");
							$(column).toggle();
						});
					</script>
				</div>
		</form>
			</div>
		</div>
      <form action="<?php echo $delete; ?>" method="post" enctype="multipart/form-data" id="form">
        <table class="list">
          <thead>
            <tr>
              <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
              <td class="center img_edit" style="<?php if(isset($cache_data['img_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"><?php echo $column_image; ?></td>
              <td class="left product_name_edit"><?php if ($sort == 'pd.name') { ?>
                <a href="<?php echo $sort_name; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_name; ?></a>
                <?php } else { ?>
                <a href="<?php echo $sort_name; ?>"><?php echo $column_name; ?></a>
                <?php } ?></td>
<td class="left desc_edit" style="<?php if(isset($cache_data['desc_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_description; ?></td>
		<td class="left meta_title_edit" style="<?php if(isset($cache_data['meta_title_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_meta_title; ?></td>
		<td class="left meta_desc_edit" style="<?php if(isset($cache_data['meta_desc_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_meta_description; ?></td>
		<td class="left meta_keyword_edit" style="<?php if(isset($cache_data['meta_keyword_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_meta_keyword; ?></td>
		<td class="left tag_edit" style="<?php if(isset($cache_data['tag_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_tag; ?></td>
              <td class="left model_edit"><?php if ($sort == 'p.model') { ?>
                <a href="<?php echo $sort_model; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_model; ?></a>
                <?php } else { ?>
                <a href="<?php echo $sort_model; ?>"><?php echo $column_model; ?></a>
                <?php } ?></td>
<td class="left sku_edit" style="<?php if(isset($cache_data['sku_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_sku; ?></td>
					<td class="left upc_edit" style="<?php if(isset($cache_data['upc_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_upc; ?></td>
					<td class="left ean_edit" style="<?php if(isset($cache_data['ean_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_ean; ?></td>
					<td class="left jan_edit" style="<?php if(isset($cache_data['jan_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_jan; ?></td>
					<td class="left isbn_edit" style="<?php if(isset($cache_data['isbn_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_isbn; ?></td>
					<td class="left mpn_edit" style="<?php if(isset($cache_data['mpn_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_mpn; ?></td>
					<td class="left location_edit" style="<?php if(isset($cache_data['location_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_location; ?></td>
					<td class="left category_edit" style="<?php if(isset($cache_data['category_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_category; ?></td>
					<td class="left filter_edit" style="<?php if(isset($cache_data['filter_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_filter; ?></td>
					<td class="left download_edit" style="<?php if(isset($cache_data['download_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_download; ?></td>
					<td class="left manufacturer_edit" style="<?php if(isset($cache_data['manufacturer_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_manufacturer; ?></td>
					<td class="left related_prod_edit" style="<?php if(isset($cache_data['related_prod_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_related; ?></td>
					<td class="left taxclass_edit" style="<?php if(isset($cache_data['taxclass_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_tax_class; ?></td>
					<td class="left min_qty_edit" style="<?php if(isset($cache_data['min_qty_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_minimum; ?></td>
					<td class="left subtract_edit" style="<?php if(isset($cache_data['subtract_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_subtract; ?></td>
					<td class="left stock_status_edit" style="<?php if(isset($cache_data['stock_status_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_stock_status; ?></td>
					<td class="left requiresshipping_edit" style="<?php if(isset($cache_data['requiresshipping_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_shipping; ?></td>
					<td class="left seokeyword_edit" style="<?php if(isset($cache_data['seokeyword_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_keyword; ?></td>
					<td class="left date_avilable_edit" style="<?php if(isset($cache_data['date_avilable_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_date_available; ?></td>
					<td class="left dimension_edit" style="<?php if(isset($cache_data['dimension_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_dimension; ?></td>
					<td class="left length_edit" style="<?php if(isset($cache_data['length_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_length; ?></td>
					<td class="left weight_edit" style="<?php if(isset($cache_data['weight_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_weight; ?></td>
					<td class="left weight_class_edit" style="<?php if(isset($cache_data['weight_class_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_weight_class; ?></td>
					<td class="left sort_order_edit" style="<?php if(isset($cache_data['sort_order_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_sort_order; ?></td>
					<td class="left view_edit" style="<?php if(isset($cache_data['view_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_product_viewed; ?></td>
					<td class="left points_edit" style="<?php if(isset($cache_data['points_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>" ><?php echo $entry_points; ?></td>
			
              <td class="left price_edit"><?php if ($sort == 'p.price') { ?>
                <a href="<?php echo $sort_price; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_price; ?></a>
                <?php } else { ?>
                <a href="<?php echo $sort_price; ?>"><?php echo $column_price; ?></a>
                <?php } ?></td>
              <td class="right qty_edit"><?php if ($sort == 'p.quantity') { ?>
                <a href="<?php echo $sort_quantity; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_quantity; ?></a>
                <?php } else { ?>
                <a href="<?php echo $sort_quantity; ?>"><?php echo $column_quantity; ?></a>
                <?php } ?></td>
              <td class="left status_edit"><?php if ($sort == 'p.status') { ?>
                <a href="<?php echo $sort_status; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_status; ?></a>
                <?php } else { ?>
                <a href="<?php echo $sort_status; ?>"><?php echo $column_status; ?></a>
                <?php } ?></td>
              <td class="right"><?php echo $column_action; ?></td>
            </tr>
          </thead>
          <tbody>
            <tr class="filter">
		    <td></td>
            <td class="img_edit" style="<?php if(isset($cache_data['img_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
			<td class="product_name_edit"><input type="text" name="filter_name" value="<?php echo $filter_name; ?>" /></td>
		<td class="desc_edit" style="<?php if(isset($cache_data['desc_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="meta_desc_edit" style="<?php if(isset($cache_data['meta_desc_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="meta_keyword_edit" style="<?php if(isset($cache_data['meta_keyword_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="tag_edit" style="<?php if(isset($cache_data['tag_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
              <td class="model_edit"><input type="text" name="filter_model" value="<?php echo $filter_model; ?>" /></td>
		<td class="sku_edit" style="<?php if(isset($cache_data['sku_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="upc_edit" style="<?php if(isset($cache_data['upc_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="ean_edit" style="<?php if(isset($cache_data['ean_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="jan_edit" style="<?php if(isset($cache_data['jan_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="isbn_edit" style="<?php if(isset($cache_data['isbn_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="mpn_edit" style="<?php if(isset($cache_data['mpn_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="location_edit" style="<?php if(isset($cache_data['location_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="category_edit" style="<?php if(isset($cache_data['category_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="filter_edit" style="<?php if(isset($cache_data['filter_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="download_edit" style="<?php if(isset($cache_data['download_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="manufacturer_edit" style="<?php if(isset($cache_data['manufacturer_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="related_prod_edit" style="<?php if(isset($cache_data['related_prod_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="taxclass_edit" style="<?php if(isset($cache_data['taxclass_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="min_qty_edit" style="<?php if(isset($cache_data['min_qty_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="subtract_edit" style="<?php if(isset($cache_data['subtract_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="stock_status_edit" style="<?php if(isset($cache_data['stock_status_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="requiresshipping_edit" style="<?php if(isset($cache_data['requiresshipping_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="seokeyword_edit" style="<?php if(isset($cache_data['seokeyword_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="date_avilable_edit" style="<?php if(isset($cache_data['date_avilable_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="dimension_edit" style="<?php if(isset($cache_data['dimension_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="length_edit" style="<?php if(isset($cache_data['length_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="weight_edit" style="<?php if(isset($cache_data['weight_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="weight_class_edit" style="<?php if(isset($cache_data['weight_class_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="sort_order_edit" style="<?php if(isset($cache_data['sort_order_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="view_edit" style="<?php if(isset($cache_data['view_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
		<td class="points_edit" style="<?php if(isset($cache_data['points_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>"></td>
              <td align="left" class="price_edit"><input type="text" name="filter_price" value="<?php echo $filter_price; ?>" size="8"/></td>
              <td align="right" class="qty_edit"><input type="text" name="filter_quantity" value="<?php echo $filter_quantity; ?>" style="text-align: right;" /></td>
              <td class="status_edit"><select name="filter_status">
                  <option value="*"></option>
                  <?php if ($filter_status) { ?>
                  <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_enabled; ?></option>
                  <?php } ?>
                  <?php if (!is_null($filter_status) && !$filter_status) { ?>
                  <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                  <?php } else { ?>
                  <option value="0"><?php echo $text_disabled; ?></option>
                  <?php } ?>
                </select></td>
              <td align="right"><a onclick="filter();" class="button"><?php echo $button_filter; ?></a></td>
            </tr>
            <?php if ($products) { ?>
            <?php foreach ($products as $product) { ?>
            <tr>
              <td style="text-align: center;"><?php if ($product['selected']) { ?>
                <input type="checkbox" name="selected[]" id="<?php echo $product['product_id']; ?>_select" value="<?php echo $product['product_id']; ?>" checked="checked" />
                <?php } else { ?>
                <input type="checkbox" name="selected[]" id="<?php echo $product['product_id']; ?>_select" value="<?php echo $product['product_id']; ?>" />
                <?php } ?></td>
              
		<td class="center img_edit" style="<?php if(isset($cache_data['img_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
			<img src="<?php echo $product['image']; ?>" alt="<?php echo $product['image']; ?>" style="padding: 1px; border: 1px solid #DDDDDD;" id="<?php echo $product['product_id']; ?>_thumb" class="<?php echo strtolower($column_image); ?> editable quick_img" name="<?php echo $product['product_id']; ?>_image" />
			<input type="hidden" name="product_description[<?php echo $product['product_id']; ?>][image]" value="<?php echo $product['thumb']; ?>" id="<?php echo $product['product_id']; ?>_image" class="<?php echo strtolower($column_image); ?> editable" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' class="<?php echo strtolower($column_image); ?> editable" />
			<div class="quick_img">
				<a onclick='image_upload("<?php echo $product['product_id']; ?>_image", "<?php echo $product['product_id']; ?>_thumb"),document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' id="<?php echo $product['product_id']; ?>"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick='$("<?php echo '#'.$product['product_id']; ?>_thumb").attr("src", "<?php echo $no_image; ?>"); $("<?php echo '#'.$product['product_id']; ?>_image").attr("value", ""),document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' id="<?php echo $product['product_id']; ?>"><?php echo $text_clear; ?></a>
			</div>
		</td>
		
              <td class="left name product_name_edit">
				<?php foreach ($languages as $language) { ?><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" />
				<input type="text" class="<?php echo strtolower($column_name); ?> editable" name="product_description[<?php echo $product['product_id']; ?>][language][<?php echo $language['language_id'];?>][name]" id="<?php echo $product['product_id']; ?>_name" value="<?php echo isset($product['name'][$language['language_id']]) ? $product['name'][$language['language_id']]['name'] : ''; ?>" size="50" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' /><br>
				
				<?php /* ?><textarea name="product_description[<?php echo $product['product_id']; ?>][language][<?php echo $language['language_id'];?>][meta_description]" cols="40" rows="5" style="display: none;"><?php echo isset($product['name'][$language['language_id']]) ? $product['name'][$language['language_id']]['meta_description'] : ''; ?></textarea>		

				<textarea name="product_description[<?php echo $product['product_id']; ?>][language][<?php echo $language['language_id'];?>][meta_keyword]" cols="40" rows="5" style="display: none;"><?php echo isset($product['name'][$language['language_id']]) ? $product['name'][$language['language_id']]['meta_keyword'] : ''; ?></textarea>		

				<textarea name="product_description[<?php echo $product['product_id']; ?>][language][<?php echo $language['language_id'];?>][description]" cols="40" rows="5" style="display: none;"><?php echo isset($product['name'][$language['language_id']]) ? $product['name'][$language['language_id']]['description'] : ''; ?></textarea>	
				
				<input type="hidden" name="product_description[<?php echo $product['product_id']; ?>][language][<?php echo $language['language_id'];?>][tag]" value="<?php echo isset($product['name'][$language['language_id']]) ? $product['name'][$language['language_id']]['tag'] : ''; ?>" size="80" /><?php */ ?>	
				
				<?php } ?>
			</td>
			
			
			<td class="text-left desc_edit" style="<?php if(isset($cache_data['desc_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<?php foreach ($languages as $language) { ?>
				<div class="input-group" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'  placeholder="<?php echo $entry_description; ?>">
					<span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /></span>
					<textarea  name="product_description[<?php echo $product['product_id']; ?>][language][<?php echo $language['language_id']; ?>][description]"  id="<?php echo $product['product_id']; ?>_<?php echo $language['language_id'];?>_desc">
						<?php echo isset($product['name'][$language['language_id']]['description']) ? $product['name'][$language['language_id']]['description'] : ''; ?>
					</textarea>
					
					<script type="text/javascript">
				
						<?php foreach ($languages as $language) { ?>
						CKEDITOR.replace('<?php echo $product['product_id']; ?>_<?php echo $language['language_id'];?>_desc', {
							filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
							filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
							filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
							filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
							filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
							filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'
						});
						<?php } ?>

					</script>
				</div>
				<?php } ?>
			</td>
			
			<td class="text-left meta_desc_edit" style="<?php if(isset($cache_data['meta_desc_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<?php foreach ($languages as $language) { ?>
				<div class="input-group" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'  placeholder="<?php echo $entry_description; ?>">
					<span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /></span>
					<textarea name="product_description[<?php echo $product['product_id']; ?>][language][<?php echo $language['language_id']; ?>][meta_description]"  id="<?php echo $product['product_id']; ?>_<?php echo $language['language_id'];?>_meta_desc"><?php echo isset($product['name'][$language['language_id']]['meta_description']) ? $product['name'][$language['language_id']]['meta_description'] : ''; ?></textarea>
				</div>
				<?php } ?>
			</td>
			
			<td class="text-left meta_keyword_edit" style="<?php if(isset($cache_data['meta_keyword_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<?php foreach ($languages as $language) { ?>
				<div class="input-group" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'  placeholder="<?php echo $entry_description; ?>">
					<span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /></span>
					<textarea name="product_description[<?php echo $product['product_id']; ?>][language][<?php echo $language['language_id']; ?>][meta_keyword]"  id="<?php echo $product['product_id']; ?>_<?php echo $language['language_id'];?>_meta_keyword"><?php echo isset($product['name'][$language['language_id']]['meta_keyword']) ? $product['name'][$language['language_id']]['meta_keyword'] : ''; ?></textarea>
				</div>
				<?php } ?>
			</td>
			
			<td class="text-left tag_edit" style="<?php if(isset($cache_data['tag_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<?php foreach ($languages as $language) { ?>
				<div class="input-group">
					<span class="input-group-addon"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /></span>
					<input type="text" class="editable form-control" name="product_description[<?php echo $product['product_id']; ?>][language][<?php echo $language['language_id'];?>][tag]" id="<?php echo $product['product_id']; ?>_<?php echo $language['language_id'];?>_tag" value="<?php echo $product['name'][$language['language_id']]['tag']; ?>" size="50" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' style="width: 150px"/>
				</div>
				<?php } ?>
			</td>
              <td class="left model_edit"><input type="text" class="<?php echo strtolower($column_model); ?> editable" name="product_description[<?php echo $product['product_id']; ?>][model]" id="<?php echo $product['product_id']; ?>_model" value="<?php echo $product['model']; ?>" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' /></td>

			<td class="left sku_edit" style="<?php if(isset($cache_data['sku_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:100px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][sku]" value="<?php echo $product['sku']; ?>"  id="<?php echo $product['product_id']; ?>_sku" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'  />
			</td>
			<td class="left upc_edit" style="<?php if(isset($cache_data['upc_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:100px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][upc]" value="<?php echo $product['upc']; ?>"  id="<?php echo $product['product_id']; ?>_upc" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="left ean_edit" style="<?php if(isset($cache_data['ean_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:100px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][ean]" value="<?php echo $product['ean']; ?>"  id="<?php echo $product['product_id']; ?>_ean" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="left jan_edit" style="<?php if(isset($cache_data['jan_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:100px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][jan]" value="<?php echo $product['jan']; ?>"  id="<?php echo $product['product_id']; ?>_jan" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="left isbn_edit" style="<?php if(isset($cache_data['isbn_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:100px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][isbn]" value="<?php echo $product['isbn']; ?>"  id="<?php echo $product['product_id']; ?>_isbn" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="left mpn_edit" style="<?php if(isset($cache_data['mpn_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:100px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][mpn]" value="<?php echo $product['mpn']; ?>"  id="<?php echo $product['product_id']; ?>_mpn" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="left location_edit" style="<?php if(isset($cache_data['location_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:100px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][location]" value="<?php echo $product['location']; ?>"  id="<?php echo $product['product_id']; ?>_location" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="left category_edit" style="<?php if(isset($cache_data['category_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:125px" type="text" name="product_description[<?php echo $product['product_id']; ?>][category]" value=""  id="input-category_<?php echo $product['product_id']; ?>" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
				<div id="product-category_<?php echo $product['product_id']; ?>" class="scrollbox" style="height: 150px; overflow: auto;" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<?php $class = 'odd'; ?>
					<?php foreach ($prod_categories as $product_category) { ?>
						<?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
						<?php if($product_category['product_id'] == $product['product_id']) { ?>
							<div id="product-category<?php echo $product_category['category_id']; ?>" class="<?php echo $class; ?>">
							<?php echo $product_category['name']; ?><img src="view/image/delete.png" alt="" />
								<input type="hidden" name="product_description[<?php echo $product['product_id']; ?>][product_category][]" value="<?php echo $product_category['category_id']; ?>" />
							</div>
						<?php } ?>
					<?php } ?>
				</div>
			</td>
			<td class="left filter_edit" style="<?php if(isset($cache_data['filter_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:125px" type="text" name="product_description[<?php echo $product['product_id']; ?>][filter]" value=""  id="input-filter_<?php echo $product['product_id']; ?>" class="form-control" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'/>
				<div id="product-filter_<?php echo $product['product_id']; ?>" class="scrollbox" style="height: 150px; overflow: auto;" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<?php $class = 'odd'; ?>
					<?php foreach ($prod_filters as $product_filter) { ?>
						<?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
						<?php if($product_filter['product_id'] == $product['product_id']) { ?>
							<div id="product-filter<?php echo $product_filter['filter_id']; ?>" class="<?php echo $class; ?>">
								<?php echo $product_filter['name']; ?><img src="view/image/delete.png" alt="" />
								<input type="hidden" name="product_description[<?php echo $product['product_id']; ?>][product_filter][]" value="<?php echo $product_filter['filter_id']; ?>" />
							</div>
						<?php } ?>
					<?php } ?>
				</div>
			</td>
			<td class="left download_edit" style="<?php if(isset($cache_data['download_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:125px" type="text" name="product_description[<?php echo $product['product_id']; ?>][download]" value=""  id="input-download_<?php echo $product['product_id']; ?>" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'/>
				<div id="product-download_<?php echo $product['product_id']; ?>" class="scrollbox" style="height: 150px; overflow: auto;" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<?php $class = 'odd'; ?>
					<?php foreach ($prod_downloads as $product_download) { ?>
						<?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
						<?php if($product_download['product_id'] == $product['product_id']) { ?>
							<div id="product-download<?php echo $product_download['download_id']; ?>">
								<?php echo $product_download['name']; ?><img src="view/image/delete.png" alt="" />
								<input type="hidden" name="product_description[<?php echo $product['product_id']; ?>][product_download][]" value="<?php echo $product_download['download_id']; ?>" />
							</div>
						<?php } ?>	
					<?php } ?>
				</div>
			</td>
			<td class="right manufacturer_edit" style="<?php if(isset($cache_data['manufacturer_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<select style="width:125px" name="product_description[<?php echo $product['product_id']; ?>][manufacturer_id]" id="input-manufacturer-class" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<option value="0"><?php echo $text_none; ?></option>
					<?php foreach ($manufacturers as $manufacturer) { ?>
					<?php if ($manufacturer['manufacturer_id'] == $product['manufacturer_id']) { ?>
					<option value="<?php echo $manufacturer['manufacturer_id']; ?>" selected="selected"><?php echo $manufacturer['name']; ?></option>
					<?php } else { ?>
					<option value="<?php echo $manufacturer['manufacturer_id']; ?>"><?php echo $manufacturer['name']; ?></option>
					<?php } ?>
					<?php } ?>
				</select>
			</td>
			<td class="left related_prod_edit" style="<?php if(isset($cache_data['related_prod_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:125px" type="text" name="product_description[<?php echo $product['product_id']; ?>][related]" value="" id="input-related_<?php echo $product['product_id']; ?>" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'/>
				<div id="product-related_<?php echo $product['product_id']; ?>" class="scrollbox" style="height: 150px; overflow: auto;" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<?php $class = 'odd'; ?>
					<?php foreach ($prod_relateds as $product_related) { ?>
						<?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
						<?php if($product_related['product_id'] == $product['product_id']) { ?>
							<div id="product-related<?php echo $product_related['related_product_id']; ?>">
							<?php echo $product_related['name']; ?><img src="view/image/delete.png" alt="" />
								<input type="hidden" name="product_description[<?php echo $product['product_id']; ?>][product_related][]" value="<?php echo $product_related['related_product_id']; ?>" />
							</div>
						<?php } ?>
					<?php } ?>
				</div>
			</td>
			<td class="right taxclass_edit" style="<?php if(isset($cache_data['taxclass_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<select style="width:125px" name="product_description[<?php echo $product['product_id']; ?>][tax_class_id]" id="input-tax-class" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<option value="0"><?php echo $text_none; ?></option>
					<?php foreach ($tax_classes as $tax_class) { ?>
					<?php if ($tax_class['tax_class_id'] == $product['tax_class_id']) { ?>
					<option value="<?php echo $tax_class['tax_class_id']; ?>" selected="selected"><?php echo $tax_class['title']; ?></option>
					<?php } else { ?>
					<option value="<?php echo $tax_class['tax_class_id']; ?>"><?php echo $tax_class['title']; ?></option>
					<?php } ?>
					<?php } ?>
				</select>
			</td>
			<td class="text-right min_qty_edit" style="<?php if(isset($cache_data['min_qty_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:100px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][minimum]" value="<?php echo $product['minimum']; ?>"  id="<?php echo $product['product_id']; ?>_minimum" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="text-right subtract_edit" style="<?php if(isset($cache_data['subtract_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<select style="width:125px" name="product_description[<?php echo $product['product_id']; ?>][subtract]" id="input-min-qty-class" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<?php if ($product['subtract']) { ?>
					<option value="1" selected="selected"><?php echo $text_yes; ?></option>
					<option value="0"><?php echo $text_no; ?></option>
					<?php } else { ?>
					<option value="1"><?php echo $text_yes; ?></option>
					<option value="0" selected="selected"><?php echo $text_no; ?></option>
					<?php } ?>
				</select>
			</td>
			<td class="text-right stock_status_edit" style="<?php if(isset($cache_data['stock_status_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<select style="width:125px" name="product_description[<?php echo $product['product_id']; ?>][stock_status_id]" id="input-stock-status-class" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<option value="0"><?php echo $text_none; ?></option>
					<?php foreach ($stock_statuses as $stock_status) { ?>
					<?php if ($stock_status['stock_status_id'] == $product['stock_status_id']) { ?>
					<option value="<?php echo $stock_status['stock_status_id']; ?>" selected="selected"><?php echo $stock_status['name']; ?></option>
					<?php } else { ?>
					<option value="<?php echo $stock_status['stock_status_id']; ?>"><?php echo $stock_status['name']; ?></option>
					<?php } ?>
					<?php } ?>
				</select>
			</td>
			<td class="text-right requiresshipping_edit" style="<?php if(isset($cache_data['requiresshipping_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<select style="width:125px" name="product_description[<?php echo $product['product_id']; ?>][shipping]" id="input-requiresshipping-class" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<?php if ($product['shipping']) { ?>
					<option value="1" selected="selected"><?php echo $text_yes; ?></option>
					<option value="0"><?php echo $text_no; ?></option>
					<?php } else { ?>
					<option value="1"><?php echo $text_yes; ?></option>
					<option value="0" selected="selected"><?php echo $text_no; ?></option>
					<?php } ?>
				</select>
			</td>
			<td class="text-right seokeyword_edit" style="<?php if(isset($cache_data['seokeyword_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:125px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][keyword]" value="<?php echo $product['keyword']; ?>"  id="<?php echo $product['product_id']; ?>_keyword" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="text-right date_avilable_edit" style="<?php if(isset($cache_data['date_avilable_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<div class="input-group" >
					<input style="width:125px" type="text" name="product_description[<?php echo $product['product_id']; ?>][date_available]" value="<?php echo $product['date_available']; ?>"  data-date-format="YYYY-MM-DD" id="input-date-available" class="form-control date" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'/>
				</div>
			</td>
			<td class="text-right dimension_edit" style="<?php if(isset($cache_data['dimension_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<label class="col-sm-2 control-label" for="input-length"><?php echo $entry_length_l; ?></label>
				<input style="width:50px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][length]" value="<?php echo $product['length']; ?>"  id="<?php echo $product['product_id']; ?>_length" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
				<label class="col-sm-2 control-label" for="input-length"><?php echo $entry_width_w; ?></label>
				<input style="width:50px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][width]" value="<?php echo $product['width']; ?>"  id="<?php echo $product['product_id']; ?>_width" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
				<label class="col-sm-2 control-label" for="input-length"><?php echo $entry_height_h; ?></label>
				<input style="width:50px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][height]" value="<?php echo $product['height']; ?>"  id="<?php echo $product['product_id']; ?>_height" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="text-right length_edit" style="<?php if(isset($cache_data['length_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<select style="width:125px" name="product_description[<?php echo $product['product_id']; ?>][length_class_id]" id="input-length-class" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<?php foreach ($length_classes as $length_class) { ?>
					<?php if ($length_class['length_class_id'] == $product['length_class_id']) { ?>
					<option value="<?php echo $length_class['length_class_id']; ?>" selected="selected"><?php echo $length_class['title']; ?></option>
					<?php } else { ?>
					<option value="<?php echo $length_class['length_class_id']; ?>"><?php echo $length_class['title']; ?></option>
					<?php } ?>
					<?php } ?>
				</select>
			</td>
			<td class="text-right weight_edit" style="<?php if(isset($cache_data['weight_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:125px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][weight]" value="<?php echo $product['weight']; ?>" placeholder="<?php echo $entry_weight; ?>" id="<?php echo $product['product_id']; ?>_weight" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="text-right weight_class_edit" style="<?php if(isset($cache_data['weight_class_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<select style="width:125px" name="product_description[<?php echo $product['product_id']; ?>][weight_class_id]" id="input-weight-class" class="form-control" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'>
					<?php foreach ($weight_classes as $weight_class) { ?>
					<?php if ($weight_class['weight_class_id'] == $product['weight_class_id']) { ?>
					<option value="<?php echo $weight_class['weight_class_id']; ?>" selected="selected"><?php echo $weight_class['title']; ?></option>
					<?php } else { ?>
					<option value="<?php echo $weight_class['weight_class_id']; ?>"><?php echo $weight_class['title']; ?></option>
					<?php } ?>
					<?php } ?>
				</select>
			</td>
			<td class="text-right sort_order_edit" style="<?php if(isset($cache_data['sort_order_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:125px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][sort_order]" value="<?php echo $product['sort_order']; ?>"  id="<?php echo $product['product_id']; ?>_sort_order" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="text-right view_edit" style="<?php if(isset($cache_data['view_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:125px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][viewed]" value="<?php echo $product['viewed']; ?>"  id="<?php echo $product['product_id']; ?>_viewed" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>
			<td class="text-right points_edit" style="<?php if(isset($cache_data['points_edit']) == 'on') { echo "display:table-cell;"; } else { echo "display:none;"; } ?>">
				<input style="width:125px" type="text" class="form-control editable" name="product_description[<?php echo $product['product_id']; ?>][points]" value="<?php echo $product['points']; ?>"  id="<?php echo $product['product_id']; ?>_viewed" size="16" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			</td>	
			
			
              <td class="left price_edit"><?php if ($product['special']) { ?>
                <span style="text-decoration: line-through;"><?php if ($product['special']) { ?>
			<input type="text" class="<?php echo strtolower($column_price); ?> editable quick_decorate" name="product_description[<?php echo $product['product_id']; ?>][price]" id="<?php echo $product['product_id']; ?>_price" value="<?php echo $product['price']; ?>" size="8" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			<?php } else { ?>
			<input type="text" class="<?php echo strtolower($column_price); ?> editable" name="product_description[<?php echo $product['product_id']; ?>][price]" id="<?php echo $product['product_id']; ?>_price" value="<?php echo $product['price']; ?>" size="8" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			 <?php } ?></span><br/>
                <span style="color: #b00;"><input type="text" class="<?php echo strtolower($column_price); ?> editable quick_edit_danger" name="product_description[<?php echo $product['product_id']; ?>][special]" id="<?php echo $product['product_id']; ?>_special" value="<?php echo $product['special']; ?>" size="8" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' /></span>
                <?php } else { ?>
                <?php if ($product['special']) { ?>
			<input type="text" class="<?php echo strtolower($column_price); ?> editable quick_decorate" name="product_description[<?php echo $product['product_id']; ?>][price]" id="<?php echo $product['product_id']; ?>_price" value="<?php echo $product['price']; ?>" size="8" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			<?php } else { ?>
			<input type="text" class="<?php echo strtolower($column_price); ?> editable" name="product_description[<?php echo $product['product_id']; ?>][price]" id="<?php echo $product['product_id']; ?>_price" value="<?php echo $product['price']; ?>" size="8" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' />
			 <?php } ?>
                <?php } ?></td>
              <td class="right qty_edit"><?php if ($product['quantity'] <= 0) { ?>
                <span style="color: #FF0000;"><input type="text" class="<?php echo strtolower($column_quantity); ?> editable" name="product_description[<?php echo $product['product_id']; ?>][quantity]" id="<?php echo $product['product_id']; ?>_quantity" value="<?php echo $product['quantity']; ?>" size="8" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' /></span>
                <?php } elseif ($product['quantity'] <= 5) { ?>
                <span style="color: #FFA500;"><input type="text" class="<?php echo strtolower($column_quantity); ?> editable" name="product_description[<?php echo $product['product_id']; ?>][quantity]" id="<?php echo $product['product_id']; ?>_quantity" value="<?php echo $product['quantity']; ?>" size="8" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' /></span>
                <?php } else { ?>
                <span style="color: #008000;"><input type="text" class="<?php echo strtolower($column_quantity); ?> editable" name="product_description[<?php echo $product['product_id']; ?>][quantity]" id="<?php echo $product['product_id']; ?>_quantity" value="<?php echo $product['quantity']; ?>" size="8" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");' /></span>
                <?php } ?></td>
              <td class="left status status_edit"><select name="product_description[<?php echo $product['product_id']; ?>][status]" id="<?php echo $product['product_id']; ?>_status" onclick='document.getElementById("<?php echo $product['product_id']; ?>_select").setAttribute("checked","checked");'> 
		  <?php if ($product['status'] == $text_enabled) { ?>
		  <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
		  <option value="0"><?php echo $text_disabled; ?></option>
		  <?php } else { ?>
		  <option value="1"><?php echo $text_enabled; ?></option>
		  <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
		  <?php } ?>
		</select></td>
              <td class="right"><?php foreach ($product['action'] as $action) { ?>
                [ <a target="_blank" href="<?php echo $action['href']; ?>"><?php echo $action['text']; ?></a> ]
                <?php } ?></td>
            </tr>
            <?php } ?>
            <?php } else { ?>
            <tr>
              <td class="center" colspan="8"><?php echo $text_no_results; ?></td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </form>
      <div class="pagination"><?php echo $pagination; ?></div>
    </div>
  </div>
</div>
<script type="text/javascript"><!--
function filter() {
	url = 'index.php?route=catalog/quick_product&token=<?php echo $token; ?>';
	
	var filter_name = $('input[name=\'filter_name\']').attr('value');
	
	if (filter_name) {
		url += '&filter_name=' + encodeURIComponent(filter_name);
	}
	
	var filter_model = $('input[name=\'filter_model\']').attr('value');
	
	if (filter_model) {
		url += '&filter_model=' + encodeURIComponent(filter_model);
	}
	
	var filter_price = $('input[name=\'filter_price\']').attr('value');
	
	if (filter_price) {
		url += '&filter_price=' + encodeURIComponent(filter_price);
	}
	
	var filter_quantity = $('input[name=\'filter_quantity\']').attr('value');
	
	if (filter_quantity) {
		url += '&filter_quantity=' + encodeURIComponent(filter_quantity);
	}
	
	var filter_status = $('select[name=\'filter_status\']').attr('value');
	
	if (filter_status != '*') {
		url += '&filter_status=' + encodeURIComponent(filter_status);
	}	

	location = url;
}
//--></script> 
<script type="text/javascript"><!--
$('#form input').keydown(function(e) {
	if (e.keyCode == 13) {
		filter();
	}
});
//--></script> 
<script type="text/javascript"><!--
$('input[name=\'filter_name\']').autocomplete({
	delay: 500,
	source: function(request, response) {
		$.ajax({
			url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
			dataType: 'json',
			success: function(json) {		
				response($.map(json, function(item) {
					return {
						label: item.name,
						value: item.product_id
					}
				}));
			}
		});
	}, 
	select: function(event, ui) {
		$('input[name=\'filter_name\']').val(ui.item.label);
						
		return false;
	},
	focus: function(event, ui) {
      	return false;
   	}
});

$('input[name=\'filter_model\']').autocomplete({
	delay: 500,
	source: function(request, response) {
		$.ajax({
			url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_model=' +  encodeURIComponent(request.term),
			dataType: 'json',
			success: function(json) {		
				response($.map(json, function(item) {
					return {
						label: item.model,
						value: item.product_id
					}
				}));
			}
		});
	}, 
	select: function(event, ui) {
		$('input[name=\'filter_model\']').val(ui.item.label);
						
		return false;
	},
	focus: function(event, ui) {
      	return false;
   	}
});
//--></script> 
<script type="text/javascript"><!--
	<?php foreach ($products as $product) { ?>	
		
		// Category
		
		$('#input-category_<?php echo $product['product_id']; ?>').autocomplete({
			delay: 500,
			source: function(request, response) {
				$.ajax({
					url: 'index.php?route=catalog/category/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
					dataType: 'json',
					success: function(json) {		
						response($.map(json, function(item) {
							return {
								label: item.name,
								value: item.category_id
							}
						}));
					}
				});
			}, 
			select: function(event, ui) {
				$('#product-category_<?php echo $product['product_id']; ?>' + ui.item.value).remove();
				
				$('#product-category_<?php echo $product['product_id']; ?>').append('<div id="product-category_<?php echo $product['product_id']; ?>' + ui.item.value + '">' + ui.item.label + '<img src="view/image/delete.png" alt="" /><input type="hidden" name="product_description[<?php echo $product['product_id']; ?>][product_category][]" value="' + ui.item.value + '" /></div>');

				$('#product-category_<?php echo $product['product_id']; ?> div:odd').attr('class', 'odd');
				$('#product-category_<?php echo $product['product_id']; ?> div:even').attr('class', 'even');
						
				return false;
			},
			focus: function(event, ui) {
			  return false;
		   }
		});

		$('#product-category_<?php echo $product['product_id']; ?> div img').live('click', function() {
			$(this).parent().remove();
			
			$('#product-category_<?php echo $product['product_id']; ?> div:odd').attr('class', 'odd');
			$('#product-category_<?php echo $product['product_id']; ?> div:even').attr('class', 'even');	
		});
		
		// Filter
		
		$('#input-filter_<?php echo $product['product_id']; ?>').autocomplete({
			delay: 500,
			source: function(request, response) {
				$.ajax({
					url: 'index.php?route=catalog/filter/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
					dataType: 'json',
					success: function(json) {		
						response($.map(json, function(item) {
							return {
								label: item.name,
								value: item.filter_id
							}
						}));
					}
				});
			}, 
			select: function(event, ui) {
				$('#product-filter_<?php echo $product['product_id']; ?>' + ui.item.value).remove();
				
				$('#product-filter_<?php echo $product['product_id']; ?>').append('<div id="product-filter_<?php echo $product['product_id']; ?>' + ui.item.value + '">' + ui.item.label + '<img src="view/image/delete.png" alt="" /><input type="hidden" name="product_description[<?php echo $product['product_id']; ?>][product_filter][]" value="' + ui.item.value + '" /></div>');

				$('#product-filter_<?php echo $product['product_id']; ?> div:odd').attr('class', 'odd');
				$('#product-filter_<?php echo $product['product_id']; ?> div:even').attr('class', 'even');
						
				return false;
			},
			focus: function(event, ui) {
			  return false;
		   }
		});

		$('#product-filter_<?php echo $product['product_id']; ?> div img').live('click', function() {
			$(this).parent().remove();
			
			$('#product-filter_<?php echo $product['product_id']; ?> div:odd').attr('class', 'odd');
			$('#product-filter_<?php echo $product['product_id']; ?> div:even').attr('class', 'even');	
		});
		
		// Downloads
		
		$('#input-download_<?php echo $product['product_id']; ?>').autocomplete({
			delay: 500,
			source: function(request, response) {
				$.ajax({
					url: 'index.php?route=catalog/download/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
					dataType: 'json',
					success: function(json) {		
						response($.map(json, function(item) {
							return {
								label: item.name,
								value: item.download_id
							}
						}));
					}
				});
			}, 
			select: function(event, ui) {
				$('#product-download_<?php echo $product['product_id']; ?>' + ui.item.value).remove();
				
				$('#product-download_<?php echo $product['product_id']; ?>').append('<div id="product-download_<?php echo $product['product_id']; ?>' + ui.item.value + '">' + ui.item.label + '<img src="view/image/delete.png" alt="" /><input type="hidden" name="product_description[<?php echo $product['product_id']; ?>][product_download][]" value="' + ui.item.value + '" /></div>');

				$('#product-download_<?php echo $product['product_id']; ?> div:odd').attr('class', 'odd');
				$('#product-download_<?php echo $product['product_id']; ?> div:even').attr('class', 'even');
						
				return false;
			},
			focus: function(event, ui) {
			  return false;
		   }
		});

		$('#product-download_<?php echo $product['product_id']; ?> div img').live('click', function() {
			$(this).parent().remove();
			
			$('#product-download_<?php echo $product['product_id']; ?> div:odd').attr('class', 'odd');
			$('#product-download_<?php echo $product['product_id']; ?> div:even').attr('class', 'even');	
		});
		
		// Related
		
		$('#input-related_<?php echo $product['product_id']; ?>').autocomplete({
			delay: 500,
			source: function(request, response) {
				$.ajax({
					url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
					dataType: 'json',
					success: function(json) {		
						response($.map(json, function(item) {
							return {
								label: item.name,
								value: item.product_id
							}
						}));
					}
				});
			}, 
			select: function(event, ui) {
				$('#product-related_<?php echo $product['product_id']; ?>' + ui.item.value).remove();
				
				$('#product-related_<?php echo $product['product_id']; ?>').append('<div id="product-related_<?php echo $product['product_id']; ?>' + ui.item.value + '">' + ui.item.label + '<img src="view/image/delete.png" alt="" /><input type="hidden" name="product_description[<?php echo $product['product_id']; ?>][product_related][]" value="' + ui.item.value + '" /></div>');

				$('#product-related_<?php echo $product['product_id']; ?> div:odd').attr('class', 'odd');
				$('#product-related_<?php echo $product['product_id']; ?> div:even').attr('class', 'even');
						
				return false;
			},
			focus: function(event, ui) {
			  return false;
		   }
		});

		$('#product-related_<?php echo $product['product_id']; ?> div img').live('click', function() {
			$(this).parent().remove();
			
			$('#product-related_<?php echo $product['product_id']; ?> div:odd').attr('class', 'odd');
			$('#product-related_<?php echo $product['product_id']; ?> div:even').attr('class', 'even');	
		});
		
	<?php } ?>
	
	function image_upload(field, thumb) {
		$('#dialog').remove();
		
		$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
		
		$('#dialog').dialog({
			title: '<?php echo $text_image_manager; ?>',
			close: function (event, ui) {
				if ($('#' + field).attr('value')) {
					$.ajax({
						url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).attr('value')),
						dataType: 'text',
						success: function(text) {
							$('#' + thumb).replaceWith('<img src="' + text + '" alt="" id="' + thumb + '" />');
						}
					});
				}
			},	
			bgiframe: false,
			width: 800,
			height: 400,
			resizable: false,
			modal: false
		});
	};
	
	$('.date').datepicker({dateFormat: 'yy-mm-dd'});
	
	
	//--></script> 
	<script type="text/javascript"> 			
	$(document).ready(function() {
		$('.editable').focus(function() {
			$(this).addClass("focusField");
			if (this.value == this.defaultValue){
				this.select();
			}
			if(this.value != this.defaultValue){
				this.select();
			}
		});
		$('.editable').blur(function() {
			$(this).removeClass("focusField");
			
		});
	});
	</script>
<?php echo $footer; ?>