From 86f11ca07b01cbda36e7a941eda8c9415f5dc623 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Sun, 10 Mar 2013 22:35:18 +0000 Subject: add urdu --- ur/about/reports/template.php | 344 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 ur/about/reports/template.php (limited to 'ur/about/reports/template.php') diff --git a/ur/about/reports/template.php b/ur/about/reports/template.php new file mode 100644 index 000000000..5c0c04994 --- /dev/null +++ b/ur/about/reports/template.php @@ -0,0 +1,344 @@ + 'January', 2 => 'February', 3 => 'March', + 4 => 'April', 5 => 'May', 6 => 'June', + 7 => 'July', 8 => 'August', 9 => 'September', + 10 => 'October', 11 => 'November', 12 => 'December' +); + +/** + * Format numbers after ISO_31 recommandation, + * using the comma as decimal sep. + * See http://en.wikipedia.org/wiki/ISO_31-0#Numbers + * + * @param float $n decimal number + * @param char $dec_sep + * + * @return string +*/ +function _report_number_format($n, $dec_sep = ',') +{ + return str_replace('#', ' ', number_format($n, 2, $dec_sep, '#')); +} + +$data = file($source_csv); +$parsed = array(); + +foreach ($data as $l) { + if (trim($l) == ',,,,,,') + continue; + + $l = str_getcsv(str_replace(array(',,,', ",\n"), '', $l)); + if (substr($l[0], 0, 2) == '# ') { + $tag = $l[0]; + $parent = $tag; + } elseif (substr($l[0], 0, 2) == '##') { + $tag = $parent . ' > ' . $l[0]; + } else { + $parsed[$tag][] = $l; + } +} + +foreach ($parsed as $tag => $values) { + $val2 = array(); + $tag2 = strtolower($tag); + $teststr = strlen($tag) > 12 ? substr($tag2, 0, 13) : null; + foreach ($values as $v) { + if ($tag2 == "# head" + || $teststr == "# account bal" + || $teststr == "# income stat" + || $teststr == "# balance she" + || $tag2 == '## expenses' + || $tag2 == '## revenues' + || $tag2 == '## liabilities' + || $tag2 == '## assets') { + $val2[$v[0]] = $v[1]; + } else { + $val2[] = $v; + } + } + + $parsed[$tag] = $val2; +} +$flow = array(); + +$list = array_fill(1, 12, 0); +$count = array_fill(1, 12, 0); +$tmp = $parsed['# Expenses details > ## More details']; +array_shift($tmp); +foreach ($tmp as $line) { + $month = date('n', strtotime($line[0])); + $list[$month] += $line[3]; // amount + $count[$month] += 1; +} +$expenses_monthly_summary = array($list, $count); + +$flow = array( + 'expenses' => $list, + 'expenses_op' => $count, + 'revenue' => null, + 'revenue_op' => null +); + +$list = array(); +$count = array(); + +// FIXME take ## Other revenues lines into account. +foreach ($parsed['# Income details > ## Donations monthly summary'] as $line) { + $list[] = $line[2]; + $count[] = $line[1]; +} + +unset($list[0]); +unset($list[13]); +unset($count[0]); +unset($count[13]); + +$flow['revenue'] = $list; +$flow['revenue_op'] = $count; + +include 'template_lib.php'; + +$R = get_revenues($parsed['# Income details > ## Donations monthly summary'], $_months); +$expenses_total = array_sum($expenses_monthly_summary[0]); + + +?> + + + + Mageia.org <?php echo $year; ?> Financial Report + + + + + + + + + + + + +
+

Activity Reports » Financial Report

+ +
+ + + +
+
+

Cash flow

+
+
+
+
+
+
+

Income statement

+ + + + + + + + + + + + + + + + + 0): + ?> + + + + + + + + + + +
Revenues
Expenses
Net IncomeNet Loss
+
+
+ +
+

Expenses

+ ## More details']); echo $E['html']; ?> +
+
+
+

Income, donations

+ +
+

Return to top

+
+ + + + -- cgit v1.2.1