formatting added id to icon for dropdown referencing

This commit is contained in:
Tim Krehan 2019-05-26 18:02:06 +02:00
parent cd4b68b8e7
commit e031f29633

View file

@ -6,7 +6,7 @@
<form action="api/list/new" method="post" class="d-flex flex-column"> <form action="api/list/new" method="post" class="d-flex flex-column">
<button type="button" id="remove" class="btn btn-primary align-self-end mt-4">Auswahl entfernen</button> <button type="button" id="remove" class="btn btn-primary align-self-end mt-4">Auswahl entfernen</button>
<?php <?php
include $_SESSION["docroot"].'/php/classes.list.php'; include $_SESSION["docroot"] . '/php/classes.list.php';
$units = new units; $units = new units;
$shopping = new shopping; $shopping = new shopping;
@ -18,13 +18,15 @@
$div_item_menu = "ml-auto mr-2"; $div_item_menu = "ml-auto mr-2";
foreach ($shopping->list as $index => $item) { foreach ($shopping->list as $index => $item) {
if($index%2==0){$color_theme = "bg-primary";} if ($index % 2 == 0) {
else{$color_theme = "bg-secondary";} $color_theme = "bg-primary";
if($item->Erledigt){ } else {
$color_theme = "bg-secondary";
}
if ($item->Erledigt) {
$div_item_row_color_classes = "bg-success"; $div_item_row_color_classes = "bg-success";
$checked = "checked"; $checked = "checked";
} } else {
else{
$div_item_row_color_classes = $color_theme; $div_item_row_color_classes = $color_theme;
$checked = ""; $checked = "";
} }
@ -33,7 +35,7 @@
print_r("<div class='$div_item_checkbox_classes'><input type='checkbox' class='$input_item_checkbox_classes' data-color='$color_theme' data-id='$item->ID' $checked></div>"); print_r("<div class='$div_item_checkbox_classes'><input type='checkbox' class='$input_item_checkbox_classes' data-color='$color_theme' data-id='$item->ID' $checked></div>");
print_r("<div class='$div_item_quantity_classes'>$item->Anzahl $item->Einheit</div>"); print_r("<div class='$div_item_quantity_classes'>$item->Anzahl $item->Einheit</div>");
print_r("<div class='$div_item_name_classes'>$item->Name</div>"); print_r("<div class='$div_item_name_classes'>$item->Name</div>");
print_r("<div class='$div_item_menu'><i class='fas fa-angle-right'></i></div>"); print_r("<div class='$div_item_menu'><i class='fas fa-angle-right dropdown-toggle' id='dropdownMenuButtonDataID" . $item->ID . "'></i></div>");
print_r("</div>"); print_r("</div>");
} }
?> ?>
@ -44,7 +46,11 @@
<select class="w-50" name="einheit"> <select class="w-50" name="einheit">
<?php <?php
foreach ($units->list as $index => $unit) { foreach ($units->list as $index => $unit) {
if($unit->Standard){$selected="selected";}else{$selected=NULL;} if ($unit->Standard) {
$selected = "selected";
} else {
$selected = NULL;
}
print_r("<option value='$unit->ID' $selected>$unit->Name</option>"); print_r("<option value='$unit->ID' $selected>$unit->Name</option>");
} }
?> ?>