<!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.lblStates}</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}/right-menu.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.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">
<div class="right-sidebar localization">
  <div class="side_wrapper"> {html->anchor priv_href="state/new/" href="state/new/countryid/$selCountry/"    title="{$language.lblAddNewState}"  content="<strong><span class='add'></span>{$language.lblAddNewState}</strong>"  class="custom-btnt add00"} 
    <!-- right side btn starts--> 
    <!-- right side btn ends--> 
    {include file='localizationRighLinks.tpl'} </div>
</div>

<!--End: Right Block-->
<div class="left_wrapper ">
  <div class="content_wrapper">
    <h2>{$language.lblStates}</h2>
    {form->start name="frmSearchCountries" action="" method="post"}
    <div class="search_container">
      <div class="inner single-box">
        <ul class="clearfix">
            <li class="column">
              <p class="label-field01">{$language.lblFilterByCountry}</p>
             <span class="form-field01">
            {form->select name="countries"  options=$rsCountries value=$selCountry class="select-box" tabindex="1"}</span>
            </li>
            <li class="column">
                   <p class="label-field01">{$language.lblState}</p>
                   <span class="form-field01">
                      {form->textbox name="stateName" class="text-box" tabindex="2"} 
                   </span>
                 </li>	
            <li class="column">              
            {form->submit name="submitCountrySearch" id="submit" class="button01"  value="{$language.lblSearch}"} 
            {html->anchor href="/state/index/" tabindex="1" caption=$language.lblListAll  class="action-link"}
          </li>
       </ul>
      </div>
    </div>
    {form->close} 
    {if $rsStates}{include file='ContentLanguageOptions.tpl'}{/if} 
    <!--End: Right Block-->
    <div class="leftblock ">
          <div class="clear"></div>
          <div id="common_message" ></div>
          {form->start name="formState" action="" method="post" error_class="message_inline_validation"}
          {form->hidden name="totalCount"}
          {form->hidden name="countryID"  class="textbox02" value=$selCountry}
          {form->hidden id="stateCount" name="stateCount"  value=$rsStates|count}
          {if $rsStates}
          
          <div class="grid_table00" >
            <table width="100%" border="0" cellspacing="0" cellpadding="0"  id="table_inline_edit"  >
              <tr>
			  {if $editPrivilege} 
                <th width="35" align="left" valign="middle"  class="checkbox_column" > <div class="chekingdiv">
                    <ul>
                      <li> {if $rsStates|count!=0}                       
                        {form->checkbox name="ListStatusLinkCheckbox" id="ListStatusLinkCheckbox" type="checkbox" class="fixing_left"  value=""} 
                         {html->anchor href="" id="ListStatusLink" class="status-arw fixing_left"}
                        <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>
                        {/if} </li>
                    </ul>
                  </div></th>{/if}
                <th align="left" valign="middle"  width="45%">{$language.lblState}</th>
                <th align="left" valign="middle" >{$language.lblCode}</th>
				{if $editPrivilege  || $deletePrivilege}
                <th align="left" valign="middle"  width="65"></th>
				{/if}
              </tr>
              {assign var="class2" value=0}  
              
              {foreach from=$rsStates item="rsStateList" key="key"}              
              {assign var="class2" value=$class2+1}              
              {assign var="curr_stateID" value=$rsStateList.stateID}             
              {form->hidden name="checkState_$curr_stateID" value="0"}              
              {form->hidden name="checkStateCode_$curr_stateID" value="0"}
              <tr {if $class2%2==0} class="shade01" {/if}>
                {if $editPrivilege} 
					<td align="left" valign="top" class="checkbox_column">{form->checkbox name="stateBulkStatus[]"  options="" value=$rsStateList.stateID class="checkbox01 ListAll List"|cat :{$rsStateList.stateStatus}}</td>
				{/if}
                <td align="left" valign="top">{$rsStateList.stateName}</td>
                <td align="left" valign="top">{$rsStateList.stateShortName}</td>
				{if $editPrivilege || $deletePrivilege}
                <td align="left" valign="top">
				{if $editPrivilege}
					{if  $rsStateList.stateStatus 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_stateID}" rel="{$newstatus}" title="{$rsStateList.stateStatus}" content="" class="{$changeStatus} icon-set" task='status-change'}
					{html->anchor href="state/edit/id/{$curr_stateID}/countryid/$selCountry/" title="Edit State" class="edit02 icon-set"  content=""}  
				{/if}
				{if $deletePrivilege}
					{html->anchor onclick="delsubconfirm($curr_stateID,'{$link}');"   rel="state/destroy/id/{$rsStateList.stateID}/country/{$selCountry}/" title="Delete"  content=""  class="delete02 icon-set"} 
				{/if}	
				</td>
				{/if}
              </tr>
              {/foreach}
              {form->hidden name="hidStateID1"  class="textbox02" value=0}
            </table>
           
            </div>
			{if $editPrivilege} 
            <div class="action_box">
            	{form->select name="stateStatus"  id="stateStatuslist"  class="select-box width-auto" options="0->{$language.lblDonotchange}~*Active->{$language.lblActivate}~*Inactive->{$language.lblInactivate}" value=0 validate_inline="yes"} 
                {form->submit name="submitBulkStatus" id="submit" class="update_btn_table submitBulkStatus button04"  value={$language.lblUpdate}}
                  </div>{/if}
              {form->close}      
                <div class="fixing_right pagination_outer" > {paginate->layout  key="page" label_record="{$language.lblRecorsFound}" label_pages="{$language.lblPages}"} </div>
                <div class="clear"></div>
               {else}
                <div class="message_info">{$language.msgNoStatesFound}</div>
                {/if}
          <!--End:From Listing--> 
    </div>
    <!--End: left Block-->
    <div class="clear"></div>
  </div>
</div>
</div>
<!--End:Content Container--> 
  {include file='CommonBottom.tpl'} 
</div>
<!--End:Outer Container--> 
{form->globalpath_script}
{include file='CommonJavaScriptBottom.tpl'}
{html->messages_script id="common_message"}
<div id="script"></div>
<script type="text/javascript">
var req="{$language.errRequired}";
var stateexist="{$language.errStateAlreayExits}";
var stateCodeexist="{$language.errStateCodeAlreayExits}";
var msgConfirmDelete='{$language.msgConfirmDelete}';
    var okText	=	'{$language.lblOK}';
	var AlertText= '{$language.lblAlert}';
	var cancelText = '{$language.lblCancel}';	
function delsubconfirm(stateID,urlink) {	

    jConfirm(msgConfirmDelete,'Alert',function (r) {
        if (r == true) {
            window.location.href = GLOBAL_BASE_PATH +'/state/destroy/id/'+stateID+'/'+urlink;			
        } else {
            return false;
        }
    },okText,cancelText);
}

</script> 
<script type="text/javascript" src="{$view_javascript}/jquery.colorbox.js"></script> 
<script type="text/javascript" src="{$view_javascript}/table.plugin.js"></script> 
<script language="javascript" src="{$view_javascript}/state.page.js"></script> 
<script type="text/javascript">
var lblSelectAction ='{$language.lblSelectAction}';
var lblSelectItem 	='{$language.lblSelectItem}';
{literal}
$(document).ready(function(){
		$(".custom-btnt,.edit02,.add00").colorbox({iframe:true, innerWidth:"60%", innerHeight:300});
		$('.side_wrapper ul li a[rel=state]').addClass('selected'); 
		setSideMenu();
});
{/literal}
</script>
</body>
</html>