mirror of
https://github.com/tim-krehan/shopping-list.git
synced 2024-11-27 15:40:00 +01:00
formatting added id to icon for dropdown referencing
This commit is contained in:
parent
cd4b68b8e7
commit
e031f29633
1 changed files with 38 additions and 32 deletions
|
@ -6,7 +6,7 @@
|
|||
<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>
|
||||
<?php
|
||||
include $_SESSION["docroot"].'/php/classes.list.php';
|
||||
include $_SESSION["docroot"] . '/php/classes.list.php';
|
||||
$units = new units;
|
||||
$shopping = new shopping;
|
||||
|
||||
|
@ -18,13 +18,15 @@
|
|||
$div_item_menu = "ml-auto mr-2";
|
||||
|
||||
foreach ($shopping->list as $index => $item) {
|
||||
if($index%2==0){$color_theme = "bg-primary";}
|
||||
else{$color_theme = "bg-secondary";}
|
||||
if($item->Erledigt){
|
||||
if ($index % 2 == 0) {
|
||||
$color_theme = "bg-primary";
|
||||
} else {
|
||||
$color_theme = "bg-secondary";
|
||||
}
|
||||
if ($item->Erledigt) {
|
||||
$div_item_row_color_classes = "bg-success";
|
||||
$checked = "checked";
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$div_item_row_color_classes = $color_theme;
|
||||
$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_quantity_classes'>$item->Anzahl $item->Einheit</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>");
|
||||
}
|
||||
?>
|
||||
|
@ -44,7 +46,11 @@
|
|||
<select class="w-50" name="einheit">
|
||||
<?php
|
||||
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>");
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue