Example #1
0
                echo "selected ";
            }
            echo "value=\"" . $d . "\">" . $d . "</option>";
        }
        ?>
</select>
<select name="num<?php 
        echo $i + 1;
        ?>
" id="num<?php 
        echo $i + 1;
        ?>
">
<option>Course Number</option>
<?php 
        $ccs = get_courses_in_department($courses[$i]["department"], $college["id"]);
        foreach ($ccs as $c) {
            echo "<option ";
            if ($c["number"] == $courses[$i]["number"]) {
                echo "selected ";
            }
            echo "value=\"" . $c["id"] . "\">" . $c["department"] . $c["number"] . (strlen($c["title"]) > 0 ? " (" . $c["title"] . ")" : "") . "</option>";
        }
        ?>
</select>
<?php 
        if ($i == count($courses) - 1) {
            ?>
<img id="btnAdd" src="+.png" height="20" style="cursor: hand; margin-bottom: -5px"/>
<?php 
        } else {
<?php

error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
require_once 'includes.php';
require_once 'functions.php';
$courses = get_courses_in_department($_GET["dept"], $_GET["college"]);
echo json_encode($courses);
?>