Example #1
0
                    $cou = getCoursesThatNotHaveGradeTheStudent($departmentId, $studentId);
                    echo generateOptionsWithSpecifiedValueField($cou, 'courseId', 'courseName');
                }
                break;
            case 'studentIdAndReturnCourseIdThatHaveGrade':
                if (!empty($_POST[$key])) {
                    $studentId = $_POST[$key];
                    $departmentId = $_POST['departmentIdAndReturnCourseIdThatHaveGrade'];
                    $cou = getCoursesThatHaveGradeTheStudent($departmentId, $studentId);
                    echo generateOptionsWithSpecifiedValueField($cou, 'courseId', 'courseName');
                }
                break;
            case 'studentIdAndReturnGradeId':
                if (!empty($_POST[$key])) {
                    $studentId = $_POST[$key];
                    $courseId = $_POST['courseIdAndReturnGradeId2'];
                    $gra = getGradeFromCourse($studentId, $courseId);
                    echo generateOptionsWithSpecifiedValueField($gra, 'gradeId', 'gradeVal');
                }
                break;
            case 'getUniversities':
                if (!empty($_POST[$key])) {
                    $uni = getAllUniversities();
                    echo generateOptionsWithSpecifiedValueField($uni, 'universityName', 'universityName');
                }
                break;
        }
    }
} else {
    redirectTo("index.php");
}
Example #2
0
echo generateDropDownListWithFirstOption(null, "Select University First", 'selectedDepartmentId', 'selectedDepartmentChange');
echo generateDropDownListWithFirstOption(null, "Select Department First", 'selectedSecretaryId', 'selectedSecretaryChange');
?>
            <input type="text" name="secretaryUsername" placeholder="Secretary Username"><br>
            <input type="text" name="SecretaryPassword" placeholder="Secretary Password"><br>
            <input type="submit" name="submit" value="change">
        </form>
    </div>

    <div class="department" id="transfer">
        <h4>Transfer Department </h4>
        <form action="manageDepartmentsSubmit.php" method="post">
            <?php 
echo generateDropDownListWithFirstOption(getAllUniversitiesNames(), "Select University", 'selectedUniversity', 'selectedUniversityTransfer');
echo generateDropDownListWithFirstOption(null, "Select University First", 'selectedDepartmentId', 'selectedDepartmentTransferId');
echo generateDropDownListWithSpecifiedValueKey(getAllUniversities(), 'transferToSelectedUniversityId', 'transferToSelectedUniversityId', 'universityId', 'universityName');
?>
            <input type="submit" name="submit" value="transfer">
        </form>
    </div>

    <div class="department" id="remove">
        <h4>Remove Department </h4>
        <form action="manageDepartmentsSubmit.php" method="post">
            <?php 
echo generateDropDownListWithFirstOption(getAllUniversitiesNames(), "Select University", 'selectedUniversity', 'selectedUniversityDelete');
echo generateDropDownListWithFirstOption(null, "Select University First", 'selectedDepartmentId', 'selectedDepartmentDelete');
?>
            <input type="submit" name="submit" class="warningButton" value="remove">
        </form>
    </div>
    include 'navBar.php';
    ?>
  <div>
    <h2>Database Editor</h2>
    <div id="instructions">
    	Select a University from the list. Then edit the fields below. <br>
    	Or select "Add New School" to add a new university. <br>
    	Click "Update" to commit your changes to the database.
    </div>

    <div>
    <form name="selectSchool" method="get">
      <select name="univId">
      	<option value="-1"> - Select School -</option>
      	<?php 
    $univList = getAllUniversities();
    foreach ($univList as $univ) {
        print '<option value=' . $univ['public_university_id'];
        if (isset($_GET['univId']) and $_GET['univId'] == $univ['public_university_id']) {
            echo ' selected="1" ';
        }
        print '>' . htmlentities($univ['name']) . '</option>';
    }
    ?>
      </select>
      <input type="submit" value="Get School Info" />
      <input type="submit" name="newSchool" value="Add New School" />
    </form>
    </div>
    <?php 
    echo '<div id="updateUniversityStatus">';