Inaktive Mitglieder und Mitgliederanzahl
[memberdb.git] / include / members.php
1 <?php
2
3 $SQL_CREATE_MEMBERS = sprintf('
4     CREATE TABLE IF NOT EXISTS `%1$s` (
5       `id` int(10) unsigned NOT NULL auto_increment,
6       `number` int(10) unsigned NOT NULL,
7       `firstname` varchar(255) NOT NULL,
8       `lastname` varchar(255) NOT NULL,
9       `nickname` varchar(255) NOT NULL,
10       `accountholder` blob NOT NULL,
11       `accountnumber` blob NOT NULL,
12       `bankcode` blob NOT NULL,
13       `bankname` blob NOT NULL,
14       `directdebit` tinyint(1) NOT NULL,
15       `street` varchar(255) NOT NULL,
16       `housenumber` varchar(255) NOT NULL,
17       `postcode` varchar(255) NOT NULL,
18       `city` varchar(255) NOT NULL,
19       `country` varchar(255) NOT NULL,
20       `email` varchar(255) NOT NULL,
21       `phone` varchar(255) NOT NULL,
22       `fax` varchar(255) NOT NULL,
23       `mobile` varchar(255) NOT NULL,
24       `jabber` varchar(255) NOT NULL,
25       `icq` varchar(255) NOT NULL,
26       `msn` varchar(255) NOT NULL,
27       `aim` varchar(255) NOT NULL,
28       `skype` varchar(255) NOT NULL,
29       `url` varchar(255) NOT NULL,
30       `twitter` varchar(255) NOT NULL,
31       `created_at` datetime NOT NULL,
32       `modified_at` datetime NOT NULL,
33       PRIMARY KEY  (`id`),
34       UNIQUE KEY `number` (`number`)
35     ) ENGINE=InnoDB DEFAULT CHARSET=%2$s
36     ', DB_TABLE_MEMBERS, DB_CHARSET);
37
38 /* DB functions {{{ */
39
40 function db_create_member($member) {
41     unset($member['id']);
42     $member['created_at']   = db_unixtime2datetime(time());
43     $member['modified_at']  = db_unixtime2datetime(time());
44     if (!db_insert_single(DB_TABLE_MEMBERS, $member)) return false;
45     return db_insert_id();
46 }
47
48 function db_change_member($member) {
49     $id = $member['id'];
50     unset($member['id']);
51     $member['modified_at']  = db_unixtime2datetime(time());
52     return db_update_single(DB_TABLE_MEMBERS, $member, sprintf('id=\'%1$d\'', db_escape($id)));
53 }
54
55 function db_get_members() {
56     $sql = 'SELECT * FROM %1$s ORDER BY number ASC';
57     return db_select_multi(sprintf($sql, DB_TABLE_MEMBERS));
58 }
59
60 function db_get_member_with_id($member_id) {
61     $sql = 'SELECT * FROM %1$s WHERE id=\'%2$d\' LIMIT 1';
62     return db_select_single(sprintf($sql, DB_TABLE_MEMBERS, db_escape($member_id)));
63 }
64
65 function db_get_next_free_member_number() {/*{{{*/
66     $row = db_select_single(sprintf('SELECT MAX(number) AS number FROM %1$s', DB_TABLE_MEMBERS));
67     if (!isset($row)) return 2;
68
69     $number = $row['number'] + 1;
70     // Some numbers are reserved for honorary members
71     $number = (int) $number;
72     switch ($number) {
73         case 1:
74         case 23:
75         case 42:
76         case 666:
77         case 1337:
78         case 31337:
79             return $number + 1;
80     }
81     return $number;
82 };/*}}}*/
83
84
85 function db_get_member_with_number($member_number) {
86     $sql = 'SELECT * FROM %1$s WHERE number=\'%2$d\' LIMIT 1';
87     return db_select_single(sprintf($sql, DB_TABLE_MEMBERS, db_escape($member_number)));
88 }
89
90 /* }}} */
91
92 function validate_member($userdata, &$dbdata, &$validation) {/*{{{*/
93     $fields = array(
94         'id'            => 'number',
95         'number'        => 'number',
96         'firstname'     => 'string',
97         'lastname'      => 'string',
98         'nickname'      => 'string',
99         'accountholder' => 'string',
100         'accountnumber' => 'string',
101         'bankcode'      => 'string',
102         'bankname'      => 'string',
103         'directdebit'   => 'bool',
104         'street'        => 'string',
105         'housenumber'   => 'string',
106         'postcode'      => 'string',
107         'city'          => 'string',
108         'country'       => 'string',
109         'email'         => 'string',
110         'phone'         => 'string',
111         'fax'           => 'string',
112         'mobile'        => 'string',
113         'jabber'        => 'string',
114         'icq'           => 'string',
115         'msn'           => 'string',
116         'aim'           => 'string',
117         'skype'         => 'string',
118         'url'           => 'string',
119         'twitter'       => 'string',
120     );
121     $orig = $dbdata;
122     foreach ($fields as $name => $type) {
123         if ($type == 'bool') {
124             $dbdata[$name] = !empty($userdata[$name]);
125             continue;
126         }
127         if (!isset($userdata[$name])) continue;
128         $dbdata[$name] = $userdata[$name];
129     }
130 //      ids must be equal
131 //      number must be equal. if changed - check if free and allowed
132     if (isset($orig['id'])) {
133         if ($dbdata['id'] != $orig['id']) {
134             $validation[] = 'Irgendwas ist sehr sehr komisch.';
135         }
136         if (!validate_member_number($dbdata['number'], $dbdata['id'])) {
137             $validation[] = 'Die Mitgliedsnummer ist schon vergeben.';
138         }
139         return (count($validation) == 0);
140     }
141     if (!validate_member_number($dbdata['number'])) {
142         $validation[] = 'Die Mitgliedsnummer ist schon vergeben.';
143     }
144     return (count($validation) == 0);
145 }/*}}}*/
146
147 function validate_member_number($member_number, $member_id = NULL) {/*{{{*/
148     $member = db_get_member_with_number($member_number);
149
150     // theres no member with this number
151     if (!isset($member)) return true;
152
153     // there is a member, but maybe its the one we got passed
154     if (isset($member_id) && $member_id == $member['id']) return true;
155
156     return false;
157 }/*}}}*/
158
159
160 function action_list_members() {/*{{{*/
161     $members = db_get_members();
162     $count   = 0;
163     ?>
164     <h2>Liste der Mitglieder</h2>
165     <?php if (isset($members)) : ?>
166         <table>
167             <tr>
168                 <th>Mitgliedsnummer</th>
169                 <th>Nickname</th>
170                 <th>Vorname</th>
171                 <th>Nachname</th>
172             </tr>
173         <?php foreach ($members as $member) : ?>
174             <?php $membership_info = fees_info_for_member($member['id'], time()); ?>
175                         <?php if (!empty($membership_info['is_member'])) $count++; ?>
176             <tr <?php if (empty($membership_info['is_member'])) : ?>class="inactive"<?php endif ?>>
177                 <td><a href="<?=html_escape(link_to('view_member', array('id'=> $member['id'])))?>"><?=html_escape($member['number'])?></a></td>
178                 <td><?=html_escape($member['nickname'])?></td>
179                 <td><?=html_escape($member['firstname'])?></td>
180                 <td><?=html_escape($member['lastname'])?></td>
181             </tr>
182         <?php endforeach ?>
183         </table>
184     <?php else : ?>
185         <p>Bisher gibt es noch keine Mitglieder.</p>
186     <?php endif ?>
187         <p>Derzeit gibt es <?=$count?> aktive Mitglieder.</p>
188         <a href="<?=link_to('create_member')?>">Neues Mitglied</a>
189         <a href="<?=link_to('export_email')?>">E-Mail-Adressen</a>
190     <?php
191 }/*}}}*/
192
193 function action_view_member() {/*{{{*/
194     if (!isset($_REQUEST['id'])) redirect(link_to());
195     $member = db_get_member_with_id($_REQUEST['id']);
196     if (!isset($member)) redirect(link_to());
197
198     form_member($member, true);
199     action_list_events($member);
200     action_create_event($member);
201 }/*}}}*/
202
203 function action_create_member() {/*{{{*/
204     $member = array();
205     $log_messages = array();
206     if (isset($_POST['submit'])) {
207         unset($_POST['id']);
208         if (validate_member($_POST, $member, $log_messages)) {
209             if (empty($member['number'])) $member['number'] = db_get_next_free_member_number();
210             if ($member_id = db_create_member($member)) {
211                 redirect(link_to('view_member', array('id' => $member_id)) . '#events');
212             }
213             echo db_error();
214         }
215     }
216     form_member($member, false, $log_messages);
217 }/*}}}*/
218
219 function action_change_member() {/*{{{*/
220     if (!isset($_REQUEST['id'])) redirect(link_to());
221     $member = db_get_member_with_id($_REQUEST['id']);
222     if (!isset($member)) redirect(link_to());
223     $log_messages = array();
224     if (isset($_POST['submit'])) {
225         if (validate_member($_POST, $member, $log_messages)) {
226             if (empty($member['number'])) $member['number'] = db_get_next_free_member_number();
227             if (db_change_member($member)) {
228                 redirect(link_to('view_member', array('id' => $member['id'])));
229             }
230             echo db_error();
231         }
232     }
233     form_member($member, false, $log_messages);
234 }/*}}}*/
235
236
237 function action_export_email() {/*{{{*/
238     $members = db_get_members();
239     $first = true;
240     ?>
241     <h2>E-Mail-Adressen</h2>
242     <?php if (isset($members)) : ?>
243         <?php foreach ($members as $member) : ?><?php if (empty($member['email'])) continue; ?><?php if ($first) : $first = false; else :?>,<?php endif ?> <?=$member['email']?><?php endforeach ?>
244     <?php else : ?>
245         <p>Bisher gibt's noch keine Mitglieder.</p>
246     <?php endif ?>
247     <?php
248 }/*}}}*/
249
250
251 function html_member_list_box($label, $name, $selected, $readonly = false, $id = NULL, $tag_params = '') {
252     $list = array(0 => '-');
253     $members = db_get_members();
254     if (!empty($members)) {
255         foreach ($members as $member) {
256             $list[$member['id']] = $member['number'] . ' ' . $member['nickname'];
257         }
258     }
259     return html_list_box($label, $name, $list, $selected, $readonly, $id, $tag_params);
260 }
261
262 function form_member($member = array(), $readonly = false, $log_messages = array()) {/*{{{*/
263     
264     $keys = db_get_crypto_keys();
265     if (empty($keys)) {
266 ?>
267         <p class="error">
268             <strong>Achtung:</strong> Bitte zuerst <a href="<?=link_to('cryptography')?>">Kryptographie einrichten</a>.
269         </p>
270 <?php
271         return;
272     }
273
274     js_modal_windows();
275     js_get_master_key();
276
277     ?>
278     <noscript>
279         <p class="error">
280             <strong>Achtung:</strong> Ohne JavaScript geht hier gar nichts. Bitte aktivieren!
281         </p>
282     </noscript>
283     <?php if (!isset($member['id'])) : ?>
284         <h2>Neues Mitglied</h2>
285     <?php elseif ($readonly) : ?>
286         <h2>Mitgliedsdetails</h2>
287     <?php else : ?>
288         <h2>Mitglied &auml;ndern</h2>
289     <?php endif ?>
290     <?php log_messages($log_messages); ?>
291     <form action="" method="post" class="clearfix">
292         <?php if (isset($member['id']) && !$readonly) : ?><?=html_hidden_field('id', $member)?><?php endif ?>
293         <fieldset>
294             <legend>Allgemein</legend>
295             <?=html_text_field('Mitgliedsnummer', 'number', $member, $readonly)?>
296             <?php if (!$readonly) : ?><small>Wird automatisch vergeben wenn leer.</small><?php endif ?>
297             <?=html_text_field('Nickname', 'nickname', $member, $readonly)?>
298             <?=html_text_field('E-Mail', 'email', $member, $readonly)?>
299         </fieldset>
300         <fieldset id="bank_details">
301             <legend>Bankverbindung</legend>
302             <?=html_text_field('Kontoinhaber', 'accountholder', $member, true)?>
303             <?=html_text_field('Kontonummer', 'accountnumber', $member, true)?>
304             <?=html_text_field('Bankleitzahl', 'bankcode', $member, true)?>
305             <?=html_text_field('Name der Bank', 'bankname', $member, true)?>
306             <?=html_checkbox('Lastschrifteinzug', 'directdebit', $member, 1, $readonly)?>
307             <?php if (!isset($member['id'])) : ?>
308                 <input class="submit" type="button" name="btn_bank_details" value="Bankverbindung erfassen" onclick="bank_details_ask_pass()" id="btn_bank_details"/>
309             <?php elseif ($readonly) : ?>
310                 <input class="submit" type="button" name="btn_bank_details" value="Bankverbindung betrachten" onclick="bank_details_ask_pass()" id="btn_bank_details"/>
311             <?php else : ?>
312                 <input class="submit" type="button" name="btn_bank_details" value="Bankverbindung &auml;ndern" onclick="bank_details_ask_pass()" id="btn_bank_details"/>
313             <?php endif ?>
314         </fieldset>
315         <fieldset style="clear: left;">
316             <legend>Anschrift</legend>
317             <?=html_text_field('Vorname', 'firstname', $member, $readonly)?>
318             <?=html_text_field('Nachname', 'lastname', $member, $readonly)?>
319             <?=html_text_field('Straße', 'street', $member, $readonly)?>
320             <?=html_text_field('Hausnummer', 'housenumber', $member, $readonly)?>
321             <?=html_text_field('PLZ', 'postcode', $member, $readonly)?>
322             <?=html_text_field('Ort', 'city', $member, $readonly)?>
323             <?=html_text_field('Land', 'country', $member, $readonly)?>
324         </fieldset>
325         <fieldset>
326             <legend>Sonstiges</legend>
327             <?=html_text_field('Telefon', 'phone', $member, $readonly)?>
328             <?=html_text_field('Fax', 'fax', $member, $readonly)?>
329             <?=html_text_field('Handy', 'mobile', $member, $readonly)?>
330             <?=html_text_field('Jabber', 'jabber', $member, $readonly)?>
331             <?=html_text_field('ICQ', 'icq', $member, $readonly)?>
332             <?=html_text_field('MSN', 'msn', $member, $readonly)?>
333             <?=html_text_field('AIM', 'aim', $member, $readonly)?>
334             <?=html_text_field('Skype', 'skype', $member, $readonly)?>
335             <?=html_text_field('Website', 'url', $member, $readonly)?>
336             <?=html_text_field('Twitter', 'twitter', $member, $readonly)?>
337         </fieldset>
338         <?php if (!$readonly) : ?>
339             <input class="submit" type="submit" name="submit" value="Speichern"/>
340         <?php else : ?>
341             <br style="clear: left;"/>
342             <a href="<?=html_escape(link_to('change_member', array('id' => $member['id'])))?>">Mitglied &auml;ndern</a>
343         <?php endif ?>
344     </form>
345     <?php if (!isset($member['id'])) : ?>
346     <input class="submit" type="button" name="btn_import_qrcode1" value="QR-Code importieren" onclick="import_qrcode_ask_pass()" id="btn_import_qrcode1"/>
347     <div id="password_popup2" class="modal_window">
348         <fieldset>
349             <legend>Passwortabfrage</legend>
350             <?=html_password_field('Passwort', 'password2')?>
351             <input class="submit" type="button" name="btn_import_qrcode2" value="QR-Code importieren" onclick="import_qrcode()"/>
352         <input class="submit" type="button" name="btn_cancel_import_qrcode" value="Abbrechen" onclick="cancel_import_qrcode()"/>
353         </fieldset>
354     </div>
355     <div id="qrcode_popup" class="modal_window">
356         <fieldset>
357             <legend>QR-Code</legend>
358             <textarea id="qrcode_content" style="width: 100%" rows="30"></textarea>
359             <input class="submit" type="button" name="btn_qrcode_close" value="Importieren" onclick="qrcode_close()"/>
360         </fieldset>
361     </div>
362     <?php endif ?>
363     
364     <div id="password_popup" class="modal_window">
365         <fieldset>
366             <legend>Passwortabfrage</legend>
367             <?=html_password_field('Passwort', 'password1')?>
368             <input class="submit" type="button" name="btn_decrypt_bank_details" value="Bankdaten entschl&uuml;sseln" onclick="decrypt_bank_details()"/>
369         <input class="submit" type="button" name="btn_cancel" value="Abbrechen" onclick="cancel_change_bank_details()"/>
370         </fieldset>
371     </div>
372     <div id="bank_detail_popup" class="modal_window">
373         <fieldset>
374             <legend>Bankverbindung</legend>
375             <?=html_text_field('Kontoinhaber', 'tmp_accountholder', $member, $readonly)?>
376             <?=html_text_field('Kontonummer', 'tmp_accountnumber', $member, $readonly)?>
377             <?=html_text_field('Bankleitzahl', 'tmp_bankcode', $member, $readonly)?>
378             <?=html_text_field('Name der Bank', 'tmp_bankname', $member, $readonly)?>
379             <?php if (!isset($member['id'])) : ?>
380                 <input class="submit" type="button" name="btn_bank_details_save" value="&Uuml;bernehmen" onclick="bank_details_save()"/>
381                 <input class="submit" type="button" name="btn_bank_details_cancel" value="Abbrechen" onclick="bank_details_cancel()"/>
382             <?php elseif ($readonly) : ?>
383                 <input class="submit" type="button" name="btn_bank_details_cancel" value="Zur&uuml;ck" onclick="bank_details_cancel()" id="btn_bank_details_cancel"/>
384             <?php else : ?>
385                 <input class="submit" type="button" name="btn_bank_details_save" value="&Uuml;bernehmen" onclick="bank_details_save()"/>
386                 <input class="submit" type="button" name="btn_bank_details_cancel" value="Abbrechen" onclick="bank_details_cancel()"/>
387             <?php endif ?>
388         </fieldset>
389     </div>
390 <script type="text/javascript">
391
392
393 var the_masterkey;
394
395 $(document).ready(function(){  
396     $('#accountholder').focus( function() { $("#btn_bank_details").focus(); });
397 <?php if ($readonly) : ?>
398     $('#btn_bank_details_cancel').keypress( function(event) { if (event.keyCode == '13') { bank_details_cancel(); } });
399 <?php else : ?>
400     $('#tmp_bankname').keypress( function(event) { if (event.keyCode == '13') { bank_details_save(); } });
401 <?php endif ?>
402     $('#password1').keypress( function(event) { if (event.keyCode == '13') { decrypt_bank_details(); } });
403     <?php if (!isset($member['id'])) : ?>
404     $('#password2').keypress( function(event) { if (event.keyCode == '13') { import_qrcode(); } });
405 <?php endif ?>
406 });  
407
408 function bank_details_ask_pass() {/*{{{*/
409     modal_window_show($("#password_popup"));
410     $("#password1").focus();
411     return;
412 }/*}}}*/
413
414
415 function import_qrcode_ask_pass() {/*{{{*/
416     modal_window_show($("#password_popup2"));
417     $("#password2").focus();
418     return;
419 }/*}}}*/
420
421 function cancel_change_bank_details() {/*{{{*/
422     modal_window_hide();
423     $("#btn_bank_details").focus();
424     $("#password1").val('');
425     return;
426 }/*}}}*/
427
428 function cancel_import_qrcode() {/*{{{*/
429     modal_window_hide();
430     $("#password2").val('');
431     return;
432 }/*}}}*/
433
434 function decrypt_bank_details() {/*{{{*/
435
436     var password = $('#password1').val();
437     $("#password1").val('');
438
439     // We pass a closure so that get_master_key may defer execution
440     get_master_key(password, function(masterkey) {
441
442         modal_window_replace($("#bank_detail_popup"));
443 <?php if ($readonly) : ?>
444         $('#btn_bank_details_cancel').focus();
445 <?php else : ?>
446         $('#tmp_accountholder').focus();
447 <?php endif ?>
448
449         var accountholder = $('#accountholder').val();
450         var accountnumber = $('#accountnumber').val();
451         var bankcode      = $('#bankcode').val();
452         var bankname      = $('#bankname').val();
453
454         // Encrypt/Decrypt data using AES with masterkey
455         if (accountholder != "") { $('#tmp_accountholder').val(Crypto.charenc.UTF8.bytesToString(Crypto.AES.decrypt(accountholder, masterkey))); }
456         if (accountnumber != "") { $('#tmp_accountnumber').val(Crypto.charenc.UTF8.bytesToString(Crypto.AES.decrypt(accountnumber, masterkey))); }
457         if (bankcode      != "") { $('#tmp_bankcode'     ).val(Crypto.charenc.UTF8.bytesToString(Crypto.AES.decrypt(bankcode,      masterkey))); }
458         if (bankname      != "") { $('#tmp_bankname'     ).val(Crypto.charenc.UTF8.bytesToString(Crypto.AES.decrypt(bankname,      masterkey))); }
459         the_masterkey = masterkey; // cache masterkey until popup is closed
460     });
461
462 }/*}}}*/
463
464 function import_qrcode() {/*{{{*/
465
466     var password = $('#password2').val();
467     $("#password2").val('');
468
469     // We pass a closure so that get_master_key may defer execution
470     get_master_key(password, function(masterkey) {
471
472         modal_window_replace($("#qrcode_popup"));
473         the_masterkey = masterkey; // cache masterkey until popup is closed
474     });
475
476 }/*}}}*/
477
478 function qrcode_close() {/*{{{*/
479
480     modal_window_hide();
481
482     var qrcode_content = $('#qrcode_content').val();
483     $("#qrcode_content").val('');
484     var qrcode = qrcode_content.split(';');
485     if (qrcode.length >= 17) { 
486         $("#nickname").val(qrcode[0]);
487         // XXX birthdate - unused
488         $("#email").val(qrcode[2]);
489         // XXX cccmember - unused
490         $("#firstname").val(qrcode[4]);
491         $("#lastname").val(qrcode[5]);
492         $("#street").val(qrcode[6]);
493         $("#housenumber").val(qrcode[7]);
494         $("#postcode").val(qrcode[8]);
495         $("#city").val(qrcode[9]);
496         $("#country").val(qrcode[10]);
497         // XXX fee unused
498         $("#paymentinterval").val(qrcode[12]);
499         var accountholder = qrcode[13];
500         var accountnumber = qrcode[14];
501         var bankcode = qrcode[15];
502         var bankname = qrcode[16];
503         // XXX amount unused - wurde erst am 4.5. ergänzt, war vorher leer.
504     }
505
506
507     // 4.2 Encrypt/Decrypt data using AES with masterkey
508     if (accountholder != "") { $('#accountholder').val(Crypto.AES.encrypt(Crypto.charenc.UTF8.stringToBytes(accountholder), the_masterkey)); } else { $('#accountholder').val(''); }
509     if (accountnumber != "") { $('#accountnumber').val(Crypto.AES.encrypt(Crypto.charenc.UTF8.stringToBytes(accountnumber), the_masterkey)); } else { $('#accountnumber').val(''); }
510     if (bankcode      != "") { $('#bankcode'     ).val(Crypto.AES.encrypt(Crypto.charenc.UTF8.stringToBytes(bankcode),      the_masterkey)); } else { $('#bankcode').val(''); }
511     if (bankname      != "") { $('#bankname'     ).val(Crypto.AES.encrypt(Crypto.charenc.UTF8.stringToBytes(bankname),      the_masterkey)); } else { $('#bankname').val(''); }
512     the_masterkey = '';
513
514 }/*}}}*/
515
516 function bank_details_save() {/*{{{*/
517
518     modal_window_hide();
519
520     var accountholder = $('#tmp_accountholder').val();
521     var accountnumber = $('#tmp_accountnumber').val();
522     var bankcode      = $('#tmp_bankcode').val();
523     var bankname      = $('#tmp_bankname').val();
524     $("#tmp_accountholder").val('');
525     $("#tmp_accountnumber").val('');
526     $("#tmp_bankcode").val('');
527     $("#tmp_bankname").val('');
528
529     // 4.2 Encrypt/Decrypt data using AES with masterkey
530     if (accountholder != "") { $('#accountholder').val(Crypto.AES.encrypt(Crypto.charenc.UTF8.stringToBytes(accountholder), the_masterkey)); } else { $('#accountholder').val(''); }
531     if (accountnumber != "") { $('#accountnumber').val(Crypto.AES.encrypt(Crypto.charenc.UTF8.stringToBytes(accountnumber), the_masterkey)); } else { $('#accountnumber').val(''); }
532     if (bankcode      != "") { $('#bankcode'     ).val(Crypto.AES.encrypt(Crypto.charenc.UTF8.stringToBytes(bankcode),      the_masterkey)); } else { $('#bankcode').val(''); }
533     if (bankname      != "") { $('#bankname'     ).val(Crypto.AES.encrypt(Crypto.charenc.UTF8.stringToBytes(bankname),      the_masterkey)); } else { $('#bankname').val(''); }
534     the_masterkey = '';
535
536 }/*}}}*/
537
538 function bank_details_cancel() {/*{{{*/
539
540     modal_window_hide();
541
542     $("#tmp_accountholder").val('');
543     $("#tmp_accountnumber").val('');
544     $("#tmp_bankcode").val('');
545     $("#tmp_bankname").val('');
546
547     the_masterkey = '';
548 }/*}}}*/
549
550 </script>
551     <?php
552 }/*}}}*/
553
554