File size: 10,604 Bytes
743a488
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reports | CommunityPulse Hub</title>
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body class="bg-gray-50 min-h-screen flex flex-col">
    <custom-navbar></custom-navbar>
    
    <main class="flex-grow container mx-auto px-4 py-8">
        <div class="mb-8">
            <h1 class="text-2xl font-bold text-gray-800">Financial Reports</h1>
            <p class="text-gray-600">Generate and view financial reports for your community</p>
        </div>
        
        <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8">
            <div class="lg:col-span-2 bg-white rounded-lg shadow p-6">
                <div class="flex justify-between items-center mb-6">
                    <h3 class="text-lg font-medium text-gray-900">Monthly Financial Overview</h3>
                    <select class="border border-gray-300 rounded-md px-3 py-1 text-sm">
                        <option>Last 6 Months</option>
                        <option>This Year</option>
                        <option>Last Year</option>
                        <option>Custom Range</option>
                    </select>
                </div>
                <canvas id="monthlyChart" height="300"></canvas>
            </div>
            
            <div class="bg-white rounded-lg shadow p-6">
                <h3 class="text-lg font-medium text-gray-900 mb-6">Quick Reports</h3>
                <div class="space-y-4">
                    <a href="#" class="block p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition duration-150 flex items-center gap-3">
                        <div class="p-3 rounded-full bg-primary-100 text-primary-500">
                            <i data-feather="file-text" class="w-5 h-5"></i>
                        </div>
                        <div>
                            <p class="font-medium">Monthly Dues Report</p>
                            <p class="text-sm text-gray-500">View all dues payments</p>
                        </div>
                    </a>
                    
                    <a href="#" class="block p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition duration-150 flex items-center gap-3">
                        <div class="p-3 rounded-full bg-secondary-100 text-secondary-500">
                            <i data-feather="dollar-sign" class="w-5 h-5"></i>
                        </div>
                        <div>
                            <p class="font-medium">Expense Report</p>
                            <p class="text-sm text-gray-500">View all community expenses</p>
                        </div>
                    </a>
                    
                    <a href="#" class="block p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition duration-150 flex items-center gap-3">
                        <div class="p-3 rounded-full bg-yellow-100 text-yellow-500">
                            <i data-feather="pie-chart" class="w-5 h-5"></i>
                        </div>
                        <div>
                            <p class="font-medium">Category Breakdown</p>
                            <p class="text-sm text-gray-500">View spending by category</p>
                        </div>
                    </a>
                    
                    <a href="#" class="block p-4 bg-gray-50 hover:bg-gray-100 rounded-lg transition duration-150 flex items-center gap-3">
                        <div class="p-3 rounded-full bg-green-100 text-green-500">
                            <i data-feather="users" class="w-5 h-5"></i>
                        </div>
                        <div>
                            <p class="font-medium">Member Dues Status</p>
                            <p class="text-sm text-gray-500">View who has paid dues</p>
                        </div>
                    </a>
                </div>
            </div>
        </div>
        
        <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
            <div class="bg-white rounded-lg shadow p-6">
                <div class="flex justify-between items-center mb-6">
                    <h3 class="text-lg font-medium text-gray-900">Income vs Expenses</h3>
                    <select class="border border-gray-300 rounded-md px-3 py-1 text-sm">
                        <option>This Year</option>
                        <option>Last Year</option>
                        <option>Last 2 Years</option>
                    </select>
                </div>
                <canvas id="incomeExpenseChart" height="250"></canvas>
            </div>
            
            <div class="bg-white rounded-lg shadow p-6">
                <div class="flex justify-between items-center mb-6">
                    <h3 class="text-lg font-medium text-gray-900">Dues Collection Rate</h3>
                    <select class="border border-gray-300 rounded-md px-3 py-1 text-sm">
                        <option>This Month</option>
                        <option>Last Month</option>
                        <option>Quarterly</option>
                    </select>
                </div>
                <canvas id="duesChart" height="250"></canvas>
            </div>
        </div>
    </main>

    <custom-footer></custom-footer>
    
    <script src="components/navbar.js"></script>
    <script src="components/footer.js"></script>
    <script src="script.js"></script>
    <script>
        // Monthly Chart
        const monthlyCtx = document.getElementById('monthlyChart').getContext('2d');
        const monthlyChart = new Chart(monthlyCtx, {
            type: 'bar',
            data: {
                labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
                datasets: [
                    {
                        label: 'Income',
                        data: [120000, 135000, 145000, 150000, 162250, 175000],
                        backgroundColor: '#4ade80',
                        borderRadius: 4
                    },
                    {
                        label: 'Expenses',
                        data: [85000, 90000, 95000, 92000, 94500, 97000],
                        backgroundColor: '#f87171',
                        borderRadius: 4
                    }
                ]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        position: 'top',
                    },
                    tooltip: {
                        callbacks: {
                            label: function(context) {
                                return context.dataset.label + ': ₱' + context.raw.toLocaleString();
                            }
                        }
                    }
                },
                scales: {
                    y: {
                        beginAtZero: true,
                        ticks: {
                            callback: function(value) {
                                return '₱' + value.toLocaleString();
                            }
                        }
                    }
                }
            }
        });
        
        // Income vs Expense Chart
        const incomeExpenseCtx = document.getElementById('incomeExpenseChart').getContext('2d');
        const incomeExpenseChart = new Chart(incomeExpenseCtx, {
            type: 'line',
            data: {
                labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
                datasets: [
                    {
                        label: 'Income',
                        data: [120000, 135000, 145000, 150000, 162250, 175000],
                        borderColor: '#4ade80',
                        backgroundColor: 'rgba(74, 222, 128, 0.1)',
                        fill: true,
                        tension: 0.3
                    },
                    {
                        label: 'Expenses',
                        data: [85000, 90000, 95000, 92000, 94500, 97000],
                        borderColor: '#f87171',
                        backgroundColor: 'rgba(248, 113, 113, 0.1)',
                        fill: true,
                        tension: 0.3
                    }
                ]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        position: 'top',
                    },
                    tooltip: {
                        callbacks: {
                            label: function(context) {
                                return context.dataset.label + ': ₱' + context.raw.toLocaleString();
                            }
                        }
                    }
                },
                scales: {
                    y: {
                        beginAtZero: true,
                        ticks: {
                            callback: function(value) {
                                return '₱' + value.toLocaleString();
                            }
                        }
                    }
                }
            }
        });
        
        // Dues Chart
        const duesCtx = document.getElementById('duesChart').getContext('2d');
        const duesChart = new Chart(duesCtx, {
            type: 'doughnut',
            data: {
                labels: ['Paid', 'Unpaid', 'Overdue'],
                datasets: [{
                    data: [85, 10, 5],
                    backgroundColor: [
                        '#4ade80',
                        '#94a3b8',
                        '#f87171'
                    ],
                    borderWidth: 0
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        position: 'right',
                    },
                    tooltip: {
                        callbacks: {
                            label: function(context) {
                                return context.label + ': ' + context.raw + '%';
                            }
                        }
                    }
                }
            }
        });
        
        feather.replace();
    </script>
</body>
</html>