<!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.lblManageBussiness}</title>
<link rel="stylesheet" type="text/css" href="{$view_styles}/popup.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/locationadd.css" />
<script type="text/javascript" src="{$common_js}/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="{$common_js}/jquery-migrate-1.4.1.js"></script>
<script type="text/javascript" src="{$view_javascript}/table.plugin.js"></script>
<script type="text/javascript" src="{$view_javascript}/businessUser.page.js"></script>
{literal}
<script language="javascript" type="text/javascript">
$(document).ready(function(){   
    {/literal}{if $businessUserID>0 || $submitted || $key}{literal}
      $('#adNewBusinessUser').show();
      $('#showAddNewBusinessUser').hide();
    {/literal}{/if}{literal}        

 });
</script>
{/literal}
</head>
    <body>
             <div class="popup-block">  <div id="common_message"></div>            
             <div class="clearfix"> {html->anchor href="business/user/id/$businessID/task/new/" class="add-new-loc" id="showAddNewBusinessUser" content="{$language.lblAddNewBusinessUser}"}</div>
       {if $businessUserDetails}        
  {form->start name="updateBusinessUser" action="" method="post" enctype="multipart/form-data"}              
               <div class="clear"></div>
          
    <div class="grid_table00" >
        <table  border="0" cellspacing="0" cellpadding="0" width="100%"    >
              <tr>
                <th align="left" valign="middle"  class="checkbox_column" width="30">
                    <div class="chekingdiv">
                   <ul>
                      <li> {form->checkbox id="ListStatusLinkCheckbox"  class="fixing_left" tabindex="1"}
                           {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>
                      </li>
                    </ul>
                </div></th>
                <th align="left" valign="middle"  width="20%">{$language.lblName}</th>
                <th align="left" valign="middle" width="22%" >{$language.lblEmailID}</th>
                <th align="left" valign="middle"  >{$language.lblUserName}</th>
                <th align="left" valign="middle"  >{$language.lblLocations}</th>
                <th align="left" valign="middle"  >{$language.lbllastUpdate}</th>
                <th align="left" valign="middle"  width="46">&nbsp;</th>
              </tr>
             {foreach from=$businessUserDetails item="user" key="key1"}
                {assign var="curr_businessUserID" value=$user.businessUserID}
              <tr>
                   <td align="left" valign="top" class="checkbox_column">
                    {form->checkbox name="checkbusinessUserIDs[]" class="checkbox01 ListAll List"|cat:$user.businessUserStatus value=$user.businessUserID tabindex="1"}</td>
               
                <td align="left" valign="top">{$user.businessUserFirstName}&nbsp;{$user.businessUserLastName}</td>
                <td align="left" valign="top">{$user.businessUserEmail}</td>
                <td align="left" valign="top">{$user.businessUserUserName}</td>
                <td align="left" valign="top">{$user.locName}</td>
                <td align="left" valign="top">{$user.businessUserUpdateDate}</td>
                <td align="left" valign="top" width="65">
                {if $user.businessUserStatus=="Active"} 
               	   {assign var="changeStatus" value='Inactive'}
                   {assign var="statustext" value="status-active hide-txt"}
                {elseif $user.businessUserStatus=="Inactive"}
                   {assign var="changeStatus" value='Active'}
                   {assign var="statustext" value="status-inactive hide-txt"} 
                {else}
                	{assign var="statustext" value="lock01 icon-set"} 
                {/if}
                {if $user.businessUserStatus eq 'Locked'}
               		 <span class="lock01 icon-set" title="Administrtor"></span>
                {else}
                	{html->anchor title="change-status" class="{$statustext}" caption="{$user.businessUserStatus}" rel="{$changeStatus}" user="{$user.businessUserID}" tabindex="1"}
                {/if}
                            {html->anchor tabindex="1" title=Edit href="business/user/id/$businessID/businessUserID/$curr_businessUserID/page/$page/" class="edit00" caption=""}
                            {html->anchor tabindex="1" user="{$user.businessUserID}" title="Delete" class="hide-txt delete00"}
                </td>
              </tr>
             {/foreach}
             </table>
             </div>
              <div class="fixing_right pagination_outer">
                    	{paginate->layout  key="page"}
            			<!--end: Pagination-->
            			 <div class="clear"></div>
        </div>
        <div class="action_box">
             {form->select  tabindex="1" id="businessUserStatus" name="businessUserStatus"  class="select-box" options="->{$language.lblDonotchange}~*Active->{$language.lblActivate}~*Inactive->{$language.lblInactivate}~*Deleted->{$language.lblDelete}"}  
              {form->submit class="update_btn_table button04" name="businessUserStatusUpdate" tabindex="1" id="businessUserStatusUpdate"  value={$language.lblUpdate}}      
                        </div>           
               
                  <div class="clear"></div>
             {form->close}
{else}
            <div class="message_info"> {$language.msgNoRecords}</div>            
            {/if}
       
      {if $show=='yes'}
  
  <div class="add_user_form"><h3><span>{if $businessUserID gt 0}{$language.lblEditUser}{else}{$language.lblAddUser}{/if}</span></h3>
  {form->start name="frmBusinessUser" action="" method="post" enctype="multipart/form-data"}
{form->hidden name="businessID" value=$businessID}
{form->hidden name="businessUserID" value=$businessUserID}
            <div class="section_wrap form_listing02 clearfix">
                <div class="left_pane">
                    <!--form listing :: Starts    -->     
                    <ul>                        
                        <li class="clearfix">
                            <div class="inner-left fixing_left mandatory">{$language.lblFirstName}</div>
                            <div class="inner-right fixing_right">
                               {form->textbox name="businessUserFirstName" tabindex="1" class="textbox" validate="required" error=$language.errFirstName}
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="inner-left fixing_left mandatory">{$language.lblLastName}</div>
                            <div class="inner-right fixing_right">
                                {form->textbox  name="businessUserLastName" tabindex="1" class="textbox" validate="required"  error=$language.errLastName}
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="inner-left fixing_left mandatory">{$language.lblEmailID}</div>
                            <div class="inner-right fixing_right">
                                {form->textbox autocomplete="off" name="businessUserEmail" tabindex="1" class="textbox" validate="required~*email"  error=$language.errUserEmail|cat:"~*"|cat:$language.errUserEmail}
                            </div>
                        </li>
                       
                        <li class="clearfix">
                            <div class="inner-left fixing_left mandatory">{$language.lblUserName}</div>
                            <div class="inner-right fixing_right">
              {if $businessUserID>0}
              {$businessUserUserName}
              {else}{form->textbox  autocomplete="off" name="businessUserUserName" tabindex="1" class="textbox" validate="required~*isLoginName~*businessUserUserName->database->business_users,businessUserUserName,businessUserStatus!='Deleted' AND businessUserUserName!='{$businessUserUserName}'~*businessUserUserName->database->business,businessLogin,businessStatus!='Deleted'"   error=$language.errUserName|cat:"~*"|cat:$language.errValidUserName|cat:"~*"|cat:$language.errUserIDExist|cat:"~*"|cat:$language.errUserIDExist}  <br /><span class="small-txt">{$language.msgEmailValid} </span>{/if}
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="inner-left fixing_left mandatory">{$language.lblPassword}<span class="sub-text">{$language.lblPasswordRestiction}</span></div>
                            <div class="inner-right fixing_right">
                                {if $businessUserID>0}
			  {form->password name="businessUserPassword" tabindex="1" autocomplete="off"  class="textbox" validate="isSecurePassword"  error=$language.errUserPassword} 
			  {else}
			  {form->password name="businessUserPassword" tabindex="1" autocomplete="off"  class="textbox" validate="required~*isSecurePassword"  error=$language.errPaaaword|cat:"~*"|cat:$language.errUserPassword} 
			  {/if}
                           <br /> <span class="small-txt" id="passwordNotify">{$language.msgUserPassword}</span></div>
                        </li>
                        <li class="clearfix">
                            <div class="inner-left fixing_left mandatory">{$language.lblConfirmPassword}</div>
                            <div class="inner-right fixing_right">
                                {if $businessUserID>0}
			   {form->password name="userConfirmPassword" autocomplete="off"  tabindex="1" class="textbox" validate="businessUserPassword->compare->value"   error=$language.errUserConfirmPassword} 
			   {else}
			  {form->password name="userConfirmPassword" autocomplete="off"  tabindex="1" class="textbox" validate="businessUserPassword->compare->value~*required"   error=$language.errUserConfirmPassword} 
			  {/if}
                            </div>
                        </li>
                         <li class="clearfix">
                            <div class="inner-left fixing_left mandatory">{$language.lblBusiness} {$language.lblLocations}</div>
                            <div class="inner-right fixing_right">
                            	<div class="location-div"> {form->checkbox  name="businessLocationCheck"  options="checkall->{$language.lblAllLocations}" tabindex="1"}<br/>
                {form->checkbox  tabindex="1" name="businessLocations" class="locCheck"  options=$businessLocations  value=$arrLocations}
                
                {if $businessUserID>0}
			 {form->validate name="hiddenLocationIDs" value=1 validate="required" error=$language.errSelectLocation}
			 {else}
			  {form->validate name="hiddenLocationIDs"  validate="required" error=$language.errSelectLocation}
			 {/if}
                            </div></div>
                        </li>
                        <li class="clearfix">
                            <div class="inner-left fixing_left">{$language.lblStatus}</div>
                            <div class="inner-right fixing_right">
                            <div id="perioddiv"> 
                            {if $businessUserStatus eq 'Locked'}
                            {assign var="userStatusOptions" value="Active~*Inactive~*Locked"}
                            {else}
                            {assign var="userStatusOptions" value="Active~*Inactive"}
                            {/if} 
                            {form->radio tabindex="1" name="businessUserStatus" class="customradio" options=$userStatusOptions value="Active"}  
               </div></div>
                        </li>
                    </ul>
                </div>
                    <div class="clear"></div>  
                  </div>	
                <div class="submit-block clearfix textto_center"> 
                    <span>&nbsp;</span>
                                  {if $businessLocID>0}
                                  {assign var="label" value="{$language.lblUpdate}"}
                                  {else}
                                    {assign var="label" value="{$language.lblSave}"}
                                  {/if}
{form->submit name="submitBusinessUser" tabindex="1" id="submitBusinessUser"  class="curve-3" form="frmBusinessUser" value=$language.lblSave} {$language.lblor} {html->anchor href="/business/user/id/{$businessID}/" name="cancelBusinessUser" id="cancel" tabindex="1" caption=$language.lblCancel}
<span id="wait" style="display:none">{form->button name="load" value="{$language.lblSubmittingPlsWait}" class="curve-3" id="load"}</span>
                </div>
            </div>
          {/if}  
      </div>        
</div>{form->validate_script form="frmBusinessUser"}
{html->messages_script id="common_message"}
{form->rootpath_script}
<script type="text/javascript">
var statusItem="{$language.lblSelectUser}";
var confirmation="{$language.lblConfirmationUser}";
var msg="{$language.lblAlert}";
var statusLocation="{$language.lblSelectLoc}";
var statusSelect="{$language.lblSelectStatus}";
var statusChange="{$language.lblStatusChanged}";
var lblAlertOk='{$language.lblAlertOk}';
var lblAlertCancel='{$language.lblAlertCancel}';
var lblAlertYes='{$language.lblAlertYes}';
var lblAlertNo='{$language.lblAlertNo}';
var lblAlert='{$language.lblAlert}';
var lblSelectCity='{$language.lblSelectCities}';
var lblCheckAll='{$language.lblCheckall}';
var lblUnCheckAll='{$language.lblUncheckall}';
var lblHashselected='{$language.lblHashselected}';
var lblSelectAction="{$language.lblSelectAction}";
</script>
<script type="text/javascript" src="{$view_javascript}/message.plugin.js"></script>
<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">
$(function(){
	 $('#perioddiv input').customInput('');
	});	
</script>
    </body>
    </html>
