<!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="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="Sat, 1 Jan 2000 00:00:00 GMT">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblAdmin}  : {$language.lblMerchantTypes}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/grid_listing.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/right-menu.css" />
{include file='CommonCustomStyles.tpl'}
{form->rootpath_script}
{form->basepath_script}
</head>
<body>
<div class="outer_container"> 
  {include file='CommonTop.tpl'} 
  <!--End:Header Container--> 
  <!--***********************************************************************END HEADER CONTAINER******************************************************-->
  <div class="content_container2 clearfix"> 
    <!-- left wrapper starts--> 
     <!-- right side btn starts--> 
    <div class="right-sidebar">
      <div class="side_wrapper"> {html->anchor priv_href="businesstype/new/" href="businesstype/new/" title="{$language.lblAddBusinessType}" class="custom-btnt" content="<strong><span class='add'></span>{$language.lblAddBusinessType}</strong>"}  
  {include file='BusinessRightLinks.tpl'}      
        <!-- right side btn ends--> 
      </div>
    </div>
    <div class="left_wrapper">
      <div class="content_wrapper">
      {include file='ContentLanguageOptions.tpl'}
        <h2>{$language.lblMerchantTypes}</h2>
        <div id="common_message" ></div>
		{if $rsBusinessType|count==0}
        <div id="common_message" class="message_info"> {$language.msgNoRecords}</div>
        {else}
        {form->start name="frmBusinessType" action="" method="post"}            
        {form->hidden name="selectedBusinessType"  class="textbox02" value=$selectedBusinessType}
        <div class="grid_table00">
          <table id="table_bustype" width="100%" border="0" cellspacing="0" cellpadding="0" >
            <thead>
              <tr>
                <th align="left" valign="middle"  width="40%" >{$language.lblBusinessType}</th>
                <th align="left" valign="middle" >{$language.lblDescription}</th>
				 {if $deleteprivilege || $editprivilege} 
                <th align="left" valign="middle"  width="65"> </th>{/if}
              </tr>
            </thead>
            <tbody>
            {assign var ="ni" value=0}              
            {assign var ="nj" value=0}  
            {assign var ="link" value=$link|default:''}  
            
            {if $selectedBusinessType} 
			{assign var="link" value="type/"|cat:$selectedBusinessType|cat:"/"}
			{/if}              
            {if $page} {assign var="link" value=$link|cat:"page/"|cat:$page|cat:"/"}{/if}             
            {section name=i loop=$rsBusinessType start=0}              
            {assign var ="nf" value=$ni+$nj}              
            {if $rsBusinessType[i].sub|@count|default:0>0}{assign var="cssForParent" value="parent"}{else}{assign var="cssForParent" value=""}{/if}              
            {form->hidden id="hidSelectedBusinessType" name="hidSelectedBusinessType" value=$selectedBusinessType}
              <tr id="row{$rsBusinessType[i].businessTypeID}"  {if $ni%2} class="{$cssForParent}" {else}  class="{$cssForParent}"  {/if}>
             
              <td align="left" valign="top">
              {if $rsBusinessType[i].sub|@count|default:0 > 0}
              <strong>
              {$rsBusinessType[i].businessTypeName|unescape:"html"}
              
              {html->anchor href="" class="downarrow" id="child-row{$rsBusinessType[i].businessTypeID}" content="<span class='down-arw'></span>"}
              </strong> 
              {else}
                {$rsBusinessType[i].businessTypeName|unescape:"html"}                  
                {/if}<br /></td>
              <td align="left" valign="top">{$rsBusinessType[i].businessTypeDescription|unescape:"html"}<br /></td>
			  {if $deleteprivilege || $editprivilege} 
              <td align="left" valign="top">
  			{if $rsBusinessType[i].businessTypeStatus=="Active"}
             {assign var="classstatus" value="status-active hide-txt"} 
             {assign var="statusValue" value=$language.lblActive}
            {else} 
             {assign var="classstatus" value="status-inactive hide-txt"} 
             {assign var="statusValue" value=$language.lblInactive}
            {/if}
			 {if $editprivilege}
              {if $rsBusinessType[i].sub|@count|default:0 > 0} 
              {html->anchor task="status-change" class="{$classstatus} icon-set" busTypeID="{$rsBusinessType[i].businessTypeID}" title="{$statusValue}" content=""}        
                {else} 
               {html->anchor  task="status-change" class="{$classstatus} icon-set" busTypeID="{$rsBusinessType[i].businessTypeID}" title="{$statusValue}" content=""}
                {/if}
               {html->anchor href="businesstype/edit/id/{$rsBusinessType[i].businessTypeID}/" title=$language.lblEditBusinessType class="edit02 icon-set"  content=""} 
			   {/if}
			   {if $deleteprivilege} 
                {assign var="errorBusinessDelete" value=$language.errorBusinessDelete}
                {if $rsBusinessType[i].sub|@count|default:0 > 0}  
                {html->anchor  task='delete' id="businesstype_{$rsBusinessType[i].businessTypeID}" class="businesstype_delete delete02 icon-set"  title=$language.lblDelete}          
                {else}                  
                {html->anchor id="{$rsBusinessType[i].businessTypeID}" title=$language.lblDelete  task='delete' content=""  class="delete_button delete02 icon-set"}
                {/if}{/if} </td>{/if}
            </tr>
            {assign var ="n" value=$ni}              
            {assign var ="ni" value=$ni+1}
            {section name=j loop=$rsBusinessType[i].sub|default:0 start=0}              
            {assign var ="nf" value=$ni+$nj}              
            {assign var ="nj" value=$nj+1}
            <tr class="child-row{$rsBusinessType[i].businessTypeID}   {if $n%2} shade01{/if} " >
              <td align="left" valign="top" class="sub"><span class="sub-level"></span> {$rsBusinessType[i].sub[j].businessTypeName|unescape:"html"} </td>
              <td align="left" valign="top">{$rsBusinessType[i].sub[j].businessTypeDescription|unescape:"html"} </td>
			  {if $deleteprivilege || $editprivilege} 
              <td align="left" valign="top">
              {if $rsBusinessType[i].sub[j].businessTypeStatus=="Active"} 
              {assign var="subclassstatus" value="status-active hide-txt"} 
              {assign var="substatusValue" value=$language.lblActive}
              {else} 
              {assign var="subclassstatus" value="status-inactive hide-txt"} 
              {assign var="substatusValue" value=$language.lblInactive}
              {/if}
			   {if $editprivilege}
              {if $rsBusinessType[i].sub[j].subBusinesscount>0}
              		{assign var="errorBusTypeStatus" value=$language.errorBusTypeStatus|default:''}
                	{html->anchor  class="{$subclassstatus} icon-set" busTypeID="{$rsBusinessType[i].sub[j].businessTypeID}" title="{$substatusValue}"  alert=$errorBusTypeStatus caption=""}
              {else}
              {html->anchor class="{$subclassstatus} icon-set"  busTypeID="{$rsBusinessType[i].sub[j].businessTypeID}" title="{$rsBusinessType[i].businessTypeStatus}"}
              {/if}
              {html->anchor href="businesstype/edit/id/{$rsBusinessType[i].sub[j].businessTypeID}/" title=$language.lblEditBusinessType class="edit02 icon-set"}
                {/if}
				
				{if $deleteprivilege} 
                {if $rsBusinessType[i].sub[j].subBusinesscount>0}
                	{assign var="errorBusinessDelete" value=$language.errorBusinessDelete}
                	{html->anchor class="delete02 icon-set"  alert=$errorBusinessDelete caption="" title=$language.lblDelete}
                {else}
                	{html->anchor id="{$rsBusinessType[i].sub[j].businessTypeID}" rel="/businesstype/destroy/id/{$rsBusinessType[i].sub[j].businessTypeID}/"|cat:$link task='delete' title=$language.lblDelete class="delete_button delete02 icon-set"} 
                    
                {/if}{/if}
                 </td>{/if}
            </tr>
            {/section}            
            {/section}
              </tbody>            
          </table>
        </div>
          {form->close}      
        {/if} 
        <!--End: Right Block--> 
       </div>
    </div>
  </div>
  <!--End:Content Container--> 
  {include file='CommonBottom.tpl'} </div>
