Location: PHPKode > projects > Ads Exchange Server > estigi_0.1.1_RC2/users.php
<?php

/***************************************************************************
 *                 users.php
 *            -------------------
 *   begin       : mier, mayo 2, 2007
 *   copyright   : (C)
 *   email       : hide@address.com
 *   Desc        : User settings. This is for search only. The actual changes are done in the profile.php file
 *
 *
 ***************************************************************************/

define('IN_ADSERVER', true);

include_once("./inc/common.inc.php");

checkLogin($web_address);
get_User_Settings($session['id_Users'], "edit_Users", $web_address);

/* Declare the Tpl */
$users_Tpl = new tpl($s_path_Tpl . "/users.tpl");

if(isset($_POST['search_Users']) && $_POST['who'] != ""){

	$q = "
		SELECT id_User, user_Name, email
		FROM ".$db_Pre."users
		WHERE user_Name like '%".$_POST['who']."%'
		OR email like '%".$_POST['who']."%'
	";

	$q_Search_Users = mysql_query($q) or die("Unable to Search Users: " . mysql_error());
	
	if(mysql_num_rows($q_Search_Users) > 0){
	
			while($row = mysql_fetch_array($q_Search_Users, MYSQL_ASSOC)){
				/* Found Users Values */
				$a_Found_Values[] = array(
					$row['id_User'],
					$row['user_Name'],
					$row['email']
				);
			}
	
		/* Found Users Keys */
		$a_Found_Keys = array(
			"{USERS_RESULTS_ID}",
			"{USERS_RESULTS_NAME}",
			"{USERS_RESULTS_EMAIL}"
		);

		$a_Found = array(
			"{USERS_TOTAL}" => sprintf($_lang['users_Total_Found'], count($a_Found_Values)),
			"{LANG_USERS_CLICK}" => $_lang['users_Click'],
			"{LANG_USERS_USER_NAME}" => $_lang['users_User_Name'],
			"{LANG_USERS_EMAIL}" => $_lang['users_Email']
		);

		/* Replace for all found users*/
		$users_Tpl->rBlock_Several($a_Found_Keys, $a_Found_Values, "USERS");
		$users_Tpl->rBlock($a_Found, "FOUND");

	}
		else{
			$s_Warning = $_lang['users_Msg_No_User'];
			$users_Tpl->hideBlock("FOUND");
		}

}
	/* If you are not looking for any users will hide the block too */
	else{
		$users_Tpl->hideBlock("FOUND");
	}

/* Main Values Array */
$a_Users = array(
	"{LANG_USERS_SEARCH}" => $_lang['users_Search'],
	"{LANG_USERS_WHO}" => $_lang['users_Who'],
	"{LANG_USERS_}" => $_lang['users_Search_Note'],
	"{LANG_USERS_SEARCH}" => $_lang['users_Search']
);


/* Replace main TPL */
$users_Tpl->rBlock($a_Users, "");

include_once("./header.inc.php");
/* Finally print the tpl */
$users_Tpl->print_Tpl();
include_once("./footer.inc.php");

?>
Return current item: Ads Exchange Server