\n\n$ttl\n\n\n" . "

$ttl

\n" . "There is a problem with this site.\n

\n" . "Please contact the site owner mentioning the " . "following condition code:\n

\n" . SAS_VERSION . '/' . $conditioncode . "\n

\n" . "Thank you for your cooperation!\n\n\n"; exit; } /* error_exit() */ // SANITY CHECK #1 - is there an existing installation at the location we expect? if (!file_exists('../' . $cmsdir . '/configuration/database.inc.php')) { error_exit('010'); } // SANITY CHECK #2 - do we have a connection to a working database? include ('../' . $cmsdir . '/configuration/database.inc.php'); if (!($db = mysql_connect($db_server, $db_username, $db_password))) { error_exit('020'); } // SANITY CHECK #3 - do we have access to our own database? if (!mysql_select_db($db_name)) { error_exit('030'); } /* * Still here? Must have valid database in our hands then. Carry on... */ error_reporting($old_error_reporting); // switch on error reporting after sanity checks require ("../$cmsdir/core/session.php"); //build a session $query = "SELECT config_value FROM $table_configuration WHERE config_key='sessioncode'"; if ($result = mysql_query($query)) { $check_sessioncode = mysql_result($result, 0); unset ($query); unset ($result); } if ($_SESSION['sessioncode'] != $check_sessioncode) { //if we don't have a session exit exit; } if (IsSet ($_SESSION['userid'])) { $userid = $_SESSION['userid']; } else { $userid = ""; } $usertype = $_SESSION['usertype']; if (IsSet ($userid) AND $usertype == "teacher") { $query = "SELECT dbtables FROM $table_modules WHERE location='sn_agenda'"; //get the table names for the agenda $result = mysql_query($query); $moduletables = mysql_result($result, 0); unset ($query); unset ($result); $moduletables = explode(",", $moduletables); $table_agenda_events = "$moduletables[0]"; $table_agenda_name = "$moduletables[1]"; $query = "SELECT config_value FROM $table_configuration WHERE config_key='agenda_options'"; $result = mysql_query($query); $agenda_options = mysql_result($result, 0, 0); $agenda_options = explode(",", $agenda_options); $busy_color = $agenda_options[0]; $busy_color_edit = $agenda_options[1]; $bgcolor = $agenda_options[2]; $months_bgcolor = $agenda_options[3]; $months_font_color = $agenda_options[4]; $weekend_color = $agenda_options[5]; $day_color = $agenda_options[6]; $timeslots_header_color = $agenda_options[7]; $week_days_bgcolor = $agenda_options[8]; $week_number_bgcolor = $agenda_options[9]; $active_day_color = $agenda_options[10]; $mouse_over_color = $agenda_options[11]; $query = "SELECT config_value FROM $table_configuration WHERE config_key='url'"; $result = mysql_query($query); $pa_link = mysql_result($result, 0, 0); } else { print $sas_lang['agenda_noaccess']; exit; } ?>