Log 2537
11/01/2024 2024-01-11 23:15$expenseType = #סוג ההוצאה#;
$expenseCost = #עלות ההוצאה#;
if ($expenseType == ‘קבועה’) {
$currentMonth = date(‘m’);
$currentYear = date(‘Y’);
$totalExpenseCost = 0;
for ($i = 1; $i 12) {
$monthToAdd -= 12;
$currentYear++;
}
$formattedDate = ’01/’ . str_pad($monthToAdd, 2, ‘0’, STR_PAD_LEFT) . ‘/’ . $currentYear;
return “Expense on {$formattedDate}: {$expenseCost}n”;
// Add expense cost to total
$totalExpenseCost += (float)$expenseCost;
}
return “Total expense for the next three months: {$totalExpenseCost}n”;
} else {
return “”;
}