File size: 15,423 Bytes
73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 73d203f 08ec4c0 | 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 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | {% extends "admin/base.html" %} {% block title %}Tableau de Bord{% endblock %}
{% block page_title %}Tableau de Bord{% endblock %} {% block content %}
<!-- Stats Cards - Row 1 -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<!-- Total Users (Displayed) -->
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Utilisateurs Affichés</p>
<h3 class="text-3xl font-bold text-white mt-1">
{{ "{:,}".format(displayed_user_count) }}
</h3>
</div>
<div
class="w-12 h-12 bg-blue-500/20 rounded-lg flex items-center justify-center"
>
<i class="fas fa-users text-blue-400 text-xl"></i>
</div>
</div>
<p class="text-sm text-gray-500 mt-3">
<span class="text-green-400">{{ total_users }}</span> réels +
<span class="text-yellow-400">{{ fake_user_count }}</span> ajoutés
</p>
</div>
<!-- Total Deposits -->
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Total Dépôts</p>
<h3 class="text-2xl font-bold text-white mt-1">
{{ "{:,.0f}".format(total_deposits) }}
<span class="text-sm font-normal text-gray-400">FCFA</span>
</h3>
</div>
<div
class="w-12 h-12 bg-green-500/20 rounded-lg flex items-center justify-center"
>
<i class="fas fa-arrow-down text-green-400 text-xl"></i>
</div>
</div>
<p class="text-sm text-gray-500 mt-3">
Somme de tous les achats de plans
</p>
</div>
<!-- Total Withdrawals -->
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Total Retraits</p>
<h3 class="text-2xl font-bold text-white mt-1">
{{ "{:,.0f}".format(total_withdrawals) }}
<span class="text-sm font-normal text-gray-400">FCFA</span>
</h3>
</div>
<div
class="w-12 h-12 bg-red-500/20 rounded-lg flex items-center justify-center"
>
<i class="fas fa-arrow-up text-red-400 text-xl"></i>
</div>
</div>
<p class="text-sm text-gray-500 mt-3">
Montant brut des retraits effectués
</p>
</div>
<!-- Total Withdrawal Fees -->
<div
class="bg-gray-800 rounded-xl p-6 border border-gray-700 relative overflow-hidden"
>
<div
class="absolute top-0 right-0 w-20 h-20 bg-yellow-500/10 rounded-full blur-xl -mr-10 -mt-10"
></div>
<div class="flex items-center justify-between relative z-10">
<div>
<p class="text-gray-400 text-sm">Frais Collectés (15%)</p>
<h3 class="text-2xl font-bold text-yellow-400 mt-1">
{{ "{:,.0f}".format(total_withdrawal_fees) }}
<span class="text-sm font-normal text-gray-400">FCFA</span>
</h3>
</div>
<div
class="w-12 h-12 bg-yellow-500/20 rounded-lg flex items-center justify-center"
>
<i class="fas fa-coins text-yellow-400 text-xl"></i>
</div>
</div>
<p class="text-sm text-gray-500 mt-3">
<i class="fas fa-chart-line text-green-400 mr-1"></i>
Revenus sur les retraits
</p>
</div>
</div>
<!-- Stats Cards - Row 2 -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<!-- Real Users -->
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Utilisateurs Réels</p>
<h3 class="text-3xl font-bold text-white mt-1">
{{ total_users }}
</h3>
</div>
<div
class="w-12 h-12 bg-indigo-500/20 rounded-lg flex items-center justify-center"
>
<i class="fas fa-user-check text-indigo-400 text-xl"></i>
</div>
</div>
<p class="text-sm text-gray-500 mt-3">
<span class="text-green-400">{{ active_users }}</span> actifs
</p>
</div>
<!-- Pending Withdrawals -->
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Retraits en Attente</p>
<h3 class="text-3xl font-bold text-white mt-1">
{{ pending_withdrawals }}
</h3>
</div>
<div
class="w-12 h-12 bg-orange-500/20 rounded-lg flex items-center justify-center"
>
<i class="fas fa-clock text-orange-400 text-xl"></i>
</div>
</div>
<a
href="{{ url_for('admin_panel.withdrawals') }}"
class="text-sm text-orange-400 hover:text-orange-300 mt-3 inline-block"
>
Voir les demandes <i class="fas fa-arrow-right ml-1"></i>
</a>
</div>
<!-- Active Investments -->
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Investissements Actifs</p>
<h3 class="text-2xl font-bold text-white mt-1">
{{ "{:,.0f}".format(total_investments) }}
<span class="text-sm font-normal text-gray-400">FCFA</span>
</h3>
</div>
<div
class="w-12 h-12 bg-purple-500/20 rounded-lg flex items-center justify-center"
>
<i class="fas fa-chart-line text-purple-400 text-xl"></i>
</div>
</div>
<p class="text-sm text-gray-500 mt-3">Valeur des plans actifs</p>
</div>
<!-- Referral Commissions -->
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-400 text-sm">Commissions Parrainage</p>
<h3 class="text-2xl font-bold text-white mt-1">
{{ "{:,.0f}".format(total_referral_commissions) }}
<span class="text-sm font-normal text-gray-400">FCFA</span>
</h3>
</div>
<div
class="w-12 h-12 bg-pink-500/20 rounded-lg flex items-center justify-center"
>
<i class="fas fa-share-nodes text-pink-400 text-xl"></i>
</div>
</div>
<a
href="{{ url_for('admin_panel.referral_commissions') }}"
class="text-sm text-pink-400 hover:text-pink-300 mt-3 inline-block"
>
Voir les détails <i class="fas fa-arrow-right ml-1"></i>
</a>
</div>
</div>
<!-- Summary Card -->
<div
class="bg-gradient-to-r from-yellow-500/10 to-amber-500/10 rounded-xl p-6 border border-yellow-500/30 mb-8"
>
<h3 class="text-lg font-bold text-white mb-4">
<i class="fas fa-chart-pie mr-2 text-yellow-400"></i>
Résumé Financier
</h3>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="text-center p-4 bg-gray-800/50 rounded-lg">
<p class="text-gray-400 text-sm mb-2">Total Entrant</p>
<p class="text-2xl font-bold text-green-400">
{{ "{:,.0f}".format(total_deposits) }} FCFA
</p>
</div>
<div class="text-center p-4 bg-gray-800/50 rounded-lg">
<p class="text-gray-400 text-sm mb-2">Total Sortant</p>
<p class="text-2xl font-bold text-red-400">
{{ "{:,.0f}".format(total_withdrawals) }} FCFA
</p>
</div>
<div class="text-center p-4 bg-gray-800/50 rounded-lg">
<p class="text-gray-400 text-sm mb-2">Gains (Frais 15%)</p>
<p class="text-2xl font-bold text-yellow-400">
{{ "{:,.0f}".format(total_withdrawal_fees) }} FCFA
</p>
</div>
</div>
</div>
<!-- Recent Transactions -->
<div class="bg-gray-800 rounded-xl border border-gray-700">
<div
class="px-6 py-4 border-b border-gray-700 flex items-center justify-between"
>
<h3 class="text-lg font-semibold text-white">
<i class="fas fa-history mr-2 text-yellow-400"></i>
Transactions Récentes
</h3>
<a
href="{{ url_for('admin_panel.transactions') }}"
class="text-sm text-yellow-400 hover:text-yellow-300"
>
Voir tout <i class="fas fa-arrow-right ml-1"></i>
</a>
</div>
<div class="overflow-x-auto">
<table class="w-full">
<thead class="bg-gray-900/50">
<tr>
<th
class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider"
>
Utilisateur
</th>
<th
class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider"
>
Type
</th>
<th
class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider"
>
Montant
</th>
<th
class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider"
>
Frais
</th>
<th
class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider"
>
Statut
</th>
<th
class="px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider"
>
Date
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-700">
{% for transaction in recent_transactions %}
<tr class="hover:bg-gray-700/50 transition-colors">
<td class="px-6 py-4 whitespace-nowrap">
<span class="text-gray-300"
>{{ transaction.user.phone if transaction.user else
'N/A' }}</span
>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span
class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium {% if transaction.type == 'deposit' %}bg-green-500/20 text-green-400 {% elif transaction.type == 'withdrawal' %}bg-red-500/20 text-red-400 {% elif transaction.type == 'purchase' %}bg-blue-500/20 text-blue-400 {% elif transaction.type == 'bonus' %}bg-yellow-500/20 text-yellow-400 {% elif transaction.type == 'referral' %}bg-pink-500/20 text-pink-400 {% else %}bg-gray-500/20 text-gray-400{% endif %}"
>
{% if transaction.type == 'deposit' %}
<i class="fas fa-arrow-down mr-1"></i> Dépôt {% elif
transaction.type == 'withdrawal' %}
<i class="fas fa-arrow-up mr-1"></i> Retrait {% elif
transaction.type == 'purchase' %}
<i class="fas fa-shopping-cart mr-1"></i> Achat {%
elif transaction.type == 'bonus' %}
<i class="fas fa-gift mr-1"></i> Bonus {% elif
transaction.type == 'referral' %}
<i class="fas fa-share-nodes mr-1"></i> Parrainage
{% else %} {{ transaction.type }} {% endif %}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span
class="font-medium {% if transaction.type == 'withdrawal' %}text-red-400{% else %}text-green-400{% endif %}"
>
{% if transaction.type == 'withdrawal' %}-{% else
%}+{% endif %}{{
"{:,.0f}".format(transaction.amount) }} FCFA
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
{% if transaction.type == 'withdrawal' and
transaction.fee_amount %}
<span class="text-yellow-400 font-medium"
>{{ "{:,.0f}".format(transaction.fee_amount) }}
FCFA</span
>
{% else %}
<span class="text-gray-500">-</span>
{% endif %}
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span
class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium {% if transaction.status == 'completed' %}bg-green-500/20 text-green-400 {% elif transaction.status == 'pending' %}bg-yellow-500/20 text-yellow-400 {% elif transaction.status == 'approved' %}bg-blue-500/20 text-blue-400 {% elif transaction.status == 'rejected' %}bg-red-500/20 text-red-400 {% else %}bg-gray-500/20 text-gray-400{% endif %}"
>
{% if transaction.status == 'completed' %}Complété
{% elif transaction.status == 'pending' %}En attente
{% elif transaction.status == 'approved' %}Approuvé
{% elif transaction.status == 'rejected' %}Rejeté {%
else %}{{ transaction.status }}{% endif %}
</span>
</td>
<td
class="px-6 py-4 whitespace-nowrap text-sm text-gray-400"
>
{{ transaction.created_at.strftime('%d/%m/%Y %H:%M') }}
</td>
</tr>
{% else %}
<tr>
<td colspan="6" class="px-6 py-8 text-center text-gray-500">
<i class="fas fa-inbox text-4xl mb-3"></i>
<p>Aucune transaction récente</p>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}
|