<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{assign var="brandID" value=$brandID|default:''}
<title>{$language.lblAdmin} : {if $brandID>0}  {$language.lblBrandEdit}  {else} {$language.lblBrandAddNew} {/if}</title>
{include file="CommonStyles.tpl"}
{include file="CommonCustomStyles.tpl"}
{include file="CommonJavaScript.tpl"}
<link rel="stylesheet" type="text/css" href="{$view_styles}/add-edit.css" media="screen" />	
</head><body>
<div class="outer_container"> {include file='CommonTop.tpl'} 
  <!--End:Header Container--> 
  <!--*************************************************START CONTAINER SECTION*************************************************-->
  <div class="content_container equalHeight">
    <div class="content_wrapper">
     <noscript>
      <div class="message_info">{$language.lblJsEnable} !!</div>
      </noscript>
      <div class="fixing_right space-t-l">{include file='ContentLanguageOptions.tpl'}</div>
      <h2>
		{if $brandID>0}
			{$language.lblBrandEdit}
		{else}	
			{$language.lblBrandAddNew} 
			
		{/if}
		</h2>
	{form->start name="formBrand" action="" method="post"}
	 <div class="inner_content_wrapper"> 
     <div id="common_message"></div>
 <div class="tab-content-outer  clearfix ">
 		<div class="left_block fixing_left">
              <div class="tab-block-01">
                <h2>{html->anchor rel="product-details-save" caption="<span>&nbsp;</span>{$language.lblBrandDetails}"}</h2>
              </div>
              <ul class="left-tab" id="maintab">
                <li class="sub">{html->anchor rel="basic-info" caption="<span>{$language.lblGeneral}</span>" class="left-tab-a active" id="general"}</li>
                 <li class="sub">{html->anchor rel="basic-info" caption="<span>{$language.lblFeaturedInCategory}</span>" class="left-tab-a" id="qtyPrice"}</li>  
               
              </ul>
            </div>
            <!-- tab General tab-1 starts -->              
             <div class="right_block fixing_right">
		   <div id="basic-info-section" class="save-floating-section">
        <div class="cm-buttons-floating" id="menuSubmit">
			<div class="submit-position"> 
				{form->submit 
					name="submitBrand" 
					id="submit"  
					class="curve-3 button03" 
					value="{$language.lblSave}" 
					tabindex="9"} 
				
				{$language.lblOr}
				
				{html->anchor 
					priv_href="brand/index/" 
					href="/brand/index/" 
					tabindex="10"
					content=$language.lblCancel} 
			</div>
        </div>
        <div class="cm-buttons"> </div>
        </div>
            <div  class="tabpane" style="display:block">
            
              <div class="tabpane_inner"> <span class="BreadCrump">
                <ul class="clearfix">
                  <li> {$language.lblBrandDetails} &raquo; </li>
                  <li> <span> {$language.lblGeneral} </span></li>
                </ul>
                </span>
                <div class="form_listing">
			<ul class="levl-00">
			<li class="clearfix">
				<div class="left1 mandatory">
					{$language.lblBrandbrandName}
				</div>
				<!--End:Left-->
				<div class="right1"> 
					{form->textbox
						name="brandName" 
						class="textbox" 
						tabindex="1"
						validate="required" 
						error="{$language.errBrandbrandNameRequired}"} 
				</div>
				<!--End:right-->
			  </li>
			 <li class="clearfix">
				<div class="left1 mandatory">
					{$language.lblBrandbrandKey}
				</div>
				<!--End:Left-->
				<div class="right1"> 
					{form->textbox
						name="brandKey" 
						class="textbox" 
						tabindex="2"
						validate="required~*callback_checkBrandKeyExist" 
						error="{$language.errBrandbrandKeyRequired}~*{$language.errBrandbrandKeyExists}"} 
				</div>
				<!--End:right-->
			  </li> 
			   <li class="clearfix">
					<div class="left1">
						{$language.lblParent}
					</div>
					<div class="right1"> 
						{form->select 
						class="{$class} selectbox-width" 
						name="parentID" 
						options=$listBrand  
						caption="->{$language.lblSelectBrand}"}
					</div>
			   </li> 
			 <li class="clearfix">
				<div class="left1">
					{$language.lblBrandbrandIcon}
				</div>
				<!--End:Left-->
				<div class="right1"> 
                  {form->upload_image
						name		  	= "brandIcon" 
						path		  	= "uploads/brand/small/"
						file		  	= $brandIcon|default:'' 
						delete_icon_title= "{$language.lblDelete}"
						tabindex	  = "3"}						
				</div>
				<!--End:right-->
			  </li> 
			 <li class="clearfix">
				<div class="left1 ">
					{$language.lblBrandbrandDescription}
				</div>
				<!--End:Left-->
				<div class="right1"> 
               {form->editor 
						name="brandDescription" 
						id="brandDescription" 
						skin=2 mode="simple" 
						} 
					
				</div>
				<!--End:right-->
			  </li>
			<li class="clearfix">
				<div class="left1">
					{$language.lblShippingCharge}
				</div>
				<!--End:Left-->
				<div class="right1"> 
					{form->textbox  class="textbox" maxlength="5" name="shippingCharge"  validate="isPrice" error=$language.errValidAmount }
				</div>
				<!--End:right-->
			  </li>
			<li class="clearfix">
				<div class="left1">
					{$language.lblBrandmetaTitle}
				</div>
				<!--End:Left-->
				<div class="right1"> 
					{form->textbox
						name="metaTitle" 
						class="textbox" 
						tabindex="5"
						} 
				</div>
				<!--End:right-->
			  </li>
			<li class="clearfix">
				<div class="left1 ">
					{$language.lblBrandmetaDescription}
				</div>
				<!--End:Left-->
				<div class="right1"> 
					{form->textarea 
						name="metaDescription" 
						id="metaDescription" 
						tabindex="6"
						} 
				</div>
				<!--End:right-->
			  </li>
			<li class="clearfix">
				<div class="left1 ">
					{$language.lblBrandMetaKeyword}
				</div>
				<!--End:Left-->
				<div class="right1"> 
					{form->textarea 
						name="searchKeywords" 
						id="searchKeywords" 
						tabindex="7"
						} 
				</div>
				<!--End:right-->
			  </li>
			
			  <li class="clearfix">
				<div class="left1 mandatory">
					{$language.lblBrandstatus}
				</div>
				<!--End:Left-->
				<div class="right1"> 
					<div id="perioddiv">
					{form->radio 
						name="status" 
						class="customradio"
						tabindex="8"
						value="A"
						options="A->{$language.lblActive}~*I->{$language.lblInactive}" 
						} 
					</div>
				</div>
				<!--End:right-->
			  </li> 
					</ul>
					</div>
				</div>
				<!--End:right-->
		  </div>
          <div class="tabpane" style="display:none;">
          <div class="tabpane_inner"> <span class="BreadCrump">
            <ul class="clearfix">
             <li> {$language.lblBrandDetails} &raquo; </li>
                  <li> <span> {$language.lblFeaturedInCategory} </span></li>
            </ul>
            </span>
            <div class="form_listing">
              <ul class="levl-00">
                <li>
                  <h3><span>{$language.lblFeaturedInCategory}</span></h3>
                </li>           
                <li class="clearfix">
				<div class="left1">
					{$language.lblFeaturedInCategory}
				</div>					
					
					

				<div class="right1"> 

				 <div class="category-section pos-relative">
				  <div class="div-city">
                      <div class="fixed-section">
                          <h2>{$language.lblProductCategory}</h2>
                      {assign var="categoryValue" value=""}

				{form->textbox name="filterCategories" class="filterBrands text-box margin-bottom" placeholder="Search Categories"}
                          </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}"></span>
									{else}
									<span class="expand colapse {if !(!empty($productCategory['children']) && is_array($productCategory['children']))}hide{/if}"></span>
									{/if}
																		  
									 {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="categoryIDs" class="categoryTree" id="category" options=$productCategory.productCategoryID|cat:"->"|cat:"&nbsp;"|cat:$categoryName value="{if $productCategory.productCategoryID|in_array:$resProductcategory}{$productCategory.productCategoryID}{/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>
				</li>						
					
					
					
					
					
					
                    </div>
                    
            </div>
            </div>
		  <!--End:From Listing--> 
		</div>
        </div>
         
        </div>
        
		<!--End:Border 3--> 
	  </div>
	  <!--End:Border 2--> 
	  {form->close} 
	  </div>
	<!--End: left Block-->
	<div class="clear"></div>
  </div>
  <!--End: left Block-->
  <div class="clear"></div>
</div>
<!--*********************************************END CONTAINER SECTION******************************************************--> 
<!--End:Content Container--> 
{include file='CommonBottom.tpl'}
</div>
<!--End:Outer Container--> 
{include file='CommonJavaScriptBottom.tpl'} 
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/jquery.autoSuggest.js"></script>

<script type="text/javascript" src="{$common_js}/underscore.plugin.js"></script> 
{form->basepath_script}
{form->validate_script form='formBrand'}
{html->messages_script id="common_message"}
{form->editor_script names="brandDescription"}

<script type="text/javascript" src="{$view_javascript}/custom-radiobutton.js"></script>
<script type="text/javascript">
	{literal}
	$(function(){
		 $('#perioddiv input').customInput('');
	});	
	{/literal}
	var preFillCategory ="";
	var lblSelect ="{$language.lblSelect}";
	$(document).ready(function () {
	$(document).on("click","ul.left-tab>li>a",function () {
        $("ul.left-tab>li>a").removeClass("active");
        $(this).addClass("active");
		var thisIndex = $("ul.left-tab>li>a").index(this);
        $(".tabpane").hide();
        $(".tabpane:eq(" + thisIndex + ")").show();
		setActiveTabSaveButton();
		});
setActiveTabSaveButton();
});
function setActiveTabSaveButton()
{
	var thisRel =   $(".left-tab li a.active").attr("rel");
	var cmButtonsFloating = $("#"+thisRel+"-section").children(".cm-buttons-floating");
	var cmButtons = $("#"+thisRel+"-section").children(".cm-buttons");
	$.scrollPane({
			floating: cmButtonsFloating,
			fixed: cmButtons,
			padding: 71
			});
	$.fn.hasScrollBar = function()
	{
		var thisRel =   $(".left-tab li a.active").attr("rel");
		toggleSaveButton(thisRel);
	}
	var thisRel =   $(".left-tab li a.active").attr("rel");
	toggleSaveButton(thisRel);
}
function toggleSaveButton(thisRel)
{
	$(".save-floating-section").hide();
	$("#"+thisRel+"-section").show();
}
</script>

<script type="text/javascript" src="{$common_js}/uploadImage.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/brandadd.page.js"></script> 
</body>
</html>
