<!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.lblPromotionSchemaUsers}</title>
{include file='CommonJavaScript.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/common.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/grid_listing.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/popup.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/locationadd.css" media="screen" />
<link href="{$view_styles}/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/ui.daterangepicker.css" />
{form->rootpath_script}
{form->basepath_script}
<style>
.date-field{
width:100%!important;
}
.icon-set{
cursor:default!important;
}
</style>
</head>
<body>
<div class="popup-block">
	<div class="clear"></div>
	<div class="search_container">
	<div class="inner wide-box"> {form->start name="formUsersSearch" action="" method="post" enctype="multipart/form-data"}
	  <ul class="clearfix">
		<li class="column">
		  <p class="label-field01">{$language.lblName}</p>                 
		   <span class="form-field01">
			   {form->textbox name="userFullName" class="text-box"} 
			</span>
		</li>
		<li class="column" style="width: 21%;">
		  <p class="label-field01">{$language.lblRegisteredDate}</p>
		  <span class="form-field01">
			  <div class="text-box-div-date"> 
			  {form->textbox id="userRegistredDate" name="userRegistredDate" class="date-field" readonly="readonly" style="text-indent:0;"}
			  </div>
			</span>
		 </li>
		 <li class="column">
		   <p class="label-field01">{$language.lblEmail}</p>
		   <span class="form-field01">
			  {form->textbox name="userEmailID" class="text-box"} 
		   </span>
		 </li>
		 <li class="column">
		   <p class="label-field01">{$language.lblType}</p>                 
		   <span class="form-field01">
			  {form->select name="userType" caption="->{$language.lblAny}" class="select-box" options="{$language.lblSite}~*{$language.lblFacebook}"}
			</span>
		 </li> 
		 <li class="column strict_fixing_right">    
			<p class="label-field01">&nbsp;</p>  
		   <span class="form-field01">
		  {form->submit name="submitSearch" class="button01" form="formUsersSearch" tabindex="7" value={$language.lblSearch}}
		   {html->anchor href="promotions/ajaxLoadUsers/" caption="{$language.lblListAll}" class="action-link"}
		   </span>
		</li> 
		</ul>
	  {form->close}
	  <div class="clear"></div>
	</div>
  </div>
  <!--END:sEARCH cONTAINER-->
	{if $resUsers|@count>0} 
			<div class="form_listing02 clearfix">
				<div class="grid_table00"> 
					<table width="100%" border="0" cellspacing="0" cellpadding="0"   >
						<thead>
							<tr>
								<th align="left" valign="middle"  width="40%">
									<span class="chkd-item">
										{form->checkbox class="listAllCheckBoxItems v-aline fixing_left"}
									</span>
									{$language.lblName}
								</th>
								<th align="left" valign="middle"  width="30%">
									{$language.lblEmailID}
								</th>
								<th align="left" valign="middle"  width="20%">
									{$language.lblRegisteredDate}
								</th>
								<th align="left" valign="middle"  width="10%">
									&nbsp;
								</th>
							</tr>
						</thead>
						<tbody>
							{foreach from=$resUsers item="resUsersList" key="key"}
								{assign var="userID" value=$resUsersList.userID} 
								<tr>
									<td align="left" valign="middle">
										<span class="chkd-item">
											{form->checkbox class="selectCheckBoxItems v-aline fixing_left" name="check_$userID" value=$userID}											
											<span class="hiddenTitle hide">	 
												{$resUsersList.userFirstName} {$resUsersList.userLastName} [ {$resUsersList.userEmail} ]
											</span>
										</span>
										<label for="check_{$userID}">
											<strong>{$resUsersList.userFirstName} {$resUsersList.userLastName}</strong>
										</label>	
									</td>
									<td align="left" valign="middle">
										{$resUsersList.userEmail}
									</td>
									<td align="left" valign="middle">
										{$resUsersList.userRegistredDate|date_format:$settingsDateFormat}
										{$resUsersList.userRegistredDate|date_format:$settingsTimeFormat}
									</td>
									<td align="left" valign="middle">
										{if $resUsersList.userStatus neq 'Locked'}
										  {if $resUsersList.userStatus eq 'Active'}
											{assign var="changeStatus" value="status-active"}
										  {else}
											{assign var="changeStatus" value="status-inactive"}
										  {/if}
										   <span class="{$changeStatus} icon-set" title="{$resUsersList.userStatus}"></span>
										{else}
											<span class="status-locked icon-set" title="Locked"></span> 
										{/if}
									</td>
								</tr>									
							{/foreach}
						</tbody>
					</table/>	
				</div>
				<!--Start: Pagination-->
				<div class="fixing_right pagination_outer">
					{paginate->layout  key="page" label_record="{$language.lblRecorsFound}" label_pages="{$language.lblPages}"} 					
					<div class="clear"></div>
				</div>         
				<!--end: Pagination--> 
				<div class="clear"></div>
			</div>
			<div class="submit-block clearfix textto_center">
				<span>&nbsp; </span> 
				{form->button name="addUserButton" class="curve-3" value=$language.lblPromotionSchemaLinkUsers}
				{$language.lblOr} 
				{html->anchor onclick="parent.$.colorbox.close();" id="cancel" caption="{$language.lblCancel}"}
			</div>
	{else}
        <div class="message_info"> {$language.msgNoRecords}</div>	
	{/if}	
</div>
<script type="text/javascript" src="{$common_js}/date.js"></script>
<script type="text/javascript" src="{$view_javascript}/daterangepicker.jQuery.js"></script>
<script>
var lblSelectItem ="{$language.lblSelectItem}";	
$(document).ready(function (){	
{literal}	
$(function(){
	$('#userRegistredDate').daterangepicker({arrows: false});
});	
{/literal}
$(document).on('click', ".listAllCheckBoxItems", function () {
	if ($(this).prop("checked") == true) {
		$(".selectCheckBoxItems").prop("checked", "checked");
	} else {
		$(".selectCheckBoxItems").removeAttr("checked");
	}
});	
$(document).on('click', "#addUserButton", function () {
	if($(".selectCheckBoxItems:checked").size()==0)
	{
		jAlert(lblSelectItem);
		return false;
	} 
	var selectedDataObj = [];
	$('.selectCheckBoxItems:checked').each(function () {        
		selectedDataObj.push({
            id: $(this).val(),
            title: $(this).next(".hiddenTitle").html()
        });
	}); 
	parent.$.colorbox.close();
	parent.addItemFromPicker(selectedDataObj); 
});	
});	
</script>	
</body>
</html>