aboutsummaryrefslogtreecommitdiff
path: root/app/views/admission/institute-select.php
blob: ed2df3f99afa2731c7d542fae1bfb8a3dd5591bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
 * @var array $institutes
 * @var string $current_institut_id
 */
?>
<? reset($institutes); ?>
<label>
    <?=_("Einrichtung:")?>
    <select name="choose_institut_id" class="nested-select">
        <? while (($institut_id = key($institutes)) && ($institute = current($institutes))): ?>
            <option value="<?= $institut_id ?>" <? if ($current_institut_id === $institut_id) echo 'selected'; ?> class="<?= $institute['is_fak'] ? 'nested-item-header' : 'nested-item' ?>">
                <?= htmlReady(my_substr($institute["name"] . ' (' . $institute["count"] . ')',0,100));?>
            </option>
            <? if ($institute['is_fak'] === 'all') : ?>
                <? $num_inst = $institute['num_inst'];
                    for ($i = 0; $i < $num_inst; ++$i):
                        $institute = next($institutes);
                        $institut_id = key($institutes);

                        if (!$institute) continue;
                    ?>
                    <option value="<?= $institut_id?>" <?=($current_institut_id == $institut_id ? 'selected' : '')?> class="nested-item">
                        <?= htmlReady(my_substr($institute['name'] . ' (' . $institute['count'] . ')',0,100));?>
                    </option>
                <? endfor ?>
            <? endif ?>
            <? next($institutes); ?>
        <? endwhile; ?>
    </select>
</label>