示例#1
0
if ($loggedIn) {
    // instructor menu
    if ($_SESSION['isInstructor'] == '1') {
        echo "<li><a href='../accounts_manage.php'> Accounts </a></li>";
        echo "<li><a href='../labs_manage.php'> Labs </a></li>";
        echo "<li><a href='../results_download.php'> Results </a></li>";
        echo "<li><a href='../settings.php'> Settings </a></li>";
    } else {
        // student menu
        ?>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                               aria-haspopup="true" aria-expanded="false">Labs <span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <?php 
        $labs = getLabs();
        while ($row = mysqli_fetch_assoc($labs)) {
            ?>
                                    <li>
                                        <a href='lab_view.php?id=<?php 
            echo htmlentities($row['id']);
            ?>
'><?php 
            echo "Lab " . $row['id'];
            ?>
</a>
                                    </li>
                                    <?php 
        }
        //
        ?>
    <?php 
require "templates/navigation.php";
?>

    <content>
        <div class="container-fluid">

            <h2>Manage Labs</h2>
            <br>

	        <p>
		        Click on a lab's name to see the student view for that lab. You may add, edit, or delete labs from this
		        page.
	        </p>
            <?php 
$result = getLabs();
?>
            <a href="lab_add.php"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&nbsp;Add Lab</a>
            <table id="labs-table" class='table-striped table-hover'>
                <?php 
while ($row = mysqli_fetch_assoc($result)) {
    ?>
                    <tr>
                        <th>
                            <a href="lab_view.php?id=<?php 
    echo htmlentities($row['id']);
    ?>
"><?php 
    echo "Lab " . htmlentities($row['id']);
    ?>
</a>
示例#3
0
     addEquipment();
     break;
 case 5:
     getEquipments();
     break;
 case 6:
     editEquipment();
     break;
 case 7:
     deleteEquipment();
     break;
 case 8:
     addLab();
     break;
 case 9:
     getLabs();
     break;
 case 10:
     editLab();
     break;
 case 11:
     deleteLab();
     break;
 case 12:
     addManufacturer();
     break;
 case 13:
     getManufacturers();
     break;
 case 14:
     editManufacturer();
示例#4
0
$results = $mysqli->prepare("SELECT properties.property_id, paper_title, moduleid, period, barriers_needed, cohort_size, campus, DATE_FORMAT(start_date,'{$configObject->get('cfg_long_date_time')}'), end_date, labs FROM (properties, properties_modules, modules, scheduling) WHERE start_date > NOW() AND properties.property_id=scheduling.paperID AND properties.property_id=properties_modules.property_id AND properties_modules.idMod=modules.id AND deleted IS NULL ORDER BY period");
$results->execute();
$results->store_result();
$results->bind_result($property_id, $paper_title, $moduleID, $period, $barriers_needed, $cohort_size, $campus, $start_date, $end_date, $labs);
while ($results->fetch()) {
    if (!isset($papers[$property_id])) {
        $papers[$property_id] = array('paper_title' => $paper_title, 'period' => $period, 'barriers_needed' => $barriers_needed, 'cohort_size' => $cohort_size, 'campus' => $campus, 'start_date' => $start_date, 'end_date' => $end_date, 'labs' => $labs);
    }
    $papers[$property_id]['modules'][] = $moduleID;
}
$results->close();
foreach ($papers as $property_id => $paper_details) {
    $cohort_size = str_replace('<', '&lt;', $paper_details['cohort_size']);
    $cohort_size = str_replace('>', '&gt;', $cohort_size);
    echo "<tr class=\"l\" id=\"{$property_id}\">";
    echo "<td><img src=\"../artwork/shortcut_calendar_icon.png\" width=\"16\" height=\"16\" />&nbsp;" . $paper_details['paper_title'] . "</td><td>" . $paper_details['start_date'] . "</td><td>{$campus} " . getLabs($paper_details['labs'], $mysqli) . "</td><td>";
    $html = '';
    foreach ($paper_details['modules'] as $individual_module) {
        if ($html == '') {
            $html = $individual_module;
        } else {
            $html .= ', ' . $individual_module;
        }
    }
    echo "{$html}</td><td>{$cohort_size}</td></tr>\n";
}
?>
</table>
</div>

</body>