Formatting
[memberdb.git] / include / xlsexport.php
index 3ccfd4b..2f98536 100644 (file)
@@ -2,10 +2,7 @@
 
 function action_export_members()
 {
-    global $EARNING_TYPES, $EXPENSE_TYPES;
-
     error_reporting(error_reporting() & ~E_DEPRECATED & ~E_STRICT);
-    require_once 'vendor/autoload.php';
 
     // Creating a workbook
     $workbook = new Spreadsheet_Excel_Writer();
@@ -15,16 +12,13 @@ function action_export_members()
     $workbook->send('Mitglieder.xls');
 
     // Creating a worksheet
-
     $members = db_get_members();
 
-
     $row = 0;
     $col = 0;
 
     $worksheet =& $workbook->addWorksheet('Mitglieder');
     $worksheet->setInputEncoding('UTF-8');
-    $row = 0;
     $worksheet->write($row, $col++, 'Mitgliedsnummer');
     $worksheet->write($row, $col++, 'Nickname');
     $worksheet->write($row, $col++, 'E-Mail');
@@ -47,7 +41,7 @@ function action_export_members()
     $worksheet->write($row, $col++, 'Twitter');
     $worksheet->write($row, $col++, 'Lastschrifteinzug');
     $worksheet->write($row, $col++, 'Mandatunterschriftsdatum');
-    $worksheet->write($row, $col++, 'Status');
+    $worksheet->write($row, $col, 'Status');
     $row++;
 
     foreach ($members as $member) {
@@ -75,8 +69,7 @@ function action_export_members()
         $worksheet->write($row, $col++, $member['directdebit']);
         $worksheet->write($row, $col++, $member['ddmandatesigdate']);
         $membership_info = fees_info_for_member($member['id'], time());
-        $worksheet->write($row, $col++, $membership_info['is_member']);
-        $col = 0;
+        $worksheet->write($row, $col, $membership_info['is_member']);
         $row++;
     }
 
@@ -94,7 +87,6 @@ function action_export_payments()
     global $EARNING_TYPES, $EXPENSE_TYPES;
 
     error_reporting(error_reporting() & ~E_DEPRECATED & ~E_STRICT);
-    require_once 'vendor/autoload.php';
 
     // Creating a workbook
     $workbook = new Spreadsheet_Excel_Writer();
@@ -104,14 +96,12 @@ function action_export_payments()
     $workbook->send('Finanzen.xls');
 
     // Creating a worksheet
-
     $payments = db_get_finished_payments(0, 1000000000);
 
 
     $row = 0;
     $col = 0;
     $current_year = '';
-
     foreach ($payments as $payment) {
         $year = substr($payment['date'], 0, 4);
         if ($year != $current_year) {
@@ -128,7 +118,7 @@ function action_export_payments()
             $worksheet->write($row, $col++, 'Mitglied');
             $worksheet->write($row, $col++, 'Kontostand');
             $worksheet->write($row, $col++, 'Kassenstand');
-            $worksheet->write($row, $col++, 'Gesamt');
+            $worksheet->write($row, $col, 'Gesamt');
             $row++;
             $col = 0;
         }
@@ -141,7 +131,7 @@ function action_export_payments()
         $worksheet->write($row, $col++, $payment['nickname']);
         $worksheet->write($row, $col++, $payment['bank']);
         $worksheet->write($row, $col++, $payment['cash']);
-        $worksheet->write($row, $col++, $payment['total']);
+        $worksheet->write($row, $col, $payment['total']);
 
         $col = 0;
         $row++;