<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblBusiness} : {$language.lblExportdata}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
{include file='CommonCustomStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/right-menu.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/ui.daterangepicker.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/bootstrap-multiselect.css" />
<link href="{$view_styles}/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/adding-page.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/product-details.css" />
</head><body class="{$languageDirection}">
<div class="outer" id="main">
  {include file='CommonHeader.tpl'}
  <!--End:Header Container-->
  {* <!--***********************************************************************START CONTAINER SECTION******************************************************--> *}
    <div class="content-wrapper">
   <div class="container-fluid clearfix">

    <div class="clearfix">
      <div class="pull-right right">
        {include file='ContentLanguageOptions.tpl'}
      </div>
    </div>
   
    <!--End: Right Block-->
    <div class="left_wrapper">
      <div class="content_wrapper">
          <div class="clearfix">
        <h2 class="pull-left">{$language.lblExportdata}</h2> 
          <div class="tab02 order-tab pull-right margin-bottom">
	{if $itab|default:''}
	      {assign var="Ptab" value=''}
	      {assign var="Itab" value='active'}
	      {assign var="Ctab" value=''}	     
	      {elseif $ctab|default:''}
	      {assign var="Ptab" value=''}
	      {assign var="Itab" value=''}
	       {assign var="Ctab" value='active'}	      
	       {else}
	      {assign var="Ptab" value='active'}
	      {assign var="Itab" value=''}
	      {assign var="Ctab" value=''}	     
	      {/if}

        <ul>
  	      <li>
            <a href="javascript:void(0);" class="{$Ptab}  tab-anchor" >{$language.lblProducts}</a>
          </li>
          <li>
            <a href="javascript:void(0);" class="{$Ctab}  tab-anchor" >{$language.lblProductCombos}</a>
          </li>
          <li>
            <a href="javascript:void(0);" class="{$Itab}  tab-anchor" >{$language.lblImages}</a>
          </li>
        </ul>

      <!--
         {html->anchor name="cancel" content="<strong>Product Combinations</strong>" class="tab-anchor" href="product/export/pattern/Combinations"} {html->anchor name="cancel" content="<strong>Images</strong>" class="tab-anchor" href="product/export/pattern/Product_images"}-->
         </div>
        </div>
        <!-- Inner Content Container starts-->
      	<div class="inner_content_wrapper margin-top">
	
          <div id="common_message" ></div>
          <div class="tab-content container-section margin-top"  {if ($ptab|default:'') || ($itab|default:''=="" && $ctab|default:''=="")} style="display:block" {else} style="display:none" {/if}>
	   <h3 class="border-bottom"> {$language.lblMenuExportProducts}</h3>
          <div class="form_listing form_listing03">
          {form->start name="productExport" method="post" action=""}
    {assign var="count" value=0}
    {foreach from=$pdtexportArray key="k" item="ioptionTitle"}    
    {$exportFields[$count][1]=$k}
    {$exportFields[$count][0]=$ioptionTitle}
    {assign var="count" value=$count+1}
    {/foreach}   
           
                
                 <div class="form-group clearfix">
                <label class="control-label col-md-3 col-sm-6 col-xs-12">{$language.lblMenuLanguages}</label>
                
                <!--End:Left-->
                <div class="rightside01 col-md-4 col-sm-6 col-xs-12">
                    <select style="width:37.5%" class="form-control" name="export_options[languageID]" id="export_options[languageID]" tabindex="1">
                    {foreach $view_common_languages as $lang}
                       <option value="{$lang.languageID}">{$lang.languageName}</option>
                    {/foreach}
                     </select>
                  
                 </div>
                <!--End:right-->
             </div>
            
              <div class="form-group clearfix">
                <label class="control-label col-md-3 col-sm-6 col-xs-12">{$language.lblAttributeSets}</label>
                <!--End:Left-->
                <div class="rightside01 col-md-4 col-sm-6 col-xs-12">
                  {form->select class="form-control" tabindex="2" name="export_options[attributeSetID]"  options=$resAttrSet  caption="->{$language.msgAttributeSet}" validate="required" error=$language.msgAttributeSet}
                 </div>
                <!--End:right-->
              </div>
             
                <!--End:Left-->
						
		{form->hidden  name="pattern_id" value="products"}
		{form->hidden  name="export_options[filename]" value="products_general_08022013.csv"}
		 <div class="form-group clearfix">
                 <label class="control-label col-md-3 col-sm-6 col-xs-12">{$language.lblProductCategory}</label>
                <div class="rightside01 col-md-4 col-sm-6 col-xs-12">
				 <div class="category-section pos-relative form-group">
                                     {*form->select style="width:37.5%" name="searchProductCategory" multiple="multiple" options=$resCategories*}
                                     
                                  <div class="div-city">     
				  <div class="fixed-section">
                          <h2>{$language.lblProductCategory}</h2>
                      {assign var="categoryValue" value=""}
				{form->textbox name="filterCategories" class="filterBrands form-control margin-bottom" placeholder="{$language.lblSearchCategories}"}
                          </div>
				{assign var="categoryValue" value=""}
			        <ul  class="dragtree categoryList" id="categoryList">
                        {*<!--menu function-->*}
                 {function name=categories level=0 catValues=0}
                {foreach from=$data item="productCategory"} 
					 {if $productCategory.productCategoryStatus=='Inactive'}
				  {assign var="categoryName" value="<span class='inactive'>"|cat:$productCategory.productCategoryName|cat:"</span>"}              
				  {else}
				  {assign var="categoryName" value=$productCategory.productCategoryName} 
				  {/if}
                        <li  data-level="{$level}" category="{$productCategory.productCategoryID}" catname="{$productCategory.productCategoryName}" class="left-spacing {if $productCategory.productCategoryID==1} ui-state-disabled {/if} li_catIDs" >
									{if !(in_array($productCategory.productCategoryID, $categoryIDList|default:array()))}
                                    <span class="expand {if !(!empty($productCategory['children']) && is_array($productCategory['children']))}hide{/if} icon-plus2"></span>
									{else}
									<span class="expand colapse {if !(!empty($productCategory['children']) && is_array($productCategory['children']))}hide{/if}">-</span>
									{/if}
									{if !(!empty($productCategory['children']) && is_array($productCategory['children']))}
																		  
									 {assign var="categoryValue" value=$catValues|cat:","|cat:$productCategory.productCategoryID}
										{*{if !(in_array($productCategory.productCategoryID, $categoryIDList|default:array()))}
										 {assign var="disable" value="disabled"}
										 {else}
										  {assign var="disable" value=""}
										 {/if}*}
									{form->checkbox   name="searchProductCategory" class="categoryTree" id="category" options=$categoryValue|cat:"->"|cat:"&nbsp;"|cat:$categoryName value=$resProductcategory|default:''} 
									{else}
									 {assign var="categoryValue" value=$catValues|cat:","|cat:$productCategory.productCategoryID}
									{$categoryName} 
									{/if}
							{assign var="children" value=$productCategory['children']|default:''}
                             {if isset($productCategory['children']) && is_array($productCategory['children']) && !empty($productCategory['children'])}
                               <ul id="" class="categoryList {if !(in_array($productCategory.productCategoryID, $categoryIDList|default:array()))}hide {/if}"> 
                            {call name=categories data=$children level=$level+1 catValues=$categoryValue}  <!--menu function calling-->
                            </ul>
                        {else}
                             {if (is_array($productCategory)) && (isset($productCategory['menuItemID'])) && (is_numeric($productCategory['menuItemID']))}
                        </li>	
                        {/if}
                    {/if}
            {/foreach}  
          {/function}
          {call categories data=$resCategories} {*<!--menu function calling-->*}
             	 </ul> 
                 </div>
             </div>
				</div> 
				</div>			  
		 <div class="form-group clearfix">
                   <label class="control-label col-md-3 col-sm-6 col-xs-12">{$language.lblBrand}</label>
                  <div class="rightside01 col-md-4 col-sm-6 col-xs-12">
				  {form->select class="form-control" name="brandID" caption="->{$language.lblSelectBrand}" options=$listBrand } 
				  </div>
				</div>  
		<div class="form-group clearfix"> <label class="control-label col-md-3 col-sm-6">{$language.lblLimitData}</label> 
            <div class="col-md-4 col-sm-6 hidden-xs0">
                <div class="row">
                <div class="col-lg-6 col-sm-6 col-xs-12">
               <label class="control-label col-md-3 col-xs-12 padng-left">{$language.lblFrom}</label>             
                <div class="rightside01 col-md-9 col-xs-12 padng-rmv">
                 {form->textbox 
                                  
								  name="limitFrom" 
                                  class="text-box form-control" 
                                  validate="limitTo->isnotequal->~*required~*isWholeNumberWithOutZero" error="~*"|cat:$language.errRequired|cat:"~*"|cat:$language.errValidNumber}
                </div>
              </div>
                <div class="col-lg-6 col-sm-6 col-xs-12">
                  <label class="control-label col-md-3">{$language.lblTo}</label>             
                <div class="rightside01  col-md-9 padng-rmv">
                 {form->textbox 
                                  
								  name="limitTo" 
                                  class="text-box form-control" 
                                  validate="limitFrom->isnotequal->~*required~*isWholeNumberWithOutZero~*limitFrom->lteq->limitTo" error="~*"|cat:$language.errRequired|cat:"~*"|cat:$language.errValidNumber|cat:"~*"|cat:"Limit To value Should be greater than Limit From Value"}
                </div>   </div>   
            </div>
             </div>
             </div>
   	
              <div class="form-group clearfix">
               <label class="control-label col-md-3 col-sm-6 col-xs-12">{$language.lblExportCsv}</label>
		
				<div class="rightside01 col-md-7 col-sm-6 col-xs-12 margin-vertical">
                <p>{$language.lblExportFieldMsg} <strong>{$language.lblEsku}</strong>, <strong>{$language.lblName}</strong> ,<strong>{$language.lblDefaultPrice}</strong>,<strong>{$language.lblEBusiness}</strong> ,<strong>{$language.lblCategory}
		</strong>,<strong>{$language.lblMeasurementClass}</strong> {$language.lblAnd}
				<strong>{$language.lblAttributeSetname}</strong>  {$language.lblExpolbl}. 
                </p>
                <div class="lis-ex-field margin-top">
                  <a href="javascript:void(0)" rel="pselect" class="selectall"><span class="icon-tick"></span> {$language.lblcheckfileds}</a> / <a href="javascript:void(0)" rel="pselect" class="uncheckall"><span class="icon-close2"></span> {$language.lbluncheckfileds}</a>
<ul class="clearfix">
                	<li class="col-xs-12 col-md-4 col-sm-6 margin-bottom">{form->checkbox name="layout_data" label="true"
                        options="{$exportFields}" class="exportpselect" datatab="p"  seperator="</li><li class='col-xs-12 col-md-4 col-sm-6 margin-bottom'>"} 
                </ul>
                </div>
               </div></div>	
				
                <!--End:right-->
              </li>				  
              <div class="form-group clearfix">
                <div class="submit-block clearfix"> 
                
                    <div class="leftside01 col-md-3 col-sm-6 hidden-xs">&nbsp;</div>
                	<div class="rightside01 col-md-4 col-sm-6">{form->submit name="submit_export" value="{$language.lblExport}" class="btn btn-primary"} 
                   
                </div>
                </div>
                <!--End:right-->
              </div>
          {form->close}
           </div>  </div>
	    <div class="tab-content container-section margin-top" {if $ctab|default:''} style="display:block" {else} style="display:none" {/if}> 
  
      <div class="content_wrapper">
      	<h3 class="border-bottom">{$language.lblExProductCombos}</h3>
        <!-- Inner Content Container starts-->
      	<div class="inner_content_wrapper full_width">
          <div id="common_message" ></div>
          <div class="form_listing form_listing03">
          {form->start name="ComboExport" method="post" action=""}
    {assign var="count" value=0}
    {foreach from=$comboexportArray key="k" item="i"}    
    {$comboexportFields[$count][1]=$k}
    {$comboexportFields[$count][0]=$i}
    {assign var="count" value=$count+1}
    {/foreach}
            <ul>
             {form->hidden  name="export_options[filename]" value="products_combination_general_08022013.csv"}
              {form->hidden  name="pattern_id" value="product_combinations"}
               <div class="form-group clearfix">
                <label class="col-md-3 col-sm-6 leftside01 control-label mandatory">{$language.lblAttributeSets}</label>
                <!--End:Left-->
                <div class="rightside01 col-md-4 col-sm-6">
                  {form->select tabindex="2" id="attributeSetID2" name="export_options[attributeSetID]"  options=$resAttrSet class="form-control" caption="->{$language.msgAttributeSet}" validate="required" error=$language.msgAttributeSet}
                 </div>
                <!--End:right-->
              </div>	      
	      <div class="form-group clearfix">
                <label class="leftside01 control-label col-md-3 col-sm-6 col-xs-12">{$language.lblExportCsv}</label>
		
		<div class="rightside01 col-md-7 col-sm-6 col-xs-12"><p>{$language.lblExportFieldMsg} <strong>{$language.lblProductID}</strong>, <strong>{$language.lblSKU}</strong> {$language.lblAnd} <strong>{$language.lblCombination}</strong> {$language.lblExpolbl}. 
                </p>
                <div class="lis-ex-field">
                  <a href="javascript:void(0)" class="selectall" rel="cselect"><span class="icon-tick"></span> {$language.lblcheckfileds}</a> / <a rel="cselect" href="javascript:void(0)" class="uncheckall"><span class="icon-close2"></span> {$language.lbluncheckfileds}</a>
<ul class="clearfix">
                	<li class="col-xs-12 col-md-4 col-sm-6 margin-bottom">{form->checkbox label="true" name="layout_data" 
	options=$comboexportFields class="exportcselect" datatab="c" seperator="</li><li class='col-xs-12 col-md-4 col-sm-6 margin-bottom'>"} 
                </ul>
                </div>
				</li>	
              <div class="form-group margin-top clearfix">
                <div class="submit-block clearfix"> 
                	<div class="rightside01">{form->submit name="submit_export" value="{$language.lblExport}" class="btn btn-primary"} 
                    
                </div>
                </div>
                <!--End:right-->
              </div>
            </ul>{form->close}
           </div>  
         </div>
	  </div>
	  
	  
          <!--End:From Listing-->
          </div>
      </div>
      <!--End:Border 2-->
   
     <div class="tab-content container-section margin-top" {if $itab|default:''} style="display:block" {else} style="display:none" {/if}>
      
      <div class="inner_content_wrapper full_width">  <h3 class="border-bottom">{$language.lblExProductImages}</h3>
          <div id="common_message" ></div>
          <div class="form_listing form_listing03">
          {form->start name="imageExport" method="post" action=""}	 
	  {assign var="count" value=0}
	  {foreach from=$imagexportArray key="k" item="i"}    
	  {$imgexportFields[$count][1]=$k}
	  {$imgexportFields[$count][0]=$i}
	  {assign var="count" value=$count+1}
	  {/foreach}
            <ul> {form->hidden  name="export_options[filename]" value="products_images_general_08022013.csv"}
		{form->hidden  name="pattern_id" value="product_images"} 
	       <div class="form-group clearfix">
                <label class="leftside01 control-label col-md-3 col-sm-6 col-xs-12">{$language.lblAttributeSets}</label>
                <!--End:Left-->
                <div class="rightside01 col-md-4 col-sm-6 col-xs-12">
                  {form->select  id="attributeSetID3" tabindex="2" name="export_options[attributeSetID]"  options=$resAttrSet  caption="->{$language.msgAttributeSet}" validate="required" class="form-control" error=$language.msgAttributeSet}
                 </div>
                <!--End:right-->
              </div>	       
              <div class="form-group clearfix">
                <label class="leftside01 control-label col-md-3 col-sm-6">{$language.lblExportCsv}</label>
		
		<div class="rightside01 col-md-7 col-sm-6"><p>{$language.lblExportFieldMsg}<strong>{$language.lblProductID}</strong>, <strong>{$language.lblSKU}</strong>,<strong>{$language.lblPairtype}</strong> {$language.lblAnd} <strong>{$language.lblDetailedImage},{$language.lblPreviewImage}</strong> {$language.lblExpolbl}. 
                </p>
                <div class="lis-ex-field">
                  <a href="javascript:void(0)" class="selectall" rel="iselect"><span class="icon-tick"></span> {$language.lblcheckfileds}</a> / <a href="javascript:void(0)" rel="iselect" class="uncheckall"><span class="icon-close2"></span> {$language.lbluncheckfileds}</a>
<ul class="clearfix">
                	<li class="col-xs-12 col-md-4 col-sm-6 margin-bottom">{form->checkbox label="true" name="layout_data"
	options=$imgexportFields class="exportiselect" datatab="i" seperator="</li><li class='col-xs-12 col-md-4 col-sm-6 margin-bottom'>"} 
    </li>
                </ul></div>
				
				</div>
                <!--End:right-->
              </div>				  
              <div class="form-group clearfix">
                <div class="submit-block clearfix"> 
                    <div class="leftside01 col-md-3 col-sm-6 hidden-xs">&nbsp;</div>
                	<div class="rightside01 col-md-4 col-sm-6">{form->submit name="submit_export" value="{$language.lblExport}" class="btn btn-primary"}                     
                </div>
                </div>
                <!--End:right-->
              </div>
            </ul>{form->close}
           </div>  
          <!--End:From Listing-->
          </div>
      </div>
      <!--End:Border 2-->
    </div>
   
      
      
     </div>
    </div>
    </div>
    <!--End: left Block-->
  </div> </div>
            
          <!--End:From Listing-->
          </div>
      </div>
      <!--End:Border 2-->
    </div>
    <!--End: left Block-->
  </div>
  <!--***********************************************************************END CONTAINER SECTION******************************************************-->
  <!--End:Content Container-->
  {include file='CommonBottom.tpl'}
</div>
<!--End:Outer Container-->
<script type="text/javascript">
{literal}
$(function(){
	$('.selectall').click(function () {
	  var id=$(this).attr('rel');
	   $('.export'+id).prop('checked','checked');
      });
	$('.uncheckall').click(function () {
	  	  var id=$(this).attr('rel');
	   $('.export'+id).prop('checked',false);
      });
	 $('.side_wrapper ul li a[rel=subscribe-export]').addClass('selected'); 
	  setSideMenu();
	 });
{/literal}
$(".tab-anchor").click(function () {
	$(".tab-anchor").removeClass("active");
	$(this).addClass("active");
  var index = $(".tab-anchor").index(this);
  $(".tab-content").hide();
  $(".tab-content:eq("+index+")").fadeIn();
});
</script>

<script type="text/javascript">
    $(document).ready(function() {
        $('#searchProductCategory').multiselect();
    });
</script>
<script type="text/javascript">
		$(document).ready(function(){
	  $(document).on('click', ".expand", function () {
		if($(this).hasClass('colapse')){
			$(this).removeClass('colapse');
			$(this).closest('li').find('ul:first').addClass('hide');
		}
		else{
			$(this).addClass('colapse'); 
			$(this).closest('li').find('ul:first').removeClass('hide');
		}
	});
	
    $(document).on('click', ".expandable", function () {
        var id = $(this).attr("id");
        $("#div" + id).fadeIn();
        $(this).removeClass("expandable").addClass("collapsable");
    });
	$(document).on('click', ".collapsable", function () {
        var id = $(this).attr("id");
        $("#div" + id).fadeOut();
        $(this).removeClass("collapsable").addClass("expandable");
    });		
		$(document).on('keyup',"#filterCategories",function(){
		
		var val = $(this).val();
		$(".li_catIDs").each(function() {
		//console.log($(this).attr('catname').toLowerCase().indexOf(val));
		if ($(this).attr('catname').toLowerCase().indexOf(val) > -1) {
			if($(this).attr('data-level') == 0){
				$(this).removeClass("hide").addClass("show");
			}
		}else{
			if($(this).attr('data-level') == 0){
				$(this).removeClass("show").addClass("hide");
			}
		}			
		});
	})	
        });
	</script> 
<script type="text/javascript" src="{$view_javascript}/bootstrap-multiselect-min.js"></script> 
{include file='CommonJavaScriptBottom.tpl'} 
{html->messages_script id="common_message"}
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script> 
{form->validate_script form="productExport"}
{form->validate_script form="ComboExport"}
{form->validate_script form="imageExport"}
</body>
</html>
