Cleanup: removed all closing tags in php files.
[fa-stable.git] / admin / forms_setup.php
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 $page_security = 'SA_FORMSETUP';
13 $path_to_root = "..";
14 include($path_to_root . "/includes/session.inc");
15
16 page(_($help_context = "Forms Setup"));
17
18 include($path_to_root . "/includes/ui.inc");
19
20 //-------------------------------------------------------------------------------------------------
21
22 if (isset($_POST['setprefs'])) 
23 {
24
25         $systypes = get_systypes();
26
27         begin_transaction();
28
29     while ($type = db_fetch($systypes)) 
30     {
31         save_next_reference($type["type_id"], $_POST['id' . $type["type_id"]]);
32     }
33
34     commit_transaction();
35
36         display_notification_centered(_("Forms settings have been updated."));
37 }
38
39 start_form();
40
41 start_outer_table(TABLESTYLE2);
42
43 $systypes = get_systypes();
44 table_section(1);
45
46 $th = array(_("Form"), _("Next Reference"));
47 table_header($th);
48 $i = 0;
49 while ($type = db_fetch($systypes)) 
50 {
51         if ($i++ == ST_CUSTCREDIT)
52         {
53                 table_section(2);
54                 table_header($th);
55         }       
56         ref_row($systypes_array[$type["type_id"]], 'id' . $type["type_id"], '', $type["next_reference"]);
57 }
58
59 end_outer_table(1);
60
61 submit_center('setprefs', _("Update"), true, '', 'default');
62
63 end_form(2);
64
65 //-------------------------------------------------------------------------------------------------
66
67 end_page();
68