IMPORTANT NOTICE "; $limit=" ("; $limit2=" ("; unset($delim); foreach ( $class as $id ) { $limit .= $delim." catalog_id = ".$id; $limit2 .= $delim." id = ".$id; $delim=" or"; } $limit .= ") "; $limit2 .= ") "; // debug //echo "

".$limit; // // build array of class titles from limit2 // $query="select * from catalog where ".$limit2; $result=mysql_query($query); for ( $i=0; $i<@mysql_num_rows($result); $i++ ) { $local_title=mysql_fetch_array($result); $title[$local_title['id']]=$local_title['title']; } // debug //echo "

".$query; // // $where // unset($where); $delim=" "; if ($_GET['catalog_id']) { $where .= $delim."catalog_id='".$_GET['catalog_id']."'"; $delim=" and "; } if ($_GET['due_date']) { switch ( $_GET['drelation'] ) { case '<': $where .= $delim."due_date<='".$_GET['due_date']."'"; break; case '>': $where .= $delim."due_date>='".$_GET['due_date']."'"; break; default: case '=': $where .= $delim."due_date='".$_GET['due_date']."'"; break; } $delim=" and "; } if ($_GET['week']) { switch ( $_GET['wrelation'] ) { case '<': $where .= $delim."week<='".$_GET['week']."'"; break; case '>': $where .= $delim."week>='".$_GET['week']."'"; break; default: case '=': $where .= $delim."week='".$_GET['week']."'"; break; } $delim=" and "; } // debug //echo "

".$where; switch ( $_GET['view'] ) { default: case 'todo': case 'all': $query="select * from assignment"; if ( $limit || $where ) { $query.= " where ".$where; if ( $limit && $where ) { $query .= " and "; } $query.=$limit; } $query.=" order by due_date asc"; break; case 'weekly': // weekly doesn't make a global query. break; } // debug //echo "

".$query; $result=mysql_query($query); for ($i=0;$i<@mysql_num_rows($result); $i++) { $row[$i]=mysql_fetch_array($result); } $numrows=@mysql_num_rows($result); echo "

\n"; echo "

"; echo "\n"; echo "
\n"; echo "

VIEW: "; echo " [ TODO List ] "; echo " [ WEEKLY graph ] "; echo "

\n"; echo "

"; switch ( $this_quarter ) { case 'f': echo "Fall"; break; case 'w': echo "Winter"; break; case 's': echo "Spring"; break; case 'm': echo "Summer"; break; } echo " ".$this_year; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; switch ( $_GET['view'] ) { default: case 'todo': echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; if ( $numrows ) { for ( $i=0; $i<$numrows; $i++ ) { $color=rowcolor($i); $local_row=$row[$i]; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; if ( $_GET['show_descriptions'] == 'on' || FALSE ) { echo "\n"; } } } else { $color=rowcolor(0); echo "\n"; } break; case 'weekly': echo "\n"; break; } echo "

"; echo "

\n"; echo "\n"; echo "\n"; if ( $_GET['view'] != 'weekly' ) { echo ""; echo "\n"; } if ( $view != 'weekly' ) { echo ""; echo "\n"; } if ( $_GET['view'] != 'weekly' ) { echo ""; echo "\n"; } echo ""; echo "\n"; echo ""; echo "\n"; echo "

Class

\n"; // catalog_id $query="select distinct catalog_id from assignment"; if ( $limit ) { $query .= " where ".$limit; } $query.=" order by catalog_id asc"; $result=mysql_query($query); echo "\n"; echo "

Due Date

\n"; echo "\n"; // duedate $query="select distinct due_date from assignment order by due_date asc"; $result=mysql_query($query); echo "\n"; echo "

Week

\n"; echo "\n"; // week $query="select distinct week from assignment order by week asc"; $result=mysql_query($query); echo "\n"; echo "

Show Descriptions?

\n"; // show descriptions? echo "\n"; echo "

 

\n"; echo "\n"; // echo "
\n"; echo "\n"; echo "

