Compare commits

..

9 commits

Author SHA1 Message Date
Tim Krehan
3a84945219
Merge 9dafc736d3 into 25f698a186 2024-09-27 00:24:30 +00:00
Tim Krehan
25f698a186 Update config.php 2023-12-02 09:55:47 +01:00
Tim Krehan
25f72b85f4 fix PHP 8 error requiring construct keyword 2023-12-02 09:55:47 +01:00
=
b4f7f2ff36 add custom checkboxes to list to fit with themes 2023-12-02 09:55:47 +01:00
Tim Krehan
7c143ac270 Update install_adduser.php 2023-12-02 09:55:47 +01:00
Tim Krehan
eaa853a714 Update install.php 2023-12-02 09:55:47 +01:00
Tim Krehan
844a788a40 fixed popover not changing 2023-12-02 09:55:47 +01:00
Tim Krehan
dec466bc11 another bugfix concerning the htacces file 2023-12-02 09:55:47 +01:00
Tim Krehan
bf2bdb186b refactored htacces to use the new syntax 2023-12-02 09:55:47 +01:00
10 changed files with 52 additions and 54 deletions

View file

@ -26,33 +26,26 @@
#Deny every *.php file
<Files *.php>
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Require all granted
</Files>
#allow following files
<Files index.php>
Order Allow,Deny
Allow from all
Require all granted
</Files>
<Files api.php>
Order Allow,Deny
Allow from all
Require all granted
</Files>
<Files login.php>
Order Allow,Deny
Allow from all
Require all granted
</Files>
<Files logout.php>
Order Allow,Deny
Allow from all
Require all granted
</Files>
<Files install*.php>
Order Allow,Deny
Allow from all
Require all granted
</Files>

View file

@ -1,6 +1,6 @@
<?php
$CONFIG = array (
'installed' => false,
);
?>
<?php
$CONFIG = array (
'installed' => false,
);
?>

View file

@ -33,7 +33,12 @@
}
print_r("<div class='list-row $div_item_row_classes $div_item_row_color_classes'>");
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'>");
print_r("<div class='custom-control custom-checkbox'>");
print_r("<input type='checkbox' class='$input_item_checkbox_classes custom-control-input' data-color='$color_theme' id='$item->ID-checkbox' data-id='$item->ID' $checked>");
print_r("<label class='custom-control-label' for='$item->ID-checkbox'></label>");
print_r("</div>");
print_r("</div>");
print_r("<div class='list-row-amount $div_item_quantity_classes' data-amount='$item->Anzahl' data-unit='$item->Einheit'>$item->Anzahl $item->Einheit</div>");
print_r("<div class='list-row-name $div_item_name_classes'>$item->Name</div>");
print_r("<div class='$div_item_menu dropdown'>");
@ -70,6 +75,5 @@
<button class="btn btn-outline-secondary" type="submit" id="button-addon2"><i class="fas fa-plus"></i></button>
</div>
</div>
</form>
</div>

View file

@ -75,6 +75,6 @@
</form>
</div>
<script src="bin/bootstrap.bundle.min.js"></script>
<script src="/js/bootstrap.bundle.min.js"></script>
</body>
</html>

View file

@ -32,6 +32,6 @@
</div>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="/js/bootstrap.bundle.min.js"></script>
</body>
</html>

View file

