<!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" />
<title>{$language.lblAdmin} : {$language.lblLocalizationSettings} : {$language.lblDeliveryZones}</title>
{include file='CommonStyles.tpl'}
{include file='CommonCustomStyles.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}/right-menu.css" />
</head><body>
<div class="outer_container"> {include file='CommonTop.tpl'}
  <!--End:Header Container-->
  <!--***********************************************************************START CONTAINER SECTION******************************************************-->
  <div class="content_container2 clearfix">
    <div class="right-sidebar localization">
      <div class="side_wrapper"> {html->anchor href="deliveryzone/new/" priv_href="deliveryzone/new/" class="custom-btnt" content="<strong><span class='add'></span>{$language.lblAddNewDeliveryZone}</strong>" title=$language.lblAddNewDeliveryZone}
        {include file='localizationRighLinks.tpl'} </div>
        
    </div>
    <!--End: Right Block-->
    <div class="left_wrapper">
      <div class="content_wrapper">
        <h2>{$language.lblDeliveryZones} </h2>
        <div id="common_message"></div>
         {form->start name="formDeliveryzoneListSearch" action="" method="post"}
        <div class="search_container">
          <div class="inner wide-box">
           <ul class="clearfix">
            	<li class="column">
                	<p class="label-field01">{$language.lblZoneMode}</p>
                    <span class="form-field01">{form->select name="deliveryZoneMode"  options="->Any~*Global->{$language.lblGlobal|default:''}~*Merchant->{$language.lblBusiness}" class="select-box"}</span>
                </li>
                    <li class="column" id="AjaxMerchant" {if $deliveryZoneMode!='Merchant'}  style="display:none"{/if}>
                	<p class="label-field01">{$language.lblBusiness}</p>
                    <span class="form-field01">{form->select name="merchantID" caption="->Select"  options=$resBusiness class="select-box"}</span>
                </li>
                <li class="column" ><p class="label-field01">{$language.lblDeliveryZoneName}</p>
                    <span class="form-field01">{form->textbox name="deliveryZoneName" class="text-box"} </span>
              </li>              
               <li class="column" ><p class="label-field01">{$language.lblCountry}</p>
                    <span class="form-field01">
                    {form->select onchange="listStates(this.value,'');" name="countryID" caption="->Select"  options=$resCountry class="select-box"}
                    </span>
              </li>
                <li class="column" ><p class="label-field01">{$language.lblState}</p>
                    <span class="form-field01">
                    {form->select name="stateID" options="->Select" class="select-box"}<span id="loadProcessImage"></span>
                     {form->hidden name="statehidValue" value=$stateID}
                    </span>
              </li>   
                     <li class="column" ><p class="label-field01">{$language.lblZipCode}</p>
                    <span class="form-field01">{form->textbox name="zipcode" class="text-box"} </span>
              </li>  
              <li class="column"><p class="label-field01">&nbsp;</p>
                	 {form->submit name="submitSearch" form="formDeliveryzoneListSearch" id="submit" class="button01"  value="{$language.lblSearch}"}
                  {html->anchor href="deliveryzone/index/" class="action-link" content="{$language.lblListAll}"}
                  </li>
           </ul>
        </div>
      </div>
        {form->close}  
        {include file='ContentLanguageOptions.tpl'}
          <div class="leftblock ">
          <div class="clear"></div>
        {form->start name="formDeliveryzoneList" method="post"}
        {if $rsDeliveryzone}
        <div class="grid_table00">
          <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
            <tr>
			{if $editPrivilege || $deletePrivilege}
              <th align="left" valign="middle"  class="checkbox_column" width="5%"> <div class="chekingdiv">
                  <ul>
                    <li> {form->checkbox id="ListStatusLinkCheckbox" name="deliveryzoneStatusAll"  options="" class="fixing_left"}
                      {html->anchor href="" id="ListStatusLink"  class="status-arw fixing_left" alt="down arrow"}
                      <ul id="ListStatusSelection"  class="check_status">
                        <li> {html->anchor href="" rel="ListActive" content=$language.lblActive}</li>
                        <li> {html->anchor href="" rel="ListInactive" content=$language.lblInactive}</li>
                        <li> {html->anchor href="" rel="ListAll" content=$language.lblSelectAll}</li>
                      </ul>
                    </li>
                  </ul>
                </div></th>
              {/if}
              <th width="25%" align="left" valign="middle" >{$language.lblDeliveryZones}</th>
			  <th width="10%" align="left" valign="middle" >{$language.lblZoneType}</th>
                           <th width="15%" align="left" valign="middle" >{$language.lblZoneMode}</th>
              <th width="35%" align="left" valign="middle">{$language.lblDescription} </th>
			  {if $editPrivilege || $deletePrivilege}
              <th width="10" align="left" valign="middle" >&nbsp;</th>
			  {/if}
            </tr>
            {foreach from=$rsDeliveryzone item="rsDeliveryzoneList" key="key1"}
            {assign var="curr_deliveryzoneID" value=$rsDeliveryzoneList.deliveryZoneID}
            <tr {if $rsDeliveryzoneList@iteration is even by 1} class="shade01" {/if}> 
			{if $editPrivilege || $deletePrivilege}
              <td align="left" valign="top" class="checkbox_column"><span id="class_checkbox">{form->checkbox name="deliveryzoneBulkStatus[]" class="deliveryzoneBulkStatus ListAll {if $rsDeliveryzoneList.deliveryZoneStatus eq 'Active'}ListActive{else}ListInactive{/if}"  options="" value=$rsDeliveryzoneList.deliveryZoneID} </span></td>
              {/if}
              <td align="left" valign="top">
				{if $editPrivilege}
					<span  class="view_{$rsDeliveryzoneList.deliveryZoneID}">
						{html->anchor href="deliveryzone/view/id/{$rsDeliveryzoneList.deliveryZoneID}/"  class="normal_link"  content="{$rsDeliveryzoneList.deliveryZoneName|wordwrap:25:"<br />
					":true}"}
					</span>
				{else}
					{$rsDeliveryzoneList.deliveryZoneName|wordwrap:25:"<br />
					":true}
				{/if}
				</td>
				<td align="left" valign="top"><span  class="view_{$rsDeliveryzoneList.deliveryZoneID}">{$rsDeliveryzoneList.deliveryZoneType}</span></td>
                                 <td align="left" valign="top"><span  class="view_{$rsDeliveryzoneList.deliveryZoneID}">
                   {$rsDeliveryzoneList.deliveryZoneMode}{if $rsDeliveryzoneList.deliveryZoneMode=='Merchant'}( {$rsDeliveryzoneList.businessKey} ){/if}</span></td>
          
              <td align="left" valign="top"><span  class="view_{$rsDeliveryzoneList.deliveryZoneID}">{$rsDeliveryzoneList.deliveryZoneDescription|wordwrap:70:"<br />
                ":true}</span></td>
				{if $editPrivilege || $deletePrivilege}
              <td align="left" valign="top"> 
				{if $editPrivilege}
					{if $rsDeliveryzoneList.taxClassCount|default:'' gt 0}
						{html->anchor alert="{$language.lblDeliveryAlert}" alt="{$language.lblDeliveryAlt}" class="status-{$rsDeliveryzoneList.deliveryZoneStatus|strtolower}"}
					{else} 
						{if  $rsDeliveryzoneList.deliveryZoneStatus eq "Active"}
							{assign var="newstatus" value="Inactive"}
							{assign var="changeStatus" value="status-active"}
						{else}
							{assign var="newstatus" value="Active"}
							{assign var="changeStatus" value="status-inactive"}
						{/if}
						{html->anchor id="{$curr_deliveryzoneID}" rel="{$newstatus}" title="{$rsDeliveryzoneList.deliveryZoneStatus}" content="" class="{$changeStatus} icon-set" task='status-change'}
					{/if}
					{html->anchor href="deliveryzone/edit/id/$curr_deliveryzoneID/" history="yes" caption="" class="edit02 icon-set" alt="Edit"}&nbsp;
				{/if}	
				{if $deletePrivilege}
					{if $rsDeliveryzoneList.taxClassCount|default:'' gt 0}
						{html->anchor alert="{$language.lblDeliveryDeleteStatus}" alt="{$language.lblGoeDeleteAlt}" class="delete-inactive" id="deliveryImage_{$rsDeliveryzoneList.deliveryZoneID}"}{form->hidden  name="delid[]" value=$rsDeliveryzoneList.deliveryZoneID}
					{else}
						{html->anchor confirm="{$language.lblDeliveryDeleteAlert}"  href="deliveryzone/destroy/id/$curr_deliveryzoneID/" alt="Delete" class="delete02 icon-set" id="deliveryImage_{$rsDeliveryzoneList.deliveryZoneID}"}
					{/if}
				{/if}	
			</td>
			{/if}
            </tr>
            {/foreach}
            {form->hidden id="checkHidden" name="checkHidden" value=$rsDeliveryzone|@count}
          </table>
        </div>
        {if $editPrivilege || $deletePrivilege}
        
        {if $deletePrivilege && $editPrivilege}
        {assign var="statusoptions" value="->{$language.lblDonotchange}~*Active->{$language.lblActivate}~*Inactive->{$language.lblInactivate}~*Deleted->{$language.lblDelete}"}
        {else if $deletePrivilege && (!$editPrivilege)} 
        {assign var="statusoptions" value="->{$language.lblDonotchange}~*Deleted->{$language.lblDelete}"} 
        {else if (!$deletePrivilege) && $editPrivilege} 
        {assign var="statusoptions" value="->{$language.lblDonotchange}~*Active->{$language.lblActivate}~*Inactive->{$language.lblInactivate}"} 
        {/if}
        <div class="action_box"> {form->select name="deliveryZoneStatus" class="select-box width-auto" options=$statusoptions value=""}
          {form->submit name="submitBulkStatus" id="submitBulkStatus" class="update_btn_table submitBulkStatus button04"  value="{$language.lblUpdate}"} </div>
        {/if}
        <div class="fixing_right pagination_outer" > {paginate->layout  key="page"} </div>
        <div class="clear"></div>
        {else}
        <div class="message_info" id="common_message"> {$language.msgNoDeliveryZonesforlisting}</div>
        {/if}
        {form->close}
        <!--End:From Listing-->
        </div>
      </div>
    </div>
    <!--End: left Block-->
  </div>
  <!--End:Content Container-->
  {include file='CommonBottom.tpl'} </div>
<!--End:Outer Container-->
{include file='CommonJavaScriptBottom.tpl'}
{form->rootpath_script}
<script type="text/javascript" src="{$view_javascript}/deliveryzone.page.js"></script>
<script type="text/javascript" src="{$view_javascript}/table.plugin.js"></script>
<script type="text/javascript">
var lblSelectAction	= '{$language.lblSelectAction}';
var lblSelectItem = '{$language.lblSelectItem}';
var lblDeliveryDeleteAlert = "{$language.lblDeliveryDeleteAlert}";
{literal}
$(document).ready(function(){
    $('#deliveryZoneMode').change(function(){
        if($(this).val()=='Merchant')
        $('#AjaxMerchant').show();
        else  $('#AjaxMerchant').hide();
    })
	$('.side_wrapper ul li a[rel=deliveryzone]').addClass('selected'); 
	setSideMenu();
});
{/literal}
</script>
{html->messages_script id="common_message"}
</body>
</html>
