5 include($path_to_root . "/includes/session.inc");
7 page(_("Quick Entries"));
9 include($path_to_root . "/gl/includes/gl_db.inc");
11 include($path_to_root . "/includes/ui.inc");
13 simple_page_mode(true);
14 //-----------------------------------------------------------------------------------
16 function can_process()
19 if (strlen($_POST['description']) == 0)
21 display_error( _("The Quick Entry description cannot be empty."));
22 set_focus('description');
29 //-----------------------------------------------------------------------------------
31 if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
37 if ($selected_id != -1)
39 update_quick_entry($selected_id, $_POST['description'], $_POST['account'], $_POST['deposit']);
40 display_notification(_('Selected quick entry has been updated'));
44 add_quick_entry($_POST['description'], $_POST['account'], $_POST['deposit']);
45 display_notification(_('New account class has been added'));
51 //-----------------------------------------------------------------------------------
53 if ($Mode == 'Delete')
56 delete_quick_entry($selected_id);
57 display_notification(_('Selected quick entry has been deleted'));
61 //-----------------------------------------------------------------------------------
65 $_POST['description'] = $_POST['account'] = $_POST['deposit'] = '';
67 //-----------------------------------------------------------------------------------
69 $result = get_quick_entries();
71 start_table($table_style);
72 $th = array(_("Description"), _("Account"), _("Deposit"), "", "");
76 while ($myrow = db_fetch($result))
79 alt_table_row_color($k);
81 if ($myrow["deposit"] == 0)
89 label_cell($myrow['description']);
90 label_cell($myrow['account']." ".$myrow['account_name']);
92 edit_button_cell("Edit".$myrow["id"], _("Edit"));
93 edit_button_cell("Delete".$myrow["id"], _("Delete"));
100 //-----------------------------------------------------------------------------------
104 start_table($table_style2);
106 if ($selected_id != -1)
110 //editing an existing status code
111 $myrow = get_quick_entry($selected_id);
113 $_POST['id'] = $myrow["id"];
114 $_POST['description'] = $myrow["description"];
115 $_POST['account'] = $myrow["account"];
116 $_POST['deposit'] = $myrow["deposit"];
117 hidden('selected_id', $selected_id);
121 text_row_ex(_("Description:"), 'description', 50, 60);
123 gl_all_accounts_list_row(_("Account"), 'account', null, true);
125 yesno_list_row(_("Deposit:"), 'deposit', null, "", "", false);
129 submit_add_or_update_center($selected_id == -1, '', true);
133 //------------------------------------------------------------------------------------