dieser term soll dann dadurch ersetzt werden
HTML-Code:
if(staffList[i]['is_present'] !== "true" ){ continue; }
<?php //conection: $link = mysqli_connect("localhost","root","","ts") or die("Error " . mysqli_error($link)); //consultation: $query = "SELECT surname, id_staff FROM staff" or die("Error in the consult.." . mysqli_error($link)); //execute the query. $result = $link->query($query); //display information: echo "<select multiple>"; while($row = mysqli_fetch_array($result)) { echo "<option>".$row["surname"].$row["id_staff"]."</option>"; } echo "</select>"; ?>
for (var i in staffList){ if(staffList[i]['is_present'] !== "true" ){ continue; } var th_element = document.createElement('th'); th_element.class="day"; th_element.style="min-width: 50px; max-width: 60px;" th_element.innerHTML=staffList[i]['surname']; th_element.value=Date.parse(date) + '_' + staffList[i]['id_staff'];
for (var i in staffList){ if(staffList[i]['is_present'] !== "true" ){ continue; }
<?php //conection: $link = mysqli_connect("localhost","root","","ts") or die("Error " . mysqli_error($link)); //consultation: $query = "SELECT surname, id_staff FROM staff" or die("Error in the consult.." . mysqli_error($link)); //execute the query. $result = $link->query($query); //display information: echo "<select multiple>"; while($row = mysqli_fetch_array($result)) { echo "<option>".$row["surname"].$row["id_staff"]."</option>"; } echo "</select>"; ?>
for (var i in staffList){ if(staffList[i]['is_present'] !== "true" ){ continue; } var th_element = document.createElement('th'); th_element.class="day"; th_element.style="min-width: 50px; max-width: 60px;" th_element.innerHTML=staffList[i]['surname']; th_element.value=Date.parse(date) + '_' + staffList[i]['id_staff'];
for (var i in staffList){ if(staffList[i]['is_present'] !== "true" ){ continue; }
staffList[0] = new Array(); staffList[0]["surname"] = "Piet"; staffList[0]["id_staff"] = "9"; staffList[0]["is_present"] = "true"; staffList[1] = new Array(); staffList[1]["surname"] = "Inga"; staffList[1]["id_staff"] = "10"; staffList[1]["is_present"] = "true";
<?php //conection: $link = mysqli_connect("localhost","root","","ts") or die("Error " . mysqli_error($link)); //consultation: $query = "SELECT surname, id_staff FROM staff" or die("Error in the consult.." . mysqli_error($link)); //execute the query. $result = $link->query($query); //display information: echo "<select>"; while($row = mysqli_fetch_array($result)) { echo "<option>".$row["surname"]."</option>"; } echo "</select>"; ?>
$db = mysqli_connect('localhost', 'root', '', 'ts') or die(mysqli_error($db));
$sql = 'SELECT surname, id_staff FROM staff';
$staff_result = mysqli_query($db, $sql);
<select name="staff" multiple="multiple">
<?php while ($row = mysqli_fetch_assoc($staff_result)): ?>
<option value="<?php echo htmlspecialchars($row['id_staff'], ENT_COMPAT, 'UTF-8'); ?>">
<?php echo htmlspecialchars($row['surname'], ENT_COMPAT, 'UTF-8'); ?>
</option>
<?php endwhile; ?>
</select>
staffList[0] = new Array(); staffList[0]["surname"] = "Piet"; staffList[0]["id_staff"] = "9"; staffList[0]["is_present"] = "true"; staffList[1] = new Array(); staffList[1]["surname"] = "Inga"; staffList[1]["id_staff"] = "10"; staffList[1]["is_present"] = "true";
var staffList = new Array(); staffList = getStaffList(); var staffList = $('select[name="staff"] > option').map(function () { var $option = $(this); return { surname: $.trim($option.text()), id_staff: $option.val() }; }).get(); for (var i in staffList){ var th_element = document.createElement('th'); th_element.class="day"; th_element.style="min-width: 50px; max-width: 60px;" th_element.innerHTML=staffList[i]['surname']; th_element.value=Date.parse(date) + '_' + staffList[i]['id_staff'];
Kommentar