about.php
account.php
auth.php
contact.php
create.php
edit_schedule.php
faq.php
group_view.php
groups.php
index.php
password.php
register.php
results.php
schedules.ph
p



download
all files

Group_view.php Source Code
<html>
<head>
<title>GroupAware : Schedules</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="group.css" rel="stylesheet" type="text/css">
<link href="blocks.css" rel="stylesheet" type="text/css">
</head>

<body vlink="#333333" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="125" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="75" valign="bottom" bgcolor="#CCCCCC"><table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="125" height="110"><font size="7" face="Arial, Helvetica, sans-serif"><strong><a href="index.php"><img src="groupAwareLogoSm2.gif" alt="logo" width="103" height="99" border="0" align="absmiddle"></a></strong></font></td>
<td><img src="spacer.gif" width="20" height="8"><font size="7" face="Arial, Helvetica, sans-serif"><strong>Group<font color="#003366">Aware</font>
<font size="4"><br>
<img src="spacer.gif" width="150" height="1">Meeting Time Organizer</font></strong></font></td>
<td width="200" valign="top" class="css">
<div align="right"><strong><font size="1"><a href="about.php"> <font size="2">About</font></a><font size="2">
| <a href="faq.php">FAQ</a> | <a href="contact.php">Contact</a><img src="spacer.gif" width="10" height="8"></font></font></strong>&nbsp;</div></td>
</tr>
</table>
<div align="right">
<table width="500" height="25" border="0" cellpadding="0" cellspacing="0" bordercolor="#660000" class="tabs">
<tr valign="middle" class="css">
<td width="100" bgcolor="#FFFFFF">
<div align="center"><a href="edit_schedule.php"><strong>Edit Schedule</strong></a></div>
</td>
<td width="100" bgcolor="#660000">
<div align="center"><font color="#FFFFFF"><strong>View My Groups</strong></font></div>
</td>
<td width="100" bgcolor="#FFFFFF">
<div align="center"><strong><a href="create.php">Create a Group</a></strong></div>
</td>
<td width="100" bgcolor="#FFFFFF">
<div align="center"><strong><a href="account.php">My Account</font></a></strong></div>
</td>
<td width="100" nowrap bgcolor="#FFFFFF">
<div align="center"><strong><a href="index.php?action=logout">Log Out </a></font></strong></div>
</td>
</tr>
</table>

</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5" bgcolor="#660000"><img src="spacer.gif" width="1" height="1"></td>
</tr>
</table>
</td>
</tr>
<!--
<tr>
<td height="7" colspan="2" bgcolor="#660000"><img src="spacer.gif" width="1" height="1"></td>
</tr>
-->
</table>
<table width="100%" height="80%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<p align="center" class="css"><font size="1"><br>
<font size="2" face="Arial, Helvetica, sans-serif">
<CENTER>
<p><font color="#CCCCCC" size="2" face="Arial, Helvetica, sans-serif"><strong>Available Times</strong></font></p>
<p><strong><font color="#660000" size="2" face="Arial, Helvetica, sans-serif">Unavailable Times</font></strong></p>
<!--
<IMG SRC="Time_Open.gif" WIDTH="10" HEIGHT="10"> Available Times<BR>
<IMG SRC="Time_Closed.gif" WIDTH="10" HEIGHT="10"> Unavailable Times<BR>
-->
</CENTER>
</font>
<form name="form1" method="post" action="results.php">
<table width="600" border="0" align="center" cellpadding="5" cellspacing="3">
<tr valign="top">
<td width="80"><div align="center"><font color="#003366"><strong><font size="2" face="Arial, Helvetica, sans-serif">Sunday</font></strong></font></div></td>
<td width="80"><div align="center"><font color="#003366"><strong><font size="2" face="Arial, Helvetica, sans-serif">Monday</font></strong></font></div></td>
<td width="80"><div align="center"><font color="#003366"><strong><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;Tuesday</font></strong></font></div></td>
<td width="80"><div align="center"><font color="#003366"><strong><font size="2" face="Arial, Helvetica, sans-serif">Wednesday</font></strong></font></div></td>
<td width="80"><div align="center"><font color="#003366"><strong><font size="2" face="Arial, Helvetica, sans-serif">Thursday</font></strong></font></div></td>
<td width="80"><div align="center"><font color="#003366"><strong><font size="2" face="Arial, Helvetica, sans-serif">Friday</font></strong></font></div></td>
<td width="80"><div align="center"><font color="#003366"><strong><font size="2" face="Arial, Helvetica, sans-serif">Saturday</font></strong></font></div></td>
</tr>
<tr valign="top">

