Location: PHPKode > scripts > Mass Emailing > bulk-emailer/admin/users/search_results.php
<?
/************************************

Script : Free BULK / MASS EMAILER
Website : http://www.agrizlive.com

Script is provided Under GPU Non-Commercial License
Agrizlive.com doesn't provide any WARRANTY for this script
**************************************/

	if(defined('AGRIZ_FREE_SCRIPTS') && AGRIZ_FREE_SCRIPTS == 'agrizlive.com'){
	}
	else{
		exit;
	}
	
	$user_name = $_REQUEST['user_name'];
	$user_id = $_REQUEST['user_id'];
	$user_email = $_REQUEST['user_email'];
	
	
	$query = "SELECT * FROM ".TABLE_PREFIX."users WHERE user_id != ''";
	
	if($user_name != ""){
		$query .= " AND user_name = '".addslashes($user_name)."'";
	}
	if($user_id != ""){
		$query .= " AND user_id = '".addslashes($user_id)."'";
	}
	if($user_email != ""){
		$query .= " AND user_email = '".addslashes($user_email)."'";
	}
	
	if(!isset($_REQUEST['total_result'])){
		$result = mysql_query($query);
		$total_result = mysql_num_rows($result);
		
		$page = 1;
		$start = 0;
	}
	else{
		$page = $_REQUEST['page'];
		$start = ($page-1) * 10;
		$total_result = $_REQUEST['total_result'];
		
		
		$query .= " LIMIT $start, 10";
		$result = mysql_query($query);
	}
	$total_pages = ceil($total_result / 10);
	
	
?>
<div id="box">
	<h3>Users</h3>
	<table width="100%">
		<thead>
			<tr>
				<th width="40px"><a href="#">ID<img src="img/icons/arrow_down_mini.gif" width="16" height="16" align="absmiddle" /></a></th>
				<th><a href="#">User Name</a></th>
				<th width="90px"><a href="#">Email</a></th>
				<th width="60px"><a href="#">Action</a></th>
			</tr>
		</thead>
		<tbody>
		<?
			while($value = mysql_fetch_array($result))
			{
		?>
			<tr>
				<td class="a-center"><?=$value['user_id']?></td>
				<td><?=stripslashes($value['user_name'])?></td>
				<td><?=$value['user_email']?></td>
				<td>
					<a href="?content=users&value=edit&id=<?=$value['user_id']?>"><img src="img/icons/user_edit.png" title="Edit User" width="16" height="16" /></a>
					<a href="?content=users&value=delete&id=<?=$value['user_id']?>" onclick="return confirm('Do you want to delete?')"><img src="img/icons/user_delete.png" title="Delete User" width="16" height="16" /></a>
				</td>
			</tr>
		<?
			}
		?>	
		</tbody>
	</table>
						
	<div id="pager">
		Page <?if($page > 1){?><a href="index.php?content=users&page=<?=$page-1?>&total_result=<?=$total_result?>&user_id=<?=$user_id?>&user_email=<?=$user_email?>&user_status=<?=$user_status?>&user_name=<?=$user_name?>" alt="Prev"><img src="img/icons/arrow_left.gif" width="16" height="16" /></a><?}?> 
		<input size="1" value="<?=$page?>" type="text" name="page" id="page" /> 
		<?if($total_pages < $page){?>
		<a href="index.php?content=users&page=<?=$page+1?>&total_result=<?=$total_result?>&user_id=<?=$user_id?>&user_email=<?=$user_email?>&user_status=<?=$user_status?>&user_name=<?=$user_name?>" alt="Next"><img src="img/icons/arrow_right.gif" width="16" height="16" /></a><?}?>
		of <?=$total_pages?> pages | Total <strong><?=$total_result?></strong> records found
	</div>
</div>
Return current item: Mass Emailing