Location: PHPKode > projects > Athena Research Assistant > athena-dev-0.1pre-alpha/objects/addgroupFORM.php
<?php
$getGROUPS =	mysql_query("SELECT * FROM ath_groups"); //GET GROUPS
				
if (!$getGROUPS){
	echo("<p class=\"red\">adduserFORM.php COULD NOT GET GROUP INFO");
}
?>

<script language="JavaScript">
function check(){
	if (addgroup.groupname.value == ""){
		window.alert("Field 'Group Name' cannot be left blank.");
		return false;
	}
}

	var url;
	var height;
	var width;
	var specs;
	function openwinHELP(url, width, height){
		specs = 'toolbar,scroll,status,resizable,width=' + width + ',height=' + height + ',top=75,left=150'
		popupWin = window.open(url,'pop_tiny',specs);
	}
</script>

	<body>
	<table border="0" cellspacing="0" cellpadding="1" bgcolor="#333333">
		<tr>
			<td class="cell_heading">ADD A NEW GROUP</td>
		</tr>
		<tr>
			<td>
				<form name="addgroup" action="main.php?act=addgroup" method="post" onSubmit="return check(this)">
				<table width="450" border="0" cellspacing="0" cellpadding="2" bgcolor="white">
						<tr>
						<td class="form_right" bgcolor="#f0e68c" width="150">Group Name:</td>
						<td bgcolor="#f0e68c" width="150"><input type="text" name="groupname" value='<?php echo($_POST["groupname"]); ?>' size="20" border="0"></td>
					</tr>
						<tr>
							<td colspan="2" align="center" bgcolor="#d3d3d3" width="304"><b>Members of this group can:</b></td>
						</tr>
						<tr>
							<td class="form_right" bgcolor="#f0e68c" width="150">Add/Delete notes:</td>
							<td bgcolor="#f0e68c" width="150"><?php
						echo("<select name=\"addnotes\" size=\"1\">");
							if ($_POST["addnotes"] == 1){ 
								echo("<option selected value=\"1\">Yes</option>");
								echo("<option value=\"0\">No</option>");
							}
							else{
								echo("<option selected value=\"0\">No</option>");
								echo("<option value=\"1\">Yes</option>");
							}
						echo("</select>");
						?></td>
						</tr>
						<tr>
							<td class="form_right" bgcolor="#f0e68c" width="150">Add/Delete resources:</td>
							<td bgcolor="#f0e68c" width="150"><?php
						echo("<select name=\"addresrc\" size=\"1\">");
							if ($_POST["addresrc"] == 1){ 
								echo("<option selected value=\"1\">Yes</option>");
								echo("<option value=\"0\">No</option>");
							}
							else{
								echo("<option selected value=\"0\">No</option>");
								echo("<option value=\"1\">Yes</option>");
							}
						echo("</select>");
						?></td>
						</tr>
						<tr>
							<td class="form_right" bgcolor="#f0e68c" width="150">Add/Delete projects:</td>
							<td bgcolor="#f0e68c" width="150"><?php
						echo("<select name=\"addprojects\" size=\"1\">");
							if ($_POST["addprojects"] == 1){ 
								echo("<option selected value=\"1\">Yes</option>");
								echo("<option value=\"0\">No</option>");
							}
							else{
								echo("<option selected value=\"0\">No</option>");
								echo("<option value=\"1\">Yes</option>");
							}
						echo("</select>");
						?></td>
						</tr>
						<tr>
							<td class="form_right" valign="top" bgcolor="#f0e68c" width="150">Add items to Public Resource:</td>
							<td valign="top" bgcolor="#f0e68c" width="150"><?php
						echo("<select name=\"addtopublic\" size=\"1\">");
							if ($_POST["addtopublic"] == 1){ 
								echo("<option selected value=\"1\">Yes</option>");
								echo("<option value=\"0\">No</option>");
							}
							else{
								echo("<option selected value=\"0\">No</option>");
								echo("<option value=\"1\">Yes</option>");
							}
						echo("</select>");
						?> <a href="#" onclick="openwinHELP('../helpfiles/aboutPUBLIC.html', 350, 350)"><img src="../images/help.jpg" alt="" height="14" width="14" border="0"></a></td>
						</tr>
						<tr>
							<td class="form_right" bgcolor="#f0e68c" width="150">Administrate:</td>
							<td bgcolor="#f0e68c" width="150"><?php
						echo("<select name=\"administrate\" size=\"1\">");
							if ($_POST["administrate"] == 1){ 
								echo("<option selected value=\"1\">Yes</option>");
								echo("<option value=\"0\">No</option>");
							}
							else{
								echo("<option selected value=\"0\">No</option>");
								echo("<option value=\"1\">Yes</option>");
							}
						echo("</select>");
						?> <a href="#" onClick="openwinHELP('../helpfiles/aboutADMINISTRATE.html', 350, 350)"><img src="../images/help.jpg" alt="" height="14" width="14" border="0"></a></td>
						</tr>
						<tr>
						<td class="form_right" bgcolor="#e9967a" width="150">Add/Delete users:</td>
						<td bgcolor="#e9967a" width="150">
						<?php
						echo("<select name=\"addusers\" size=\"1\">");
							if ($_POST["addusers"] == 1){ 
								echo("<option selected value=\"1\">Yes</option>");
								echo("<option value=\"0\">No</option>");
							}
							else{
								echo("<option selected value=\"0\">No</option>");
								echo("<option value=\"1\">Yes</option>");
							}
						echo("</select>");
						?>
						</td>
					</tr>
						<tr>
						<td class="form_right" bgcolor="#e9967a" width="150">View user profiles:</td>
						<td bgcolor="#e9967a" width="150"><?php
						echo("<select name=\"viewuserprofiles\" size=\"1\">");
							if ($_POST["viewuserprofiles"] == 1){ 
								echo("<option selected value=\"1\">Yes</option>");
								echo("<option value=\"0\">No</option>");
							}
							else{
								echo("<option selected value=\"0\">No</option>");
								echo("<option value=\"1\">Yes</option>");
							}
						echo("</select>");
						?></td>
					</tr>
						
						<?php if ($checkUSER["ath_groups_ADMINISTRATE"] == 1): ?>
						<tr>
							<td class="form_right" bgcolor="#e9967a" width="150">Add/Delete groups:</td>
							<td bgcolor="#e9967a" width="150"><?php
						echo("<select name=\"addgroups\" size=\"1\">");
							if ($_POST["addgroups"] == 1){ 
								echo("<option selected value=\"1\">Yes</option>");
								echo("<option value=\"0\">No</option>");
							}
							else{
								echo("<option selected value=\"0\">No</option>");
								echo("<option value=\"1\">Yes</option>");
							}
						echo("</select>");
						?></td>
						</tr>
						<?php endif; ?>
						
						<tr>
							<td class="form_right" bgcolor="#e9967a" width="150">View other groups:</td>
							<td bgcolor="#e9967a" width="150"><?php
						echo("<select name=\"viewgroups\" size=\"1\">");
							if ($_POST["viewgroups"] == 1){ 
								echo("<option selected value=\"1\">Yes</option>");
								echo("<option value=\"0\">No</option>");
							}
							else{
								echo("<option selected value=\"0\">No</option>");
								echo("<option value=\"1\">Yes</option>");
							}
						echo("</select>");
						?></td>
						</tr>
						<tr height="10">
							<td class="form_right" bgcolor="#e9967a" width="150" height="10"></td>
							<td bgcolor="#e9967a" width="150" height="10"></td>
						</tr>
						<tr>
					<td class="form_right" bgcolor="#90ee90" width="150">&nbsp;</td>
					<td bgcolor="#90ee90" width="150"><input type="submit" name="addgroup" value="Add Group" border="0"></td>
				</tr>
			</table>
			</form>
			</td>
		</tr>
	</table>
</body>
Return current item: Athena Research Assistant