<?php

require_once "ws_soap_common.php";
global $JAVASCRIPT_BASE;
global $ASSETS_BASE;
global $IMAGE_BASE;
global $LOGOUT_URL;
global $CONTACT_EMAIL;
$my_courses = getMyCourses();
$exists = spaceExists($my_courses);
$REMOTE_USER = $_SERVER['REMOTE_USER'];
$space_name = $_REQUEST['space_name'];
$url = "https://{$space_name}.wikispaces.columbia.edu";
?>

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html> <head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<script src="<?php 
echo $JAVASCRIPT_BASE;
?>
/MochiKit/MochiKit.js" type="text/javascript"></script>
<script src="<?php 
echo $JAVASCRIPT_BASE;
?>
/ajaxify_forms.js" type="text/javascript"></script>

<title>Administer Wikispace</title>


<style type="text/css">
    while ($row = mysql_fetch_array($result)) {
        echo '<tr>';
        echo '<td>' . htmlentities($row['title']) . '</td>';
        echo '<td>' . htmlentities($row['days']) . '</td>';
        echo '<td>' . htmlentities($row['crn']) . '</td>';
        echo '<td></td>';
        echo '</tr>';
    }
} else {
    die(mysql_error());
}
?>
                    <?php 
include_once "functions.php";
$_SESSION["uid"] = isset($_SESSION["uid"]) ? $_SESSION["uid"] : 1;
$courses = getMyCourses($_SESSION['uid']);
foreach ($courses as $course) {
    ?>
                        <tr>
                            <td><?php 
    echo $course['title'];
    ?>
</td>
                            <td>
                                <?php 
    $letters = array('M', 'T', 'W', 'R', 'F', 'S');
    $arrayOfLetters = str_split($course['days']);
    ?>
                                <div class="schedule-for-days">
                                    <?php 
    $counter = 0;