Index: trunk/extensions/ContributionReporting/ContributionStatistics_body.php |
— | — | @@ -58,8 +58,7 @@ |
59 | 59 | if( $this->mEndDate > time() && $this->mStartDate < time() ) { |
60 | 60 | $this->showDailyTotals( $egContributionStatisticsViewDays ); |
61 | 61 | } |
62 | | - |
63 | | - // Show daily totals |
| 62 | + // Show monthly totals |
64 | 63 | $this->showMonthlyTotals( ); |
65 | 64 | |
66 | 65 | // Show currency totals |
— | — | @@ -99,16 +98,20 @@ |
100 | 99 | |
101 | 100 | // Days |
102 | 101 | foreach ( $days as $data ) { |
| 102 | + $stats = array(); |
| 103 | + foreach( $data as $key => $value ) { |
| 104 | + $stats[] = $value; |
| 105 | + } |
103 | 106 | $htmlOut .= Xml::tags( 'tr', null, |
104 | | - Xml::element( 'td', array( 'align' => 'left' ), $data[0] ) . |
105 | | - Xml::element( 'td', array( 'align' => 'left' ), $wgLang->formatNum( $data[1] ) ) . |
106 | | - Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $data[2], 2 ) ) ) . |
107 | | - Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $data[3], 2 ) ) ) . |
108 | | - /*Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $data[5], 2 ) ) ) .*/ |
109 | | - Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $data[4], 2 ) ) ) . |
| 107 | + Xml::element( 'td', array( 'align' => 'left' ), $stats[0] ) . |
| 108 | + Xml::element( 'td', array( 'align' => 'left' ), $wgLang->formatNum( $stats[1] ) ) . |
| 109 | + Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $stats[2], 2 ) ) ) . |
| 110 | + Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $stats[3], 2 ) ) ) . |
| 111 | + /*Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $stats[5], 2 ) ) ) .*/ |
| 112 | + Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $stats[4], 2 ) ) ) . |
110 | 113 | Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $total, 2 ) ) ) |
111 | 114 | ); |
112 | | - $total -= $data[2]; |
| 115 | + $total -= $stats[2]; |
113 | 116 | } |
114 | 117 | |
115 | 118 | $htmlOut .= Xml::closeElement( 'table' ); |
— | — | @@ -342,20 +345,24 @@ |
343 | 346 | // Build day/value array |
344 | 347 | $totals = array(); |
345 | 348 | foreach ( $res as $row ) { |
| 349 | + $stats = array(); |
| 350 | + foreach( $row as $key => $value ) { |
| 351 | + $stats[] = $value; |
| 352 | + } |
346 | 353 | $median = $dbr->selectField( 'public_reporting', |
347 | 354 | array( 'converted_amount' ), |
348 | 355 | array( |
349 | | - "FROM_UNIXTIME(received, '%Y-%m')" => $row[0] |
| 356 | + "FROM_UNIXTIME(received, '%Y-%m')" => $stats[0] |
350 | 357 | ), |
351 | 358 | __METHOD__, |
352 | 359 | array( |
353 | 360 | 'ORDER BY' => 'converted_amount DESC', |
354 | | - 'OFFSET' => round( $row[1] / 2 ), |
| 361 | + 'OFFSET' => round( $stats[1] / 2 ), |
355 | 362 | 'LIMIT' => 1 |
356 | 363 | ) |
357 | 364 | ); |
358 | | - $row[] = $median; |
359 | | - $totals[] = $row; |
| 365 | + $stats[] = $median; |
| 366 | + $totals[] = $stats; |
360 | 367 | } |
361 | 368 | |
362 | 369 | // Return results |
— | — | @@ -385,23 +392,27 @@ |
386 | 393 | |
387 | 394 | $totals = array(); |
388 | 395 | foreach ( $res as $row ) { |
| 396 | + $stats = array(); |
| 397 | + foreach( $row as $key => $value ) { |
| 398 | + $stats[] = $value; |
| 399 | + } |
389 | 400 | $median = $dbr->selectField( 'public_reporting', |
390 | 401 | array( 'converted_amount' ), |
391 | 402 | array_merge( |
392 | 403 | $this->dateConds( $dbr ), |
393 | 404 | array( |
394 | | - 'original_currency' => $row[0] |
| 405 | + 'original_currency' => $stats[0] |
395 | 406 | ) |
396 | 407 | ), |
397 | 408 | __METHOD__, |
398 | 409 | array( |
399 | 410 | 'ORDER BY' => 'converted_amount DESC', |
400 | | - 'OFFSET' => round( $row[1] / 2 ), |
| 411 | + 'OFFSET' => round( $stats[1] / 2 ), |
401 | 412 | 'LIMIT' => 1, |
402 | 413 | ) |
403 | 414 | ); |
404 | | - $row[] = $median; |
405 | | - $totals[$row[0]] = $row; |
| 415 | + $stats[] = $median; |
| 416 | + $totals[$stats[0]] = $stats; |
406 | 417 | } |
407 | 418 | |
408 | 419 | if ( isset( $totals[null] ) ) { |