Example #1
0
<?php

require_once '../../views/_secureHead.php';
require_once $relative_base_path . 'models/edit.php';
if (isset($sessionManager) && $sessionManager->isAuthorized()) {
    $id = request_isset('id');
    $budgetManager = new BudgetManager();
    $record = $budgetManager->getRecord($id);
    $page_title = 'Edit | Bookmarks';
    $record_date_split = explode(' ', $record['date']);
    $date = $record_date_split[0];
    $time = $record_date_split[1];
    // build edit view
    $editModel = new EditModel('Edit', 'update_by_id', $id);
    //		$editModel->addRow ('amount', 'Amount', $record['amount'] );
    //		$editModel->addRow ('category', 'Category', $record['category'] );
    $editModel->addRow('store', 'Store', $record['store']);
    //		$editModel->addRow ('items', 'Items', $record['items'] );
    $editModel->addRow('dateOption', 'dateOption', 'dateOption-selectTime', 'readonly=readonly');
    $editModel->addRow('selectTime-date', 'Date', $date);
    $editModel->addRow('selectTime-time', 'Time', $time);
    $views_to_load = array();
    $views_to_load[] = ' ' . EditView2::render($editModel);
    include $relative_base_path . 'views/_generic.php';
}
Example #2
0
         $id = BudgetManager::getBudgetIdFromItemId($item_id);
         $db_update_success = BudgetManager::updateItemRecord($item_id, $item_name, $amount, $qty, $category, $brand, $size, $size_unit, $tax, $sale);
         break;
     case 'add_receipt_item':
         $id = $budget_id;
         $db_add_success = BudgetManager::addItemRecord($budget_id, $item_name, $amount, $qty, $category, $brand, $size, $size_unit, $tax, $sale);
         break;
     case 'delete_item_by_id':
         $id = BudgetManager::getBudgetIdFromItemId($item_id);
         $db_delete_success = BudgetManager::deleteItemRecord($item_id);
         break;
     case 'add_budget_item':
         $id = BudgetManager::addRecord($store, $date);
         break;
 }
 $spending_history_data = BudgetManager::getRecord($id);
 $items = BudgetManager::getItems($id);
 $receipt_total = 0;
 $page_title = 'Receipt | Budget';
 $alt_menu = getAddButton() . getBackButton();
 // add Item form
 $addModel = new AddModel('Add', 'add_receipt_item');
 $addModel->addRow('item_name', 'Item');
 $addModel->addRow('amount', 'Amount');
 $addModel->addRow('qty', 'Qty', 1);
 $addModel->addRow('category', 'Category');
 $addModel->addRow('brand', 'Brand');
 $addModel->addRow('size', 'Size');
 $addModel->addRow('size_unit', 'Units');
 $addModel->addRow('sale', 'Sale');
 $addModel->addOptionBox('tax', 'Tax', ['13%', '0%']);