Пример #1
0
 $id = request_isset('id');
 $amount = request_isset('amount');
 $category = request_isset('category');
 $store = request_isset('store');
 $items = request_isset('items');
 $startdate = request_isset('startdate');
 $enddate = request_isset('enddate');
 switch ($page_action) {
     case 'update_by_id':
         $db_update_success = BudgetManager::updateRecurringRecord($id, $amount, $category, $store, $items, $startdate, $enddate);
         break;
     case 'add_budget_item':
         $db_add_success = BudgetManager::addRecurringRecord($amount, $category, $store, $items, $startdate, $enddate);
         break;
     case 'delete_by_id':
         $db_delete_success = BudgetManager::deleteRecurringRecord($id);
         break;
 }
 $page_title = 'Recurring | Budget';
 $alt_menu = getAddButton() . getBackButton();
 $addModel = new AddModel('Add', 'add_budget_item');
 $addModel->addRow('amount', 'Amount');
 $addModel->addRow('category', 'Category');
 $addModel->addRow('store', 'Store');
 $addModel->addRow('items', 'Items');
 $addModel->addRow('startdate', 'Start Date', 'CURRENT_TIMESTAMP');
 $addModel->addRow('enddate', 'End Date', '2037-12-31 23:59:59');
 // build recurring table model
 $recurringModel = new TableModel('Recurring items', 'recurring');
 $recurringModel->addRow(array(TableView2::createCell('amount', 'Amount', 'th'), TableView2::createCell('category', 'Category', 'th'), TableView2::createCell('store', 'Store', 'th'), TableView2::createCell('items', 'Items', 'th'), TableView2::createCell()));
 $recurring_items_data = BudgetManager::getAllRecurring();