Example #1
0
<div class="row">
    <div class="col-sm-12">
      <table class="table">
        <thead>
          <tr>
            <th>Sanitäter</th>
            <th>Handy</th>
            <th></th>
          </tr>
        </thead>
        <tbody>

        <?php 
$db = new Database();
$con = $db->connectUser();
$anwesend_result = $db->select_anwesend($con, $akw, 's.sanitaeterid');
while ($anwesend = $anwesend_result->fetch_assoc()) {
    $dienst_result = $db->select_dienst_by_id($con, $akw, $anwesend['sid']);
    $dienst = $dienst_result->fetch_assoc();
    $handy_result = $db->select_handy($con);
    echo '<form action="handy.php?PHPSESSID=' . $_GET['PHPSESSID'] . '" method="post">';
    echo '<input type="hidden"  name="sid" value=' . $anwesend['sid'] . '>';
    echo '<tr>';
    echo "<td>" . $anwesend['vorname'] . " " . $anwesend['name'] . "</td>";
    echo '<td>';
    echo '<select class="form-control" name="handy">';
    echo '<option value=" 0 "> Kein Handy  </option>';
    while ($handy = $handy_result->fetch_assoc()) {
        if ($anwesend['sid'] == $handy['SanitaeterID']) {
            echo '<option selected="selected" value="' . $handy['HandyID'] . '">Handy ' . $handy['HandyID'] . ': ' . $handy['Handynummer'] . '</option>';
        } else {
     $kw = 1;
     $neues_jahr = 1;
 }
 if ($neues_jahr == 1 && $kw == $letztekw + 1) {
     break;
 }
 $ferien = false;
 for ($i = 0; $ferien_kw[$i]; $i++) {
     if ($kw == $ferien_kw[$i]) {
         $ferien = true;
     }
 }
 if (!$ferien) {
     $sw++;
 }
 $anwesend_result = $db->select_anwesend($con, $kw, $sid);
 $anwesend = $anwesend_result->fetch_assoc();
 echo '<form action="jahresanwesenheit.php?PHPSESSID=' . $_GET['PHPSESSID'] . '" method="post">';
 echo '<input type="hidden"  name="sid" value=' . $sid . '>';
 echo '<input type="hidden"  name="akw" value=' . $kw . '>';
 echo "<tr>";
 echo "<td>{$kw}</td>";
 echo "<td>" . printweek($kw, $schuljahr + $neues_jahr) . "</td>";
 if (!$ferien) {
     echo "<td><button type='submit' class='btn btn-success btn-sm' name='submit' value='komplette_KW'>{$sw}</button></td>";
 } else {
     echo "<td>Ferien</td>";
 }
 $anwesend['montag'] == 1 ? $checked = 'checked="checked"' : ($checked = '');
 echo '<td><label><input type="checkbox" name="check_' . $sid . '_montag" value="1" ' . $checked . ' ></label></td>';
 $anwesend['dienstag'] == 1 ? $checked = 'checked="checked"' : ($checked = '');