@ -27,6 +27,7 @@ $(document).ready(function () {
});
});
function userPopover(title, text){
$("#newuser").popover('dispose');
$("#newuser").data("toggle", "popover");
$("#newuser").data("container", "body");
$("#newuser").data("placement", "bottom");

View file

@ -16,7 +16,7 @@ function highlightNewEntry(){
if(match!=null){
var newID = match[1];
var checkBox = $(`[data-id='${newID}']`);
var newRow = checkBox.parent().parent();
var newRow = checkBox.parent().parent().parent();
newRow.removeClass($(checkBox).data("color"));
newRow.addClass("alert-primary");
setTimeout(function () {
@ -111,28 +111,28 @@ function checkItem() {
},
success: function () {
var color = $(dataIdSelector).data("color");
$(dataIdSelector).parent().parent().removeClass("bg-danger");
$(dataIdSelector).parent().parent().find(".dropdown-menu-button").removeClass("btn-danger");
$(dataIdSelector).parent().parent().parent().removeClass("bg-danger");
$(dataIdSelector).parent().parent().parent().find(".dropdown-menu-button").removeClass("btn-danger");
if($(dataIdSelector).prop("checked")){
$(dataIdSelector).parent().parent().removeClass(color);
$(dataIdSelector).parent().parent().addClass("bg-success");
$(dataIdSelector).parent().parent().parent().removeClass(color);
$(dataIdSelector).parent().parent().parent().addClass("bg-success");
}
else{
$(dataIdSelector).parent().parent().removeClass("bg-success");
$(dataIdSelector).parent().parent().addClass(color);
$(dataIdSelector).parent().parent().parent().removeClass("bg-success");
$(dataIdSelector).parent().parent().parent().addClass(color);
}
},
error: function () {
$(dataIdSelector).parent().parent().addClass("bg-danger");
$(dataIdSelector).parent().parent().data("toggle", "popover");
$(dataIdSelector).parent().parent().data("container", "body");
$(dataIdSelector).parent().parent().data("placement", "top");
$(dataIdSelector).parent().parent().data("html", true);
$(dataIdSelector).parent().parent().data("trigger", "focus");
$(dataIdSelector).parent().parent().data("content", "Dieses Element konnte nicht gespeichert werden.<br />Bitte die Seite Aktualisieren");
$(dataIdSelector).parent().parent().attr("title", "Fehler!");
$(dataIdSelector).parent().parent().popover('show');
$(dataIdSelector).parent().parent().parent().addClass("bg-danger");
$(dataIdSelector).parent().parent().parent().data("toggle", "popover");
$(dataIdSelector).parent().parent().parent().data("container", "body");
$(dataIdSelector).parent().parent().parent().data("placement", "top");
$(dataIdSelector).parent().parent().parent().data("html", true);
$(dataIdSelector).parent().parent().parent().data("trigger", "focus");
$(dataIdSelector).parent().parent().parent().data("content", "Dieses Element konnte nicht gespeichert werden.<br />Bitte die Seite Aktualisieren");
$(dataIdSelector).parent().parent().parent().attr("title", "Fehler!");
$(dataIdSelector).parent().parent().parent().popover('show');
}
});
}

View file

@ -1,7 +1,7 @@
<?php
class item {
public $ID, $Anzahl, $Einheit, $Name, $Erledigt;
function item($ID, $Anzahl, $Einheit, $Name, $Erledigt){
function __construct($ID, $Anzahl, $Einheit, $Name, $Erledigt){
$this->ID = $ID;
$this->Anzahl = $Anzahl;
$this->Einheit = $Einheit;
@ -16,7 +16,7 @@
array_push($this->list, $current);
}
function shopping(){
function __construct(){
include $_SESSION["docroot"].'/config/config.php';
include $_SESSION["docroot"].'/php/connect.php';
$result = $mysqli->query("SELECT * FROM `ViewEinkauf` ORDER BY `ViewEinkauf`.`Name` ASC;");
@ -132,7 +132,7 @@
class unit {
public $ID, $Name, $Standard;
function unit($ID, $Name, $Standard){
function __construct($ID, $Name, $Standard){
$this->ID = $ID;
$this->Name = $Name;
$this->Standard = $Standard;
@ -145,7 +145,7 @@
array_push($this->list, $current);
}
function units(){
function __construct(){
include $_SESSION["docroot"].'/config/config.php';
include $_SESSION["docroot"].'/php/connect.php';
$result = $mysqli->query("SELECT * FROM `Einheit`;");

View file

@ -1,6 +1,7 @@
<?php
class unit {
public $ID, $Name, $Standard;
function __construct(){}
}
class unitList {
public $units = array();
@ -12,7 +13,7 @@
$unit->Standard = $Standard;
array_push($this->units, $unit);
}
function unitList(){
function __construct(){
include $_SESSION["docroot"].'/php/connect.php';
$result = $mysqli->query("SELECT * FROM `Einheit`;");
while($item = $result->fetch_assoc()){
@ -33,7 +34,7 @@
class ingredient {
public $ID, $Menge, $Einheit, $Name;
function ingredient($ID, $Menge, $Einheit, $Name){
function __construct($ID, $Menge, $Einheit, $Name){
$this->ID = $ID;
$this->Menge = $Menge;
$this->Einheit = $Einheit;
@ -44,7 +45,7 @@
class recipe {
public $ID, $Name, $Dauer, $Beschreibung;
public $Zutaten = array();
function recipe($ID, $Name, $Dauer, $Beschreibung){
function __construct($ID, $Name, $Dauer, $Beschreibung){
$this->ID = $ID;
$this->Name = $Name;
$this->Dauer = $Dauer;

View file

@ -7095,27 +7095,26 @@ select.form-control {
[type="checkbox"] {
position: relative;
-webkit-appearance: none;
appearance: none;
cursor: pointer; }
[type="checkbox"]:before {
content: "";
/* position: absolute; */
/* left: -1.2em; */
/* top: -0.9em; */
position: absolute;
left: -1.2em;
top: -0.9em;
display: inline-block;
width: 15px;
height: 16px;
border: 2px solid #fff;
border: 2px solid #333;
border-radius: 2px 8px 2px 4px / 5px 3px 5px 3px; }
[type="checkbox"]:checked:after {
content: "x";
position: absolute;
left: 3px;
/* top: -0.48em; */
left: -0.64em;
top: -0.48em;
font-size: 1.5rem;
line-height: 0.5;
color: #fff; }
color: #333; }
[type="checkbox"]:disabled:before {
border: 2px solid #aaa; }