Merge pull request #3196 from JoeMurray/master
[civicrm-core.git] / templates / CRM / Report / Form / Grant / Statistics.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25 *}
26 {if $section eq 1}
27 <div class="crm-block crm-content-block crm-report-layoutGraph-form-block">
28 {*include the graph*}
29 {include file="CRM/Report/Form/Layout/Graph.tpl"}
30 </div>
31 {else}
32 <div class="crm-block crm-form-block crm-report-field-form-block">
33 {include file="CRM/Report/Form/Fields.tpl" componentName='Grant'}
34 </div>
35
36 <div class="crm-block crm-content-block crm-report-form-block">
37 {*include actions*}
38 {include file="CRM/Report/Form/Actions.tpl"}
39
40 {*include the graph*}
41 {include file="CRM/Report/Form/Layout/Graph.tpl"}
42
43
44 {if $printOnly}
45 <h1>{$reportTitle}</h1>
46 <div id="report-date">{$reportDate}</div>
47 {/if}
48
49 {if !empty($totalStatistics)}
50 <h3>{ts}Report Filters{/ts}</h3>
51 <table class="report-layout statistics-table">
52 {if $totalStatistics.filters}
53 {foreach from=$totalStatistics.filters item=row}
54 <tr>
55 <th class="statistics">{$row.title}</th>
56 <td>{$row.value}</td>
57 </tr>
58 {/foreach}
59 {else}
60 ( {ts}All Grants{/ts} )
61 {/if}
62 </table>
63
64 <h3>{ts}Summary Statistics{/ts}</h2>
65 <table class="report-layout display">
66 <tr>
67 <th class="statistics" scope="row"></th>
68 <th class="statistics right" scope="row">Count</th>
69 <th class="statistics right" scope="row">Amount</th>
70 </tr>
71 {foreach from=$totalStatistics.total_statistics key=key item=val}
72 <tr>
73 <td>{$val.title}</td>
74 <td class="right">{$val.count}</td>
75 <td class="right">{$val.amount|crmMoney}</td>
76 </tr>
77 {/foreach}
78 </table>
79 {/if}
80
81 {if !empty($grantStatistics)}
82 <h3>{ts}Statistics Breakdown{/ts}</h3>
83 <table class="report-layout display">
84 {foreach from=$grantStatistics item=values key=key}
85 <tr>
86 <th class="statistics" scope="row">{$values.title}</th>
87 <th class="statistics right" scope="row">Number of Grants (%)</th>
88 <th class="statistics right" scope="row">Total Amount (%)</th>
89 </tr>
90 {foreach from=$values.value item=row key=field}
91 <tr>
92 <td>{$field}</td>
93 <td class="right">{if $row.count}{$row.count} ({$row.percentage}%){/if}</td>
94 <td class="right">
95 {foreach from=$row.currency key=fld item=val}
96 {$val.value|crmMoney:$fld} ({$val.percentage}%)&nbsp;&nbsp;
97 {/foreach}
98 </td>
99 </tr>
100 {if $row.unassigned_count}
101 <tr>
102 <td>{$field} ({ts}Unassigned{/ts})</td>
103 <td class="right">{if $row.unassigned_count}{$row.unassigned_count} ({$row.unassigned_percentage}%){/if}</td>
104 <td class="right">
105 {foreach from=$row.unassigned_currency key=fld item=val}
106 {$val.value|crmMoney:$fld} ({$val.percentage}%)&nbsp;&nbsp;
107 {/foreach}
108 </td>
109 </tr>
110 {/if}
111 {/foreach}
112 <tr><td colspan="3" style="border: none;">&nbsp;</td></tr>
113 {/foreach}
114 </table>
115 {/if}
116
117 <br />
118 {if empty($totalStatistics)}
119 {include file="CRM/Report/Form/ErrorMessage.tpl"}
120 {/if}
121 </div>
122 {/if}