File size: 37,361 Bytes
23ff214 | 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 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoanMaster ERP - Lending Management System</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.sidebar {
transition: all 0.3s ease;
}
.sidebar-collapsed {
width: 70px;
}
.sidebar-collapsed .nav-text {
display: none;
}
.sidebar-collapsed .logo-text {
display: none;
}
.sidebar-collapsed .nav-item {
justify-content: center;
}
.content {
transition: margin-left 0.3s ease;
}
.notification-badge {
position: absolute;
top: -5px;
right: -5px;
font-size: 10px;
background: #ef4444;
color: white;
border-radius: 50%;
width: 18px;
height: 18px;
display: flex;
align-items: center;
justify-content: center;
}
.chart-container {
position: relative;
height: 300px;
}
.dropdown:hover .dropdown-menu {
display: block;
}
.risk-high { background-color: #fee2e2; }
.risk-medium { background-color: #fef3c7; }
.risk-low { background-color: #dcfce7; }
.status-approved { background-color: #dcfce7; color: #166534; }
.status-pending { background-color: #fef3c7; color: #92400e; }
.status-rejected { background-color: #fee2e2; color: #991b1b; }
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-blue-800 text-white w-64 flex flex-col">
<!-- Logo -->
<div class="p-4 flex items-center space-x-3 border-b border-blue-700">
<div class="bg-white p-2 rounded-lg">
<i class="fas fa-hand-holding-usd text-blue-800 text-xl"></i>
</div>
<span class="logo-text text-xl font-bold">LoanMaster ERP</span>
</div>
<!-- User Profile -->
<div class="p-4 flex items-center space-x-3 border-b border-blue-700">
<div class="relative">
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User" class="w-10 h-10 rounded-full">
<span class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white"></span>
</div>
<div class="flex flex-col">
<span class="font-medium">Robert Johnson</span>
<span class="text-xs text-blue-300">Loan Officer</span>
</div>
</div>
<!-- Navigation -->
<nav class="flex-1 overflow-y-auto">
<ul class="space-y-1 p-2">
<li>
<a href="#" class="nav-item flex items-center p-3 space-x-3 rounded-lg bg-blue-900">
<i class="fas fa-tachometer-alt"></i>
<span class="nav-text">Dashboard</span>
</a>
</li>
<li>
<a href="#" class="nav-item flex items-center p-3 space-x-3 rounded-lg hover:bg-blue-700">
<i class="fas fa-user-plus"></i>
<span class="nav-text">New Applications</span>
</a>
</li>
<li>
<a href="#" class="nav-item flex items-center p-3 space-x-3 rounded-lg hover:bg-blue-700">
<i class="fas fa-clipboard-list"></i>
<span class="nav-text">Loan Portfolio</span>
</a>
</li>
<li>
<a href="#" class="nav-item flex items-center p-3 space-x-3 rounded-lg hover:bg-blue-700">
<i class="fas fa-users"></i>
<span class="nav-text">Customers</span>
</a>
</li>
<li>
<a href="#" class="nav-item flex items-center p-3 space-x-3 rounded-lg hover:bg-blue-700">
<i class="fas fa-file-invoice-dollar"></i>
<span class="nav-text">Payments</span>
</a>
</li>
<li>
<a href="#" class="nav-item flex items-center p-3 space-x-3 rounded-lg hover:bg-blue-700">
<i class="fas fa-chart-line"></i>
<span class="nav-text">Reports</span>
</a>
</li>
<li>
<a href="#" class="nav-item flex items-center p-3 space-x-3 rounded-lg hover:bg-blue-700">
<i class="fas fa-cog"></i>
<span class="nav-text">Settings</span>
</a>
</li>
<li>
<a href="#" class="nav-item flex items-center p-3 space-x-3 rounded-lg hover:bg-blue-700">
<i class="fas fa-code"></i>
<span class="nav-text">VB Integration</span>
</a>
</li>
</ul>
</nav>
<!-- Collapse Button -->
<div class="p-4 border-t border-blue-700">
<button id="toggleSidebar" class="w-full flex items-center justify-center p-2 rounded-lg hover:bg-blue-700">
<i class="fas fa-chevron-left"></i>
</button>
</div>
</div>
<!-- Main Content -->
<div class="content flex-1 flex flex-col overflow-hidden">
<!-- Top Navigation -->
<header class="bg-white shadow-sm">
<div class="flex items-center justify-between px-6 py-3">
<!-- Search -->
<div class="flex items-center space-x-4">
<button id="mobileMenuButton" class="md:hidden text-gray-500">
<i class="fas fa-bars"></i>
</button>
<div class="relative">
<input type="text" placeholder="Search loans, customers..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
</div>
<!-- Notifications & User -->
<div class="flex items-center space-x-4">
<div class="relative">
<button class="p-2 rounded-full hover:bg-gray-100">
<i class="fas fa-bell text-gray-600"></i>
<span class="notification-badge">3</span>
</button>
</div>
<div class="relative">
<button class="p-2 rounded-full hover:bg-gray-100">
<i class="fas fa-envelope text-gray-600"></i>
<span class="notification-badge">2</span>
</button>
</div>
<div class="dropdown relative">
<button class="flex items-center space-x-2 focus:outline-none">
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User" class="w-8 h-8 rounded-full">
<span class="hidden md:inline">Robert J.</span>
<i class="fas fa-chevron-down text-xs"></i>
</button>
<div class="dropdown-menu absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 hidden">
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Profile</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Settings</a>
<div class="border-t border-gray-200"></div>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Sign out</a>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content Area -->
<main class="flex-1 overflow-y-auto p-6">
<!-- Page Header -->
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-bold text-gray-800">Lending Management Dashboard</h1>
<div class="flex space-x-2">
<button onclick="showVBIntegrationModal()" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 flex items-center space-x-2">
<i class="fas fa-code"></i>
<span>VB Integration</span>
</button>
<button class="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50 flex items-center space-x-2">
<i class="fas fa-filter"></i>
<span>Filter</span>
</button>
</div>
</div>
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">Total Loan Portfolio</p>
<h3 class="text-2xl font-bold">$4,563,892</h3>
<p class="text-green-500 text-sm mt-1">
<i class="fas fa-arrow-up"></i> 8.2% from last quarter
</p>
</div>
<div class="p-3 rounded-full bg-blue-100 text-blue-600">
<i class="fas fa-hand-holding-usd text-xl"></i>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">New Applications</p>
<h3 class="text-2xl font-bold">42</h3>
<p class="text-red-500 text-sm mt-1">
<i class="fas fa-arrow-down"></i> 3.5% from last month
</p>
</div>
<div class="p-3 rounded-full bg-green-100 text-green-600">
<i class="fas fa-file-signature text-xl"></i>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">Delinquency Rate</p>
<h3 class="text-2xl font-bold">2.8%</h3>
<p class="text-green-500 text-sm mt-1">
<i class="fas fa-arrow-down"></i> 1.2% from last quarter
</p>
</div>
<div class="p-3 rounded-full bg-yellow-100 text-yellow-600">
<i class="fas fa-exclamation-triangle text-xl"></i>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">Active Customers</p>
<h3 class="text-2xl font-bold">1,243</h3>
<p class="text-green-500 text-sm mt-1">
<i class="fas fa-arrow-up"></i> 5.3% from last quarter
</p>
</div>
<div class="p-3 rounded-full bg-purple-100 text-purple-600">
<i class="fas fa-users text-xl"></i>
</div>
</div>
</div>
</div>
<!-- Charts Row -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<!-- Loan Portfolio Chart -->
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between items-center mb-4">
<h3 class="font-semibold text-lg">Loan Portfolio Growth</h3>
<select class="border rounded px-3 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
<option>This Year</option>
<option>Last Year</option>
<option>Last 5 Years</option>
</select>
</div>
<div class="chart-container">
<canvas id="portfolioChart"></canvas>
</div>
</div>
<!-- Loan Types Distribution -->
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between items-center mb-4">
<h3 class="font-semibold text-lg">Loan Types Distribution</h3>
<select class="border rounded px-3 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
<option>Current Portfolio</option>
<option>New Applications</option>
</select>
</div>
<div class="chart-container">
<canvas id="loanTypeChart"></canvas>
</div>
</div>
</div>
<!-- Recent Applications & VB Integration -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Recent Applications -->
<div class="lg:col-span-2 bg-white p-6 rounded-lg shadow">
<h3 class="font-semibold text-lg mb-4">Recent Loan Applications</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Application #</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Customer</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Risk</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-blue-600">LN-2023-0042</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Michael Brown</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$25,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Personal</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full risk-medium">Medium</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full status-pending">Pending</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-blue-600">LN-2023-0041</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Sarah Johnson</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$15,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Auto</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full risk-low">Low</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full status-approved">Approved</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-blue-600">LN-2023-0040</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">David Wilson</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$150,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Mortgage</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full risk-high">High</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full status-rejected">Rejected</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-blue-600">LN-2023-0039</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Emily Davis</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">$35,000</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Business</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full risk-medium">Medium</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full status-approved">Approved</span>
</td>
</tr>
</tbody>
</table>
</div>
<button class="mt-4 text-blue-600 hover:text-blue-800 text-sm font-medium">
View all applications <i class="fas fa-arrow-right ml-1"></i>
</button>
</div>
<!-- VB Integration Panel -->
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between items-center mb-4">
<h3 class="font-semibold text-lg">Visual Basic Integration</h3>
<button onclick="showVBIntegrationModal()" class="text-blue-600 hover:text-blue-800 text-sm font-medium">
<i class="fas fa-plus"></i> New Integration
</button>
</div>
<div class="space-y-3">
<div class="p-3 bg-gray-50 rounded-lg">
<div class="flex items-center justify-between mb-2">
<span class="font-medium">Loan Calculator</span>
<span class="text-xs px-2 py-1 bg-green-100 text-green-800 rounded-full">Active</span>
</div>
<p class="text-xs text-gray-500 mb-2">Calculates loan payments and amortization</p>
<div class="flex space-x-2">
<button class="text-xs px-2 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200">
<i class="fas fa-play"></i> Run
</button>
<button class="text-xs px-2 py-1 bg-gray-100 text-gray-800 rounded hover:bg-gray-200">
<i class="fas fa-edit"></i> Edit
</button>
</div>
</div>
<div class="p-3 bg-gray-50 rounded-lg">
<div class="flex items-center justify-between mb-2">
<span class="font-medium">Risk Assessment</span>
<span class="text-xs px-2 py-1 bg-green-100 text-green-800 rounded-full">Active</span>
</div>
<p class="text-xs text-gray-500 mb-2">Analyzes borrower risk factors</p>
<div class="flex space-x-2">
<button class="text-xs px-2 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200">
<i class="fas fa-play"></i> Run
</button>
<button class="text-xs px-2 py-1 bg-gray-100 text-gray-800 rounded hover:bg-gray-200">
<i class="fas fa-edit"></i> Edit
</button>
</div>
</div>
<div class="p-3 bg-gray-50 rounded-lg">
<div class="flex items-center justify-between mb-2">
<span class="font-medium">Report Generator</span>
<span class="text-xs px-2 py-1 bg-yellow-100 text-yellow-800 rounded-full">Pending</span>
</div>
<p class="text-xs text-gray-500 mb-2">Generates regulatory reports</p>
<div class="flex space-x-2">
<button class="text-xs px-2 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200">
<i class="fas fa-play"></i> Run
</button>
<button class="text-xs px-2 py-1 bg-gray-100 text-gray-800 rounded hover:bg-gray-200">
<i class="fas fa-edit"></i> Edit
</button>
</div>
</div>
</div>
<button class="mt-4 text-blue-600 hover:text-blue-800 text-sm font-medium">
View all integrations <i class="fas fa-arrow-right ml-1"></i>
</button>
</div>
</div>
</main>
</div>
</div>
<!-- VB Integration Modal -->
<div id="vbIntegrationModal" class="fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full hidden z-50">
<div class="relative top-20 mx-auto p-5 border w-1/2 shadow-lg rounded-md bg-white">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-bold">Visual Basic Integration</h3>
<button onclick="hideVBIntegrationModal()" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="vbFunction">
VB Function Name
</label>
<input id="vbFunction" type="text" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="CalculateLoanPayment">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="vbParameters">
Parameters (JSON format)
</label>
<textarea id="vbParameters" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline h-24" placeholder='{"principal": 10000, "rate": 5.5, "term": 60}'></textarea>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="vbDescription">
Description
</label>
<textarea id="vbDescription" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="Calculates monthly loan payment amount"></textarea>
</div>
<div class="flex justify-end space-x-3">
<button onclick="hideVBIntegrationModal()" class="px-4 py-2 bg-gray-300 text-gray-800 rounded hover:bg-gray-400">
Cancel
</button>
<button onclick="runVBIntegration()" class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">
<i class="fas fa-play mr-2"></i> Run VB Function
</button>
<button onclick="saveVBIntegration()" class="px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700">
<i class="fas fa-save mr-2"></i> Save
</button>
</div>
<div id="vbOutput" class="mt-4 p-3 bg-gray-100 rounded hidden">
<h4 class="font-bold mb-2">Output:</h4>
<pre id="vbOutputContent" class="text-sm"></pre>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Toggle sidebar
const toggleSidebar = document.getElementById('toggleSidebar');
const sidebar = document.querySelector('.sidebar');
const content = document.querySelector('.content');
toggleSidebar.addEventListener('click', () => {
sidebar.classList.toggle('sidebar-collapsed');
content.classList.toggle('ml-64');
toggleSidebar.innerHTML = sidebar.classList.contains('sidebar-collapsed')
? '<i class="fas fa-chevron-right"></i>'
: '<i class="fas fa-chevron-left"></i>';
});
// Mobile menu toggle
const mobileMenuButton = document.getElementById('mobileMenuButton');
mobileMenuButton.addEventListener('click', () => {
sidebar.classList.toggle('hidden');
});
// Dropdown menus
document.querySelectorAll('.dropdown').forEach(dropdown => {
dropdown.addEventListener('click', (e) => {
e.stopPropagation();
const menu = dropdown.querySelector('.dropdown-menu');
menu.classList.toggle('hidden');
});
});
// Close dropdown when clicking outside
document.addEventListener('click', () => {
document.querySelectorAll('.dropdown-menu').forEach(menu => {
menu.classList.add('hidden');
});
});
// Charts
// Portfolio Chart
const portfolioCtx = document.getElementById('portfolioChart').getContext('2d');
const portfolioChart = new Chart(portfolioCtx, {
type: 'line',
data: {
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
datasets: [{
label: 'Loan Portfolio',
data: [3200000, 3800000, 4200000, 4560000],
borderColor: '#3B82F6',
backgroundColor: 'rgba(59, 130, 246, 0.1)',
fill: true,
tension: 0.4
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: false,
grid: {
drawBorder: false
},
ticks: {
callback: function(value) {
return '$' + (value / 1000000) + 'M';
}
}
},
x: {
grid: {
display: false
}
}
}
}
});
// Loan Type Chart
const loanTypeCtx = document.getElementById('loanTypeChart').getContext('2d');
const loanTypeChart = new Chart(loanTypeCtx, {
type: 'doughnut',
data: {
labels: ['Mortgage', 'Auto', 'Personal', 'Business', 'Other'],
datasets: [{
data: [45, 25, 15, 10, 5],
backgroundColor: [
'#3B82F6',
'#10B981',
'#6366F1',
'#F59E0B',
'#EF4444'
],
borderWidth: 0
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right'
}
},
cutout: '70%'
}
});
// VB Integration Functions
function showVBIntegrationModal() {
document.getElementById('vbIntegrationModal').classList.remove('hidden');
}
function hideVBIntegrationModal() {
document.getElementById('vbIntegrationModal').classList.add('hidden');
}
function runVBIntegration() {
const functionName = document.getElementById('vbFunction').value;
const params = document.getElementById('vbParameters').value;
// This is where you would normally call your VB code
// For demo purposes, we'll simulate a response
let output;
try {
const parsedParams = JSON.parse(params);
if (functionName === 'CalculateLoanPayment') {
// Simulate loan payment calculation
const principal = parsedParams.principal || 10000;
const rate = parsedParams.rate || 5.0;
const term = parsedParams.term || 60;
const monthlyRate = rate / 100 / 12;
const payment = principal * monthlyRate * Math.pow(1 + monthlyRate, term) / (Math.pow(1 + monthlyRate, term) - 1);
output = {
status: 'success',
result: {
monthlyPayment: payment.toFixed(2),
totalInterest: (payment * term - principal).toFixed(2),
totalPayment: (payment * term).toFixed(2)
}
};
} else if (functionName === 'AssessRisk') {
// Simulate risk assessment
const creditScore = parsedParams.creditScore || 700;
const dti = parsedParams.dti || 0.35;
let riskLevel;
if (creditScore < 600 || dti > 0.5) {
riskLevel = 'High';
} else if (creditScore < 700 || dti > 0.4) {
riskLevel = 'Medium';
} else {
riskLevel = 'Low';
}
output = {
status: 'success',
result: {
riskLevel: riskLevel,
approvalRecommendation: riskLevel === 'High' ? 'Reject' : 'Approve',
conditions: riskLevel === 'Medium' ? 'Higher interest rate recommended' : 'Standard terms'
}
};
} else {
output = {
status: 'error',
message: 'Function not recognized'
};
}
} catch (e) {
output = {
status: 'error',
message: 'Invalid parameters: ' + e.message
};
}
document.getElementById('vbOutputContent').textContent = JSON.stringify(output, null, 2);
document.getElementById('vbOutput').classList.remove('hidden');
}
function saveVBIntegration() {
const functionName = document.getElementById('vbFunction').value;
const params = document.getElementById('vbParameters').value;
const description = document.getElementById('vbDescription').value;
// In a real application, this would save to your database
alert(`VB Integration saved:\nFunction: ${functionName}\nDescription: ${description}`);
hideVBIntegrationModal();
}
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=AV1925/avcom" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |