Files
Client-Billing-software/app/templates/index.html
Pooja Fulari ddf38f6bc3 updated code
2026-04-27 10:18:10 +05:30

621 lines
15 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LAXMI CIVIL ENGINEERING SERVICES PVT. LTD.</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
<style>
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: #f1f5f9;
}
/* Sidebar */
.sidebar {
width: 240px;
height: 98vh;
position: fixed;
background: linear-gradient(180deg, #0f172a, #1e293b);
padding: 20px 15px;
display: flex;
flex-direction: column;
}
.sidebar h2 {
color: white;
margin-bottom: 25px;
}
.sidebar a {
color: #cbd5f5;
padding: 10px;
text-decoration: none;
border-radius: 8px;
margin-bottom: 8px;
}
.sidebar a:hover {
background: rgba(59,130,246,0.2);
color: white;
}
.sidebar .logout {
margin-top: auto;
background: #ef4444;
color: white;
text-align: center;
}
/* Header */
.header {
margin-left: 270px;
padding: 15px;
background: white;
font-weight: 600;
box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
/* Container */
.container {
margin-left: 280px;
padding: 25px 25px;
}
/* Cards */
.cards {
display: flex;
gap: 20px;
margin-bottom: 20px;
}
.card {
flex: 1;
background: white;
padding: 20px;
border-radius: 12px;
}
/* Dropdown */
.dropdown {
position: relative;
width: 220px;
}
.dropdown-btn {
background: white;
border: 1px solid #ccc;
padding: 8px;
border-radius: 6px;
cursor: pointer;
}
.dropdown-content {
display: none;
position: absolute;
background: white;
border: 1px solid #ddd;
border-radius: 6px;
width: 100%;
max-height: 200px;
overflow-y: auto;
z-index: 999;
}
.dropdown-content label {
display: block;
padding: 6px;
}
.dropdown-content label:hover {
background: #f1f5f9;
}
/* Table
.table-container {
background: white;
padding: 15px;
border-radius: 12px;
}
table {
width: 100%;
border-collapse: collapse;
}
th {
background: #3b82f6;
color: white;
}
th, td {
padding: 10px;
}
.total-row {
background: #3b82f6;
color: white;
} */
.table-container{
background:#fff;
border-radius:14px;
box-shadow:0 10px 25px rgba(0,0,0,.05);
overflow:hidden;
}
.table-wrapper{
height:500px;
overflow:auto;
}
table{
width:100%;
min-width:1200px;
border-collapse:collapse;
font-size:14px;
}
/* Sticky Header */
thead th{
position:sticky;
top:0;
z-index:20;
background:#3b82f6;
color:#fff;
padding:14px 12px;
font-weight:600;
}
/* Body rows */
tbody td{
padding:12px;
border-bottom:1px solid #e5e7eb;
text-align:center;
white-space:nowrap;
}
tbody tr:nth-child(even){
background:#f8fafc;
}
tbody tr:hover{
background:#dbeafe;
}
/* Sticky Bottom Total Row */
tfoot td{
position:sticky;
bottom:0;
z-index:20;
background:#2563eb;
color:#fff;
font-weight:700;
padding:14px 12px;
text-align:center;
border-top:2px solid #1d4ed8;
}
.total-row td:first-child{
text-align:center;
}
/* Search */
.search-box{
position:relative;
width:320px;
margin-bottom:18px;
}
.search-box input{
width:100%;
padding:11px 14px 11px 42px;
border:1px solid #d1d5db;
border-radius:10px;
font-size:14px;
}
.search-icon{
position:absolute;
top:50%;
left:14px;
transform:translateY(-50%);
}
.cards{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
gap:25px;
margin-bottom:30px;
}
.card{
position:relative;
padding:28px;
border-radius:22px;
color:#fff;
overflow:hidden;
box-shadow:0 15px 35px rgba(0,0,0,.08);
transition:.35s ease;
}
.card:hover{
transform:translateY(-8px) scale(1.02);
box-shadow:0 20px 45px rgba(0,0,0,.15);
}
/* Gradient backgrounds */
.boq-card{
background:linear-gradient(135deg,#2563eb,#60a5fa);
}
.claimed-card{
background:linear-gradient(135deg,#059669,#34d399);
}
.balance-card{
background:linear-gradient(135deg,#7c3aed,#a78bfa);
}
/* Glass effect circle */
.card::after{
content:"";
position:absolute;
right:-35px;
top:-35px;
width:120px;
height:120px;
background:rgba(255,255,255,.12);
border-radius:50%;
}
.card-top{
display:flex;
justify-content:space-between;
align-items:center;
}
.card-label{
font-size:15px;
font-weight:500;
opacity:.9;
display:block;
margin-bottom:12px;
}
.card h2{
margin:0;
font-size:34px;
font-weight:700;
letter-spacing:.5px;
}
.card-icon{
width:62px;
height:62px;
display:flex;
align-items:center;
justify-content:center;
font-size:30px;
background:rgba(255,255,255,.18);
backdrop-filter:blur(8px);
border-radius:18px;
}
.card-footer{
margin-top:22px;
padding-top:14px;
border-top:1px solid rgba(255,255,255,.2);
font-size:14px;
opacity:.95;
}
/* Responsive */
@media(max-width:768px){
.card h2{
font-size:28px;
}
.card{
padding:22px;
}
}
/* Button */
.submit-btn {
/* margin-top: 10px; */
background: #3b82f6;
color: white;
border: none;
padding: 6px 10px;
border-radius: 6px;
}
.filter-row {
display: flex;
align-items: center;
gap: 10px; /* space between dropdown & button */
}
/* Fix button height alignment */
.submit-btn {
height: 36px;
margin-top: 0; /* remove top margin */
}
.search-box {
position: relative;
width: 300px;
margin-bottom: 15px;
}
.search-box input {
width: 100%;
padding: 10px 12px 10px 38px;
border: 1px solid #d1d5db;
border-radius: 8px;
font-size: 14px;
outline: none;
background: white;
transition: 0.3s;
}
/* Focus effect */
.search-box input:focus {
border-color: #3b82f6;
box-shadow: 0 0 6px rgba(59,130,246,0.3);
}
/* Icon */
.search-icon {
position: absolute;
top: 50%;
left: 10px;
transform: translateY(-50%);
font-size: 16px;
color: #64748b;
}
.sidebar .logo {
width: 60px;
height: auto;
margin-left: 90px;
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="sidebar">
<img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA+CAYAAAB3NHh5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4JpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS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jaUSnfYyevWyFVr6t0wY92AsVXizJJNximnfFuFbAVElGHnyNKfVothjDpr4iyjNAgqlVfbSA+GKR7gAMLEIexzA1SMTjnUA4VjZspsAMQxluGqxVqhbFMetjQcB7xk6umXChUZzyCCkFnBcIeGblI3tZ+h4if3UCJczE49EoXbLA87VcWNLBUMHLvjVamO42YZqxljf8tAcjsNOIuxyGuEMGyoLPQr72SP4Ww/T5LBURZ226rweyWUUC+I2mW9jZ3GTeCnjHk0y4fOCNl8yvHQO4/oBYbzJPIaszKmmdsiEa4R+vSkYwe0IRyxee0X4PkEoNPgPfiKQSsmDVcHaXL5HshBH2i2OsauAdXRstNgWacOcvU12WtyPl6xcf53yb01Ub7sIeQHA6zcZKJ7IiYdMth5QNNpxOJ2pZ5rJGMZcGOvbuEq4WifZSWHoD0bSZS99FvCB6QHRcdXptONOuNP0KuuN+wYiZkV/MPJg6Ck77WPLvwIMAHzX4zyhUFlrAAAAAElFTkSuQmCC"
alt="LCEPL Logo"
class="logo"
/>
<center><h2>Dashboard</h2></center>
<a href="/">Dashboard</a>
<a href="/upload_excel">Upload Excel</a>
<a href="/generate_report_page">Print Report</a>
<a href="/filter_tasks">Filter Tasks</a>
<a href="/activity_log">Activity Logs</a>
<a href="{{ url_for('main.logout') }}" class="logout">Logout</a>
</div>
<div class="header">LAXMI CIVIL ENGINEERING SERVICES PVT. LTD.</div>
<div class="container">
<div class="cards">
<div class="card boq-card">
<div class="card-top">
<div>
<span class="card-label">Total BOQ</span>
<h2 id="card-boq">0</h2>
</div>
<div class="card-icon">📊</div>
</div>
<div class="card-footer">
<span>Project Value</span>
</div>
</div>
<div class="card claimed-card">
<div class="card-top">
<div>
<span class="card-label">Total Claimed</span>
<h2 id="card-claimed">0</h2>
</div>
<div class="card-icon">💰</div>
</div>
<div class="card-footer">
<span>Amount Claimed</span>
</div>
</div>
<div class="card balance-card">
<div class="card-top">
<div>
<span class="card-label">Balance</span>
<h2 id="card-balance">0</h2>
</div>
<div class="card-icon">📈</div>
</div>
<div class="card-footer">
<span>Remaining Balance</span>
</div>
</div>
</div>
<!-- Dropdown Filter -->
<form method="get">
<div class="filter-row">
<div class="dropdown">
<div class="dropdown-btn" onclick="toggleDropdown(event)">
Select Blocks
</div>
<div id="dropdownContent" class="dropdown-content">
{% for block in blocks %}
<label>
<input type="checkbox" name="block[]" value="{{ block }}"
{% if block in selected_blocks %}checked{% endif %}>
{{ block }}
</label>
{% endfor %}
</div>
</div>
<button type="submit" class="submit-btn">Apply</button>
</div>
</form>
<br>
<div class="search-box">
<span class="search-icon">🔍</span>
<input
type="text"
id="search-input"
placeholder="Search village..."
onkeyup="filterVillages()"
>
</div>
<!-- Table -->
<div class="table-container">
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>Sr</th>
<th>Block</th>
<th>Village</th>
<th>BOQ</th>
<th>Claimed</th>
<th>To Claim</th>
<th>Cumulative</th>
<th>Variation</th>
<th>Balance</th>
</tr>
</thead>
<tbody id="village-table-body">
{% for village in villages %}
<tr>
<td>{{ loop.index }}</td>
<td>{{ village.block_name }}</td>
<td>{{ village.village_name }}</td>
<td class="amount" data-amount="{{ village.total_boq_amount }}"></td>
<td class="amount" data-amount="{{ village.prev_billed_amount }}"></td>
<td class="amount" data-amount="{{ village.to_be_claimed_amount }}"></td>
<td class="amount" data-amount="{{ village.cumulative_billed_amount }}"></td>
<td class="amount" data-amount="{{ village.total_variation_amount }}"></td>
<td class="amount"
data-amount="{{ village.total_boq_amount - village.cumulative_billed_amount - village.total_variation_amount }}">
</td>
</tr>
{% endfor %}
<tfoot>
<tr class="total-row">
<td colspan="3">TOTAL</td>
<td id="total-boq"></td>
<td id="total-billed"></td>
<td id="total-to-claim"></td>
<td id="total-cumulative"></td>
<td id="total-variation"></td>
<td id="total-balance"></td>
</tr>
</tfoot>
</tbody>
</table>
</div>
</div>
</div>
<script>
// DROPDOWN
function toggleDropdown(event) {
event.stopPropagation();
const dropdown = document.getElementById("dropdownContent");
dropdown.style.display = dropdown.style.display === "block" ? "none" : "block";
}
window.addEventListener("click", function() {
document.getElementById("dropdownContent").style.display = "none";
});
// FORMAT
function formatAmountCRL(amount) {
amount = parseFloat(amount || 0);
let sign = amount < 0 ? "-" : "";
let num = Math.abs(amount);
if (num >= 10000000) {
return sign + (num / 10000000).toFixed(2) + " Cr";
}
if (num >= 100000) {
return sign + (num / 100000).toFixed(2) + " Lakh";
}
return sign + num.toFixed(2);
}
// CALCULATIONS
window.onload = function () {
let totalBOQ=0,totalBilled=0,totalToClaim=0,totalCum=0,totalVar=0,totalBal=0;
document.querySelectorAll('.amount').forEach(cell=>{
let val=parseFloat(cell.dataset.amount||0);
cell.innerText=formatAmountCRL(val);
});
document.querySelectorAll('#village-table-body tr').forEach(row=>{
let c=row.querySelectorAll('td');
totalBOQ += parseFloat(c[3]?.dataset.amount||0);
totalBilled += parseFloat(c[4]?.dataset.amount||0);
totalToClaim += parseFloat(c[5]?.dataset.amount||0);
totalCum += parseFloat(c[6]?.dataset.amount||0);
totalVar += parseFloat(c[7]?.dataset.amount||0);
totalBal += parseFloat(c[8]?.dataset.amount||0);
});
document.getElementById('total-boq').innerText=formatAmountCRL(totalBOQ);
document.getElementById('total-billed').innerText=formatAmountCRL(totalBilled);
document.getElementById('total-to-claim').innerText=formatAmountCRL(totalToClaim);
document.getElementById('total-cumulative').innerText=formatAmountCRL(totalCum);
document.getElementById('total-variation').innerText=formatAmountCRL(totalVar);
document.getElementById('total-balance').innerText=formatAmountCRL(totalBal);
document.getElementById('card-boq').innerText=formatAmountCRL(totalBOQ);
document.getElementById('card-claimed').innerText=formatAmountCRL(totalBilled);
document.getElementById('card-balance').innerText=formatAmountCRL(totalBal);
};
// SEARCH
function filterVillages() {
let val=document.getElementById("search-input").value.toLowerCase();
document.querySelectorAll("#village-table-body tr").forEach(row=>{
let v=row.cells[2]?.innerText.toLowerCase();
row.style.display = v && v.includes(val) ? "" : "none";
});
}
</script>
</body>
</html>