Assignment

Class

Due Date

Week

".$local_row['title']."

"; $cquery="select * from catalog where id='".$local_row['catalog_id']."'"; $cresult=mysql_query($cquery); if ( @mysql_num_rows($cresult) ) { $local_class=mysql_fetch_array($cresult); echo $local_class['title']." (".strtoupper($local_class['code']).") "; } else { echo $local_row['catalog_id']; } echo "

".$local_row['due_date']."

"; // WEEK if ( empty($local_row['week']) ) { echo "Res"; } else { echo $local_row['week']; } echo "

".$local_row['description']."

No Results

\n"; echo "\n"; echo "\n"; for ( $j=0;$j

".$title[$class[$j]]."\n"; echo "

\n"; } echo "\n"; for ( $i=0;$i<$numweeks;$i++ ) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; for ( $j=0;$j"; $query="select * from assignment where week='". ( $i + 1 ) ."' and catalog_id='". ( $j + 1 )."' and ( due_date is NULL or due_date = '' ) order by due_date asc"; $result=mysql_query($query); //echo "

$query\n"; if ( @mysql_num_rows($result) ) { for ( $k=0;$k".$local_row['title']."\n"; echo "
".$local_row['due_date']."\n"; if ( $_GET['show_descriptions'] == 'on' || FALSE ) { echo "
".$local_row['description']."\n"; } } } else { echo "

No assignments w/o due dates\n"; } echo "\n"; echo "

\n"; } echo "\n"; echo "\n"; for ( $j=0;$j"; $query="select * from assignment where week='". ( $i + 1 ) ."' and catalog_id='". ( $j + 1 )."' and due_date order by due_date asc"; $result=mysql_query($query); //echo "

$query\n"; if ( @mysql_num_rows($result) ) { for ( $k=0;$k".$local_row['title']."\n"; echo "
".$local_row['due_date']."\n"; if ( $_GET['show_descriptions'] == 'on' || FALSE ) { echo "
".$local_row['description']."\n"; } } } else { echo "

No assignments w/ due dates\n"; } echo "\n"; echo "

\n"; } echo "\n"; // show residencies here, if it's a residency weekend $rquery="select * from residency where year='".$this_year."' and quarter='".$this_quarter."' and week='".( $i + 1 )."'"; $rresult=mysql_query($rquery); if ( @mysql_num_rows($rresult) ) { // weekly spacer echo "\n"; for ( $j=0;$j$holder\n"; echo "\n"; } echo "\n"; $local_residency=mysql_fetch_array($rresult); echo "\n"; //echo "\n"; //echo "\n"; for ( $j=0;$j"; echo "

".$local_residency['name']; $query="select * from assignment where week='0' and catalog_id='". ( $j + 1 )."' and ( due_date >= '".$local_residency['start']."' and due_date <= '".$local_residency['stop']."' ) order by due_date asc"; $result=mysql_query($query); //echo "

$query\n"; if ( @mysql_num_rows($result) ) { for ( $k=0;$k".$local_row['title']."\n"; echo "
".$local_row['due_date']."\n"; if ( $_GET['show_descriptions'] == 'on' || FALSE ) { echo "
".$local_row['description']."\n"; } } } else { echo "

No residency assignments\n"; } echo "\n"; echo "

\n"; } echo "\n"; } // weekly spacer echo "\n"; for ( $j=0;$j

 \n"; echo "

\n"; } echo "\n"; } echo "
$holder

Week ".( $i + 1 )."

$holder
$holder
$holder
$holder
$holder
\n"; echo "
\n"; echo "

\n"; echo "

\n"; ?>

*** NOTICE ***
This code is preliminary and may do unexpected things. The tool is experimental and may not work and/or break at various times, doing various things. The data is incomplete and from preliminary versions of the catalogs and may be innacurate or not reflect what actually is offered. The tool is not permanent and may go away or not be available without future notice. Etc ... Etc ...
*** NOTICE ***