familyHub/scripts/daily_export.php
Louis Whittington 6d10cb4726 Implement banking system features and enhancements
- Added banking mode with checking, savings, and charity accounts, including auto-split options for income.
- Introduced banking transaction management, including transfers and charity outflows.
- Updated family settings to allow configuration of banking features and interest rates.
- Enhanced data export functionality to include bank transactions.
- Improved user interface to display banking information and donation goals.
- Updated documentation to reflect new banking features and settings.
2026-03-31 11:03:53 -05:00

26 lines
915 B
PHP

<?php
require_once __DIR__ . '/../includes/db.php';
require_once __DIR__ . '/../includes/utils.php';
require_once __DIR__ . '/../config/config.php';
// Export all data types
$types = ['chores', 'groceries', 'meals', 'meal_plans', 'expenses', 'stores', 'grocery_lists', 'grocery_catalog', 'bank_transactions'];
$results = [];
foreach ($types as $type) {
$data = readJsonFile($type . '.json');
$filename = generateExportFilename($type);
$exportPath = EXPORT_DESTINATION . '/' . $filename;
if (file_put_contents($exportPath, json_encode($data, JSON_PRETTY_PRINT))) {
$results[$type] = 'success';
} else {
$results[$type] = 'failed';
}
}
// Log results
$logFile = EXPORT_DESTINATION . '/export_log.txt';
$timestamp = date('Y-m-d H:i:s');
$logMessage = "[$timestamp] Export results: " . json_encode($results) . "\n";
file_put_contents($logFile, $logMessage, FILE_APPEND);