<!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="productCategoryID" value=$productCategoryID|default:''}
<title>{$language.lblAdmin} : {if $productCategoryID>0} {$language.lblEditProductCategory}   {else} {$language.lblAddProductCategory}{/if}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<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}/ui.daterangepicker.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/add-edit.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/chosen.css" />
<script src="{$view_javascript}/chosen.pluggin.js" type="text/javascript"></script> 
{include file='CommonCustomStyles.tpl'}
</head>
<body>
    
<div class="outer_container">
	{include file='CommonTop.tpl'} 
	<!--End:Header Container--> 
	<!--***********************************************************************END HEADER CONTAINER******************************************************-->
	<div class="content_container">
		<div class="content_wrapper">
			<div class="fixing_right">
				{include file='ContentLanguageOptions.tpl'}	
			</div>
			<h2>   {if $productCategoryID>0} {$language.lblEditProductCategory}   {else} {$language.lblAddProductCategory}{/if}</h2>
			<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 priv_href="productcategory/index/" href="productcategory/index/" content="{$language.lblProductCategory}"}</h2>
					</div>
					<ul class="left-tab" id="maintab">
						<li class="sub first-item">{html->anchor rel="product-category" class="left-tab-a active" id="basicInfo" caption="<span>{$language.lblBasicInfo}</span>"}</li>  
						<li class="sub first-item">{html->anchor rel="product-category" class="left-tab-a " id="displaySettings" caption="<span>{$language.lblDisplaySettings}</span>"}</li>  
						<li class="sub first-item">{html->anchor rel="product-category" class="left-tab-a " id="widget" caption="<span>{$language.lblAssignWidget}</span>"}</li>  
					</ul>
				</div>
				<div class="right_block fixing_right">
					{form->start name="formProductCategorySubmit" action="" method="post" rel="product-category"}
						{form->hidden name="productCategoryID" value=$productCategoryID}
							<div id="product-category-section" class="save-floating-section">
								<div class="cm-buttons-floating" id="menuSubmit">
									<div class="submit-position"> {form->submit  name="submitProductCategory" id="submit"  class="curve-3 button03" value="{$language.lblSave}" tabindex="1"} 
										{$language.lblOr} {html->anchor  href="productcategory/" id="cancel"  class="cancel" name="cancelProductType" tabindex="7" caption="{$language.lblCancel}"}
									</div>
								</div>
								<div class="cm-buttons"> </div>
							</div>
							
							<div class="tabpane" style="display:block;">
								<div class="tabpane_inner">
									<div class="form_listing">
									<span class="BreadCrump">
										<ul class="clearfix">
											<li> {$language.lblProductCategory} &raquo; </li>
											<li>{$language.lblBasicInfo}</li>
										</ul>
									</span>
										<ul class="levl-00">
											<li>
											  <h3><span>{form->errors name='formProductCategorySubmit'}{$language.lblBasicInfo}</span></h3>
											</li>
													<li class="clearfix">
														<div class="left1 mandatory ">{$language.lblMenuBrands}</div>
														<div class="right1 fixing_right">
														{if $brandID|default:'' > 0}
														{form->select style="width:60%;" class="select" name="brandID" caption="->{$language.lblSelect}" options=$listBrand disabled="disabled" value=" $brandID"}
														{else}
														{form->select style="width:60%;" class="select" name="brandID" caption="->{$language.lblSelect}" options=$listBrand validate="required" error=$language.errFranchisee}
														{/if}
														</div>
														</li>
														
														<li class="clearfix">
														<div class="left1 mandatory ">{$language.lblProductCategory}</div>
														<div class="right1 fixing_right">{form->textbox name="productCategoryName" class="textbox width-60per" maxlength="50" validate="required" error=$language.errProductCategoryName tabindex="1"} </div>
														</li>
														<li class="clearfix">
															<div class="left1 mandatory">{$language.lblParentProductCategoryName}</div>
															<div class="right1 fixing_right"> 
																{if $productCategoryID neq 1}
																<div id="ajax-parents">
																	<select id="productCategoryParent" name="productCategoryParent" class="width-60per" onchange="checkExists();" tabindex="2" >
																		{foreach from=$resListParentProductCategory item=productCatParent}
																			{if $productCatParent.0|default:0>0}
																				<option 
																						value="{$productCatParent.0|default:0}" 
																						{if $productCatParent.0|default:0 == $productParentCategoryId|default:''}
																							selected="selected"
																						{/if} 
																						{if $productCatParent.2 == 'Inactive'}
																							class="opt_inactive"
																						{/if} 
																						{if $productCategoryID>0 && in_array($productCategoryID, $productCatParent['parents'])}
																							disabled="disabled" 
																						{/if}
																					>
																					{$productCatParent.1}
																				</option>
																			{else}
																				<option value="0" {if $productCatParent.0|default:0 == $productParentCategoryId|default:''}selected="selected"{/if} >{$language.lblRootLevel}</option>
																			{/if}
																		{/foreach}
																	</select>
																	</div>
																{else}
																	{*{$resListParentProductCategory.0.1|default:0}*}
																	{$language.lblBlogRootLevel}
																	{form->hidden name="productCategoryParent" value=0}
																{/if}
																{form->hidden name="oldCategoryParent" value=$productCategoryParent|default:''}
															</div>
														</li>
                                                                                                                
                                                                                                               {*<li class="clearfix">
                                                                                                                 <div class="left1 mandatory">{$language.lblGoogleCategory}</div>
                                                                                                                 <div class="right1 fixing_right">
                                                                                                                 {form->select caption="->{$language.lblSelect}" tabindex="1" 	name="google_category_id"  options="$resGoogleCategoryTree" validate="required" error=$language.lblGoogleCategoryErr class="choosen selectbox-width chzn-done"}     
                                                                                                                        </div>
                                                                                                                    </li>*}

														<li class="clearfix">
															<div class="left1">{$language.lblProductCategoryKey}</div>
															<div class="right1 fixing_right">{form->textbox name="productCategoryKey" onchange="keycheck();" class="textbox width-60per" maxlength="50" validate="isUrlKey" error=$language.errValidProductCategoryIDKey tabindex="3"} 
																{form->hidden name="validateKeyValue" value="0"}          
																{form->validate  name="validateKey" validate="validateKeyValue->isequal->1~*required" error=$language.errKeyAlreayExits}
																{form->hidden name="validateKeyexceptions" value="0"}          
																{form->validate  name="validateEceptions" validate="validateKeyexceptions->isequal->1~*required" error=$language.errKeyNotAllowed}
																{if $productCategoryID>0}
																	<div class="clear"></div>
																	{form->hidden name="oldCatagoryKey" value=$productCategoryKey|default:''}
																	{form->checkbox name="redirectOption" value="RP" checked="{if $settingsRedirectforurl=='Yes'}True{/if}"  tabindex="1" disabled="disabled"}
																	{$language.lblPermanentRedirect}
																{/if}
															</div>
														</li>
									<li class="clearfix">
											 <div class="left1 ">{$language.lblProductCommission}</div>
											 <div class="right1 fixing_right">
											 {form->select caption="->{$language.lblSelect}" tabindex="1" 	name="productCommissionType"  options="global->{$language.lblOverrideGlobal}~*parent->{$language.lblOverrideParentCategory}~*new->{$language.lblNewCommission}" value="Active" class="choosen selectbox-width chzn-done"}     
													</div>
												</li>	
                    <li  class="clearfix">
                      <div class="left1">
                     {$language.lblWebsiteCommission}</div>
                      <div class="right1 fixing_right">
					  {form->hidden name="productCommisionhidden" value=$globalCommisionPercentage} 
                    {form->textbox name="productCommissionRate" value=$productCommissionRate|default:'' readonly="readonly" validate="isPercentage"  error=$language.errValidCommission class="textbox width-60per disabled"}
                          
                          </div>

                    </li> 	
					<li  class="clearfix">
                    <div class="left1">{$language.lblShippingCharge}</div>
						<div class="right1 fixing_right">
							{form->textbox  class="textbox width-60per" maxlength="5" name="shippingCharge"  validate="isPrice" error=$language.errValidAmount }
						</div>
                    </li> 	
														<li class="clearfix">
															<div class="left1">{$language.lblDescription}</div>
															<div class="right1 fixing_right">{form->textarea name="productCategoryDescription" class="textbox " cols="4" rows="3" onKeyDown="limitText(this,250);" onKeyUp="limitText(this,250);" tabindex="3"} </div>
														</li>
														<li class="clearfix">
															<div class="left1">{$language.lblProductCategoryIcon}</div>
															<div class="right1 fixing_right">
																<div id="image_upload_enable"> <span  tabindex="3">
																{assign var="productCategoryIcon" value=$productCategoryIcon|default:''}
																{form->upload_image 
																	name="productCategoryIcon" 
																	validate="isImage"
																	 width="50"																	
																	error=$language.errValidImage 
																	path= "uploads/product-category/"
																	file= $productCategoryIcon	
																	size_caption=$language.lblMaximumFileSize 
																	types_caption=$language.lblFileTypes}</span> </div>
																<div id="image_upload_disable" class="image_disable_div">&nbsp;</div>
															</div>
														</li>
														<li class="clearfix">
															<div class="left1">{$language.lblProductCategoryImage}</div>
															<div class="right1 fixing_right">
																<div id="image_upload_enable"> <span  tabindex="3">
																{assign var="productCategoryImage" value=$productCategoryImage|default:''}
																{form->upload_image 
																	name="productCategoryImage" 
																	validate="isImage" 
																	error=$language.errValidImage
																	path= "uploads/product-category/"
																	file= $productCategoryImage																	 
																	size_caption=$language.lblMaximumFileSize 
																	types_caption=$language.lblFileTypes}</span> </div>
																<div id="image_upload_disable" class="image_disable_div">&nbsp;</div>
															</div>
														</li>
														<li class="clearfix">
															<div class="left1">{$language.lblMetaTitle}</div>
															<div class="right1 fixing_right">
																{form->textbox tabindex="20" name="productCategoryMetaTitle" class="textbox" value=""}
															</div>
														</li>
														<li class="clearfix">
															<div class="left1">{$language.lblMetakeywords}</div>
															<div class="right1 fixing_right">
																{form->textarea  tabindex="22" name="productCategoryMetaKeywords" class="text-area-01" cols="4" rows="4"}
															</div>
														</li>
														<li class="clearfix">
															<div class="left1">{$language.lblMetaDescription}</div>
															<div class="right1 fixing_right">
																{form->textarea  tabindex="21" name="productCategoryMetaDescription" class="text-area-01" cols="4" rows="4"}               
															</div>
														</li>
                                                                                                                <li class="clearfix">
															<div class="left1">{$language.lblCategoryFooterText}</div>
															<div class="right1 fixing_right">
                                                                                                                                {form->editor tabindex="22"  mode="simple" skin=2 name="productCategoryFooterText" id="productCategoryFooterText" value=$productCategoryFooterText|default:'' class="text-area-01"}
																
															</div>
														</li>
														{if $parentStatus|default:'' neq 'Inactive' && $productCategoryID neq 1}
															<li class="clearfix">
														{else}
															<li class="clearfix" style="display:none">
														{/if}
															<div class="left1">{$language.lblStatus}</div>
															<div class="right1 ">
																<div id="perioddiv" rel="productCategoryStatus">
																	{form->radio name="productCategoryStatus" class="customradio" options="Active->{$language.lblActive}~*Inactive->{$language.lblInactive}" value="Active"}   
																</div>
															</div>
											</li>
										</ul>
									</div>
								</div>
							</div>
							<div class="tabpane">
								<div class="tabpane_inner"> <span class="BreadCrump">
									<ul class="clearfix">
										<li> {$language.lblProductCategory} &raquo; </li>
										<li>{$language.lblDisplaySettings}</li>
									</ul>
								</span>
								<div class="form_listing">
									<ul class="levl-00">
										<li class="clearfix">
											<h3><span>{$language.lblDisplaySettings}</span></h3>
										</li> 
													<li class="clearfix">
														<div class="left1">{$language.lblUseParentCategorySettings}</div>
														<div class="right1 fixing_right top-spc">
															{form->checkbox  name="parentCategorySettings" value='Yes'}
														</div>
													</li>
													<li class="clearfix">
														<div class="left1">{$language.lblProductThumbWidth}</div>
														<div class="right1">
														{form->textbox  name="productThumbWidth" class="textbox width-100px" validate="isWholeNumber~*productThumbWidth->isNumberLimit->0,1024" error="{$language.errWidthLessThan1024}" value="{if $productCategoryID eq 0}{$settingsProductThumbWidth}{/if}"}
														</div>
													</li>
													<li class="clearfix">
														<div class="left1">{$language.lblProductThumbHeight}</div>
														<div class="right1 fixing_right">
															{form->textbox  name="productThumbHeight" class="textbox width-100px" validate="isWholeNumber~*productThumbHeight->isNumberLimit->0,1024" error="{$language.errHeightLessThan1024}" value="{if $productCategoryID eq 0}{$settingsProductThumbHeight}{/if}"}
														</div>
													</li>
													<li class="clearfix">
														<div class="left1">{$language.lblShowReviewRatingInGridList}</div>
														<div class="right1 fixing_right top-spc">
															{form->checkbox  name="showRatingCountInGrid" value="Yes" checked="{if $showRatingCountInGrid|default:'No' eq 'Yes'}checked{/if}"}
														</div>
													</li>
													<li class="clearfix">
														<div class="left1">{$language.lblProductGridListLayout}</div>
														<div class="right1 fixing_right">
															{form->hidden name="hiddenProductGridListLayoutID" id="hiddenProductGridListLayoutID"}
															{form->select  name="productGridListLayoutID" class="width-27per" options=$resGridLayout}
														</div>
													</li>
													<li class="clearfix">
														<div class="left1">{$language.lblProductDetailslayout}</div>
														<div class="right1 fixing_right">
															{form->hidden name="hiddenProductDetailsLayoutID" id="hiddenProductDetailsLayoutID"}
															{form->select  name="productDetailsLayoutID" class="width-27per" options=$resDetailsLayout}
														</div>
													</li>
													<li class="clearfix">
														<div class="left1">{$language.lblLayoutActiveFrom}</div>
														<div class="right1 fixing_right">
															<span class="form-field01">
																<div class="text-box-div-date">
																	{if $layoutActiveFrom|default:'' != '0000-00-00'}
																		{assign var="layoutActiveFrom" value=$layoutActiveFrom|customDate|default:''}
																	{else}
																		{assign var="layoutActiveFrom" value=''}
																	{/if}
																	{form->textbox  name="layoutActiveFrom" id="layoutActiveFrom" class="date-field width-27per" validate="isDate" error=$language.errValidDate}
																</div>
															</span>
														</div>
													</li>
													<li class="clearfix">
														<div class="left1">{$language.lblLayoutActiveTo}</div>
														<div class="right1 fixing_right">
															<span class="form-field01">
																<div class="text-box-div-date">
																	{if $layoutActiveTo|default:'' != '0000-00-00'}
																		{assign var="layoutActiveTo" value=$layoutActiveTo|customDate|default:''}
																	{else}
																		{assign var="layoutActiveTo" value=''}
																	{/if}
																	{form->textbox  name="layoutActiveTo" id="layoutActiveTo" class="date-field width-27per" validate="isDate" error=$language.errValidDate}
																	{form->hidden name="hiddenStartEndDate" value="2"}
																	{form->validate name="StartEndDatecheck"  validate="hiddenStartEndDate->isequal->0~*required" error=$language.errStartEndDate}
																</div>
															</span>
														</div>
													</li>
													<li class="clearfix">
														<div class="left1">{$language.lblPageDefaultView}</div>
														<div class="right1 fixing_right">
															{form->hidden name="hiddenPageDefaultView" id="hiddenPageDefaultView"}
															{form->select name="pageDefaultView" id="pageDefaultView" class="width-27per" options="products_only->{$language.lblProductsOnly}~*widget_only->{$language.lblWidgetsOnly}~*category_with_products->{$language.lblCategoriesWithProducts}~*widget_and_products->{$language.lblWidgetsAndProducts}~*widget_and_category_with_products->{$language.lblWidgetsAndCategoriesWithProducts}"}
														</div>
													</li>
													<li class="clearfix" id="pdtCnt" style="display:none;">
														<div class="left1">{$language.lblNumberofProductCount}</div>
														<div class="right1 fixing_right">{assign var="numberOfProductCount" value="{if $pageDefaultView|default:'' eq 'category_with_products' || $pageDefaultView|default:'' eq 'widget_and_category_with_products' }{$numberOfProductCount|default:''}{/if}"}
															{form->textbox name="numberOfProductCount" class="textbox width-100px" validate="pageDefaultView->isequal->category_with_products~*pageDefaultView->isequal->widget_and_category_with_products~*required~*isWholeNumberWithOutZero" error="{$language.errEnterProductCount}"}
														</div>
													</li>
												</ul>
											
										
								</div>
							</div>
						</div>
						<div class="tabpane">
							<div class="tabpane_inner"> <span class="BreadCrump">
								<ul class="clearfix">
									<li> {$language.lblProductCategory}&raquo; </li>
									<li>{$language.lblAssignWidget}</li>
								</ul>
								</span>
                                 <div class="drope-block-03 clearfix" >
                                 <div class="pane01">
                                 <table width="100%" border="0" cellspacing="2" cellpadding="0">
            <tbody><tr>
              <td align="left" valign="middle" class="leftpane"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="rlp-serch">
                  <tbody><tr>
                    <td align="left" valign="middle" width="175" > {form->textbox name="widgetName" id="widgetName" placeholder="{$language.lblWidgetName}" class="text-box"}
                    </td>
                    <td align="left" valign="middle" class="left" >
                    {form->button name="search" value="{$language.lblSearch}" class="button01 margin-r-10 curve-2"}
					{html->anchor class="action-link" id="reset" content="{$language.lblReset}"}
                   </td>
                  </tr>               
                </tbody></table></td>
                {if $selectedWidgetList|@Count|default:0 eq 0}              
                 {assign var="outerborder" value='outer-border'}
                 {assign var="toplabelhide" value='hide'}               
              {/if}              
              <td align="left" valign="middle" class="rightpane"><span class="fixing_right top-label ">{$language.lblDragHereCreateWidget}</span><h3>{$language.lblAssignWidget}</h3></td>
            </tr>
            <tr>
				<td align="left" valign="top">
					<div class="leftblock03 drop-div" id="divExceptAll" >
						<ul  id="product_drop_left_id" class="connect product_drop_left">
							{if $resWidgetList|default:''}
						
								{foreach $resWidgetList as $key=>$resWidget}
								
									<li id="{$resWidget.widgetID}" class="sort{$resWidget.widgetID}" ad_id="{$resWidget.widgetID}">
										{html->anchor class="remove-btn product_drop_delete hide"}
										<div class="title" >{$resWidget.widgetTitle|truncate:60} {if $resListUpcomingProduct.productTitle|default:''=='Inactive'}{/if}</div>
									</li>
								{/foreach}
							{else}
								<div class="message_info" id="widgetNotAvailable">{$language.msgNoRecords}</div>
							{/if}
						</ul>
					</div>
				</td>
				<td align="left" valign="top">
					<div class="drop-div rightblock03" id="divRightAll" >
						
						<ul id="product_drop_right_id" class='connect product_drop_right {$outerborder|default:''}'>
							{if $resGetCategoryWidgetIDs|default:''}
							{assign var="selectedWidgetIDs" value=""}
								{foreach $resGetCategoryWidgetIDs  as $key=>$resSelWidget}
	
								{assign var="widgetID" value="{$resSelWidget.widgetID}"}
								{if $key gt 0}
								{assign var="selectedWidgetIDs" value=$selectedWidgetIDs|cat:'~*'|cat:$widgetID}
								{else}
								{assign var="selectedWidgetIDs" value="{$resWidget.widgetID}"}
								{/if}

								
									<li id="{$resSelWidget.widgetID}" class="sort{$resSelWidget.widgetID}" ad_id="{$resSelWidget.widgetID}">
										{html->anchor class="remove-btn product_drop_delete"}
											<div class="title"> {$resSelWidget.widgetTitle|truncate:60}</div>
                                    </li>
									{assign var="sorthide" value='hide'}
								{/foreach}                 
							{/if}
							<span class="sort-label {$sorthide|default:''}">{$language.lblDragWidgetTxt}</span>
						</ul>
						{form->hidden name="selectedWidgetIDs" id="selectedWidgetIDs" value=$resCategoryWidgetIDs|default:''}
					</div>
				</td>
            </tr>
          </tbody></table>
                                 </div>
                                 </div>
								
								</div>
							</div>
						</div>
					{form->close}	
				</div>
			</div>
		</div>	
	</div>		
{include file='CommonBottom.tpl'}
</div>
{include file='CommonJavaScriptBottom.tpl'}
<script type="text/javascript" src="{$view_javascript}/productcategoryadd.page.js"></script>
<script type="text/javascript" src="{$view_javascript}/custom-radiobutton.js"></script>
<script type="text/javascript">
var editImageTitle	=	"{$language.lbleditImageTitle}";
var lblAlertOk='{$language.lblAlertOk}';
var lblAlertCancel='{$language.lblAlertCancel}';
var lblAlertYes='{$language.lblAlertYes}';
var lblAlertNo='{$language.lblAlertNo}';
var lblAlert='{$language.lblAlert}';
var	msgConfirmDelete	=	'{$language.lblAreYouSureToDelete}';
var lblMessage	=	'{$language.lblDelete}';
var settingsRedirectUrl = '{$settingsRedirectforurl|default:''}';
var sysKeys = '{$sysKeys}';
$(function(){
	 $('#perioddiv input').customInput('');
	});	
