Fixed composer.json
[memberdb.git] / index.php
1 <?php
2
3 header('Content-type: text/html; charset=utf-8');
4 if (function_exists('date_default_timezone_set')) date_default_timezone_set('UTC');
5 bcscale(2);
6
7 require_once('config.php');
8 require_once('include/database.php');
9 require_once('include/misc.php');
10 require_once('include/installation.php');
11 require_once('include/html.php');
12
13 require_once('include/finances.php');
14 require_once('include/fees.php');
15 require_once('include/cryptography.php');
16 require_once('include/earnings.php');
17 require_once('include/events.php');
18 require_once('include/expenses.php');
19 require_once('include/members.php');
20 require_once('include/payments.php');
21 require_once('include/directdebit.php');
22 require_once('include/xlsexport.php');
23
24
25 try {
26
27     db_connect();
28
29     if (!defined('IS_INSTALLED') || !IS_INSTALLED) install_database();
30
31     $action = 'list_members';
32     if (isset($_REQUEST['action'])) $action = $_REQUEST['action'];
33
34     ob_start();
35
36     switch ($action) {
37         case 'list_members'   : action_list_members();    break;
38         case 'view_member'    : action_view_member();     break;
39         case 'export_email'   : action_export_email();    break;
40         case 'create_member'  : action_create_member();   break;
41         case 'change_member'  : action_change_member();   break;
42         case 'export_ibanhin' : action_export_ibanhin();  break;
43         case 'create_event'   : action_create_event();    break;
44         case 'change_event'   : action_change_event();    break;
45         case 'delete_event'   : action_delete_event();    break;
46         case 'create_earnings': action_create_earnings(); break;
47         case 'create_earning' : action_create_earning();  break;
48         case 'change_earning' : action_change_earning();  break;
49         case 'delete_earning' : action_delete_earning();  break;
50         case 'create_expense' : action_create_expense();  break;
51         case 'change_expense' : action_change_expense();  break;
52         case 'delete_expense' : action_delete_expense();  break;
53         case 'cryptography'   : action_cryptography();    break;
54         case 'fees'           : action_fees();            break;
55         case 'directdebit'    : action_directdebit();     break;
56         case 'finances'       : action_finances();        break;
57         case 'export'         : action_export_payments(); break;
58         case 'export_members' : action_export_members();  break;
59         default: action_404();
60     }
61
62     $content = ob_get_contents();
63     ob_end_clean();
64
65 ?>
66 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
67
68 <html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
69     <head>
70         <title>Mitgliedsverwaltung - Chaos Computer Club Frankfurt am Main</title>
71         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
72         <style type="text/css">
73             form  { line-height: 2em; }
74             fieldset { line-height: 2em; border: 1px solid #ccc; margin-bottom: 1em; float:left; border-width: 1px 0 0 0; width: 27em; }
75             /*fieldset { border: 1px solid #ccc; margin-bottom: 1em; float:left; border-width: 1px 0 0 0; } */
76             legend { font-size: 1.4em; }
77             label { clear: left; display: block; width: 10em; float: left; }
78             input, select { display: block; width: 20em; float: left; }
79             form small { clear: left; display: block; text-align: right; margin-right: 1.8em; line-height: 1em; margin-bottom: 1.5em; }
80             fieldset small { clear: left; display: block; text-align: right; margin-right: 1.8em; line-height: 1em; margin-bottom: 1.5em; }
81             .checkbox label { clear: none; margin-left: 0.5em; }
82             .checkbox input { clear: left; width: auto;  }
83             #header { margin: 0; padding: 1px 0; background-color: #464646; }
84             #content { font-size: 1.4em; }
85             .content { margin: 0 auto; width: 960px; }
86             .submit { clear: left; }
87             h1 { color: #fff; }
88             body { margin: 0; padding: 0; font-family:  Arial, Verdana, Tahoma; font-size: 62.5%; color: #333; }
89             html { margin: 0; padding: 0; }
90             table { border-collapse: collapse; margin-bottom: 1em; border: 1px solid #ccc; }
91             th, td { padding: 0.3em 2em 0.3em 0.3em;}
92             tr:hover { background-color: #eee; }
93             tr.earning { background-color: #efe; }
94             tr.expense { background-color: #fee; }
95             tr.earning:hover { background-color: #dfd; }
96             tr.expense:hover { background-color: #fdd; }
97             tr.total { background-color: #eee; font-weight: bold; }
98             tr.current { background-color: #eee; font-weight: bold; }
99             tr.inactive { color: #999; }
100             #earning_form { background-color: #efe; }
101             #expense_form { background-color: #fee; }
102             th { text-align: left; background-color: #eee; font-weight: normal; border-bottom: 1px solid #ccc;  }
103             h1, h2, h3, legend { font-family: Georgia, Sans-Serif, Verdana; font-weight: normal; color: #333;}
104             #header h1 { font-size: 4em; color: #fff; }
105             h2 { font-size: 2.2em; }
106             h3 { font-size: 1.8em; }
107             #pagemenu { background-color: #e0e0e0; border-top: 1px solid #e4f2fd; font-size: 1.4em; }
108             #pagemenu ul { list-style: none; padding: 0px 10px; display:block; margin-top: 6px; }
109             #pagemenu li { line-height:28px; font-weight: bold; display: inline; float: left; margin-left: 5px; }
110             #pagemenu li a { display: block; color: #888; background-color: #eee; padding: 0px 20px; text-decoration: none; }
111             #pagemenu li a:hover { color: #000; background: #fff; }
112             #footer { background-color: #eee; border-top: 1px solid #ddd; height: 50px; margin-top: 3em; }
113             .clearfix:after { content: " "; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; }
114             .clearfix { display: inline-block; }
115             html[xmlns] .clearfix { display: block; }
116             * html .clearfix { height: 1%; }
117             .log_messages { color: #cc0000; }
118             p.error { border: 1px solid #900;  padding: 1em; color: #cc0000; background-color: #fff9f9;}
119
120             #content a { text-decoration: none; padding: 0 1px; color: #21759B; border-bottom: 1px solid #ccc; }
121             #content a:hover { color: #D54E21; background: #F5D1C5; border-bottom: 1px solid #D54E21; }
122             .modal_window { position:absolute; display:none; background-color: #fff; padding: 1em; }
123             #mask { position:absolute; top:0px; left:0px; height:100%; width:100%; display:none; background-color: black; }
124
125             .pagination { text-align: center; margin: 10px 0; font-weight: bold; }
126             .pagination .prev { float: left; }
127             .pagination .next { float: right; }
128
129         </style>
130         <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
131         <script type="text/javascript" src="js/crypto-js/crypto/crypto-min.js"></script>
132         <script type="text/javascript" src="js/crypto-js/sha1/sha1-min.js"></script>
133         <script type="text/javascript" src="js/crypto-js/hmac/hmac-min.js"></script>
134         <script type="text/javascript" src="js/crypto-js/pbkdf2/pbkdf2-min.js"></script>
135         <script type="text/javascript" src="js/crypto-js/ofb/ofb-min.js"></script>
136         <script type="text/javascript" src="js/crypto-js/aes/aes_modified.js"></script>
137         <script type="text/javascript" src="js/date.js"></script>
138         <script type="text/javascript" src="js/utils.js"></script>
139         <script type="text/javascript" src="js/dtaus.js"></script>
140         <script type="text/javascript" src="js/sepa-CORE.js"></script>
141     </head>
142     <body>
143     <div id="header"><div class="content"><h1>Mitgliedsverwaltung</h1></div></div>
144     <div id="pagemenu">
145         <ul class="content clearfix">
146             <li><a href="<?=link_to()?>">Mitglieder</a></li>
147             <li><a href="<?=link_to('finances')?>">Finanzen</a></li>
148             <li><a href="<?=link_to('fees')?>">Mitgliedsbeitr&auml;ge</a></li>
149             <li><a href="<?=link_to('directdebit')?>">Bankeinzug</a></li>
150             <li><a href="<?=link_to('cryptography')?>">Kryptographie</a></li>
151         </ul>
152     </div>
153     <div id="content" class="content"><?=$content?></div>
154     <div id="footer"></div>
155     </body>
156 </html>
157
158 <?php
159
160 }
161 catch (Exception $e) {
162     echo 'Caught exception: ',  $e->getMessage(), "\n";
163 }