<?php
	class octgroup_user{
	
		function show_octgroup_user()
		{
			$all_user_group = $all_user_group . "<div id=\"all_user_in\">";							
			$all_user_group = $all_user_group . 	"<table>";
			$all_user_group = $all_user_group . 		"<tr>";
			$all_user_group = $all_user_group . 			"<td>";
			$all_user_group = $all_user_group . 			"<select name=\"shared_user[]\" id=\"shared_user\" size=\"12\" multiple=\"multiple\" style=\"width:198px; margin-left:4px;\">";
															$memo_shared	= "Select * from role";
															$memo_query	= mysql_query($memo_shared);
															$u	= 1;
															$t	= 1;
															while($memo_row = mysql_fetch_array($memo_query))
															{
																$role_name = $memo_row['role_name'];
			$all_user_group = $all_user_group .					"<optgroup id='opt_$u' label='$role_name'>";
																$opt_shared	= "Select * from user where role_id = $memo_row[id]";
																$opt_query	= mysql_query($opt_shared);
								
			$all_user_group = $all_user_group .					"<script>var gp_{$u}_start = $t; </script> ";
								
																while($opt_row = mysql_fetch_array($opt_query))
																{
									
																	$user_id = $opt_row['user_id'];
																	$name	 = $opt_row['first_name']." ".$opt_row['last_name'];
																	if($user_id != $_SESSION['user_id'])
																	{
			$all_user_group = $all_user_group .							"<option value=$user_id>$name</option>";
																		$t++;
																	}
									
																}
																$uk	= $t - 1;
			$all_user_group = $all_user_group .						"<script>var gp_{$u}_end = $uk; </script> ";
																$u++;
															 }
			$all_user_group = $all_user_group .			"</select>";
						
			$all_user_group = $all_user_group .			"</td>";
			$all_user_group = $all_user_group .		"<td>";
			$all_user_group = $all_user_group . "<table>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,1);\" id=\"check_option_1\" name=\"check_option_1\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Manager)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,2);\" id=\"check_option_2\" name=\"check_option_2\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Assistant Manager)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,3);\" id=\"check_option_3\" name=\"check_option_3\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Clerks)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,4);\" id=\"check_option_4\" name=\"check_option_4\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check ALL/UnCheck ALL)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .	"</table>";
			$all_user_group = $all_user_group . "</td>";
			$all_user_group = $all_user_group . "</tr>";
			$all_user_group = $all_user_group . "</table>";
			$all_user_group = $all_user_group . "</div>";
			$all_user_group = $all_user_group .	"<div id=\"group_of_in\" style=\"display:none;\">";
			$all_user_group = $all_user_group .	"<select name=\"shared_user[]\" id=\"shared_user_1\" size=\"12\" multiple=\"multiple\" style=\"width:198px; margin-left:4px;\">";
			$all_user_group = $all_user_group .			"<optgroup id=\"group\" label=\"Groups\">";
															$group_query	=	"SELECT * FROM `group`";
															$gr_query		= mysql_query($group_query);
															while($group_row = mysql_fetch_array($gr_query))
															{
			$all_user_group = $all_user_group .				"<option value=".$group_row['group_member'].">".$group_row['group_title']."</option>";
															}
						
			$all_user_group = $all_user_group .			"</select>";
			$all_user_group = $all_user_group . "</div>";
			
			return $all_user_group;
		
			}
			
		function show_octgroup_user_edit($shared_user_id)
		{
			$all_user_group = $all_user_group . "<div id=\"all_user_in\">";							
			$all_user_group = $all_user_group . 	"<table>";
			$all_user_group = $all_user_group . 		"<tr>";
			$all_user_group = $all_user_group . 			"<td>";
			$all_user_group = $all_user_group . 			"<select name=\"shared_user[]\" id=\"shared_user\" size=\"12\" multiple=\"multiple\" style=\"width:198px; margin-left:4px;\">";															
															
															$memo_shared	= "Select * from role";
															$memo_query	= mysql_query($memo_shared);
															$u	= 1;
															$t	= 1;
															while($memo_row = mysql_fetch_array($memo_query))
															{
																$role_name = $memo_row['role_name'];
			$all_user_group = $all_user_group .					"<optgroup id='opt_$u' label='$role_name'>";
																$opt_shared	= "Select * from user where role_id = $memo_row[id]";
																$opt_query	= mysql_query($opt_shared);
								
			$all_user_group = $all_user_group .					"<script>var gp_{$u}_start = $t; </script> ";
								
																while($opt_row = mysql_fetch_array($opt_query))
																{
																	$sel	 = "";									
																	$user_id = $opt_row['user_id'];
																	$name	 = $opt_row['first_name']." ".$opt_row['last_name'];
																	$pos	 = strpos($shared_user_id,",".$user_id.",");
																	if($pos !== false)
																	{
																		$sel = "selected";
																	}																	
																	if($user_id != $_SESSION['user_id'])
																	{
			$all_user_group = $all_user_group .							"<option value=$user_id $sel>$name</option>";
																		$t++;
																	}
									
																}
																$uk	= $t - 1;
			$all_user_group = $all_user_group .						"<script>var gp_{$u}_end = $uk; </script> ";
																$u++;
															 }
			$all_user_group = $all_user_group .			"</select>";
						
			$all_user_group = $all_user_group .			"</td>";
			$all_user_group = $all_user_group .		"<td>";
			$all_user_group = $all_user_group . "<table>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,1);\" id=\"check_option_1\" name=\"check_option_1\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Manager)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,2);\" id=\"check_option_2\" name=\"check_option_2\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Assistant Manager)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,3);\" id=\"check_option_3\" name=\"check_option_3\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Clerks)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,4);\" id=\"check_option_4\" name=\"check_option_4\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check ALL/UnCheck ALL)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .	"</table>";
			$all_user_group = $all_user_group . "</td>";
			$all_user_group = $all_user_group . "</tr>";
			$all_user_group = $all_user_group . "</table>";
			$all_user_group = $all_user_group . "</div>";
			$all_user_group = $all_user_group .	"<div id=\"group_of_in\" style=\"display:none;\">";
			$all_user_group = $all_user_group .	"<select name=\"shared_user[]\" id=\"shared_user_1\" size=\"12\" multiple=\"multiple\" style=\"width:198px; margin-left:4px;\">";
			$all_user_group = $all_user_group .			"<optgroup id=\"group\" label=\"Groups\">";
															$group_query	=	"SELECT * FROM `group`";
															$gr_query		= mysql_query($group_query);
															while($group_row = mysql_fetch_array($gr_query))
															{
			$all_user_group = $all_user_group .				"<option value=".$group_row['group_member'].">".$group_row['group_title']."</option>";
															}
						
			$all_user_group = $all_user_group .			"</select>";
			$all_user_group = $all_user_group . "</div>";
			
			return $all_user_group;
		
			}	

		function show_octgroup_user_form()
		{
			$all_user_group="";
			$all_user_group = $all_user_group . "<div id=\"all_user_in\">";							
			$all_user_group = $all_user_group . 	"<table>";
			$all_user_group = $all_user_group . 		"<tr>";
			$all_user_group = $all_user_group . 			"<td>";
			$all_user_group = $all_user_group . 			"<select name=\"shared_user[]\" id=\"shared_user\" size=\"12\" multiple=\"multiple\" style=\"width:198px; margin-left:4px;\">";
															$memo_shared	= "Select * from role";
															$memo_query	= mysql_query($memo_shared);
															$u	= 1;
															$t	= 1;
															while($memo_row = mysql_fetch_array($memo_query))
															{
																$role_name = $memo_row['role_name'];
			$all_user_group = $all_user_group .					"<optgroup id='opt_$u' label='$role_name'>";
																$opt_shared	= "Select * from user where role_id = $memo_row[id]";
																$opt_query	= mysql_query($opt_shared);
								
			$all_user_group = $all_user_group .					"<script>var gp_{$u}_start = $t; </script> ";
								
																while($opt_row = mysql_fetch_array($opt_query))
																{
									
																	$user_id = $opt_row['user_id'];
																	$name	 = $opt_row['first_name']." ".$opt_row['last_name'];
																	if($user_id != $_SESSION['user_id'])
																	{
			$all_user_group = $all_user_group .							"<option value=$user_id>$name</option>";
																		$t++;
																	}
									
																}
																$uk	= $t - 1;
			$all_user_group = $all_user_group .						"<script>var gp_{$u}_end = $uk; </script> ";
																$u++;
															 }
			$all_user_group = $all_user_group .			"</select>";
						
			$all_user_group = $all_user_group .			"</td>";
			$all_user_group = $all_user_group .		"<td>";
			$all_user_group = $all_user_group . "<table>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,1);\" id=\"check_option_1\" name=\"check_option_1\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Manager)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,2);\" id=\"check_option_2\" name=\"check_option_2\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Assistant Manager)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,3);\" id=\"check_option_3\" name=\"check_option_3\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Clerks)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,4);\" id=\"check_option_4\" name=\"check_option_4\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check ALL/UnCheck ALL)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .	"</table>";
			$all_user_group = $all_user_group . "</td>";
			$all_user_group = $all_user_group . "</tr>";
			$all_user_group = $all_user_group . "</table>";
			$all_user_group = $all_user_group . "</div>";
			$all_user_group = $all_user_group .	"<div id=\"group_of_in\" style=\"display:none;\">";
			$all_user_group = $all_user_group .	"<select name=\"shared_user[]\" id=\"shared_user_1\" size=\"12\" multiple=\"multiple\" style=\"width:198px; margin-left:4px;\">";
			$all_user_group = $all_user_group .			"<optgroup id=\"group\" label=\"Groups\">";
															$group_query	=	"SELECT * FROM `group`";
															$gr_query		= mysql_query($group_query);
															while($group_row = mysql_fetch_array($gr_query))
															{
																$replace_str = str_replace(",", "|", $group_row['group_member']);		
			$all_user_group = $all_user_group .				"<option value='$replace_str'>".$group_row['group_title']."</option>";
															}
						
			$all_user_group = $all_user_group .			"</select>";
			$all_user_group = $all_user_group . "</div>";
			
			return $all_user_group;
		
			}		
			
		function show_octgroup_user_edit_form($shared_user_id)
		{
			$all_user_group = $all_user_group . "<div id=\"all_user_in\">";							
			$all_user_group = $all_user_group . 	"<table>";
			$all_user_group = $all_user_group . 		"<tr>";
			$all_user_group = $all_user_group . 			"<td>";
			$all_user_group = $all_user_group . 			"<select name=\"shared_user[]\" id=\"shared_user\" size=\"12\" multiple=\"multiple\" style=\"width:198px; margin-left:4px;\">";															
															
															$memo_shared	= "Select * from role";
															$memo_query	= mysql_query($memo_shared);
															$u	= 1;
															$t	= 1;
															while($memo_row = mysql_fetch_array($memo_query))
															{
																$role_name = $memo_row['role_name'];
			$all_user_group = $all_user_group .					"<optgroup id='opt_$u' label='$role_name'>";
																$opt_shared	= "Select * from user where role_id = $memo_row[id]";
																$opt_query	= mysql_query($opt_shared);
								
			$all_user_group = $all_user_group .					"<script>var gp_{$u}_start = $t; </script> ";
								
																while($opt_row = mysql_fetch_array($opt_query))
																{
																	$sel	 = "";									
																	$user_id = $opt_row['user_id'];
																	$name	 = $opt_row['first_name']." ".$opt_row['last_name'];
																	$pos	 = strpos($shared_user_id,"|".$user_id."|");
																	if($pos !== false)
																	{
																		$sel = "selected";
																	}																	
																	if($user_id != $_SESSION['user_id'])
																	{
			$all_user_group = $all_user_group .							"<option value=$user_id $sel>$name</option>";
																		$t++;
																	}
									
																}
																$uk	= $t - 1;
			$all_user_group = $all_user_group .						"<script>var gp_{$u}_end = $uk; </script> ";
																$u++;
															 }
			$all_user_group = $all_user_group .			"</select>";
						
			$all_user_group = $all_user_group .			"</td>";
			$all_user_group = $all_user_group .		"<td>";
			$all_user_group = $all_user_group . "<table>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,1);\" id=\"check_option_1\" name=\"check_option_1\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Manager)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,2);\" id=\"check_option_2\" name=\"check_option_2\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Assistant Manager)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,3);\" id=\"check_option_3\" name=\"check_option_3\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check All Clerks)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .		"<tr>";
			$all_user_group = $all_user_group .			"<td><input type=\"checkbox\" onclick=\"return check(this.value,4);\" id=\"check_option_4\" name=\"check_option_4\" value=\"false\" /></td>";
			$all_user_group = $all_user_group .			"<td><span><font size=\"-3\" color=\"#990000\">(Check ALL/UnCheck ALL)</font></span></td>";
			$all_user_group = $all_user_group .		"</tr>";
			$all_user_group = $all_user_group .	"</table>";
			$all_user_group = $all_user_group . "</td>";
			$all_user_group = $all_user_group . "</tr>";
			$all_user_group = $all_user_group . "</table>";
			$all_user_group = $all_user_group . "</div>";
			$all_user_group = $all_user_group .	"<div id=\"group_of_in\" style=\"display:none;\">";
			$all_user_group = $all_user_group .	"<select name=\"shared_user[]\" id=\"shared_user_1\" size=\"12\" multiple=\"multiple\" style=\"width:198px; margin-left:4px;\">";
			$all_user_group = $all_user_group .			"<optgroup id=\"group\" label=\"Groups\">";
															$group_query	=	"SELECT * FROM `group`";
															$gr_query		= mysql_query($group_query);
															while($group_row = mysql_fetch_array($gr_query))
															{
																$replace_str = str_replace(",", "|", $group_row['group_member']);	
			$all_user_group = $all_user_group .				"<option value='$replace_str'>".$group_row['group_title']."</option>";
															}
						
			$all_user_group = $all_user_group .			"</select>";
			$all_user_group = $all_user_group . "</div>";
			
			return $all_user_group;
		
			}
			
			
			function choose_folder($i)
			{
				if($i == 1)
				{$test = 'View All Documents';}
				else
				{$test = 'Select Folder';}
				
					$all_user_group	= "";
			$all_user_group = $all_user_group . 			"<select name=\"choose_folder\" id=\"choose_folder\" style=\"width:198px; margin-left:4px;\">";
			$all_user_group = $all_user_group . 			"<option value=''>$test</option>";
																$opt_shared	= "Select * from forms_folder";
																$opt_query	= mysql_query($opt_shared);
																while($opt_row = mysql_fetch_array($opt_query))
																{
																	$folder_id = $opt_row['folder_id'];
																	$folder_name	 = $opt_row['folder_name'];
			$all_user_group = $all_user_group .							"<option value=$folder_id>$folder_name</option>";
									
																}
			$all_user_group = $all_user_group .			"</select>";		
			return $all_user_group;			
			}		
			
			function choose_folder_display($i)
			{
				if($i == 1)
				{$test = 'View All Documents';}
				else
				{$test = 'Select Folder';}
				
					$all_user_group	= "";
			$all_user_group = $all_user_group . 			"<select name=\"choose_folder\" id=\"choose_folder\" style=\"width:198px; margin-left:4px;\">";
			$all_user_group = $all_user_group . 			"<option value=''>$test</option>";
																$opt_shared	= "Select * from displays_folder";
																$opt_query	= mysql_query($opt_shared);
																while($opt_row = mysql_fetch_array($opt_query))
																{
																	$folder_id = $opt_row['folder_id'];
																	$folder_name	 = $opt_row['folder_name'];
			$all_user_group = $all_user_group .							"<option value=$folder_id>$folder_name</option>";
									
																}
			$all_user_group = $all_user_group .			"</select>";		
			return $all_user_group;			
			}					

			function choose_folder_edit($folder)
			{
					$all_user_group	= "";
			$all_user_group = $all_user_group . 			"<select name=\"choose_folder\" id=\"choose_folder\" style=\"width:198px; margin-left:4px;\">";
			$all_user_group = $all_user_group . 			"<option value=''>Select Folder</option>";
																$opt_shared	= "Select * from forms_folder";
																$opt_query	= mysql_query($opt_shared);
																while($opt_row = mysql_fetch_array($opt_query))
																{
																	$sel	=	"";
																	$folder_id = $opt_row['folder_id'];
																	$folder_name	 = $opt_row['folder_name'];
																	if($folder	== $folder_id)
																	{
																		$sel	= "selected";	
																	}
			$all_user_group = $all_user_group .							"<option value=$folder_id $sel>$folder_name</option>";
									
																}
			$all_user_group = $all_user_group .			"</select>";		
			return $all_user_group;			
			}			
			
			
			function choose_folder_edit_display($folder)
			{
					$all_user_group	= "";
			$all_user_group = $all_user_group . 			"<select name=\"choose_folder\" id=\"choose_folder\" style=\"width:198px; margin-left:4px;\">";
			$all_user_group = $all_user_group . 			"<option value=''>Select Folder</option>";
																$opt_shared	= "Select * from displays_folder";
																$opt_query	= mysql_query($opt_shared);
																while($opt_row = mysql_fetch_array($opt_query))
																{
																	$sel	=	"";
																	$folder_id = $opt_row['folder_id'];
																	$folder_name	 = $opt_row['folder_name'];
																	if($folder	== $folder_id)
																	{
																		$sel	= "selected";	
																	}
			$all_user_group = $all_user_group .							"<option value=$folder_id $sel>$folder_name</option>";
									
																}
			$all_user_group = $all_user_group .			"</select>";		
			return $all_user_group;			
			}		
			function search_folder($id)
			{
						$opt_shared	= "SELECT * FROM `forms_folder` where folder_id = '$id'";
						if(mysql_query($opt_shared))
						{
							$opt_query	= mysql_query($opt_shared);
							$row	= mysql_fetch_array($opt_query);
							return $row['folder_name'];
						}
			}	
			
			function search_folder_display($id)
			{
						$opt_shared	= "SELECT * FROM `displays_folder` where folder_id = '$id'";
						if(mysql_query($opt_shared))
						{
							$opt_query	= mysql_query($opt_shared);
							$row	= mysql_fetch_array($opt_query);
							return $row['folder_name'];
						}
			}	
			
			function only_user()
			{
			$all_user_group = $all_user_group . "<select name=\"shared_user[]\" id=\"shared_user\" size=\"12\" multiple=\"multiple\" style=\"width:350px; margin-left:15px;\" class=\"txtfield3\">";

				$opt_shared	= "Select * from user";
				
				$opt_query	= mysql_query($opt_shared);

				while($opt_row = mysql_fetch_array($opt_query))
				{

					$user_id = $opt_row['user_id'];
					$name	 = $opt_row['first_name']." ".$opt_row['last_name'];
					if($user_id != $_SESSION['user_id'])
					{
						$all_user_group = $all_user_group .	"<option value=$user_id>$name</option>";
						$t++;
					}

				}
				$all_user_group = $all_user_group .			"</select>";
				return $all_user_group;	
			}
			
			function only_user_edit($shared_user_id)
			{
				$all_user_group = $all_user_group . "<select name=\"shared_user[]\" id=\"shared_user\" size=\"12\" multiple=\"multiple\" style=\"width:350px; margin-left:15px;\" class=\"txtfield3\">";															
				
					$opt_shared	= "Select * from user";
					$opt_query	= mysql_query($opt_shared);

					while($opt_row = mysql_fetch_array($opt_query))
					{
						$sel	 = "";									
						$user_id = $opt_row['user_id'];
						$name	 = $opt_row['first_name']." ".$opt_row['last_name'];
						$pos	 = strpos($shared_user_id,",".$user_id.",");
						if($pos !== false)
						{
							$sel = "selected";
						}																	
						if($user_id != $_SESSION['user_id'])
						{
							$all_user_group = $all_user_group .	"<option value=$user_id $sel>$name</option>";
							$t++;
						}

					}

				$all_user_group = $all_user_group .	"</select>";
				return $all_user_group;	
			}
		
	}
?>