Location: PHPKode > projects > Homeless Mangement Information System > hmis/include/edit_user_info_functions.inc
<?php
/*

function pull_user_variables ($user_id)	{					
	
	$sql = "SELECT gate_status FROM gate WHERE gate_user_id = '".$user_id."'";
	$gate_query = run_query ($sql, "No gate query");
	$gate_array = fetch_array ($gate_query, "No gate info array");
	
	$sql = "SELECT * FROM user_info WHERE user_id = '".$user_id."'";
	$user_info_query = run_query ($sql, "No user info query");
	$user_info_array = fetch_array ($user_info_query, "No user info array");  
					
	$sql = "SELECT * FROM organizations WHERE org_id = '".$user_info_array["org_id"]."'";
	$org_query = run_query ($sql, "No org info query"); 
	$org_array = fetch_array ($org_query, "No org_info login query"); 
	
	$sql = "SELECT* FROM groups WHERE group_id = '".$org_array["org_group_id"]."'";
	$group_query = run_query ($sql, "No group info query");
	$groups_array = fetch_array ($group_query, "No group info array"); 
	
	$all_user_info_array = array_merge ($gate_array, $user_info_array, $org_array, $groups_array);
     
	return $all_user_info_array;  

												}




function pull_associated_users ($user_id, $access_level)	{
				
	switch ($access_level)	{
		case "10":
			$sql = "SELECT user_id FROM user_info WHERE user_access_level = '20'";
			$result = run_query($sql, "Associated users id 10");
			$total_matches = num_rows ($result);
			for ($i = 0; $i < $total_matches; $i++)	{
				$current_row = fetch_array($result, "10 edit user function");
				$associated_user[$i] = $current_row["user_id"];	
													}
		break;
		
		case "20":
			$sql = "SELECT org_id FROM user_info WHERE user_id = '".$user_id."'";
			$result = run_query($sql, "Associated users id 20");
			$current_row = fetch_array($result, "Edit user function 20")
			$org_id = $current_row["org_id"];

			$sql = "SELECT org_group_id FROM organizations WHERE org_id = '".$org_id."'";
			$result = run_query($sql, "Associated users id 20");
			$current_row = fetch_array($result, "Edit user function 20");
			$group_id = $current_row["org_group_id"];

			$sql = "SELECT org_id FROM organizations WHERE org_group_id = '".$group_id."'";
			$result_orgs = run_query($sql, "Associated users id 20");
			
			$total_matches = num_rows ($result_orgs);
            
			for ($i = 0; $i < $total_matches; $i++)	{
				$current_row = fetch_array($result_orgs, "10 edit user function");
				$current_org = $current_row["org_id"];
				$sqlr = "SELECT user_id FROM user_info WHERE org_id = '".$current_org."' AND user_access_level LIKE '30' AND user_id != '".$user_id."'";
				$resultr = run_query($sqlr, "Associated users id 20");
				$current_row = fetch_array($resultr, "Edit user function 20");
				$associated_user[$i] = $current_row["user_id"];	
													}
		break;

		case "30":
			$sql = "SELECT org_id FROM user_info WHERE user_id = '".$user_id."'";
			$result = run_query($sql, "Associated users id 20");
			$current_row = fetch_array($result, "Edit user function 20")
			$org_id = $current_row["org_id"];

			$sql = "SELECT user_id FROM user_info WHERE org_id = '".$org_id."'";
			$result_users = run_query($sql, "Associated users id 30");
			
			$total_matches = num_rows ($result_users);
			for ($i = 0; $i < $total_matches; $i++)	{
				$current_row = fetch_array($result_users, "30 edit user function");
				$associated_user[$i] = $current_row["user_id"];	
													}
			break;
		
		default:
		echo "No case level in edit_user_info_functions.inc";
							}
	return $associated_user;
															}


*/
?>
Return current item: Homeless Mangement Information System