mirror of
https://github.com/grocy/grocy.git
synced 2025-08-19 11:48:55 +00:00
Also show due/overdue on bateries- and habitoverview
This commit is contained in:
@@ -45,6 +45,38 @@ function FindAllObjectsInArrayByPropertyValue($array, $propertyName, $propertyVa
|
||||
return $returnArray;
|
||||
}
|
||||
|
||||
function FindAllItemsInArrayByValue($array, $value, $operator = '==')
|
||||
{
|
||||
$returnArray = array();
|
||||
|
||||
foreach($array as $item)
|
||||
{
|
||||
switch($operator)
|
||||
{
|
||||
case '==':
|
||||
if($item == $value)
|
||||
{
|
||||
$returnArray[] = $item;
|
||||
}
|
||||
break;
|
||||
case '>':
|
||||
if($item > $value)
|
||||
{
|
||||
$returnArray[] = $item;
|
||||
}
|
||||
break;
|
||||
case '<':
|
||||
if($item < $value)
|
||||
{
|
||||
$returnArray[] = $item;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
}
|
||||
|
||||
function SumArrayValue($array, $propertyName)
|
||||
{
|
||||
$sum = 0;
|
||||
|
Reference in New Issue
Block a user