<!--End:Outer Container-->
<div id="test" style="display:none;">
<div id="popupFeaturedLink">
  <div class="producttype-pop">
  <div id="msgtest" class="message_info" style="display:none">{$language.lblSelectParentBusinessType}</div>
  <ul>
  <li class="clearfix"> 
       
        <div class="inner-left fixing_left"><strong>{$language.lblSelectNewBusinessType}</strong></div>
        <div class="inner-right fixing_right"> {form->select name="selectFeaturedLink" id="selectFeaturedLink" class="selectbox"}</div>
      </li>
     <li class="clearfix"> 
      	<div class="inner-right fixing_right"> <div class="submit-block clearfix">  
          {form->button name="update" value="{$language.lblUpdate}" class="update_btn_tables curve-3"} 
      {$language.lblOr} 
       {form->button name="cancel"  onclick="parent.$.colorbox.close();" class="action-link3" value="{$language.lblCancel}" id="popup_cancel2"}
          </div>
          </div>
      </li>
  	
  </ul>
	
   
      </div>
</div>
</div>
{html->messages_script id="common_message"} 
{include file='CommonJavaScriptBottom.tpl'}
<script type="text/javascript">
var msgConfirmsubTypes='{$language.lblmsgConfirmsubTypes}';
var msgConfirmsub='{$language.lblmsgConfirmsub}';
	var statusChange="{$language.msgBusinessTypeStatusUpdate}";	
	var msgBusinessTypeDelete="{$language.msgBusinessTypeDelete}";
	var msgCouldNotInactivate="{$language.msgCouldNotInactivate|default:''}";
		var msgCouldNotDelete="{$language.msgCouldNotDelete|default:''}";
		var msgSelectSearchCriteria="{$language.msgSelectSearchCriteria}";
		var msgSelectItem="{$language.msgSelectItem}";
		var lblSelectAction="{$language.lblSelectAction}";
		var lblSelectParentBusinessType="{$language.lblSelectParentBusinessType}";
		var deleteText = "{$language.lblDelete}";
		var message = "{$language.lblMessage}";
		var msgAlert = "{$language.lblAlert}";
		var selectBusType = "{$language.lblSelectBusinessTypes}";
		var activeText = "{$language.lblActive}";
		var inactiveText = "{$language.lblInactive}";
		var expandOrCollapse = "{$language.lblExpandOrCollapse}";
</script> 
<script type="text/javascript" src="{$view_javascript}/jquery.colorbox.js"></script> 
<script type="text/javascript" src="{$view_javascript}/businesstype.page.js"></script> 
<script type="text/javascript">
{literal}
$(document).ready(function(){
		$(".custom-btnt,.edit02").colorbox({iframe:true, innerWidth:"60%", innerHeight:400});
});
{/literal}
</script>
</body>
</html>
