Improvements
[infodrom.org/service.infodrom.org] / src / InfoCon / account / list.wml
index f36c8cc..c17a294 100644 (file)
@@ -99,13 +99,36 @@ function filter_account()
 
   return $out;
 }
+
+if (!empty($_POST['ajax']) && $_POST['ajax'] == 1) {
+    echo utf8_encode(filter_account());
+    exit;
+}
+
 ?>
 
 <page func=InfoCon title="Kontoführung">
 
+<calendar_init -5>
 <account_heading>
 <form_to_yyyymmdd>
 
+<style type="text/css">
+div#filter_popup {
+    background: white;
+    border: 1px solid #CCC;
+    height:auto;
+    width:340px;
+    position:absolute;
+}
+div#filter_title {
+    width: 100%;
+    cursor: move;
+    background: #EEE;
+    margin-bottom: 5px;
+    font-weight: bold;
+}
+</style>
 <table class="border smallfont" width=100% border=0 cellpadding=0 cellspacing=1>
 <thead>
 <tr class=head>
@@ -116,7 +139,7 @@ function filter_account()
 </tr>
 </thead>
 <tbody>
-<?=filter_account()?>
+<?=(count($_GET)?'':filter_account())?>
 </tbody>
 </table><p>
 
@@ -129,8 +152,56 @@ $(function(){
        else
            $(this).css('backgroundColor','');
     });
+    $('body').append('<script type="text/javascript" src="../../jquery.udraggable.js"><\/script>');
+    $('body').append('<script type="text/javascript" src="../../jquery.event.ue.js"><\/script>');
 });
+
+function filter_popup()
+{
+    if (!$('#filter_popup form input').length) {
+       $.get('query.php',
+             window.location.search.substr(1),
+             function(data) {
+                 var text = '<style type="text/css">';
+                 text += '#fc { z-index: 10; }';
+                 $(data).find('style').each(function(i,e){
+                     text += $(this).html();
+                 });
+                 text += '</style>';
+                 text += $(data).find('form').html();
+                 $('#filter_popup form').html(text);
+
+                 $('#filter_popup').udraggable({
+                     'handle': 'div#filter_title'
+                 }).css('top', '70px').css('left', '103px');
+
+                 $('#filter_popup form input.button[type="submit"]').click(function(e){
+                     $.post('list.php',
+                            'ajax=1&'+$('#filter_popup form').serialize(),
+                            function(data){
+                                $('table.border tbody').html(data);
+                                $('#filter_popup').hide();
+                            });
+                     return false;
+                 });
+         });
+    }
+
+    if ($('#filter_popup:visible').length)
+        $('#filter_popup').hide();
+    else
+        $('#filter_popup').show();
+
+    return false;
+}
+
 </script></protect>
+<div id="filter_popup" style="display:none;">
+<div id="filter_title">Filter setzen</div>
+<div style="padding:5px;">
+<form id="filter_form"></form>
+</div>
+</div>
 </page>
 
 # Local variables: