Esempio n. 1
0
</script>

<?php 
$heading = array('title_final' => _l('Upcoming Transactions'), 'type' => 'h2', 'main' => true, 'button' => array());
if (module_finance::can_i('create', 'Finance Upcoming')) {
    $heading['button'][] = array('title' => "Add New", 'type' => 'add', 'url' => module_finance::link_open_recurring('new'));
    $heading['button'][] = array('title' => _l("Set Starting Balance (currently %s)", dollar($balance)), 'url' => 'javascript:set_starting_balance();');
}
print_heading($heading);
?>

<form action="" method="post" id="finance_recurring_form">

    <?php 
$categories_rel = array();
foreach (module_finance::get_categories() as $category) {
    $categories_rel[$category['finance_category_id']] = $category['name'];
}
$accounts_rel = array();
foreach (module_finance::get_accounts() as $account) {
    $accounts_rel[$account['finance_account_id']] = $account['name'];
}
$search_bar = array('elements' => array('due_date' => array('title' => _l('Due Date:'), 'fields' => array(array('type' => 'date', 'name' => 'search[date_from]', 'value' => isset($search['date_from']) ? $search['date_from'] : ''), _l('to'), array('type' => 'date', 'name' => 'search[date_to]', 'value' => isset($search['date_to']) ? $search['date_to'] : ''))), 'name' => array('title' => _l('Name:'), 'field' => array('type' => 'text', 'name' => 'search[generic]', 'value' => isset($search['generic']) ? $search['generic'] : '', 'size' => 20)), 'amount' => array('title' => _l('Amount:'), 'fields' => array(array('type' => 'currency', 'name' => 'search[amount_from]', 'value' => isset($search['amount_from']) ? $search['amount_from'] : ''), _l('to'), array('type' => 'currency', 'name' => 'search[amount_to]', 'value' => isset($search['amount_to']) ? $search['amount_to'] : ''))), 'account' => array('title' => _l('Account:'), 'field' => array('type' => 'select', 'name' => 'search[finance_account_id]', 'value' => isset($search['finance_account_id']) ? $search['finance_account_id'] : '', 'options' => $accounts_rel)), 'category' => array('title' => _l('Category:'), 'field' => array('type' => 'select', 'name' => 'search[finance_category_id]', 'value' => isset($search['finance_category_id']) ? $search['finance_category_id'] : '', 'options' => $categories_rel))));
echo module_form::search_bar($search_bar);
?>


<table width="100%" border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_rows">
    <thead>
    <tr class="title">
        <th><?php 
Esempio n. 2
0
$table_manager->row_callback = function ($finance) {
    if (isset($finance['finance_id']) && $finance['finance_id']) {
        $finance['finance_record'] = module_finance::get_finance($finance['finance_id']);
    } else {
        $finance['finance_record'] = false;
    }
    return $finance;
};
if (module_finance::can_i('create', 'Finance')) {
    $header_rows = array();
    ob_start();
    ?>

	<div style="height:18px; width:89px; overflow: hidden; position: absolute; background: #FFFFFF;" onmouseover="$(this).height('auto');$(this).width('auto');" onmouseout="$(this).height('18px');$(this).width('89px');">
                    <?php 
    $categories = module_finance::get_categories();
    foreach ($categories as $category) {
        ?>

                        <input type="checkbox" name="finance_category_id[]" value="<?php 
        echo $category['finance_category_id'];
        ?>
" id="category_<?php 
        echo $category['finance_category_id'];
        ?>
" <?php 
        echo isset($finance['category_ids'][$category['finance_category_id']]) ? ' checked' : '';
        ?>
>
                        <label for="category_<?php 
        echo $category['finance_category_id'];
Esempio n. 3
0
                    </td>
                    <td>
                        <?php 
echo print_select_box(module_finance::get_accounts(), 'search[finance_account_id]', isset($search['finance_account_id']) ? $search['finance_account_id'] : '', '', true, 'name');
?>

                    </td>
                    <td width="30">
                        <?php 
_e('Category:');
?>

                    </td>
                    <td>
                        <?php 
echo print_select_box(module_finance::get_categories(), 'search[finance_category_id]', isset($search['finance_category_id']) ? $search['finance_category_id'] : '', '', true, 'name');
?>

                    </td>
                    <td class="search_action">
                        <?php 
echo create_link("Reset", "reset", module_finance::link_open(false));
?>

                        <?php 
echo create_link("Search", "submit");
?>

                    </td>
                </tr>
            </table>