</script>
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script>
<script type="text/javascript" src="{$view_javascript}/urlEncode.js"></script>
<script type="text/javascript" src="{$view_javascript}/message.plugin.js"></script>
<script type="text/javascript" src="{$common_js}/uploadImage.plugin.js"></script>
{form->editor_script names="productCategoryFooterText"}
{form->validate_script form="formProductCategorySubmit"}
{html->messages_script id="common_message"}
{literal}
<script type="text/javascript">
	$(document).ready(function(){
                $('#layoutActiveFrom').datepicker();
		$('#layoutActiveTo').datepicker();
		if($('#pageDefaultView').val() == 'category_with_products' || $('#pageDefaultView').val() == 'widget_and_category_with_products'){
				$('#pdtCnt').show();
			}
			else{
				$('#pdtCnt').hide();
			}
		$('#pageDefaultView').change(function(){
			if($('#pageDefaultView').val() == 'category_with_products' || $('#pageDefaultView').val() == 'widget_and_category_with_products'){
				$('#pdtCnt').show();
			}
			else{
				$('#pdtCnt').hide();
			}
		});
                
	});
</script>
{/literal}
<script type="text/javascript" src="{$common_js}/date.js"></script>
<script type="text/javascript" src="{$view_javascript}/daterangepicker.jQuery.js"></script>
<script type="text/javascript" src="{$view_javascript}/jquery.colorbox.js"></script> 
<!--<script type="text/javascript" src="{$common_js}/underscore.plugin.js"></script> -->

</body>
</html>