<?php

//require_once('Connections/dbsvr.php');
require_once('Connections/groupaware.php');

#####################################
# NEEDS TO RECEIVE THE GROUP ID HERE#
#####################################
#
$GroupID = $HTTP_GET_VARS['id'];
#

//function to handle the comparison between database vector and user members vector
function RestaDeArrays($vectorA,$vectorB)
{
$cantA=count($vectorA);
$cantB=count($vectorB);
$No_saca=0;
for($i=0;$i<$cantA;$i++)
{
for($j=0;$j<$cantB;$j++)
{
if($vectorA[$i]==$vectorB[$j])
$No_saca=1;
}

if($No_saca==0)
$nuevo_array[]=$vectorA[$i];
else
$No_saca=0;
}

return $nuevo_array;
}

//array of times available to be selected
$Times = array("", "8:00", "8:30", "9:00", "9:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "1:00", "1:30", "2:00", "2:30", "3:00", "3:30", "4:00", "4:30", "5:00", "5:30", "6:00", "6:30", "7:00", "7:30", "8:00", "8:30", "9:00", "9:30", "10:00", "10:30");

//loop through each day, grabbing the list of unavailable times from the database and assigning them to a vector
for ($Day = 1; $Day <= 7; $Day++) {

$Alltimes = array();
$newArray = array();
$FinalResult = array();
$arr = array();

mysql_select_db($database_dbsvr, $dbsvr);
$query_auth = "SELECT user_unavailable.Time
FROM user_unavailable, group_detail, groups
WHERE user_unavailable.User_ID = group_detail.userID AND
group_detail.groupid = groups.name AND
groups.groupID = $GroupID AND
user_unavailable.Day = $Day";

$result = mysql_query($query_auth, $dbsvr) or die(mysql_error());

while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
$arr[] = $row["Time"];
}

$newArray=array_unique($arr);

//array of all time values... represents the counted depth from the top of the selection box
// so the earliest time would be 1, the latest would be 30.

$Alltimes = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30");

$FinalResult = RestaDeArrays($Alltimes,$newArray);

#Display Final Results Here

#echo "<TD>\n";
#foreach ($FinalResult as $v) {
# echo "$v <BR>";
#}
#echo "</TD>\n";

//begins to output the information
echo "<TD><TABLE BORDER='0' CELLSPACING='0' CELLPADDING='2' WIDTH='80'>\n";
$a = 0;
$d = 0;
$Length = count($FinalResult);

while ($a < $Length) {

$EXIT = 0;

//loops through array and colors the table cell background red if the time is unavailable
while ($d <= 30 && $EXIT == 0) {
$d++;
if ($FinalResult[$a] == $d) {
$x = $FinalResult[$a];
echo "<TR><TD BGCOLOR='#CCCCCC'><font size='2' face='Arial, Helvetica, sans-serif'>&nbsp;&nbsp; $Times[$x]</TD></TR>";
$EXIT = 1;
} else {
echo "<TR><TD BGCOLOR='#660000'><font size='2' face='Arial, Helvetica, sans-serif' color='#FFFFFF'>&nbsp;&nbsp; $Times[$d]</TD></TR>";
}
}

$a++;
}

echo "</TABLE></TD>\n";

mysql_free_result($result);

}

?>

</tr>
</table>
<br><br> <span class="css"><font size="2" face="Arial, Helvetica, sans-serif">
<center><a href="groups.php">Return to groups</a></center></font></span>
<br><br>


</td>
</tr>
<tr>
<td height="20" valign="top"><div align="center"><span class="css"><font size="1" face="Arial, Helvetica, sans-serif">This
site was created by IST students at The Pennsylvania State University.
Use of this system is subject to the terms and conditions set forth.<br>
Copyright 2005</font><font size="1"></font></span><font size="1"><br>
<br>
</font></div></td>
</tr>
</table>
</body>
</html>