<!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>
{if $section|default:''=='profileEdit'}
	{$language.lblAdmin} : {$language.lblMenuUpdateYourprofile}
{else}
	{$language.lblAdmin} : {$language.lbladminSettings} :  {$language.lblmanageAdmin}
{/if}	
</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}/inner-formlisting.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">
    {if $section|default:''!='profileEdit'}
	<div class="right-sidebar">
      <div class="side_wrapper"> {include file='AdminUserRightLinks.tpl'} </div>
    </div>
	{/if}
    <!--End: Right Block-->
	{assign var="adminUserID" value=$adminUserID|default:''}
    <div class="left_wrapper"> {form->start name="formAdminAdd" action="" method="post"}
      <div class="content_wrapper">
        <h2>
		{if $adminUserID}
			{if $section|default:''=='profileEdit'}
				{$language.lblMenuUpdateYourprofile}
			{else}
				{$language.lblEditAdmin}
			{/if}	
		{else}			
			{$language.lblAddNewAdmin}				
		{/if}
        {form->hidden name="adminUserID"}</h2>
        <div class="inner_content_wrapper">
		<div id="common_message"></div>
          <div class="form_listing form_listing03">
            <ul>
              <li class="clearfix">
                <div class="leftside01 mandatory">{$language.lblFirstName} </div>
                <!--End:Left-->
                <div class="rightside01"> {form->textbox name="adminUserFirstName" class="textbox" validate="required" error=$language.errFirstName tabindex="1"} </div>
                <!--End:right-->
              </li>
              <li class="clearfix">
                <div class="leftside01 mandatory"> {$language.lblLastName} </div>
                <!--End:Left-->
                <div class="rightside01"> {form->textbox name="adminUserLastName" class="textbox" validate="required" error=$language.errLastName tabindex="1"} </div>
                <!--End:right-->
              </li>
              <li class="clearfix">
                <div class="leftside01 mandatory"> {$language.lblEmail} </div>
                <!--End:Left-->
                <div class="rightside01"> {form->textbox name="adminUserEmail" class="textbox" validate="required~*email~*adminUserEmail->database->admin_users,adminUserEmail,adminUserID!='$adminUserID' AND adminUserStatus!='deleted'" error=$language.errEnterValidEmailID|cat:'~*'|cat:$language.errEnterValidEmailID|cat:'~*'|cat:$language.errEmailIDExists  tabindex="1"} </div>
                <!--End:right-->
              </li>
              <li class="clearfix">
                <div class="leftside01 mandatory"> {$language.lblUserName}
                  {if $adminUserID}{else} <span class="sub-text">{$language.msgUsernameSuggest}</span>{/if} </div>
                <!--End:Left-->
                <div class="rightside01"> {if $adminUserID}{$adminUserLoginName}{else}{form->textbox name="adminUserLoginName" class="textbox" validate="isLoginName~*adminUserLoginName->database->admin_users,adminUserLoginName,adminUserID!='$adminUserID' AND adminUserStatus!='deleted'" error=$language.errValidUserName|cat:'~*'|cat:$language.errUserNameExists tabindex="1"}{/if} </div>
                <!--End:right-->
              </li>
              <li class="clearfix">
                <div class="leftside01 mandatory"> {$language.lblPassword} <span class="sub-text" id="passwordNotify">{$language.msgUserPassword}</span> </div>
                <!--End:Left-->
                <div class="rightside01"> 
                {if $adminUserID>0}
                {form->password name="adminUserLoginPass" autocomplete="off"  class="textbox" validate="isSecurePassword" error=$language.errValidPassword  tabindex="1" maxlength="15" tabindex="1" postTrigger="$('#adminUserConfirmPass').blur();"} {else}
                {form->password
					  name="adminUserLoginPass" maxlength="15" validate="required~*isSecurePassword" error=$language.errPaaaword|cat:"~*"|cat
					  : $language.errValidPassword class="textbox" tabindex="1" postTrigger="$('#adminUserConfirmPass').blur();"} {/if}
                  </div>
                <!--End:right-->
              </li>
              <li class="clearfix">
                <div class="leftside01 mandatory" > {$language.lblConfirmPassword} </div>
                <div class="rightside01"> {form->password  tabindex="1" class="textbox" maxlength="20" name="adminUserConfirmPass" validate="adminUserLoginPass->compare->value" error=$language.errPasswordMismatch maxlength="15"} </div>
              </li>
			  {if $section|default:''!='profileEdit'}
              <li class="clearfix">
                <div class="leftside01 mandatory"> {$language.lblRole} </div>
                <!--End:Left-->
                <div class="rightside01"> 
				{if $getUserTypeName==1}
					{if $userTypeID|default:''}
						{$userTypeName}
						{form->hidden name="adminRole"  value=$userTypeID|default:''}
					{else}
						{$userTypeName}
						{form->hidden name="adminRole"  value="$view_common_manageUserTypeID"}
					{/if}						 
				{else}	
					{form->select 
					name="adminRole" 
					caption="->{$language.lblSelectRole}" 
					id="adminRole" 
					value=$userTypeID|default:'' 
					options=$resListAdminRoles 
					validate="required"
					error=$language.errSelectRole 
					tabindex="1"} 
				{/if}	
                  {form->hidden name="adminType"} </div>
                <!--End:right-->
              </li>
			  {if $view_common_manageUserTypeID==1}
			   <li class="clearfix">
                <div class="leftside01 "> {$language.lblRestRole} </div>
                <!--End:Left-->
                <div class="rightside01"> 
					{form->select 
						name="roleID" 
						tabindex="1"
						caption="->{$language.lblSelect}" 
						id="roleID"
						options=$listRestRoles 
						disabled="disabled"}
                </div>
                <!--End:right-->
              </li>
			  {/if}
			  {else}
					{form->hidden name="adminRole"  value="$userTypeID"}
			  {/if}
              <li class="clearfix">
                <div class="leftside01 mandatory"> {$language.lblStatus} </div>
                <!--End:Left-->
                <div class="rightside01">
                	<div id="perioddiv">
                    {if $adminUserID==$view_common_manageUserID || $adminUserID==1} 
					{if $adminUserStatus=='Active'}
						{$language.lblActive}
					{elseif $adminUserStatus=='Inactive'}
						{$language.lblInactive}
					{elseif $adminUserStatus=='Blocked'}
						{$language.lblBlocked}
					{/if}
                    {form->hidden name="adminUserStatus"}
					{else}
                    {form->radio tabindex="1" name="adminUserStatus" class="customradio" options="Active->"|cat:$language.lblActive|cat:"~*Inactive->"|cat:$language.lblInactive|cat:"~*Blocked->{$language.lblLocked}" value="Active"}
					                 
					 {/if}
                   </div>
                </div>
                <!--End:right-->
              </li>
			 
              <li class="clearfix">
              	<div class="submit-block clearfix"> 
                        <span>&nbsp; </span>
                        <div class="leftside01">&nbsp;</div>
                    	<div class="rightside01">	
                        {form->submit name="submitAdmin" class="curve-3" value="{if $adminUserID}{$language.lblUpdate}{else}{$language.lblSave}{/if}" tabindex="1"}
                        {if !$previousURL|default:''} {assign var="previousURL" value="/adminuser/index/"}{/if} 
						{if $section|default:''!='profileEdit'}
							{$language.lblOr} 
							{html->anchor id="cancel" name="cancelAdmin" caption="{$language.lblCancel}" href="$previousURL" tabindex="1"}
						{/if}	
                         </div>
                    </div>
                <!--End:right-->
              </li>
            </ul>
          </div>
          <!--End:From Listing--> 
        </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}/custom-radiobutton.js"></script>
<script type="text/javascript">
{literal}
$(function(){
	 $('#perioddiv input').customInput('');
});
$(document).ready(function(){
		$('.side_wrapper ul li a[rel=adminuser]').addClass('selected'); 
});
{/literal}
</script>
<script type="text/javascript" src="{$view_javascript}/adminuser.page.js"></script> 

{form->basepath_script}
{form->validate_script form="formAdminAdd"}
{html->messages_script id="common_message"}
</body>
</html>