<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-1074964965522467583</atom:id><lastBuildDate>Tue, 07 Apr 2026 11:11:48 +0000</lastBuildDate><category>Trending</category><category>PWD Working</category><category>Roads</category><category>Software</category><category>Bridge</category><category>Building</category><category>Design calculations</category><category>Construction Procedure</category><category>Estimate Preparation</category><category>Drawings</category><category>Earth retaining structures</category><category>Programming</category><category>Tender</category><category>Survey</category><category>Guidelines Books Type plan GR&#39;s Circulars</category><category>Formulas</category><category>RTI</category><category>Structural Analysis</category><category>SSR</category><title>Useful for Civil Engineers of P.W.D. , Yogendra Borse</title><description>Day to Day working Calculations and Procedures and Methods in Public Works Department, Problems and Their solutions via Discussions or from Theory books.</description><link>https://www.yogipwd.com/</link><managingEditor>noreply@blogger.com (Yogendra)</managingEditor><generator>Blogger</generator><openSearch:totalResults>354</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-716781961750643453</guid><pubDate>Sat, 04 Apr 2026 09:08:00 +0000</pubDate><atom:updated>2026-04-07T10:20:08.358+05:30</atom:updated><title>Land acquisition data entry</title><description>&lt;script src=&quot;https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;mermaid.initialize({ startOnLoad: false, theme: &#39;forest&#39; });&lt;/script&gt;

&lt;div id=&quot;land-acquisition-app&quot;&gt;
    &lt;style&gt;
        /* Scoped CSS for Blogger */
        #land-acquisition-app {
            font-family: &#39;Segoe UI&#39;, Tahoma, Geneva, Verdana, sans-serif;
            color: #333;
            max-width: 1000px;
            margin: 20px auto;
            line-height: 1.6;
        }
        #land-acquisition-app .card {
            background: #ffffff;
            border: 1px solid #e0e0e0;
            padding: 20px;
            margin-bottom: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }
        #land-acquisition-app .grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 15px;
        }
        #land-acquisition-app input, #land-acquisition-app select {
            width: 100%;
            padding: 8px;
            margin: 5px 0;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
        }
        #land-acquisition-app button {
            background-color: #34495e;
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
            transition: 0.3s;
        }
        #land-acquisition-app button:hover { background-color: #2c3e50; }
        #land-acquisition-app .owner-row {
            background: #f1f3f4;
            padding: 10px;
            border-radius: 5px;
            margin-bottom: 8px;
        }
        #land-acquisition-app table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
            background: white;
        }
        #land-acquisition-app th, #land-acquisition-app td {
            border: 1px solid #ddd;
            padding: 12px;
            text-align: left;
            font-size: 13px;
        }
        #land-acquisition-app th { background: #34495e; color: white; }
        #land-acquisition-app .btn-group { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
        #mermaid-container {
            background: #fff;
            padding: 10px;
            border-radius: 8px;
            min-height: 200px;
            overflow-x: auto;
        }
    &lt;/style&gt;

&lt;div class=&quot;card&quot; style=&quot;border-bottom: 3px solid #2980b9; margin-bottom: 20px;&quot;&gt;
    &lt;h3&gt;Project &amp; Village Configuration&lt;/h3&gt;

    &lt;!-- IMPORT BUTTON --&gt;
    &lt;div style=&quot;margin-bottom:10px;&quot;&gt;
        &lt;input type=&quot;file&quot; id=&quot;importFile&quot; accept=&quot;.json&quot; onchange=&quot;importJSON(event)&quot; style=&quot;display:none;&quot;&gt;
        &lt;button onclick=&quot;document.getElementById(&#39;importFile&#39;).click()&quot; 
            style=&quot;background:#8e44ad; color:white; border:none; padding:10px 15px; border-radius:4px;&quot;&gt;
            Import Backup
        &lt;/button&gt;
    &lt;/div&gt;

    &lt;div class=&quot;grid&quot; style=&quot;display:grid; grid-template-columns:1fr 1fr; gap:20px;&quot;&gt;
        
        &lt;!-- PROJECT --&gt;
        &lt;div&gt;
            &lt;label&gt;&lt;strong&gt;1A. Select Active Project:&lt;/strong&gt;&lt;/label&gt;
            &lt;select id=&quot;projectSelect&quot; onchange=&quot;loadProjectData()&quot; style=&quot;width: 100%; padding: 8px; margin-bottom:10px;&quot;&gt;
                &lt;option value=&quot;&quot;&gt;-- Select Project --&lt;/option&gt;
            &lt;/select&gt;

            &lt;div style=&quot;display:flex; gap:5px;&quot;&gt;
                &lt;input type=&quot;text&quot; id=&quot;newProjectName&quot; placeholder=&quot;New Project Name&quot; style=&quot;flex:1; padding:8px;&quot;&gt;
                &lt;button onclick=&quot;createNewProject()&quot; style=&quot;background:#2ecc71; color:white; border:none; padding:8px 12px; border-radius:4px;&quot;&gt;
                    Create
                &lt;/button&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        &lt;!-- VILLAGE --&gt;
        &lt;div&gt;
            &lt;label&gt;&lt;strong&gt;1B. Manage Villages:&lt;/strong&gt;&lt;/label&gt;

            &lt;div style=&quot;display:flex; gap:5px; margin-bottom:10px;&quot;&gt;
                &lt;input type=&quot;text&quot; id=&quot;villageInput&quot; placeholder=&quot;Add Village Name&quot; style=&quot;flex:1; padding:8px;&quot;&gt;
                &lt;button onclick=&quot;addVillageToProject()&quot; style=&quot;background:#3498db; color:white; border:none; padding:8px 12px; border-radius:4px;&quot;&gt;
                    + Add
                &lt;/button&gt;
            &lt;/div&gt;

            &lt;label&gt;&lt;strong&gt;1C. Working Village:&lt;/strong&gt;&lt;/label&gt;
            &lt;select id=&quot;activeVillageSelect&quot; onchange=&quot;changeWorkingVillage()&quot; 
                style=&quot;width: 100%; padding: 8px; border: 2px solid #3498db; font-weight:bold;&quot;&gt;
                &lt;option value=&quot;&quot;&gt;-- Select Village to Start Entry --&lt;/option&gt;
            &lt;/select&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;!-- ENTRY SECTION --&gt;
&lt;div id=&quot;entrySection&quot; style=&quot;display:none;&quot;&gt;
    &lt;div class=&quot;card&quot;&gt;
        
        &lt;div style=&quot;display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;&quot;&gt;
            &lt;h3&gt;2. Gat &amp; Owner Details&lt;/h3&gt;
            &lt;span id=&quot;activeVillageLabel&quot; 
                style=&quot;color:white; font-weight:bold; background:#27ae60; padding:4px 12px; border-radius:20px;&quot;&gt;
            &lt;/span&gt;
        &lt;/div&gt;

        &lt;div id=&quot;gatContainer&quot;&gt;&lt;/div&gt;

        &lt;div style=&quot;display:flex; gap:10px; margin-top:20px;&quot;&gt;
            &lt;button onclick=&quot;addGatRow()&quot; 
                style=&quot;flex:1; background:#7f8c8d; color:white; border:none; padding:12px; border-radius:4px;&quot;&gt;
                + Add Another Gat
            &lt;/button&gt;

            &lt;button onclick=&quot;saveEntry()&quot; 
                style=&quot;flex:2; background:#27ae60; color:white; border:none; padding:12px; font-size:16px; border-radius:4px;&quot;&gt;
                SAVE DATA
            &lt;/button&gt;
        &lt;/div&gt;

    &lt;/div&gt;
&lt;/div&gt;

&lt;!-- SUMMARY --&gt;
&lt;div id=&quot;dashboardSummary&quot; 
    style=&quot;font-weight:bold; font-size:1.2em; text-align:right; margin:15px 0; color:#2c3e50; padding:10px; background:#f8f9fa; border-radius:4px; border-right:5px solid #27ae60;&quot;&gt;
    Total Project Value: ₹0
&lt;/div&gt;

&lt;!-- ACTION BUTTONS --&gt;
&lt;div class=&quot;btn-group&quot; style=&quot;display:flex; gap:10px; margin-bottom:20px;&quot;&gt;
    &lt;button onclick=&quot;exportCSV()&quot; 
        style=&quot;background:#e67e22; color:white; border:none; padding:12px; border-radius:4px; flex:1;&quot;&gt;
        Download Excel
    &lt;/button&gt;

    &lt;button onclick=&quot;exportJSON()&quot; 
        style=&quot;background:#34495e; color:white; border:none; padding:12px; border-radius:4px; flex:1;&quot;&gt;
        Backup
    &lt;/button&gt;

    &lt;button onclick=&quot;resetForm()&quot; 
        style=&quot;background:#95a5a6; color:white; border:none; padding:12px; border-radius:4px; flex:1;&quot;&gt;
        Clear
    &lt;/button&gt;
&lt;/div&gt;

&lt;!-- TABLE --&gt;
&lt;div class=&quot;card&quot;&gt;
    &lt;h3&gt;Master Project Land Records&lt;/h3&gt;

    &lt;div style=&quot;overflow-x:auto;&quot;&gt;
        &lt;table style=&quot;width:100%; border-collapse:collapse;&quot;&gt;
            &lt;thead&gt;
                &lt;tr style=&quot;background:#2c3e50; color:white;&quot;&gt;
                    &lt;th style=&quot;padding:10px;&quot;&gt;Village&lt;/th&gt;
                    &lt;th style=&quot;padding:10px;&quot;&gt;Gat No.&lt;/th&gt;
                    &lt;th style=&quot;padding:10px;&quot;&gt;Owner&lt;/th&gt;
                    &lt;th style=&quot;padding:10px;&quot;&gt;Owned Area&lt;/th&gt;
                    &lt;th style=&quot;padding:10px;&quot;&gt;Acquired Area&lt;/th&gt;
                    &lt;th style=&quot;padding:10px;&quot;&gt;Payable&lt;/th&gt;
                    &lt;th style=&quot;padding:10px;&quot;&gt;Status&lt;/th&gt; &lt;!-- ✅ ADDED --&gt;
                    &lt;th style=&quot;padding:10px;&quot;&gt;Action&lt;/th&gt;
                &lt;/tr&gt;
            &lt;/thead&gt;
            &lt;tbody id=&quot;tableBody&quot;&gt;&lt;/tbody&gt;
        &lt;/table&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;!-- VILLAGE SUMMARY --&gt;
&lt;div class=&quot;card&quot;&gt;
    &lt;h3&gt;Village-wise Land Category Summary&lt;/h3&gt;

    &lt;button onclick=&quot;generateVillageSummary()&quot; 
        style=&quot;background:#8e44ad;color:white;border:none;padding:10px 15px;margin-bottom:10px;border-radius:4px;&quot;&gt;
        Generate Summary
    &lt;/button&gt;

    &lt;table style=&quot;width:100%; border-collapse:collapse;&quot;&gt;
        &lt;thead&gt;
            &lt;tr style=&quot;background:#34495e;color:white;&quot;&gt;
                &lt;th&gt;Village&lt;/th&gt;
                &lt;th&gt;Class-1 Area&lt;/th&gt;
                &lt;th&gt;Class-2 Area&lt;/th&gt;
                &lt;th&gt;PESA Area&lt;/th&gt;
                &lt;th&gt;Total Area&lt;/th&gt;
            &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody id=&quot;villageSummaryBody&quot;&gt;&lt;/tbody&gt;
    &lt;/table&gt;
&lt;/div&gt;

&lt;!-- MERMAID --&gt;
&lt;div class=&quot;card&quot;&gt;
    &lt;h3&gt;Project Hierarchy View&lt;/h3&gt;

    &lt;button onclick=&quot;generateMermaid()&quot; 
        style=&quot;background:#16a085;color:white;border:none;padding:10px 15px;border-radius:4px;margin-bottom:10px;&quot;&gt;
        Generate Diagram
    &lt;/button&gt;

    &lt;div class=&quot;mermaid&quot; id=&quot;mermaidChart&quot; style=&quot;overflow:auto;&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;button onclick=&quot;exportMermaidA2()&quot; 
    style=&quot;background:#c0392b;color:white;border:none;padding:10px 15px;border-radius:4px;&quot;&gt;
    Export A2 Print
&lt;/button&gt;

  
  &lt;div style=&quot;font-family:Segoe UI, Arial; line-height:1.6; max-width:900px; margin:auto; color:#2c3e50;&quot;&gt;

    &lt;h1 style=&quot;color:#2c3e50; border-bottom:3px solid #3498db; padding-bottom:5px;&quot;&gt;
        Land Acquisition Management Tool – Complete Guide
    &lt;/h1&gt;

    &lt;p&gt;
        The &lt;b&gt;Land Acquisition Management Tool&lt;/b&gt; is a powerful web-based application designed to manage,
        track, and visualize land acquisition data at project level. It is especially useful for
        engineers, project managers, and government officials handling large-scale infrastructure projects.
    &lt;/p&gt;

    &lt;h2 style=&quot;color:#2980b9;&quot;&gt;1. Key Features&lt;/h2&gt;
    &lt;ul&gt;
        &lt;li&gt;📌 Project-wise and village-wise data management&lt;/li&gt;
        &lt;li&gt;📌 Gat-level land acquisition tracking&lt;/li&gt;
        &lt;li&gt;📌 Owner-wise financial and legal record management&lt;/li&gt;
        &lt;li&gt;📌 Excel (CSV) export with detailed columns&lt;/li&gt;
        &lt;li&gt;📌 JSON backup &amp; restore functionality&lt;/li&gt;
        &lt;li&gt;📌 Mermaid-based hierarchy visualization&lt;/li&gt;
        &lt;li&gt;📌 A2 size printable diagram export&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h2 style=&quot;color:#2980b9;&quot;&gt;2. Workflow Overview&lt;/h2&gt;
    &lt;ol&gt;
        &lt;li&gt;Create a new project&lt;/li&gt;
        &lt;li&gt;Add villages under the project&lt;/li&gt;
        &lt;li&gt;Select a working village&lt;/li&gt;
        &lt;li&gt;Enter Gat details&lt;/li&gt;
        &lt;li&gt;Add owner-wise land and financial data&lt;/li&gt;
        &lt;li&gt;Save and manage records&lt;/li&gt;
    &lt;/ol&gt;

    &lt;h2 style=&quot;color:#2980b9;&quot;&gt;3. Data Structure&lt;/h2&gt;

    &lt;h3&gt;📍 Gat Level Data&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Gat Number&lt;/li&gt;
        &lt;li&gt;Land Category (Class-1 / Class-2 / PESA)&lt;/li&gt;
        &lt;li&gt;JMS Status&lt;/li&gt;
        &lt;li&gt;Valuation Status&lt;/li&gt;
        &lt;li&gt;Legal Status&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;👤 Owner Level Data&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Owner Name &amp; Type&lt;/li&gt;
        &lt;li&gt;Owned Area &amp; Acquired Area&lt;/li&gt;
        &lt;li&gt;Payable Amount (Manual Entry)&lt;/li&gt;
        &lt;li&gt;Amount Paid &amp; Balance&lt;/li&gt;
        &lt;li&gt;Draft Sale Deed&lt;/li&gt;
        &lt;li&gt;Registration Fee, Stamp Duty, Paging Fee, Misc Expenses&lt;/li&gt;
        &lt;li&gt;Land Acquisition Cost&lt;/li&gt;
        &lt;li&gt;Payment Date&lt;/li&gt;
        &lt;li&gt;Aadhar &amp; PAN Details&lt;/li&gt;
        &lt;li&gt;Bank Details (Name, IFSC, Account Number)&lt;/li&gt;
        &lt;li&gt;Remarks&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h2 style=&quot;color:#2980b9;&quot;&gt;4. Excel Export Columns&lt;/h2&gt;

    &lt;p&gt;The tool exports complete project data into Excel (CSV) format with the following fields:&lt;/p&gt;

    &lt;div style=&quot;overflow-x:auto;&quot;&gt;
        &lt;table style=&quot;border-collapse:collapse; width:100%;&quot;&gt;
            &lt;tr style=&quot;background:#34495e; color:white;&quot;&gt;
                &lt;th style=&quot;padding:8px;&quot;&gt;Field&lt;/th&gt;
                &lt;th style=&quot;padding:8px;&quot;&gt;Description&lt;/th&gt;
            &lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Village&lt;/td&gt;&lt;td&gt;Village name&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Gat No&lt;/td&gt;&lt;td&gt;Survey/Gat number&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Owner Name&lt;/td&gt;&lt;td&gt;Land owner name&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Category&lt;/td&gt;&lt;td&gt;Land classification&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;JMS Status&lt;/td&gt;&lt;td&gt;Joint Measurement Status&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Valuation Status&lt;/td&gt;&lt;td&gt;Award/valuation progress&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Legal Status&lt;/td&gt;&lt;td&gt;Title verification&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Draft Sale Deed&lt;/td&gt;&lt;td&gt;Document reference&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Registration Fee&lt;/td&gt;&lt;td&gt;Registration cost&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Stamp Duty&lt;/td&gt;&lt;td&gt;Stamp charges&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Paging Fee&lt;/td&gt;&lt;td&gt;Documentation charges&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Miscellaneous&lt;/td&gt;&lt;td&gt;Other expenses&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Land Acquisition Cost&lt;/td&gt;&lt;td&gt;Total cost&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Amount Paid Date&lt;/td&gt;&lt;td&gt;Payment date&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Aadhar Number&lt;/td&gt;&lt;td&gt;Identity proof&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;PAN Number&lt;/td&gt;&lt;td&gt;Tax ID&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Bank Details&lt;/td&gt;&lt;td&gt;Payment account details&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Remarks&lt;/td&gt;&lt;td&gt;Additional notes&lt;/td&gt;&lt;/tr&gt;
        &lt;/table&gt;
    &lt;/div&gt;

    &lt;h2 style=&quot;color:#2980b9;&quot;&gt;5. Mermaid Hierarchy Visualization&lt;/h2&gt;

    &lt;p&gt;
        The tool generates a &lt;b&gt;visual flowchart&lt;/b&gt; using Mermaid.js representing:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;🏗️ Project&lt;/li&gt;
        &lt;li&gt;🏡 Villages&lt;/li&gt;
        &lt;li&gt;📍 Gat Numbers&lt;/li&gt;
        &lt;li&gt;👤 Owner Details&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        Each node includes financial, legal, and identity details, making it extremely useful
        for presentations and reporting.
    &lt;/p&gt;

    &lt;h3&gt;🖨️ A2 Print Export&lt;/h3&gt;
    &lt;p&gt;
        The diagram can be exported in &lt;b&gt;A2 size SVG format&lt;/b&gt;, allowing full-scale printing
        for large datasets such as highway or irrigation projects.
    &lt;/p&gt;

    &lt;h2 style=&quot;color:#2980b9;&quot;&gt;6. Village-wise Summary&lt;/h2&gt;

    &lt;p&gt;
        The tool automatically generates summary reports based on land category:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;Class-1 Area&lt;/li&gt;
        &lt;li&gt;Class-2 Area&lt;/li&gt;
        &lt;li&gt;PESA Area&lt;/li&gt;
        &lt;li&gt;Total Acquired Area&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h2 style=&quot;color:#2980b9;&quot;&gt;7. Backup &amp; Restore&lt;/h2&gt;

    &lt;ul&gt;
        &lt;li&gt;Export full project as JSON backup&lt;/li&gt;
        &lt;li&gt;Import data anytime&lt;/li&gt;
        &lt;li&gt;Safe data storage using IndexedDB (browser-based)&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h2 style=&quot;color:#2980b9;&quot;&gt;8. Advantages&lt;/h2&gt;

    &lt;ul&gt;
        &lt;li&gt;✔ No server required (works offline)&lt;/li&gt;
        &lt;li&gt;✔ Fast and responsive&lt;/li&gt;
        &lt;li&gt;✔ Highly customizable&lt;/li&gt;
        &lt;li&gt;✔ Ideal for government and EPC projects&lt;/li&gt;
        &lt;li&gt;✔ Scalable for thousands of records&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h2 style=&quot;color:#2980b9;&quot;&gt;9. Conclusion&lt;/h2&gt;

    &lt;p&gt;
        This Land Acquisition Tool provides a digital solution for managing
        complex land records, financial tracking, and legal status in a structured manner.
        With visualization and export features, it improves decision-making and reporting efficiency.
    &lt;/p&gt;

&lt;/div&gt;

&lt;script&gt;
/* ================= DATABASE ================= */
let db;
let editingIndex = null;

const request = indexedDB.open(&quot;LandAcqBloggerDB&quot;, 1);

request.onupgradeneeded = (e) =&gt; {
    db = e.target.result;
    if (!db.objectStoreNames.contains(&quot;projects&quot;)) {
        db.createObjectStore(&quot;projects&quot;, { keyPath: &quot;id&quot;, autoIncrement: true });
    }
};

request.onsuccess = (e) =&gt; { 
    db = e.target.result; 
    refreshProjectList();
    addGatRow(); // UX improvement
};

/* ================= PROJECT ================= */
function createNewProject() {
    const name = document.getElementById(&#39;newProjectName&#39;).value.trim();
    if (!name) return alert(&quot;Project Name required&quot;);

    const tx = db.transaction(&quot;projects&quot;, &quot;readwrite&quot;);
    tx.objectStore(&quot;projects&quot;).add({ name, entries: [], villages: [] });

    tx.oncomplete = () =&gt; {
        document.getElementById(&#39;newProjectName&#39;).value = &quot;&quot;;
        refreshProjectList();
    };
}

function refreshProjectList() {
    const select = document.getElementById(&#39;projectSelect&#39;);
    select.innerHTML = &#39;&lt;option value=&quot;&quot;&gt;-- Select Project --&lt;/option&gt;&#39;;

    db.transaction(&quot;projects&quot;).objectStore(&quot;projects&quot;).openCursor().onsuccess = (e) =&gt; {
        const cursor = e.target.result;
        if (cursor) {
            let opt = document.createElement(&#39;option&#39;);
            opt.value = cursor.value.id;
            opt.text = cursor.value.name;
            select.add(opt);
            cursor.continue();
        }
    };
}

/* ================= VILLAGE ================= */
function addVillageToProject() {
    const id = parseInt(document.getElementById(&#39;projectSelect&#39;).value);
    const vInput = document.getElementById(&#39;villageInput&#39;);
    const vName = vInput.value.trim();

    if (!id) return alert(&quot;Select a Project first&quot;);
    if (!vName) return alert(&quot;Enter Village Name&quot;);

    const tx = db.transaction(&quot;projects&quot;, &quot;readwrite&quot;);
    const store = tx.objectStore(&quot;projects&quot;);

    store.get(id).onsuccess = (e) =&gt; {
        const p = e.target.result;

        if (!p.villages) p.villages = [];

        const exists = p.villages.map(v =&gt; v.toLowerCase()).includes(vName.toLowerCase());

        if (!exists) {
            p.villages.push(vName);
            store.put(p).onsuccess = () =&gt; {
                updateVillageDropdown(p.villages);
                vInput.value = &quot;&quot;;
            };
        } else {
            alert(&quot;Village already exists&quot;);
        }
    };
}

function updateVillageDropdown(villages) {
    const select = document.getElementById(&#39;activeVillageSelect&#39;);
    select.innerHTML = &#39;&lt;option value=&quot;&quot;&gt;-- Select Village to Start Entry --&lt;/option&gt;&#39;;

    villages.sort().forEach(v =&gt; {
        let opt = document.createElement(&#39;option&#39;);
        opt.value = v;
        opt.text = v;
        select.add(opt);
    });
}

function changeWorkingVillage(skipReset = false) {
    const village = document.getElementById(&#39;activeVillageSelect&#39;).value;
    const entrySection = document.getElementById(&#39;entrySection&#39;);
    const label = document.getElementById(&#39;activeVillageLabel&#39;);

    if (village) {
        entrySection.style.display = &quot;block&quot;;
        label.innerText = &quot;Village: &quot; + village;

        // 🔥 Skip reset during edit
        if (!skipReset) {
            resetForm(false);
        }
    } else {
        entrySection.style.display = &quot;none&quot;;
    }
}
/* ================= GAT UI ================= */
function addGatRow() {
    const div = document.createElement(&#39;div&#39;);
    div.className = &#39;gat-entry card&#39;;
    div.style = &#39;background:#fdfdfd;border:1px solid #ddd;margin-top:15px;padding:15px;position:relative;&#39;;

    div.innerHTML = `
        &lt;!-- REMOVE BUTTON --&gt;
        &lt;button onclick=&quot;this.closest(&#39;.gat-entry&#39;).remove()&quot; 
            style=&quot;position:absolute;top:10px;right:10px;background:#e74c3c;color:white;border:none;border-radius:4px;padding:2px 8px;cursor:pointer;&quot;&gt;
            X
        &lt;/button&gt;

        &lt;!-- GAT BASIC DETAILS --&gt;
        &lt;h4 style=&quot;margin-bottom:10px;&quot;&gt;Gat Details&lt;/h4&gt;

        &lt;div class=&quot;grid&quot; style=&quot;grid-template-columns:1fr 1fr 1fr;gap:10px;margin-bottom:15px;&quot;&gt;
            
            &lt;div&gt;
                &lt;label&gt;Gat Number&lt;/label&gt;
                &lt;input type=&quot;text&quot; class=&quot;gatNumber&quot; placeholder=&quot;Enter Gat No&quot; style=&quot;width:100%;&quot;&gt;
            &lt;/div&gt;

            &lt;div&gt;
                &lt;label&gt;Land Category&lt;/label&gt;
                &lt;select class=&quot;landCategory&quot; style=&quot;width:100%;&quot;&gt;
                    &lt;option value=&quot;Class-1&quot;&gt;Class-1&lt;/option&gt;
                    &lt;option value=&quot;Class-2&quot;&gt;Class-2&lt;/option&gt;
                    &lt;option value=&quot;PESA&quot;&gt;PESA&lt;/option&gt;
                &lt;/select&gt;
            &lt;/div&gt;

        &lt;/div&gt;

        &lt;!-- PROCEDURE STATUS --&gt;
        &lt;h4 style=&quot;margin-bottom:8px;&quot;&gt;Land Acquisition Status&lt;/h4&gt;

        &lt;div class=&quot;grid&quot; style=&quot;grid-template-columns:1fr 1fr 1fr; gap:10px; margin-bottom:15px; background:#f8f9fa; padding:10px; border-radius:6px;&quot;&gt;
            
            &lt;div&gt;
                &lt;label&gt;JMS Status&lt;/label&gt;
                &lt;select class=&quot;checkJMS&quot; style=&quot;width:100%;&quot;&gt;
                    &lt;option value=&quot;Pending&quot;&gt;Pending&lt;/option&gt;
                    &lt;option value=&quot;Ongoing&quot;&gt;Ongoing / Verification&lt;/option&gt;
                    &lt;option value=&quot;Completed&quot;&gt;Completed (Final Area)&lt;/option&gt;
                &lt;/select&gt;
            &lt;/div&gt;

            &lt;div&gt;
                &lt;label&gt;Valuation Status&lt;/label&gt;
                &lt;select class=&quot;checkValuation&quot; style=&quot;width:100%;&quot;&gt;
                    &lt;option value=&quot;Awaited&quot;&gt;Awaited&lt;/option&gt;
                    &lt;option value=&quot;Draft&quot;&gt;Draft Prepared&lt;/option&gt;
                    &lt;option value=&quot;Declared&quot;&gt;Declared (Awarded)&lt;/option&gt;
                &lt;/select&gt;
            &lt;/div&gt;

            &lt;div&gt;
                &lt;label&gt;Legal Status&lt;/label&gt;
                &lt;select class=&quot;checkLegal&quot; style=&quot;width:100%;&quot;&gt;
                    &lt;option value=&quot;Clear&quot;&gt;Clear Title&lt;/option&gt;
                    &lt;option value=&quot;Disputed&quot;&gt;Disputed / Court Case&lt;/option&gt;
                    &lt;option value=&quot;In-Progress&quot;&gt;In-Progress&lt;/option&gt;
                &lt;/select&gt;
            &lt;/div&gt;

        &lt;/div&gt;

        &lt;!-- OWNERS SECTION --&gt;
        &lt;h4 style=&quot;margin-bottom:8px;&quot;&gt;Owner Details&lt;/h4&gt;

        &lt;div class=&quot;ownerInputs&quot;&gt;&lt;/div&gt;

        &lt;button onclick=&quot;addOwnerRow(this)&quot; 
            style=&quot;background:#95a5a6;color:white;border:none;padding:6px 12px;border-radius:4px;margin-top:10px;cursor:pointer;&quot;&gt;
            + Add Owner
        &lt;/button&gt;
    `;

    document.getElementById(&#39;gatContainer&#39;).appendChild(div);

    // Add first owner row by default
    addOwnerRow(div.querySelector(&#39;.ownerInputs&#39;));
}
  
 function editGat(entryIndex) {
    const id = parseInt(document.getElementById(&#39;projectSelect&#39;).value);
    if (!id) return alert(&quot;Select project first&quot;);

    editingIndex = entryIndex;

    db.transaction(&quot;projects&quot;).objectStore(&quot;projects&quot;).get(id).onsuccess = (e) =&gt; {
        const project = e.target.result;
        const entry = project.entries[entryIndex];

        // Set village
        document.getElementById(&#39;activeVillageSelect&#39;).value = entry.village;

        // 🔥 IMPORTANT: prevent auto reset row creation
        changeWorkingVillage(true);

        const container = document.getElementById(&#39;gatContainer&#39;);

        // 🔥 CRITICAL: remove ALL existing rows
        container.innerHTML = &quot;&quot;;

        // ✅ Create ONLY ONE Gat row
        addGatRow();
        const gatCard = container.querySelector(&#39;.gat-entry&#39;);

        // Fill Gat data
        gatCard.querySelector(&#39;.gatNumber&#39;).value = entry.gat;
        gatCard.querySelector(&#39;.landCategory&#39;).value = entry.category || &quot;Class-1&quot;;

        gatCard.querySelector(&#39;.checkJMS&#39;).value = entry.jmsStatus || &quot;Pending&quot;;
        gatCard.querySelector(&#39;.checkValuation&#39;).value = entry.valuationStatus || &quot;Awaited&quot;;
        gatCard.querySelector(&#39;.checkLegal&#39;).value = entry.legalStatus || &quot;Clear&quot;;

        // 🔥 Remove default owner row
        const oContainer = gatCard.querySelector(&#39;.ownerInputs&#39;);
        oContainer.innerHTML = &quot;&quot;;

        // Add ONLY existing owners
        (entry.owners || []).forEach(o =&gt; {
            const div = document.createElement(&#39;div&#39;);
            div.className = &#39;owner-row&#39;;

            div.innerHTML = `
                &lt;input type=&quot;text&quot; class=&quot;ownerName&quot; value=&quot;${o.name}&quot;&gt;
                
                &lt;select class=&quot;ownerType&quot;&gt;
                    &lt;option value=&quot;Private&quot; ${o.type === &#39;Private&#39; ? &#39;selected&#39; : &#39;&#39;}&gt;Private&lt;/option&gt;
                    &lt;option value=&quot;Govt&quot; ${o.type === &#39;Govt&#39; ? &#39;selected&#39; : &#39;&#39;}&gt;Govt&lt;/option&gt;
                &lt;/select&gt;

                &lt;input type=&quot;number&quot; class=&quot;totalArea&quot; value=&quot;${o.totalArea || 0}&quot;&gt;
                &lt;input type=&quot;number&quot; class=&quot;ownerArea&quot; value=&quot;${o.area || 0}&quot;&gt;
                &lt;input type=&quot;number&quot; class=&quot;amtPayable&quot; value=&quot;${o.payable || 0}&quot;&gt;
                &lt;input type=&quot;number&quot; class=&quot;amtPaid&quot; value=&quot;${o.paid || 0}&quot;&gt;

                &lt;input type=&quot;text&quot; class=&quot;draftDeed&quot; value=&quot;${o.draftDeed || &#39;&#39;}&quot;&gt;
                &lt;input type=&quot;number&quot; class=&quot;regFee&quot; value=&quot;${o.regFee || 0}&quot;&gt;
                &lt;input type=&quot;number&quot; class=&quot;stampDuty&quot; value=&quot;${o.stampDuty || 0}&quot;&gt;
                &lt;input type=&quot;number&quot; class=&quot;pagingFee&quot; value=&quot;${o.pagingFee || 0}&quot;&gt;
                &lt;input type=&quot;number&quot; class=&quot;misc&quot; value=&quot;${o.misc || 0}&quot;&gt;
                &lt;input type=&quot;number&quot; class=&quot;laCost&quot; value=&quot;${o.laCost || 0}&quot;&gt;

                &lt;input type=&quot;date&quot; class=&quot;paidDate&quot; value=&quot;${o.paidDate || &#39;&#39;}&quot;&gt;

                &lt;input type=&quot;text&quot; class=&quot;aadhar&quot; value=&quot;${o.aadhar || &#39;&#39;}&quot;&gt;
                &lt;input type=&quot;text&quot; class=&quot;pan&quot; value=&quot;${o.pan || &#39;&#39;}&quot;&gt;

                &lt;input type=&quot;text&quot; class=&quot;bank&quot; value=&quot;${o.bank || &#39;&#39;}&quot;&gt;
                &lt;input type=&quot;text&quot; class=&quot;ifsc&quot; value=&quot;${o.ifsc || &#39;&#39;}&quot;&gt;
                &lt;input type=&quot;text&quot; class=&quot;account&quot; value=&quot;${o.account || &#39;&#39;}&quot;&gt;

                &lt;input type=&quot;text&quot; class=&quot;remarks&quot; value=&quot;${o.remarks || &#39;&#39;}&quot;&gt;
            `;

            oContainer.appendChild(div);
        });

        // UI Update
        const btn = document.querySelector(&#39;button[onclick=&quot;saveEntry()&quot;]&#39;);
        btn.innerText = &quot;UPDATE RECORD&quot;;
        btn.style.background = &quot;#3498db&quot;;

        window.scrollTo({ top: 0, behavior: &#39;smooth&#39; });
    };
}

function addOwnerRow(containerOrBtn) {
    const container = containerOrBtn.classList?.contains(&#39;ownerInputs&#39;) 
        ? containerOrBtn 
        : containerOrBtn.previousElementSibling;

    const div = document.createElement(&#39;div&#39;);
    div.className = &#39;owner-row&#39;;

    div.style = `
        border:1px solid #ddd;
        padding:12px;
        margin-bottom:10px;
        border-radius:6px;
        background:#f9f9f9;
    `;

    div.innerHTML = `
        &lt;div style=&quot;display:grid; grid-template-columns: 180px 1fr; gap:8px; align-items:center;&quot;&gt;

            &lt;label&gt;Owner Name&lt;/label&gt;
            &lt;input type=&quot;text&quot; class=&quot;ownerName&quot;&gt;

            &lt;label&gt;Owner Type&lt;/label&gt;
            &lt;select class=&quot;ownerType&quot;&gt;
                &lt;option value=&quot;Private&quot;&gt;Private&lt;/option&gt;
                &lt;option value=&quot;Govt&quot;&gt;Govt&lt;/option&gt;
            &lt;/select&gt;

            &lt;label&gt;Owned Area&lt;/label&gt;
            &lt;input type=&quot;number&quot; class=&quot;totalArea&quot;&gt;

            &lt;label&gt;Acquired Area&lt;/label&gt;
            &lt;input type=&quot;number&quot; class=&quot;ownerArea&quot;&gt;

            &lt;label&gt;Payable Amount (₹)&lt;/label&gt;
            &lt;input type=&quot;number&quot; class=&quot;amtPayable&quot;&gt;

            &lt;label&gt;Amount Paid (₹)&lt;/label&gt;
            &lt;input type=&quot;number&quot; class=&quot;amtPaid&quot;&gt;
            
            &lt;label&gt;Repayment of Bank Loan (₹)&lt;/label&gt;
			&lt;input type=&quot;number&quot; class=&quot;loanRepayment&quot;&gt;

            &lt;label&gt;Paid Date&lt;/label&gt;
            &lt;input type=&quot;date&quot; class=&quot;paidDate&quot;&gt;

            &lt;label&gt;Draft Sale Deed&lt;/label&gt;
            &lt;input type=&quot;text&quot; class=&quot;draftDeed&quot;&gt;

            &lt;label&gt;Registration Fee (₹)&lt;/label&gt;
            &lt;input type=&quot;number&quot; class=&quot;regFee&quot;&gt;

            &lt;label&gt;Stamp Duty (₹)&lt;/label&gt;
            &lt;input type=&quot;number&quot; class=&quot;stampDuty&quot;&gt;

            &lt;label&gt;Paging Fee (₹)&lt;/label&gt;
            &lt;input type=&quot;number&quot; class=&quot;pagingFee&quot;&gt;

            &lt;label&gt;Miscellaneous (₹)&lt;/label&gt;
            &lt;input type=&quot;number&quot; class=&quot;misc&quot;&gt;

            &lt;label&gt;Land Acquisition Cost (₹)&lt;/label&gt;
            &lt;input type=&quot;number&quot; class=&quot;laCost&quot;&gt;

            &lt;label&gt;Aadhar Number&lt;/label&gt;
            &lt;input type=&quot;text&quot; class=&quot;aadhar&quot;&gt;

            &lt;label&gt;PAN Number&lt;/label&gt;
            &lt;input type=&quot;text&quot; class=&quot;pan&quot;&gt;

            &lt;label&gt;Bank Name&lt;/label&gt;
            &lt;input type=&quot;text&quot; class=&quot;bank&quot;&gt;

            &lt;label&gt;IFSC Code&lt;/label&gt;
            &lt;input type=&quot;text&quot; class=&quot;ifsc&quot;&gt;

            &lt;label&gt;Account Number&lt;/label&gt;
            &lt;input type=&quot;text&quot; class=&quot;account&quot;&gt;

            &lt;label&gt;Remarks&lt;/label&gt;
            &lt;input type=&quot;text&quot; class=&quot;remarks&quot;&gt;

        &lt;/div&gt;

        &lt;button onclick=&quot;this.parentElement.remove()&quot; 
            style=&quot;margin-top:10px;background:#e74c3c;color:white;border:none;padding:5px 10px;border-radius:4px;&quot;&gt;
            Remove Owner
        &lt;/button&gt;
    `;

    container.appendChild(div);
}
/* ================= CALC ================= */


/* ================= SAVE ================= */
function saveEntry() {
    const projectId = parseInt(document.getElementById(&#39;projectSelect&#39;).value);
    const villageName = document.getElementById(&#39;activeVillageSelect&#39;).value;

    if (!projectId || !villageName) {
        alert(&quot;Select Project &amp; Village&quot;);
        return;
    }

    const newGats = [];

    document.querySelectorAll(&#39;.gat-entry&#39;).forEach(ge =&gt; {

        const gatNo = ge.querySelector(&#39;.gatNumber&#39;).value.trim();
        if (!gatNo) return;

        const owners = [];

        ge.querySelectorAll(&#39;.owner-row&#39;).forEach(or =&gt; {
            const name = or.querySelector(&#39;.ownerName&#39;).value.trim();

            if (name) {
                owners.push({
                    name: name,
                    type: or.querySelector(&#39;.ownerType&#39;)?.value || &quot;Private&quot;,

                    totalArea: parseFloat(or.querySelector(&#39;.totalArea&#39;).value) || 0,
                    area: parseFloat(or.querySelector(&#39;.ownerArea&#39;).value) || 0,
                    payable: parseFloat(or.querySelector(&#39;.amtPayable&#39;).value) || 0,
                    paid: parseFloat(or.querySelector(&#39;.amtPaid&#39;)?.value) || 0,
                  	loanRepayment: parseFloat(or.querySelector(&#39;.loanRepayment&#39;)?.value) || 0,

                    draftDeed: or.querySelector(&#39;.draftDeed&#39;)?.value || &quot;&quot;,
                    regFee: parseFloat(or.querySelector(&#39;.regFee&#39;)?.value) || 0,
                    stampDuty: parseFloat(or.querySelector(&#39;.stampDuty&#39;)?.value) || 0,
                    pagingFee: parseFloat(or.querySelector(&#39;.pagingFee&#39;)?.value) || 0,
                    misc: parseFloat(or.querySelector(&#39;.misc&#39;)?.value) || 0,
                    laCost: parseFloat(or.querySelector(&#39;.laCost&#39;)?.value) || 0,

                    paidDate: or.querySelector(&#39;.paidDate&#39;)?.value || &quot;&quot;,

                    aadhar: or.querySelector(&#39;.aadhar&#39;)?.value || &quot;&quot;,
                    pan: or.querySelector(&#39;.pan&#39;)?.value || &quot;&quot;,

                    bank: or.querySelector(&#39;.bank&#39;)?.value || &quot;&quot;,
                    ifsc: or.querySelector(&#39;.ifsc&#39;)?.value || &quot;&quot;,
                    account: or.querySelector(&#39;.account&#39;)?.value || &quot;&quot;,

                    remarks: or.querySelector(&#39;.remarks&#39;)?.value || &quot;&quot;
                });
            }
        });

        if (owners.length &gt; 0) {
            newGats.push({
                village: villageName,
                gat: gatNo,
                category: ge.querySelector(&#39;.landCategory&#39;)?.value || &quot;Class-1&quot;,

                jmsStatus: ge.querySelector(&#39;.checkJMS&#39;)?.value || &quot;Pending&quot;,
                valuationStatus: ge.querySelector(&#39;.checkValuation&#39;)?.value || &quot;Awaited&quot;,
                legalStatus: ge.querySelector(&#39;.checkLegal&#39;)?.value || &quot;Clear&quot;,

                owners: owners
            });
        }
    });

    if (newGats.length === 0) {
        alert(&quot;No valid data&quot;);
        return;
    }

    const tx = db.transaction(&quot;projects&quot;, &quot;readwrite&quot;);
    const store = tx.objectStore(&quot;projects&quot;);

    store.get(projectId).onsuccess = (e) =&gt; {
        const p = e.target.result;
        if (!p.entries) p.entries = [];

        // 🔥 EDIT MODE (REPLACE)
        if (editingIndex !== null &amp;&amp; editingIndex !== undefined) {

            if (newGats.length !== 1) {
                alert(&quot;Edit mode allows only one Gat&quot;);
                return;
            }

            // ✅ Replace exact entry
            p.entries.splice(editingIndex, 1, newGats[0]);

            alert(&quot;Entry updated successfully&quot;);

        } else {
            // ✅ NEW ENTRY
            p.entries.push(...newGats);
            alert(&quot;New Gat added&quot;);
        }

        // Reset edit mode AFTER save
        editingIndex = null;

        store.put(p).onsuccess = () =&gt; {
            renderTable(p.entries);
            resetForm(false);
        };
    };
}
/* ================= DELETE ================= */
function deleteOwner(entryIndex, ownerIndex) {
    const projectId = parseInt(document.getElementById(&#39;projectSelect&#39;).value);

    const tx = db.transaction(&quot;projects&quot;, &quot;readwrite&quot;);
    const store = tx.objectStore(&quot;projects&quot;);

    store.get(projectId).onsuccess = (e) =&gt; {
        const p = e.target.result;

        p.entries[entryIndex].owners.splice(ownerIndex, 1);

        if (p.entries[entryIndex].owners.length === 0) {
            p.entries.splice(entryIndex, 1);
        }

        store.put(p).onsuccess = () =&gt; renderTable(p.entries);
    };
}

/* ================= TABLE ================= */
function renderTable(entries) {
    const tbody = document.getElementById(&#39;tableBody&#39;);
    tbody.innerHTML = &quot;&quot;;
    let total = 0;

    (entries || []).forEach((ent, eIdx) =&gt; {

        (ent.owners || []).forEach((o, oIdx) =&gt; {

            total += o.payable || 0;
            const isFirst = oIdx === 0;

            tbody.innerHTML += `
                &lt;tr style=&quot;${isFirst ? &#39;border-top:2px solid #ddd;&#39; : &#39;&#39;}&quot;&gt;

                    &lt;td&gt;${isFirst ? ent.village : &#39;&#39;}&lt;/td&gt;
                    &lt;td&gt;${isFirst ? ent.gat : &#39;&#39;}&lt;/td&gt;

                    &lt;td&gt;
                        ${o.name} 
                        &lt;small&gt;(${o.type || &#39;Private&#39;})&lt;/small&gt;
                    &lt;/td&gt;

                    &lt;td&gt;${(o.totalArea || 0).toFixed(4)}&lt;/td&gt;
                    &lt;td&gt;${(o.area || 0).toFixed(4)}&lt;/td&gt;

                    &lt;td style=&quot;text-align:right;&quot;&gt;
                        ₹${(o.payable || 0).toLocaleString(&#39;en-IN&#39;)}
                    &lt;/td&gt;

                    &lt;!-- ✅ STATUS COLUMN --&gt;
                    &lt;td&gt;
                        ${isFirst ? `
                            &lt;small&gt;
                                JMS: ${ent.jmsStatus}&lt;br&gt;
                                Val: ${ent.valuationStatus}&lt;br&gt;
                                Legal: ${ent.legalStatus}
                            &lt;/small&gt;
                        ` : &#39;&#39;}
                    &lt;/td&gt;

                    &lt;!-- ACTION --&gt;
                    &lt;td&gt;
                        ${isFirst ? `
                            &lt;button onclick=&quot;editGat(${eIdx})&quot;
                                style=&quot;background:#3498db;color:white;border:none;padding:3px 6px;margin-right:5px;&quot;&gt;
                                Edit
                            &lt;/button&gt;
                        ` : &#39;&#39;}

                        &lt;button onclick=&quot;deleteOwner(${eIdx},${oIdx})&quot;
                            style=&quot;background:#e74c3c;color:white;border:none;padding:3px 6px;&quot;&gt;
                            Del
                        &lt;/button&gt;
                    &lt;/td&gt;

                &lt;/tr&gt;
            `;
        });
    });

    document.getElementById(&#39;dashboardSummary&#39;).innerHTML =
        `Total Project Value: ₹${total.toLocaleString(&#39;en-IN&#39;)}`;
}

/* ================= LOAD ================= */
function loadProjectData() {
    const id = parseInt(document.getElementById(&#39;projectSelect&#39;).value);

    document.getElementById(&#39;activeVillageSelect&#39;).innerHTML =
        &#39;&lt;option value=&quot;&quot;&gt;-- Select Village --&lt;/option&gt;&#39;;

    if (!id) return;

    db.transaction(&quot;projects&quot;).objectStore(&quot;projects&quot;).get(id).onsuccess = (e) =&gt; {
        const p = e.target.result;
        if (p) {
            renderTable(p.entries || []);
            updateVillageDropdown(p.villages || []);
        }
    };
}

/* ================= RESET ================= */
function resetForm(clearVillage = true, skipDefaultRow = false) {
    document.getElementById(&#39;gatContainer&#39;).innerHTML = &quot;&quot;;

    if (clearVillage) {
        document.getElementById(&#39;activeVillageSelect&#39;).value = &quot;&quot;;
    }

    editingIndex = null;

    // ❌ prevent auto row during edit
    if (!skipDefaultRow) {
        addGatRow();
    }
}
  
  function importJSON(event) {
    const file = event.target.files[0];
    if (!file) return;

    const reader = new FileReader();

    reader.onload = function(e) {
        try {
            const data = JSON.parse(e.target.result);

            if (!data.name || !Array.isArray(data.entries)) {
                alert(&quot;Invalid file format&quot;);
                return;
            }

            const tx = db.transaction(&quot;projects&quot;, &quot;readwrite&quot;);
            const store = tx.objectStore(&quot;projects&quot;);

            let projectFound = false;

            store.openCursor().onsuccess = function(ev) {
                const cursor = ev.target.result;

                if (cursor) {
                    const existing = cursor.value;

                    // ✅ MATCH PROJECT BY NAME
                    if (existing.name === data.name) {
                        projectFound = true;

                        let existingEntries = existing.entries || [];
                        let newEntries = data.entries || [];

                        // 🔥 CREATE MAP FOR FAST DUPLICATE CHECK
                        const entryMap = new Map();

                        existingEntries.forEach(ent =&gt; {
                            const key = `${ent.village}__${ent.gat}`;
                            entryMap.set(key, ent);
                        });

                        // 🔥 MERGE LOGIC
                        newEntries.forEach(newEnt =&gt; {
                            const key = `${newEnt.village}__${newEnt.gat}`;

                            if (entryMap.has(key)) {
                                // 🔁 UPDATE EXISTING ENTRY
                                entryMap.set(key, newEnt);
                            } else {
                                // ➕ ADD NEW ENTRY
                                entryMap.set(key, newEnt);
                            }
                        });

                        // ✅ FINAL MERGED ARRAY
                        existing.entries = Array.from(entryMap.values());

                        // ✅ MERGE VILLAGES (NO DUPLICATES)
                        const villageSet = new Set([
                            ...(existing.villages || []),
                            ...(data.villages || [])
                        ]);
                        existing.villages = Array.from(villageSet);

                        // 💾 SAVE UPDATED PROJECT
                        cursor.update(existing).onsuccess = () =&gt; {
                            alert(&quot;Project merged successfully (duplicates avoided)&quot;);
                            refreshProjectList();
                            loadProjectData();
                        };

                        return;
                    }

                    cursor.continue();

                } else {
                    // 🆕 NO PROJECT FOUND → CREATE NEW
                    delete data.id;

                    store.add(data).onsuccess = () =&gt; {
                        alert(&quot;New project imported&quot;);
                        refreshProjectList();
                    };
                }
            };

        } catch (err) {
            console.error(err);
            alert(&quot;Error reading file&quot;);
        }
    };

    reader.readAsText(file);
}
  
  function exportJSON() {
    const projectId = parseInt(document.getElementById(&#39;projectSelect&#39;).value);
    if (!projectId) return alert(&quot;Select a project&quot;);

    db.transaction(&quot;projects&quot;).objectStore(&quot;projects&quot;).get(projectId).onsuccess = (e) =&gt; {
        const p = e.target.result;
        if (!p) return alert(&quot;No data&quot;);

        const blob = new Blob([JSON.stringify(p, null, 2)], { type: &quot;application/json&quot; });
        const url = URL.createObjectURL(blob);

        const link = document.createElement(&quot;a&quot;);
        link.href = url;
        link.download = `${p.name}_Backup.json`;
        link.click();

        URL.revokeObjectURL(url);
    };
}
  
  function decodeHTML(html) {
    const txt = document.createElement(&quot;textarea&quot;);
    txt.innerHTML = html;
    return txt.value;
}
  
  
  function exportCSV() {
    const projectId = parseInt(document.getElementById(&#39;projectSelect&#39;).value);
    if (!projectId) return alert(&quot;Select project&quot;);

    db.transaction(&quot;projects&quot;).objectStore(&quot;projects&quot;).get(projectId).onsuccess = (e) =&gt; {
        const p = e.target.result;
        if (!p || !p.entries) return alert(&quot;No data&quot;);

        let csv = `Project Name,${p.name}\n\n`;

        // ✅ HEADER (EXACTLY AS REQUIRED)
        csv += decodeHTML(&quot;गाव,गट क्रमांक,मालकाचे नाव,जमिनीचा प्रकार,JMS स्थिती,मूल्यांकन स्थिती,कायदेशीर स्थिती,देय रक्कम, अदा केलेली रक्कम, बँक लोन भरणा रक्कम,ड्राफ्ट विक्री कागदपत्र,नोंदणी शुल्क,स्टॅम्प शुल्क,पेजिंग शुल्क,इतर खर्च,जमीन संपादन खर्च,देय दिनांक,आधार क्रमांक,PAN क्रमांक,बँक नाव,IFSC कोड,खाते क्रमांक,शेरा\n&quot;);

        p.entries.forEach(ent =&gt; {
            (ent.owners || []).forEach(o =&gt; {

                // ✅ SINGLE LINE PER ROW (VERY IMPORTANT)
                csv += `&quot;${ent.village}&quot;,&quot;${ent.gat}&quot;,&quot;${o.name}&quot;,&quot;${ent.category || &#39;&#39;}&quot;,&quot;${ent.jmsStatus || &#39;&#39;}&quot;,&quot;${ent.valuationStatus || &#39;&#39;}&quot;,&quot;${ent.legalStatus || &#39;&#39;}&quot;,${o.payable || 0},${o.paid || 0},${o.loanRepayment || 0},&quot;${o.draftDeed || &#39;&#39;}&quot;,${o.regFee || 0},${o.stampDuty || 0},${o.pagingFee || 0},${o.misc || 0},${o.laCost || 0},&quot;${o.paidDate || &#39;&#39;}&quot;,&quot;${o.aadhar || &#39;&#39;}&quot;,&quot;${o.pan || &#39;&#39;}&quot;,&quot;${o.bank || &#39;&#39;}&quot;,&quot;${o.ifsc || &#39;&#39;}&quot;,&quot;${o.account || &#39;&#39;}&quot;,&quot;${o.remarks || &#39;&#39;}&quot;\n`;

            });
        });

        // ✅ SAFE FILE NAME WITH DATE
        const now = new Date();
        const date = now.toLocaleDateString(&#39;en-GB&#39;).replace(/\//g, &#39;-&#39;);
        const safeName = p.name.replace(/[&lt;&gt;:&quot;/\\|?*]+/g, &#39;&#39;);

        const blob = new Blob([&quot;\uFEFF&quot; + csv], { type: &quot;text/csv;charset=utf-8;&quot; });
        const url = URL.createObjectURL(blob);

        const link = document.createElement(&quot;a&quot;);
        link.href = url;
        link.download = `${safeName}_${date}_LA_Detailed_Report.csv`;
        link.click();

        URL.revokeObjectURL(url);
    };
}
  
function generateMermaid() {
    const projectId = parseInt(document.getElementById(&#39;projectSelect&#39;).value);
    if (!projectId) return alert(&quot;Select project&quot;);

    db.transaction(&quot;projects&quot;).objectStore(&quot;projects&quot;).get(projectId).onsuccess = (e) =&gt; {
        const p = e.target.result;
        if (!p || !p.entries) return alert(&quot;No data&quot;);

        let diagram = &quot;flowchart TD\n&quot;;

        // Root Node
        diagram += `P[&quot;🏗️ ${p.name}&quot;]\n`;

        const villageMap = {};
        const villageTotals = {};

        // --- Village totals ---
        p.entries.forEach(ent =&gt; {
            if (!villageTotals[ent.village]) {
                villageTotals[ent.village] = {
                    area: 0,
                    payable: 0,
                    paid: 0
                };
            }

            (ent.owners || []).forEach(o =&gt; {
                villageTotals[ent.village].area += (o.area || 0);
                villageTotals[ent.village].payable += (o.payable || 0);
                villageTotals[ent.village].paid += (o.paid || 0);
            });
        });

        // --- Build Diagram ---
        p.entries.forEach((ent, eIdx) =&gt; {

            const vKey = `V_${ent.village.replace(/\W/g, &#39;&#39;)}`;

            // Village Node
            if (!villageMap[ent.village]) {
                const v = villageTotals[ent.village];

                diagram += `P --&gt; ${vKey}[&quot;🏡 ${ent.village}&lt;br&gt;
Area: ${v.area.toFixed(2)}&lt;br&gt;
₹ Pay: ${v.payable.toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;
₹ Paid: ${v.paid.toLocaleString(&#39;en-IN&#39;)}&quot;]\n`;

                villageMap[ent.village] = vKey;
            }

            // Gat totals
            let totalArea = 0, totalPayable = 0, totalPaid = 0;

            (ent.owners || []).forEach(o =&gt; {
                totalArea += (o.area || 0);
                totalPayable += (o.payable || 0);
                totalPaid += (o.paid || 0);
            });

            const balance = totalPayable - totalPaid;
            const gKey = `G${eIdx}_${ent.gat}`;

            // Gat Node
            diagram += `${villageMap[ent.village]} --&gt; ${gKey}[&quot;📍 Gat: ${ent.gat}&lt;br&gt;
Cat: ${ent.category || &#39;-&#39;}&lt;br&gt;
Area: ${totalArea.toFixed(2)}&lt;br&gt;
₹ Pay: ${totalPayable.toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;
₹ Paid: ${totalPaid.toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;
Bal: ₹${balance.toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;&lt;br&gt;
JMS: ${ent.jmsStatus || &#39;-&#39;}&lt;br&gt;
Val: ${ent.valuationStatus || &#39;-&#39;}&lt;br&gt;
Legal: ${ent.legalStatus || &#39;-&#39;}&quot;]\n`;

            // Owners
            (ent.owners || []).forEach((o, oIdx) =&gt; {

    const oKey = `O${eIdx}_${oIdx}`;
    const bal = (o.payable || 0) - (o.paid || 0);

    // ✅ OWNER NODE
    diagram += `${gKey} --&gt; ${oKey}[&quot;👤 ${o.name}&lt;br&gt;
(${o.type || &#39;Private&#39;})&lt;br&gt;&lt;br&gt;

📐 Owned: ${(o.totalArea || 0).toFixed(2)}&lt;br&gt;
📏 Acq: ${(o.area || 0).toFixed(2)}&lt;br&gt;&lt;br&gt;

💰 Pay: ₹${(o.payable || 0).toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;
💵 Paid: ₹${(o.paid || 0).toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;
🏦 Loan: ₹${(o.loanRepayment || 0).toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;&lt;br&gt;

📄 Draft: ${o.draftDeed || &#39;-&#39;}&lt;br&gt;
🧾 Reg: ₹${(o.regFee || 0).toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;
🪙 Stamp: ₹${(o.stampDuty || 0).toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;
📑 Paging: ₹${(o.pagingFee || 0).toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;
📦 Misc: ₹${(o.misc || 0).toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;
🏗️ LA Cost: ₹${(o.laCost || 0).toLocaleString(&#39;en-IN&#39;)}&lt;br&gt;&lt;br&gt;

📅 Paid Dt: ${o.paidDate || &#39;-&#39;}&lt;br&gt;&lt;br&gt;

🆔 Aadhaar: ${o.aadhar || &#39;-&#39;}&lt;br&gt;
🪪 PAN: ${o.pan || &#39;-&#39;}&lt;br&gt;&lt;br&gt;

🏦 Bank: ${o.bank || &#39;-&#39;}&lt;br&gt;
🔢 IFSC: ${o.ifsc || &#39;-&#39;}&lt;br&gt;
💳 Acc: ${o.account || &#39;-&#39;}&lt;br&gt;&lt;br&gt;

📝 ${o.remarks || &#39;&#39;}&quot;]\n`;

    // ✅ CONDITIONAL COLOR (YELLOW if unpaid)
    if (!o.paid || o.paid === 0) {
        diagram += `style ${oKey} fill:#fff3cd,stroke:#f39c12,stroke-width:2px\n`;
    }

});

        });

        // Render
        const container = document.getElementById(&quot;mermaidChart&quot;);
        container.innerHTML = diagram;

        try {
            mermaid.init(undefined, container);
        } catch (err) {
            console.error(err);
            alert(&quot;Mermaid rendering error&quot;);
        }
    };
}
  
 function exportMermaidA2() {
    const svg = document.querySelector(&quot;#mermaidChart svg&quot;);
    if (!svg) {
        alert(&quot;Generate diagram first&quot;);
        return;
    }

    // Clone original SVG
    const clone = svg.cloneNode(true);

    // Get actual diagram size
    const bbox = svg.getBBox();

    // A2 Landscape (px)
    const A2_WIDTH = 594 * 3.78;   // ≈ 2244 px
    const A2_HEIGHT = 420 * 3.78;  // ≈ 1587 px

    // Calculate scale (fit inside A2)
    const scaleX = A2_WIDTH / bbox.width;
    const scaleY = A2_HEIGHT / bbox.height;
    const scale = Math.min(scaleX, scaleY);

    const scaledWidth = bbox.width * scale;
    const scaledHeight = bbox.height * scale;

    // Centering offsets (to fully utilize page)
    const offsetX = (A2_WIDTH - scaledWidth) / 2;
    const offsetY = (A2_HEIGHT - scaledHeight) / 2;

    // Set proper viewBox (VERY IMPORTANT)
    clone.setAttribute(
        &quot;viewBox&quot;,
        `${bbox.x - offsetX/scale} ${bbox.y - offsetY/scale} ${A2_WIDTH/scale} ${A2_HEIGHT/scale}`
    );

    clone.setAttribute(&quot;width&quot;, A2_WIDTH);
    clone.setAttribute(&quot;height&quot;, A2_HEIGHT);

    // Optional: Improve text readability
    clone.style.background = &quot;white&quot;;

    // Serialize SVG
    const svgData = new XMLSerializer().serializeToString(clone);
    const blob = new Blob([svgData], { type: &quot;image/svg+xml;charset=utf-8&quot; });

    const url = URL.createObjectURL(blob);

    // Safe filename with date
    const now = new Date();
    const date = now.toLocaleDateString(&#39;en-GB&#39;).replace(/\//g, &#39;-&#39;);

    const link = document.createElement(&quot;a&quot;);
    link.href = url;
    link.download = `Land_Acquisition_A2_${date}.svg`;
    link.click();

    URL.revokeObjectURL(url);
}
  
  function generateVillageSummary() {
    const projectId = parseInt(document.getElementById(&#39;projectSelect&#39;).value);
    if (!projectId) return alert(&quot;Select project&quot;);

    db.transaction(&quot;projects&quot;).objectStore(&quot;projects&quot;).get(projectId).onsuccess = (e) =&gt; {
        const p = e.target.result;
        if (!p || !p.entries) return alert(&quot;No data&quot;);

        const summary = {};

        p.entries.forEach(ent =&gt; {
            const village = ent.village;
            const category = ent.category || &quot;Class-1&quot;;

            if (!summary[village]) {
                summary[village] = {
                    &quot;Class-1&quot;: 0,
                    &quot;Class-2&quot;: 0,
                    &quot;PESA&quot;: 0
                };
            }

            // Sum acquired area (owner area)
            (ent.owners || []).forEach(o =&gt; {
                summary[village][category] += (o.area || 0);
            });
        });

        // Render table
        const tbody = document.getElementById(&#39;villageSummaryBody&#39;);
        tbody.innerHTML = &quot;&quot;;

        Object.keys(summary).forEach(village =&gt; {
            const v = summary[village];

            const total = v[&quot;Class-1&quot;] + v[&quot;Class-2&quot;] + v[&quot;PESA&quot;];

            tbody.innerHTML += `
                &lt;tr&gt;
                    &lt;td&gt;&lt;b&gt;${village}&lt;/b&gt;&lt;/td&gt;
                    &lt;td&gt;${v[&quot;Class-1&quot;].toFixed(4)}&lt;/td&gt;
                    &lt;td&gt;${v[&quot;Class-2&quot;].toFixed(4)}&lt;/td&gt;
                    &lt;td&gt;${v[&quot;PESA&quot;].toFixed(4)}&lt;/td&gt;
                    &lt;td&gt;&lt;b&gt;${total.toFixed(4)}&lt;/b&gt;&lt;/td&gt;
                &lt;/tr&gt;
            `;
        });
    };
}
&lt;/script&gt;
&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/04/land-acquisition-data-entry.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-920994611213108038</guid><pubDate>Fri, 27 Mar 2026 18:06:00 +0000</pubDate><atom:updated>2026-04-06T12:13:40.464+05:30</atom:updated><title>PEB section Estimation calculator </title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;PEB Structural member Estimation&lt;/title&gt;
    
    &lt;script type=&quot;text/x-mathjax-config&quot;&gt;
      MathJax.Hub.Config({
        tex2jax: {inlineMath: [[&#39;$&#39;,&#39;$&#39;], [&#39;\\(&#39;,&#39;\\)&#39;]], processEscapes: true}
      });
    &lt;/script&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;&gt;&lt;/script&gt;

    &lt;style&gt;
        body { font-family: &#39;Segoe UI&#39;, Arial, sans-serif; background-color: #f0f2f5; padding: 2px; color: #333; }
        .container { max-width: 1300px; margin: auto; background: white; padding: 3px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
        h2 { color: #1a3a5a; border-left: 5px solid #3498db; padding-left: 15px; }
        .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 25px; background: #f8f9fa; padding: 20px; border-radius: 10px; }
        .input-group { display: flex; flex-direction: column; }
        label { font-weight: 600; font-size: 0.85em; margin-bottom: 5px; color: #555; }
        input, select { padding: 12px; border: 1px solid #ccc; border-radius: 6px; }
        button { width: 100%; padding: 15px; background: #2c3e50; color: white; border: none; border-radius: 6px; font-size: 1.1em; font-weight: bold; cursor: pointer; transition: 0.3s; margin-top: 10px; }
        button:hover { background: #34495e; }
        .results { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; }
        .card { background: white; border: 1px solid #e1e4e8; padding: 20px; border-radius: 10px; }
        .card h3 { margin-top: 0; font-size: 0.9em; color: #3498db; text-transform: uppercase; border-bottom: 1px solid #eee; padding-bottom: 5px; }
        table { width: 100%; border-collapse: collapse; }
        td { padding: 8px 0; border-bottom: 1px solid #eee; font-size: 0.95em; }
        td:last-child { text-align: right; font-weight: bold; color: #2c3e50; }
        .full-width { grid-column: span 2; }
        .highlight { color: #e74c3c; font-weight: bold; }
      h1, h2 {
    color: #1a3a5a;
}
h2 {
    border-left: 5px solid #3498db;
    padding-left: 10px;
}
p {
    margin: 10px 0;
}
ul {
    margin-left: 20px;
}
.code {
    background: #f8f9fa;
    padding: 10px;
    border-left: 4px solid #3498db;
    font-family: monospace;
}
.highlight {
    color: #e74c3c;
    font-weight: bold;
}
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class=&quot;container&quot;&gt;
    &lt;h2&gt;PEB tentative section Estimation&lt;/h2&gt;
    
    &lt;div class=&quot;grid&quot;&gt;
        &lt;div class=&quot;input-group&quot;&gt;&lt;label&gt;Span ($L$) [m]&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;span&quot; value=&quot;30&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;&lt;label&gt;Bay Spacing [m]&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;bay&quot; value=&quot;8&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;&lt;label&gt;Eave Height [m]&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;height&quot; value=&quot;7&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;
            &lt;label&gt;Base Connection&lt;/label&gt;
            &lt;select id=&quot;baseType&quot;&gt;
                &lt;option value=&quot;pinned&quot;&gt;Pinned (Standard)&lt;/option&gt;
                &lt;option value=&quot;fixed&quot;&gt;Fixed (Rigid)&lt;/option&gt;
            &lt;/select&gt;
        &lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;
            &lt;label&gt;Wind Speed ($V_b$)&lt;/label&gt;
            &lt;select id=&quot;wind&quot;&gt;
                &lt;option value=&quot;33&quot;&gt;33 m/s (Low)&lt;/option&gt;
                &lt;option value=&quot;44&quot; selected&gt;44 m/s (Medium)&lt;/option&gt;
                &lt;option value=&quot;50&quot;&gt;50 m/s (High/Coastal)&lt;/option&gt;
            &lt;/select&gt;
        &lt;/div&gt;
        &lt;button onclick=&quot;runCalculations()&quot;&gt;Generate Design &amp; Formulas&lt;/button&gt;
    &lt;/div&gt;

    &lt;div class=&quot;results&quot; id=&quot;output&quot; style=&quot;display:none;&quot;&gt;
        &lt;div class=&quot;card&quot;&gt;
            &lt;h3&gt;Primary Geometry&lt;/h3&gt;
            &lt;table&gt;
                &lt;tr&gt;&lt;td&gt;Optimum Max Depth&lt;/td&gt;&lt;td id=&quot;res-dmax&quot;&gt;--&lt;/td&gt;&lt;/tr&gt;
                &lt;tr&gt;&lt;td&gt;Min Web Thickness&lt;/td&gt;&lt;td id=&quot;res-tw&quot;&gt;--&lt;/td&gt;&lt;/tr&gt;
                &lt;tr&gt;&lt;td&gt;Flange Width&lt;/td&gt;&lt;td id=&quot;res-fw&quot;&gt;--&lt;/td&gt;&lt;/tr&gt;
                &lt;tr&gt;&lt;td&gt;Deflection Limit ($L/180$)&lt;/td&gt;&lt;td id=&quot;res-def&quot;&gt;--&lt;/td&gt;&lt;/tr&gt;
            &lt;/table&gt;
        &lt;/div&gt;

        &lt;div class=&quot;card&quot;&gt;
            &lt;h3&gt;Anchor &amp; Shear Key&lt;/h3&gt;
            &lt;table&gt;
                &lt;tr&gt;&lt;td&gt;Anchor Bolts&lt;/td&gt;&lt;td id=&quot;res-bolt&quot;&gt;--&lt;/td&gt;&lt;/tr&gt;
                &lt;tr&gt;&lt;td&gt;Embedment ($15 \times d$)&lt;/td&gt;&lt;td id=&quot;res-embed&quot;&gt;--&lt;/td&gt;&lt;/tr&gt;
                &lt;tr&gt;&lt;td&gt;Shear Key Req.&lt;/td&gt;&lt;td id=&quot;res-skey&quot;&gt;--&lt;/td&gt;&lt;/tr&gt;
                &lt;tr&gt;&lt;td&gt;Key Size (Approx)&lt;/td&gt;&lt;td id=&quot;res-skey-size&quot;&gt;--&lt;/td&gt;&lt;/tr&gt;
            &lt;/table&gt;
        &lt;/div&gt;

        &lt;div class=&quot;card full-width&quot;&gt;
            &lt;h3&gt;Design Logic &amp; Weight&lt;/h3&gt;
            &lt;div id=&quot;math-output&quot;&gt;&lt;/div&gt;
            &lt;p style=&quot;text-align:right;&quot;&gt;&lt;strong&gt;Est. Steel: &lt;span id=&quot;res-total-mt&quot;&gt;&lt;/span&gt; MT/bay&lt;/strong&gt;&lt;/p&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
  
  &lt;div class=&quot;container&quot;&gt;

&lt;h1&gt;PEB Structural Member Estimation Tool – Technical Explanation&lt;/h1&gt;

&lt;p&gt;
This tool is developed for &lt;strong&gt;Pre-Engineered Building (PEB)&lt;/strong&gt; preliminary design. It provides
quick and reliable estimates of structural member sizes, anchor systems, and steel weight based on
standard engineering thumb rules and practical industry experience.
&lt;/p&gt;

&lt;h2&gt;1. Objective of the Tool&lt;/h2&gt;
&lt;p&gt;
The primary objective is to assist engineers in obtaining:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Preliminary rafter depth and plate sizes&lt;/li&gt;
&lt;li&gt;Steel quantity estimation&lt;/li&gt;
&lt;li&gt;Anchor bolt requirements&lt;/li&gt;
&lt;li&gt;Shear key necessity check&lt;/li&gt;
&lt;li&gt;Basic design validation using engineering logic&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;2. Input Parameters&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Span (L):&lt;/strong&gt; Distance between columns&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bay Spacing (B):&lt;/strong&gt; Distance between frames&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Eave Height (H):&lt;/strong&gt; Height at column top&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Base Connection:&lt;/strong&gt; Pinned or Fixed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wind Speed (Vb):&lt;/strong&gt; Governing lateral load parameter&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;3. Primary Member Design Logic&lt;/h2&gt;

&lt;h3&gt;3.1 Rafter Depth Estimation&lt;/h3&gt;
&lt;p&gt;
The tool uses a widely accepted optimization ratio:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
d ≈ L / 28
&lt;/div&gt;

&lt;p&gt;
Where:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;d = depth of rafter (mm)&lt;/li&gt;
&lt;li&gt;L = span (mm)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
This ensures:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Efficient bending resistance&lt;/li&gt;
&lt;li&gt;Economical steel usage&lt;/li&gt;
&lt;li&gt;Compliance with deflection limits&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;3.2 Web Thickness&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
tw = d / 150 (minimum 6 mm)
&lt;/div&gt;

&lt;p&gt;
This criterion ensures:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Shear capacity adequacy&lt;/li&gt;
&lt;li&gt;Prevention of web buckling&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;3.3 Flange Width&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
bf = d / 5 (minimum 150 mm)
&lt;/div&gt;

&lt;p&gt;
Flange width governs:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Bending strength&lt;/li&gt;
&lt;li&gt;Lateral torsional stability&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;3.4 Deflection Check&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Allowable Deflection = L / 180
&lt;/div&gt;

&lt;p&gt;
This is a standard serviceability limit used in industrial structures.
&lt;/p&gt;

&lt;h2&gt;4. Steel Weight Estimation&lt;/h2&gt;

&lt;p&gt;
The steel consumption is estimated using empirical relationships:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
kg/m² = 25 + (0.5 × L) + Wind Factor
&lt;/div&gt;

&lt;p&gt;
Where:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Base value = 25 kg/m² (light structure)&lt;/li&gt;
&lt;li&gt;Span effect increases steel&lt;/li&gt;
&lt;li&gt;Wind factor adds 10 kg/m² for high wind zones&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;code&quot;&gt;
Total Steel (MT) = (kg/m² × L × B) / 1000
&lt;/div&gt;

&lt;p&gt;
This gives steel per bay, useful for:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cost estimation&lt;/li&gt;
&lt;li&gt;Feasibility studies&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;5. Anchor Bolt Design Logic&lt;/h2&gt;

&lt;h3&gt;Bolt Diameter Selection&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
If L &gt; 30 m → M30 bolts  
Else → M24 bolts
&lt;/div&gt;

&lt;h3&gt;Bolt Quantity&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Pinned Base → 4 bolts  
Fixed Base → 8 bolts
&lt;/div&gt;

&lt;h3&gt;Embedment Depth&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Embedment = 15 × Bolt Diameter
&lt;/div&gt;

&lt;p&gt;
This ensures proper anchorage and pull-out resistance.
&lt;/p&gt;

&lt;h2&gt;6. Shear Key Requirement&lt;/h2&gt;

&lt;p&gt;
Shear key necessity is checked using friction vs shear condition:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
If Vu &gt; μ × Pu → Shear Key Required
&lt;/div&gt;

&lt;p&gt;
Simplified logic used in the tool:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High wind (≥ 44 m/s) OR large span (&gt; 35 m) → Shear key required&lt;/li&gt;
&lt;li&gt;Otherwise friction is sufficient&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Typical Shear Key Sizes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;ISMC 150 channel&lt;/li&gt;
&lt;li&gt;100 × 100 box section&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;7. Role of MathJax&lt;/h2&gt;

&lt;p&gt;
The tool integrates &lt;strong&gt;MathJax&lt;/strong&gt; to dynamically render engineering equations such as:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Depth optimization formulas&lt;/li&gt;
&lt;li&gt;Weight calculations&lt;/li&gt;
&lt;li&gt;Design inequalities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
This improves readability and provides a professional engineering interface.
&lt;/p&gt;

&lt;h2&gt;8. Engineering Assumptions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Preliminary design only (not final design)&lt;/li&gt;
&lt;li&gt;Uniform loading conditions&lt;/li&gt;
&lt;li&gt;Standard material properties&lt;/li&gt;
&lt;li&gt;Typical industrial building configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;9. Limitations&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Does not replace detailed structural analysis&lt;/li&gt;
&lt;li&gt;No seismic load consideration&lt;/li&gt;
&lt;li&gt;No connection design verification&lt;/li&gt;
&lt;li&gt;No code-specific checks (IS 800, MBMA, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;10. Conclusion&lt;/h2&gt;

&lt;p&gt;
This PEB estimation tool serves as a &lt;span class=&quot;highlight&quot;&gt;fast and practical design assistant&lt;/span&gt; 
for structural engineers. It bridges the gap between conceptual design and detailed analysis,
helping engineers make informed decisions quickly.
&lt;/p&gt;

&lt;p&gt;
For final design, it is recommended to validate results using detailed structural analysis software
and relevant design codes.
&lt;/p&gt;

&lt;/div&gt;

&lt;script&gt;
function runCalculations() {
    const L = parseFloat(document.getElementById(&#39;span&#39;).value);
    const B = parseFloat(document.getElementById(&#39;bay&#39;).value);
    const H = parseFloat(document.getElementById(&#39;height&#39;).value);
    const Vb = parseFloat(document.getElementById(&#39;wind&#39;).value);
    const base = document.getElementById(&#39;baseType&#39;).value;

    // Calculations
    let d_max = Math.ceil((L * 1000 / 28) / 50) * 50;
    let tw = Math.ceil(d_max / 150); if(tw &lt; 6) tw = 6;
    let fw = Math.ceil((d_max/5)/25)*25; if(fw &lt; 150) fw = 150;
    
    // Weight logic
    let kg_m2 = 25 + (L * 0.5) + (Vb &gt; 44 ? 10 : 0);
    let total_mt = (kg_m2 * L * B) / 1000;

    // Anchor &amp; Shear logic
    let bolt_dia = L &gt; 30 ? 30 : 24;
    let bolt_qty = base === &#39;fixed&#39; ? 8 : 4;
    let shear_key_req = (Vb &gt;= 44 || L &gt; 35) ? &quot;YES&quot; : &quot;NO (Friction OK)&quot;;
    let skey_size = shear_key_req === &quot;YES&quot; ? &quot;ISMC 150 or 100x100 Box&quot; : &quot;N/A&quot;;

    // Results display
    document.getElementById(&#39;output&#39;).style.display = &#39;grid&#39;;
    document.getElementById(&#39;res-dmax&#39;).innerText = d_max + &quot; mm&quot;;
    document.getElementById(&#39;res-tw&#39;).innerText = tw + &quot; mm&quot;;
    document.getElementById(&#39;res-fw&#39;).innerText = fw + &quot; mm&quot;;
    document.getElementById(&#39;res-def&#39;).innerText = (L*1000/180).toFixed(1) + &quot; mm&quot;;
    
    document.getElementById(&#39;res-bolt&#39;).innerText = bolt_qty + &quot; Nos M&quot; + bolt_dia;
    document.getElementById(&#39;res-embed&#39;).innerText = (bolt_dia * 15) + &quot; mm&quot;;
    document.getElementById(&#39;res-skey&#39;).innerText = shear_key_req;
    document.getElementById(&#39;res-skey-size&#39;).innerText = skey_size;
    document.getElementById(&#39;res-total-mt&#39;).innerText = total_mt.toFixed(2);

    // Dynamic MathJax Rendering
    const mathDiv = document.getElementById(&#39;math-output&#39;);
    mathDiv.innerHTML = `
        &lt;p&gt;Using optimization ratio $d \\approx L/28$, the calculated depth is $${d_max}\\text{ mm}$.&lt;/p&gt;
        &lt;p&gt;The estimated steel consumption is calculated as: 
        $$\\text{Weight} = (${kg_m2.toFixed(1)}\\text{ kg/m}^2) \\times (L \\times B)$$&lt;/p&gt;
        &lt;p&gt;Shear capacity check: If $V_u &gt; \\mu \\cdot P_u$, then a Shear Key is required.&lt;/p&gt;
    `;

    // Re-run MathJax to process new dynamic content
    MathJax.Hub.Queue([&quot;Typeset&quot;, MathJax.Hub, mathDiv]);
}
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/03/peb-section-estimation-calculator.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-3162939310620119729</guid><pubDate>Sat, 21 Mar 2026 09:06:10 +0000</pubDate><atom:updated>2026-04-06T12:18:17.097+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">PWD Working</category><title>Letter correspondence</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;Letter Correspondence Manager&lt;/title&gt;
    &lt;script src=&quot;https://cdn.tailwindcss.com&quot;&gt;&lt;/script&gt;
    &lt;style&gt;
        body { background-color: #f3f4f6; padding: 1rem; font-family: sans-serif; scroll-behavior: smooth; }
        @media (min-width: 768px) { body { padding: 2.5rem; } }
        .max-w-5xl { max-width: 64rem; margin: 0 auto; background-color: white; padding: 1.5rem; border-radius: 0.75rem; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; color: #1f2937; border-bottom: 1px solid #e5e7eb; padding-bottom: 1rem; }
        label { display: block; font-size: 0.875rem; font-weight: 600; color: #374151; margin-bottom: 0.25rem; }
        form { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
        @media (min-width: 768px) { form { grid-template-columns: repeat(2, minmax(0, 1fr)); } .md\:col-span-2 { grid-column: span 2 / span 2; } }
        input, select, textarea { width: 100%; padding: 0.625rem; border: 1px solid #d1d5db; border-radius: 0.5rem; outline: none; }
        input:focus, select:focus, textarea:focus { ring: 2px solid #3b82f6; border-color: #3b82f6; }
        #action { border-color: #93c5fd; background-color: #eff6ff; color: #2563eb; font-weight: 500; }
        button, .cursor-pointer { padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 700; cursor: pointer; border: none; transition: background 0.2s; text-align: center; }
        #submitBtn { background-color: #2563eb; color: white; flex: 1; }
        .bg-yellow-600 { background-color: #ca8a04; color: white; }
        .bg-green-600 { background-color: #16a34a; color: white; }
        .bg-orange-500 { background-color: #f97316; color: white; }
        .bg-gray-600 { background-color: #4b5563; color: white; }
        
        /* --- HORIZONTAL SCROLL STYLING --- */
        .table-container { 
            width: 100%; 
            overflow-x: auto; /* Enables the scrollbar */
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            background: white;
        }

        table { 
            width: 100%; 
            min-width: 1000px; /* Force the table to be wide enough to show all columns */
            border-collapse: collapse; 
            font-size: 0.875rem; 
            text-align: left; 
        }
        
        /* Custom Scrollbar Styling (Optional) */
        .table-container::-webkit-scrollbar { height: 8px; }
        .table-container::-webkit-scrollbar-track { background: #f1f1f1; }
        .table-container::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }
        .table-container::-webkit-scrollbar-thumb:hover { background: #555; }

        th, td { padding: 0.75rem; border: 1px solid #e5e7eb; white-space: nowrap; } /* Prevent text wrapping */
        .hidden { display: none; }
      }
h1, h2 {
    color: #1a3a5a;
}
h2 {
    border-left: 5px solid #3498db;
    padding-left: 10px;
}
ul {
    margin-left: 20px;
}
.code {
    background: #f8f9fa;
    padding: 10px;
    border-left: 4px solid #3498db;
    font-family: monospace;
}
.highlight {
    color: #e74c3c;
    font-weight: bold;
}
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div class=&quot;max-w-5xl mx-auto&quot;&gt;
        &lt;h2&gt;Letter Correspondence Entry&lt;/h2&gt;
        
        &lt;form id=&quot;letterForm&quot;&gt;
            &lt;div&gt;
                &lt;label&gt;Sr. No&lt;/label&gt;
                &lt;input type=&quot;number&quot; id=&quot;sr&quot; required&gt;
            &lt;/div&gt;
            &lt;div&gt;
                &lt;label&gt;Subject&lt;/label&gt;
                &lt;input type=&quot;text&quot; id=&quot;subj&quot; required&gt;
            &lt;/div&gt;
            &lt;div&gt;
                &lt;label&gt;Letter Date&lt;/label&gt;
                &lt;input type=&quot;date&quot; id=&quot;l_date&quot;&gt;
            &lt;/div&gt;
            &lt;div&gt;
                &lt;label&gt;Letter Number&lt;/label&gt;
                &lt;input type=&quot;text&quot; id=&quot;l_num&quot;&gt;
            &lt;/div&gt;
           &lt;div&gt;
    &lt;label&gt;Letter Received Date&lt;/label&gt;
    &lt;input type=&quot;date&quot; id=&quot;r_date&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;label&gt;Letter Received Number&lt;/label&gt;
    &lt;input type=&quot;text&quot; id=&quot;r_num&quot;&gt;
&lt;/div&gt;
            &lt;div&gt;
                &lt;label class=&quot;text-blue-600&quot;&gt;Action Taken&lt;/label&gt;
                &lt;select id=&quot;action&quot; required&gt;
                    &lt;option value=&quot;&quot; disabled selected&gt;-- Select Status --&lt;/option&gt;
                    &lt;option value=&quot;Forwarded&quot;&gt;1) Forwarded&lt;/option&gt;
                    &lt;option value=&quot;Reverted&quot;&gt;2) Reverted&lt;/option&gt;
                    &lt;option value=&quot;Filed&quot;&gt;3) Filed&lt;/option&gt;
                    &lt;option value=&quot;Action Yet to be taken&quot;&gt;4) Action Yet to be taken&lt;/option&gt;
                &lt;/select&gt;
            &lt;/div&gt;
            &lt;div&gt;
                &lt;label&gt;Reply Date&lt;/label&gt;
                &lt;input type=&quot;date&quot; id=&quot;rep_date&quot;&gt;
            &lt;/div&gt;
            &lt;div class=&quot;md:col-span-2&quot;&gt;
                &lt;label&gt;Remarks&lt;/label&gt;
                &lt;textarea id=&quot;rem&quot; rows=&quot;2&quot;&gt;&lt;/textarea&gt;
            &lt;/div&gt;
            
            &lt;div class=&quot;md:col-span-2 flex flex-wrap gap-3 mt-4&quot;&gt;
                &lt;button type=&quot;submit&quot; id=&quot;submitBtn&quot;&gt;Save&lt;/button&gt;
                &lt;button type=&quot;button&quot; onclick=&quot;scrollToTable()&quot; class=&quot;bg-gray-600&quot;&gt;View Saved List ↓&lt;/button&gt;
                &lt;button type=&quot;button&quot; onclick=&quot;exportJSON()&quot; class=&quot;bg-green-600&quot;&gt;Export JSON&lt;/button&gt;
                &lt;label class=&quot;bg-orange-500 text-white px-6 py-3 rounded-lg cursor-pointer&quot;&gt;
                    Import JSON &lt;input type=&quot;file&quot; id=&quot;importFile&quot; class=&quot;hidden&quot; accept=&quot;.json&quot; onchange=&quot;importJSON(event)&quot;&gt;
                &lt;/label&gt;
            &lt;/div&gt;
        &lt;/form&gt;

        &lt;div id=&quot;tableSection&quot; class=&quot;mt-10&quot;&gt;
            &lt;h3 class=&quot;text-lg font-bold mb-3 italic&quot;&gt;Recent Entries (Local View)&lt;/h3&gt;
            
            &lt;div class=&quot;table-container&quot;&gt;
                &lt;table&gt;
                    &lt;thead class=&quot;bg-gray-200&quot;&gt;
                        &lt;tr&gt;
                            &lt;th&gt;Sr.&lt;/th&gt;
                            &lt;th&gt;Subject&lt;/th&gt;
                            &lt;th&gt;Letter Date&lt;/th&gt;
                            &lt;th&gt;Letter No.&lt;/th&gt;
                            &lt;th&gt;Reply Date&lt;/th&gt;
                            &lt;th class=&quot;text-blue-600&quot;&gt;Status&lt;/th&gt;
                            &lt;th&gt;Action&lt;/th&gt;
                            &lt;th&gt;Remark&lt;/th&gt;
                          &lt;th&gt;Letter Inward No.&lt;/th&gt;
                        &lt;/tr&gt;
                    &lt;/thead&gt;
                    &lt;tbody id=&quot;dataTable&quot;&gt;&lt;/tbody&gt;
                &lt;/table&gt;
            &lt;/div&gt;
            &lt;p class=&quot;text-xs text-gray-400 mt-2&quot;&gt;← Scroll horizontally to see more columns →&lt;/p&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;div class=&quot;container&quot;&gt;

&lt;h1&gt;Letter Correspondence Entry System – Technical Explanation&lt;/h1&gt;

&lt;p&gt;
This web-based application is designed to manage and track official correspondence efficiently.
It enables users to record, update, store, and retrieve letter communication details with a simple interface.
The system combines &lt;strong&gt;form-based data entry&lt;/strong&gt;, &lt;strong&gt;local storage&lt;/strong&gt;, and &lt;strong&gt;cloud integration&lt;/strong&gt;.
&lt;/p&gt;

&lt;h2&gt;1. Objective of the System&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Maintain structured records of incoming and outgoing letters&lt;/li&gt;
&lt;li&gt;Track action taken on each correspondence&lt;/li&gt;
&lt;li&gt;Enable quick editing and deletion of records&lt;/li&gt;
&lt;li&gt;Provide backup via JSON export/import&lt;/li&gt;
&lt;li&gt;Integrate with Google Sheets for centralized data storage&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;2. Form Input Structure&lt;/h2&gt;

&lt;p&gt;The form captures key details of correspondence:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sr. No:&lt;/strong&gt; Unique identifier for each entry&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Subject:&lt;/strong&gt; Brief description of the letter&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Letter Date:&lt;/strong&gt; Date on the original letter&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Letter Number:&lt;/strong&gt; Reference number of the letter&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Letter Received Date:&lt;/strong&gt; Date when letter is received&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Letter Received Number:&lt;/strong&gt; Inward/receipt number&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Action Taken:&lt;/strong&gt; Status of processing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reply Date:&lt;/strong&gt; Date of response&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remarks:&lt;/strong&gt; Additional notes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;3. Action Tracking Logic&lt;/h2&gt;

&lt;p&gt;
The system categorizes each letter based on its processing status:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Forwarded&lt;/li&gt;
&lt;li&gt;Reverted&lt;/li&gt;
&lt;li&gt;Filed&lt;/li&gt;
&lt;li class=&quot;highlight&quot;&gt;Action Yet to be Taken (Pending cases)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
This helps in monitoring workflow and identifying pending tasks.
&lt;/p&gt;

&lt;h2&gt;4. Data Storage Mechanism&lt;/h2&gt;

&lt;h3&gt;4.1 Local Storage&lt;/h3&gt;

&lt;p&gt;
All entries are stored in the browser using &lt;strong&gt;localStorage&lt;/strong&gt;:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
localStorage.setItem(&#39;letterEntries&#39;, JSON.stringify(letterData));
&lt;/div&gt;

&lt;p&gt;
Benefits:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Fast access&lt;/li&gt;
&lt;li&gt;No server dependency&lt;/li&gt;
&lt;li&gt;Offline usability&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;4.2 Cloud Storage (Google Apps Script)&lt;/h3&gt;

&lt;p&gt;
Data is also sent to a Google Sheet using a web API:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
fetch(SCRIPT_URL, {
    method: &#39;POST&#39;,
    mode: &#39;no-cors&#39;,
    body: JSON.stringify(payload)
});
&lt;/div&gt;

&lt;p&gt;
Advantages:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Centralized record keeping&lt;/li&gt;
&lt;li&gt;Multi-user accessibility&lt;/li&gt;
&lt;li&gt;Permanent backup&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;5. Data Rendering (Table View)&lt;/h2&gt;

&lt;p&gt;
The system dynamically displays saved entries in a table using JavaScript:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
tbody.innerHTML = letterData.map(...).join(&#39;&#39;);
&lt;/div&gt;

&lt;p&gt;
Features:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Live updates&lt;/li&gt;
&lt;li&gt;Editable rows&lt;/li&gt;
&lt;li&gt;Delete functionality&lt;/li&gt;
&lt;li&gt;Horizontal scroll for wide datasets&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;6. Edit and Update Functionality&lt;/h2&gt;

&lt;p&gt;
When editing a record:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Form fields are pre-filled with existing data&lt;/li&gt;
&lt;li&gt;Submit button changes to &lt;strong&gt;&quot;Update Entry&quot;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Selected record is updated instead of creating a new one&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;code&quot;&gt;
letterData[editIndex] = payload;
&lt;/div&gt;

&lt;h2&gt;7. Delete Functionality&lt;/h2&gt;

&lt;p&gt;
Users can remove records with confirmation:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
letterData.splice(index, 1);
&lt;/div&gt;

&lt;p&gt;
This ensures data integrity and prevents accidental deletion.
&lt;/p&gt;

&lt;h2&gt;8. Backup and Restore System&lt;/h2&gt;

&lt;h3&gt;8.1 Export JSON&lt;/h3&gt;

&lt;p&gt;
Data can be exported as a backup file:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
new Blob([JSON.stringify(letterData, null, 2)], { type: &#39;application/json&#39; });
&lt;/div&gt;

&lt;h3&gt;8.2 Import JSON&lt;/h3&gt;

&lt;p&gt;
Previously saved data can be restored:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File is read using FileReader&lt;/li&gt;
&lt;li&gt;Data replaces current dataset&lt;/li&gt;
&lt;li&gt;Table updates automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;9. User Experience Enhancements&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Smooth scrolling to data table&lt;/li&gt;
&lt;li&gt;Processing indicator during submission&lt;/li&gt;
&lt;li&gt;Dynamic button state (Save → Update)&lt;/li&gt;
&lt;li&gt;Responsive layout using utility classes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;10. Workflow Summary&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;User enters correspondence details&lt;/li&gt;
&lt;li&gt;Clicks &quot;Save&quot;&lt;/li&gt;
&lt;li&gt;Data is stored locally and sent to cloud&lt;/li&gt;
&lt;li&gt;Table updates instantly&lt;/li&gt;
&lt;li&gt;User can edit/delete/export as needed&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;11. Engineering &amp; Administrative Benefits&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Efficient document tracking&lt;/li&gt;
&lt;li&gt;Reduced manual register work&lt;/li&gt;
&lt;li&gt;Easy audit and reporting&lt;/li&gt;
&lt;li&gt;Improved accountability&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;12. Limitations&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No authentication system&lt;/li&gt;
&lt;li&gt;Dependent on browser storage&lt;/li&gt;
&lt;li&gt;No validation for duplicate entries&lt;/li&gt;
&lt;li&gt;Limited error handling for API&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

    &lt;script&gt;
        const SCRIPT_URL = &#39;https://script.google.com/macros/s/AKfycbzYOWmhkHmYuA2WuPGdGRcebSVMWEENwCB8z2k2379HNyto2UIhnw_jrSm9lr4u08nuXQ/exec&#39;;
        let letterData = JSON.parse(localStorage.getItem(&#39;letterEntries&#39;)) || [];
        let editIndex = -1;

        function scrollToTable() {
            document.getElementById(&#39;tableSection&#39;).scrollIntoView({ behavior: &#39;smooth&#39; });
        }

        const renderTable = () =&gt; {
            const tbody = document.getElementById(&#39;dataTable&#39;);
            tbody.innerHTML = letterData.map((item, index) =&gt; `
                &lt;tr class=&quot;hover:bg-gray-50&quot;&gt;
                    &lt;td class=&quot;p-3 border&quot;&gt;${item.sr}&lt;/td&gt;
                    &lt;td class=&quot;p-3 border font-medium&quot;&gt;${item.subj}&lt;/td&gt;
                    &lt;td class=&quot;p-3 border&quot;&gt;${item.l_date}&lt;/td&gt;
                    &lt;td class=&quot;p-3 border&quot;&gt;${item.l_num || &#39;-&#39;}&lt;/td&gt;
                    &lt;td class=&quot;p-3 border&quot;&gt;${item.rep_date || &#39;-&#39;}&lt;/td&gt;
                    &lt;td class=&quot;p-3 border font-bold text-blue-700&quot;&gt;${item.action}&lt;/td&gt;
                    &lt;td class=&quot;p-3 border&quot;&gt;
                        &lt;div class=&quot;flex gap-2&quot;&gt;
                            &lt;button onclick=&quot;editRow(${index})&quot; class=&quot;text-blue-600 underline&quot;&gt;Edit&lt;/button&gt;
                            &lt;button onclick=&quot;deleteRow(${index})&quot; class=&quot;text-red-500 underline&quot;&gt;Delete&lt;/button&gt;
                        &lt;/div&gt;
                    &lt;/td&gt;
                    &lt;td class=&quot;p-3 border&quot;&gt;${item.rem || &#39;-&#39;}&lt;/td&gt;
                    &lt;td class=&quot;p-3 border&quot;&gt;${item.r_num || &#39;-&#39;}&lt;/td&gt;
                &lt;/tr&gt;
            `).join(&#39;&#39;);
            localStorage.setItem(&#39;letterEntries&#39;, JSON.stringify(letterData));
        };

        function editRow(index) {
    const item = letterData[index];
    editIndex = index;
    
    document.getElementById(&#39;sr&#39;).value = item.sr;
    document.getElementById(&#39;subj&#39;).value = item.subj;
    document.getElementById(&#39;l_date&#39;).value = item.l_date;
    document.getElementById(&#39;l_num&#39;).value = item.l_num;
    document.getElementById(&#39;r_date&#39;).value = item.r_date;
    document.getElementById(&#39;r_num&#39;).value = item.r_num || &#39;&#39;; // ADD THIS
    document.getElementById(&#39;action&#39;).value = item.action;
    document.getElementById(&#39;rep_date&#39;).value = item.rep_date;
    document.getElementById(&#39;rem&#39;).value = item.rem;

    const btn = document.getElementById(&#39;submitBtn&#39;);
    btn.innerText = &quot;Update Entry&quot;;
    btn.classList.add(&#39;bg-yellow-600&#39;);
    window.scrollTo({ top: 0, behavior: &#39;smooth&#39; });
}

        document.getElementById(&#39;letterForm&#39;).addEventListener(&#39;submit&#39;, async (e) =&gt; {
            e.preventDefault();
            const submitBtn = document.getElementById(&#39;submitBtn&#39;);
            submitBtn.disabled = true;
            submitBtn.innerText = &quot;Processing...&quot;;

            const payload = {
    sr: document.getElementById(&#39;sr&#39;).value,
    subj: document.getElementById(&#39;subj&#39;).value,
    l_date: document.getElementById(&#39;l_date&#39;).value,
    l_num: document.getElementById(&#39;l_num&#39;).value,
    r_date: document.getElementById(&#39;r_date&#39;).value,
    r_num: document.getElementById(&#39;r_num&#39;).value, // ADD THIS
    action: document.getElementById(&#39;action&#39;).value,
    rep_date: document.getElementById(&#39;rep_date&#39;).value,
    rem: document.getElementById(&#39;rem&#39;).value
};

            try {
                await fetch(SCRIPT_URL, { method: &#39;POST&#39;, mode: &#39;no-cors&#39;, body: JSON.stringify(payload) });

                if (editIndex === -1) {
                    letterData.push(payload);
                } else {
                    letterData[editIndex] = payload;
                    editIndex = -1;
                }

                renderTable();
                e.target.reset();
                submitBtn.innerText = &quot;Save&quot;;
                submitBtn.classList.remove(&#39;bg-yellow-600&#39;);
                
                setTimeout(scrollToTable, 500); 

            } catch (error) {
                alert(&#39;Error connecting to Sheet.&#39;);
            } finally {
                submitBtn.disabled = false;
            }
        });

        function deleteRow(index) {
            if(confirm(&quot;Delete record?&quot;)) {
                letterData.splice(index, 1);
                renderTable();
            }
        }

        function exportJSON() {
            const blob = new Blob([JSON.stringify(letterData, null, 2)], { type: &#39;application/json&#39; });
            const a = document.createElement(&#39;a&#39;);
            a.href = URL.createObjectURL(blob);
            a.download = &#39;backup.json&#39;;
            a.click();
        }

        function importJSON(event) {
            const reader = new FileReader();
            reader.onload = (e) =&gt; {
                letterData = JSON.parse(e.target.result);
                renderTable();
                scrollToTable();
            };
            reader.readAsText(event.target.files[0]);
        }

        renderTable();
    &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/03/letter-correspondence.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-8700580112072653133</guid><pubDate>Thu, 19 Mar 2026 02:32:58 +0000</pubDate><atom:updated>2026-04-06T12:21:05.699+05:30</atom:updated><title>PUMP DESIGN CALCULATION</title><description>
&lt;style&gt;
body {
    font-family: &#39;Segoe UI&#39;, Arial, sans-serif;
    background: #f4f6f9;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}
.container {
    max-width: 1100px;
    margin: auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
h1, h2 {
    color: #1a5276;
}
h2 {
    border-left: 5px solid #3498db;
    padding-left: 10px;
}
ul {
    margin-left: 20px;
}
.code {
    background: #f8f9fa;
    padding: 10px;
    border-left: 4px solid #3498db;
    font-family: monospace;
}
.highlight {
    color: #e74c3c;
    font-weight: bold;
}
&lt;/style&gt;


&lt;div id=&quot;pump-calculator-container&quot; style=&quot;font-family: &#39;Segoe UI&#39;, Arial, sans-serif; max-width: 600px; margin: 20px auto; padding: 25px; border: 1px solid #ccc; border-radius: 12px; background-color: #ffffff; box-shadow: 0 10px 20px rgba(0,0,0,0.1);&quot;&gt;
    
    &lt;div id=&quot;print-header&quot; style=&quot;display: none; text-align: center; border-bottom: 2px solid #000; margin-bottom: 20px;&quot;&gt;
        &lt;h1&gt;PUMP DESIGN CALCULATION REPORT&lt;/h1&gt;
        &lt;p&gt;Project Infrastructure Analysis | Date: &lt;span id=&quot;print-date&quot;&gt;&lt;/span&gt;&lt;/p&gt;
    &lt;/div&gt;

    &lt;h2 id=&quot;calc-title&quot; style=&quot;text-align: center; color: #1a5276; border-bottom: 2px solid #3498db; padding-bottom: 10px;&quot;&gt;Pump Design &amp; Data Logger&lt;/h2&gt;
    
    &lt;div style=&quot;display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px;&quot;&gt;
        &lt;div&gt;&lt;label&gt;Suction (z1) m:&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;z1&quot; value=&quot;0&quot; style=&quot;width:90%; padding:5px;&quot;&gt;&lt;/div&gt;
        &lt;div&gt;&lt;label&gt;Discharge (z2) m:&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;z2&quot; value=&quot;20&quot; style=&quot;width:90%; padding:5px;&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div style=&quot;margin-bottom: 15px;&quot;&gt;
        &lt;label&gt;Pipe Length (L) m:&lt;/label&gt;
        &lt;input type=&quot;number&quot; id=&quot;pipeLength&quot; value=&quot;500&quot; style=&quot;width:95%; padding:5px;&quot;&gt;
    &lt;/div&gt;
    &lt;div style=&quot;display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px;&quot;&gt;
        &lt;div&gt;&lt;label&gt;Dia (D) mm:&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;diameter&quot; value=&quot;150&quot; style=&quot;width:90%; padding:5px;&quot;&gt;&lt;/div&gt;
        &lt;div&gt;&lt;label&gt;Flow (Q) m³/hr:&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;flowRate&quot; value=&quot;50&quot; style=&quot;width:90%; padding:5px;&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;

    &lt;div id=&quot;action-buttons&quot;&gt;
        &lt;button onclick=&quot;calculateAndShow()&quot; style=&quot;width: 100%; padding: 12px; background-color: #27ae60; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; margin-bottom: 10px;&quot;&gt;1. Calculate System&lt;/button&gt;
    &lt;/div&gt;

    &lt;div id=&quot;fullResult&quot; style=&quot;margin-top: 15px; padding: 15px; background-color: #f4fbf7; border: 1px solid #d5f5e3; border-radius: 8px; display: none;&quot;&gt;
        &lt;h4 style=&quot;margin-top:0;&quot;&gt;Calculation Results:&lt;/h4&gt;
        &lt;p&gt;Static Head: &lt;span id=&quot;resStatic&quot;&gt;0&lt;/span&gt; m&lt;/p&gt;
        &lt;p&gt;Friction Loss: &lt;span id=&quot;resFric&quot;&gt;0&lt;/span&gt; m&lt;/p&gt;
        &lt;p&gt;&lt;strong&gt;Total Dynamic Head (TDH):&lt;/strong&gt; &lt;span id=&quot;resTdh&quot;&gt;0&lt;/span&gt; m&lt;/p&gt;
        &lt;p&gt;&lt;strong&gt;Required Power:&lt;/strong&gt; &lt;span id=&quot;resKw&quot;&gt;0&lt;/span&gt; kW (&lt;span id=&quot;resHp&quot;&gt;0&lt;/span&gt; HP)&lt;/p&gt;
        
        &lt;div id=&quot;export-actions&quot; style=&quot;display: flex; gap: 10px; margin-top: 15px;&quot;&gt;
            &lt;button onclick=&quot;sendToSheet()&quot; style=&quot;flex: 1; padding: 10px; background-color: #f39c12; color: white; border: none; border-radius: 4px; cursor: pointer;&quot;&gt;Save to Sheet&lt;/button&gt;
            &lt;button onclick=&quot;prepareAndPrint()&quot; style=&quot;flex: 1; padding: 10px; background-color: #34495e; color: white; border: none; border-radius: 4px; cursor: pointer;&quot;&gt;Save as PDF&lt;/button&gt;
        &lt;/div&gt;
        &lt;p id=&quot;statusMsg&quot; style=&quot;font-size: 11px; text-align: center; color: #7f8c8d; margin-top: 5px;&quot;&gt;&lt;/p&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&quot;container&quot;&gt;

&lt;h1&gt;Pump Design &amp; Data Logger – Technical Explanation&lt;/h1&gt;

&lt;p&gt;
This tool is developed for &lt;strong&gt;hydraulic pump system design&lt;/strong&gt; and performance estimation.
It calculates the &lt;strong&gt;Total Dynamic Head (TDH)&lt;/strong&gt; and required pump power based on
pipe flow conditions and elevation differences.
&lt;/p&gt;

&lt;h2&gt;1. Objective of the Tool&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Estimate pump head requirements&lt;/li&gt;
&lt;li&gt;Calculate friction losses in pipelines&lt;/li&gt;
&lt;li&gt;Determine pump power (kW and HP)&lt;/li&gt;
&lt;li&gt;Generate printable design reports&lt;/li&gt;
&lt;li&gt;Store and export calculation data&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;2. Input Parameters&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Suction Level (z₁):&lt;/strong&gt; Pump inlet elevation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discharge Level (z₂):&lt;/strong&gt; Outlet elevation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pipe Length (L):&lt;/strong&gt; Total pipeline length&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pipe Diameter (D):&lt;/strong&gt; Internal diameter of pipe&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flow Rate (Q):&lt;/strong&gt; Discharge in m³/hr&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;3. Hydraulic Calculations&lt;/h2&gt;

&lt;h3&gt;3.1 Static Head&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Static Head = z₂ - z₁
&lt;/div&gt;

&lt;p&gt;
Represents elevation difference between suction and discharge points.
&lt;/p&gt;

&lt;h3&gt;3.2 Flow Conversion&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Q (m³/s) = Q (m³/hr) / 3600
&lt;/div&gt;

&lt;p&gt;
Required for SI unit consistency.
&lt;/p&gt;

&lt;h3&gt;3.3 Pipe Diameter Conversion&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
D (m) = D (mm) / 1000
&lt;/div&gt;

&lt;h3&gt;3.4 Friction Loss (Hazen-Williams Equation)&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
hf = (10.67 × L × Q^1.852) / (C^1.852 × D^4.87)
&lt;/div&gt;

&lt;p&gt;
Where:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;hf = friction head loss (m)&lt;/li&gt;
&lt;li&gt;C = Hazen-Williams coefficient (assumed 130)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
This formula is widely used for water supply systems and provides reliable estimates for turbulent flow.
&lt;/p&gt;

&lt;h3&gt;3.5 Total Dynamic Head (TDH)&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
TDH = Static Head + Friction Loss
&lt;/div&gt;

&lt;p&gt;
This represents the total head against which the pump must operate.
&lt;/p&gt;

&lt;h3&gt;3.6 Pump Power Calculation&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Power (kW) = (ρ × g × Q × TDH) / (η × 1000)
&lt;/div&gt;

&lt;p&gt;
Where:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ρ = density of water (1000 kg/m³)&lt;/li&gt;
&lt;li&gt;g = 9.81 m/s²&lt;/li&gt;
&lt;li&gt;η = pump efficiency (assumed 75%)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;3.7 Conversion to Horsepower&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
HP = kW × 1.341
&lt;/div&gt;

&lt;h2&gt;4. System Workflow&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;User enters hydraulic parameters&lt;/li&gt;
&lt;li&gt;Clicks &lt;strong&gt;&quot;Calculate System&quot;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;System computes all hydraulic values&lt;/li&gt;
&lt;li&gt;Results are displayed instantly&lt;/li&gt;
&lt;li&gt;User can export or print results&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;5. Data Logging Feature&lt;/h2&gt;

&lt;p&gt;
The system stores the last calculation in memory:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
lastCalculation = { flow, head, friction, tdh, kw, hp }
&lt;/div&gt;

&lt;p&gt;
This enables:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Quick export to external systems&lt;/li&gt;
&lt;li&gt;Cloud storage integration&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;6. Google Sheets Integration&lt;/h2&gt;

&lt;p&gt;
The tool supports saving results to Google Sheets via API:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
fetch(scriptUrl, {
    method: &#39;POST&#39;,
    mode: &#39;no-cors&#39;,
    body: JSON.stringify(lastCalculation)
});
&lt;/div&gt;

&lt;p&gt;
Benefits:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Centralized data storage&lt;/li&gt;
&lt;li&gt;Project record keeping&lt;/li&gt;
&lt;li&gt;Multi-user accessibility&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;7. Print &amp; PDF Report Generation&lt;/h2&gt;

&lt;p&gt;
The tool includes a print-optimized layout:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hides buttons and UI elements&lt;/li&gt;
&lt;li&gt;Displays formatted report header&lt;/li&gt;
&lt;li&gt;Auto inserts current date&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;code&quot;&gt;
window.print();
&lt;/div&gt;

&lt;p&gt;
This allows generation of professional design reports.
&lt;/p&gt;

&lt;h2&gt;8. Engineering Significance&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Ensures correct pump selection&lt;/li&gt;
&lt;li&gt;Avoids under/over-design&lt;/li&gt;
&lt;li&gt;Optimizes energy consumption&lt;/li&gt;
&lt;li&gt;Improves system reliability&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;9. Assumptions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Water as working fluid&lt;/li&gt;
&lt;li&gt;Constant pipe roughness (C = 130)&lt;/li&gt;
&lt;li&gt;Pump efficiency = 75%&lt;/li&gt;
&lt;li&gt;Steady flow conditions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;10. Limitations&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No minor losses (bends, valves) considered&lt;/li&gt;
&lt;li&gt;No NPSH calculation&lt;/li&gt;
&lt;li&gt;No pump curve matching&lt;/li&gt;
&lt;li&gt;No transient flow analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;11. Conclusion&lt;/h2&gt;

&lt;p&gt;
This tool serves as a &lt;span class=&quot;highlight&quot;&gt;quick and effective hydraulic design assistant&lt;/span&gt;
for engineers. It simplifies complex calculations into a user-friendly interface while maintaining
engineering accuracy for preliminary design.
&lt;/p&gt;

&lt;p&gt;
For final pump selection, it is recommended to validate results with manufacturer pump curves
and detailed hydraulic analysis.
&lt;/p&gt;

&lt;/div&gt;

&lt;style&gt;
@media print {
    body * { visibility: hidden; }
    #pump-calculator-container, #pump-calculator-container * { visibility: visible; }
    #pump-calculator-container { position: absolute; left: 0; top: 0; width: 100%; border: none; box-shadow: none; }
    #action-buttons, #export-actions, #statusMsg { display: none !important; }
    #print-header { display: block !important; }
    input { border: none !important; background: transparent !important; }
}
&lt;/style&gt;

&lt;script&gt;
let lastCalculation = {};

function calculateAndShow() {
    const z1 = parseFloat(document.getElementById(&#39;z1&#39;).value);
    const z2 = parseFloat(document.getElementById(&#39;z2&#39;).value);
    const L = parseFloat(document.getElementById(&#39;pipeLength&#39;).value);
    const D_mm = parseFloat(document.getElementById(&#39;diameter&#39;).value);
    const Q_hr = parseFloat(document.getElementById(&#39;flowRate&#39;).value);
    
    const staticH = z2 - z1;
    const Q_sec = Q_hr / 3600;
    const D_m = D_mm / 1000;
    const hf = (10.67 * L * Math.pow(Q_sec, 1.852)) / (Math.pow(130, 1.852) * Math.pow(D_m, 4.87));
    const tdh = staticH + hf;
    const kw = (1000 * 9.81 * Q_sec * tdh) / (0.75 * 1000);
    const hp = kw * 1.341;

    lastCalculation = { flow: Q_hr, head: staticH, friction: hf.toFixed(2), tdh: tdh.toFixed(2), kw: kw.toFixed(2), hp: hp.toFixed(2) };

    document.getElementById(&#39;resStatic&#39;).innerText = staticH.toFixed(2);
    document.getElementById(&#39;resFric&#39;).innerText = hf.toFixed(2);
    document.getElementById(&#39;resTdh&#39;).innerText = tdh.toFixed(2);
    document.getElementById(&#39;resKw&#39;).innerText = kw.toFixed(2);
    document.getElementById(&#39;resHp&#39;).innerText = hp.toFixed(2);
    document.getElementById(&#39;fullResult&#39;).style.display = &#39;block&#39;;
}

function prepareAndPrint() {
    document.getElementById(&#39;print-date&#39;).innerText = new Date().toLocaleDateString();
    window.print();
}

function sendToSheet() {
    const scriptUrl = &#39;YOUR_SCRIPT_URL_HERE&#39;; 
    if(scriptUrl === &#39;YOUR_SCRIPT_URL_HERE&#39;) { alert(&quot;Please add your Google Script URL first!&quot;); return; }
    
    document.getElementById(&#39;statusMsg&#39;).innerText = &quot;Sending to Sheets...&quot;;
    fetch(scriptUrl, { method: &#39;POST&#39;, mode: &#39;no-cors&#39;, body: JSON.stringify(lastCalculation) })
    .then(() =&gt; { document.getElementById(&#39;statusMsg&#39;).innerText = &quot;Data Saved Successfully!&quot;; })
    .catch(() =&gt; { document.getElementById(&#39;statusMsg&#39;).innerText = &quot;Error saving data.&quot;; });
}
&lt;/script&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/03/pump-design-calculation.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-41499563337414015</guid><pubDate>Wed, 18 Mar 2026 18:56:55 +0000</pubDate><atom:updated>2026-04-06T12:25:22.756+05:30</atom:updated><title>Isolated footing design as per IS 456 2000</title><description>&lt;div id=&quot;footing-pro-container&quot;&gt;
    &lt;style&gt;
        #footing-pro-container {
            background: #ffffff;
            border: 1px solid #333;
            border-radius: 8px;
            padding: 20px;
            max-width: 600px;
            margin: 20px auto;
            font-family: &#39;Segoe UI&#39;, Tahoma, sans-serif;
            color: #222;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        }
        .header { text-align: center; border-bottom: 2px solid #2c3e50; margin-bottom: 20px; padding-bottom: 10px; }
        .input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
        .input-group label { display: block; font-size: 12px; font-weight: bold; margin-bottom: 5px; color: #555; }
        .input-group input { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
        
        #calc-btn {
            width: 100%;
            background: #2c3e50;
            color: white;
            padding: 15px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: bold;
            font-size: 16px;
        }
        #calc-btn:hover { background: #1a252f; }

        .report-section {
            margin-top: 25px;
            display: none;
            border-top: 2px dashed #ccc;
            padding-top: 20px;
        }
        .step { margin-bottom: 20px; padding: 10px; background: #fdfdfd; border-left: 4px solid #3498db; }
        .step-title { font-weight: bold; color: #2980b9; text-transform: uppercase; font-size: 13px; margin-bottom: 8px; }
        .formula { font-family: &#39;Courier New&#39;, monospace; background: #eee; padding: 5px; display: inline-block; margin: 5px 0; font-weight: bold; }
        .final-val { color: #c0392b; font-weight: bold; }
      
body {
    font-family: &#39;Segoe UI&#39;, Arial, sans-serif;
    background: #f4f6f9;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}
.container {
    max-width: 1100px;
    margin: auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
h1, h2 {
    color: #1a3a5a;
}
h2 {
    border-left: 5px solid #3498db;
    padding-left: 10px;
}
ul {
    margin-left: 20px;
}
.code {
    background: #f8f9fa;
    padding: 10px;
    border-left: 4px solid #3498db;
    font-family: monospace;
}
.highlight {
    color: #e74c3c;
    font-weight: bold;
}
    &lt;/style&gt;

    &lt;div class=&quot;header&quot;&gt;
        &lt;h2 style=&quot;margin:0;&quot;&gt;RCC Isolated Footing Design&lt;/h2&gt;
        &lt;small&gt;As per IS 456:2000 Standards&lt;/small&gt;
    &lt;/div&gt;

    &lt;div class=&quot;input-grid&quot;&gt;
        &lt;div class=&quot;input-group&quot;&gt;
            &lt;label&gt;Column Load (P) in kN&lt;/label&gt;
            &lt;input type=&quot;number&quot; id=&quot;P&quot; value=&quot;1000&quot;&gt;
        &lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;
            &lt;label&gt;SBC of Soil in kN/m²&lt;/label&gt;
            &lt;input type=&quot;number&quot; id=&quot;SBC&quot; value=&quot;200&quot;&gt;
        &lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;
            &lt;label&gt;Column Size (mm)&lt;/label&gt;
            &lt;input type=&quot;number&quot; id=&quot;col_size&quot; value=&quot;400&quot;&gt;
        &lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;
            &lt;label&gt;Steel Grade (fy)&lt;/label&gt;
            &lt;input type=&quot;number&quot; id=&quot;fy&quot; value=&quot;500&quot;&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;button id=&quot;calc-btn&quot; onclick=&quot;generateReport()&quot;&gt;Generate Detailed Report&lt;/button&gt;

    &lt;div id=&quot;report&quot; class=&quot;report-section&quot;&gt;
        &lt;div class=&quot;step&quot;&gt;
            &lt;div class=&quot;step-title&quot;&gt;Step 1: Required Footing Area&lt;/div&gt;
            Increasing load by 10% for self-weight...&lt;br&gt;
            &lt;div class=&quot;formula&quot;&gt;A = (P * 1.1) / SBC&lt;/div&gt;&lt;br&gt;
            Required Area: &lt;span id=&quot;r1&quot; class=&quot;final-val&quot;&gt;&lt;/span&gt; m²&lt;br&gt;
            Adopted Size: &lt;span id=&quot;r2&quot; class=&quot;final-val&quot;&gt;&lt;/span&gt; m x &lt;span id=&quot;r2_2&quot; class=&quot;final-val&quot;&gt;&lt;/span&gt; m
        &lt;/div&gt;

        &lt;div class=&quot;step&quot;&gt;
            &lt;div class=&quot;step-title&quot;&gt;Step 2: Net Upward Pressure (q)&lt;/div&gt;
            &lt;div class=&quot;formula&quot;&gt;q = P / Area_Provided&lt;/div&gt;&lt;br&gt;
            Net Pressure: &lt;span id=&quot;r3&quot; class=&quot;final-val&quot;&gt;&lt;/span&gt; kN/m²
        &lt;/div&gt;

        &lt;div class=&quot;step&quot;&gt;
            &lt;div class=&quot;step-title&quot;&gt;Step 3: Bending Moment (M)&lt;/div&gt;
            Critical section at face of column...&lt;br&gt;
            Projection (X) = (Side - Col)/2 = &lt;span id=&quot;r_x&quot;&gt;&lt;/span&gt; m&lt;br&gt;
            &lt;div class=&quot;formula&quot;&gt;M = (q * X²) / 2&lt;/div&gt;&lt;br&gt;
            Moment: &lt;span id=&quot;r4&quot; class=&quot;final-val&quot;&gt;&lt;/span&gt; kNm
        &lt;/div&gt;

        &lt;div class=&quot;step&quot;&gt;
            &lt;div class=&quot;step-title&quot;&gt;Step 4: Steel Calculation (Ast)&lt;/div&gt;
            Using Effective Depth (d) = 400mm&lt;br&gt;
            &lt;div class=&quot;formula&quot;&gt;Ast = (M * 1.5) / (0.87 * fy * j * d)&lt;/div&gt;&lt;br&gt;
            Required Ast: &lt;span id=&quot;r5&quot; class=&quot;final-val&quot;&gt;&lt;/span&gt; mm²&lt;br&gt;
            &lt;strong&gt;Result:&lt;/strong&gt; Provide 12mm bars @ &lt;span id=&quot;r6&quot;&gt;&lt;/span&gt; mm c/c.
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;container&quot;&gt;

&lt;h1&gt;RCC Isolated Footing Design Tool – Technical Explanation&lt;/h1&gt;

&lt;p&gt;
This tool is developed for the &lt;strong&gt;design of isolated footings&lt;/strong&gt; supporting individual columns,
based on guidelines from &lt;strong&gt;IS 456:2000&lt;/strong&gt;. It provides a step-by-step calculation of
footing size, soil pressure, bending moment, and reinforcement requirement.
&lt;/p&gt;

&lt;h2&gt;1. Objective of the Tool&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Determine required footing area&lt;/li&gt;
&lt;li&gt;Check soil bearing pressure&lt;/li&gt;
&lt;li&gt;Calculate bending moment at critical section&lt;/li&gt;
&lt;li&gt;Design reinforcement (Ast)&lt;/li&gt;
&lt;li&gt;Provide practical bar spacing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;2. Input Parameters&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Column Load (P):&lt;/strong&gt; Axial load on footing (kN)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Safe Bearing Capacity (SBC):&lt;/strong&gt; Soil capacity (kN/m²)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Column Size:&lt;/strong&gt; Size of column (mm)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Steel Grade (fy):&lt;/strong&gt; Yield strength of reinforcement (MPa)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;3. Design Procedure&lt;/h2&gt;

&lt;h3&gt;Step 1: Footing Area Calculation&lt;/h3&gt;

&lt;p&gt;
To account for self-weight of footing, load is increased by 10%.
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
A = (P × 1.1) / SBC
&lt;/div&gt;

&lt;p&gt;
The footing is assumed square:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
Side = √A
&lt;/div&gt;

&lt;p&gt;
The value is rounded for practical construction.
&lt;/p&gt;

&lt;h3&gt;Step 2: Net Soil Pressure&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
q = P / Area_provided
&lt;/div&gt;

&lt;p&gt;
This ensures:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Actual pressure is within SBC limits&lt;/li&gt;
&lt;li&gt;Uniform load distribution assumption&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Step 3: Bending Moment Calculation&lt;/h3&gt;

&lt;p&gt;
Critical section is taken at the face of the column.
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
Projection (X) = (Footing Size - Column Size) / 2
&lt;/div&gt;

&lt;div class=&quot;code&quot;&gt;
M = (q × X²) / 2
&lt;/div&gt;

&lt;p&gt;
Factored moment:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
Mu = 1.5 × M
&lt;/div&gt;

&lt;p&gt;
This follows limit state design principles.
&lt;/p&gt;

&lt;h3&gt;Step 4: Steel Reinforcement (Ast)&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Ast = (Mu × 10⁶) / (0.87 × fy × j × d)
&lt;/div&gt;

&lt;p&gt;
Where:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;j ≈ 0.9 (lever arm factor)&lt;/li&gt;
&lt;li&gt;d = effective depth (assumed 400 mm)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Step 5: Bar Spacing&lt;/h3&gt;

&lt;p&gt;
Using 12 mm diameter bars:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
Area of bar = 113 mm²
&lt;/div&gt;

&lt;div class=&quot;code&quot;&gt;
Spacing = (Area × 1000) / (Ast / Footing Width)
&lt;/div&gt;

&lt;p&gt;
Maximum spacing is limited:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
Spacing ≤ 300 mm
&lt;/div&gt;

&lt;h2&gt;4. Engineering Significance&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Ensures safe load transfer to soil&lt;/li&gt;
&lt;li&gt;Prevents excessive settlement&lt;/li&gt;
&lt;li&gt;Controls bending failure&lt;/li&gt;
&lt;li&gt;Provides economical reinforcement design&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;5. Assumptions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Uniform soil pressure distribution&lt;/li&gt;
&lt;li&gt;Square footing geometry&lt;/li&gt;
&lt;li&gt;Effective depth fixed at 400 mm&lt;/li&gt;
&lt;li&gt;No eccentric loading considered&lt;/li&gt;
&lt;li&gt;Only bending design (no shear checks included)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;6. Limitations&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No check for one-way shear&lt;/li&gt;
&lt;li&gt;No check for punching shear&lt;/li&gt;
&lt;li&gt;No settlement analysis&lt;/li&gt;
&lt;li&gt;No seismic or moment effects&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;7. Workflow Summary&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;User inputs load, SBC, column size, and steel grade&lt;/li&gt;
&lt;li&gt;Tool calculates required area&lt;/li&gt;
&lt;li&gt;Adopted footing size is determined&lt;/li&gt;
&lt;li&gt;Soil pressure and bending moment are computed&lt;/li&gt;
&lt;li&gt;Steel reinforcement is designed&lt;/li&gt;
&lt;li&gt;Bar spacing is suggested&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;8. Conclusion&lt;/h2&gt;

&lt;p&gt;
This tool acts as a &lt;span class=&quot;highlight&quot;&gt;rapid preliminary design assistant&lt;/span&gt; for RCC isolated footings.
It simplifies complex structural calculations into a clear step-by-step process, making it highly useful
for site engineers and designers.
&lt;/p&gt;

&lt;p&gt;
For final design, it is essential to perform detailed checks including shear, settlement,
and code compliance as per IS 456:2000.
&lt;/p&gt;

&lt;/div&gt;

    &lt;script&gt;
        function generateReport() {
            // Inputs
            const P = parseFloat(document.getElementById(&#39;P&#39;).value);
            const SBC = parseFloat(document.getElementById(&#39;SBC&#39;).value);
            const col = parseFloat(document.getElementById(&#39;col_size&#39;).value) / 1000;
            const fy = parseFloat(document.getElementById(&#39;fy&#39;).value);

            if(!P || !SBC) return;

            // Step 1: Area
            let AreaReq = (P * 1.1) / SBC;
            let Side = Math.ceil(Math.sqrt(AreaReq) * 10) / 10;
            let AreaProvided = Side * Side;

            // Step 2: Pressure
            let q = P / AreaProvided;

            // Step 3: Moment
            let X = (Side - col) / 2;
            let M = (q * Math.pow(X, 2)) / 2;
            let Mu = M * 1.5; // Factored

            // Step 4: Steel
            let d = 400; // Effective depth assumed from your image
            let Ast = (Mu * Math.pow(10, 6)) / (0.87 * fy * 0.9 * d);
            
            // Spacing for 12mm bar (Area = 113mm2)
            let spacing = (113 * 1000) / (Ast / Side); 
            if (spacing &gt; 300) spacing = 300; // Max spacing limit

            // UI Update
            document.getElementById(&#39;report&#39;).style.display = &#39;block&#39;;
            document.getElementById(&#39;r1&#39;).innerText = AreaReq.toFixed(2);
            document.getElementById(&#39;r2&#39;).innerText = Side.toFixed(2);
            document.getElementById(&#39;r2_2&#39;).innerText = Side.toFixed(2);
            document.getElementById(&#39;r3&#39;).innerText = q.toFixed(2);
            document.getElementById(&#39;r_x&#39;).innerText = X.toFixed(2);
            document.getElementById(&#39;r4&#39;).innerText = M.toFixed(2);
            document.getElementById(&#39;r5&#39;).innerText = Math.round(Ast);
            document.getElementById(&#39;r6&#39;).innerText = Math.round(spacing);
        }
    &lt;/script&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/03/isolated-footing-design-as-per-is-456.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-4082034759430863561</guid><pubDate>Wed, 18 Mar 2026 18:44:43 +0000</pubDate><atom:updated>2026-04-06T12:27:31.330+05:30</atom:updated><title>Helical Ring length calculator </title><description>&lt;div id=&quot;helical-calc-container&quot;&gt;
    &lt;style&gt;
        #helical-calc-container {
            background: #ffffff;
            border: 1px solid #d1d5db;
            border-radius: 10px;
            padding: 20px;
            max-width: 450px;
            margin: 20px auto;
            font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif;
            color: #374151;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
        .h-header { text-align: center; border-bottom: 2px solid #3b82f6; padding-bottom: 10px; margin-bottom: 20px; }
        .h-header h2 { margin: 0; font-size: 1.25rem; color: #1e40af; }
        
        .h-row { margin-bottom: 15px; }
        .h-row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
        
        .h-input {
            width: 100%;
            padding: 10px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            box-sizing: border-box;
            font-size: 15px;
        }
        .h-input:focus { outline: 2px solid #3b82f6; border-color: transparent; }

        #h-btn {
            width: 100%;
            background-color: #1e40af;
            color: white;
            border: none;
            padding: 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
            margin-top: 10px;
        }
        #h-btn:hover { background-color: #1d4ed8; }

        #h-result-box {
            margin-top: 20px;
            padding: 15px;
            background: #eff6ff;
            border-left: 5px solid #3b82f6;
            display: none;
        }
        .res-line { font-size: 1.1em; margin: 5px 0; }
        .formula-note { font-size: 0.8em; color: #6b7280; font-style: italic; margin-top: 10px; }
    &lt;/style&gt;

    &lt;div class=&quot;h-header&quot;&gt;
        &lt;h2&gt;Helical Ring Length Calculator&lt;/h2&gt;
    &lt;/div&gt;

    &lt;div class=&quot;h-row&quot;&gt;
        &lt;label&gt;Total Height of Spiral (m)&lt;/label&gt;
        &lt;input type=&quot;number&quot; id=&quot;h_height&quot; class=&quot;h-input&quot; placeholder=&quot;e.g. 3.0&quot; step=&quot;0.01&quot;&gt;
    &lt;/div&gt;

    &lt;div class=&quot;h-row&quot;&gt;
        &lt;label&gt;Diameter of Ring (m) &lt;br&gt;&lt;small&gt;(Center-to-center of bar)&lt;/small&gt;&lt;/label&gt;
        &lt;input type=&quot;number&quot; id=&quot;h_dia&quot; class=&quot;h-input&quot; placeholder=&quot;e.g. 0.5&quot; step=&quot;0.01&quot;&gt;
    &lt;/div&gt;

    &lt;div class=&quot;h-row&quot;&gt;
        &lt;label&gt;Pitch / Spacing (m)&lt;/label&gt;
        &lt;input type=&quot;number&quot; id=&quot;h_pitch&quot; class=&quot;h-input&quot; placeholder=&quot;e.g. 0.15&quot; step=&quot;0.01&quot;&gt;
    &lt;/div&gt;

    &lt;button id=&quot;h-btn&quot; onclick=&quot;calcHelical()&quot;&gt;Calculate Length&lt;/button&gt;

    &lt;div id=&quot;h-result-box&quot;&gt;
        &lt;div class=&quot;res-line&quot;&gt;Number of Turns: &lt;strong id=&quot;out_turns&quot;&gt;0&lt;/strong&gt;&lt;/div&gt;
        &lt;div class=&quot;res-line&quot;&gt;Total Bar Length: &lt;strong id=&quot;out_len&quot; style=&quot;color: #1e40af;&quot;&gt;0.00 m&lt;/strong&gt;&lt;/div&gt;
        &lt;p class=&quot;formula-note&quot;&gt;Formula: L = n × √(C² + P²)&lt;br&gt;Includes circumference and pitch incline.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class=&quot;container&quot;&gt;

&lt;h1&gt;Helical Ring Length Calculator – Technical Explanation&lt;/h1&gt;

&lt;p&gt;
This tool is designed to calculate the &lt;strong&gt;total length of helical reinforcement&lt;/strong&gt;
(commonly used in columns, piles, and spiral reinforcement systems).
It is based on fundamental geometric relationships of a helix.
&lt;/p&gt;

&lt;h2&gt;1. Objective of the Tool&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Calculate number of helical turns&lt;/li&gt;
&lt;li&gt;Determine total reinforcement length&lt;/li&gt;
&lt;li&gt;Assist in bar bending schedule (BBS)&lt;/li&gt;
&lt;li&gt;Improve accuracy in spiral reinforcement estimation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;2. Input Parameters&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Total Height (H):&lt;/strong&gt; Vertical height of spiral (m)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Diameter (D):&lt;/strong&gt; Diameter of helix (center-to-center of bar)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pitch (P):&lt;/strong&gt; Vertical spacing between turns&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;3. Geometric Concept&lt;/h2&gt;

&lt;p&gt;
A helical bar forms a &lt;strong&gt;3D spiral path&lt;/strong&gt; around a cylinder.
Each turn consists of:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Circular movement (circumference)&lt;/li&gt;
&lt;li&gt;Vertical rise (pitch)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Thus, the length of one turn is the &lt;strong&gt;hypotenuse of a right triangle&lt;/strong&gt;.
&lt;/p&gt;

&lt;h2&gt;4. Calculation Steps&lt;/h2&gt;

&lt;h3&gt;Step 1: Number of Turns&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
n = H / P
&lt;/div&gt;

&lt;p&gt;
This represents how many complete spiral loops are formed.
&lt;/p&gt;

&lt;h3&gt;Step 2: Circumference of One Turn&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
C = π × D
&lt;/div&gt;

&lt;p&gt;
This is the horizontal distance covered in one revolution.
&lt;/p&gt;

&lt;h3&gt;Step 3: Length of One Turn&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
L_turn = √(C² + P²)
&lt;/div&gt;

&lt;p&gt;
This combines horizontal and vertical components using Pythagoras theorem.
&lt;/p&gt;

&lt;h3&gt;Step 4: Total Length of Helical Bar&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Total Length = n × L_turn
&lt;/div&gt;

&lt;p&gt;
This gives the full length of reinforcement required.
&lt;/p&gt;

&lt;h2&gt;5. Engineering Significance&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Used in spiral columns and circular piles&lt;/li&gt;
&lt;li&gt;Provides confinement to concrete&lt;/li&gt;
&lt;li&gt;Improves ductility and strength&lt;/li&gt;
&lt;li&gt;Essential for seismic-resistant structures&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;6. Practical Applications&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;RCC circular columns&lt;/li&gt;
&lt;li&gt;Bored cast-in-situ piles&lt;/li&gt;
&lt;li&gt;Bridge piers&lt;/li&gt;
&lt;li&gt;Chimneys and silos&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;7. Assumptions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Uniform pitch throughout height&lt;/li&gt;
&lt;li&gt;Perfect circular geometry&lt;/li&gt;
&lt;li&gt;No allowance for hooks or laps&lt;/li&gt;
&lt;li&gt;Centerline diameter is used&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;8. Limitations&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No code-based spacing checks (IS 456 / IS 2911)&lt;/li&gt;
&lt;li&gt;No confinement ratio calculation&lt;/li&gt;
&lt;li&gt;No detailing for anchorage or laps&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;9. Workflow Summary&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;User inputs height, diameter, and pitch&lt;/li&gt;
&lt;li&gt;Tool calculates number of turns&lt;/li&gt;
&lt;li&gt;Length of one turn is computed&lt;/li&gt;
&lt;li&gt;Total reinforcement length is displayed&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;10. Conclusion&lt;/h2&gt;

&lt;p&gt;
This tool acts as a &lt;span class=&quot;highlight&quot;&gt;quick and accurate helical reinforcement calculator&lt;/span&gt;,
helping engineers and site professionals prepare bar bending schedules efficiently.
&lt;/p&gt;

&lt;p&gt;
For final design, additional checks such as spacing limits, anchorage,
and code compliance should be considered.
&lt;/p&gt;

&lt;/div&gt;

    &lt;script&gt;
        function calcHelical() {
            const H = parseFloat(document.getElementById(&#39;h_height&#39;).value);
            const D = parseFloat(document.getElementById(&#39;h_dia&#39;).value);
            const P = parseFloat(document.getElementById(&#39;h_pitch&#39;).value);
            const resBox = document.getElementById(&#39;h-result-box&#39;);

            if (!H || !D || !P) {
                alert(&quot;Please enter all dimensions in meters.&quot;);
                return;
            }

            // 1. Number of turns
            const n = H / P;
            
            // 2. Circumference (C = π * D)
            const C = Math.PI * D;
            
            // 3. Length of one turn (Hypotenuse of C and P)
            // L_turn = sqrt(C^2 + P^2)
            const oneTurnLen = Math.sqrt(Math.pow(C, 2) + Math.pow(P, 2));
            
            // 4. Total length
            const totalLen = n * oneTurnLen;

            // Display results
            resBox.style.display = &#39;block&#39;;
            document.getElementById(&#39;out_turns&#39;).innerText = n.toFixed(2);
            document.getElementById(&#39;out_len&#39;).innerText = totalLen.toFixed(3) + &quot; meters&quot;;
        }
    &lt;/script&gt;

&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/03/helical-ring-length-calculator_01175476092.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-775496378427670248</guid><pubDate>Tue, 17 Mar 2026 09:01:03 +0000</pubDate><atom:updated>2026-04-06T12:30:08.196+05:30</atom:updated><title>Invoice Calculations Verification</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;PWD Infrastructure - Monthly Bill Manager&lt;/title&gt;
    &lt;style&gt;
        body { font-family: &#39;Segoe UI&#39;, Arial, sans-serif; background-color: #f0f2f5; padding: 20px; }
        .container { max-width: 1200px; margin: auto; background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
        h2 { color: #1a73e8; border-bottom: 3px solid #1a73e8; padding-bottom: 10px; margin-top: 0; }
        
        .config-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 20px; background: #e8f0fe; padding: 15px; border-radius: 8px; border: 1px solid #1a73e8; }
        .header-grid { display: grid; grid-template-columns: 1.5fr 0.8fr 1.2fr 1fr; gap: 15px; margin-bottom: 20px; background: #f8f9fa; padding: 15px; border-radius: 8px; border-left: 5px solid #1a73e8; }
        
        .action-bar { display: flex; gap: 10px; margin-bottom: 20px; background: #fff; padding: 10px; border: 1px dashed #ccc; border-radius: 8px; }
        .btn-action { padding: 8px 15px; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 0.8rem; transition: 0.2s; }
        .btn-export { background: #673ab7; color: white; }
        .btn-import { background: #ff9800; color: white; }
        .btn-edit { background: #00bcd4; color: white; }

        .field label { display: block; font-weight: bold; margin-bottom: 5px; color: #5f6368; font-size: 0.75rem; text-transform: uppercase; }
        input { padding: 8px; border: 1px solid #dadce0; border-radius: 4px; width: 100%; box-sizing: border-box; font-size: 14px; font-weight: 600; }
        .auto-field { background-color: #e6fffa; border: 1px solid #38b2ac; color: #2c7a7b; }

        table { width: 100%; border-collapse: collapse; margin-top: 10px; }
        th { background-color: #3c4043; color: white; padding: 8px; font-size: 0.85rem; }
        td { border: 1px solid #dee2e6; padding: 6px; }
        .num { text-align: right; font-family: &#39;Consolas&#39;, monospace; }

        .footer-row { background-color: #f8f9fa; font-weight: bold; }
        .deduction { color: #d93025; }
        .net-payable { background-color: #1a73e8; color: white; font-size: 1.15rem; }

        .alert { color: #d93025; font-weight: bold; background: #fce8e6; padding: 10px; border-radius: 4px; display: none; margin-top: 15px; text-align: center; border: 1px solid #d93025; }
        .btn-save { padding: 15px 30px; border: none; border-radius: 6px; cursor: pointer; font-weight: 700; background-color: #1e8e3e; color: white; margin-top: 20px; width: 100%; font-size: 1rem; }
        .btn-save:disabled { background-color: #ccc; cursor: not-allowed; }
        
        .history-section { margin-top: 30px; border-top: 2px solid #eee; padding-top: 20px; }
        .btn-small { padding: 4px 8px; font-size: 11px; margin-left: 5px; cursor: pointer; }
      h1, h2 {
    color: #0b3d91;
}
h2 {
    border-left: 5px solid #007bff;
    padding-left: 10px;
}
ul {
    margin-left: 20px;
}
.code {
    background: #f8f9fa;
    padding: 10px;
    border-left: 4px solid #007bff;
    font-family: monospace;
}
.highlight {
    color: #d62828;
    font-weight: bold;
}
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class=&quot;container&quot;&gt;
    &lt;h2&gt;Road Project Bill Verification&lt;/h2&gt;

    &lt;div class=&quot;action-bar&quot;&gt;
        &lt;button class=&quot;btn-action btn-export&quot; onclick=&quot;exportJSON()&quot;&gt;💾 Export JSON Data&lt;/button&gt;
        &lt;button class=&quot;btn-action btn-import&quot; onclick=&quot;document.getElementById(&#39;importFile&#39;).click()&quot;&gt;📂 Import JSON&lt;/button&gt;
        &lt;input type=&quot;file&quot; id=&quot;importFile&quot; style=&quot;display:none&quot; onchange=&quot;importJSON(event)&quot;&gt;
        &lt;button class=&quot;btn-action btn-edit&quot; onclick=&quot;scrollToHistory()&quot;&gt;📋 View/Edit History&lt;/button&gt;
    &lt;/div&gt;
    
   
        &lt;div class=&quot;field&quot;&gt;&lt;label&gt;Project Cost (₹)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;totalProjectCost&quot; value=&quot;74225000&quot; oninput=&quot;calc()&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;field&quot;&gt;&lt;label&gt;Allocation (%)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;allocPercent&quot; value=&quot;100&quot; step=&quot;0.01&quot; oninput=&quot;calc()&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;field&quot;&gt;&lt;label&gt;Negotiation (%)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;negPercent&quot; value=&quot;4.59&quot; step=&quot;0.01&quot; oninput=&quot;calc()&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;field&quot;&gt;&lt;label&gt;GST Rate (%)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;gstPercent&quot; value=&quot;18&quot; oninput=&quot;calc()&quot;&gt;&lt;/div&gt;
    

   
        &lt;div class=&quot;field&quot;&gt;&lt;label&gt;Project Name&lt;/label&gt;&lt;input list=&quot;projectList&quot; id=&quot;projName&quot; value=&quot;Sinhasth Kumbh Pkg -C&quot; onchange=&quot;syncHistory()&quot;&gt;&lt;datalist id=&quot;projectList&quot;&gt;&lt;/datalist&gt;&lt;/div&gt;
        &lt;div class=&quot;field&quot;&gt;&lt;label&gt;Bill No.&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;billNo&quot; value=&quot;1&quot; class=&quot;auto-field&quot; readonly&gt;&lt;/div&gt;
        &lt;div class=&quot;field&quot;&gt;&lt;label&gt;Cumulative Prev. Paid&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;prevPaid&quot; class=&quot;auto-field&quot; readonly value=&quot;0&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;field&quot;&gt;&lt;label&gt;Budget Limit (₹)&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;budgetLimit&quot; readonly class=&quot;auto-field&quot;&gt;&lt;/div&gt;
    

    &lt;table&gt;
        &lt;thead&gt;
            &lt;tr&gt;
                &lt;th style=&quot;text-align: left;&quot;&gt;Item Description&lt;/th&gt;
                &lt;th style=&quot;width: 20%;&quot;&gt;Contract (₹)&lt;/th&gt;
                &lt;th style=&quot;width: 20%;&quot;&gt;This Month (₹)&lt;/th&gt;
                &lt;th style=&quot;width: 20%;&quot;&gt;Remaining Balance&lt;/th&gt;
            &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody id=&quot;billItems&quot;&gt;&lt;/tbody&gt;
        &lt;tfoot&gt;
            &lt;tr class=&quot;footer-row&quot;&gt;
                &lt;td colspan=&quot;2&quot;&gt;1. Sub-Total Amount (Gross)&lt;/td&gt;
                &lt;td id=&quot;subTotal&quot; class=&quot;num&quot;&gt;0.00&lt;/td&gt;
                &lt;td&gt;-&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td colspan=&quot;2&quot;&gt;2. Negotiation Amount (&lt;span id=&quot;negLab&quot;&gt;4.59&lt;/span&gt;%) [Deduction]&lt;/td&gt;
                &lt;td id=&quot;negAmt&quot; class=&quot;num deduction&quot;&gt;- 0.00&lt;/td&gt;
                &lt;td&gt;-&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr class=&quot;footer-row&quot;&gt;
                &lt;td colspan=&quot;2&quot;&gt;3. Final Total Amount (Excl. GST)&lt;/td&gt;
                &lt;td id=&quot;finalTotalExcl&quot; class=&quot;num&quot;&gt;0.00&lt;/td&gt;
                &lt;td&gt;-&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td colspan=&quot;2&quot;&gt;4. GST Amount (&lt;span id=&quot;gstLab&quot;&gt;18&lt;/span&gt;%) on Final Total&lt;/td&gt;
                &lt;td id=&quot;gstAmt&quot; class=&quot;num&quot;&gt;+ 0.00&lt;/td&gt;
                &lt;td&gt;-&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr class=&quot;net-payable&quot;&gt;
                &lt;td colspan=&quot;2&quot;&gt;NET PAYABLE AMOUNT (FOR BILL NO. &lt;span id=&quot;dispBillNo&quot;&gt;1&lt;/span&gt;)&lt;/td&gt;
                &lt;td id=&quot;netPayable&quot; class=&quot;num&quot;&gt;₹ 0.00&lt;/td&gt;
                &lt;td&gt;-&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/tfoot&gt;
    &lt;/table&gt;

    &lt;div id=&quot;budgetWarning&quot; class=&quot;alert&quot;&gt;⚠️ BUDGET EXCEEDED: Sum of all bills exceeds the allotted project funds!&lt;/div&gt;
    &lt;button id=&quot;saveBtn&quot; class=&quot;btn-save&quot; onclick=&quot;saveRecord()&quot;&gt;Submit &amp; Save Monthly Bill&lt;/button&gt;

    &lt;div class=&quot;history-section&quot; id=&quot;historySection&quot;&gt;
        &lt;h3&gt;Project History &amp; Edit Options&lt;/h3&gt;
        &lt;table id=&quot;historyTable&quot;&gt;
            &lt;thead&gt;
                &lt;tr&gt;
                    &lt;th&gt;Date&lt;/th&gt;
                    &lt;th&gt;Project&lt;/th&gt;
                    &lt;th&gt;Bill No&lt;/th&gt;
                    &lt;th&gt;Amount&lt;/th&gt;
                    &lt;th&gt;Actions&lt;/th&gt;
                &lt;/tr&gt;
            &lt;/thead&gt;
            &lt;tbody id=&quot;historyBody&quot;&gt;&lt;/tbody&gt;
        &lt;/table&gt;
    &lt;/div&gt;
&lt;/div&gt;
  
  &lt;div class=&quot;container&quot;&gt;

&lt;h1&gt;Road Project Bill Verification System – Technical Explanation&lt;/h1&gt;

&lt;p&gt;
This application is designed for &lt;strong&gt;verification, tracking, and management of road project bills&lt;/strong&gt;.
It ensures financial control by calculating payable amounts, monitoring budget limits, and maintaining
a complete history of billing records using a structured digital workflow.
&lt;/p&gt;

&lt;h2&gt;1. Objective of the System&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Verify contractor bills against project budget&lt;/li&gt;
&lt;li&gt;Apply negotiation deductions and GST calculations&lt;/li&gt;
&lt;li&gt;Track cumulative payments&lt;/li&gt;
&lt;li&gt;Prevent budget overruns&lt;/li&gt;
&lt;li&gt;Maintain digital record of all bills&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;2. Input Parameters&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Project Cost:&lt;/strong&gt; Total sanctioned project value&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allocation %:&lt;/strong&gt; Portion of budget allocated&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Negotiation %:&lt;/strong&gt; Agreed deduction percentage&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GST %:&lt;/strong&gt; Applicable tax rate&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Project Name:&lt;/strong&gt; Identifier for tracking&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bill No:&lt;/strong&gt; Auto-generated sequence&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;3. Bill Item Structure&lt;/h2&gt;

&lt;p&gt;
The system includes predefined cost heads:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Professional Staff&lt;/li&gt;
&lt;li&gt;Supporting Staff&lt;/li&gt;
&lt;li&gt;Transportation&lt;/li&gt;
&lt;li&gt;Office Expenses&lt;/li&gt;
&lt;li&gt;Training &amp; Contingencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Each item includes:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Contract Value&lt;/li&gt;
&lt;li&gt;Current Bill Amount&lt;/li&gt;
&lt;li&gt;Remaining Balance&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;4. Financial Calculation Logic&lt;/h2&gt;

&lt;h3&gt;4.1 Sub-Total (Gross Amount)&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
SubTotal = Σ(Current Bill Amounts)
&lt;/div&gt;

&lt;h3&gt;4.2 Negotiation Deduction&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Negotiation Amount = SubTotal × (Negotiation %)
&lt;/div&gt;

&lt;h3&gt;4.3 Final Amount (Excluding GST)&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Final Amount = SubTotal - Negotiation Amount
&lt;/div&gt;

&lt;h3&gt;4.4 GST Calculation&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
GST Amount = Final Amount × (GST %)
&lt;/div&gt;

&lt;h3&gt;4.5 Net Payable Amount&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Net Payable = Final Amount + GST
&lt;/div&gt;

&lt;p&gt;
This represents the total amount payable for the current bill.
&lt;/p&gt;

&lt;h2&gt;5. Budget Control Mechanism&lt;/h2&gt;

&lt;h3&gt;5.1 Budget Limit&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Budget Limit = Project Cost × Allocation %
&lt;/div&gt;

&lt;h3&gt;5.2 Total Liability Check&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
Total Liability = Previous Paid + Current Bill Amount
&lt;/div&gt;

&lt;p&gt;
If:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
Total Liability &gt; Budget Limit → Warning Triggered
&lt;/div&gt;

&lt;p class=&quot;highlight&quot;&gt;
System disables saving when budget is exceeded.
&lt;/p&gt;

&lt;h2&gt;6. Data Storage (IndexedDB)&lt;/h2&gt;

&lt;p&gt;
All billing records are stored in browser database:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
indexedDB → &quot;PWD_Final_Bills&quot;
&lt;/div&gt;

&lt;p&gt;
Each record contains:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project name&lt;/li&gt;
&lt;li&gt;Bill number&lt;/li&gt;
&lt;li&gt;Net payable amount&lt;/li&gt;
&lt;li&gt;Item-wise data&lt;/li&gt;
&lt;li&gt;Configuration (GST, negotiation, etc.)&lt;/li&gt;
&lt;li&gt;Timestamp&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;7. History &amp; Editing System&lt;/h2&gt;

&lt;p&gt;
The system maintains a full history of bills:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auto-increment bill numbers&lt;/li&gt;
&lt;li&gt;View previous records&lt;/li&gt;
&lt;li&gt;Edit/load existing entries&lt;/li&gt;
&lt;li&gt;Delete unwanted records&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;code&quot;&gt;
store.getAll() → Filter by project → Render table
&lt;/div&gt;

&lt;h2&gt;8. Import / Export Feature&lt;/h2&gt;

&lt;h3&gt;8.1 Export&lt;/h3&gt;

&lt;p&gt;
Data can be downloaded as JSON:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
JSON.stringify(records)
&lt;/div&gt;

&lt;h3&gt;8.2 Import&lt;/h3&gt;

&lt;p&gt;
Backup files can be restored into the system:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File is read using FileReader&lt;/li&gt;
&lt;li&gt;Records inserted into IndexedDB&lt;/li&gt;
&lt;li&gt;IDs regenerated automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;9. Workflow Summary&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;User enters project and bill details&lt;/li&gt;
&lt;li&gt;Inputs current bill amounts&lt;/li&gt;
&lt;li&gt;System calculates totals and deductions&lt;/li&gt;
&lt;li&gt;Budget validation is performed&lt;/li&gt;
&lt;li&gt;Bill is saved if within limit&lt;/li&gt;
&lt;li&gt;History is updated automatically&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;10. Engineering &amp; Administrative Benefits&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Prevents financial mismanagement&lt;/li&gt;
&lt;li&gt;Ensures transparency in billing&lt;/li&gt;
&lt;li&gt;Reduces manual calculation errors&lt;/li&gt;
&lt;li&gt;Provides quick audit trail&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;11. Assumptions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;All costs are inclusive of contract conditions&lt;/li&gt;
&lt;li&gt;Negotiation applies uniformly across items&lt;/li&gt;
&lt;li&gt;GST is applied on final amount only&lt;/li&gt;
&lt;li&gt;No escalation or variation considered&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;12. Limitations&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No multi-user synchronization&lt;/li&gt;
&lt;li&gt;No backend database (client-side only)&lt;/li&gt;
&lt;li&gt;No approval workflow&lt;/li&gt;
&lt;li&gt;No integration with accounting systems&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;13. Conclusion&lt;/h2&gt;

&lt;p&gt;
This system acts as a &lt;span class=&quot;highlight&quot;&gt;digital bill verification and control tool&lt;/span&gt;
for infrastructure projects. It combines financial accuracy with ease of use,
making it highly suitable for engineers, auditors, and project managers.
&lt;/p&gt;

&lt;p&gt;
For advanced deployment, the system can be extended with cloud databases,
user authentication, and integration with ERP systems.
&lt;/p&gt;

&lt;/div&gt;

&lt;script&gt;
    const lineItems = [
        [&quot;I. Professional Staff&quot;, 45975000], [&quot;II. Supporting Staff&quot;, 7650000],
        [&quot;III. Transportation&quot;, 5430000], [&quot;IV. Duty Travel&quot;, 200000],
        [&quot;V. Office Rent&quot;, 2700000], [&quot;VI. Office Supplies&quot;, 900000],
        [&quot;VII. Office Furniture&quot;, 810000], [&quot;VIII. Reports &amp; Printing&quot;, 1160000],
        [&quot;X. Training Costs&quot;, 100000], [&quot;XI. Contingencies&quot;, 1000000]
    ];

    const tbody = document.getElementById(&#39;billItems&#39;);
    lineItems.forEach((item, idx) =&gt; {
        tbody.innerHTML += `&lt;tr&gt;&lt;td&gt;${item[0]}&lt;/td&gt;
            &lt;td&gt;&lt;input type=&quot;number&quot; class=&quot;num contract-val&quot; value=&quot;${item[1]}&quot; oninput=&quot;calc()&quot;&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type=&quot;number&quot; class=&quot;num current-val&quot; value=&quot;0&quot; oninput=&quot;calc()&quot;&gt;&lt;/td&gt;
            &lt;td class=&quot;num rem-val&quot; style=&quot;color: #666;&quot;&gt;0.00&lt;/td&gt;&lt;/tr&gt;`;
    });

    let db;
    const dbReq = indexedDB.open(&quot;PWD_Final_Bills&quot;, 2);
    dbReq.onupgradeneeded = (e) =&gt; {
        db = e.target.result;
        if(!db.objectStoreNames.contains(&quot;bills&quot;)) {
            db.createObjectStore(&quot;bills&quot;, { keyPath: &quot;id&quot;, autoIncrement: true });
        }
    };
    dbReq.onsuccess = (e) =&gt; { db = e.target.result; updateDatalist(); syncHistory(); };

    function syncHistory() {
        const proj = document.getElementById(&#39;projName&#39;).value;
        const tx = db.transaction(&quot;bills&quot;, &quot;readonly&quot;);
        const store = tx.objectStore(&quot;bills&quot;);
        store.getAll().onsuccess = (e) =&gt; {
            const allRecords = e.target.result;
            const history = allRecords.filter(r =&gt; r.project === proj);
            const lastNo = history.length &gt; 0 ? Math.max(...history.map(r =&gt; r.billNo)) : 0;
            
            document.getElementById(&#39;billNo&#39;).value = lastNo + 1;
            document.getElementById(&#39;dispBillNo&#39;).innerHTML = lastNo + 1;
            document.getElementById(&#39;prevPaid&#39;).value = history.reduce((sum, r) =&gt; sum + r.netAmount, 0).toFixed(2);
            
            renderHistoryTable(allRecords);
            calc();
        };
    }

    function calc() {
        const limit = (parseFloat(document.getElementById(&#39;totalProjectCost&#39;).value) || 0) * ((parseFloat(document.getElementById(&#39;allocPercent&#39;).value) || 0) / 100);
        document.getElementById(&#39;budgetLimit&#39;).value = &quot;₹ &quot; + limit.toLocaleString(&#39;en-IN&#39;);

        let subTotal = 0;
        document.querySelectorAll(&quot;#billItems tr&quot;).forEach(row =&gt; {
            const cont = parseFloat(row.querySelector(&quot;.contract-val&quot;).value) || 0;
            const curr = parseFloat(row.querySelector(&quot;.current-val&quot;).value) || 0;
            row.querySelector(&quot;.rem-val&quot;).innerHTML = (cont - curr).toLocaleString(&#39;en-IN&#39;);
            subTotal += curr;
        });

        const negRate = (parseFloat(document.getElementById(&#39;negPercent&#39;).value) || 0) / 100;
        const gstRate = (parseFloat(document.getElementById(&#39;gstPercent&#39;).value) || 0) / 100;
        
        const negAmt = subTotal * negRate;
        const finalExcl = subTotal - negAmt;
        const gstAmt = finalExcl * gstRate;
        const netPayable = finalExcl + gstAmt;

        document.getElementById(&#39;negLab&#39;).innerHTML = (negRate * 100).toFixed(2);
        document.getElementById(&#39;gstLab&#39;).innerHTML = (gstRate * 100).toFixed(0);
        document.getElementById(&#39;subTotal&#39;).innerHTML = subTotal.toLocaleString(&#39;en-IN&#39;, {minimumFractionDigits: 2});
        document.getElementById(&#39;negAmt&#39;).innerHTML = &quot;- &quot; + negAmt.toLocaleString(&#39;en-IN&#39;, {minimumFractionDigits: 2});
        document.getElementById(&#39;finalTotalExcl&#39;).innerHTML = finalExcl.toLocaleString(&#39;en-IN&#39;, {minimumFractionDigits: 2});
        document.getElementById(&#39;gstAmt&#39;).innerHTML = &quot;+ &quot; + gstAmt.toLocaleString(&#39;en-IN&#39;, {minimumFractionDigits: 2});
        document.getElementById(&#39;netPayable&#39;).innerHTML = &quot;₹ &quot; + netPayable.toLocaleString(&#39;en-IN&#39;, {minimumFractionDigits: 2});

        const totalLiability = (parseFloat(document.getElementById(&#39;prevPaid&#39;).value) || 0) + netPayable;
        const warn = document.getElementById(&#39;budgetWarning&#39;);
        const saveBtn = document.getElementById(&#39;saveBtn&#39;);
        
        const isOverBudget = totalLiability &gt; limit;
        warn.style.display = isOverBudget ? &quot;block&quot; : &quot;none&quot;;
        saveBtn.disabled = isOverBudget;
        window.currentNet = netPayable;
    }

    function saveRecord() {
        const tx = db.transaction(&quot;bills&quot;, &quot;readwrite&quot;);
        // Capture current state of inputs to allow for &quot;editing&quot; later
        const currentInputs = Array.from(document.querySelectorAll(&#39;.current-val&#39;)).map(i =&gt; i.value);
        const contractInputs = Array.from(document.querySelectorAll(&#39;.contract-val&#39;)).map(i =&gt; i.value);

        const entry = {
            project: document.getElementById(&#39;projName&#39;).value,
            billNo: parseInt(document.getElementById(&#39;billNo&#39;).value),
            netAmount: window.currentNet,
            config: {
                totalCost: document.getElementById(&#39;totalProjectCost&#39;).value,
                neg: document.getElementById(&#39;negPercent&#39;).value,
                gst: document.getElementById(&#39;gstPercent&#39;).value,
                alloc: document.getElementById(&#39;allocPercent&#39;).value
            },
            items: currentInputs,
            contracts: contractInputs,
            timestamp: new Date().toLocaleString()
        };
        tx.objectStore(&quot;bills&quot;).add(entry).onsuccess = () =&gt; {
            alert(`Successfully Saved Bill No. ${entry.billNo}`);
            updateDatalist();
            syncHistory();
        };
    }

    function renderHistoryTable(records) {
        const hBody = document.getElementById(&#39;historyBody&#39;);
        hBody.innerHTML = records.map(r =&gt; `
            &lt;tr&gt;
                &lt;td&gt;${r.timestamp}&lt;/td&gt;
                &lt;td&gt;${r.project}&lt;/td&gt;
                &lt;td&gt;${r.billNo}&lt;/td&gt;
                &lt;td&gt;₹${r.netAmount.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
                &lt;td&gt;
                    &lt;button class=&quot;btn-small&quot; style=&quot;background:#00bcd4; color:white;&quot; onclick=&#39;loadRecord(${JSON.stringify(r)})&#39;&gt;Edit/Load&lt;/button&gt;
                    &lt;button class=&quot;btn-small&quot; style=&quot;background:#f44336; color:white;&quot; onclick=&quot;deleteRecord(${r.id})&quot;&gt;Del&lt;/button&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
        `).join(&#39;&#39;);
    }

    function loadRecord(record) {
        if(!confirm(&quot;Load this record? Current unsaved changes will be lost.&quot;)) return;
        document.getElementById(&#39;projName&#39;).value = record.project;
        document.getElementById(&#39;totalProjectCost&#39;).value = record.config.totalCost;
        document.getElementById(&#39;negPercent&#39;).value = record.config.neg;
        document.getElementById(&#39;gstPercent&#39;).value = record.config.gst;
        document.getElementById(&#39;allocPercent&#39;).value = record.config.alloc;
        
        const currentInputs = document.querySelectorAll(&#39;.current-val&#39;);
        const contractInputs = document.querySelectorAll(&#39;.contract-val&#39;);
        
        record.items.forEach((val, i) =&gt; currentInputs[i].value = val);
        record.contracts.forEach((val, i) =&gt; contractInputs[i].value = val);
        
        calc();
        window.scrollTo(0,0);
    }

    function deleteRecord(id) {
        if(confirm(&quot;Permanently delete this record?&quot;)) {
            const tx = db.transaction(&quot;bills&quot;, &quot;readwrite&quot;);
            tx.objectStore(&quot;bills&quot;).delete(id).onsuccess = () =&gt; syncHistory();
        }
    }

    function exportJSON() {
        const tx = db.transaction(&quot;bills&quot;, &quot;readonly&quot;);
        tx.objectStore(&quot;bills&quot;).getAll().onsuccess = (e) =&gt; {
            const dataStr = &quot;data:text/json;charset=utf-8,&quot; + encodeURIComponent(JSON.stringify(e.target.result));
            const downloadAnchorNode = document.createElement(&#39;a&#39;);
            downloadAnchorNode.setAttribute(&quot;href&quot;, dataStr);
            downloadAnchorNode.setAttribute(&quot;download&quot;, &quot;pwd_billing_backup.json&quot;);
            document.body.appendChild(downloadAnchorNode);
            downloadAnchorNode.click();
            downloadAnchorNode.remove();
        };
    }

    function importJSON(event) {
        const file = event.target.files[0];
        if (!file) return;
        const reader = new FileReader();
        reader.onload = (e) =&gt; {
            const data = JSON.parse(e.target.result);
            const tx = db.transaction(&quot;bills&quot;, &quot;readwrite&quot;);
            const store = tx.objectStore(&quot;bills&quot;);
            data.forEach(item =&gt; {
                delete item.id; // Allow IndexedDB to generate new IDs
                store.add(item);
            });
            tx.oncomplete = () =&gt; {
                alert(&quot;Import Successful!&quot;);
                syncHistory();
                updateDatalist();
            };
        };
        reader.readAsText(file);
    }

    function updateDatalist() {
        const tx = db.transaction(&quot;bills&quot;, &quot;readonly&quot;);
        tx.objectStore(&quot;bills&quot;).getAll().onsuccess = (e) =&gt; {
            const projects = [...new Set(e.target.result.map(r =&gt; r.project))];
            document.getElementById(&#39;projectList&#39;).innerHTML = projects.map(p =&gt; `&lt;option value=&quot;${p}&quot;&gt;`).join(&#39;&#39;);
        };
    }

    function scrollToHistory() {
        document.getElementById(&#39;historySection&#39;).scrollIntoView({behavior: &#39;smooth&#39;});
    }
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/03/invoice-calculations-verification.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-7864331520127220443</guid><pubDate>Tue, 17 Mar 2026 07:56:48 +0000</pubDate><atom:updated>2026-04-06T12:33:04.615+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">PWD Working</category><title>Expenditure Tracker</title><description>&lt;div id=&quot;pwd-tracker-root&quot;&gt;
&lt;style&gt;
    /* Scoping everything to #pwd-tracker-root to prevent clashing with Blogger Theme */
    #pwd-tracker-root {
        --primary: #2563eb;
        --success: #10b981;
        --danger: #ef4444;
        --bg: #f8fafc;
        font-family: &#39;Segoe UI&#39;, Tahoma, Geneva, Verdana, sans-serif;
        background: var(--bg);
        padding: 10px;
        color: #1e293b;
        border-radius: 8px;
    }
    #pwd-tracker-root .container {
        max-width: 100%;
        margin: auto;
        background: white;
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    #pwd-tracker-root .section {
        margin-bottom: 25px;
        padding: 15px;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
    }
    #pwd-tracker-root .master-ts { background: #fffcf0; border-color: #fde68a; }
    #pwd-tracker-root .ra-bill { border-left: 6px solid var(--primary); background: #fff; margin-bottom: 20px; }

    /* Blogger Mobile Responsive Fix */
    #pwd-tracker-root .scroll-wrapper {
        width: 100%;
        overflow-x: auto;
        margin-bottom: 15px;
        border: 1px solid #e2e8f0;
        background: #fff;
    }

    /* Fixed Header Grid for Blogger */
    #pwd-tracker-root .header-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 15px;
        padding: 10px;
    }

    #pwd-tracker-root .bill-grid {
        display: grid;
        grid-template-columns: 250px 140px 140px 300px 60px;
        gap: 10px;
        padding: 10px;
        min-width: 900px;
        align-items: center;
    }

    #pwd-tracker-root .bill-header {
        background: #f1f5f9;
        font-weight: bold;
        font-size: 0.8em;
        text-transform: uppercase;
    }

    #pwd-tracker-root input, #pwd-tracker-root select {
        padding: 8px;
        border: 1px solid #cbd5e1;
        border-radius: 4px;
        width: 100%;
        box-sizing: border-box;
    }

    #pwd-tracker-root label {
        font-size: 0.75em;
        font-weight: 700;
        color: #64748b;
        display: block;
        margin-bottom: 4px;
    }

    #pwd-tracker-root .btn {
        padding: 8px 16px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-weight: 600;
        transition: 0.2s;
    }
    #pwd-tracker-root .btn-add { background: var(--success); color: white; }
    #pwd-tracker-root .btn-bill { background: var(--primary); color: white; }
    #pwd-tracker-root .btn-save { background: #1e293b; color: white; width: 100%; margin-top: 10px; padding: 12px; }
    #pwd-tracker-root .btn-del { background: var(--danger); color: white; padding: 4px 8px; font-size: 11px; }

    #pwd-tracker-root .summary-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 800px;
    }
    #pwd-tracker-root .summary-table th, #pwd-tracker-root .summary-table td {
        border: 1px solid #e2e8f0;
        padding: 10px;
        text-align: left;
        font-size: 13px;
    }
    #pwd-tracker-root .status-pill {
        padding: 3px 8px;
        border-radius: 12px;
        font-size: 10px;
        font-weight: bold;
    }
    #pwd-tracker-root .pill-ok { background: #dcfce7; color: #166534; }
    #pwd-tracker-root .pill-error { background: #fee2e2; color: #991b1b; }
  h1, h2 {
    color: #1e3a8a;
}
h2 {
    border-left: 5px solid #2563eb;
    padding-left: 10px;
}
ul {
    margin-left: 20px;
}
.code {
    background: #f8f9fa;
    padding: 10px;
    border-left: 4px solid #2563eb;
    font-family: monospace;
}
.highlight {
    color: #dc2626;
    font-weight: bold;
}
&lt;/style&gt;

&lt;div class=&quot;container&quot;&gt;
    &lt;h2 style=&quot;text-align:center; color: #2563eb;&quot;&gt;Infrastructure Project Dashboard&lt;/h2&gt;
  
  &lt;div class=&quot;section&quot; style=&quot;background: #f8fafc; border: 1px dashed #cbd5e1; display: flex; gap: 10px; justify-content: center;&quot;&gt;
    &lt;button class=&quot;btn&quot; style=&quot;background: #059669;&quot; onclick=&quot;exportProjectJSON()&quot;&gt;📤 Export Backup (JSON)&lt;/button&gt;
    &lt;button class=&quot;btn&quot; style=&quot;background: #7c3aed;&quot; onclick=&quot;triggerImport()&quot;&gt;📥 Import Backup (JSON)&lt;/button&gt;
    &lt;input type=&quot;file&quot; id=&quot;importFile&quot; style=&quot;display:none&quot; accept=&quot;.json&quot; onchange=&quot;importProjectJSON(event)&quot;&gt;
&lt;/div&gt;

    &lt;div class=&quot;section&quot;&gt;
        &lt;h3&gt;General Project Information&lt;/h3&gt;
        &lt;div class=&quot;header-grid&quot;&gt;
            &lt;div style=&quot;grid-column: span 2;&quot;&gt;&lt;label&gt;Project Name&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;projName&quot; placeholder=&quot;Enter Full Name of Work&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;label&gt;Work Code / Job No.&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;workCode&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;label&gt;Division&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;division&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;header-grid&quot;&gt;
            &lt;div&gt;&lt;label&gt;Admin Approval (AA) (₹)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;adminAmt&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;label&gt;AA Ref No. &amp; Date&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;aaRef&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;label&gt;Technical Sanction (TS) (₹)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;totalTS&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;label&gt;TS Ref No. &amp; Date&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;tsRef&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;header-grid&quot;&gt;
            &lt;div&gt;&lt;label&gt;Tendered Amount (₹)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;tenderAmt&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;label&gt;Contractor Name&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;contractor&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;label&gt;Commencement Date&lt;/label&gt;&lt;input type=&quot;date&quot; id=&quot;startDate&quot;&gt;&lt;/div&gt;
            &lt;div&gt;&lt;label&gt;Stipulated Completion&lt;/label&gt;&lt;input type=&quot;date&quot; id=&quot;endDate&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class=&quot;section master-ts&quot;&gt;
        &lt;div style=&quot;display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;&quot;&gt;
            &lt;h3 style=&quot;margin:0;&quot;&gt;1. Master TS Components&lt;/h3&gt;
            &lt;button class=&quot;btn btn-add&quot; onclick=&quot;addMasterRow()&quot;&gt;+ Add Component&lt;/button&gt;
        &lt;/div&gt;
        &lt;div class=&quot;scroll-wrapper&quot;&gt;
            &lt;div class=&quot;bill-grid bill-header&quot; style=&quot;grid-template-columns: 2fr 1fr 80px; min-width: 500px;&quot;&gt;
                &lt;div&gt;Component Name&lt;/div&gt;&lt;div&gt;TS Amount (₹)&lt;/div&gt;&lt;div&gt;Action&lt;/div&gt;
            &lt;/div&gt;
            &lt;div id=&quot;master-list&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class=&quot;section&quot;&gt;
        &lt;div style=&quot;display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;&quot;&gt;
            &lt;h3 style=&quot;margin:0;&quot;&gt;2. RA Bill Entries&lt;/h3&gt;
            &lt;button class=&quot;btn btn-bill&quot; onclick=&quot;addNewBill()&quot;&gt;+ New RA Bill&lt;/button&gt;
        &lt;/div&gt;
        &lt;div id=&quot;bills-container&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;

    &lt;div class=&quot;section&quot;&gt;
        &lt;h3&gt;3. Cumulative Summary&lt;/h3&gt;
        &lt;div class=&quot;scroll-wrapper&quot;&gt;
            &lt;table class=&quot;summary-table&quot;&gt;
                &lt;thead&gt;
                    &lt;tr&gt;
                        &lt;th&gt;Description&lt;/th&gt;
                        &lt;th&gt;TS Amount&lt;/th&gt;
                        &lt;th&gt;Expended&lt;/th&gt;
                        &lt;th&gt;Balance&lt;/th&gt;
                        &lt;th&gt;Status&lt;/th&gt;
                    &lt;/tr&gt;
                &lt;/thead&gt;
                &lt;tbody id=&quot;summary-body&quot;&gt;&lt;/tbody&gt;
            &lt;/table&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;button class=&quot;btn btn-save&quot; onclick=&quot;saveToDB()&quot;&gt;💾 Save Project Data &amp; Update Records&lt;/button&gt;
&lt;/div&gt;
  
&lt;div class=&quot;container&quot;&gt;

&lt;h1&gt;Infrastructure Project Dashboard – Technical Explanation&lt;/h1&gt;

&lt;p&gt;
This application is a &lt;strong&gt;comprehensive project monitoring and expenditure tracking system&lt;/strong&gt;
designed for infrastructure works. It integrates project data management, bill tracking, and
financial control into a single dashboard using browser-based storage.
&lt;/p&gt;

&lt;h2&gt;1. Objective of the System&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Manage project-level administrative and financial data&lt;/li&gt;
&lt;li&gt;Track Technical Sanction (TS) components&lt;/li&gt;
&lt;li&gt;Monitor RA (Running Account) bills&lt;/li&gt;
&lt;li&gt;Provide real-time expenditure vs budget comparison&lt;/li&gt;
&lt;li&gt;Enable backup and restoration of project data&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;2. General Project Information&lt;/h2&gt;

&lt;p&gt;
The system captures key administrative details:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project Name, Work Code, Division&lt;/li&gt;
&lt;li&gt;Administrative Approval (AA)&lt;/li&gt;
&lt;li&gt;Technical Sanction (TS)&lt;/li&gt;
&lt;li&gt;Tendered Amount&lt;/li&gt;
&lt;li&gt;Contractor Details&lt;/li&gt;
&lt;li&gt;Project Timeline (Start &amp; Completion)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
These parameters form the base for financial and progress tracking.
&lt;/p&gt;

&lt;h2&gt;3. Master TS Components&lt;/h2&gt;

&lt;p&gt;
The project is divided into multiple components such as:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Civil Work&lt;/li&gt;
&lt;li&gt;Royalty&lt;/li&gt;
&lt;li&gt;Insurance&lt;/li&gt;
&lt;li&gt;Other custom components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Each component includes:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
Component Name + TS Amount
&lt;/div&gt;

&lt;p&gt;
This defines the &lt;strong&gt;maximum allowable expenditure&lt;/strong&gt; for each category.
&lt;/p&gt;

&lt;h2&gt;4. RA Bill Management&lt;/h2&gt;

&lt;p&gt;
The system allows multiple RA bills, each containing:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bill Name (e.g., 1st RA, 2nd RA)&lt;/li&gt;
&lt;li&gt;Component-wise expenditure&lt;/li&gt;
&lt;li&gt;Remarks for each entry&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Each bill dynamically links to master components:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
Selected Component → Fetch TS Limit → Enter Current Amount
&lt;/div&gt;

&lt;h2&gt;5. Real-Time Synchronization Logic&lt;/h2&gt;

&lt;p&gt;
The core function &lt;strong&gt;syncAll()&lt;/strong&gt; performs:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Updates dropdown options from master list&lt;/li&gt;
&lt;li&gt;Displays TS limits dynamically&lt;/li&gt;
&lt;li&gt;Aggregates expenditure across all bills&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;code&quot;&gt;
Total Expended = Σ (All RA Bills for each component)
&lt;/div&gt;

&lt;h2&gt;6. Cumulative Summary Calculation&lt;/h2&gt;

&lt;p&gt;
For each component:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
Balance = TS Amount - Total Expended
&lt;/div&gt;

&lt;p&gt;
Status is determined as:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
If Balance &lt; 0 → OVER (Budget Exceeded)
Else → OK
&lt;/div&gt;

&lt;p class=&quot;highlight&quot;&gt;
Negative balance indicates overspending and requires immediate attention.
&lt;/p&gt;

&lt;h2&gt;7. Data Storage (IndexedDB)&lt;/h2&gt;

&lt;p&gt;
All project data is stored in browser database:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
Database: PWD_Blogger_DB  
Store: projects  
Key: id = &quot;p1&quot;
&lt;/div&gt;

&lt;p&gt;
Stored data includes:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project details&lt;/li&gt;
&lt;li&gt;Master components&lt;/li&gt;
&lt;li&gt;All RA bills&lt;/li&gt;
&lt;li&gt;Item-wise expenditure&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;8. Save &amp; Load Mechanism&lt;/h2&gt;

&lt;h3&gt;Saving Data&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
objectStore.put(projectData)
&lt;/div&gt;

&lt;p&gt;
Ensures persistent storage within browser.
&lt;/p&gt;

&lt;h3&gt;Loading Data&lt;/h3&gt;

&lt;div class=&quot;code&quot;&gt;
objectStore.get(&quot;p1&quot;)
&lt;/div&gt;

&lt;p&gt;
Automatically restores previous session data.
&lt;/p&gt;

&lt;h2&gt;9. Import / Export Feature&lt;/h2&gt;

&lt;h3&gt;Export&lt;/h3&gt;

&lt;p&gt;
Project data is exported as JSON:
&lt;/p&gt;

&lt;div class=&quot;code&quot;&gt;
JSON.stringify(data, null, 2)
&lt;/div&gt;

&lt;h3&gt;Import&lt;/h3&gt;

&lt;p&gt;
The system:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reads JSON file&lt;/li&gt;
&lt;li&gt;Validates structure&lt;/li&gt;
&lt;li&gt;Saves to IndexedDB&lt;/li&gt;
&lt;li&gt;Reloads dashboard&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;10. Workflow Summary&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Enter project details&lt;/li&gt;
&lt;li&gt;Define TS components&lt;/li&gt;
&lt;li&gt;Add RA bills&lt;/li&gt;
&lt;li&gt;Input expenditure values&lt;/li&gt;
&lt;li&gt;System calculates totals and balances&lt;/li&gt;
&lt;li&gt;Monitor status (OK / OVER)&lt;/li&gt;
&lt;li&gt;Save data or export backup&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;11. Engineering &amp; Management Benefits&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Real-time budget monitoring&lt;/li&gt;
&lt;li&gt;Prevents overspending&lt;/li&gt;
&lt;li&gt;Centralized project tracking&lt;/li&gt;
&lt;li&gt;Improves transparency and accountability&lt;/li&gt;
&lt;li&gt;Reduces manual errors&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;12. Assumptions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;All TS values are fixed and approved&lt;/li&gt;
&lt;li&gt;RA bills are cumulative in nature&lt;/li&gt;
&lt;li&gt;No variation orders considered&lt;/li&gt;
&lt;li&gt;Single-user environment&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;13. Limitations&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;No cloud synchronization&lt;/li&gt;
&lt;li&gt;No multi-user collaboration&lt;/li&gt;
&lt;li&gt;No approval workflow&lt;/li&gt;
&lt;li&gt;No integration with accounting systems&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;14. Conclusion&lt;/h2&gt;

&lt;p&gt;
This dashboard functions as a &lt;span class=&quot;highlight&quot;&gt;powerful project expenditure tracking tool&lt;/span&gt;,
combining financial control with ease of use. It is especially useful for engineers,
project managers, and administrative authorities handling infrastructure works.
&lt;/p&gt;

&lt;p&gt;
Future enhancements may include cloud integration, real-time collaboration,
and advanced analytics dashboards.
&lt;/p&gt;

&lt;/div&gt;

&lt;script&gt;
    let db;
    let masterItems = [];

    // Initialize Database
    const request = indexedDB.open(&quot;PWD_Blogger_DB&quot;, 1);
    request.onupgradeneeded = e =&gt; {
        db = e.target.result;
        db.createObjectStore(&quot;projects&quot;, { keyPath: &quot;id&quot; });
    };
    request.onsuccess = e =&gt; { 
        db = e.target.result; 
        loadData(); 
    };

    function addMasterRow(name = &quot;&quot;, val = 0) {
        const id = &#39;m-&#39; + Date.now() + Math.random();
        const div = document.createElement(&#39;div&#39;);
        div.className = &#39;bill-grid&#39;;
        div.id = id;
        div.style.gridTemplateColumns = &quot;2fr 1fr 80px&quot;;
        div.style.minWidth = &quot;500px&quot;;
        div.innerHTML = `
            &lt;input type=&quot;text&quot; class=&quot;m-name&quot; value=&quot;${name}&quot; placeholder=&quot;Item Name&quot; oninput=&quot;syncAll()&quot;&gt;
            &lt;input type=&quot;number&quot; class=&quot;m-val&quot; value=&quot;${val}&quot; oninput=&quot;syncAll()&quot;&gt;
            &lt;button class=&quot;btn btn-del&quot; onclick=&quot;document.getElementById(&#39;${id}&#39;).remove(); syncAll();&quot;&gt;X&lt;/button&gt;
        `;
        document.getElementById(&#39;master-list&#39;).appendChild(div);
        syncAll();
    }

    function addNewBill(data = null) {
        const id = data ? data.id : &#39;bill-&#39; + Date.now();
        const div = document.createElement(&#39;div&#39;);
        div.className = &#39;section ra-bill&#39;;
        div.id = id;
        div.innerHTML = `
            &lt;div style=&quot;display:flex; justify-content:space-between; margin-bottom:10px;&quot;&gt;
                &lt;input type=&quot;text&quot; class=&quot;bill-no&quot; value=&quot;${data ? data.no : &#39;&#39;}&quot; placeholder=&quot;Bill Name (e.g. 1st RA)&quot; style=&quot;width:200px; font-weight:bold;&quot;&gt;
                &lt;button class=&quot;btn btn-del&quot; onclick=&quot;document.getElementById(&#39;${id}&#39;).remove(); syncAll();&quot;&gt;Delete Bill&lt;/button&gt;
            &lt;/div&gt;
            &lt;div class=&quot;scroll-wrapper&quot;&gt;
                &lt;div class=&quot;bill-grid bill-header&quot;&gt;
                    &lt;div&gt;Component&lt;/div&gt;&lt;div&gt;TS Limit&lt;/div&gt;&lt;div&gt;Current (₹)&lt;/div&gt;&lt;div&gt;Remarks&lt;/div&gt;&lt;div&gt;&lt;/div&gt;
                &lt;/div&gt;
                &lt;div id=&quot;rows-${id}&quot;&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;button class=&quot;btn btn-add&quot; style=&quot;font-size:11px; margin-top:5px;&quot; onclick=&quot;addItemToBill(&#39;${id}&#39;)&quot;&gt;+ Add Row&lt;/button&gt;
        `;
        document.getElementById(&#39;bills-container&#39;).prepend(div);
        if (data &amp;&amp; data.items) {
            data.items.forEach(i =&gt; addItemToBill(id, i.name, i.amt, i.remark));
        } else { addItemToBill(id); }
    }

    function addItemToBill(billId, sName = &quot;&quot;, amt = 0, remark = &quot;&quot;) {
        const div = document.createElement(&#39;div&#39;);
        div.className = &#39;bill-grid&#39;;
        let options = masterItems.map(m =&gt; `&lt;option value=&quot;${m.name}&quot; ${m.name === sName ? &#39;selected&#39; : &#39;&#39;}&gt;${m.name}&lt;/option&gt;`).join(&#39;&#39;);
        div.innerHTML = `
            &lt;select class=&quot;ra-sel&quot; onchange=&quot;syncAll()&quot;&gt;
                &lt;option value=&quot;&quot;&gt;-- Item --&lt;/option&gt;${options}
            &lt;/select&gt;
            &lt;div class=&quot;ts-disp&quot; style=&quot;font-weight:bold; color:var(--primary);&quot;&gt;0&lt;/div&gt;
            &lt;input type=&quot;number&quot; class=&quot;ra-amt&quot; value=&quot;${amt}&quot; oninput=&quot;syncAll()&quot;&gt;
            &lt;input type=&quot;text&quot; class=&quot;ra-rem&quot; value=&quot;${remark}&quot; placeholder=&quot;Notes&quot;&gt;
            &lt;button class=&quot;btn btn-del&quot; onclick=&quot;this.parentElement.remove(); syncAll();&quot;&gt;X&lt;/button&gt;
        `;
        document.getElementById(`rows-${billId}`).appendChild(div);
        syncAll();
    }

    function syncAll() {
        masterItems = Array.from(document.querySelectorAll(&#39;#master-list .bill-grid&#39;)).map(row =&gt; ({
            name: row.querySelector(&#39;.m-name&#39;).value,
            ts: parseFloat(row.querySelector(&#39;.m-val&#39;).value) || 0
        }));

        document.querySelectorAll(&#39;.ra-bill&#39;).forEach(bill =&gt; {
            bill.querySelectorAll(&#39;.bill-grid:not(.bill-header)&#39;).forEach(row =&gt; {
                const select = row.querySelector(&#39;.ra-sel&#39;);
                const cur = select.value;
                const tsDisp = row.querySelector(&#39;.ts-disp&#39;);
                select.innerHTML = `&lt;option value=&quot;&quot;&gt;-- Item --&lt;/option&gt;` + masterItems.map(m =&gt; `&lt;option value=&quot;${m.name}&quot; ${m.name === cur ? &#39;selected&#39; : &#39;&#39;}&gt;${m.name}&lt;/option&gt;`).join(&#39;&#39;);
                const match = masterItems.find(m =&gt; m.name === cur);
                tsDisp.innerHTML = match ? match.ts.toLocaleString(&#39;en-IN&#39;) : &quot;0&quot;;
            });
        });

        const totals = {};
        masterItems.forEach(m =&gt; totals[m.name] = { ts: m.ts, exp: 0 });
        document.querySelectorAll(&#39;.ra-bill .ra-amt&#39;).forEach(input =&gt; {
            const name = input.closest(&#39;.bill-grid&#39;).querySelector(&#39;.ra-sel&#39;).value;
            if (name &amp;&amp; totals[name]) totals[name].exp += parseFloat(input.value) || 0;
        });

        const tbody = document.getElementById(&#39;summary-body&#39;);
        tbody.innerHTML = &#39;&#39;;
        for (let name in totals) {
            const item = totals[name];
            const balance = item.ts - item.exp;
            tbody.innerHTML += `
                &lt;tr&gt;
                    &lt;td&gt;${name}&lt;/td&gt;
                    &lt;td&gt;${item.ts.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
                    &lt;td&gt;${item.exp.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
                    &lt;td style=&quot;color:${balance &lt; 0 ? &#39;red&#39; : &#39;green&#39;}; font-weight:bold;&quot;&gt;${balance.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
                    &lt;td&gt;&lt;span class=&quot;status-pill ${balance &lt; 0 ? &#39;pill-error&#39; : &#39;pill-ok&#39;}&quot;&gt;${balance &lt; 0 ? &#39;OVER&#39; : &#39;OK&#39;}&lt;/span&gt;&lt;/td&gt;
                &lt;/tr&gt;`;
        }
    }

    function saveToDB() {
        const fields = [&#39;projName&#39;, &#39;workCode&#39;, &#39;division&#39;, &#39;adminAmt&#39;, &#39;aaRef&#39;, &#39;totalTS&#39;, &#39;tsRef&#39;, &#39;tenderAmt&#39;, &#39;contractor&#39;, &#39;startDate&#39;, &#39;endDate&#39;];
        const data = { id: &quot;p1&quot; };
        fields.forEach(f =&gt; data[f] = document.getElementById(f).value);
        data.master = masterItems;
        data.bills = Array.from(document.querySelectorAll(&#39;.ra-bill&#39;)).map(b =&gt; ({
            id: b.id, no: b.querySelector(&#39;.bill-no&#39;).value,
            items: Array.from(b.querySelectorAll(&#39;.bill-grid:not(.bill-header)&#39;)).map(r =&gt; ({
                name: r.querySelector(&#39;.ra-sel&#39;).value, amt: r.querySelector(&#39;.ra-amt&#39;).value, remark: r.querySelector(&#39;.ra-rem&#39;).value
            }))
        }));
        const tx = db.transaction(&quot;projects&quot;, &quot;readwrite&quot;);
        tx.objectStore(&quot;projects&quot;).put(data);
        alert(&quot;Saved to browser memory!&quot;);
    }

    function loadData() {
        const tx = db.transaction(&quot;projects&quot;, &quot;readonly&quot;);
        const req = tx.objectStore(&quot;projects&quot;).get(&quot;p1&quot;);
        req.onsuccess = () =&gt; {
            const res = req.result;
            if (res) {
                const fields = [&#39;projName&#39;, &#39;workCode&#39;, &#39;division&#39;, &#39;adminAmt&#39;, &#39;aaRef&#39;, &#39;totalTS&#39;, &#39;tsRef&#39;, &#39;tenderAmt&#39;, &#39;contractor&#39;, &#39;startDate&#39;, &#39;endDate&#39;];
                fields.forEach(f =&gt; document.getElementById(f).value = res[f] || &quot;&quot;);
                res.master.forEach(m =&gt; addMasterRow(m.name, m.ts));
                res.bills.reverse().forEach(b =&gt; addNewBill(b));
                syncAll();
            } else { 
                [&quot;Civil Work&quot;, &quot;Royalty&quot;, &quot;Insurance&quot;].forEach(n =&gt; addMasterRow(n, 0)); 
            }
        };
    }
  
  function exportProjectJSON() {
        const tx = db.transaction(&quot;projects&quot;, &quot;readonly&quot;);
        const req = tx.objectStore(&quot;projects&quot;).get(&quot;p1&quot;);

        req.onsuccess = () =&gt; {
            const data = req.result;
            if (!data) {
                alert(&quot;No data found to export! Please save your project first.&quot;);
                return;
            }

            const date = new Date().toISOString().split(&#39;T&#39;)[0];
            const fileName = `Expenditure Tracker dated ${date}.json`;
            
            const blob = new Blob([JSON.stringify(data, null, 2)], { type: &quot;application/json&quot; });
            const url = URL.createObjectURL(blob);
            const a = document.createElement(&quot;a&quot;);
            
            a.href = url;
            a.download = fileName;
            document.body.appendChild(a);
            a.click();
            document.body.removeChild(a);
            URL.revokeObjectURL(url);
        };
    }
  
  function triggerImport() {
        document.getElementById(&#39;importFile&#39;).click();
    }

    // 3. New Import Function
    function importProjectJSON(event) {
        const file = event.target.files[0];
        if (!file) return;

        const reader = new FileReader();
        reader.onload = function(e) {
            try {
                const importedData = JSON.parse(e.target.result);
                
                // Validate if it&#39;s our project data
                if (!importedData.projName || !importedData.master) {
                    throw new Error(&quot;Invalid file format.&quot;);
                }

                // Save to IndexedDB
                const tx = db.transaction(&quot;projects&quot;, &quot;readwrite&quot;);
                const store = tx.objectStore(&quot;projects&quot;);
                store.put(importedData);

                tx.oncomplete = () =&gt; {
                    alert(&quot;Import Successful! Reloading dashboard...&quot;);
                    location.reload(); // Refresh to show new data
                };
            } catch (err) {
                alert(&quot;Error importing file: &quot; + err.message);
            }
        };
        reader.readAsText(file);
    }
&lt;/script&gt;
&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/03/expenditure-tracker.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-1968293366174317595</guid><pubDate>Fri, 13 Mar 2026 07:46:00 +0000</pubDate><atom:updated>2026-04-06T23:56:32.599+05:30</atom:updated><title>EPC project status Obligation</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;PWD EPC Monitor | Fixed Stable&lt;/title&gt;
    &lt;style&gt;
        :root { --pwd-blue: #1a3a5a; --pwd-light: #f4f7f9; }
        body { font-family: &#39;Segoe UI&#39;, sans-serif; background: var(--pwd-light); padding: 2px; }
        .container { max-width: 1200px; margin: 0 auto; background: white; padding: 2px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
        .section { margin-bottom: 25px; border-top: 4px solid var(--pwd-blue); padding: 2px; background: #fff; }
        .table-wrapper { width: 100%; overflow-x: auto; margin-top: 10px; border: 1px solid #ddd; border-radius: 4px; }
        .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 5px; margin-bottom: 20px; }
        .form-group { display: flex; flex-direction: column; }
        label { font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; color: #555; }
        input, select { padding: 1px; border: 1px solid #ccc; border-radius: 4px; }
        table { width: 100%; border-collapse: collapse; min-width: 500px; }
        th, td { border: 1px solid #ddd; padding: 1px; text-align: left; font-size: 0.85rem; }
        th { background: #f8f9fa; color: var(--pwd-blue); position: sticky; top: 0; }
        .btn-group { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
        button { padding: 1px 2px; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; transition: 0.2s; }
        .btn-save { background: #28a745; color: white; }
        .btn-csv { background: #d97706; color: white; }
        .btn-del { background: #dc3545; color: white; }
        .btn-add-row { background: #e9ecef; border: 1px solid #ccc; }
        .btn-del-row { background: #fff1f1; color: #dc3545; border: 1px solid #feb2b2; margin-left: 5px; }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;section&quot;&gt;
        &lt;h3&gt;Project Management (Database)&lt;/h3&gt;
        &lt;div style=&quot;display: flex; gap: 1px;&quot;&gt;
            &lt;select id=&quot;projectSelector&quot; onchange=&quot;loadSelectedProject()&quot; style=&quot;flex-grow: 1; padding: 1px;&quot;&gt;
                &lt;option value=&quot;&quot;&gt;-- Select Project from IndexedDB --&lt;/option&gt;
            &lt;/select&gt;
          &lt;/div&gt;
      &lt;div&gt;
            &lt;button class=&quot;btn-add-row&quot; onclick=&quot;document.getElementById(&#39;fileInput&#39;).click()&quot;&gt;📥 Import JSON&lt;/button&gt;
            &lt;input type=&quot;file&quot; id=&quot;fileInput&quot; style=&quot;display:none&quot; accept=&quot;.json&quot; onchange=&quot;importJSON(event)&quot;&gt;
        
    &lt;/div&gt;

    &lt;div class=&quot;section&quot;&gt;
        &lt;h3&gt;Primary Details&lt;/h3&gt;
        &lt;div class=&quot;form-grid&quot;&gt;
            &lt;div class=&quot;form-group&quot;&gt;&lt;label&gt;Project Name&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;projectName&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;form-group&quot;&gt;&lt;label&gt;Length (km)&lt;/label&gt;&lt;input type=&quot;number&quot; step=&quot;0.001&quot; id=&quot;roadLength&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;form-group&quot;&gt;&lt;label&gt;AA Cost (Cr)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;aacost&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;form-group&quot;&gt;&lt;label&gt;Appointment Date&lt;/label&gt;&lt;input type=&quot;date&quot; id=&quot;appointment&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;form-group&quot;&gt;&lt;label&gt;Estimate (Cr)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;estimate&quot; oninput=&quot;calculateVariation()&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;form-group&quot;&gt;&lt;label&gt;Accepted Tender (Cr)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;tender&quot; oninput=&quot;calculateVariation()&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;form-group&quot;&gt;&lt;label&gt;Variation %&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;variation&quot; readonly style=&quot;background:#eee&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;form-group&quot;&gt;&lt;label&gt;Work Period&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;period&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;form-group&quot;&gt;&lt;label&gt;Contractor&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;contractor&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;form-group&quot;&gt;&lt;label&gt;Authority Engineer&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;ae&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
        
        &lt;div class=&quot;btn-group&quot;&gt;
            &lt;button class=&quot;btn-save&quot; onclick=&quot;saveToDB()&quot;&gt;💾 Save to DB&lt;/button&gt;
            &lt;button class=&quot;btn-csv&quot; onclick=&quot;exportToCSV()&quot;&gt;📊 Export CSV&lt;/button&gt;
            &lt;button style=&quot;background:#17a2b8; color:white;&quot; onclick=&quot;exportJSONBackup()&quot;&gt;📤 Export JSON Backup&lt;/button&gt;
            &lt;button class=&quot;btn-del&quot; onclick=&quot;deleteProject()&quot;&gt;🗑️ Delete Project&lt;/button&gt;
            &lt;button onclick=&quot;location.reload()&quot;&gt;🔄 Refresh/New&lt;/button&gt;
        &lt;/div&gt;
    &lt;/div&gt;

     &lt;div class=&quot;section&quot;&gt;
        &lt;h3&gt;1. Consultants &amp; Personnel&lt;/h3&gt;
      &lt;div class=&quot;table-wrapper&quot;&gt;
        &lt;table id=&quot;table_0&quot;&gt;
            &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Consultants &amp; Personnel&lt;/th&gt;&lt;th&gt;Sub. Date&lt;/th&gt;&lt;th&gt;Rem. Date&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Remarks&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
            &lt;tbody&gt;
              
              &lt;tr&gt;&lt;td&gt;Design Consultant&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Proof Consultant&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Safety Consultant&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Project Manager&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Surveyor&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Site Supervisor&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Material Engineer&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
          &lt;/tbody&gt;
        &lt;/table&gt;
    &lt;/div&gt;
  &lt;/div&gt;

    &lt;div class=&quot;section&quot;&gt;
        &lt;h3&gt;2. Mandatory Submissions&lt;/h3&gt;
      &lt;div class=&quot;table-wrapper&quot;&gt;
        &lt;table id=&quot;table_1&quot;&gt;
            &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Mandatory Submissions&lt;/th&gt;&lt;th&gt;Sub. Date&lt;/th&gt;&lt;th&gt;Rem. Date&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Remarks&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
            &lt;tbody&gt;
              
              &lt;tr&gt;&lt;td&gt;Land Memorandom&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Schedule H&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Schedule F Permits (20 Days)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Project Implementation Schedule or Construction program– In line with Schedule-J along with approved Schedule-J&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Workzone Safety Plan (20 Days)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Environment Management Plan (20 Days)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Work Programme (30 Days)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;QAP (30 Days)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Insurance Policy (CAR)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Comprehensive workman insurance Policy.&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              
          
          &lt;/tbody&gt;
        &lt;/table&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;div class=&quot;section&quot;&gt;
        &lt;h3&gt;3. Engineering Documents&lt;/h3&gt;
    &lt;div class=&quot;table-wrapper&quot;&gt;
        &lt;table id=&quot;table_2&quot;&gt;
            &lt;thead&gt;
              &lt;tr&gt;&lt;th&gt;Structural Drawings&lt;/th&gt;&lt;th&gt;Sub. Date&lt;/th&gt;&lt;th&gt;Rem. Date&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Remarks&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
            &lt;tbody&gt;
              
              &lt;tr&gt;&lt;td&gt;Plan and Profile&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Traffic Diversion Plan&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Drone Videography as per 11.16 every calender Quarter&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Construction Methodology&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;MPR &amp; QPR no latter than 10 Days after the close of easch month as per clause 11.7&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;HPC&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Minor Bridge	&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Major Bridge	&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Slab drain&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Retaining wall&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Footway Drain&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Rigid Pavement&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Anti Crash barrier&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;List of TBMs&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Drainage Plan&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Hydraulic Calculations&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Flexible Pavement Design&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
         
          
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;div class=&quot;section&quot;&gt;
        &lt;h3&gt;4. Statutory Approvals&lt;/h3&gt;
    &lt;div class=&quot;table-wrapper&quot;&gt;
        &lt;table id=&quot;table_3&quot;&gt;
            &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Approvals&lt;/th&gt;&lt;th&gt;Sub. Date&lt;/th&gt;&lt;th&gt;Rem. Date&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Remarks&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
            &lt;tbody&gt;
              
              &lt;tr&gt;&lt;td&gt;Environmental Clearance&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;MPCB&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Forest Clearance&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Tree Cutting Permission	&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Explosive License&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Village Panchayat NOC for borrow area.&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Drawing water from River/Reservoir&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;WC Policy&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Quarry Agreements/Permission for Lease&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Fire Policy&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Camp Office – Copy of Lease/Rent Deed/Conveyance Deed.&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Availability of infrastructure like electricity, water, fuel etc. i.e., Bill copies&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Insurance of assets mobilised site.&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Comprehensive project risk policy (Natural calamities)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Comprehensive workman insurance Policy.&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
          
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;div class=&quot;section&quot;&gt;
        &lt;h3&gt;5. Material Approval&lt;/h3&gt;
    &lt;div class=&quot;table-wrapper&quot;&gt;
        &lt;table id=&quot;table_4&quot;&gt;
            &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Material&lt;/th&gt;&lt;th&gt;Sub. Date&lt;/th&gt;&lt;th&gt;Rem. Date&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Remarks&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
            &lt;tbody&gt;
              
              &lt;tr&gt;&lt;td&gt;Aggregates&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Soil&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Fly Ash&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Cement&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Steel&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Bitumen&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;GSB&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;WMM&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;GGBS&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Admixture 1&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Admixture 2&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Water&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Hume Pipe/Arcoduct&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Bituminous Mix Designs&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Concrete Mix Designs&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Trial Patch&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;CTE and CTO (All Plants and Crushers)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
          
          
          &lt;/tbody&gt;
        &lt;/table&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;div class=&quot;section&quot;&gt;
        &lt;h3&gt;6. Details of site mobilization including details of base camp, list of construction equipment, Manpower to be deployed etc.&lt;/h3&gt;
    &lt;div class=&quot;table-wrapper&quot;&gt;
        &lt;table id=&quot;table_5&quot;&gt;
            &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Mobilization&lt;/th&gt;&lt;th&gt;Sub. Date&lt;/th&gt;&lt;th&gt;Rem. Date&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Remarks&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
            &lt;tbody&gt;
              
              &lt;tr&gt;&lt;td&gt;Ready Mix Plant&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Batch mix Plant&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Drum mix Plant&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Crusher&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Lab Setup&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Calbration Certificate&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Machinery&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Manpower&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
              
              &lt;tr&gt;&lt;td&gt;Camp Office – Copy of Lease/Rent Deed/Conveyance Deed.&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;
          
          &lt;/tbody&gt;
        &lt;/table&gt;
    &lt;/div&gt;
    &lt;/div&gt;
  
&lt;/div&gt;
  
  &lt;div class=&quot;article-container&quot; style=&quot;max-width:1000px; margin:auto; font-family:Segoe UI; line-height:1.6; color:#1e293b;&quot;&gt;

    &lt;h1 style=&quot;text-align:center; color:#1d4ed8;&quot;&gt;EPC Project Monitoring &amp; Management Tool&lt;/h1&gt;

    &lt;p&gt;
        This advanced &lt;b&gt;HTML + JavaScript based Project Monitoring Tool&lt;/b&gt; is designed for 
        &lt;b&gt;Engineering, Procurement, and Construction (EPC)&lt;/b&gt; projects, particularly suited for 
        &lt;b&gt;PWD / Highway / Infrastructure Projects&lt;/b&gt;. It provides a structured, database-driven 
        interface to manage project data, track submissions, monitor approvals, and generate reports.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;🔷 Key Features&lt;/h2&gt;
    &lt;ul&gt;
        &lt;li&gt;📂 Project storage using &lt;b&gt;IndexedDB (Browser Database)&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;📊 Multi-section compliance tracking (6 structured tables)&lt;/li&gt;
        &lt;li&gt;📥 JSON Import &amp; 📤 JSON Backup system&lt;/li&gt;
        &lt;li&gt;📄 One-click CSV report generation&lt;/li&gt;
        &lt;li&gt;➕ Dynamic row addition &amp; deletion&lt;/li&gt;
        &lt;li&gt;⚡ Real-time variation calculation (Estimate vs Tender)&lt;/li&gt;
        &lt;li&gt;🧠 Fully client-side (No server required)&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;1. Project Database Management&lt;/h2&gt;
    &lt;p&gt;
        The tool uses &lt;b&gt;IndexedDB&lt;/b&gt; to store multiple projects locally in the browser.
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;b&gt;Select Project:&lt;/b&gt; Load saved project from dropdown&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Save to DB:&lt;/b&gt; Stores complete project including all tables&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Delete Project:&lt;/b&gt; Permanently removes project data&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Refresh/New:&lt;/b&gt; Clears screen for new entry&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        Each project is uniquely identified using &lt;b&gt;Project Name as Key&lt;/b&gt;.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;2. Primary Project Details&lt;/h2&gt;
    &lt;p&gt;
        This section captures essential project metadata required for reporting and tracking:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;Project Name&lt;/li&gt;
        &lt;li&gt;Road Length (km)&lt;/li&gt;
        &lt;li&gt;Administrative Approval Cost (AA Cost)&lt;/li&gt;
        &lt;li&gt;Appointment Date&lt;/li&gt;
        &lt;li&gt;Estimate Cost vs Accepted Tender&lt;/li&gt;
        &lt;li&gt;Work Period&lt;/li&gt;
        &lt;li&gt;Contractor &amp; Authority Engineer&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;📊 Variation Calculation&lt;/h3&gt;
    &lt;p&gt;
        The tool automatically calculates variation using:
    &lt;/p&gt;

    &lt;pre style=&quot;background:#f1f5f9; padding:10px;&quot;&gt;
Variation (%) = ((Tender - Estimate) / Estimate) × 100
    &lt;/pre&gt;

    &lt;p&gt;
        Output indicates whether the tender is &lt;b&gt;Above&lt;/b&gt; or &lt;b&gt;Below&lt;/b&gt; the estimate.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;3. Structured Monitoring Tables&lt;/h2&gt;
    &lt;p&gt;
        The system is divided into &lt;b&gt;6 major monitoring sections&lt;/b&gt;, each representing a critical
        EPC compliance domain.
    &lt;/p&gt;

    &lt;h3&gt;📁 Sections Included:&lt;/h3&gt;
    &lt;ol&gt;
        &lt;li&gt;&lt;b&gt;Consultants &amp; Personnel&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Mandatory Submissions&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Engineering Documents&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Statutory Approvals&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Material Approvals&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Site Mobilization&lt;/b&gt;&lt;/li&gt;
    &lt;/ol&gt;

    &lt;h3&gt;📌 Table Structure&lt;/h3&gt;
    &lt;p&gt;Each table follows a standardized format:&lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;Description&lt;/li&gt;
        &lt;li&gt;Submission Date&lt;/li&gt;
        &lt;li&gt;Remark Date&lt;/li&gt;
        &lt;li&gt;Status (Pending / Submitted / Approved / Reverted)&lt;/li&gt;
        &lt;li&gt;Remarks&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;➕ Dynamic Row Feature&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Add unlimited rows using &lt;b&gt;+&lt;/b&gt; button&lt;/li&gt;
        &lt;li&gt;Delete rows using &lt;b&gt;🗑️&lt;/b&gt; button&lt;/li&gt;
        &lt;li&gt;Ensures flexible project tracking&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;4. Data Persistence Logic&lt;/h2&gt;

    &lt;h3&gt;💾 Save Function&lt;/h3&gt;
    &lt;p&gt;
        The &lt;b&gt;saveToDB()&lt;/b&gt; function:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;Collects all input values&lt;/li&gt;
        &lt;li&gt;Loops through all 6 tables (table_0 to table_5)&lt;/li&gt;
        &lt;li&gt;Stores structured array data in IndexedDB&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;📂 Load Function&lt;/h3&gt;
    &lt;p&gt;
        The &lt;b&gt;loadSelectedProject()&lt;/b&gt; function:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;Retrieves project data&lt;/li&gt;
        &lt;li&gt;Populates form fields&lt;/li&gt;
        &lt;li&gt;Dynamically rebuilds all tables&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;5. Import &amp; Backup System&lt;/h2&gt;

    &lt;h3&gt;📥 Import JSON&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Upload previously exported backup file&lt;/li&gt;
        &lt;li&gt;Automatically merges projects into database&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;📤 Export JSON Backup&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Exports all projects in structured JSON format&lt;/li&gt;
        &lt;li&gt;Filename includes current date&lt;/li&gt;
        &lt;li&gt;Ensures data portability &amp; backup safety&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;6. CSV Report Generation&lt;/h2&gt;
    &lt;p&gt;
        The &lt;b&gt;Export CSV&lt;/b&gt; feature generates a complete project monitoring report:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;Includes project summary&lt;/li&gt;
        &lt;li&gt;Exports all 6 sections&lt;/li&gt;
        &lt;li&gt;Each table becomes a structured section&lt;/li&gt;
        &lt;li&gt;Compatible with Excel&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        Special handling ensures:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;Commas inside text are safely managed&lt;/li&gt;
        &lt;li&gt;Each row is exported as a single clean line&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;7. Status Tracking System&lt;/h2&gt;
    &lt;p&gt;
        Each activity is tracked through lifecycle stages:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;⏳ Pending&lt;/li&gt;
        &lt;li&gt;📤 Submitted&lt;/li&gt;
        &lt;li&gt;✅ Approved&lt;/li&gt;
        &lt;li&gt;🔁 Reverted&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        This enables real-time monitoring of project compliance and delays.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;8. Technical Architecture&lt;/h2&gt;

    &lt;ul&gt;
        &lt;li&gt;&lt;b&gt;Frontend:&lt;/b&gt; HTML + CSS&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Logic:&lt;/b&gt; Vanilla JavaScript&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Database:&lt;/b&gt; IndexedDB (Client-side)&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;File Handling:&lt;/b&gt; Blob API + FileReader&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;9. Advantages&lt;/h2&gt;

    &lt;ul&gt;
        &lt;li&gt;✔ No internet required (Offline tool)&lt;/li&gt;
        &lt;li&gt;✔ No installation needed&lt;/li&gt;
        &lt;li&gt;✔ Highly customizable&lt;/li&gt;
        &lt;li&gt;✔ Suitable for site engineers &amp; project managers&lt;/li&gt;
        &lt;li&gt;✔ Eliminates manual tracking in Excel&lt;/li&gt;
    &lt;/ul&gt;

&lt;/div&gt;

&lt;script&gt;
const DB_NAME = &quot;PWD_EPC_STORE&quot;;
const STORE = &quot;projects&quot;; 
let db;

const req = indexedDB.open(DB_NAME, 1);
req.onupgradeneeded = (e) =&gt; {
    e.target.result.createObjectStore(STORE, { keyPath: &quot;projectName&quot; });
};
req.onsuccess = (e) =&gt; { db = e.target.result; updateDropdown(); };

// FIX: Scanning by ID instead of general querySelectorAll
async function saveToDB() {
    if (!db) return alert(&quot;Database initializing...&quot;);
    const name = document.getElementById(&#39;projectName&#39;).value.trim();
    if (!name) return alert(&quot;Please enter a Project Name first.&quot;);

    const data = {
        projectName: name,
        roadLength: document.getElementById(&#39;roadLength&#39;).value,
        aacost: document.getElementById(&#39;aacost&#39;).value,
        appointment: document.getElementById(&#39;appointment&#39;).value,
        estimate: document.getElementById(&#39;estimate&#39;).value,
        tender: document.getElementById(&#39;tender&#39;).value,
        period: document.getElementById(&#39;period&#39;).value,
        variation: document.getElementById(&#39;variation&#39;).value,
        contractor: document.getElementById(&#39;contractor&#39;).value, 
        ae: document.getElementById(&#39;ae&#39;).value,
        tables: []
    };

    // Explicitly loop through Table IDs 0 to 5 to ensure Mobilization (5) is included
    for (let i = 0; i &lt;= 5; i++) {
        const table = document.getElementById(`table_${i}`);
        const rows = [];
        if (table) {
            table.querySelectorAll(&#39;tbody tr&#39;).forEach(tr =&gt; {
                const cells = tr.querySelectorAll(&#39;td&#39;);
                if(cells.length &gt;= 5) {
                    rows.push([
                        cells[0].innerText.trim(),
                        cells[1].querySelector(&#39;input&#39;).value,
                        cells[2].querySelector(&#39;input&#39;).value,
                        cells[3].querySelector(&#39;select&#39;).value,
                        cells[4].querySelector(&#39;input&#39;).value
                    ]);
                }
            });
        }
        data.tables.push(rows);
    }

    const tx = db.transaction(STORE, &quot;readwrite&quot;);
    tx.objectStore(STORE).put(data);
    tx.oncomplete = () =&gt; {
        alert(&quot;Success: All 6 tables saved to Database.&quot;);
        updateDropdown();
    };
}
  
  
// Ensure the loader handles all tables correctly
function loadSelectedProject() {
    const name = document.getElementById(&#39;projectSelector&#39;).value;
    if (!name) return;

    const tx = db.transaction(STORE, &quot;readonly&quot;);
    const request = tx.objectStore(STORE).get(name);

    request.onsuccess = () =&gt; {
        const data = request.result;
        if (!data) return;

        // Populate Primary Details
        document.getElementById(&#39;projectName&#39;).value = data.projectName || &quot;&quot;;
        document.getElementById(&#39;roadLength&#39;).value = data.roadLength || &quot;&quot;;
        document.getElementById(&#39;aacost&#39;).value = data.aacost || &quot;&quot;;
        document.getElementById(&#39;appointment&#39;).value = data.appointment || &quot;&quot;;
        document.getElementById(&#39;estimate&#39;).value = data.estimate || &quot;&quot;;
        document.getElementById(&#39;tender&#39;).value = data.tender || &quot;&quot;;
        document.getElementById(&#39;period&#39;).value = data.period || &quot;&quot;;
        document.getElementById(&#39;variation&#39;).value = data.variation || &quot;&quot;;
        document.getElementById(&#39;contractor&#39;).value = data.contractor || &quot;&quot;;
        document.getElementById(&#39;ae&#39;).value = data.ae || &quot;&quot;;

        // Populate All 6 Tables (0 to 5)
        if (data.tables &amp;&amp; Array.isArray(data.tables)) {
            data.tables.forEach((tableData, idx) =&gt; {
                const table = document.getElementById(`table_${idx}`);
                if (!table) return;

                const tbody = table.querySelector(&#39;tbody&#39;);
                // Use a default row structure if the table is currently empty
                const rowHtml = `&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;date&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;select&gt;&lt;option&gt;Pending&lt;/option&gt;&lt;option&gt;Submitted&lt;/option&gt;&lt;option&gt;Approved&lt;/option&gt;&lt;option&gt;Reverted&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;`;
                
                tbody.innerHTML = &quot;&quot;; // Clear current UI rows
                
                tableData.forEach(rowData =&gt; {
                    const tr = document.createElement(&#39;tr&#39;);
                    tr.innerHTML = rowHtml;
                    const c = tr.querySelectorAll(&#39;td&#39;);
                    
                    // Fill the row with saved data
                    c[0].innerText = rowData[0] || &quot;&quot;;
                    c[1].querySelector(&#39;input&#39;).value = rowData[1] || &quot;&quot;;
                    c[2].querySelector(&#39;input&#39;).value = rowData[2] || &quot;&quot;;
                    c[3].querySelector(&#39;select&#39;).value = rowData[3] || &quot;Pending&quot;;
                    c[4].querySelector(&#39;input&#39;).value = rowData[4] || &quot;&quot;;
                    
                    // Add the +/- buttons back to the last cell
                    attachDeleteRow(c[5]);
                    tbody.appendChild(tr);
                });
            });
        }
    };
}

function deleteProject() {
    const name = document.getElementById(&#39;projectSelector&#39;).value;
    if (name &amp;&amp; confirm(`Delete ${name}?`)) {
        const tx = db.transaction(STORE, &quot;readwrite&quot;);
        tx.objectStore(STORE).delete(name);
        tx.oncomplete = () =&gt; location.reload();
    }
}

function exportToCSV() {
    // 1. Get Primary Details from the screen
    const name = document.getElementById(&#39;projectName&#39;).value || &quot;Project_Report&quot;;
    const contractor = document.getElementById(&#39;contractor&#39;).value || &quot;N/A&quot;;
    const ae = document.getElementById(&#39;ae&#39;).value || &quot;N/A&quot;;
    const length = document.getElementById(&#39;roadLength&#39;).value || &quot;0&quot;;

    // 2. Start CSV Content
    let csv = `EPC PROJECT MONITORING REPORT\n`;
    csv += `Project Name,${name.replace(/,/g, &quot; &quot;)}\n`;
    csv += `Contractor,${contractor.replace(/,/g, &quot; &quot;)}\n`;
    csv += `Authority Engineer,${ae.replace(/,/g, &quot; &quot;)}\n`;
    csv += `Length (km),${length}\n\n`;

    // 3. Loop through all tables
    document.querySelectorAll(&#39;table&#39;).forEach((table) =&gt; {
        // Try to find the section title (h3) above the table
        const sectionTitle = table.closest(&#39;.section&#39;) ? table.closest(&#39;.section&#39;).querySelector(&#39;h3&#39;).innerText : &quot;Section&quot;;
        csv += `${sectionTitle}\n`;
        csv += &quot;Description,Submission Date,Remark Date,Status,Remarks\n&quot;;

        table.querySelectorAll(&#39;tbody tr&#39;).forEach(tr =&gt; {
            const cells = tr.querySelectorAll(&#39;td&#39;);
            if (cells.length &gt;= 5) {
                const row = [
                    `&quot;${cells[0].innerText.trim()}&quot;`, // Description (handles commas)
                    cells[1].querySelector(&#39;input&#39;) ? cells[1].querySelector(&#39;input&#39;).value : &quot;&quot;,
                    cells[2].querySelector(&#39;input&#39;) ? cells[2].querySelector(&#39;input&#39;).value : &quot;&quot;,
                    cells[3].querySelector(&#39;select&#39;) ? cells[3].querySelector(&#39;select&#39;).value : &quot;&quot;,
                    `&quot;${cells[4].querySelector(&#39;input&#39;) ? cells[4].querySelector(&#39;input&#39;).value : &quot;&quot;}&quot;` // Remarks
                ];
                csv += row.join(&quot;,&quot;) + &quot;\n&quot;;
            }
        });
        csv += &quot;\n&quot;; // Space between sections
    });

    // 4. Create and Trigger Download
    const blob = new Blob([csv], { type: &#39;text/csv;charset=utf-8;&#39; });
    const link = document.createElement(&quot;a&quot;);
    const url = URL.createObjectURL(blob);
    
    link.setAttribute(&quot;href&quot;, url);
    link.setAttribute(&quot;download&quot;, `${name.replace(/\s+/g, &#39;_&#39;)}_Monitor.csv`);
    link.style.visibility = &#39;hidden&#39;;
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
}

function exportJSONBackup() {
    const tx = db.transaction(STORE, &quot;readonly&quot;);
    const request = tx.objectStore(STORE).getAll();

    request.onsuccess = () =&gt; {
        // 1. Get the current date (YYYY-MM-DD)
        const date = new Date().toISOString().split(&#39;T&#39;)[0];
        const fileName = `EPC projects status obligation dated ${date}.json`;

        const allData = {};
        request.result.forEach(proj =&gt; allData[proj.projectName] = proj);

        // 2. Create the blob and link
        const blob = new Blob([JSON.stringify(allData, null, 2)], { type: &#39;application/json&#39; });
        const url = URL.createObjectURL(blob);
        
        const a = document.createElement(&#39;a&#39;);
        a.href = url;
        a.download = fileName; // Applies your new naming convention

        // 3. Trigger and cleanup
        document.body.appendChild(a);
        a.click();
        document.body.removeChild(a);
        URL.revokeObjectURL(url);
    };
}

function importJSON(e) {
    const reader = new FileReader();
    reader.onload = (ev) =&gt; {
        try {
            const data = JSON.parse(ev.target.result);
            const tx = db.transaction(STORE, &quot;readwrite&quot;);
            const store = tx.objectStore(STORE);

            for (let key in data) {
                store.put(data[key]);
            }

            tx.oncomplete = () =&gt; {
                alert(&quot;Imported successfully! Please select the project from the dropdown to load tables.&quot;);
                updateDropdown(); // Refresh the list so the new project appears
            };
        } catch (err) {
            alert(&quot;Error parsing JSON file. Please ensure it is a valid backup.&quot;);
        }
    };
    reader.readAsText(e.target.files[0]);
}

function addRow(btn) {
    const row = btn.closest(&#39;tr&#39;);
    const newRow = row.cloneNode(true);
    newRow.querySelectorAll(&#39;input&#39;).forEach(i =&gt; i.value = &quot;&quot;);
    attachDeleteRow(newRow.querySelectorAll(&#39;td&#39;)[5]);
    row.after(newRow);
}

function attachDeleteRow(cell) {
    cell.innerHTML = &#39;&lt;button class=&quot;btn-add-row&quot; onclick=&quot;addRow(this)&quot;&gt;+&lt;/button&gt;&#39;;
    const del = document.createElement(&#39;button&#39;);
    del.innerHTML = &quot;🗑️&quot;;
    del.className = &quot;btn-del-row&quot;;
    del.onclick = function() { if(this.closest(&#39;tbody&#39;).rows.length &gt; 1) this.closest(&#39;tr&#39;).remove(); };
    cell.appendChild(del);
}

function updateDropdown() {
    const sel = document.getElementById(&#39;projectSelector&#39;);
    const tx = db.transaction(STORE, &quot;readonly&quot;);
    const request = tx.objectStore(STORE).getAllKeys();
    request.onsuccess = () =&gt; {
        sel.innerHTML = &#39;&lt;option value=&quot;&quot;&gt;-- Select Project --&lt;/option&gt;&#39;;
        request.result.forEach(k =&gt; sel.innerHTML += `&lt;option value=&quot;${k}&quot;&gt;${k}&lt;/option&gt;`);
    };
}

function calculateVariation() {
    const e = parseFloat(document.getElementById(&#39;estimate&#39;).value) || 0;
    const t = parseFloat(document.getElementById(&#39;tender&#39;).value) || 0;
    if (e &gt; 0) {
        const diff = ((t - e) / e) * 100;
        document.getElementById(&#39;variation&#39;).value = diff.toFixed(2) + &quot;% &quot; + (diff &gt;= 0 ? &quot;Above&quot; : &quot;Below&quot;);
    }
}

// Initialize delete buttons for first load
document.querySelectorAll(&#39;table tbody tr&#39;).forEach(tr =&gt; attachDeleteRow(tr.querySelectorAll(&#39;td&#39;)[5]));
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/03/epc-projects-status-obligation.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-540950427102000529</guid><pubDate>Tue, 10 Mar 2026 06:54:00 +0000</pubDate><atom:updated>2026-04-07T00:00:22.061+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Estimate Preparation</category><category domain="http://www.blogger.com/atom/ns#">PWD Working</category><category domain="http://www.blogger.com/atom/ns#">Roads</category><category domain="http://www.blogger.com/atom/ns#">Software</category><title>Road Sanctioned length and remaining lengths under various schemes</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;title&gt;Road Manager v8.7 | Enhanced Summary&lt;/title&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js&quot;&gt;&lt;/script&gt;
    &lt;style&gt;
        :root {
            --color-03: #007bff;
            --color-04: #28a745;
            --color-Nabard: #6f42c1;
            --color-AMC: #fd7e14;
            --color-DLP: #dc3545;
            --color-HAM: #17a2b8;
            --color-T6: #6610f2;
            --color-SR: #20c997;
            --color-FDR: #e83e8c;
            --color-CRF: #6c757d;
            --color-Kumbh: #ff6f61;
            --color-unknown: #6c757d;
            --color-gap: #dee2e6;
        }
        body { font-family: &#39;Segoe UI&#39;, sans-serif; margin: 20px; background: #f0f2f5; }
        .container { max-width: 1300px; margin: auto; background: white; padding: 25px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
        .main-grid { display: grid; grid-template-columns: 380px 1fr; gap: 24px; }
        .sidebar { background: #fff; padding: 18px; border-radius: 10px; border: 1px solid #ddd; position: sticky; top: 20px; height: fit-content; }
       
        .summary-box {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            padding: 14px 16px;
            margin-bottom: 16px;
            font-size: 13.5px;
            line-height: 1.55;
        }
        .summary-box h4 {
            margin: 0 0 10px 0;
            font-size: 15px;
            color: #343a40;
            border-bottom: 1px solid #dee2e6;
            padding-bottom: 6px;
        }
        .summary-row {
            display: flex;
            justify-content: space-between;
            margin: 6px 0;
        }
        .summary-label { font-weight: 500; color: #495057; }
        .summary-value { font-weight: 600; color: #212529; text-align: right; }
        .summary-highlight { color: #c82333; font-weight: 700; }
       
        .bulk-buttons { display: flex; gap: 8px; margin: 12px 0; }
        .bulk-btn { flex: 1; padding: 8px; font-size: 13px; cursor: pointer; border-radius: 6px; border: none; }
        .select-all { background: #28a745; color: white; }
        .deselect-all { background: #6c757d; color: white; }
       
        .road-list { max-height: 460px; overflow-y: auto; border: 1px solid #eee; margin-top: 8px; border-radius: 8px; }
        .road-item { display: flex; align-items: center; padding: 10px; border-bottom: 1px solid #eee; }
        .road-item.selected-for-pdf { background: #d4edda !important; border-left: 6px solid #28a745; }
        .road-item.active-editing { background: #e7f1ff; border-right: 6px solid #007bff; }
       
        .big-check { width: 18px; height: 18px; margin-right: 10px; accent-color: #28a745; cursor: pointer; }
        .action-group { display: flex; gap: 4px; margin-left: auto; }
        .btn-edit { background: #007bff; color: #fff; border: none; padding: 5px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; }
        .btn-del { background: #ff4d4d; color: #fff; border: none; padding: 5px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; }
       
        .chart-box { position: relative; width: 100%; height: 50px; background: #eee; border: 1px solid #ccc; margin-bottom: 5px; }
        .chart-seg { position: absolute; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: bold; overflow: hidden; }
        .axis { position: relative; width: 100%; height: 50px; }
        .tick { position: absolute; transform: translateX(-50%); text-align: center; }
        .tick-line { width: 1px; height: 10px; background: #000; margin: 0 auto; }
        .tick-label { font-size: 9px; font-weight: bold; transform: rotate(-45deg); display: block; margin-top: 10px; white-space: nowrap; }
       
        .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 20px; }
        input, select { padding: 10px; border: 1px solid #ccc; border-radius: 4px; width: 100%; box-sizing: border-box; }
        .btn-pdf { background: #dc3545; color: white; width: 100%; padding: 15px; font-size: 18px; border-radius: 8px; margin-top: 10px; border: none; cursor: pointer; font-weight: bold; }
        .storage-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 15px; }
        .btn-store { background: #6c757d; color: white; border: none; padding: 8px; border-radius: 4px; font-size: 12px; cursor: pointer; }
       
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th, td { border: 1px solid #ddd; padding: 10px; text-align: center; font-size: 13px; }
        .hidden-staging { position: absolute; left: -9999px; top: -9999px; }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;main-grid&quot;&gt;
        &lt;div class=&quot;sidebar&quot;&gt;
            &lt;h3 style=&quot;margin:0 0 10px 0;&quot;&gt;Project Overview &amp; Export&lt;/h3&gt;
           
            &lt;div class=&quot;summary-box&quot; id=&quot;summaryBox&quot;&gt;
                &lt;h4&gt;Project Summary&lt;/h4&gt;
                &lt;div class=&quot;summary-row&quot;&gt;&lt;span class=&quot;summary-label&quot;&gt;Total Road length:&lt;/span&gt; &lt;span class=&quot;summary-value&quot; id=&quot;totalSanctioned&quot;&gt;0.000 km&lt;/span&gt;&lt;/div&gt;
                &lt;div class=&quot;summary-row&quot;&gt;&lt;span class=&quot;summary-label&quot;&gt;Total Sanctioned length:&lt;/span&gt; &lt;span class=&quot;summary-value&quot; id=&quot;totalCovered&quot;&gt;0.000 km&lt;/span&gt;&lt;/div&gt;
                &lt;div class=&quot;summary-row&quot;&gt;&lt;span class=&quot;summary-label&quot;&gt;Total Uncovered length:&lt;/span&gt; &lt;span class=&quot;summary-value summary-highlight&quot; id=&quot;totalRemaining&quot;&gt;0.000 km&lt;/span&gt;&lt;/div&gt;
                &lt;div class=&quot;summary-row&quot; style=&quot;margin-top:12px;&quot;&gt;&lt;span class=&quot;summary-label&quot;&gt;Total sanctioned cost:&lt;/span&gt; &lt;span class=&quot;summary-value&quot; id=&quot;totalCost&quot;&gt;₹ 0&lt;/span&gt;&lt;/div&gt;
                &lt;div class=&quot;summary-row&quot;&gt;&lt;span class=&quot;summary-label&quot;&gt;Avg. cost per km:&lt;/span&gt; &lt;span class=&quot;summary-value&quot; id=&quot;avgCostPerKm&quot;&gt;—&lt;/span&gt;&lt;/div&gt;
                &lt;div class=&quot;summary-row&quot; style=&quot;margin-top:12px; font-size:14px;&quot;&gt;&lt;span class=&quot;summary-label&quot;&gt;Roads in database:&lt;/span&gt; &lt;span class=&quot;summary-value&quot; id=&quot;roadCount&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
                &lt;div id=&quot;schemeBreakdown&quot;&gt;&lt;/div&gt;
            &lt;/div&gt;
           
            &lt;div class=&quot;bulk-buttons&quot;&gt;
                &lt;button class=&quot;bulk-btn select-all&quot; onclick=&quot;bulkSelect(true)&quot;&gt;Select All&lt;/button&gt;
                &lt;button class=&quot;bulk-btn deselect-all&quot; onclick=&quot;bulkSelect(false)&quot;&gt;Deselect All&lt;/button&gt;
            &lt;/div&gt;
        &lt;/div&gt;
       &lt;/div&gt;
    &lt;/div&gt;

        &lt;div class=&quot;content-area&quot;&gt;
            &lt;h2 id=&quot;roadHeader&quot; style=&quot;margin-top:0;&quot;&gt;Road Inventory Editor&lt;/h2&gt;
          
            &lt;div style=&quot;background:#f8f9fa; padding:15px; border-radius:8px; margin-bottom:20px; border:1px solid #eee;&quot;&gt;
                &lt;div style=&quot;display:flex; justify-content:space-between; margin-bottom:10px;&quot;&gt;
                    &lt;strong id=&quot;chartTitle&quot;&gt;Select or Add a Road&lt;/strong&gt;
                &lt;/div&gt;
                &lt;div class=&quot;chart-box&quot; id=&quot;liveChart&quot;&gt;&lt;/div&gt;
                &lt;div class=&quot;axis&quot; id=&quot;liveAxis&quot;&gt;&lt;/div&gt;
            &lt;/div&gt;
         
           
            &lt;div class=&quot;form-grid&quot;&gt;
                &lt;div style=&quot;grid-column: span 2;&quot;&gt;&lt;label&gt;Road Name&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;rName&quot; placeholder=&quot;Enter Road Name&quot;&gt;&lt;/div&gt;
                &lt;div&gt;&lt;label&gt;Total Length (km)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;rLen&quot; step=&quot;0.001&quot; min=&quot;0.001&quot; placeholder=&quot;e.g. 54.7&quot;&gt;&lt;/div&gt;
                &lt;div style=&quot;display:flex; align-items:flex-end;&quot;&gt;&lt;button style=&quot;background:#007bff; color:white; border:none; padding:10px; font-weight:bold; width:100%; border-radius:4px; cursor:pointer;&quot; onclick=&quot;saveRoad()&quot;&gt;Save Road&lt;/button&gt;&lt;/div&gt;
            &lt;/div&gt;
          
            &lt;div class=&quot;form-grid&quot; style=&quot;background:#eefdf3; padding:15px; border-radius:8px; border:1px solid #c3e6cb;&quot;&gt;
                &lt;div&gt;&lt;label&gt;Scheme&lt;/label&gt;
                    &lt;select id=&quot;scheme&quot;&gt;
                        &lt;option&gt;03&lt;/option&gt;
                        &lt;option&gt;04&lt;/option&gt;
                        &lt;option&gt;HAM&lt;/option&gt;
                        &lt;option&gt;T6&lt;/option&gt;
                        &lt;option&gt;Nabard&lt;/option&gt;
                        &lt;option&gt;AMC&lt;/option&gt;
                        &lt;option&gt;DLP&lt;/option&gt;
                        &lt;option&gt;SR&lt;/option&gt;
                        &lt;option&gt;FDR&lt;/option&gt;
                        &lt;option&gt;CRF&lt;/option&gt;
                        &lt;option&gt;Kumbh&lt;/option&gt;
                    &lt;/select&gt;
                &lt;/div&gt;
                &lt;div&gt;&lt;label&gt;Start Ch&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;sCh&quot; step=&quot;0.001&quot; min=&quot;0&quot;&gt;&lt;/div&gt;
                &lt;div&gt;&lt;label&gt;End Ch&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;eCh&quot; step=&quot;0.001&quot; min=&quot;0&quot;&gt;&lt;/div&gt;
                &lt;div&gt;&lt;label&gt;Cost (₹)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;cost&quot; min=&quot;0&quot; step=&quot;1000&quot;&gt;&lt;/div&gt;
                &lt;div&gt;&lt;label&gt;Year&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;year&quot; value=&quot;2026&quot; min=&quot;2000&quot;&gt;&lt;/div&gt;
                &lt;div style=&quot;display:flex; align-items:flex-end;&quot;&gt;&lt;button style=&quot;background:#28a745; color:white; border:none; font-weight:bold; width:100%; padding:10px; border-radius:4px; cursor:pointer;&quot; onclick=&quot;addSegment()&quot;&gt;Add Segment&lt;/button&gt;&lt;/div&gt;
            &lt;/div&gt;
           
            &lt;table&gt;
                &lt;thead&gt;&lt;tr style=&quot;background:#f1f1f1;&quot;&gt;&lt;th&gt;Scheme&lt;/th&gt;&lt;th&gt;Chainage Range&lt;/th&gt;&lt;th&gt;Length&lt;/th&gt;&lt;th&gt;Year&lt;/th&gt;&lt;th&gt;Cost&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
                &lt;tbody id=&quot;liveTableBody&quot;&gt;&lt;/tbody&gt;
            &lt;/table&gt;
        

    &lt;div id=&quot;stagingArea&quot; class=&quot;hidden-staging&quot;&gt;&lt;/div&gt;

    &lt;p id=&quot;statsCounter&quot; style=&quot;font-size: 12px; color: #666; margin: 10px 0 12px 0;&quot;&gt;&lt;/p&gt;
    &lt;div id=&quot;checklist&quot; class=&quot;road-list&quot;&gt;&lt;/div&gt;
    &lt;button class=&quot;btn-pdf&quot; onclick=&quot;generateBatchPDF()&quot;&gt;📥 EXPORT SELECTED TO PDF&lt;/button&gt;
   
    &lt;div class=&quot;storage-btns&quot;&gt;
        &lt;button class=&quot;btn-store&quot; onclick=&quot;exportJSON()&quot;&gt;💾 Backup (JSON)&lt;/button&gt;
        &lt;button class=&quot;btn-store&quot; style=&quot;background:#495057;&quot; onclick=&quot;document.getElementById(&#39;importFile&#39;).click()&quot;&gt;📂 Import Data&lt;/button&gt;
    &lt;/div&gt;
    &lt;input type=&quot;file&quot; id=&quot;importFile&quot; hidden onchange=&quot;importJSON(event)&quot;&gt;
    &lt;p style=&quot;font-size: 10px; color: #999; margin-top: 12px; text-align: center;&quot;&gt;Chainage format: XX/XXX (54.7 → 54/700)&lt;/p&gt;
&lt;/div&gt;
  
  &lt;div class=&quot;article-container&quot; style=&quot;max-width:1000px; margin:auto; font-family:Segoe UI; line-height:1.6; color:#1e293b;&quot;&gt;

    &lt;h1 style=&quot;text-align:center; color:#0f766e;&quot;&gt;Road Inventory &amp; Scheme Monitoring Tool&lt;/h1&gt;

    &lt;p&gt;
        This advanced &lt;b&gt;HTML + JavaScript based Road Inventory Tool&lt;/b&gt; is designed for 
        &lt;b&gt;highway engineers, PWD officials, and infrastructure planners&lt;/b&gt; to manage 
        road-wise project data using &lt;b&gt;chainage-based segmentation&lt;/b&gt;. 
    &lt;/p&gt;

    &lt;p&gt;
        The tool enables precise tracking of &lt;b&gt;road coverage, scheme allocation, cost distribution, 
        and physical progress&lt;/b&gt; using an intuitive graphical and tabular interface.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;🔷 Key Features&lt;/h2&gt;
    &lt;ul&gt;
        &lt;li&gt;🛣️ Road-wise inventory management&lt;/li&gt;
        &lt;li&gt;📏 Chainage-based segmentation (Start–End)&lt;/li&gt;
        &lt;li&gt;📊 Real-time graphical linear progress visualization&lt;/li&gt;
        &lt;li&gt;📉 Gap detection (Uncovered stretches)&lt;/li&gt;
        &lt;li&gt;💰 Scheme-wise cost tracking&lt;/li&gt;
        &lt;li&gt;📄 Batch PDF export with charts&lt;/li&gt;
        &lt;li&gt;💾 Local storage (Offline working)&lt;/li&gt;
        &lt;li&gt;📥 JSON import &amp; 📤 backup system&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;1. Project Overview &amp; Summary Dashboard&lt;/h2&gt;

    &lt;p&gt;
        The &lt;b&gt;sidebar summary panel&lt;/b&gt; provides real-time aggregated statistics across all roads:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;Total Road Length&lt;/li&gt;
        &lt;li&gt;Total Covered Length&lt;/li&gt;
        &lt;li&gt;Total Uncovered Length (Highlighted)&lt;/li&gt;
        &lt;li&gt;Total Sanctioned Cost&lt;/li&gt;
        &lt;li&gt;Average Cost per Km&lt;/li&gt;
        &lt;li&gt;Total Number of Roads&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;📊 Scheme-wise Breakdown&lt;/h3&gt;
    &lt;p&gt;
        The system automatically distributes road length across schemes such as:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;03, 04, NABARD, HAM, CRF, SR, FDR, AMC, etc.&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Gap (Uncovered Length)&lt;/b&gt; is calculated automatically&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        This helps identify &lt;b&gt;funding distribution and missing coverage&lt;/b&gt; instantly.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;2. Road Inventory Management&lt;/h2&gt;

    &lt;h3&gt;➕ Add / Edit Road&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Enter &lt;b&gt;Road Name&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;Define &lt;b&gt;Total Length (km)&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;Save road into local database&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        Each road acts as a &lt;b&gt;parent entity&lt;/b&gt; containing multiple segmented works.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;3. Chainage-Based Segmentation&lt;/h2&gt;

    &lt;p&gt;
        The core concept of this tool is &lt;b&gt;chainage-based segmentation&lt;/b&gt;, where each road is divided into:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;&lt;b&gt;Start Chainage&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;End Chainage&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Scheme Allocation&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Cost &amp; Year&lt;/b&gt;&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;📌 Validation Rules&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;0 ≤ Start &amp;lt; End ≤ Total Length&lt;/li&gt;
        &lt;li&gt;No invalid overlaps allowed logically&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;📏 Chainage Format&lt;/h3&gt;
    &lt;p&gt;
        Values are automatically displayed in standard format:
    &lt;/p&gt;

    &lt;pre style=&quot;background:#f1f5f9; padding:10px;&quot;&gt;
54.700 km → 54/700
    &lt;/pre&gt;

    &lt;hr&gt;

    &lt;h2&gt;4. Linear Progress Visualization&lt;/h2&gt;

    &lt;p&gt;
        The tool dynamically generates a &lt;b&gt;horizontal bar chart&lt;/b&gt; representing the road:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;Each segment is color-coded by scheme&lt;/li&gt;
        &lt;li&gt;Proportional to actual chainage length&lt;/li&gt;
        &lt;li&gt;Gaps are highlighted in grey&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        This provides an &lt;b&gt;instant visual understanding of coverage&lt;/b&gt; and missing links.
    &lt;/p&gt;

    &lt;h3&gt;📍 Axis Marking&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Chainage ticks are auto-generated&lt;/li&gt;
        &lt;li&gt;Start and end points clearly marked&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;5. Gap Detection Logic&lt;/h2&gt;

    &lt;p&gt;
        One of the most powerful features is &lt;b&gt;automatic gap identification&lt;/b&gt;.
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;Uncovered stretches between segments are detected&lt;/li&gt;
        &lt;li&gt;Displayed as &lt;b&gt;&quot;GAP&quot;&lt;/b&gt; in table and chart&lt;/li&gt;
        &lt;li&gt;Included in summary as &lt;b&gt;Uncovered Length&lt;/b&gt;&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        This ensures &lt;b&gt;no portion of the road is left untracked&lt;/b&gt;.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;6. Data Table Representation&lt;/h2&gt;

    &lt;p&gt;
        Each segment is listed in a structured table:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;Scheme&lt;/li&gt;
        &lt;li&gt;Chainage Range&lt;/li&gt;
        &lt;li&gt;Length&lt;/li&gt;
        &lt;li&gt;Year&lt;/li&gt;
        &lt;li&gt;Cost&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        Gap rows are automatically inserted for missing stretches.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;7. Bulk Selection &amp; PDF Export&lt;/h2&gt;

    &lt;h3&gt;📑 Batch PDF Export&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Select multiple roads&lt;/li&gt;
        &lt;li&gt;Generate detailed PDF reports&lt;/li&gt;
        &lt;li&gt;Each road includes:
            &lt;ul&gt;
                &lt;li&gt;Linear chart&lt;/li&gt;
                &lt;li&gt;Chainage axis&lt;/li&gt;
                &lt;li&gt;Segment table&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        PDF generation uses:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;b&gt;html2canvas&lt;/b&gt; for rendering UI&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;jsPDF&lt;/b&gt; for document creation&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;8. Data Storage System&lt;/h2&gt;

    &lt;h3&gt;💾 Local Storage&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;All data stored in browser using &lt;b&gt;localStorage&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;No backend required&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;📥 Import / 📤 Export&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Backup complete dataset as JSON&lt;/li&gt;
        &lt;li&gt;Restore anytime using import&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;9. Scheme Color Coding&lt;/h2&gt;

    &lt;p&gt;
        Each scheme is visually differentiated:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;03 → Blue&lt;/li&gt;
        &lt;li&gt;04 → Green&lt;/li&gt;
        &lt;li&gt;NABARD → Purple&lt;/li&gt;
        &lt;li&gt;HAM → Cyan&lt;/li&gt;
        &lt;li&gt;Gap → Grey&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        Ensures &lt;b&gt;quick identification of funding sources&lt;/b&gt;.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;10. Engineering Applications&lt;/h2&gt;

    &lt;ul&gt;
        &lt;li&gt;✔ DPR preparation &amp; review&lt;/li&gt;
        &lt;li&gt;✔ Funding allocation tracking&lt;/li&gt;
        &lt;li&gt;✔ Physical progress monitoring&lt;/li&gt;
        &lt;li&gt;✔ Gap identification for proposals&lt;/li&gt;
        &lt;li&gt;✔ Road asset management&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;11. Advantages&lt;/h2&gt;

    &lt;ul&gt;
        &lt;li&gt;✔ Fully offline system&lt;/li&gt;
        &lt;li&gt;✔ Visual + numerical analysis combined&lt;/li&gt;
        &lt;li&gt;✔ Eliminates manual chainage calculations&lt;/li&gt;
        &lt;li&gt;✔ Accurate gap detection&lt;/li&gt;
        &lt;li&gt;✔ Professional reporting via PDF&lt;/li&gt;
    &lt;/ul&gt;

&lt;/div&gt;

&lt;script&gt;
    let roads = {};
    let activeRoad = &quot;&quot;;

    // Color map for PDF (html2canvas doesn&#39;t read CSS variables reliably in off-screen render)
    const SCHEME_COLORS = {
        &quot;03&quot;:    &quot;#007bff&quot;,
        &quot;04&quot;:    &quot;#28a745&quot;,
        &quot;Nabard&quot;:&quot;#6f42c1&quot;,
        &quot;AMC&quot;:   &quot;#fd7e14&quot;,
        &quot;DLP&quot;:   &quot;#dc3545&quot;,
        &quot;HAM&quot;:   &quot;#17a2b8&quot;,
        &quot;T6&quot;:    &quot;#6610f2&quot;,
        &quot;SR&quot;:    &quot;#20c997&quot;,
        &quot;FDR&quot;:   &quot;#e83e8c&quot;,
        &quot;CRF&quot;:   &quot;#6c757d&quot;,
        &quot;Kumbh&quot;: &quot;#ff6f61&quot;,
        &quot;gap&quot;:   &quot;#dee2e6&quot;,
        &quot;Gap&quot;:   &quot;#dee2e6&quot;,
        &quot;unknown&quot;:&quot;#6c757d&quot;
    };

    try {
        const saved = localStorage.getItem(&#39;roadData_v87&#39;);
        if (saved) {
            roads = JSON.parse(saved);
        }
    } catch (err) {
        console.error(&quot;Failed to load saved roads:&quot;, err);
        roads = {};
    }

    function formatChainage(val) {
        if (val == null || isNaN(val)) return &quot;0/000&quot;;
        const km = Math.floor(val);
        const m = Math.round((val - km) * 1000);
        return `${km}/${m.toString().padStart(3, &#39;0&#39;)}`;
    }

    function ensureRoadData(name, length) {
        if (!roads[name]) {
            roads[name] = { length, segments: [], selectedForPDF: false };
        } else {
            roads[name].length = length;
            if (roads[name].selectedForPDF === undefined) roads[name].selectedForPDF = false;
        }
    }

    function calculateSummary() {
        let totalSanctioned = 0;
        let totalCost = 0;
        let roadCount = Object.keys(roads).length;

        const schemeLengths = {
            &quot;03&quot;: 0, &quot;04&quot;: 0, &quot;Nabard&quot;: 0, &quot;AMC&quot;: 0, &quot;DLP&quot;: 0,
            &quot;HAM&quot;: 0, &quot;T6&quot;: 0, &quot;SR&quot;: 0, &quot;FDR&quot;: 0, &quot;CRF&quot;: 0, &quot;Kumbh&quot;: 0,
            &quot;Gap&quot;: 0
        };

        Object.values(roads).forEach(road =&gt; {
            const totalLength = Number(road.length || 0);
            totalSanctioned += totalLength;
            if (totalLength &lt;= 0) return;

            const sorted = [...road.segments].sort((a,b) =&gt; a.start - b.start);
            let prevEnd = 0;

            sorted.forEach(s =&gt; {
                const start = Number(s.start);
                const end = Number(s.end);
                const len = end - start;

                if (start &gt; prevEnd) schemeLengths[&quot;Gap&quot;] += (start - prevEnd);

                if (schemeLengths.hasOwnProperty(s.scheme)) {
                    schemeLengths[s.scheme] += len;
                }
                totalCost += Number(s.cost || 0);
                prevEnd = end;
            });

            if (prevEnd &lt; totalLength) {
                schemeLengths[&quot;Gap&quot;] += (totalLength - prevEnd);
            }
        });

        const totalCovered = totalSanctioned - schemeLengths[&quot;Gap&quot;];
        const totalRemaining = schemeLengths[&quot;Gap&quot;];
        const avgCostPerKm = totalSanctioned &gt; 0 ? Math.round(totalCost / totalSanctioned) : 0;

        document.getElementById(&#39;totalSanctioned&#39;).innerHTML = totalSanctioned.toFixed(3) + &quot; km&quot;;
        document.getElementById(&#39;totalCovered&#39;).innerHTML   = totalCovered.toFixed(3)   + &quot; km&quot;;
        document.getElementById(&#39;totalRemaining&#39;).innerHTML = totalRemaining.toFixed(3) + &quot; km&quot;;
        document.getElementById(&#39;totalCost&#39;).innerHTML      = &quot;₹ &quot; + Number(totalCost).toLocaleString(&#39;en-IN&#39;);
        document.getElementById(&#39;avgCostPerKm&#39;).innerHTML   = avgCostPerKm &gt; 0 ? &quot;₹ &quot; + avgCostPerKm.toLocaleString(&#39;en-IN&#39;) : &quot;—&quot;;
        document.getElementById(&#39;roadCount&#39;).innerHTML      = roadCount;

        // Build scheme breakdown
        let html = &#39;&lt;h4 style=&quot;margin:16px 0 8px 0; padding-top:12px; border-top:1px solid #dee2e6;&quot;&gt;Length by Scheme&lt;/h4&gt;&#39;;
        Object.entries(schemeLengths).forEach(([sch, len]) =&gt; {
            if (len &gt; 0 || sch === &quot;Gap&quot;) {
                const isGap = sch === &quot;Gap&quot;;
                html += `
                    &lt;div class=&quot;summary-row&quot;&gt;
                        &lt;span class=&quot;summary-label&quot;&gt;${sch}${isGap ? &#39; (uncovered)&#39; : &#39;&#39;}:&lt;/span&gt;
                        &lt;span class=&quot;summary-value ${isGap ? &#39;summary-highlight&#39; : &#39;&#39;}&quot;&gt;${len.toFixed(3)} km&lt;/span&gt;
                    &lt;/div&gt;`;
            }
        });

        document.getElementById(&#39;schemeBreakdown&#39;).innerHTML = html;
    }

    function init() {
        const list = document.getElementById(&#39;checklist&#39;);
        const countTotal = Object.keys(roads).length;
        const countSelected = Object.values(roads).filter(r =&gt; r.selectedForPDF).length;
        document.getElementById(&#39;statsCounter&#39;).innerHTML = `${countTotal} road(s) • ${countSelected} selected for PDF`;

        list.innerHTML = &quot;&quot;;
        const sortedNames = Object.keys(roads).sort((a,b) =&gt; a.localeCompare(b, undefined, {sensitivity:&#39;base&#39;}));

        sortedNames.forEach(name =&gt; {
            const road = roads[name];
            const isEditing  = (name === activeRoad) ? &#39;active-editing&#39; : &#39;&#39;;
            const isSelected = road.selectedForPDF ? &#39;selected-for-pdf&#39; : &#39;&#39;;

            const row = document.createElement(&#39;div&#39;);
            row.className = `road-item ${isEditing} ${isSelected}`;
            row.dataset.name = name;
            row.innerHTML = `
                &lt;input type=&quot;checkbox&quot; class=&quot;big-check&quot; ${road.selectedForPDF ? &#39;checked&#39; : &#39;&#39;}&gt;
                &lt;span style=&quot;font-weight:bold; cursor:pointer; font-size:13px;&quot; onclick=&quot;setActive(&#39;${name.replace(/&#39;/g,&quot;\\&#39;&quot;)}&#39;)&quot;&gt;${name}&lt;/span&gt;
                &lt;div class=&quot;action-group&quot;&gt;
                    &lt;button class=&quot;btn-edit&quot; onclick=&quot;setActive(&#39;${name.replace(/&#39;/g,&quot;\\&#39;&quot;)}&#39;)&quot;&gt;Edit&lt;/button&gt;
                    &lt;button class=&quot;btn-del&quot; onclick=&quot;deleteRoad(&#39;${name.replace(/&#39;/g,&quot;\\&#39;&quot;)}&#39;)&quot;&gt;×&lt;/button&gt;
                &lt;/div&gt;
            `;

            row.querySelector(&#39;.big-check&#39;).addEventListener(&#39;change&#39;, e =&gt; {
                road.selectedForPDF = e.target.checked;
                save();
                updateSelectionUI();
            });

            list.appendChild(row);
        });

        calculateSummary();
        refreshUI();
    }

    function updateSelectionUI() {
        const countSelected = Object.values(roads).filter(r =&gt; r.selectedForPDF).length;
        document.getElementById(&#39;statsCounter&#39;).innerHTML = `${Object.keys(roads).length} road(s) • ${countSelected} selected for PDF`;

        document.querySelectorAll(&#39;.road-item&#39;).forEach(item =&gt; {
            const name = item.dataset.name;
            if (roads[name]?.selectedForPDF) {
                item.classList.add(&#39;selected-for-pdf&#39;);
            } else {
                item.classList.remove(&#39;selected-for-pdf&#39;);
            }
        });
    }

    function bulkSelect(shouldSelect) {
        Object.values(roads).forEach(r =&gt; r.selectedForPDF = shouldSelect);
        save();
        init();
    }

    function setActive(name) {
        activeRoad = name;
        document.getElementById(&#39;rName&#39;).value = name;
        document.getElementById(&#39;rLen&#39;).value = roads[name]?.length || &#39;&#39;;
        document.getElementById(&#39;roadHeader&#39;).innerHTML = &quot;Road: &quot; + (name || &quot;—&quot;);
        refreshUI();
        init(); // also refreshes list to highlight active
    }

    function saveRoad() {
        let name = document.getElementById(&#39;rName&#39;).value.trim();
        const len = parseFloat(document.getElementById(&#39;rLen&#39;).value);
        if (!name || isNaN(len) || len &lt;= 0) {
            alert(&quot;Please enter valid road name and length (&gt;0).&quot;);
            return;
        }
        ensureRoadData(name, len);
        activeRoad = name;
        save();
        init();
    }

    function addSegment() {
        if (!activeRoad) return alert(&quot;Please select or save a road first.&quot;);
        const s = parseFloat(document.getElementById(&#39;sCh&#39;).value);
        const e = parseFloat(document.getElementById(&#39;eCh&#39;).value);
        const road = roads[activeRoad];

        if (isNaN(s) || isNaN(e) || s &gt;= e || e &gt; road.length || s &lt; 0) {
            alert(&quot;Invalid range: 0 ≤ Start &lt; End ≤ Total Length&quot;);
            return;
        }

        road.segments.push({
            scheme: document.getElementById(&#39;scheme&#39;).value,
            start: s,
            end: e,
            cost: parseFloat(document.getElementById(&#39;cost&#39;).value) || 0,
            year: document.getElementById(&#39;year&#39;).value || &quot;2026&quot;
        });

        road.segments.sort((a,b) =&gt; a.start - b.start);
        save();
        refreshUI();
        calculateSummary();
    }

    function refreshUI() {
        const tbody = document.getElementById(&#39;liveTableBody&#39;);
        const chart = document.getElementById(&#39;liveChart&#39;);
        const axis  = document.getElementById(&#39;liveAxis&#39;);
        tbody.innerHTML = &quot;&quot;; chart.innerHTML = &quot;&quot;; axis.innerHTML = &quot;&quot;;

        if (!activeRoad || !roads[activeRoad]) return;

        const road = roads[activeRoad];
        document.getElementById(&#39;chartTitle&#39;).innerHTML = `Linear Progress: ${formatChainage(road.length)}`;

        let cur = 0;
        const pts = new Set([0, road.length]);

        road.segments.forEach((seg, idx) =&gt; {
            if (seg.start &gt; cur) {
                renderChartBox(chart, cur, seg.start, &quot;gap&quot;, road.length);
                renderRow(tbody, &quot;GAP&quot;, cur, seg.start, &quot;—&quot;, &quot;—&quot;, true);
            }
            renderChartBox(chart, seg.start, seg.end, seg.scheme, road.length);
            renderRow(tbody, seg.scheme, seg.start, seg.end, seg.year, seg.cost, false, idx);
            pts.add(seg.start);
            pts.add(seg.end);
            cur = seg.end;
        });

        if (cur &lt; road.length) {
            renderChartBox(chart, cur, road.length, &quot;gap&quot;, road.length);
            renderRow(tbody, &quot;GAP&quot;, cur, road.length, &quot;—&quot;, &quot;—&quot;, true);
        }

        Array.from(pts).sort((a,b)=&gt;a-b).forEach(p =&gt; {
            const tick = document.createElement(&#39;div&#39;);
            tick.className = &#39;tick&#39;;
            tick.style.left = (p / road.length * 100) + &quot;%&quot;;
            tick.innerHTML = `&lt;div class=&quot;tick-line&quot;&gt;&lt;/div&gt;&lt;span class=&quot;tick-label&quot;&gt;${formatChainage(p)}&lt;/span&gt;`;
            axis.appendChild(tick);
        });
    }

    function renderChartBox(container, s, e, type, total) {
        const b = document.createElement(&#39;div&#39;);
        b.className = &#39;chart-seg&#39;;
        b.style.left   = (s / total * 100) + &quot;%&quot;;
        b.style.width  = ((e - s) / total * 100) + &quot;%&quot;;
        b.style.backgroundColor = SCHEME_COLORS[type] || &quot;#cccccc&quot;;
        if (type !== &#39;gap&#39;) b.textContent = type;
        container.appendChild(b);
    }

    function renderRow(target, scheme, s, e, y, c, isGap, idx) {
        const r = target.insertRow();
        if (isGap) r.style.color = &quot;#888&quot;;
        r.innerHTML = `
            &lt;td&gt;${scheme}&lt;/td&gt;
            &lt;td&gt;${formatChainage(s)} - ${formatChainage(e)}&lt;/td&gt;
            &lt;td&gt;${(e-s).toFixed(3)}&lt;/td&gt;
            &lt;td&gt;${y}&lt;/td&gt;
            &lt;td&gt;${Number(c).toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
            &lt;td&gt;${!isGap ? `&lt;button onclick=&quot;deleteSeg(${idx})&quot;&gt;×&lt;/button&gt;` : &#39;&#39;}&lt;/td&gt;`;
    }

    function deleteSeg(idx) {
        if (!activeRoad || !confirm(&quot;Delete this segment?&quot;)) return;
        roads[activeRoad].segments.splice(idx, 1);
        save();
        refreshUI();
        calculateSummary();
    }

    function deleteRoad(name) {
        if (!confirm(`Delete road &quot;${name}&quot;?`)) return;
        delete roads[name];
        if (activeRoad === name) activeRoad = &quot;&quot;;
        save();
        init();
    }

    function save() {
        localStorage.setItem(&#39;roadData_v87&#39;, JSON.stringify(roads));
    }

    async function generateBatchPDF() {
        const selected = Object.keys(roads).filter(k =&gt; roads[k].selectedForPDF);
        if (!selected.length) return alert(&quot;No roads selected for export.&quot;);

        const { jsPDF } = window.jspdf;
        const pdf = new jsPDF(&#39;p&#39;, &#39;mm&#39;, &#39;a4&#39;);
        const staging = document.getElementById(&#39;stagingArea&#39;);
        staging.innerHTML = &quot;&quot;;

        for (let i = 0; i &lt; selected.length; i++) {
            const name = selected[i];
            const road = roads[name];

            const block = document.createElement(&#39;div&#39;);
            block.style.padding = &quot;30px&quot;;
            block.style.width = &quot;190mm&quot;;
            block.style.background = &quot;#fff&quot;;
            block.style.fontFamily = &quot;Arial, sans-serif&quot;;

            let tableRows = &quot;&quot;;
            let prev = 0;
            road.segments.forEach(s =&gt; {
                if (s.start &gt; prev) {
                    tableRows += `
                        &lt;tr style=&quot;color:#777; background:#f8f9fa;&quot;&gt;
                            &lt;td&gt;Gap&lt;/td&gt;
                            &lt;td&gt;${formatChainage(prev)}&lt;/td&gt;
                            &lt;td&gt;${formatChainage(s.start)}&lt;/td&gt;
                            &lt;td&gt;—&lt;/td&gt;
                            &lt;td&gt;—&lt;/td&gt;
                        &lt;/tr&gt;`;
                }
                tableRows += `
                    &lt;tr&gt;
                        &lt;td&gt;${s.scheme}&lt;/td&gt;
                        &lt;td&gt;${formatChainage(s.start)}&lt;/td&gt;
                        &lt;td&gt;${formatChainage(s.end)}&lt;/td&gt;
                        &lt;td&gt;${s.year}&lt;/td&gt;
                        &lt;td&gt;₹ ${Number(s.cost).toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
                    &lt;/tr&gt;`;
                prev = s.end;
            });
            if (prev &lt; road.length) {
                tableRows += `
                    &lt;tr style=&quot;color:#777; background:#f8f9fa;&quot;&gt;
                        &lt;td&gt;Gap&lt;/td&gt;
                        &lt;td&gt;${formatChainage(prev)}&lt;/td&gt;
                        &lt;td&gt;${formatChainage(road.length)}&lt;/td&gt;
                        &lt;td&gt;—&lt;/td&gt;
                        &lt;td&gt;—&lt;/td&gt;
                    &lt;/tr&gt;`;
            }

            block.innerHTML = `
                &lt;h1 style=&quot;text-align:center; margin-bottom:16px; border-bottom:2px solid #333; padding-bottom:8px;&quot;&gt;ROAD INVENTORY&lt;/h1&gt;
                &lt;p style=&quot;font-size:14px; margin-bottom:20px;&quot;&gt;
                    &lt;strong&gt;ROAD:&lt;/strong&gt; ${name}&lt;br&gt;
                    &lt;strong&gt;TOTAL LENGTH:&lt;/strong&gt; ${formatChainage(road.length)}
                &lt;/p&gt;
                &lt;div style=&quot;height:60px; position:relative; background:#f0f0f0; border:1px solid #aaa; margin-bottom:8px;&quot; id=&quot;pdf-chart-${i}&quot;&gt;&lt;/div&gt;
                &lt;div style=&quot;height:50px; position:relative; margin-bottom:24px;&quot; id=&quot;pdf-axis-${i}&quot;&gt;&lt;/div&gt;
                &lt;table style=&quot;width:100%; border-collapse:collapse; font-size:11px;&quot;&gt;
                    &lt;tr style=&quot;background:#e0e0e0; font-weight:bold;&quot;&gt;
                        &lt;th&gt;Scheme&lt;/th&gt;&lt;th&gt;Start&lt;/th&gt;&lt;th&gt;End&lt;/th&gt;&lt;th&gt;Year&lt;/th&gt;&lt;th&gt;Cost&lt;/th&gt;
                    &lt;/tr&gt;
                    ${tableRows}
                &lt;/table&gt;`;

            staging.appendChild(block);

            // Build chart for PDF
            const chartEl = block.querySelector(`#pdf-chart-${i}`);
            const axisEl  = block.querySelector(`#pdf-axis-${i}`);
            let pts = new Set([0, road.length]);

            road.segments.forEach(s =&gt; {
                const seg = document.createElement(&#39;div&#39;);
                seg.style.position = &#39;absolute&#39;;
                seg.style.height = &#39;100%&#39;;
                seg.style.left   = (s.start / road.length * 100) + &quot;%&quot;;
                seg.style.width  = ((s.end - s.start) / road.length * 100) + &quot;%&quot;;
                seg.style.backgroundColor = SCHEME_COLORS[s.scheme] || &quot;#ccc&quot;;
                seg.style.color = &quot;blue&quot;;
                seg.style.display = &quot;flex&quot;;
                seg.style.alignItems = &quot;center&quot;;
                seg.style.justifyContent = &quot;center&quot;;
                seg.style.fontSize = &quot;10px&quot;;
                seg.style.fontWeight = &quot;bold&quot;;
                seg.textContent = s.scheme;
                chartEl.appendChild(seg);
                pts.add(s.start);
                pts.add(s.end);
            });

            Array.from(pts).sort((a,b)=&gt;a-b).forEach(p =&gt; {
                const tick = document.createElement(&#39;div&#39;);
                tick.style.position = &#39;absolute&#39;;
                tick.style.left = (p / road.length * 100) + &quot;%&quot;;
                tick.style.transform = &quot;translateX(-50%)&quot;;
                tick.innerHTML = `&lt;div style=&quot;width:1px;height:10px;background:#000;margin:0 auto;&quot;&gt;&lt;/div&gt;
                                  &lt;span style=&quot;font-size:9px;font-weight:bold;&quot;&gt;${formatChainage(p)}&lt;/span&gt;`;
                axisEl.appendChild(tick);
            });

            // Render to canvas
            const canvas = await html2canvas(block, {
                scale: 2,
                useCORS: true,
                logging: false
            });

            const imgData = canvas.toDataURL(&#39;image/png&#39;);
            const pdfWidth = 200;
            const pdfHeight = (canvas.height * pdfWidth) / canvas.width;

            if (i &gt; 0) pdf.addPage();
            pdf.addImage(imgData, &#39;PNG&#39;, 5, 5, pdfWidth, pdfHeight);
        }

        pdf.save(`Road_Inventory_${new Date().toISOString().slice(0,10)}.pdf`);
        staging.innerHTML = &quot;&quot;;
    }

    function exportJSON() {
        const blob = new Blob([JSON.stringify(roads, null, 2)], {type: &#39;application/json&#39;});
        const url = URL.createObjectURL(blob);
        const a = document.createElement(&#39;a&#39;);
        a.href = url;
        a.download = &quot;road_data_v87.json&quot;;
        a.click();
        URL.revokeObjectURL(url);
    }

    function importJSON(e) {
        const file = e.target.files[0];
        if (!file) return;
        const reader = new FileReader();
        reader.onload = ev =&gt; {
            try {
                roads = JSON.parse(ev.target.result);
                save();
                init();
                alert(&quot;Data imported successfully!&quot;);
            } catch (err) {
                alert(&quot;Error reading file: &quot; + err.message);
            }
        };
        reader.readAsText(file);
    }

    // Initial load
    init();
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/03/road-sanctioned-length-and-remaining.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-5877606476122481424</guid><pubDate>Wed, 04 Mar 2026 13:30:31 +0000</pubDate><atom:updated>2026-04-07T00:08:18.723+05:30</atom:updated><title>Barricade Rate Analysis Calculator</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;title&gt;Bulk Barricade Project Analysis&lt;/title&gt;
    &lt;style&gt;
        :root { --primary: #2c3e50; --accent: #2980b9; --success: #27ae60; }
        body { font-family: &#39;Segoe UI&#39;, Tahoma, sans-serif; background:#f4f7f6; margin:20px; color: #333; }
        .container { max-width: 1000px; margin: auto; background:#fff; padding:3px; border-radius:1px; box-shadow:0 1px 3px rgba(0,0,0,0.1); }
        .config-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; background: #ebf2f7; padding: 20px; border-radius: 8px; margin-bottom: 25px; border: 1px solid #d6eaf8; }
        label { font-weight: bold; font-size: 0.9em; color: var(--primary); }
        input { width: 100%; padding: 8px; margin-top: 5px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
        table { width:100%; border-collapse:collapse; margin:15px 0; font-size: 0.95em; }
        th, td { border:1px solid #dee2e6; padding:12px; text-align:left; }
        th { background: var(--primary); color: white; }
        .calc-btn { background: var(--success); color: white; padding: 15px; border: none; border-radius: 6px; cursor: pointer; width: 100%; font-size: 1.1em; font-weight: bold; transition: 0.3s; }
        .calc-btn:hover { background: #219150; transform: translateY(-2px); }
        .result-box { margin-top: 30px; border-top: 2px solid #eee; padding-top: 20px; }
        .total-highlight { background: #fff9c4; border-left: 5px solid #fbc02d; padding: 15px; margin: 15px 0; }
        .gst-text { color: #e67e22; font-weight: bold; }
        @media print { .no-print { display: none; } .container { box-shadow: none; border: none; width: 100%; } }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;no-print&quot;&gt;
        &lt;h2&gt;Construction Project Calculator: 100km Barricading&lt;/h2&gt;
        &lt;div class=&quot;config-panel&quot;&gt;
            &lt;div&gt;
                &lt;label&gt;Total Length (km)&lt;/label&gt;
                &lt;input id=&quot;total_km&quot; type=&quot;number&quot; value=&quot;100&quot;&gt;
            &lt;/div&gt;
            &lt;div&gt;
                &lt;label&gt;Bulk Discount (%)&lt;/label&gt;
                &lt;input id=&quot;bulk_disc&quot; type=&quot;number&quot; value=&quot;15&quot;&gt;
            &lt;/div&gt;
            &lt;div&gt;
                &lt;label&gt;Labour Efficiency (%)&lt;/label&gt;
                &lt;input id=&quot;labour_eff&quot; type=&quot;number&quot; value=&quot;10&quot;&gt;
            &lt;/div&gt;
            &lt;div&gt;
                &lt;label&gt;GST Rate (%)&lt;/label&gt;
                &lt;input id=&quot;gst_rate&quot; type=&quot;number&quot; value=&quot;18&quot;&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        
        &lt;div style=&quot;display: grid; grid-template-columns: 1fr 1fr; gap: 20px;&quot;&gt;
            &lt;div&gt;
                &lt;h3&gt;Material Unit Rates (Base)&lt;/h3&gt;
                &lt;table&gt;
                    &lt;tr&gt;&lt;td&gt;V. Balli (Qty/Rate)&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;v_qty&quot; value=&quot;3&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;v_rate&quot; value=&quot;15&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
                    &lt;tr&gt;&lt;td&gt;H. Balli (Qty/Rate)&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;h_qty&quot; value=&quot;3&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;h_rate&quot; value=&quot;12&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
                    &lt;tr&gt;&lt;td&gt;Wire (kg/Rate)&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;w_qty&quot; value=&quot;0.25&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;w_rate&quot; value=&quot;90&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
                    &lt;tr&gt;&lt;td&gt;Nails (kg/Rate)&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;n_qty&quot; value=&quot;0.10&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;n_rate&quot; value=&quot;80&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
                &lt;/table&gt;
            &lt;/div&gt;
            &lt;div&gt;
                &lt;h3&gt;Labour &amp; Overheads&lt;/h3&gt;
                &lt;table&gt;
                    &lt;tr&gt;&lt;td&gt;Mazdoor (Qty/Rate)&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;m_qty&quot; value=&quot;0.25&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;m_rate&quot; value=&quot;700&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
                    &lt;tr&gt;&lt;td&gt;Supervisor (Qty/Rate)&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;s_qty&quot; value=&quot;0.05&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;input id=&quot;s_rate&quot; value=&quot;900&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
                    &lt;tr&gt;&lt;td&gt;T&amp;P (%)&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;input id=&quot;tp_percent&quot; value=&quot;5&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
                    &lt;tr&gt;&lt;td&gt;Cont. Profit (%)&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;input id=&quot;profit_percent&quot; value=&quot;10&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
                &lt;/table&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;button class=&quot;calc-btn&quot; onclick=&quot;generateReport()&quot;&gt;Generate Detailed Bulk Analysis&lt;/button&gt;
    &lt;/div&gt;

    &lt;div id=&quot;output&quot; class=&quot;result-box&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
  
  &lt;div class=&quot;article-container&quot; style=&quot;max-width:1000px; margin:auto; font-family:Segoe UI; line-height:1.6; color:#1e293b;&quot;&gt;

    &lt;h1 style=&quot;text-align:center; color:#7c2d12;&quot;&gt;Construction Project Calculator – Barricading Cost Analysis&lt;/h1&gt;

    &lt;p&gt;
        This &lt;b&gt;HTML + JavaScript based construction calculator&lt;/b&gt; is a specialized tool developed for 
        &lt;b&gt;large-scale barricading works&lt;/b&gt; such as highway safety works, urban traffic control, 
        and temporary construction enclosures.
    &lt;/p&gt;

    &lt;p&gt;
        It enables engineers and contractors to perform &lt;b&gt;detailed rate analysis, bulk cost estimation, 
        and project-level financial planning&lt;/b&gt; with real-time computation.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;🔷 Key Features&lt;/h2&gt;
    &lt;ul&gt;
        &lt;li&gt;📏 Project-scale estimation (e.g., 100 km barricading)&lt;/li&gt;
        &lt;li&gt;🧮 Automatic unit-to-project scaling&lt;/li&gt;
        &lt;li&gt;📉 Bulk discount &amp; labour efficiency adjustments&lt;/li&gt;
        &lt;li&gt;💰 Detailed cost breakdown (Material, Labour, Overheads)&lt;/li&gt;
        &lt;li&gt;📊 GST calculation with final payable amount&lt;/li&gt;
        &lt;li&gt;📄 Printable professional report&lt;/li&gt;
        &lt;li&gt;📐 Final rate per meter calculation&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;1. Project Configuration Parameters&lt;/h2&gt;

    &lt;p&gt;
        The tool begins with high-level project inputs:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;&lt;b&gt;Total Length (km):&lt;/b&gt; Defines project scale&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Bulk Discount (%):&lt;/b&gt; Applied to material costs&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Labour Efficiency (%):&lt;/b&gt; Reduces labour cost due to productivity gains&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;GST Rate (%):&lt;/b&gt; Applicable tax rate&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        These parameters simulate &lt;b&gt;real-world large project economics&lt;/b&gt;.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;2. Base Unit Analysis (2 Meter Segment)&lt;/h2&gt;

    &lt;p&gt;
        The calculation is based on a &lt;b&gt;standard barricading unit of 2 meters&lt;/b&gt;. 
        All material and labour inputs are defined per unit length.
    &lt;/p&gt;

    &lt;h3&gt;📦 Material Components&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Vertical Balli&lt;/li&gt;
        &lt;li&gt;Horizontal Balli&lt;/li&gt;
        &lt;li&gt;Binding Wire&lt;/li&gt;
        &lt;li&gt;Nails&lt;/li&gt;
    &lt;/ul&gt;

    &lt;h3&gt;👷 Labour Components&lt;/h3&gt;
    &lt;ul&gt;
        &lt;li&gt;Mazdoor (Skilled/Unskilled)&lt;/li&gt;
        &lt;li&gt;Supervisor&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        Each component is defined by:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;Quantity per 2m&lt;/li&gt;
        &lt;li&gt;Unit Rate (₹)&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;3. Project Scaling Logic&lt;/h2&gt;

    &lt;p&gt;
        The tool converts unit-level data into full project quantities:
    &lt;/p&gt;

    &lt;pre style=&quot;background:#f1f5f9; padding:10px;&quot;&gt;
Total Length (m) = Length (km) × 1000  
Total Units = Total Length / 2
    &lt;/pre&gt;

    &lt;p&gt;
        Example for 100 km:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;Total Length = 100,000 m&lt;/li&gt;
        &lt;li&gt;Total Units = 50,000 barricade segments&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;4. Economy of Scale Adjustments&lt;/h2&gt;

    &lt;h3&gt;📉 Material Discount&lt;/h3&gt;
    &lt;p&gt;
        Bulk procurement reduces material cost:
    &lt;/p&gt;

    &lt;pre style=&quot;background:#f1f5f9; padding:10px;&quot;&gt;
Bulk Material Cost = Base Cost × (1 − Discount %)
    &lt;/pre&gt;

    &lt;h3&gt;⚡ Labour Efficiency&lt;/h3&gt;
    &lt;p&gt;
        Repetitive work increases productivity:
    &lt;/p&gt;

    &lt;pre style=&quot;background:#f1f5f9; padding:10px;&quot;&gt;
Effective Labour Cost = Base Labour × (1 − Efficiency %)
    &lt;/pre&gt;

    &lt;p&gt;
        This reflects &lt;b&gt;real construction site conditions&lt;/b&gt;.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;5. Cost Build-Up Structure&lt;/h2&gt;

    &lt;p&gt;
        The tool follows a standard engineering cost hierarchy:
    &lt;/p&gt;

    &lt;ol&gt;
        &lt;li&gt;&lt;b&gt;Prime Cost&lt;/b&gt; = Material + Labour&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Add T&amp;P / Transportation&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Add Contractor Profit&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Net Taxable Amount&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Add GST&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Grand Total Project Cost&lt;/b&gt;&lt;/li&gt;
    &lt;/ol&gt;

    &lt;hr&gt;

    &lt;h2&gt;6. Overheads &amp; Profit&lt;/h2&gt;

    &lt;ul&gt;
        &lt;li&gt;&lt;b&gt;T&amp;P (Tools &amp; Plant):&lt;/b&gt; Typically 3–10%&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Contractor Profit:&lt;/b&gt; Typically 8–15%&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        These are applied on the &lt;b&gt;prime cost&lt;/b&gt; to determine final project valuation.
    &lt;/p&gt;

    &lt;hr&gt;

    &lt;h2&gt;7. GST Calculation&lt;/h2&gt;

    &lt;p&gt;
        GST is applied on the taxable amount:
    &lt;/p&gt;

    &lt;pre style=&quot;background:#f1f5f9; padding:10px;&quot;&gt;
GST Amount = Taxable Value × GST Rate
    &lt;/pre&gt;

    &lt;p&gt;
        The tool also highlights:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;Total GST payable&lt;/li&gt;
        &lt;li&gt;Per meter GST impact&lt;/li&gt;
        &lt;li&gt;Input Tax Credit (ITC) relevance&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;8. Final Output Metrics&lt;/h2&gt;

    &lt;p&gt;
        The system generates key engineering outputs:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;Total Project Cost (₹)&lt;/li&gt;
        &lt;li&gt;Taxable Cost&lt;/li&gt;
        &lt;li&gt;GST Amount&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;Rate per Meter (₹/m)&lt;/b&gt;&lt;/li&gt;
        &lt;li&gt;&lt;b&gt;All-Inclusive Rate (₹/m)&lt;/b&gt;&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        These values are critical for:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;BOQ preparation&lt;/li&gt;
        &lt;li&gt;Tender submission&lt;/li&gt;
        &lt;li&gt;Rate justification&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;9. Report Generation&lt;/h2&gt;

    &lt;p&gt;
        The tool produces a &lt;b&gt;professional printable report&lt;/b&gt; including:
    &lt;/p&gt;

    &lt;ul&gt;
        &lt;li&gt;Project scope summary&lt;/li&gt;
        &lt;li&gt;Material &amp; labour analysis&lt;/li&gt;
        &lt;li&gt;Detailed cost breakdown&lt;/li&gt;
        &lt;li&gt;Final rate analysis&lt;/li&gt;
        &lt;li&gt;Technical observations&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;
        This can be directly used for:
    &lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;Client submission&lt;/li&gt;
        &lt;li&gt;Internal approvals&lt;/li&gt;
        &lt;li&gt;Audit documentation&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;10. Engineering Insights&lt;/h2&gt;

    &lt;ul&gt;
        &lt;li&gt;✔ Large projects benefit significantly from bulk procurement&lt;/li&gt;
        &lt;li&gt;✔ Labour productivity improves with repetitive work&lt;/li&gt;
        &lt;li&gt;✔ GST forms a major cost component in infrastructure works&lt;/li&gt;
        &lt;li&gt;✔ Per meter rate is key for comparison with schedule rates&lt;/li&gt;
    &lt;/ul&gt;

    &lt;hr&gt;

    &lt;h2&gt;11. Advantages&lt;/h2&gt;

    &lt;ul&gt;
        &lt;li&gt;✔ Fast and accurate estimation&lt;/li&gt;
        &lt;li&gt;✔ Eliminates manual calculation errors&lt;/li&gt;
        &lt;li&gt;✔ Highly customizable inputs&lt;/li&gt;
        &lt;li&gt;✔ Suitable for contractors and engineers&lt;/li&gt;
        &lt;li&gt;✔ Works completely offline&lt;/li&gt;
    &lt;/ul&gt;

&lt;/div&gt;

&lt;script&gt;
function generateReport() {
    const getVal = (id) =&gt; parseFloat(document.getElementById(id).value) || 0;

    // 1. BASE UNIT CALCULATIONS (2m)
    let v_t = getVal(&#39;v_qty&#39;) * getVal(&#39;v_rate&#39;);
    let h_t = getVal(&#39;h_qty&#39;) * getVal(&#39;h_rate&#39;);
    let w_t = getVal(&#39;w_qty&#39;) * getVal(&#39;w_rate&#39;);
    let n_t = getVal(&#39;n_qty&#39;) * getVal(&#39;n_rate&#39;);
    let mat_sub_unit = v_t + h_t + w_t + n_t;

    let m_t = getVal(&#39;m_qty&#39;) * getVal(&#39;m_rate&#39;);
    let s_t = getVal(&#39;s_qty&#39;) * getVal(&#39;s_rate&#39;);
    let lab_sub_unit = m_t + s_t;

    // 2. PROJECT SCALING
    const km = getVal(&#39;total_km&#39;);
    const total_m = km * 1000;
    const total_units = total_m / 2;
    
    // Efficiency Adjustments
    const m_disc = (100 - getVal(&#39;bulk_disc&#39;)) / 100;
    const l_eff = (100 - getVal(&#39;labour_eff&#39;)) / 100;

    let bulk_mat_total = (mat_sub_unit * total_units) * m_disc;
    let bulk_lab_total = (lab_sub_unit * total_units) * l_eff;
    
    let prime_cost = bulk_mat_total + bulk_lab_total;
    let tp_amt = prime_cost * (getVal(&#39;tp_percent&#39;) / 100);
    let net_before_profit = prime_cost + tp_amt;
    let profit_amt = net_before_profit * (getVal(&#39;profit_percent&#39;) / 100);
    
    let taxable_total = net_before_profit + profit_amt;
    let gst_amt = taxable_total * (getVal(&#39;gst_rate&#39;) / 100);
    let grand_total = taxable_total + gst_amt;

    document.getElementById(&#39;output&#39;).innerHTML = `
        &lt;div style=&quot;text-align:right&quot;&gt;&lt;button class=&quot;no-print&quot; onclick=&quot;window.print()&quot;&gt;Print Project Report&lt;/button&gt;&lt;/div&gt;
        &lt;h2 style=&quot;text-align:center; text-decoration: underline;&quot;&gt;DETAILED ESTIMATE &amp; RATE ANALYSIS&lt;/h2&gt;
        
        &lt;h3&gt;1️⃣ Project Scope&lt;/h3&gt;
        &lt;p&gt;Providing and erecting barricades for a total length of &lt;b&gt;${km.toLocaleString()} km&lt;/b&gt; (${total_m.toLocaleString()} meters).&lt;/p&gt;
        &lt;ul&gt;
            &lt;li&gt;Unit Segment: 2.0 meters&lt;/li&gt;
            &lt;li&gt;Total Units to be Erected: ${total_units.toLocaleString()} Nos.&lt;/li&gt;
            &lt;li&gt;Rental Basis: 1 Day&lt;/li&gt;
        &lt;/ul&gt;

        

        &lt;h3&gt;2️⃣ Material &amp; Labour Analysis (Project Scale)&lt;/h3&gt;
        &lt;table&gt;
            &lt;tr style=&quot;background:#eee&quot;&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Unit&lt;/th&gt;&lt;th&gt;Base Rate (₹)&lt;/th&gt;&lt;th&gt;Bulk Total (₹)&lt;/th&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Materials (Vertical, Horizontal, Binding)&lt;/td&gt;&lt;td&gt;Job&lt;/td&gt;&lt;td&gt;${mat_sub_unit.toFixed(2)} / 2m&lt;/td&gt;&lt;td&gt;${bulk_mat_total.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:2})}&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Labour (Mazdoor &amp; Supervisor)&lt;/td&gt;&lt;td&gt;Job&lt;/td&gt;&lt;td&gt;${lab_sub_unit.toFixed(2)} / 2m&lt;/td&gt;&lt;td&gt;${bulk_lab_total.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:2})}&lt;/td&gt;&lt;/tr&gt;
            &lt;tr style=&quot;font-weight:bold&quot;&gt;&lt;td&gt;Total Prime Cost&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;After Economy of Scale&lt;/td&gt;&lt;td&gt;₹ ${prime_cost.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:2})}&lt;/td&gt;&lt;/tr&gt;
        &lt;/table&gt;

        &lt;h3&gt;3️⃣ Detailed Cost Breakdown&lt;/h3&gt;
        &lt;table&gt;
            &lt;tr&gt;&lt;td&gt;Total Prime Cost&lt;/td&gt;&lt;td style=&quot;text-align:right&quot;&gt;₹ ${prime_cost.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:2})}&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Add T&amp;P / Transportation @ ${getVal(&#39;tp_percent&#39;)}%&lt;/td&gt;&lt;td style=&quot;text-align:right&quot;&gt;₹ ${tp_amt.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:2})}&lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;&lt;td&gt;Add Contractor Profit @ ${getVal(&#39;profit_percent&#39;)}%&lt;/td&gt;&lt;td style=&quot;text-align:right&quot;&gt;₹ ${profit_amt.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:2})}&lt;/td&gt;&lt;/tr&gt;
            &lt;tr class=&quot;gst-text&quot;&gt;&lt;td&gt;Net Taxable Amount&lt;/td&gt;&lt;td style=&quot;text-align:right&quot;&gt;₹ ${taxable_total.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:2})}&lt;/td&gt;&lt;/tr&gt;
            &lt;tr class=&quot;gst-text&quot;&gt;&lt;td&gt;Add GST @ ${getVal(&#39;gst_rate&#39;)}%&lt;/td&gt;&lt;td style=&quot;text-align:right&quot;&gt;₹ ${gst_amt.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:2})}&lt;/td&gt;&lt;/tr&gt;
            &lt;tr style=&quot;background:var(--primary); color:white; font-size:1.2em&quot;&gt;
                &lt;td&gt;GRAND TOTAL PROJECT COST&lt;/td&gt;
                &lt;td style=&quot;text-align:right&quot;&gt;₹ ${grand_total.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:2})}&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;

        &lt;div class=&quot;total-highlight&quot;&gt;
            &lt;h3 style=&quot;margin:0&quot;&gt;4️⃣ Final Rate Per Meter&lt;/h3&gt;
            &lt;p&gt;Taxable Rate per Meter: &lt;b&gt;₹ ${(taxable_total / total_m).toFixed(2)}&lt;/b&gt;&lt;/p&gt;
            &lt;p class=&quot;gst-text&quot;&gt;GST per Meter: ₹ ${(gst_amt / total_m).toFixed(2)}&lt;/p&gt;
            &lt;hr&gt;
            &lt;p style=&quot;font-size:1.5em; margin:0&quot;&gt;&lt;strong&gt;All-Inclusive Rate: ₹ ${(grand_total / total_m).toFixed(2)} / Meter&lt;/strong&gt;&lt;/p&gt;
        &lt;/div&gt;

        &lt;h3&gt;5️⃣ Technical Observations for 100km Project&lt;/h3&gt;
        &lt;ul&gt;
            &lt;li&gt;&lt;b&gt;Economy of Scale:&lt;/b&gt; A 15% discount is applied to materials due to wholesale procurement.&lt;/li&gt;
            &lt;li&gt;&lt;b&gt;Labour Productivity:&lt;/b&gt; A 10% efficiency gain is assumed for repetitive work over long stretches.&lt;/li&gt;
            &lt;li&gt;&lt;b&gt;GST Impact:&lt;/b&gt; The project involves a massive tax component of ₹ ${gst_amt.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:0})}, which is eligible for Input Tax Credit (ITC).&lt;/li&gt;
        &lt;/ul&gt;
    `;
}
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/03/barricade-rate-analysis-calculator.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-7263837756205277002</guid><pubDate>Sat, 28 Feb 2026 13:57:02 +0000</pubDate><atom:updated>2026-04-07T12:13:49.205+05:30</atom:updated><title>EPC Schedule H payment plus physical progress tracking</title><description>&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;&lt;/meta&gt;
    &lt;meta content=&quot;width=device-width, initial-scale=1.0&quot; name=&quot;viewport&quot;&gt;&lt;/meta&gt;
    &lt;title&gt;EPC Pro: Progress &amp; Billing&lt;/title&gt;
    
    &lt;script src=&quot;https://cdn.jsdelivr.net/npm/chart.js&quot;&gt;&lt;/script&gt;

    &lt;style&gt;
        :root {
            --primary: #2c3e50; --accent: #3498db; --success: #27ae60;
            --danger: #e74c3c; --warning: #f39c12; --light: #f4f7f6;
        }

        body { font-family: &#39;Segoe UI&#39;, sans-serif; background: var(--light); margin: 0; padding: 10px; color: #333; }
        .container { max-width: 1200px; margin: auto; }
        
        .nav-bar { 
            display: flex; justify-content: space-between; align-items: center; 
            background: white; padding: 2px 5px; border-radius: 8px; 
            box-shadow: 0 2px 5px rgba(0,0,0,0.1); margin-bottom: 15px;
        }

        .card { background: white; padding: 15px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); margin-bottom: 15px; }
        .grid-dashboard { display: grid; grid-template-columns: 1.5fr 1fr; gap: 15px; margin-bottom: 15px; }
        
        .table-wrapper { overflow-x: auto; background: white; border-radius: 4px; margin-top: 10px; border: 1px solid #eee; }
        table { width: 100%; border-collapse: collapse; min-width: 600px; }
        th { background: var(--primary); color: white; padding: 2px; text-align: left; font-size: 11px; text-transform: uppercase; }
        td { padding: 8px; border-bottom: 1px solid #eee; font-size: 12px; }
        
        .milestone-row { background: #e8f4fd; font-weight: bold; }
        .status { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: bold; }
        .status-paid { background: #d4edda; color: #155724; }
        .status-pending { background: #f8d7da; color: #721c24; }

        .input-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-top: 10px; }
        label { font-size: 11px; font-weight: bold; color: #666; display: block; margin-bottom: 3px; }
        input, select { width: 100%; padding: 6px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; }

        .btn { padding: 7px 12px; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 11px; }
        .btn-primary { background: var(--accent); color: white; }
        .btn-success { background: var(--success); color: white; }
        .btn-danger { background: var(--danger); color: white; }

        .stat-card { flex: 1; padding: 10px; border-radius: 8px; color: white; text-align: center; }
        .section-title { border-left: 5px solid var(--accent); padding-left: 10px; margin: 20px 0 10px 0; color: var(--primary); font-size: 16px; }
        
        input.table-input { width: 40px; padding: 2px; border: 1px solid #ccc; }
      .row-selected {
    background-color: #d6eaf8 !important;
}
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;nav-bar&quot;&gt;
      
        &lt;div style=&quot;align-items: center; display: flex; gap: 10px;&quot;&gt;
            &lt;strong&gt;PROJ:&lt;/strong&gt;
            &lt;select id=&quot;projectSelector&quot; onchange=&quot;switchProject()&quot;&gt;&lt;/select&gt;
        &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
  
      
        &lt;div&gt;
          	&lt;button class=&quot;btn&quot; onclick=&quot;createNewProject()&quot; style=&quot;background:blue; color:white;&quot;&gt;+ New&lt;/button&gt;
            &lt;button class=&quot;btn&quot; onclick=&quot;exportJSON()&quot; style=&quot;background: green; color: white;&quot;&gt;Export JSON&lt;/button&gt;
         
            &lt;input type=&quot;file&quot; id=&quot;importJSONFile&quot; style=&quot;display:none&quot; onchange=&quot;importJSON(event)&quot;&gt;
			&lt;button class=&quot;btn&quot; onclick=&quot;document.getElementById(&#39;importJSONFile&#39;).click()&quot; style=&quot;background:Magenta; color:white;&quot;&gt;Import JSON&lt;/button&gt;
            
            &lt;button class=&quot;btn&quot; onclick=&quot;deleteCurrentProject()&quot; style=&quot;background:red; color:white;&quot;&gt;Delete Project&lt;/button&gt;
    	&lt;/div&gt;
        
    &lt;div class=&quot;grid-dashboard&quot;&gt;
        &lt;div class=&quot;card&quot;&gt;
            &lt;h4 style=&quot;margin: 0 0 10px 0;&quot;&gt;Settings&lt;/h4&gt;
            &lt;div class=&quot;input-row&quot;&gt;
                &lt;div&gt;&lt;label&gt;Project Name&lt;/label&gt;&lt;input id=&quot;projNameInput&quot; onblur=&quot;renameProject()&quot; type=&quot;text&quot; /&gt;&lt;/div&gt;
            &lt;/div&gt;
          
          	&lt;div class=&quot;input-row&quot;&gt;
          		&lt;div&gt;&lt;label&gt;Contract Value (₹)&lt;/label&gt;&lt;input id=&quot;projBudgetInput&quot; onchange=&quot;updateProjectMeta()&quot; type=&quot;number&quot; /&gt;&lt;/div&gt;
            &lt;/div&gt;
          
            &lt;div style=&quot;border-top: 1px solid #eee; margin-top: 15px; padding-top: 10px;&quot;&gt;
                &lt;label&gt;Set Physical Progress Milestones (%)&lt;/label&gt;
                &lt;div style=&quot;display: flex; gap: 8px; margin-top: 5px;&quot;&gt;
                    &lt;input id=&quot;newMilestonePercent&quot; placeholder=&quot;e.g. 25&quot; style=&quot;width: 70px;&quot; type=&quot;number&quot; /&gt;
                  &lt;button class=&quot;btn btn-primary&quot; onclick=&quot;addGlobalMilestone()&quot;&gt;Add&lt;/button&gt;
                  	
                &lt;/div&gt;
                &lt;div id=&quot;milestoneList&quot; style=&quot;display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px;&quot;&gt;&lt;/div&gt;
            &lt;/div&gt;
           
        &lt;/div&gt;
      

        &lt;div class=&quot;card&quot; style=&quot;background: var(--primary); color: white;&quot;&gt;
            &lt;h4 style=&quot;margin: 0; opacity: 0.8;&quot;&gt;Financial Summary&lt;/h4&gt;
            &lt;div class=&quot;stat-card&quot; style=&quot;background: rgba(255,255,255,0.1); margin: 10px 0;&quot;&gt;
                &lt;small&gt;Total Earned&lt;/small&gt;
                &lt;div style=&quot;font-size: 20px; font-weight: bold;&quot;&gt;₹&lt;span id=&quot;totalSpent&quot;&gt;0&lt;/span&gt;&lt;/div&gt;
                &lt;small&gt;&lt;span id=&quot;overallPercent&quot;&gt;0&lt;/span&gt;% Complete&lt;/small&gt;
              &lt;button class=&quot;btn btn-primary&quot; onclick=&quot;exportPDF()&quot; 
        style=&quot;margin-top:10px;width:100%;&quot;&gt;
    Export PDF
&lt;/button&gt;
            &lt;/div&gt;
            &lt;div style=&quot;display: flex; gap: 10px;&quot;&gt;
                &lt;div class=&quot;stat-card&quot; style=&quot;background: var(--success);&quot;&gt;&lt;small&gt;Paid&lt;/small&gt;&lt;br /&gt;&lt;b id=&quot;dispPaid&quot;&gt;0&lt;/b&gt;&lt;/div&gt;
                &lt;div class=&quot;stat-card&quot; style=&quot;background: var(--warning);&quot;&gt;&lt;small&gt;Bal&lt;/small&gt;&lt;br /&gt;&lt;b id=&quot;dispBalance&quot;&gt;0&lt;/b&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;button class=&quot;btn btn-danger&quot; onclick=&quot;deleteCurrentProject()&quot; style=&quot;margin-top: 10px; width: 100%;&quot;&gt;Delete Project&lt;/button&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;div style=&quot;height: 600px; width: 100%; margin-top: 2px;&quot;&gt;&lt;canvas id=&quot;progressChart&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;

    &lt;h3 class=&quot;section-title&quot;&gt;Physical Progress Tracking&lt;/h3&gt;
    &lt;div class=&quot;card&quot;&gt;
        &lt;div class=&quot;input-row&quot;&gt;
            &lt;div style=&quot;grid-column: span 2;&quot;&gt;&lt;label&gt;Activity&lt;/label&gt;&lt;select id=&quot;actName&quot;&gt;&lt;/select&gt;&lt;/div&gt;
        &lt;/div&gt;
      
      &lt;div class=&quot;input-row&quot;&gt;    
            &lt;div&gt;&lt;label&gt;Total Qty&lt;/label&gt;&lt;input id=&quot;actTotalQty&quot; type=&quot;number&quot; /&gt;&lt;/div&gt;
        &lt;/div&gt;
      
      &lt;div class=&quot;input-row&quot;&gt;
            &lt;div&gt;&lt;label&gt;Achieved&lt;/label&gt;&lt;input id=&quot;actAchievedQty&quot; type=&quot;number&quot; /&gt;&lt;/div&gt;
        &lt;/div&gt;
      
      &lt;div class=&quot;input-row&quot;&gt;
            &lt;div style=&quot;align-items: flex-end; display: flex;&quot;&gt;&lt;button class=&quot;btn btn-success&quot; onclick=&quot;saveActivity()&quot; style=&quot;width: 100%;&quot;&gt;Update&lt;/button&gt;&lt;/div&gt;
        &lt;/div&gt;
      
      
        &lt;div class=&quot;table-wrapper&quot;&gt;
            &lt;table&gt;
                &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Activity&lt;/th&gt;&lt;th&gt;Qty&lt;/th&gt;&lt;th&gt;Progress&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
                &lt;tbody id=&quot;tableBody&quot;&gt;&lt;/tbody&gt;
            &lt;/table&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;h3 class=&quot;section-title&quot;&gt;EPC Billing (Schedule-H)&lt;/h3&gt;
    
    &lt;div class=&quot;card&quot;&gt;
        &lt;div style=&quot;align-items: center; display: flex; gap: 10px; margin-bottom: 10px;&quot;&gt;
            &lt;button class=&quot;btn btn-primary&quot; onclick=&quot;addMilestone()&quot;&gt;+ Add Stage&lt;/button&gt;
            &lt;input id=&quot;certNumber&quot; placeholder=&quot;Cert No&quot; style=&quot;width: 90px;&quot; /&gt;
            &lt;button class=&quot;btn btn-success&quot; onclick=&quot;approveSelected()&quot;&gt;Approve &amp;amp; Pay&lt;/button&gt;
        &lt;/div&gt;
        &lt;div class=&quot;table-wrapper&quot;&gt;
            &lt;table&gt;
                &lt;thead&gt;
                    &lt;tr&gt;
                        &lt;th style=&quot;width: 20px;&quot;&gt;&lt;input onclick=&quot;toggleAll(this)&quot; type=&quot;checkbox&quot; /&gt;&lt;/th&gt;
                        &lt;th&gt;Milestone / Activity&lt;/th&gt;
                        &lt;th&gt;MS %&lt;/th&gt;
                        &lt;th&gt;Weight %&lt;/th&gt;
                        &lt;th&gt;Exec (%)&lt;/th&gt;
                        &lt;th&gt;Stage Value&lt;/th&gt;
                        &lt;th&gt;Payable&lt;/th&gt;
                        &lt;th&gt;Status&lt;/th&gt;
						&lt;th&gt;Action&lt;/th&gt;
                    &lt;/tr&gt;
                &lt;/thead&gt;
                &lt;tbody id=&quot;billingTableBody&quot;&gt;&lt;/tbody&gt;
            &lt;/table&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  
  
  &lt;div class=&quot;container&quot; style=&quot;max-width:1000px; margin:auto; line-height:1.6; font-family:Arial, sans-serif;&quot;&gt;

&lt;h1 style=&quot;text-align:center; color:#2c3e50;&quot;&gt;
EPC Project Monitoring &amp; Schedule-H Payment Tracking System
&lt;/h1&gt;

&lt;p style=&quot;text-align:center; color:#555;&quot;&gt;
A Professional Digital Solution for Integrated Physical Progress and Financial Billing Control
&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;1. Introduction&lt;/h2&gt;
&lt;p&gt;
This tool is a comprehensive &lt;b&gt;Engineering, Procurement &amp; Construction (EPC)&lt;/b&gt; project monitoring system 
designed to seamlessly integrate &lt;b&gt;physical progress tracking&lt;/b&gt; with &lt;b&gt;financial billing (Schedule-H)&lt;/b&gt;.
&lt;/p&gt;

&lt;p&gt;
It eliminates manual reconciliation between site progress and billing by creating a 
&lt;b&gt;data-driven, automated linkage&lt;/b&gt; between executed quantities and payable amounts.
&lt;/p&gt;

---

&lt;h2&gt;2. Core Concept&lt;/h2&gt;

&lt;p&gt;The system operates on three interconnected layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Physical Progress Layer&lt;/b&gt; – Tracks actual executed quantities on site&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Billing Layer (Schedule-H)&lt;/b&gt; – Defines payment structure through milestones and stages&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Financial Layer&lt;/b&gt; – Calculates payable, paid, and balance dynamically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
This ensures that &lt;b&gt;payments are always proportional to actual work completed&lt;/b&gt;, 
which is a key requirement in EPC contracts.
&lt;/p&gt;

---

&lt;h2&gt;3. Physical Progress Tracking&lt;/h2&gt;

&lt;p&gt;
Each activity (e.g., DBM, PQC, Culvert, Drain, etc.) is monitored using:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Total Quantity&lt;/li&gt;
&lt;li&gt;Achieved Quantity&lt;/li&gt;
&lt;li&gt;Automatic % Completion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;b&gt;Formula Used:&lt;/b&gt;&lt;/p&gt;

&lt;p style=&quot;background:#f4f6f7; padding:10px; border-left:4px solid #3498db;&quot;&gt;
% Progress = (Achieved Quantity / Total Quantity) × 100
&lt;/p&gt;

&lt;p&gt;
This data acts as the &lt;b&gt;primary driver&lt;/b&gt; for all financial calculations.
&lt;/p&gt;

---

&lt;h2&gt;4. Schedule-H Billing System&lt;/h2&gt;

&lt;p&gt;
The billing module follows a structured hierarchy:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Milestones&lt;/b&gt; → Represent major project stages (e.g., Earthwork, Pavement, Structures)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Sub-Activities (Stages)&lt;/b&gt; → Linked directly to physical work items&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Weightage (%)&lt;/b&gt; → Defines financial importance of each stage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Each stage derives its payable amount based on:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project Budget&lt;/li&gt;
&lt;li&gt;Milestone %&lt;/li&gt;
&lt;li&gt;Stage Weight %&lt;/li&gt;
&lt;li&gt;Physical Progress&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;5. Financial Logic&lt;/h2&gt;

&lt;p&gt;&lt;b&gt;Stage Maximum Value:&lt;/b&gt;&lt;/p&gt;

&lt;p style=&quot;background:#f4f6f7; padding:10px; border-left:4px solid #27ae60;&quot;&gt;
Stage Value = Budget × (Milestone % / 100) × (Stage Weight % / 100)
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Payable Amount:&lt;/b&gt;&lt;/p&gt;

&lt;p style=&quot;background:#f4f6f7; padding:10px; border-left:4px solid #e67e22;&quot;&gt;
Payable = Stage Value × (Physical Progress / 100)
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Final Payment Rule:&lt;/b&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Payment is capped at executed value&lt;/li&gt;
&lt;li&gt;No overpayment allowed&lt;/li&gt;
&lt;li&gt;Already paid amounts are deducted automatically&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;6. Smart Approval System&lt;/h2&gt;

&lt;p&gt;
The tool includes a &lt;b&gt;checkbox-based approval system&lt;/b&gt; where:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Selected activities are approved in batch&lt;/li&gt;
&lt;li&gt;System automatically updates payable → paid&lt;/li&gt;
&lt;li&gt;Prevents duplicate or excess payments&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;7. Global Milestones (Physical Targets)&lt;/h2&gt;

&lt;p&gt;
Users can define global physical milestones (e.g., 25%, 50%, 75%, 100%).
&lt;/p&gt;

&lt;p&gt;
The system calculates &lt;b&gt;overall physical progress in cost terms&lt;/b&gt; and highlights:
&lt;/p&gt;

&lt;ul&gt;
&lt;li style=&quot;color:green;&quot;&gt;&lt;b&gt;Achieved Milestones&lt;/b&gt;&lt;/li&gt;
&lt;li style=&quot;color:orange;&quot;&gt;&lt;b&gt;Pending Milestones&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;8. Data Management System&lt;/h2&gt;

&lt;p&gt;
The tool uses &lt;b&gt;IndexedDB (Browser Database)&lt;/b&gt; for:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Offline data storage&lt;/li&gt;
&lt;li&gt;Multi-project handling&lt;/li&gt;
&lt;li&gt;Fast performance without server dependency&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;9. Smart JSON Import / Export&lt;/h2&gt;

&lt;p&gt;
A powerful &lt;b&gt;data portability system&lt;/b&gt; is built-in:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Export single / multiple / all projects&lt;/li&gt;
&lt;li&gt;Import with &lt;b&gt;smart merge logic&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;b&gt;Smart Merge Features:&lt;/b&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project matching by name&lt;/li&gt;
&lt;li&gt;Duplicate prevention&lt;/li&gt;
&lt;li&gt;Latest progress preservation&lt;/li&gt;
&lt;li&gt;Max-value logic for quantities and payments&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;10. Visualization (Progress Chart)&lt;/h2&gt;

&lt;p&gt;
A dynamic bar chart provides:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Activity-wise progress (%)&lt;/li&gt;
&lt;li&gt;Instant visual performance tracking&lt;/li&gt;
&lt;li&gt;Better decision-making for engineers and managers&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;11. PDF Reporting&lt;/h2&gt;

&lt;p&gt;
The system generates a professional report including:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project summary&lt;/li&gt;
&lt;li&gt;Financial progress&lt;/li&gt;
&lt;li&gt;Physical progress&lt;/li&gt;
&lt;li&gt;Schedule-H breakdown&lt;/li&gt;
&lt;li&gt;Graphical representation&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;12. Key Advantages&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;✔ Eliminates manual billing errors&lt;/li&gt;
&lt;li&gt;✔ Ensures payment transparency&lt;/li&gt;
&lt;li&gt;✔ Links field progress with finance&lt;/li&gt;
&lt;li&gt;✔ Supports EPC contract compliance&lt;/li&gt;
&lt;li&gt;✔ Works offline (no server required)&lt;/li&gt;
&lt;li&gt;✔ Scalable for multiple projects&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;13. Ideal Use Cases&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Highway Projects (Flexible &amp; Rigid Pavements)&lt;/li&gt;
&lt;li&gt;Bridge &amp; Structure Works&lt;/li&gt;
&lt;li&gt;Urban Infrastructure Projects&lt;/li&gt;
&lt;li&gt;Government EPC Contracts&lt;/li&gt;
&lt;li&gt;PMC &amp; Contractor Billing Systems&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
  
  

&lt;script&gt;
    let library = { currentProjectId: null, projects: {} };
    let editIdx = -1; let chart = null;

    const masterWorkItems = {
   &quot;Roadwork - BT Layers&quot;: [&quot;Site Clearance&quot;,&quot;Sub_grade Flexible&quot;,&quot;Excavation for Road&quot;,&quot;Emabankment/Earthwork/Natural Subgrade&quot;,&quot;Emabankment/Earthwork/Natural Subgrade (BT Widening)&quot;,&quot;Emabankment/Earthwork/Natural Subgrade (BT reconstruction)&quot;,&quot;Sub-Base Course&quot;,&quot;Sub-Base Course(Widening BT)&quot;,&quot;Sub-Base Course(Reconstruction BT)&quot;,&quot;Sub-Base Course(Repair BT)&quot;,&quot;Wet Mix Macadam&quot;,&quot;Non Bituminous Base course&quot;,&quot;Non Bituminous Base course (BT Widening)&quot;,&quot;Non Bituminous Base course (BT Reconstruction)&quot;,&quot;Non Bituminous Base course (BT Repair)&quot;,&quot;Grading I&quot;,&quot;Grading II&quot;,&quot;Dense Bituminous Macadam (DBM)&quot;,&quot;Bituminous Base course&quot;,&quot;Bituminous Base course (Widening)&quot;,&quot;Bituminous Base course (Reconstruction)&quot;,&quot;Bituminous Base course (Repair)&quot;,&quot;Bituminous Concrete (BC)&quot;,&quot;Wearing course (BT Widening)&quot;,&quot;Wearing course (BT Reconstruction)&quot;,&quot;Wearing course (BT Repair)&quot;,&quot;Excavation for Road for Widening BT&quot;,&quot;Excavation for Road for Reconstruction BT&quot;,&quot;Side Shoulders&quot;,&quot;Side Shoulders (Widening)&quot;,&quot;Side Shoulders (Reconstruction)&quot;,&quot;Side Shoulders (Repair)&quot;],
      
   &quot;Roadwork - Rigid Layers&quot;: [&quot;White Topping&quot;,&quot;Sub_grade Rigid&quot;,&quot;Emabankment/Earthwork/Natural Subgrade (Rigid Widening)&quot;,&quot;Emabankment/Earthwork/Natural Subgrade (Rigid reconstruction)&quot;,&quot;Sub-Base Course(Widening Rigid)&quot;,&quot;Sub-Base Course(Reconstruction Rigid)&quot;,&quot;Sub-Base Course(Repair Rigid)&quot;,&quot;Non Bituminous Base course (Rigid Widening)&quot;,&quot;Non Bituminous Base course (Rigid Reconstruction)&quot;,&quot;Dry lean Concrete (DLC)&quot;,&quot;Dry lean Concrete widening (DLC)&quot;,&quot;Dry lean Concrete reconstruction (DLC)&quot;,&quot;Pavement Quality Concrete (PQC)&quot;,&quot;Pavement Quality Concrete (PQC widening)&quot;,&quot;Pavement Quality Concrete (PQC Reconstruction)&quot;,&quot;Pavement Quality Concrete (PQC Repair)&quot;,&quot;Wearing course (Rigid Widening)&quot;,&quot;Wearing course (Rigid Reconstruction)&quot;,&quot;Wearing course (Rigid Repair)&quot;,&quot;Excavation for Road for Widening Rigid&quot;,&quot;Excavation for Road for Reconstruction Rigid&quot;,&quot;Side Shoulders (Paved)&quot;,&quot;Side Shoulders (UnPaved)&quot;,&quot;Soft Side Shoulders (Rigid widening)&quot;,&quot;Soft Side Shoulders (Rigid reconstruction)&quot;],   

  &quot;Structures - Culverts &amp; Walls&quot;: [&quot;Slab Culvert&quot;,&quot;Slab Culvert (Repair)&quot;,&quot;Hume Pipe Culvert&quot;,&quot;Hume Pipe Culvert (Repair)&quot;,&quot;Box Culvert&quot;,&quot;Box Culvert (Repair)&quot;,&quot;PCC retaining wall&quot;,&quot;RCC retaining wall&quot;,&quot;Toe wall&quot;,&quot;Approaches for slab culvert&quot;,&quot;Approaches for HPD&quot;,&quot;Head walls&quot;],

  &quot;Bridges (Minor &amp; Major)&quot;: [&quot;Minor Bridge foundation&quot;,&quot;Minor Bridge Sub-structure&quot;,&quot;Minor Bridge Super-structure&quot;,&quot;Major Bridge foundation&quot;,&quot;Major Bridge Sub-structure&quot;,&quot;Major Bridge Super-structure&quot;,&quot;Bridge Approaches&quot;,&quot;Miscellaneous Bridge works&quot;,&quot;Bridge Bearing&quot;,&quot;Crash Barrier&quot;,&quot;Rigid apron&quot;,&quot;Flexible apron&quot;,&quot;Wing wall&quot;,&quot;Wearing Course&quot;,&quot;Stone Pitching&quot;,&quot;Curtain wall&quot;,&quot;Minor Bridge (Repair)&quot;,&quot;Major Bridge (Repair)&quot;],
      
      &quot;Bridges-2 (Minor &amp; Major)&quot;: [&quot;Minor Bridge foundation-2&quot;,&quot;Minor Bridge Sub-structure-2&quot;,&quot;Minor Bridge Super-structure-2&quot;,&quot;Major Bridge foundation-2&quot;,&quot;Major Bridge Sub-structure-2&quot;,&quot;Major Bridge Super-structure-2&quot;,&quot;Bridge Approaches-2&quot;,&quot;Miscellaneous Bridge works-2&quot;,&quot;Bridge Bearing-2&quot;,&quot;Crash Barrier-2&quot;,&quot;Rigid apron-2&quot;,&quot;Flexible apron-2&quot;,&quot;Wing wall-2&quot;,&quot;Wearing Course-2&quot;,&quot;Stone Pitching-2&quot;,&quot;Curtain wall-2&quot;,&quot;Minor Bridge (Repair)-2&quot;,&quot;Major Bridge (Repair)-2&quot;],

  &quot;Junctions &amp; Safety&quot;: [&quot;Traffic Signs&quot;,&quot;Major Junctions&quot;,&quot;Minor Junctions&quot;,&quot;Road signs, Markings&quot;,&quot;KM stones&quot;,&quot;Metal Beam Crash barrier&quot;,&quot;Hand Railing for built-up section&quot;,&quot;Solar Blinker&quot;,&quot;Solar Street Light&quot;,&quot;High mast&quot;,&quot;Overhead Gantry Mounted Signs&quot;,&quot;Road Delineators&quot;],

  &quot;Drainage &amp; Utilities&quot;: [&quot;Footpath and Drains&quot;,&quot;Clearing and Grubbing&quot;,&quot;Excavation For Gutter&quot;,&quot;Cover Slab&quot;,&quot;Utility Duct Across the road&quot;,&quot;Approach Crossing&quot;,&quot;Road Side Drains (Earthen)&quot;,&quot;Road Side Drains (RCC covered slab drain)&quot;,&quot;Water Utilities&quot;,&quot;Electrical Utilities&quot;,&quot;Storm water Drain&quot;,&quot;Sewer lines&quot;],

  &quot;Ancillary&quot;: [&quot;Bus Shelter&quot;,&quot;Bus Bay&quot;,&quot;Toilet Block&quot;,&quot;Median Kerb&quot;,&quot;Kerb With Channel&quot;,&quot;Road side Plantation&quot;,&quot;Plantation in Median&quot;,&quot;Blinkers&quot;,&quot;Cateye&quot;,&quot;Staircase&quot;,&quot;Truck lay byes&quot;],
      
  &quot;Project facilities&quot;: [&quot;Cantilever Gantry&quot;, &quot;Solar street Light&quot;,&quot;High Mast&quot;,&quot;Metal beam crash barrier&quot;,&quot;Hand Railing for Built-up sections&quot;,&quot;Protection works for floor&quot;],  

  &quot;General Components&quot;: [&quot;Reinforcement&quot;,&quot;Formwork&quot;,&quot;Finishing&quot;,&quot;Colouring&quot;],

  &quot;Repair works&quot;: [&quot;Repair culvert&quot;,&quot;Diversion&quot;],

  &quot;River Training&quot;: [&quot;Guide Bunds&quot;,&quot;Spurs&quot;,&quot;Groynes&quot;,&quot;Marginal embankment (dyke or levee)&quot;],
      
   &quot;Underpass1&quot;: [&quot;U1_Foundation: On completion of the foundation work of abutments and piers&quot;,&quot;U1_Sub-structure: On completion of abutments and piers with abutment/pier&quot;,&quot;U1_Super-structure: On completion of the super-structure upto deck slab including bearing&quot;,&quot;U1_Miscellaneous Works: On completion of wearing coat, expansion joint, crash barrier, railings and any remaining work associated to bridge including tests on bridge&quot;,&quot;U1_Approaches: On completion of approaches including Wing walls/Return walls, Retaining walls/Reinforced Earth walls, stone pitching, protection works complete in all respect and fit for use&quot;,&quot;ACB on completion of Final work&quot;],
      
   &quot;Underpass2&quot;: [&quot;U2_Foundation: On completion of the foundation work of abutments and piers&quot;,&quot;U2_Sub-structure: On completion of abutments and piers with abutment/pier&quot;,&quot;U2_Super-structure: On completion of the super-structure upto deck slab including bearing&quot;,&quot;U2_Miscellaneous Works: On completion of wearing coat, expansion joint, crash barrier, railings and any remaining work associated to bridge including tests on bridge&quot;,&quot;U2_Approaches: On completion of approaches including Wing walls/Return walls, Retaining walls/Reinforced Earth walls, stone pitching, protection works complete in all respect and fit for use&quot;],
      
   &quot;Underpass3&quot;: [&quot;U3_Foundation: On completion of the foundation work of abutments and piers&quot;,&quot;U3_Sub-structure: On completion of abutments and piers with abutment/pier&quot;,&quot;U3_Super-structure: On completion of the super-structure upto deck slab including bearing&quot;,&quot;U3_Miscellaneous Works: On completion of wearing coat, expansion joint, crash barrier, railings and any remaining work associated to bridge including tests on bridge&quot;,&quot;U3_Approaches: On completion of approaches including Wing walls/Return walls, Retaining walls/Reinforced Earth walls, stone pitching, protection works complete in all respect and fit for use&quot;],
      
   &quot;Other works&quot;: [&quot;Toll Plaza&quot;,&quot;Road side drains/Storm Water&quot;,&quot;Protection works other than approaches to the bridges, elevated sections/flyovers/grade separators and ROBS/RUBs. Including Crash Barrier, NJB, Kerb, etc.&quot;,&quot;Sump and Pumping arrangement&quot;,&quot;Utility Shifting&quot;,&quot;Road signs, markings, km stones, safety devices, kerb etc.&quot;],
      
      &quot;Dismantling Works&quot;: [&quot;Dismantling flexible Pavements&quot;,&quot;Dismantling Rigid Pavements&quot;],
      
  &quot;Not for Payment&quot;: [&quot;No. of trees to be cut&quot;,&quot;No. of Electric Poles to be shifted&quot;,&quot;Elecrical Lines crossings&quot;,&quot;Length of Pipeline to be shifted (Severe/Water)&quot;,&quot;Other Utilities&quot;]
};

    document.addEventListener(&#39;DOMContentLoaded&#39;, () =&gt; {
    initDB(() =&gt; {
        loadFromStorage(() =&gt; {
            if (!library.currentProjectId || !library.projects[library.currentProjectId]) {
                createNewProject(&quot;Project Alpha&quot;);
            } else {
                refreshProjectList();
                updateUI();
            }
        });
    });
});

    function createNewProject(name) {
        const id = &#39;proj_&#39; + Date.now();
        const pName = name || prompt(&quot;Project Name:&quot;);
        if (!pName) return;
        library.projects[id] = { id, name: pName, budget: 10000000, activities: [], milestones: [], globalMilestones: [] };
        library.currentProjectId = id;
        saveToStorage();
        refreshProjectList();
      	updateUI();
      
    }
  
  let db;

function initDB(callback) {
    const request = indexedDB.open(&#39;ConstructionMasterDB&#39;, 1);

    request.onupgradeneeded = (e) =&gt; {
        db = e.target.result;
        if (!db.objectStoreNames.contains(&#39;data&#39;)) {
            db.createObjectStore(&#39;data&#39;);
        }
    };

    request.onsuccess = (e) =&gt; {
        db = e.target.result;
        console.log(&quot;DB initialized&quot;);
        if (callback) callback();
    };

    request.onerror = (e) =&gt; {
        console.error(&quot;DB error:&quot;, e.target.error);
    };
}
  

function saveToStorage() {
    if (!db) return;

    const tx = db.transaction([&#39;data&#39;], &#39;readwrite&#39;);
    const store = tx.objectStore(&#39;data&#39;);

    const req = store.put(library, &#39;main_library&#39;);

    req.onsuccess = () =&gt; {
        console.log(&quot;Saved to IndexedDB&quot;);
    };

    req.onerror = (e) =&gt; {
        console.error(&quot;Save error:&quot;, e.target.error);
    };
}
  
  function loadFromStorage(callback) {
    if (!db) return;

    const tx = db.transaction([&#39;data&#39;], &#39;readonly&#39;);
    const store = tx.objectStore(&#39;data&#39;);

    const req = store.get(&#39;main_library&#39;);

    req.onsuccess = () =&gt; {
        if (req.result) {
            library = req.result;
            console.log(&quot;Loaded from IndexedDB&quot;);
        }
        if (callback) callback();
    };

    req.onerror = (e) =&gt; {
        console.error(&quot;Load error:&quot;, e.target.error);
    };
}
  
  

    function updateUI() {
        const p = library.projects[library.currentProjectId];
        if (!p) return;
        document.getElementById(&#39;projNameInput&#39;).value = p.name;
        document.getElementById(&#39;projBudgetInput&#39;).value = p.budget;
        renderPhysicalTable(p);
        renderBillingTable(p);
        renderChart(p);
        renderMilestoneBadges(p);
        updateFinancialSummary(p);
    }

    // --- PHYSICAL TRACKING LOGIC ---
function renderPhysicalTable(p) {

    let html = &#39;&#39;;

    p.activities.forEach((a, i) =&gt; {
        const act = a.totalQty &gt; 0
            ? (a.achievedQty / a.totalQty * 100).toFixed(1)
            : 0;

        html += `
&lt;tr&gt;
    &lt;td&gt;${a.name}&lt;/td&gt;
    &lt;td&gt;${a.achievedQty}/${a.totalQty}&lt;/td&gt;
    &lt;td&gt;${act}%&lt;/td&gt;
    &lt;td&gt;-&lt;/td&gt;
    &lt;td&gt;
        &lt;button onclick=&quot;editActivity(${i})&quot;&gt;Edit&lt;/button&gt;
        &lt;button onclick=&quot;deleteActivity(${i})&quot;&gt;Delete&lt;/button&gt;
    &lt;/td&gt;
&lt;/tr&gt;`;
    });

    document.getElementById(&#39;tableBody&#39;).innerHTML = html;

    const actSelect = document.getElementById(&#39;actName&#39;);

    if (!actSelect.innerHTML) {

        let optHtml = &quot;&quot;;

        for (const [grp, items] of Object.entries(masterWorkItems)) {
            optHtml += `&lt;optgroup label=&quot;${grp}&quot;&gt;
                ${items.map(i =&gt; `&lt;option value=&quot;${i}&quot;&gt;${i}&lt;/option&gt;`).join(&#39;&#39;)}
            &lt;/optgroup&gt;`;
        }

        actSelect.innerHTML = optHtml;
    }
}
    function saveActivity() {

    const p = library.projects[library.currentProjectId];
    const name = document.getElementById(&#39;actName&#39;).value;

    const act = {
        name,
        totalQty: parseFloat(document.getElementById(&#39;actTotalQty&#39;).value) || 0,
        achievedQty: parseFloat(document.getElementById(&#39;actAchievedQty&#39;).value) || 0
    };

    if (editIdx &gt; -1) {
        p.activities[editIdx] = act;
    } else {
        const existingIndex = p.activities.findIndex(a =&gt; a.name === name);
        if (existingIndex &gt; -1) {
            p.activities[existingIndex] = act;
        } else {
            p.activities.push(act);
        }
    }

    editIdx = -1;
    saveToStorage();
      updateUI();
}

// 1. Updated Table Rendering with &quot;Row-Click&quot; support
  
function renderBillingTable(p) {
    let html = &quot;&quot;;
    let cv = p.budget || 0;
    
    (p.milestones || []).forEach((mil, mIdx) =&gt; {
        let milVal = (mil.percent / 100) * cv;
        
        // Milestone Header Row
      html += `
&lt;tr style=&quot;background:#f9f9f9; font-weight:bold;&quot;&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;${mil.name}&lt;/td&gt;
    &lt;td&gt;${mil.percent}%&lt;/td&gt;
    &lt;td colspan=&quot;6&quot;&gt;&lt;/td&gt;
    &lt;td&gt;
        &lt;button onclick=&quot;editMilestone(${mIdx})&quot;&gt;Edit&lt;/button&gt;
        &lt;button onclick=&quot;deleteMilestone(${mIdx})&quot;&gt;Delete&lt;/button&gt;
    &lt;/td&gt;
&lt;/tr&gt;
`;

        // Sub-Activity Rows
        (mil.stages || []).forEach((st, sIdx) =&gt; {
           let stageMaxVal = (mil.percent/100) * (st.weight/100) * cv;

let executionPercent = getExecutionFromPhysical(p, st.name);
let executedValue = stageMaxVal * (executionPercent / 100);

let payable = Math.max(0, executedValue - (st.paid || 0));

let isPaid = executedValue &gt; 0 &amp;&amp; (st.paid || 0) &gt;= executedValue;
            
            // Added &#39;onclick&#39; to the TR so clicking the row selects the checkbox
            html += `
            &lt;tr style=&quot;cursor: pointer;&quot; onclick=&quot;document.getElementById(&#39;chk-${mIdx}-${sIdx}&#39;).click()&quot;&gt;
                &lt;td&gt;&lt;input type=&quot;checkbox&quot; 
       class=&quot;rowchk&quot;
       id=&quot;chk-${mIdx}-${sIdx}&quot;
       value=&quot;${mIdx}-${sIdx}&quot;
       onchange=&quot;toggleRowStyle(this);&quot;
       onclick=&quot;event.stopPropagation()&quot;&gt;
  				&lt;/td&gt;
                &lt;td style=&quot;padding-left:20px;&quot;&gt;
    &lt;select class=&quot;table-input&quot; style=&quot;width:140px&quot;
        onchange=&quot;updateStage(${mIdx}, ${sIdx}, &#39;name&#39;, this.value)&quot;
        onclick=&quot;event.stopPropagation()&quot;&gt;

        ${generateWorkItemOptions(st.name)}

    &lt;/select&gt;
&lt;/td&gt;
                &lt;td&gt;-&lt;/td&gt;
                &lt;td&gt;&lt;input type=&quot;number&quot; class=&quot;table-input&quot; value=&quot;${st.weight}&quot; onchange=&quot;updateStage(${mIdx}, ${sIdx}, &#39;weight&#39;, this.value)&quot; onclick=&quot;event.stopPropagation()&quot;&gt;%&lt;/td&gt;
                &lt;td&gt;${getExecutionFromPhysical(p, st.name).toFixed(1)}%&lt;/td&gt;
                &lt;td&gt;₹${stageMaxVal.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
                &lt;td&gt;₹${payable.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
                &lt;td&gt;&lt;span class=&quot;status ${isPaid ? &#39;status-paid&#39; : &#39;status-pending&#39;}&quot;&gt;${isPaid ? &#39;PAID&#39; : &#39;PENDING&#39;}&lt;/span&gt;&lt;/td&gt;
                
                &lt;td&gt;
    &lt;button onclick=&quot;event.stopPropagation(); editStage(${mIdx}, ${sIdx});&quot;&gt;
        Edit
    &lt;/button&gt;
    &lt;button onclick=&quot;event.stopPropagation(); deleteStage(${mIdx}, ${sIdx});&quot;&gt;
        Delete
    &lt;/button&gt;
&lt;/td&gt;
            &lt;/tr&gt;`;
        });
        
        html += `&lt;tr&gt;&lt;td colspan=&quot;9&quot; align=&quot;center&quot; style=&quot;padding:10px;&quot;&gt;&lt;button class=&quot;btn btn-primary&quot; style=&quot;font-size:10px;&quot; onclick=&quot;addStage(${mIdx})&quot;&gt;+ Add Sub-Activity&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;`;
    });
    
    document.getElementById(&#39;billingTableBody&#39;).innerHTML = html;
}
  
  function getExecutionFromPhysical(p, stageName) {

    if (!p.activities || p.activities.length === 0) return 0;

    const match = p.activities.find(a =&gt; 
        a.name.trim().toLowerCase() === stageName.trim().toLowerCase()
    );

    if (!match) return 0;

    if (match.totalQty &lt;= 0) return 0;

    return Math.min(100, (match.achievedQty / match.totalQty) * 100);
}
  
  function toggleRowStyle(cb) {
    const row = cb.closest(&quot;tr&quot;);
    if (row) {
        row.classList.toggle(&quot;row-selected&quot;, cb.checked);
    }
}

// --- IMPROVED UI HANDLING ---
function toggleRowCheck(event, id) {
    // Prevent toggle if clicking buttons or inputs
    if ([&#39;INPUT&#39;, &#39;BUTTON&#39;, &#39;SELECT&#39;].includes(event.target.tagName)) return;
    
    const cb = document.getElementById(&#39;chk-&#39; + id);
    if (cb) {
        cb.checked = !cb.checked;
        // Optional: Add a class to the row for visual feedback
        event.currentTarget.classList.toggle(&#39;row-selected&#39;, cb.checked);
    }
}

// 3. Fixed Select All Logic
function toggleAll(masterCheckbox) {
    const allCheckboxes = document.querySelectorAll(&quot;.rowchk&quot;);
    allCheckboxes.forEach(cb =&gt; {
        cb.checked = masterCheckbox.checked;
        const row = cb.closest(&quot;tr&quot;);
        if (row) {
            row.classList.toggle(&quot;row-selected&quot;, masterCheckbox.checked);
        }
    });
}
  
    
    function addMilestone() {

    const name = prompt(&quot;Stage Name:&quot;);
    if (!name) return;

    const percent = parseFloat(prompt(&quot;stage %:&quot;));
    if (isNaN(percent)) return;

    const p = library.projects[library.currentProjectId];

    const totalPercent = (p.milestones || [])
        .reduce((sum, m) =&gt; sum + (m.percent || 0), 0);

    if (totalPercent + percent &gt; 100) {
        alert(&quot;Total milestone percentage cannot exceed 100%&quot;);
        return;
    }

    p.milestones = p.milestones || [];

    p.milestones.push({
        name,
        percent,
        stages: []
    });

    saveToStorage();
    updateUI();
}
  
  
   function deleteMilestone(index) {

    if (!confirm(&quot;Delete this milestone?&quot;)) return;

    const p = library.projects[library.currentProjectId];

    p.milestones.splice(index, 1);

    saveToStorage();
    updateUI();
}
  
 function editMilestone(index) {

    const p = library.projects[library.currentProjectId];
    const mil = p.milestones[index];

    const newName = prompt(&quot;Milestone Name:&quot;, mil.name);
    if (!newName) return;

    const newPercent = parseFloat(prompt(&quot;Milestone %:&quot;, mil.percent));
    if (isNaN(newPercent)) return;

    mil.name = newName;
    mil.percent = newPercent;

    saveToStorage();
    updateUI();
}
  
  function addGlobalMilestone() {

    const p = library.projects[library.currentProjectId];
    p.globalMilestones = p.globalMilestones || [];

    const val = parseFloat(document.getElementById(&#39;newMilestonePercent&#39;).value);

    if (isNaN(val) || val &lt;= 0 || val &gt; 100) {
        alert(&quot;Enter valid % between 1 and 100&quot;);
        return;
    }

    p.globalMilestones.push(val);

    document.getElementById(&#39;newMilestonePercent&#39;).value = &quot;&quot;;
    saveToStorage();
    updateUI();
}
  
  function editPhysicalMilestone(index) {

    const p = library.projects[library.currentProjectId];
    const value = p.globalMilestones[index];

    const newValue = parseFloat(prompt(&quot;Milestone %:&quot;, value));
    if (isNaN(newValue) || newValue &lt;= 0 || newValue &gt; 100) return;

    p.globalMilestones[index] = newValue;
    saveToStorage();
    updateUI();
}

function deletePhysicalMilestone(index) {

    if (!confirm(&quot;Delete this milestone?&quot;)) return;

    const p = library.projects[library.currentProjectId];
    p.globalMilestones.splice(index, 1);

    saveToStorage();
    updateUI();
}
  
  
  

   function addStage(mIdx) {

    const p = library.projects[library.currentProjectId];
    const milestone = p.milestones[mIdx];

    milestone.stages = milestone.stages || [];

    const firstGroup = Object.values(masterWorkItems)[0];
    const defaultItem = firstGroup[0];

    milestone.stages.push({
        name: defaultItem,
        weight: 0,
        paid: 0
    });

    saveToStorage();
    updateUI();
}
  
  
    function updateStage(m, s, field, val) {
        const p = library.projects[library.currentProjectId];
        p.milestones[m].stages[s][field] = (field === &#39;name&#39;) ? val : parseFloat(val) || 0;
        saveToStorage();
    }

    function updateMilestone(mIdx, field, val) {

    const p = library.projects[library.currentProjectId];

    if (field === &#39;percent&#39;) {

        val = Math.min(100, Math.max(0, parseFloat(val) || 0));

        const totalPercent = p.milestones.reduce((sum, m, i) =&gt;
            sum + (i === mIdx ? val : (m.percent || 0))
        , 0);

        if (totalPercent &gt; 100) {
            alert(&quot;Total milestone percentage cannot exceed 100%&quot;);
            return;
        }
    }

    p.milestones[mIdx][field] = val;

    saveToStorage();
    updateUI();
}

// --- FIXED CALCULATION LOGIC ---
function approveSelected() {

    const p = library.projects[library.currentProjectId];
    const checkboxes = document.querySelectorAll(&quot;.rowchk:checked&quot;);

    if (checkboxes.length === 0) {
        alert(&quot;Please select at least one sub-activity checkbox.&quot;);
        return;
    }

    checkboxes.forEach(cb =&gt; {

        const [mIdx, sIdx] = cb.value.split(&quot;-&quot;).map(Number);
        const mil = p.milestones[mIdx];
        const st = mil.stages[sIdx];

        const executionPercent = getExecutionFromPhysical(p, st.name);

        const stageMaxVal = 
            p.budget * 
            (mil.percent / 100) * 
            (st.weight / 100);

        const executionFactor = Math.min(1, executionPercent / 100);

        const newPayable = stageMaxVal * executionFactor;

        st.paid = Math.max(st.paid || 0, newPayable);
    });

    saveToStorage();
    updateUI();
    alert(&quot;Selected items approved and updated!&quot;);
}

    // --- HELPERS ---
    function updateFinancialSummary(p) {
        let earned = 0;
        p.milestones.forEach(m =&gt; m.stages.forEach(s =&gt; earned += (s.paid || 0)));
        document.getElementById(&#39;totalSpent&#39;).innerText = earned.toLocaleString();
        document.getElementById(&#39;dispPaid&#39;).innerText = earned.toLocaleString();
        document.getElementById(&#39;dispBalance&#39;).innerText = Math.max(0, p.budget - earned).toLocaleString();
        document.getElementById(&#39;overallPercent&#39;).innerText = p.budget &gt; 0 ? ((earned / p.budget) * 100).toFixed(1) : 0;
    }

  

    function renderMilestoneBadges(p) {

    const budget = parseFloat(p.budget) || 0;

    let totalExecutedCost = 0;

    (p.milestones || []).forEach(m =&gt; {

        const milestonePercent = parseFloat(m.percent) || 0;

        (m.stages || []).forEach(s =&gt; {

            const stageWeight = parseFloat(s.weight) || 0;

            const stageMaxValue =
                budget *
                (milestonePercent / 100) *
                (stageWeight / 100);

            const physicalItem = (p.activities || []).find(a =&gt;
                (a.name || &quot;&quot;).trim().toLowerCase() ===
                (s.name || &quot;&quot;).trim().toLowerCase()
            );

            const totalQty = parseFloat(physicalItem?.totalQty) || 0;
            const executedQty = parseFloat(physicalItem?.achievedQty) || 0;

            const executionPercent =
                totalQty &gt; 0
                    ? Math.min(100, (executedQty / totalQty) * 100)
                    : 0;

            const executedCost =
                stageMaxValue * (executionPercent / 100);

            totalExecutedCost += executedCost;
        });
    });

    const physicalProgressPercent =
        budget &gt; 0
            ? (totalExecutedCost / budget) * 100
            : 0;

    const html = (p.globalMilestones || []).map((m, index) =&gt; {

        const achieved = physicalProgressPercent &gt;= m;

        return `
            &lt;div style=&quot;display:inline-block; margin:5px;&quot;&gt;
                &lt;span class=&quot;status&quot;
                    style=&quot;
                        background:${achieved ? &#39;#27ae60&#39; : &#39;#f39c12&#39;};
                        color:white;
                        padding:6px 10px;
                        border-radius:4px;
                        margin-right:5px;
                    &quot;&gt;
                    ${m}%
                &lt;/span&gt;

                &lt;button onclick=&quot;editPhysicalMilestone(${index})&quot;&gt;
                    Edit
                &lt;/button&gt;

                &lt;button onclick=&quot;deletePhysicalMilestone(${index})&quot;&gt;
                    Delete
                &lt;/button&gt;
            &lt;/div&gt;
        `;
    }).join(&#39;&#39;);

    document.getElementById(&#39;milestoneList&#39;).innerHTML = html;
}

function renderChart(p) {

    const canvas = document.getElementById(&#39;progressChart&#39;);
    if (!canvas) return;

    const ctx = canvas.getContext(&#39;2d&#39;);

    // Destroy previous chart
    if (chart) {
        chart.destroy();
        chart = null;
    }

    // If no activities → stop
    if (!p.activities || p.activities.length === 0) {
        return;
    }

    const labels = p.activities.map(a =&gt; a.name || &quot;Unnamed&quot;);

    const data = p.activities.map(a =&gt; {
        const total = parseFloat(a.totalQty) || 0;
        const achieved = parseFloat(a.achievedQty) || 0;

        if (total &lt;= 0) return 0;

        return Math.min(100, (achieved / total) * 100);
    });

    chart = new Chart(ctx, {
    type: &#39;bar&#39;,
    data: {
        labels: labels,
        datasets: [{
            label: &#39;% Physical Progress&#39;,
            data: data,
            backgroundColor: &#39;#3498db&#39;
        }]
    },
    options: {
        responsive: true,
        maintainAspectRatio: false,
        animation: false,
        layout: {
            padding: {
                bottom: 1   // space for vertical labels
            }
        },
        scales: {
            x: {
                ticks: {
                    autoSkip: false,
                    minRotation: 90,
                    maxRotation: 90
                }
            },
            y: {
                beginAtZero: true,
                max: 100
            }
        }
    }
});
}
  
   function switchProject() { 
    library.currentProjectId = document.getElementById(&#39;projectSelector&#39;).value; 
    updateUI();
}
  
    function refreshProjectList() {
        document.getElementById(&#39;projectSelector&#39;).innerHTML = Object.values(library.projects).map(p =&gt; 
            `&lt;option value=&quot;${p.id}&quot; ${p.id === library.currentProjectId ? &#39;selected&#39; : &#39;&#39;}&gt;${p.name}&lt;/option&gt;`).join(&#39;&#39;);
    }
    function renameProject() { library.projects[library.currentProjectId].name = document.getElementById(&#39;projNameInput&#39;).value; saveToStorage(); refreshProjectList(); }
  
    function updateProjectMeta() { library.projects[library.currentProjectId].budget = parseFloat(document.getElementById(&#39;projBudgetInput&#39;).value) || 0; saveToStorage(); }
  
function exportJSON() {

    saveToStorage(); // safety

    const choice = prompt(
`Export Options:
1 → Current Project
2 → All Projects
3 → Select Multiple Projects`,
        &quot;1&quot;
    );

    if (!choice) return;

    const date = new Date().toISOString().split(&#39;T&#39;)[0];
    let exportData = {};
    let fileName = &quot;&quot;;

    // =========================
    // ✅ OPTION 1: CURRENT PROJECT
    // =========================
    if (choice === &quot;1&quot;) {

        const currentId = library.currentProjectId;

        if (!currentId || !library.projects[currentId]) {
            alert(&quot;No project selected.&quot;);
            return;
        }

        exportData = {
            currentProjectId: currentId,
            projects: {
                [currentId]: library.projects[currentId]
            }
        };

        const projName = library.projects[currentId].name.replace(/[^a-z0-9]/gi, &quot;_&quot;);
        fileName = `${projName}_${date}.json`;
    }

    // =========================
    // ✅ OPTION 2: ALL PROJECTS
    // =========================
    else if (choice === &quot;2&quot;) {

        exportData = library;
        fileName = `EPC Schedule H payment plus physical progress tracking fo All_Projects_${date}.json`;
    }

    // =========================
    // ✅ OPTION 3: MULTIPLE PROJECTS
    // =========================
    else if (choice === &quot;3&quot;) {

        const projectList = Object.values(library.projects);

        if (projectList.length === 0) {
            alert(&quot;No projects available.&quot;);
            return;
        }

        // Build selection list
        let listText = &quot;Enter project numbers (comma separated):\n\n&quot;;

        projectList.forEach((p, i) =&gt; {
            listText += `${i + 1} → ${p.name}\n`;
        });

        const input = prompt(listText, &quot;1,2&quot;);

        if (!input) return;

        const indexes = input.split(&quot;,&quot;)
            .map(i =&gt; parseInt(i.trim()) - 1)
            .filter(i =&gt; i &gt;= 0 &amp;&amp; i &lt; projectList.length);

        if (indexes.length === 0) {
            alert(&quot;Invalid selection.&quot;);
            return;
        }

        const selectedProjects = {};

        indexes.forEach(i =&gt; {
            const p = projectList[i];
            selectedProjects[p.id] = p;
        });

        exportData = {
            currentProjectId: library.currentProjectId,
            projects: selectedProjects
        };

        fileName = `Selected_Projects_${date}.json`;
    }

    else {
        alert(&quot;Invalid option.&quot;);
        return;
    }

    // =========================
    // 📦 DOWNLOAD
    // =========================
    const dataStr = JSON.stringify(exportData, null, 2);
    const blob = new Blob([dataStr], { type: &quot;application/json&quot; });

    const a = document.createElement(&quot;a&quot;);
    const url = URL.createObjectURL(blob);

    a.href = url;
    a.download = fileName;

    document.body.appendChild(a);
    a.click();

    document.body.removeChild(a);
    URL.revokeObjectURL(url);
}
  
function importJSON(event) {

    const file = event.target.files[0];
    if (!file) return;

    const reader = new FileReader();

    reader.onload = function(e) {
        try {
            const importedData = JSON.parse(e.target.result);

            if (!importedData.projects) {
                alert(&quot;Invalid JSON file.&quot;);
                return;
            }

            Object.values(importedData.projects).forEach(newProj =&gt; {

                // =========================
                // 🔍 MATCH PROJECT BY NAME (SMART)
                // =========================
                let existingProj = Object.values(library.projects).find(p =&gt;
                    p.name.trim().toLowerCase() === newProj.name.trim().toLowerCase()
                );

                // =========================
                // 🆕 NEW PROJECT
                // =========================
                if (!existingProj) {
                    const newId = &#39;proj_&#39; + Date.now() + Math.random();
                    library.projects[newId] = {
                        ...newProj,
                        id: newId
                    };
                    return;
                }

                const oldProj = existingProj;

                // =========================
                // 💰 MERGE BUDGET (TAKE HIGHER)
                // =========================
                oldProj.budget = Math.max(oldProj.budget || 0, newProj.budget || 0);

                // =========================
                // 📊 MERGE ACTIVITIES (SMART)
                // =========================
                oldProj.activities = oldProj.activities || [];

                newProj.activities?.forEach(newAct =&gt; {

                    let oldAct = oldProj.activities.find(a =&gt;
                        a.name.trim().toLowerCase() === newAct.name.trim().toLowerCase()
                    );

                    if (!oldAct) {
                        oldProj.activities.push(newAct);
                    } else {
                        // TAKE MAX VALUES (LATEST PROGRESS)
                        oldAct.totalQty = Math.max(oldAct.totalQty || 0, newAct.totalQty || 0);
                        oldAct.achievedQty = Math.max(oldAct.achievedQty || 0, newAct.achievedQty || 0);
                    }
                });

                // =========================
                // 📅 MERGE MILESTONES
                // =========================
                oldProj.milestones = oldProj.milestones || [];

                newProj.milestones?.forEach(newMil =&gt; {

                    let oldMil = oldProj.milestones.find(m =&gt;
                        m.name.trim().toLowerCase() === newMil.name.trim().toLowerCase()
                    );

                    if (!oldMil) {
                        oldProj.milestones.push(newMil);
                        return;
                    }

                    // TAKE MAX %
                    oldMil.percent = Math.max(oldMil.percent || 0, newMil.percent || 0);

                    oldMil.stages = oldMil.stages || [];

                    // -------------------------
                    // 🔁 MERGE STAGES
                    // -------------------------
                    newMil.stages?.forEach(newStage =&gt; {

                        let oldStage = oldMil.stages.find(s =&gt;
                            s.name.trim().toLowerCase() === newStage.name.trim().toLowerCase()
                        );

                        if (!oldStage) {
                            oldMil.stages.push(newStage);
                        } else {
                            oldStage.weight = Math.max(oldStage.weight || 0, newStage.weight || 0);
                            oldStage.paid = Math.max(oldStage.paid || 0, newStage.paid || 0);
                        }
                    });
                });

                // =========================
                // 🌐 MERGE GLOBAL MILESTONES
                // =========================
                oldProj.globalMilestones = oldProj.globalMilestones || [];

                newProj.globalMilestones?.forEach(val =&gt; {
                    if (!oldProj.globalMilestones.includes(val)) {
                        oldProj.globalMilestones.push(val);
                    }
                });

            });

            saveToStorage();
            refreshProjectList();
            updateUI();

            alert(&quot;🔥 Smart Merge Completed (Latest values preserved)&quot;);

        } catch (err) {
            console.error(err);
            alert(&quot;Error importing JSON.&quot;);
        }
    };

    reader.readAsText(file);
}
  
  
  
function deleteCurrentProject() {

    const pId = library.currentProjectId;

    if (!pId || !library.projects[pId]) {
        alert(&quot;No valid project selected.&quot;);
        return;
    }

    const projectName = library.projects[pId].name;

    const confirmDelete = confirm(
        `Are you sure you want to delete &quot;${projectName}&quot;?\nThis cannot be undone.`
    );

    if (!confirmDelete) return;

    // Delete project using ID (NOT name)
    delete library.projects[pId];

    // Get remaining project IDs
    const remainingIds = Object.keys(library.projects);

    // Switch to another project if available
    library.currentProjectId = remainingIds.length &gt; 0
        ? remainingIds[0]
        : null;

    saveToStorage();

    // Refresh UI safely
    refreshProjectList();
updateUI();
    renderBillingTable();
    renderChart(library.projects[library.currentProjectId] || { activities: [] });

    alert(&quot;Project deleted successfully.&quot;);
}
  
  function generateWorkItemOptions(selectedValue) {

    let html = &quot;&quot;;

    for (const [grp, items] of Object.entries(masterWorkItems)) {

        html += `&lt;optgroup label=&quot;${grp}&quot;&gt;`;

        items.forEach(item =&gt; {
            html += `
                &lt;option value=&quot;${item}&quot; 
                    ${item === selectedValue ? &quot;selected&quot; : &quot;&quot;}&gt;
                    ${item}
                &lt;/option&gt;`;
        });

        html += `&lt;/optgroup&gt;`;
    }

    return html;
}
  

  function deleteActivity(index) {

    if (!confirm(&quot;Delete this activity?&quot;)) return;

    const p = library.projects[library.currentProjectId];
    p.activities.splice(index, 1);

    saveToStorage();
    updateUI();
}
  
  function editActivity(index) {

    const p = library.projects[library.currentProjectId];
    const activity = p.activities[index];

    let newName = prompt(&quot;Activity Name:&quot;, activity.name);
    if (newName === null) return;

    let newTotalQty = prompt(&quot;Total Quantity:&quot;, activity.totalQty);
    if (newTotalQty === null) return;

    let newAchievedQty = prompt(&quot;Achieved Quantity:&quot;, activity.achievedQty);
    if (newAchievedQty === null) return;

    activity.name = newName;
    activity.totalQty = parseFloat(newTotalQty) || 0;
    activity.achievedQty = parseFloat(newAchievedQty) || 0;

    saveToStorage();
    updateUI();
}
  
  function deleteStage(mIndex, sIndex) {

    if (!confirm(&quot;Delete this stage?&quot;)) return;

    const p = library.projects[library.currentProjectId];
    p.milestones[mIndex].stages.splice(sIndex, 1);

    saveToStorage();
    updateUI();
}
  
  function editStage(mIndex, sIndex) {

    const p = library.projects[library.currentProjectId];
    const stage = p.milestones[mIndex].stages[sIndex];

    const newName = prompt(&quot;Stage Name:&quot;, stage.name);
    if (!newName) return;

    const newWeight = parseFloat(prompt(&quot;Stage Weight %:&quot;, stage.weight));
    if (isNaN(newWeight)) return;

    stage.name = newName;
    stage.weight = newWeight;

    saveToStorage();
    updateUI();
}
  
 
  
 function exportPDF() {

    const p = library.projects[library.currentProjectId];
    if (!p) return;

    const budget = parseFloat(p.budget) || 0;

    let totalPaid = 0;
    let totalPayable = 0;
    let totalExecutedCost = 0;

    // Calculate totals
    (p.milestones || []).forEach(m =&gt; {

        const milestonePercent = parseFloat(m.percent) || 0;

        (m.stages || []).forEach(s =&gt; {

            const stageWeight = parseFloat(s.weight) || 0;
            const paidAmount = parseFloat(s.paid) || 0;

            totalPaid += paidAmount;

            const stageMaxValue =
                budget *
                (milestonePercent / 100) *
                (stageWeight / 100);

            totalPayable += stageMaxValue;

            // Find matching activity safely
            const physicalItem = (p.activities || []).find(a =&gt;
                (a.name || &quot;&quot;).trim().toLowerCase() ===
                (s.name || &quot;&quot;).trim().toLowerCase()
            );

            const totalQty = parseFloat(physicalItem?.totalQty) || 0;
            const executedQty = parseFloat(physicalItem?.achievedQty) || 0;

            const executionPercent =
                totalQty &gt; 0
                    ? Math.min(100, (executedQty / totalQty) * 100)
                    : 0;

            const executedCost =
                stageMaxValue * (executionPercent / 100);

            totalExecutedCost += executedCost;
        });
    });

    const financialPercent =
        budget &gt; 0
            ? ((totalPaid / budget) * 100).toFixed(2)
            : &quot;0.00&quot;;

    const physicalPercent =
        budget &gt; 0
            ? ((totalExecutedCost / budget) * 100).toFixed(2)
            : &quot;0.00&quot;;

    // Get chart image safely
  let chartImage = &quot;&quot;;
const chartCanvas = document.getElementById(&#39;progressChart&#39;);

if (chartCanvas) {
    try {

        // 🔥 Increase resolution for PDF
        const originalWidth = chartCanvas.width;
        const originalHeight = chartCanvas.height;

        chartCanvas.width = originalWidth * 2;
        chartCanvas.height = originalHeight * 2;

        if (chart) {
            chart.resize();
            chart.update();
        }

        chartImage = chartCanvas.toDataURL(&quot;image/png&quot;, 1.0);

        // Restore original size
        chartCanvas.width = originalWidth;
        chartCanvas.height = originalHeight;

        if (chart) {
            chart.resize();
            chart.update();
        }

    } catch (err) {
        console.error(&quot;Chart export failed:&quot;, err);
    }
}

    let reportHTML = `
    &lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Project Report&lt;/title&gt;
        &lt;style&gt;
            body { font-family: Arial, sans-serif; padding: 20px; }
            h2 { margin-bottom: 10px; }
            table { border-collapse: collapse; width: 100%; margin-top: 20px; }
            th, td { border: 1px solid #ccc; padding: 6px; text-align: center; }
            th { background: #f2f2f2; }
            .summary p { margin: 5px 0; }
            .chart-container { text-align: center; margin-top: 20px; }
        &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;

    &lt;h2&gt;${p.name}&lt;/h2&gt;

    &lt;div class=&quot;summary&quot;&gt;
        &lt;p&gt;&lt;strong&gt;Project Cost:&lt;/strong&gt; ₹${budget.toLocaleString(&#39;en-IN&#39;)}&lt;/p&gt;
        &lt;p&gt;&lt;strong&gt;Total Payable (As per Schedule):&lt;/strong&gt; ₹${totalExecutedCost.toLocaleString(&#39;en-IN&#39;)}&lt;/p&gt;
        &lt;p&gt;&lt;strong&gt;Total Paid Till Date:&lt;/strong&gt; ₹${totalPaid.toLocaleString(&#39;en-IN&#39;)}&lt;/p&gt;
        &lt;p&gt;&lt;strong&gt;Cumulative Financial Progress:&lt;/strong&gt; ${financialPercent}%&lt;/p&gt;
        &lt;p&gt;&lt;strong&gt;Cumulative Physical Progress:&lt;/strong&gt; ${physicalPercent}%&lt;/p&gt;
    &lt;/div&gt;
    `;

    if (chartImage) {
        reportHTML += `
        &lt;h3&gt;Physical Progress Graph&lt;/h3&gt;
        &lt;div style=&quot;width:100%; margin-top:20px;&quot;&gt;
    &lt;img src=&quot;${chartImage}&quot; 
         style=&quot;width:100%; display:block;&quot; /&gt;
&lt;/div&gt;
        `;
    }

    reportHTML += `
    &lt;h3&gt;Schedule H Details&lt;/h3&gt;
    &lt;table&gt;
        &lt;tr&gt;
            &lt;th&gt;Milestone&lt;/th&gt;
            &lt;th&gt;Milestone %&lt;/th&gt;
            &lt;th&gt;Stage&lt;/th&gt;
            &lt;th&gt;Stage Weight %&lt;/th&gt;
            &lt;th&gt;Total Qty&lt;/th&gt;
            &lt;th&gt;Executed Qty&lt;/th&gt;
            &lt;th&gt;Total Cost (₹)&lt;/th&gt;
            &lt;th&gt;Executed Cost (₹)&lt;/th&gt;
        &lt;/tr&gt;
    `;

    (p.milestones || []).forEach(m =&gt; {

        const milestonePercent = parseFloat(m.percent) || 0;

        (m.stages || []).forEach(s =&gt; {

            const stageWeight = parseFloat(s.weight) || 0;

            const stageMaxValue =
                budget *
                (milestonePercent / 100) *
                (stageWeight / 100);

            const physicalItem = (p.activities || []).find(a =&gt;
                (a.name || &quot;&quot;).trim().toLowerCase() ===
                (s.name || &quot;&quot;).trim().toLowerCase()
            );

            const totalQty = parseFloat(physicalItem?.totalQty) || 0;
            const executedQty = parseFloat(physicalItem?.achievedQty) || 0;

            const executionPercent =
                totalQty &gt; 0
                    ? Math.min(100, (executedQty / totalQty) * 100)
                    : 0;

            const executedCost =
                stageMaxValue * (executionPercent / 100);

            reportHTML += `
                &lt;tr&gt;
                    &lt;td&gt;${m.name}&lt;/td&gt;
                    &lt;td&gt;${milestonePercent}%&lt;/td&gt;
                    &lt;td&gt;${s.name}&lt;/td&gt;
                    &lt;td&gt;${stageWeight}%&lt;/td&gt;
                    &lt;td&gt;${totalQty}&lt;/td&gt;
                    &lt;td&gt;${executedQty}&lt;/td&gt;
                    &lt;td&gt;${stageMaxValue.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
                    &lt;td&gt;${executedCost.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
                &lt;/tr&gt;
            `;
        });
    });

    reportHTML += `
        &lt;/table&gt;
    &lt;/body&gt;
    &lt;/html&gt;
    `;

    const win = window.open(&quot;&quot;, &quot;_blank&quot;, &quot;width=1000,height=800&quot;);

    if (!win) {
        alert(&quot;Popup blocked! Please allow popups.&quot;);
        return;
    }

    win.document.open();
    win.document.write(reportHTML);
    win.document.close();

    win.onload = function () {
        setTimeout(() =&gt; {
            win.print();
        }, 500);
    };
}
  
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/02/epc-schedule-h-payment-plus-physical.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-9108466008299712044</guid><pubDate>Wed, 25 Feb 2026 11:36:00 +0000</pubDate><atom:updated>2026-02-28T07:03:43.422+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Drawings</category><category domain="http://www.blogger.com/atom/ns#">PWD Working</category><category domain="http://www.blogger.com/atom/ns#">Survey</category><title>Maps Prepared by me</title><description>&lt;h2 style=&quot;text-align: center;&quot;&gt;&amp;nbsp;Maps Prepared by me&lt;/h2&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Sawalya Povalya Road existence proof&lt;/h3&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAE48AZ6EaZadNdhdxk4FpMaRpyj5FFT7BO2uMfkju6gCGv8hm6YSbXWK77c21YMR88W2V2-7G4hujBXg_9wnfaEG2odIgt1LY8DhnsdWnjnGhMoYEMfAlgp8qhnSrJhyQFqGAwOudlLCkuc2trsxmACIDLoYrFx8Fr7Ui8lkaqQ0DF2aWYySwZwH4fUlt/s7015/Sawalya%20Povalya%20Road%20existence%20proof.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;4960&quot; data-original-width=&quot;7015&quot; height=&quot;465&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAE48AZ6EaZadNdhdxk4FpMaRpyj5FFT7BO2uMfkju6gCGv8hm6YSbXWK77c21YMR88W2V2-7G4hujBXg_9wnfaEG2odIgt1LY8DhnsdWnjnGhMoYEMfAlgp8qhnSrJhyQFqGAwOudlLCkuc2trsxmACIDLoYrFx8Fr7Ui8lkaqQ0DF2aWYySwZwH4fUlt/w659-h465/Sawalya%20Povalya%20Road%20existence%20proof.png&quot; width=&quot;659&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Irrigation Water Mains Pipeline road crossing&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4AgIasm_Vm3v8dPFVCoZ4Dh6EoaOcHpgjxx1w44jXM9uJL_RJ-nCS4y82G_2UzFXZbr-tMKlOa9gqN77MXDFsFZrdP3ZMB1KdGuN8SXptcBpLMUCY0-lM5P3kz_qhQEIpvJqujHltmkPrXhpNuaq_3E_yi7y5e9WUckbDaDLaGBE0j967CaL-Q-dVpaJA/s7015/Irrigation%20Water%20Mains%20Pipeline%20road%20crossing.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;4960&quot; data-original-width=&quot;7015&quot; height=&quot;456&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4AgIasm_Vm3v8dPFVCoZ4Dh6EoaOcHpgjxx1w44jXM9uJL_RJ-nCS4y82G_2UzFXZbr-tMKlOa9gqN77MXDFsFZrdP3ZMB1KdGuN8SXptcBpLMUCY0-lM5P3kz_qhQEIpvJqujHltmkPrXhpNuaq_3E_yi7y5e9WUckbDaDLaGBE0j967CaL-Q-dVpaJA/w647-h456/Irrigation%20Water%20Mains%20Pipeline%20road%20crossing.png&quot; width=&quot;647&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Toposheets with chainages to Identify Forest Length chainages&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHgLG6wmNVCG1T9_EG2T01unSxJaRNeQjtgqIQ0zTTQgC5OiosoolfmNpp3Clzr9y6Gn_PrkCCxccoGa4KnXnq37_nRyPR5pQEnNpeKrm_dwJqrGgSMRWUpvXzAr_12-sZmmi1Qty6cgFcG2hiKhXpedesZZm5uDN9vS1KXzreCCGlCSFGm-ARQ-r6WxkD/s7151/Toposheet%20overlap%20for%20forest%20without%20background.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;7151&quot; data-original-width=&quot;6805&quot; height=&quot;690&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHgLG6wmNVCG1T9_EG2T01unSxJaRNeQjtgqIQ0zTTQgC5OiosoolfmNpp3Clzr9y6Gn_PrkCCxccoGa4KnXnq37_nRyPR5pQEnNpeKrm_dwJqrGgSMRWUpvXzAr_12-sZmmi1Qty6cgFcG2hiKhXpedesZZm5uDN9vS1KXzreCCGlCSFGm-ARQ-r6WxkD/w656-h690/Toposheet%20overlap%20for%20forest%20without%20background.png&quot; width=&quot;656&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Saptashrungi Temple Connectivity&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUOnrAEgKz-pOle9zAQgEeDA3puhrVzpe7o3iLzvDs845T-VTwKxGrnhMVTCTl9x8TZtHikOvEWePjN8GWDDR-g9QWbyJrLsVnK6K9F2GIMutAqt-z-8jI_ZkUg5mgNJRQU92BGwqA1TCE2-JxmHKqZxThd7mf9g3thhEuAV1WBZzBy2fLYmX09Hbb4BWM/s9921/Gad.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;7015&quot; data-original-width=&quot;9921&quot; height=&quot;417&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUOnrAEgKz-pOle9zAQgEeDA3puhrVzpe7o3iLzvDs845T-VTwKxGrnhMVTCTl9x8TZtHikOvEWePjN8GWDDR-g9QWbyJrLsVnK6K9F2GIMutAqt-z-8jI_ZkUg5mgNJRQU92BGwqA1TCE2-JxmHKqZxThd7mf9g3thhEuAV1WBZzBy2fLYmX09Hbb4BWM/w590-h417/Gad.png&quot; width=&quot;590&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Airport Connectivity&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_whdC77RaQEJgLFa2O4yKy32gCbRdfrtoyjIPx4fUWF604Q7JHwvykQNXQF7LwV-DTS6C7nt1gReu2rCmg2dqljnyLWUN5QpYRB6O4IwyeaOHqgYIwAjicmMknOxx-IabAkEzmRa9fS-42FZETBfUHwwzYlae9T5_qXAMfAXRgu-MmF2ZezhFPCcPwuH2/s14031/Aiport%20Connectivity.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;9921&quot; data-original-width=&quot;14031&quot; height=&quot;469&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_whdC77RaQEJgLFa2O4yKy32gCbRdfrtoyjIPx4fUWF604Q7JHwvykQNXQF7LwV-DTS6C7nt1gReu2rCmg2dqljnyLWUN5QpYRB6O4IwyeaOHqgYIwAjicmMknOxx-IabAkEzmRa9fS-42FZETBfUHwwzYlae9T5_qXAMfAXRgu-MmF2ZezhFPCcPwuH2/w663-h469/Aiport%20Connectivity.png&quot; width=&quot;663&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;National Highway Connectivity to Nashik&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEQ1BYbtNvChzE6k6mO76pSRanKT4ttVi5JMPTBFRcphd0eMd63dZIvRlWIa4BoLJgVFPcwWRGBnLNAq_q3nmNzRLntmd0Q8cyAaWqpVfbqiM20srdLL4p9_1Wz9c-idYmAsPxEsnAzVB6qoNbjd-Fyft8OeVLbopcyH2iEQnTs6tDgaWsGVy8AJJDyvV4/s4960/all%20NH%20Maps.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;3507&quot; data-original-width=&quot;4960&quot; height=&quot;467&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEQ1BYbtNvChzE6k6mO76pSRanKT4ttVi5JMPTBFRcphd0eMd63dZIvRlWIa4BoLJgVFPcwWRGBnLNAq_q3nmNzRLntmd0Q8cyAaWqpVfbqiM20srdLL4p9_1Wz9c-idYmAsPxEsnAzVB6qoNbjd-Fyft8OeVLbopcyH2iEQnTs6tDgaWsGVy8AJJDyvV4/w663-h467/all%20NH%20Maps.png&quot; width=&quot;663&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Trimbak Parking Radius wise&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeTtT_ceWrjHYrIV1lhzw__OvZdoTzFmP_bSmVSL2synU91Z5uKjkR4j1MCf3mr9gjNu8_exLPPYFnz2NKrLQdq25eq4kKeXGapHsFLZE8rq7NwSjRJaMvbJ_w38FTo4wJD196WZ95b6JBhKxix5lw_7YxVWM5jaf1938AuxIX55X-JOtqmf3TYO-V-AJY/s4960/rev%201%20Parkings%20Trimbak.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;3507&quot; data-original-width=&quot;4960&quot; height=&quot;467&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeTtT_ceWrjHYrIV1lhzw__OvZdoTzFmP_bSmVSL2synU91Z5uKjkR4j1MCf3mr9gjNu8_exLPPYFnz2NKrLQdq25eq4kKeXGapHsFLZE8rq7NwSjRJaMvbJ_w38FTo4wJD196WZ95b6JBhKxix5lw_7YxVWM5jaf1938AuxIX55X-JOtqmf3TYO-V-AJY/w661-h467/rev%201%20Parkings%20Trimbak.png&quot; width=&quot;661&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Spokewise Trimbak and Nashik Outer parking&lt;/h3&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOV4NpY3gs0CC5bxZQMCDyLT7UzprnbiT_3jocmK9SnjhY9umDZ1cI0lQ5o3KNlmt-PJkcjoEubx8DBuZPqKhyFby7gb6Etd21KHdgRObAb7a4xO2UJuwAI4lCJ_U6zJAoTcw7DNKEWXYk-3TnOo4pugh694dHH-glPZLUMPGT64bnNJb8SV7IYmfKpAgb/s4960/Spokeswise%20outer%20Parkings.png&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;3507&quot; data-original-width=&quot;4960&quot; height=&quot;466&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOV4NpY3gs0CC5bxZQMCDyLT7UzprnbiT_3jocmK9SnjhY9umDZ1cI0lQ5o3KNlmt-PJkcjoEubx8DBuZPqKhyFby7gb6Etd21KHdgRObAb7a4xO2UJuwAI4lCJ_U6zJAoTcw7DNKEWXYk-3TnOo4pugh694dHH-glPZLUMPGT64bnNJb8SV7IYmfKpAgb/w660-h466/Spokeswise%20outer%20Parkings.png&quot; width=&quot;660&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Beze Contour&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJh_5acOcyZMU5ivuP7xI7DZrqVe0cNcqOvKcQe1M9sstfb6sLtvjtWQrnOTt5yxHfF5c9X9YhrSX914OTZCZPUOPiUJaAqIaLrFIGuR0V-bnc6BhuivuKda2YRGScu7k6VEUYOHOglTRbXRKWDFR4GHgSlDmwz8_y7GkWBnSwLmK0rPSsmRaZ97RQ9Jke/s4960/beze.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;3507&quot; data-original-width=&quot;4960&quot; height=&quot;469&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJh_5acOcyZMU5ivuP7xI7DZrqVe0cNcqOvKcQe1M9sstfb6sLtvjtWQrnOTt5yxHfF5c9X9YhrSX914OTZCZPUOPiUJaAqIaLrFIGuR0V-bnc6BhuivuKda2YRGScu7k6VEUYOHOglTRbXRKWDFR4GHgSlDmwz8_y7GkWBnSwLmK0rPSsmRaZ97RQ9Jke/w665-h469/beze.png&quot; width=&quot;665&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Trimbak Area&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj19VGOsI0YgzC9IVxbTJzkit2v3Mu9UcvriHlZqLYFtdGILd_c5epqAPlUmnuFxYMrT9gnGhMPRxOVQvyIMk6UwavWiNbgleR1t-mjJ46JvUJ629tjhV27hlJ94A53LWnXOEsLZdCzGF0V_gd_ibqo82WSUXPasXNZrmakSn76izSecLubTPZr4fB9ATdr/s14043/trimbak.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;9933&quot; data-original-width=&quot;14043&quot; height=&quot;464&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj19VGOsI0YgzC9IVxbTJzkit2v3Mu9UcvriHlZqLYFtdGILd_c5epqAPlUmnuFxYMrT9gnGhMPRxOVQvyIMk6UwavWiNbgleR1t-mjJ46JvUJ629tjhV27hlJ94A53LWnXOEsLZdCzGF0V_gd_ibqo82WSUXPasXNZrmakSn76izSecLubTPZr4fB9ATdr/w655-h464/trimbak.png&quot; width=&quot;655&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Road Connectivity Map&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQWHhiUR6XGM1BPDKsjc9MUtVwAswQ8k5eMCqivrEWsfL54VHF-XOmODGUqfOzypO4lJregQRe5u4NTx_ZTQ0AMGWQaSsnoxRDCvj2gU9mSIrlvoiCVeQ70yaFsXHT0WNgbsY9hEYnmep5ERHAl0UBSJkhoKLX5PTg4DNcSJt_z_U92WAnt7gEHHwyMhQk/s14043/kumbh%20image.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;9933&quot; data-original-width=&quot;14043&quot; height=&quot;462&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQWHhiUR6XGM1BPDKsjc9MUtVwAswQ8k5eMCqivrEWsfL54VHF-XOmODGUqfOzypO4lJregQRe5u4NTx_ZTQ0AMGWQaSsnoxRDCvj2gU9mSIrlvoiCVeQ70yaFsXHT0WNgbsY9hEYnmep5ERHAl0UBSJkhoKLX5PTg4DNcSJt_z_U92WAnt7gEHHwyMhQk/w654-h462/kumbh%20image.png&quot; width=&quot;654&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: center;&quot;&gt;Dwaraka Underpass Traffic Diversion&lt;/h3&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQM5fj5GOSHLzNTP43bWkl1plPSz5vTNuPMM2Un4Q9COySdwoDVwLJM6oeJxtdEMfV59A9GAmmKKA6Aqr1ULzszDZsE5uZ1N2tLWsbU_T7es44dDwZisDUv24GdmxTTv6yTmmXsYSATqmtP2fwb53_uogzCNMo4Ei0cxRgERvibi67tC5Z20S4zdNFSLMG/s7015/Dwaraka%20traffic%20diversion%20plan.png&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;4960&quot; data-original-width=&quot;7015&quot; height=&quot;468&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQM5fj5GOSHLzNTP43bWkl1plPSz5vTNuPMM2Un4Q9COySdwoDVwLJM6oeJxtdEMfV59A9GAmmKKA6Aqr1ULzszDZsE5uZ1N2tLWsbU_T7es44dDwZisDUv24GdmxTTv6yTmmXsYSATqmtP2fwb53_uogzCNMo4Ei0cxRgERvibi67tC5Z20S4zdNFSLMG/w663-h468/Dwaraka%20traffic%20diversion%20plan.png&quot; width=&quot;663&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_A47Y-Pocxmz61rIvKdT3kd_fg2u7R9yGRiMHfZd_g1tgiBNel_DVuVyplhxxAvs_STssGbI99Qf8_I96Uzwq59IUPIFWvMBBwfm5uE_TEIXvdYuyqRNK2tt2Ay-LfFikBDTdZ79SNlS8vIRVzLTJsEpamr0DzkOTY1OmEUaHKvRJNnUfFniDENWh3Jwk/s3507/PPT.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;2480&quot; data-original-width=&quot;3507&quot; height=&quot;455&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_A47Y-Pocxmz61rIvKdT3kd_fg2u7R9yGRiMHfZd_g1tgiBNel_DVuVyplhxxAvs_STssGbI99Qf8_I96Uzwq59IUPIFWvMBBwfm5uE_TEIXvdYuyqRNK2tt2Ay-LfFikBDTdZ79SNlS8vIRVzLTJsEpamr0DzkOTY1OmEUaHKvRJNnUfFniDENWh3Jwk/w643-h455/PPT.png&quot; width=&quot;643&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg08VZ32I4jYxCVYnY4tGg_ahfoO7El_I4diRYBNmzkk6SCu0FbDDcPHBH9dCx4zrVTFJPpGJvWWsuXUT1d_3jAdPl__m2GnpL4BKz7_HsaUFzKL3TM8pnuH9foJ2iaeZuQAJRhaOovgGwI98tRbqffoJvV6YpZ90Q5JI-5hZO9z366lVNkBXocr2jzofMw/s9933/Trimbak%20MSIDC.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;7015&quot; data-original-width=&quot;9933&quot; height=&quot;457&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg08VZ32I4jYxCVYnY4tGg_ahfoO7El_I4diRYBNmzkk6SCu0FbDDcPHBH9dCx4zrVTFJPpGJvWWsuXUT1d_3jAdPl__m2GnpL4BKz7_HsaUFzKL3TM8pnuH9foJ2iaeZuQAJRhaOovgGwI98tRbqffoJvV6YpZ90Q5JI-5hZO9z366lVNkBXocr2jzofMw/w646-h457/Trimbak%20MSIDC.png&quot; width=&quot;646&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT3xKRkYa7NXsKK1HSs2s48mUcbpOnWSyBBVVL9IGmCIA4KAKGF1UDdfdIxS-211DllqNg4hrzghZpPO8RDsSmRsBe-DhdQpDxuYt0g5lSL4YOu9UzsyilCorD72mro0YWiBowBp-l2KqKirA_Ad29pESVIodDtBxgi3OEUHcPEKCWE1kSHuhJCWki78ja/s14043/kumbh%20all.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;9933&quot; data-original-width=&quot;14043&quot; height=&quot;474&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT3xKRkYa7NXsKK1HSs2s48mUcbpOnWSyBBVVL9IGmCIA4KAKGF1UDdfdIxS-211DllqNg4hrzghZpPO8RDsSmRsBe-DhdQpDxuYt0g5lSL4YOu9UzsyilCorD72mro0YWiBowBp-l2KqKirA_Ad29pESVIodDtBxgi3OEUHcPEKCWE1kSHuhJCWki78ja/w672-h474/kumbh%20all.png&quot; width=&quot;672&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgme2piwfZX1aVe2xpV-UuLPWwUwcjtoleCdSXQtIup6WAQ9kLs_xOOEH8leQYI93An3DV_lg91Sd06-00ikJ1dsHPMR3PIJXkIU_dQtCr1QNr1X1diN7CTx7jxPDq41hloNncv3CxGUcgrbWyDZo9gPSHktTpR6IDgJN0ym49ya3mxbYPfFw-noOZf3gJ9/s3308/1000387444.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;2339&quot; data-original-width=&quot;3308&quot; height=&quot;472&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgme2piwfZX1aVe2xpV-UuLPWwUwcjtoleCdSXQtIup6WAQ9kLs_xOOEH8leQYI93An3DV_lg91Sd06-00ikJ1dsHPMR3PIJXkIU_dQtCr1QNr1X1diN7CTx7jxPDq41hloNncv3CxGUcgrbWyDZo9gPSHktTpR6IDgJN0ym49ya3mxbYPfFw-noOZf3gJ9/w669-h472/1000387444.jpg&quot; width=&quot;669&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/02/maps-prepared-by-me.html</link><author>noreply@blogger.com (Yogendra)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAE48AZ6EaZadNdhdxk4FpMaRpyj5FFT7BO2uMfkju6gCGv8hm6YSbXWK77c21YMR88W2V2-7G4hujBXg_9wnfaEG2odIgt1LY8DhnsdWnjnGhMoYEMfAlgp8qhnSrJhyQFqGAwOudlLCkuc2trsxmACIDLoYrFx8Fr7Ui8lkaqQ0DF2aWYySwZwH4fUlt/s72-w659-h465-c/Sawalya%20Povalya%20Road%20existence%20proof.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-6441247803281962665</guid><pubDate>Tue, 24 Feb 2026 13:26:00 +0000</pubDate><atom:updated>2026-02-24T18:56:30.838+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Guidelines Books Type plan GR&#39;s Circulars</category><category domain="http://www.blogger.com/atom/ns#">PWD Working</category><title>Medical Expenditure Reimbursement Rules</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;mr&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;&gt;
&lt;title&gt;GR Explanation - Emergency Private Hospital Reimbursement (19-03-2005)&lt;/title&gt;
&lt;style&gt;
body{
    font-family: Arial, sans-serif;
    line-height: 1.6;
    max-width: 1000px;
    margin: auto;
    padding: 20px;
    background:#f4f6f9;
}
h1,h2,h3{
    color:#123b5d;
}
.section{
    background:white;
    padding:20px;
    margin-top:20px;
    border-radius:8px;
}
.highlight{
    background:#e8f4ff;
    padding:10px;
    border-left:5px solid #123b5d;
}
ul{
    margin-left:20px;
}
.footer{
    margin-top:40px;
    font-size:14px;
    color:gray;
    text-align:center;
}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;h1&gt;शासकीय निर्णय स्पष्टीकरण&lt;/h1&gt;

&lt;div class=&quot;section&quot;&gt;
&lt;h2&gt;📘 शासन निर्णय तपशील&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;विषय:&lt;/strong&gt; शासकीय कर्मचाऱ्यांनी व त्यांच्या कुटुंबियांनी आकस्मिक निकडीच्या प्रसंगी घेतलेल्या खाजगी रुग्णालयातील आंतररुग्ण उपचाराच्या वैद्यकीय खर्चाच्या मंजुरीबाबत&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;शासन निर्णय क्रमांक:&lt;/strong&gt; 200503190000000117&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;दिनांक:&lt;/strong&gt; 19 मार्च 2005&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;राज्य:&lt;/strong&gt; महाराष्ट्र शासन&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;section&quot;&gt;
&lt;h2&gt;🎯 शासन निर्णयाचा उद्देश&lt;/h2&gt;
&lt;p&gt;
या शासन निर्णयाचा मुख्य उद्देश असा आहे की, जर एखाद्या शासकीय कर्मचाऱ्याला किंवा त्याच्या कुटुंबातील सदस्याला अचानक जीवघेणी आपत्कालीन स्थिती निर्माण झाली आणि तात्काळ उपचारासाठी खाजगी रुग्णालयात दाखल करावे लागले, तर अशा परिस्थितीत झालेल्या खर्चाची शासनाकडून मर्यादित परतफेड (Reimbursement) करता येईल.
&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;section&quot;&gt;
&lt;h2&gt;🚨 कोणत्या परिस्थितीत लागू?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;जीव वाचविण्यासाठी तातडीची आवश्यकता (Life Saving Emergency)&lt;/li&gt;
&lt;li&gt;रुग्णालयात भरती (Indoor Treatment) आवश्यक&lt;/li&gt;
&lt;li&gt;जवळपास शासकीय रुग्णालय उपलब्ध नसणे किंवा उपचार सुविधा नसणे&lt;/li&gt;
&lt;li&gt;पूर्वपरवानगी घेणे शक्य नसणे&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;section&quot;&gt;

&lt;h1&gt;आकस्मिक निकडीचे आजार (भाग १)&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;हृदयविकाराचा झटका &lt;span class=&quot;english&quot;&gt;(Cardiac emergency)&lt;/span&gt;, मेंदू रक्तवाहिन्यासंबंधी विकार &lt;span class=&quot;english&quot;&gt;(Cerebral vascular)&lt;/span&gt;, फुफ्फुसविकार आपत्कालीन स्थिती &lt;span class=&quot;english&quot;&gt;(Pulmonary emergency)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;उच्च रक्तदाब &lt;span class=&quot;english&quot;&gt;(Hypertension)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;धनुर्वात &lt;span class=&quot;english&quot;&gt;(Tetanus)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;घटसर्प &lt;span class=&quot;english&quot;&gt;(Diphtheria)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;अपघातामुळे झालेला शॉक सिंड्रोम &lt;span class=&quot;english&quot;&gt;(Accident / Shock Syndrome)&lt;/span&gt;,हृदय-रक्तवाहिनीसंबंधी विकार &lt;span class=&quot;english&quot;&gt;(Cardiological and Vascular)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;गर्भपात &lt;span class=&quot;english&quot;&gt;(Abortions)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;तीव्र पोटदुखी / आतड्यांचा अडथळा &lt;span class=&quot;english&quot;&gt;(Acute abdominal pain / Intestinal obstruction)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;गंभीर रक्तस्राव &lt;span class=&quot;english&quot;&gt;(Severe Haemorrhage)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;जठरांत्रशोथ &lt;span class=&quot;english&quot;&gt;(Gastro-Enteritis)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;विषमज्वर &lt;span class=&quot;english&quot;&gt;(Typhoid)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;बेशुद्धावस्था &lt;span class=&quot;english&quot;&gt;(Coma)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;मानसिक विकाराची अचानक सुरुवात &lt;span class=&quot;english&quot;&gt;(Onset of psychiatric disorder)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;डोळ्यातील दृष्टिपटल सरकणे &lt;span class=&quot;english&quot;&gt;(Retinal detachment in the eye)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;स्त्रीरोग व प्रसूती आपत्कालीन स्थिती &lt;span class=&quot;english&quot;&gt;(Gynaecological and Obstetric emergency)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;मूत्रजननेंद्रिय आपत्कालीन स्थिती &lt;span class=&quot;english&quot;&gt;(Genito-Urinary emergency)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;गॅस गँग्रीन &lt;span class=&quot;english&quot;&gt;(Gas Gangrene)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;कान-नाक-घसा आपत्कालीन स्थिती &lt;span class=&quot;english&quot;&gt;(Foreign body in ear, nose &amp; throat emergency)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;तातडीच्या शस्त्रक्रियेची आवश्यकता असलेले जन्मजात विकार &lt;span class=&quot;english&quot;&gt;(Congenital anomalies requiring urgent surgical intervention)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;मेंदूचा ट्युमर &lt;span class=&quot;english&quot;&gt;(Brain Tumour)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;भाजणे &lt;span class=&quot;english&quot;&gt;(Burns)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;अपस्मार &lt;span class=&quot;english&quot;&gt;(Epilepsy)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;तीव्र काचबिंदू &lt;span class=&quot;english&quot;&gt;(Acute Glaucoma)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;स्पायनल कॉर्ड (मज्जारज्जू )संबंधात आकस्मिक आजार &lt;/li&gt;
&lt;li&gt;उष्माघात&lt;/li&gt;
&lt;li&gt;रक्तसंबंधातील आजार&lt;/li&gt;
&lt;li&gt;प्राणी चावल्यामुळे होणारी विषबाधा&lt;/li&gt;
&lt;li&gt;रसायनांमुळे होणारी विषबाधा&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
  
  &lt;div&gt;
  &lt;h2&gt;गंभीर आजार – भाग २&lt;/h2&gt;
    
  &lt;ol&gt;
  
  &lt;li&gt;हृदय प्रत्यारोपणाची शस्त्रक्रिया (Heart Surgery)&lt;/li&gt;
  
  &lt;li&gt;हृदय बायपास शस्त्रक्रिया (Bypass Surgery)&lt;/li&gt;
  
  &lt;li&gt;अँजिओप्लास्टी शस्त्रक्रिया (Angioplasty Surgery)&lt;/li&gt;
  
  &lt;li&gt;मूत्रपिंड प्रत्यारोपण शस्त्रक्रिया (Kidney Transplantation)&lt;/li&gt;
  
  &lt;li&gt;रक्ताचा कर्करोग (Blood Cancer)&lt;/li&gt;
      
   &lt;/ol&gt;
    
    &lt;p&gt;वरील प्रकरणे उच्चस्तरीय तपासणीस अधीन असतात.&lt;/p&gt;
    
  &lt;/div&gt;

&lt;div class=&quot;section&quot;&gt;
&lt;h2&gt;💰 खर्च मंजुरीचे नियम&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;
✔ फक्त आंतररुग्ण (Indoor) उपचारासाठी लागू &lt;br&gt;
✖ बाह्यरुग्ण (OPD) उपचारासाठी लागू नाही
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;खर्च शासनमान्य दरानुसारच मंजूर होईल.&lt;/li&gt;
&lt;li&gt;CGHS / शासन रुग्णालय दराप्रमाणे मर्यादा लागू.&lt;/li&gt;
&lt;li&gt;खाजगी रुग्णालयाचे दर जास्त असल्यास अतिरिक्त रक्कम कर्मचाऱ्याने स्वतः भरावी.&lt;/li&gt;
&lt;li&gt;प्रकरण वैद्यकीय तपासणीनंतर मंजूर केले जाईल.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;section&quot;&gt;
&lt;h2&gt;📑 आवश्यक कागदपत्रे&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;रुग्णालयाचे आपत्कालीन प्रमाणपत्र&lt;/li&gt;
&lt;li&gt;दाखल व सुटकेचा सारांश (Discharge Summary)&lt;/li&gt;
&lt;li&gt;मूळ बिल व पावत्या&lt;/li&gt;
&lt;li&gt;रुग्णाची स्थिती स्पष्ट करणारा वैद्यकीय अहवाल&lt;/li&gt;
&lt;li&gt;खाजगी रुग्णालय निवडण्याचे कारण स्पष्ट करणारे निवेदन&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;section&quot;&gt;
&lt;h2&gt;🏛 मंजुरी प्रक्रिया&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;विभागप्रमुख स्तरावर तपासणी&lt;/li&gt;
&lt;li&gt;प्रशासकीय मान्यता&lt;/li&gt;
&lt;li&gt;आवश्यक असल्यास वित्त विभागाची संमती&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;section&quot;&gt;
&lt;h2&gt;⚖ महत्वाच्या अटी&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;पूर्वनियोजित शस्त्रक्रिया मंजूर नाही.&lt;/li&gt;
&lt;li&gt;फसवणूक आढळल्यास शिस्तभंग कारवाई होऊ शकते.&lt;/li&gt;
&lt;li&gt;आपत्कालीन स्वरूपाची खात्री करणे आवश्यक आहे.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/02/medical-expenditure-reimbursement-rules.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-7569988453082965290</guid><pubDate>Wed, 18 Feb 2026 13:27:00 +0000</pubDate><atom:updated>2026-02-18T20:11:16.981+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">PWD Working</category><category domain="http://www.blogger.com/atom/ns#">Tender</category><title>Tender related Information and related calculator - PWD Maharashtra</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;Tender related Information and related calculator - PWD Maharashtra&lt;/title&gt;
    &lt;style&gt;
        body {
            font-family: Arial, Helvetica, sans-serif;
            max-width: 900px;
            margin: 40px auto;
            line-height: 1.5;
        }
        h2 {
            text-align: center;
            color: #333;
        }
        .reference {
            font-style: italic;
            color: #555;
            text-align: center;
            margin-bottom: 20px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        th, td {
            padding: 12px 15px;
            text-align: left;
            border: 1px solid #ddd;
        }
        th {
            background-color: #f2f2f2;
            font-weight: bold;
            color: #333;
        }
        tr:nth-child(even) {
            background-color: #f9f9f9;
        }
        tr:hover {
            background-color: #f1f1f1;
        }
        .center {
            text-align: center;
        }
        .amount {
            font-weight: 600;
        }
        .note {
            font-size: 0.95em;
            color: #444;
            margin-top: 10px;
        }
      .container{
    max-width:900px;
    background:white;
    padding:25px;
    margin:auto;
    border-radius:8px;
    box-shadow:0 0 8px rgba(0,0,0,0.1);
}

input, select{
    width:100%;
    padding:8px;
    margin-top:6px;
    margin-bottom:15px;
}

button{
    padding:10px 20px;
    background:#007bff;
    color:white;
    border:none;
    cursor:pointer;
}

.result{
    background:#f1f1f1;
    padding:15px;
    margin-top:20px;
    border-radius:6px;
}
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  
    &lt;div class=&quot;container&quot;&gt;

&lt;h2&gt;PWD Tender Detailed Calculator&lt;/h2&gt;

&lt;label&gt;Tender Amount (₹)&lt;/label&gt;
&lt;input type=&quot;number&quot; id=&quot;amount&quot;&gt;

&lt;label&gt;GST (%)&lt;/label&gt;
&lt;input type=&quot;number&quot; id=&quot;gst&quot; value=&quot;18&quot;&gt;

&lt;label&gt;Quoted Below Percentage (%)&lt;/label&gt;
&lt;input type=&quot;number&quot; id=&quot;below&quot;&gt;

&lt;label&gt;Type of Work&lt;/label&gt;
&lt;select id=&quot;workType&quot;&gt;
    &lt;option value=&quot;&quot;&gt;Select Work Type&lt;/option&gt;
    &lt;option value=&quot;rcc&quot;&gt;RCC and Load Bearing Building&lt;/option&gt;
    &lt;option value=&quot;waterproofing&quot;&gt;Waterproofing on Building Slab&lt;/option&gt;
    &lt;option value=&quot;specified&quot;&gt;Specified Repairs to Buildings&lt;/option&gt;
    &lt;option value=&quot;special&quot;&gt;Special Repairs to Building&lt;/option&gt;
    &lt;option value=&quot;current&quot;&gt;Current Repairs to Building&lt;/option&gt;
    &lt;option value=&quot;road&quot;&gt;Strengthening &amp; Black Topping of Roads&lt;/option&gt;
&lt;/select&gt;

&lt;button onclick=&quot;calculate()&quot;&gt;Calculate&lt;/button&gt;

&lt;div class=&quot;result&quot; id=&quot;output&quot;&gt;&lt;/div&gt;

&lt;script&gt;

function formatMoney(num){
    return num.toLocaleString(&#39;en-IN&#39;, {maximumFractionDigits:2});
}

function round1000(val){
    return Math.ceil(val/1000)*1000;
}

function calculate(){

let amt = Number(document.getElementById(&quot;amount&quot;).value);
let gst = Number(document.getElementById(&quot;gst&quot;).value);
let below = Number(document.getElementById(&quot;below&quot;).value);
let type = document.getElementById(&quot;workType&quot;).value;

if(!amt || amt&lt;=0){
    alert(&quot;Enter valid Tender Amount&quot;);
    return;
}

/* ---------- Tender Fee ---------- */

let fee = 0;

if(amt &lt;= 300000) fee = 200;
else if(amt &lt;= 5000000) fee = 500;
else if(amt &lt;= 20000000) fee = 1000;
else if(amt &lt;= 50000000) fee = 2000;
else if(amt &lt;= 1000000000) fee = 3000;
else if(amt &lt;= 5000000000) fee = 5000;
else fee = 10000;

let feeGST = fee + (fee * gst / 100);


/* ---------- Tender Form ---------- */

let form = &quot;D Tender&quot;;

if(amt &lt;= 149999999) form=&quot;B-1 Tender&quot;;
else if(amt &lt;= 499999999) form=&quot;SBD Tender&quot;;
else form=&quot;EPC Tender&quot;;


/* ---------- Publicity Period ---------- */

let publicity=&quot;&quot;;

if(amt &lt; 250000000)
publicity=&quot;1st Call 8 / 2nd call 8 / 3rd call 8 Days&quot;;

else if(amt &lt;= 1000000000)
publicity=&quot;1st Call 15 / 2nd call 8 / 3rd call 8 Days&quot;;

else
publicity=&quot;1st Call 21 / 2nd call 8 / 3rd call 8 Days&quot;;


/* ---------- Completion Period ---------- */

let completion=&quot;Not Applicable&quot;;

if(amt &gt;= 500000 &amp;&amp; amt &lt;= 1500000)
completion=&quot;100 Days&quot;;

else if(amt &gt; 1500000 &amp;&amp; amt &lt;= 5000000)
completion=&quot;180 Days&quot;;

else if(amt &gt; 5000000 &amp;&amp; amt &lt;= 150000000)
completion=&quot;300 Days&quot;;


/* ---------- DLP ---------- */

const dlpMap = {
    rcc:&quot;10 Years&quot;,
    waterproofing:&quot;7 Years&quot;,
    specified:&quot;5 Years&quot;,
    special:&quot;2 Years&quot;,
    current:&quot;1 Year&quot;,
    road:&quot;10 Years&quot;
};

let dlp = dlpMap[type] || &quot;Select Work Type&quot;;


/* ---------- EMD ---------- */

let emd=0;

if(amt &lt;= 15000000)
emd = amt * 0.01;

else
emd = Math.max(amt*0.005 ,150000);


/* ---------- Security Deposit ---------- */

let sd = (amt &lt;= 15000000) ? amt*0.02 : amt*0.01;
sd = round1000(sd);


/* ---------- Additional Performance ---------- */

let apsPercent = 0;

if(below &gt; 0){

if(below &lt;= 10)
apsPercent = 1;

else if(below &lt;= 15)
apsPercent = 1 + (below-10);

else
apsPercent = 6 + (2*(below-15));
}

let apsAmount = amt * apsPercent / 100;


/* ---------- Output ---------- */

let output = `
&lt;b&gt;Tender Fee :&lt;/b&gt; ₹${formatMoney(fee)} + GST = ₹${formatMoney(feeGST)} &lt;br&gt;
&lt;b&gt;Tender Form :&lt;/b&gt; ${form} &lt;br&gt;
&lt;b&gt;Publicity Period :&lt;/b&gt; ${publicity} &lt;br&gt;
&lt;b&gt;Completion Period :&lt;/b&gt; ${completion} &lt;br&gt;
&lt;b&gt;Defect Liability :&lt;/b&gt; ${dlp} &lt;br&gt;
&lt;b&gt;EMD :&lt;/b&gt; ₹${formatMoney(emd)} &lt;br&gt;
&lt;b&gt;Security Deposit :&lt;/b&gt; ₹${formatMoney(sd)} &lt;br&gt;
&lt;b&gt;Additional Performance Security :&lt;/b&gt; ${apsPercent}% 
(${formatMoney(apsAmount)}) &lt;br&gt;
`;

document.getElementById(&quot;output&quot;).innerHTML = output;

}

&lt;/script&gt;
      
      

    &lt;h2&gt;Cost of Blank Tender Form&lt;/h2&gt;
    &lt;div class=&quot;reference&quot;&gt;
        As per PWD GR No. CAT/2017/PK08/Blddg-2 dated 27/09/2018&lt;br&gt;
        Para No. 5.3 (Annexure 6)
    &lt;/div&gt;

    &lt;table&gt;
        &lt;thead&gt;
            &lt;tr&gt;
                &lt;th&gt;Sr. No.&lt;/th&gt;
                &lt;th&gt;Tender Amount&lt;/th&gt;
                &lt;th&gt;Tender Fees&lt;/th&gt;
            &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
            &lt;tr&gt;
                &lt;td&gt;1&lt;/td&gt;
                &lt;td&gt;Up to 3 lakhs&lt;/td&gt;
                &lt;td class=&quot;amount&quot;&gt;₹ 200 + GST&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;2&lt;/td&gt;
                &lt;td&gt;3 lakhs to 50 lakhs&lt;/td&gt;
                &lt;td class=&quot;amount&quot;&gt;₹ 500 + GST&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;3&lt;/td&gt;
                &lt;td&gt;20 lakhs to 2 crores&lt;/td&gt;
                &lt;td class=&quot;amount&quot;&gt;₹ 1,000 + GST&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;4&lt;/td&gt;
                &lt;td&gt;2 crores to 5 crores&lt;/td&gt;
                &lt;td class=&quot;amount&quot;&gt;₹ 2,000 + GST&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;5&lt;/td&gt;
                &lt;td&gt;5 crores to 100 crores&lt;/td&gt;
                &lt;td class=&quot;amount&quot;&gt;₹ 3,000 + GST&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;6&lt;/td&gt;
                &lt;td&gt;100 crores to 500 crores&lt;/td&gt;
                &lt;td class=&quot;amount&quot;&gt;₹ 5,000 + GST&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;7&lt;/td&gt;
                &lt;td&gt;More than 500 crores&lt;/td&gt;
                &lt;td class=&quot;amount&quot;&gt;₹ 10,000 + GST&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/tbody&gt;
    &lt;/table&gt;

    &lt;p class=&quot;note center&quot;&gt;
        Note: All amounts are as per the Government Resolution mentioned above. GST is applicable extra as per prevailing rates.
    &lt;/p&gt;
  
  &lt;table border=&quot;1&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 100%; font-family: Arial, sans-serif;&quot;&gt;
    &lt;caption style=&quot;font-weight: bold; font-size: 1.2em; padding: 10px; text-align: left;&quot;&gt;
        Tenders shall be invited in following formats
        &lt;br&gt;&lt;small&gt;PWD GR No. CAT/2017/PK08/Blddg-2 dated 27/09/2018 at Para 2.9.1 (Annexure 6)&lt;/small&gt;
    &lt;/caption&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;background-color: #f2f2f2;&quot;&gt;
            &lt;th style=&quot;text-align: center;&quot;&gt;Sr. No.&lt;/th&gt;
            &lt;th style=&quot;text-align: left;&quot;&gt;Works Costing&lt;/th&gt;
            &lt;th style=&quot;text-align: left;&quot;&gt;Tender Form&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;/td&gt;
            &lt;td&gt;Civil Works Costing up to 15 Cr&lt;/td&gt;
            &lt;td&gt;B-1 Tender Form&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;2&lt;/td&gt;
            &lt;td&gt;Civil Works Costing from 15 Cr to 50 Cr&lt;/td&gt;
            &lt;td&gt;SBD Tender Form&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;3&lt;/td&gt;
            &lt;td&gt;Civil Works Costing more than 50 Cr&lt;/td&gt;
            &lt;td&gt;EPC Tender Form&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;4&lt;/td&gt;
            &lt;td&gt;Supply of Items / Materials&lt;/td&gt;
            &lt;td&gt;D Tender Form&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
  
  &lt;table border=&quot;1&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 100%; font-family: Arial, sans-serif;&quot;&gt;
    &lt;caption style=&quot;font-weight: bold; font-size: 1.2em; padding: 10px; text-align: left;&quot;&gt;
        Minimum Time/Period of Publicity of Tender
        &lt;br&gt;&lt;small&gt;PWD GR No. CAT/2017/PK08/Blddg-2 dated (earlier 27/09/2018 at Para 2 (Annexure 6)) now revised&lt;/small&gt;
    &lt;/caption&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;background-color: #f2f2f2;&quot;&gt;
            &lt;th style=&quot;text-align: center;&quot;&gt;Sr. No.&lt;/th&gt;
            &lt;th style=&quot;text-align: left;&quot;&gt;Work Cost&lt;/th&gt;
            &lt;th style=&quot;text-align: center;&quot;&gt;First Call&lt;/th&gt;
            &lt;th style=&quot;text-align: center;&quot;&gt;Second Call&lt;/th&gt;
            &lt;th style=&quot;text-align: center;&quot;&gt;Third Call&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;/td&gt;
            &lt;td&gt;Below 25 Cr&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;8 days&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;8 days&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;8 days&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;2&lt;/td&gt;
            &lt;td&gt;25 Cr to 100 Lakhs&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;15 days&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;8 days&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;8 days&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;3&lt;/td&gt;
            &lt;td&gt;&gt;100 Crs.&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;21 days&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;8 days&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;8 days&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
  
  
  &lt;table border=&quot;1&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 100%; font-family: Arial, sans-serif;&quot;&gt;
    &lt;caption style=&quot;font-weight: bold; font-size: 1.2em; padding: 10px; text-align: left;&quot;&gt;
        Completion Period for Works Costing More Than Rs. 5.00 Lakhs
        &lt;br&gt;&lt;small&gt;As per PWD GR No. CAT-2019/PK 96/Blddg-2 dated 26/07/2019 (Annexure 10)&lt;/small&gt;
    &lt;/caption&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;background-color: #f2f2f2;&quot;&gt;
            &lt;th style=&quot;text-align: center;&quot;&gt;Sr. No.&lt;/th&gt;
            &lt;th style=&quot;text-align: left;&quot;&gt;Cost&lt;/th&gt;
            &lt;th style=&quot;text-align: center;&quot;&gt;Time Period&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;/td&gt;
            &lt;td&gt;5 lakhs to 15 lakhs&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;100 days&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;2&lt;/td&gt;
            &lt;td&gt;15 lakhs to 50 lakhs&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;180 days&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;3&lt;/td&gt;
            &lt;td&gt;50 lakhs to 15 crores&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;300 days&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
  
  &lt;table border=&quot;1&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 100%; font-family: Arial, sans-serif;&quot;&gt;
    &lt;caption style=&quot;font-weight: bold; font-size: 1.2em; padding: 10px; text-align: left;&quot;&gt;
        Defect Liability Period
        &lt;br&gt;&lt;small&gt;PWD GR - MISC-2018/PK 151/Blddg-2 dated 14 Jan 2019 (Annexure 11)&lt;/small&gt;
    &lt;/caption&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;background-color: #f2f2f2;&quot;&gt;
            &lt;th style=&quot;text-align: center;&quot;&gt;Sr. No.&lt;/th&gt;
            &lt;th style=&quot;text-align: left;&quot;&gt;Type of Work&lt;/th&gt;
            &lt;th style=&quot;text-align: center;&quot;&gt;Time Period&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;/td&gt;
            &lt;td&gt;RCC and Load bearing Building&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;10 years&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;2&lt;/td&gt;
            &lt;td&gt;Waterproofing on Building Slab&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;07 years&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;3&lt;/td&gt;
            &lt;td&gt;Specified Repairs to Buildings&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;05 years&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;4&lt;/td&gt;
            &lt;td&gt;Special Repairs to Building&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;02 years&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;5&lt;/td&gt;
            &lt;td&gt;Current repairs to Building&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;01 year&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;6&lt;/td&gt;
            &lt;td&gt;Strengthening &amp; Black Topping of Roads&lt;/td&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;10 years&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
  
  &lt;table border=&quot;1&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 100%; font-family: Arial, sans-serif;&quot;&gt;
    &lt;caption style=&quot;font-weight: bold; font-size: 1.2em; padding: 10px; text-align: left;&quot;&gt;
        Earnest Money Deposit (EMD)
        &lt;br&gt;&lt;small&gt;PWD GR No. CAT/2017/PK08/Blddg-2 dated 27/09/2018 at Para No. 2.7 (Annexure No. 6)&lt;/small&gt;
    &lt;/caption&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;background-color: #f2f2f2;&quot;&gt;
            &lt;th style=&quot;text-align: center;&quot;&gt;Sr. No.&lt;/th&gt;
            &lt;th style=&quot;text-align: left;&quot;&gt;Work Costing&lt;/th&gt;
            &lt;th style=&quot;text-align: left;&quot;&gt;Earnest Money Deposit (EMD)&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;/td&gt;
            &lt;td&gt;Work Costing up to 1.5 Cr.&lt;/td&gt;
            &lt;td&gt;1% of Tender Amount&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style=&quot;text-align: center;&quot;&gt;2&lt;/td&gt;
            &lt;td&gt;Work Costing More than 1.5 Cr.&lt;/td&gt;
            &lt;td&gt;0.5% of Tender Amount or Rs. 1.50 Lakhs whichever is higher&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;

&lt;p style=&quot;font-family: Arial, sans-serif; margin-top: 15px; font-size: 0.95em; color: #444;&quot;&gt;
    &lt;strong&gt;Note:&lt;/strong&gt; EMD is compulsory for all bidders. Tenders without EMD shall be technically disqualified for opening of financial bid. For bids of appointment of consultant, EMD is not necessary.
&lt;/p&gt;
  
  &lt;p&gt;&lt;strong&gt;Security Deposit:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;
    PWD GR No. CAT/2017/PK08/Bldg-2 dated 27/09/2018 at Para No. 2.8 (Annexure No.6)
&lt;/p&gt;

&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot;&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Sr No&lt;/th&gt;
            &lt;th&gt;Work Cost&lt;/th&gt;
            &lt;th&gt;Security Deposit&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;1&lt;/td&gt;
            &lt;td&gt;Works Costing upto 1.5 Cr&lt;/td&gt;
            &lt;td&gt;2 (Two) % of Tender Amount (Rounded to next Rs.1000)&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;2&lt;/td&gt;
            &lt;td&gt;Works Costing more than 1.5 Cr&lt;/td&gt;
            &lt;td&gt;1 (One) % of Tender Amount (Rounded to next Rs.1000)&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;

  &lt;p&gt;&lt;strong&gt;13.11 Additional Performance Security Deposit:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;
    Additional performance security shall be submitted by the lowest bidder, who quotes rates below estimated rates of tender as per 
    PWD GR CAT/2017/PK 08/Bldg-2 dated 26 Nov 2018 (Annexure 14) before work order:
&lt;/p&gt;

&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot;&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Sr No&lt;/th&gt;
            &lt;th&gt;Below Tender Offer Quoted&lt;/th&gt;
            &lt;th&gt;Additional Performance Security (In percentage of Tender Cost)&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;1&lt;/td&gt;
            &lt;td&gt;Upto 10% Below&lt;/td&gt;
            &lt;td&gt;1%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;2&lt;/td&gt;
            &lt;td&gt;Upto 15% Below&lt;/td&gt;
            &lt;td&gt;1% + Quoted percentage above 10%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;3&lt;/td&gt;
            &lt;td&gt;More than 15% Below&lt;/td&gt;
            &lt;td&gt;6% + Twice actual percentage above 15%&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/02/tender-information-and-related.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-2710278084369884730</guid><pubDate>Wed, 18 Feb 2026 12:34:00 +0000</pubDate><atom:updated>2026-02-18T20:50:53.954+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Estimate Preparation</category><category domain="http://www.blogger.com/atom/ns#">PWD Working</category><title>Block Estimate Rates</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;PWD Block Estimate (2022-23)&lt;/title&gt;
    &lt;style&gt;
        :root {
            --primary: #2980b9;
            --secondary: #2c3e50;
            --accent: #27ae60;
            --bg: #f4f7f6;
        }

        body {
            font-family: &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: var(--bg);
            color: #333;
            line-height: 1.6;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: #fff;
            padding: 10px;
            border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }
      
      table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

table thead {
    background-color: #f2f2f2;
}

table th {
    border: 1px solid #333;
    padding: 8px;
    text-align: center;
    font-weight: 600;
}

table td {
    border: 1px solid #555;
    padding: 7px;
    vertical-align: top;
}

/* Alternate row shading */
table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

        h1 {
            color: var(--secondary);
            text-align: center;
            font-size: 24px;
            border-bottom: 3px solid var(--primary);
            padding-bottom: 15px;
            margin-bottom: 30px;
        }

        .input-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: var(--secondary);
        }

        select, input[type=&quot;number&quot;] {
            width: 100%;
            padding: 12px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 16px;
            box-sizing: border-box;
            transition: border-color 0.3s;
        }

        select:focus, input:focus {
            border-color: var(--primary);
            outline: none;
        }

        .btn-container {
            display: flex;
            gap: 10px;
            margin-top: 30px;
        }

        button {
            flex: 1;
            padding: 15px;
            font-size: 16px;
            font-weight: bold;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.3s;
        }

        .calc-btn { background-color: var(--primary); }
        .calc-btn:hover { background-color: #1f6391; }
        
        .print-btn { background-color: #7f8c8d; }
        .print-btn:hover { background-color: #636e72; }

        #result-box {
            margin-top: 30px;
            padding: 25px;
            background: #fff;
            border: 2px solid var(--primary);
            border-radius: 6px;
            display: none;
        }

        .estimate-table {
            width: 100%;
            border-collapse: collapse;
            margin: 15px 0;
        }

        .estimate-table td {
            padding: 10px 0;
            border-bottom: 1px solid #eee;
        }

        .total-row {
            font-size: 1.3em;
            font-weight: bold;
            color: var(--secondary);
        }

        .footer-note {
            margin-top: 40px;
            font-size: 0.85em;
            color: #777;
            text-align: center;
            border-top: 1px solid #eee;
            padding-top: 20px;
        }

        @media print {
            body { background: white; padding: 0; }
            .container { box-shadow: none; width: 100%; max-width: 100%; }
            button, select, input, label, small { display: none; }
            #result-box { display: block !important; border: none; }
            h1 { font-size: 20px; }
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class=&quot;container&quot;&gt;
    &lt;h1&gt;PWD Block Estimate Calculator (2022-23)&lt;/h1&gt;

    &lt;div class=&quot;input-group&quot;&gt;
        &lt;label&gt;Work Category&lt;/label&gt;
        &lt;select id=&quot;category&quot; onchange=&quot;loadOptions()&quot;&gt;
            &lt;option value=&quot;&quot;&gt;-- Select Category --&lt;/option&gt;
            &lt;option value=&quot;road&quot;&gt;Road Work / Renewal&lt;/option&gt;
            &lt;option value=&quot;culvert&quot;&gt;Pipe Culvert (Stage-I)&lt;/option&gt;
            &lt;option value=&quot;causeway&quot;&gt;Causeway / Hard Passage&lt;/option&gt;
            &lt;option value=&quot;bridge&quot;&gt;Minor Bridge / Slab Drain&lt;/option&gt;
            &lt;option value=&quot;building&quot;&gt;Building Work&lt;/option&gt;
        &lt;/select&gt;
    &lt;/div&gt;

    &lt;div id=&quot;dynamicInputs&quot;&gt;&lt;/div&gt;

    &lt;div class=&quot;input-group&quot;&gt;
        &lt;label&gt;Area Adjustment %&lt;/label&gt;
        &lt;input type=&quot;number&quot; id=&quot;adjust&quot; value=&quot;0&quot; step=&quot;1&quot;&gt;
        &lt;small style=&quot;color:#666&quot;&gt;Ghat +15%, Tribal +10%, Corp +5%, Gadchiroli +20%&lt;/small&gt;
    &lt;/div&gt;

    &lt;div class=&quot;btn-container&quot;&gt;
        &lt;button class=&quot;calc-btn&quot; onclick=&quot;calculate()&quot;&gt;Generate Estimate&lt;/button&gt;
        &lt;button class=&quot;print-btn&quot; onclick=&quot;window.print()&quot;&gt;Print PDF&lt;/button&gt;
    &lt;/div&gt;

    &lt;div id=&quot;result-box&quot; style=&quot;display:none;&quot;&gt;
        &lt;h2 style=&quot;margin-top:0;&quot;&gt;Estimate Summary&lt;/h2&gt;
        &lt;div id=&quot;result-content&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;script&gt;
  
  let estimateItems = [];

/* ===================== RATES ===================== */

const roadRates = {
&quot;Village Road BC&quot;:834000,
&quot;Village Road Non BC&quot;:681800,
&quot;ODR/MDR BC&quot;:1010100,
&quot;ODR/MDR Non BC&quot;:843700,
&quot;State Highway BC&quot;:1413000,
&quot;State Highway Non BC&quot;:1204500,
&quot;VR Renewal&quot;:976000,
&quot;ORD/MDR Renewal&quot;:1200000,
&quot;SH Renewal&quot;:1790000,
&quot;MPM 75 Over WBM&quot;:1418250,
&quot;MPM 75 Over BT&quot;:1500938,
&quot;BUSG 75 Over WBM&quot;:1513250,
&quot;BUSG 75 Over BT&quot;:1701000,
&quot;MPM 50 Over WBM&quot;:1058438,
&quot;MPM 50 Over BT&quot;:1197188,
&quot;SCD Over WBM&quot;:380250,
&quot;SCD Over BT&quot;:387000,
&quot;Premix Carpet WBM&quot;:1228313,
&quot;Premix Carpet BT&quot;:1214626,
&quot;50mm BM&quot;:2108850,
&quot;75mm DBM&quot;:3104770,
&quot;30mm BC&quot;:1774500,
&quot;50mm DBM&quot;:2487600,
&quot;75mm BM&quot;:3672890,
&quot;CC Drain&quot;:5358000
};

const culvertRates = {
&quot;800 Single 7.5&quot;:397000,&quot;800 Single 10&quot;:415900,
&quot;800 Double 7.5&quot;:510400,&quot;800 Double 10&quot;:558200,
&quot;800 Triple 7.5&quot;:629000,&quot;800 Triple 10&quot;:706600,
&quot;900 Single 7.5&quot;:424600,&quot;900 Single 10&quot;:451300,
&quot;900 Double 7.5&quot;:560700,&quot;900 Double 10&quot;:611900,
&quot;900 Triple 7.5&quot;:693000,&quot;900 Triple 10&quot;:769800,
&quot;1000 Single 7.5&quot;:468500,&quot;1000 Single 10&quot;:496300,
&quot;1000 Double 7.5&quot;:615400,&quot;1000 Double 10&quot;:672200,
&quot;1000 Triple 7.5&quot;:710700,&quot;1000 Triple 10&quot;:847500,
&quot;1200 Single 7.5&quot;:564200,&quot;1200 Single 10&quot;:600600,
&quot;1200 Double 7.5&quot;:734600,&quot;1200 Double 10&quot;:823100,
&quot;1200 Triple 7.5&quot;:936000,&quot;1200 Triple 10&quot;:1045500
};

const causewayRates = {&quot;Without Vents&quot;:28700,&quot;With Pipes&quot;:26300};

const bridgeRates = {
&quot;Open Foundation&quot;:54617,
&quot;Raft Foundation&quot;:63857,
&quot;Box Cells&quot;:500125,
&quot;Non Submersible&quot;:26180,
&quot;Submersible&quot;:45629
};

const buildingRates = {
iti_gf:{name:&quot;I.T.I Buildings, Administrative Buildings and other similar structures – Ground Floor&quot;,rate:30000},
iti_ff:{name:&quot;I.T.I Buildings, Administrative Buildings and other similar structures – First Floor&quot;,rate:24450},

hostel_gf:{name:&quot;Hostel, Courts, Urban Hospital and other similar Buildings – Ground Floor&quot;,rate:30100},
hostel_ff:{name:&quot;Hostel, Courts, Urban Hospital and other similar Buildings – First Floor&quot;,rate:25250},

rural_gf:{name:&quot;Rural Hospital and other similar Buildings – Ground Floor&quot;,rate:24700},

res_gf:{name:&quot;Residential Quarter (Type III, IV &amp; V) – Ground Floor&quot;,rate:25000},
res_ff_a:{name:&quot;Residential Quarter (Type III, IV &amp; V) – First Floor&quot;,rate:21200},
res_ff_b:{name:&quot;Residential Quarters (Type III, IV &amp; V) – Ground Floor&quot;,rate:28800},
res_ff_c:{name:&quot;Residential Quarters (Type III, IV &amp; V) – First Floor&quot;,rate:23450},

judge_gf:{name:&quot;Bungalows of Hon’ble Judges and other similar Buildings – Ground Floor&quot;,rate:29000},
judge_ff:{name:&quot;Bungalows of Hon’ble Judges and other similar Buildings – First Floor&quot;,rate:24000}
};


/* ---------------- DROPDOWN ---------------- */

function optionList(obj){
return Object.keys(obj).map(key=&gt;{
if(typeof obj[key]===&quot;object&quot;){
return `&lt;option value=&quot;${key}&quot;&gt;${obj[key].name}&lt;/option&gt;`;
}
return `&lt;option value=&quot;${key}&quot;&gt;${key}&lt;/option&gt;`;
}).join(&#39;&#39;);
}

/* ---------------- LOAD INPUTS ---------------- */

function loadOptions(){

document.getElementById(&quot;result-box&quot;).style.display=&quot;none&quot;;

const cat=document.getElementById(&quot;category&quot;).value;
const container=document.getElementById(&quot;dynamicInputs&quot;);

let html=&quot;&quot;;

if(!cat){container.innerHTML=&quot;&quot;;return;}

switch(cat){

case &quot;road&quot;:
html=`
&lt;label&gt;Road Type&lt;/label&gt;
&lt;select id=&quot;item&quot;&gt;${optionList(roadRates)}&lt;/select&gt;
&lt;label&gt;Length (km)&lt;/label&gt;
&lt;input type=&quot;number&quot; id=&quot;qty&quot; step=&quot;0.01&quot;&gt;`;
break;

case &quot;culvert&quot;:
html=`
&lt;label&gt;Type&lt;/label&gt;
&lt;select id=&quot;item&quot;&gt;${optionList(culvertRates)}&lt;/select&gt;
&lt;label&gt;Quantity&lt;/label&gt;
&lt;input type=&quot;number&quot; id=&quot;qty&quot;&gt;`;
break;

case &quot;causeway&quot;:
html=`
&lt;label&gt;Type&lt;/label&gt;
&lt;select id=&quot;item&quot;&gt;${optionList(causewayRates)}&lt;/select&gt;
&lt;label&gt;Length (m)&lt;/label&gt;
&lt;input type=&quot;number&quot; id=&quot;qty&quot;&gt;
&lt;label&gt;Width (m)&lt;/label&gt;
&lt;input type=&quot;number&quot; id=&quot;width&quot; value=&quot;7.5&quot;&gt;
&lt;label&gt;BC Soil&lt;/label&gt;
&lt;select id=&quot;bcsoil&quot;&gt;
&lt;option value=&quot;0&quot;&gt;No&lt;/option&gt;
&lt;option value=&quot;15&quot;&gt;Yes (+15%)&lt;/option&gt;
&lt;/select&gt;`;
break;

case &quot;bridge&quot;:
html=`
&lt;label&gt;Bridge Type&lt;/label&gt;
&lt;select id=&quot;item&quot;&gt;${optionList(bridgeRates)}&lt;/select&gt;
&lt;label&gt;Length (m)&lt;/label&gt;
&lt;input type=&quot;number&quot; id=&quot;qty&quot;&gt;`;
break;

case &quot;building&quot;:
html=`
&lt;label&gt;Building Type&lt;/label&gt;
&lt;select id=&quot;item&quot;&gt;${optionList(buildingRates)}&lt;/select&gt;
&lt;label&gt;Built-up Area (sqm)&lt;/label&gt;
&lt;input type=&quot;number&quot; id=&quot;qty&quot;&gt;
&lt;label&gt;Floors&lt;/label&gt;
&lt;input type=&quot;number&quot; id=&quot;floors&quot; value=&quot;1&quot;&gt;`;
break;

}

container.innerHTML=html;
}

/* ---------------- CALCULATE ---------------- */

function calculate(){

const cat=document.getElementById(&quot;category&quot;).value;
const item=document.getElementById(&quot;item&quot;).value;
const qty=parseFloat(document.getElementById(&quot;qty&quot;).value);
const adjust=parseFloat(document.getElementById(&quot;adjust&quot;).value)||0;

if(!cat) return alert(&quot;Select category&quot;);
if(isNaN(qty)||qty&lt;=0) return alert(&quot;Enter valid quantity&quot;);

let rate=0;

if(cat===&quot;road&quot;)rate=roadRates[item];
else if(cat===&quot;culvert&quot;)rate=culvertRates[item];
else if(cat===&quot;causeway&quot;)rate=causewayRates[item];
else if(cat===&quot;bridge&quot;)rate=bridgeRates[item];
else if(cat===&quot;building&quot;)rate=buildingRates[item]?.rate;

if(!rate) return alert(&quot;Rate not found&quot;);

let baseTotal=rate*qty;
let extra=0;

/* Causeway */
if(cat===&quot;causeway&quot;){
const width=parseFloat(document.getElementById(&quot;width&quot;).value)||7.5;
baseTotal=rate*qty*width;

const bc=parseFloat(document.getElementById(&quot;bcsoil&quot;).value);
if(bc&gt;0) extra+=baseTotal*(bc/100);
}

/* Building */
if(cat===&quot;building&quot;){
const floors=parseInt(document.getElementById(&quot;floors&quot;).value)||1;
baseTotal=rate*qty*floors;
}

/* Final */
let subTotal=baseTotal+extra;
let finalTotal=subTotal+(subTotal*(adjust/100));

/* Store Item */
const itemName = (cat===&quot;building&quot;) ? buildingRates[item].name : item;

estimateItems.push({
category:getCategoryName(cat),
name:itemName,
qty:qty,
amount:finalTotal
});

renderEstimateTable();
}

/* ---------------- CATEGORY LABEL ---------------- */

function getCategoryName(cat){
return {
road:&quot;Road Work&quot;,
culvert:&quot;Pipe Culvert&quot;,
causeway:&quot;Causeway&quot;,
bridge:&quot;Bridge&quot;,
building:&quot;Building&quot;
}[cat];
}

/* ---------------- TABLE RENDER ---------------- */

function renderEstimateTable(){

let grandTotal=0;

let rows=estimateItems.map((item,i)=&gt;{
grandTotal+=item.amount;

return `
&lt;tr&gt;
&lt;td&gt;${i+1}&lt;/td&gt;
&lt;td&gt;${item.category}&lt;/td&gt;
&lt;td&gt;${item.name}&lt;/td&gt;
&lt;td&gt;${item.qty}&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;₹${Math.round(item.amount).toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
&lt;td&gt;&lt;button onclick=&quot;removeItem(${i})&quot;&gt;Delete&lt;/button&gt;&lt;/td&gt;
&lt;/tr&gt;`;
}).join(&#39;&#39;);

document.getElementById(&quot;result-content&quot;).innerHTML=`
&lt;table border=&quot;1&quot; width=&quot;100%&quot;&gt;
&lt;tr&gt;
&lt;th&gt;Sr&lt;/th&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Qty&lt;/th&gt;
&lt;th&gt;Amount&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
${rows}
&lt;tr&gt;
&lt;td colspan=&quot;4&quot;&gt;&lt;b&gt;Grand Total&lt;/b&gt;&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;&lt;b&gt;₹${Math.round(grandTotal).toLocaleString(&#39;en-IN&#39;)}&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;`;

document.getElementById(&quot;result-box&quot;).style.display=&quot;block&quot;;
}

/* ---------------- REMOVE ITEM ---------------- */

function removeItem(index){
estimateItems.splice(index,1);
renderEstimateTable();
}

&lt;/script&gt;





&lt;h1&gt;Road construction / renewal works (2022–23)&lt;/h1&gt;
&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot;&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Sl No&lt;/th&gt;
            &lt;th&gt;Item of Work&lt;/th&gt;
            &lt;th&gt;Details&lt;/th&gt;
            &lt;th&gt;Proposed Rate 2022-23&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;1&lt;/td&gt;
            &lt;td&gt;Village Road&lt;/td&gt;
            &lt;td&gt;Roadway: 7.50 m, Carriageway: 3.00 m, BC Soil (Per Km)&lt;/td&gt;
            &lt;td&gt;834000.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;1&lt;/td&gt;
            &lt;td&gt;Village Road&lt;/td&gt;
            &lt;td&gt;Roadway: 7.50 m, Carriageway: 3.00 m, Non BC Soil (Per Km)&lt;/td&gt;
            &lt;td&gt;681800.00&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;2&lt;/td&gt;
            &lt;td&gt;Other District &amp; Major District Road upto WBM&lt;/td&gt;
            &lt;td&gt;Roadway: 7.50 m, Carriageway: 3.75 m, BC Soil (Per Km)&lt;/td&gt;
            &lt;td&gt;1010100.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;2&lt;/td&gt;
            &lt;td&gt;Other District &amp; Major District Road upto WBM&lt;/td&gt;
            &lt;td&gt;Roadway: 7.50 m, Carriageway: 3.75 m, Non BC Soil (Per Km)&lt;/td&gt;
            &lt;td&gt;843700.00&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;3&lt;/td&gt;
            &lt;td&gt;State Highway upto WBM&lt;/td&gt;
            &lt;td&gt;Roadway: 7.50 m, Carriageway: 3.75 m, BC Soil (Per Km)&lt;/td&gt;
            &lt;td&gt;1413000.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;3&lt;/td&gt;
            &lt;td&gt;State Highway upto WBM&lt;/td&gt;
            &lt;td&gt;Roadway: 7.50 m, Carriageway: 3.75 m, Non BC Soil (Per Km)&lt;/td&gt;
            &lt;td&gt;1204500.00&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;4A&lt;/td&gt;
            &lt;td&gt;Road Renewals - VR&lt;/td&gt;
            &lt;td&gt;One Metal Layer WBM (7.5 cm compacted, 3.00 m wide)&lt;/td&gt;
            &lt;td&gt;976000.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;4B&lt;/td&gt;
            &lt;td&gt;Road Renewals - ORD/MDR&lt;/td&gt;
            &lt;td&gt;One Metal Layer WBM (7.5 cm compacted, 3.75 m wide)&lt;/td&gt;
            &lt;td&gt;1200000.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;4C&lt;/td&gt;
            &lt;td&gt;Road Renewals - SH&lt;/td&gt;
            &lt;td&gt;One Metal Layer WBM (7.5 cm compacted, 5.50 m wide)&lt;/td&gt;
            &lt;td&gt;1790000.00&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;5&lt;/td&gt;
            &lt;td&gt;Modified Penetration Macadam (MPM)&lt;/td&gt;
            &lt;td&gt;75 mm thick, 3.75 m width, Over WBM&lt;/td&gt;
            &lt;td&gt;1418250.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;5&lt;/td&gt;
            &lt;td&gt;Modified Penetration Macadam (MPM)&lt;/td&gt;
            &lt;td&gt;75 mm thick, 3.75 m width, Over BT&lt;/td&gt;
            &lt;td&gt;1500938.00&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;6&lt;/td&gt;
            &lt;td&gt;Built up Spray Grout (BUSG)&lt;/td&gt;
            &lt;td&gt;75 mm thick, 3.75 m width, Over WBM&lt;/td&gt;
            &lt;td&gt;1513250.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;6&lt;/td&gt;
            &lt;td&gt;Built up Spray Grout (BUSG)&lt;/td&gt;
            &lt;td&gt;75 mm thick, 3.75 m width, Over BT&lt;/td&gt;
            &lt;td&gt;1701000.00&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;7&lt;/td&gt;
            &lt;td&gt;Modified Penetration Macadam (MPM)&lt;/td&gt;
            &lt;td&gt;50 mm thick, 3.75 m width, Over WBM&lt;/td&gt;
            &lt;td&gt;1058438.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;7&lt;/td&gt;
            &lt;td&gt;Modified Penetration Macadam (MPM)&lt;/td&gt;
            &lt;td&gt;50 mm thick, 3.75 m width, Over BT&lt;/td&gt;
            &lt;td&gt;1197188.00&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;8&lt;/td&gt;
            &lt;td&gt;Single Coat Surface Dressing&lt;/td&gt;
            &lt;td&gt;3.75 m Carriageway, Over WBM&lt;/td&gt;
            &lt;td&gt;380250.00&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;8&lt;/td&gt;
            &lt;td&gt;Single Coat Surface Dressing&lt;/td&gt;
            &lt;td&gt;3.75 m Carriageway, Over BT&lt;/td&gt;
            &lt;td&gt;387000.00&lt;/td&gt;
        &lt;/tr&gt;
      
      &lt;tr&gt;
    &lt;td&gt;9&lt;/td&gt;
    &lt;td&gt;20 mm Premix Carpet (Open graded premix surfacing) with liquid seal coat (Hot Mix laid, 3.75 m wide)&lt;/td&gt;
    &lt;td&gt;Over WBM&lt;/td&gt;
    &lt;td&gt;1228313.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;9&lt;/td&gt;
    &lt;td&gt;20 mm Premix Carpet (Open graded premix surfacing) with liquid seal coat (Hot Mix laid, 3.75 m wide)&lt;/td&gt;
    &lt;td&gt;Over BT&lt;/td&gt;
    &lt;td&gt;1214626.00&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;10&lt;/td&gt;
    &lt;td&gt;50 mm thick BM (3.3% Bitumen)&lt;/td&gt;
    &lt;td&gt;-&lt;/td&gt;
    &lt;td&gt;2108850.00&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;11&lt;/td&gt;
    &lt;td&gt;75 mm thick DBM (3.3% Bitumen)&lt;/td&gt;
    &lt;td&gt;-&lt;/td&gt;
    &lt;td&gt;3104770.00&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;12&lt;/td&gt;
    &lt;td&gt;30 mm thick Bituminous Concrete with 5.2% Bitumen (3.75 m wide)&lt;/td&gt;
    &lt;td&gt;-&lt;/td&gt;
    &lt;td&gt;1774500.00&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;13&lt;/td&gt;
    &lt;td&gt;50 mm thick DBM (4.5% Bitumen)&lt;/td&gt;
    &lt;td&gt;-&lt;/td&gt;
    &lt;td&gt;2487600.00&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;14&lt;/td&gt;
    &lt;td&gt;75 mm thick BM (4.5% Bitumen)&lt;/td&gt;
    &lt;td&gt;-&lt;/td&gt;
    &lt;td&gt;3672890.00&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;15&lt;/td&gt;
    &lt;td&gt;Construction of Cement Concrete Drain (One side in M-20 grade cement concrete)&lt;/td&gt;
    &lt;td&gt;-&lt;/td&gt;
    &lt;td&gt;5358000.00&lt;/td&gt;
&lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;Pipe Culverts Stage-I Rates 2022-23 (With NP3 Pipes)&lt;/h1&gt;
&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot;&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Sr No&lt;/th&gt;
            &lt;th&gt;Details&lt;/th&gt;
            &lt;th&gt;Culverts 7.5 m width (Rs.)&lt;/th&gt;
            &lt;th&gt;Culverts 10.0 m width (Rs.)&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;1&lt;/td&gt;
            &lt;td&gt;800 mm Single row&lt;/td&gt;
            &lt;td&gt;397000&lt;/td&gt;
            &lt;td&gt;415900&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;2&lt;/td&gt;
            &lt;td&gt;800 mm Double row&lt;/td&gt;
            &lt;td&gt;510400&lt;/td&gt;
            &lt;td&gt;558200&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;3&lt;/td&gt;
            &lt;td&gt;800 mm Three row&lt;/td&gt;
            &lt;td&gt;629000&lt;/td&gt;
            &lt;td&gt;706600&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;4&lt;/td&gt;
            &lt;td&gt;900 mm Single row&lt;/td&gt;
            &lt;td&gt;424600&lt;/td&gt;
            &lt;td&gt;451300&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;5&lt;/td&gt;
            &lt;td&gt;900 mm Double row&lt;/td&gt;
            &lt;td&gt;560700&lt;/td&gt;
            &lt;td&gt;611900&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;6&lt;/td&gt;
            &lt;td&gt;900 mm Three row&lt;/td&gt;
            &lt;td&gt;693000&lt;/td&gt;
            &lt;td&gt;769800&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;7&lt;/td&gt;
            &lt;td&gt;1000 mm Single row&lt;/td&gt;
            &lt;td&gt;468500&lt;/td&gt;
            &lt;td&gt;496300&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;8&lt;/td&gt;
            &lt;td&gt;1000 mm Double row&lt;/td&gt;
            &lt;td&gt;615400&lt;/td&gt;
            &lt;td&gt;672200&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;9&lt;/td&gt;
            &lt;td&gt;1000 mm Three row&lt;/td&gt;
            &lt;td&gt;710700&lt;/td&gt;
            &lt;td&gt;847500&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;10&lt;/td&gt;
            &lt;td&gt;1200 mm Single row&lt;/td&gt;
            &lt;td&gt;564200&lt;/td&gt;
            &lt;td&gt;600600&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;11&lt;/td&gt;
            &lt;td&gt;1200 mm Double row&lt;/td&gt;
            &lt;td&gt;734600&lt;/td&gt;
            &lt;td&gt;823100&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;12&lt;/td&gt;
            &lt;td&gt;1200 mm Three row&lt;/td&gt;
            &lt;td&gt;936000&lt;/td&gt;
            &lt;td&gt;1045500&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;

&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot;&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Sr No&lt;/th&gt;
            &lt;th&gt;Item of Work&lt;/th&gt;
            &lt;th&gt;Rates Proposed 2022-23 (Rs.)&lt;/th&gt;
            &lt;th&gt;Unit&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td rowspan=&quot;2&quot;&gt;1&lt;/td&gt;
            &lt;td&gt;Causeway / Hard Passage (7.50 m wide) - Without vents&lt;/td&gt;
            &lt;td&gt;28700&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;Causeway / Hard Passage (7.50 m wide) - With Pipes&lt;/td&gt;
            &lt;td&gt;26300&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;

&lt;br&gt;

&lt;h3&gt;Notes&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Length of Causeway / Hard Passage should be measured as length of A.H.F.L (Afflux High Flood Level).&lt;/li&gt;
    &lt;li&gt;Add 15% for B.C soil area.&lt;/li&gt;
    &lt;li&gt;Work out proportional rate for causeway / hard passages having width more or less than 7.50 meter.&lt;/li&gt;
&lt;/ul&gt;

&lt;br&gt;

&lt;h3&gt;Minor Bridges or Slab Drains Stage-I Rates 2022-23 (7.50 m wide &amp; upto 5.00 m height)&lt;/h3&gt;

&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot;&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Sr No&lt;/th&gt;
            &lt;th&gt;Details&lt;/th&gt;
            &lt;th&gt;Rate (Rs.)&lt;/th&gt;
            &lt;th&gt;Unit&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;(i)&lt;/td&gt;
            &lt;td&gt;With open foundation&lt;/td&gt;
            &lt;td&gt;54617&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;(ii)&lt;/td&gt;
            &lt;td&gt;With raft foundation&lt;/td&gt;
            &lt;td&gt;63857&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;(iii)&lt;/td&gt;
            &lt;td&gt;With Box cells&lt;/td&gt;
            &lt;td&gt;500125&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;(iv)&lt;/td&gt;
            &lt;td&gt;Non Submersible approaches&lt;/td&gt;
            &lt;td&gt;26180&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;(v)&lt;/td&gt;
            &lt;td&gt;Submersible approaches&lt;/td&gt;
            &lt;td&gt;45629&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;

&lt;br&gt;

&lt;h3&gt;Additional Notes&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Work out proportionate rates for bridges wider or lesser than 7.50 meter and above 5.00 meter height.&lt;/li&gt;
    &lt;li&gt;For major bridges and special/state art bridges, actual detailed estimate to be prepared.&lt;/li&gt;
&lt;/ul&gt;

&lt;br&gt;

&lt;h3&gt;General Notes&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Ghat area / Sugarcane area – Add 15%&lt;/li&gt;
    &lt;li&gt;Tribal area – Add 10%&lt;/li&gt;
    &lt;li&gt;Approved Action Plan (Non-Tribal) – Add 10%&lt;/li&gt;
    &lt;li&gt;Gadchiroli District – Extra 20%&lt;/li&gt;
    &lt;li&gt;Corporation area – Add 5%&lt;/li&gt;
    &lt;li&gt;Average lead of 30 km is considered for road work.&lt;/li&gt;
    &lt;li&gt;Bitumen lead is considered from refinery to plant site.&lt;/li&gt;
&lt;/ul&gt;



&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot;&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Sr No&lt;/th&gt;
            &lt;th&gt;Item of Work&lt;/th&gt;
            &lt;th&gt;Rates Proposed 2022-23 (Rs.)&lt;/th&gt;
            &lt;th&gt;Unit&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td rowspan=&quot;2&quot;&gt;1&lt;/td&gt;
            &lt;td&gt;&lt;b&gt;Causeway / Hard Passage (7.50 m wide)&lt;/b&gt; - Without vents&lt;/td&gt;
            &lt;td&gt;28700&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;b&gt;Causeway / Hard Passage (7.50 m wide)&lt;/b&gt; - With Pipes&lt;/td&gt;
            &lt;td&gt;26300&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;

&lt;br&gt;

&lt;h3&gt;Notes&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Length of Causeway / Hard Passage should be measured as length of A.H.F.L (Afflux High Flood Level).&lt;/li&gt;
    &lt;li&gt;Add 15% for B.C. soil area.&lt;/li&gt;
    &lt;li&gt;Work out proportional rate for causeway / hard passages having width more or less than 7.50 meters.&lt;/li&gt;
&lt;/ul&gt;

&lt;br&gt;

&lt;h3&gt;Minor Bridges or Slab Drains Stage-I Rates 2022-23 (7.50 m wide &amp; upto 5.00 m height)&lt;/h3&gt;

&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot;&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Sr No&lt;/th&gt;
            &lt;th&gt;Details&lt;/th&gt;
            &lt;th&gt;Rate (Rs.)&lt;/th&gt;
            &lt;th&gt;Unit&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;(i)&lt;/td&gt;
            &lt;td&gt;With open foundation&lt;/td&gt;
            &lt;td&gt;54617.00&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;(ii)&lt;/td&gt;
            &lt;td&gt;With raft foundation&lt;/td&gt;
            &lt;td&gt;63857.00&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;(iii)&lt;/td&gt;
            &lt;td&gt;With Box cells&lt;/td&gt;
            &lt;td&gt;500125.00&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;(iv)&lt;/td&gt;
            &lt;td&gt;Non-Submersible approaches&lt;/td&gt;
            &lt;td&gt;26180.00&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;(v)&lt;/td&gt;
            &lt;td&gt;Submersible approaches&lt;/td&gt;
            &lt;td&gt;45629.00&lt;/td&gt;
            &lt;td&gt;Per Meter&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;

&lt;br&gt;

&lt;h3&gt;Additional Notes&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Work out proportionate rates for bridges wider or lesser in width than 7.50 meter and above 5.00 meter height.&lt;/li&gt;
    &lt;li&gt;For major bridges and special / State-of-Art bridges, actual detailed estimate should be prepared.&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;Buildings – Rates Proposed (Stage-I, 2022-23)&lt;/h1&gt;

&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot;&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Sr No&lt;/th&gt;
            &lt;th&gt;Item of Work&lt;/th&gt;
            &lt;th&gt;Rate Proposed 2022-23 (Rs.)&lt;/th&gt;
            &lt;th&gt;Unit&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;

        &lt;tr&gt;
            &lt;td rowspan=&quot;2&quot;&gt;1&lt;/td&gt;
            &lt;td&gt;I.T.I Buildings, Administrative Buildings and other similar structures – Ground Floor&lt;/td&gt;
            &lt;td&gt;30000.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;I.T.I Buildings, Administrative Buildings and other similar structures – First Floor&lt;/td&gt;
            &lt;td&gt;24450.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td rowspan=&quot;2&quot;&gt;2&lt;/td&gt;
            &lt;td&gt;Hostel, Courts, Urban Hospital and other similar Buildings – Ground Floor&lt;/td&gt;
            &lt;td&gt;30100.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;Hostel, Courts, Urban Hospital and other similar Buildings – First Floor&lt;/td&gt;
            &lt;td&gt;25250.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td&gt;3&lt;/td&gt;
            &lt;td&gt;Rural Hospital and other similar Buildings – Ground Floor&lt;/td&gt;
            &lt;td&gt;24700.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td rowspan=&quot;2&quot;&gt;4&lt;/td&gt;
            &lt;td&gt;Residential Quarters (Type III, IV &amp; V) – Ground Floor&lt;/td&gt;
            &lt;td&gt;25000.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;Residential Quarters (Type III, IV &amp; V) – First Floor&lt;/td&gt;
            &lt;td&gt;21200.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td rowspan=&quot;2&quot;&gt;5&lt;/td&gt;
            &lt;td&gt;Residential Quarters (Type II, IV &amp; V) – Ground Floor&lt;/td&gt;
            &lt;td&gt;28800.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;Residential Quarters (Type II, IV &amp; V) – First Floor&lt;/td&gt;
            &lt;td&gt;23450.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;

        &lt;tr&gt;
            &lt;td rowspan=&quot;2&quot;&gt;6&lt;/td&gt;
            &lt;td&gt;Bungalows of Hon’ble Judges and other similar Buildings – Ground Floor&lt;/td&gt;
            &lt;td&gt;29000.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;Bungalows of Hon’ble Judges and other similar Buildings – First Floor&lt;/td&gt;
            &lt;td&gt;24000.00&lt;/td&gt;
            &lt;td&gt;Per Sqm&lt;/td&gt;
        &lt;/tr&gt;

    &lt;/tbody&gt;
&lt;/table&gt;


&lt;h3&gt;Notes&lt;/h3&gt;

&lt;ol&gt;
    &lt;li&gt;
        The above rates shall be increased by 1% for every floor above first floor.
    &lt;/li&gt;

    &lt;li&gt;
        The above rates are for preparing Stage-I estimates for Buildings and these rates shall not be used for any type of valuation purpose.
    &lt;/li&gt;

    &lt;li&gt;
        The above rates are basic rates and these shall be increased by percentage specified in the State Schedule of Rates for tribal area, inaccessible area, Municipal Council and Corporation area, Factories, Prison and Naxalite area for Gadchiroli District.
    &lt;/li&gt;

    &lt;li&gt;
        The provision like contingencies, Electrification other than Internal &amp; External, External Water supply and sanitary, Garden and Landscaping, Green Building and other provisions appropriate percentage shall be separately added.
    &lt;/li&gt;

    &lt;li&gt;
        The above rates are for R.C.C. framed structure and the rates shall be increased or decreased suitably depending on actual site conditions where raft foundation or load bearing structure is provided, and reasons for same shall be furnished.
    &lt;/li&gt;
&lt;/ol&gt;






&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/02/block-estimate-rates.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-2739210140402010442</guid><pubDate>Sun, 15 Feb 2026 09:10:00 +0000</pubDate><atom:updated>2026-04-07T00:20:21.389+05:30</atom:updated><title>Carriageway Width Calculator</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;IRC Lane Requirement Calculator - Improved&lt;/title&gt;

    &lt;!-- MathJax --&gt;
    &lt;script type=&quot;text/x-mathjax-config&quot;&gt;
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [[&#39;$&#39;,&#39;$&#39;], [&#39;\\(&#39;,&#39;\\)&#39;]],
          displayMath: [[&#39;$$&#39;,&#39;$$&#39;], [&#39;\\[&#39;,&#39;\\]&#39;]],
          processEscapes: true
        },
        &quot;HTML-CSS&quot;: { linebreaks: { automatic: true } }
      });
    &lt;/script&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;&gt;&lt;/script&gt;

    &lt;!-- jsPDF &amp; html2canvas --&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js&quot;&gt;&lt;/script&gt;

    &lt;style&gt;
        :root { --primary: #004aad; --bg: #f1f5f9; }
        body { font-family: &#39;Segoe UI&#39;, Arial, sans-serif; background: var(--bg); padding: 20px; color: #1e293b; margin: 0; }
        .container { max-width: 960px; margin: auto; background: white; padding: 35px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
        h2 { color: var(--primary); border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; margin-top: 0; }
        .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin: 25px 0; }
        .input-group { display: flex; flex-direction: column; }
        label { font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; color: #475569; }
        input, select { padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; transition: 0.2s; }
        input:focus, select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(0,74,173,0.1); }
        button { padding: 16px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: 0.3s; margin: 10px 10px 10px 0; }
        button:hover { background: #003a8c; transform: translateY(-1px); }
        #exportBtn { background: #059669; }
        #exportBtn:hover { background: #047857; }
        .report-area { margin-top: 35px; padding: 30px; border: 1px solid #e2e8f0; border-radius: 12px; background: #ffffff; display: none; }
        .formula-box { background: #f8fafc; padding: 20px; border-left: 6px solid var(--primary); margin: 20px 0; border-radius: 8px; font-size: 1.1rem; border: 1px solid #e2e8f0; }
        .road-viz { height: 80px; background: #334155; margin: 30px 0; border-radius: 10px; position: relative; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; border: 4px solid #1e293b; font-size: 1.3rem; }
        .lane-markings { position: absolute; width: 100%; height: 2px; border-top: 2px dashed rgba(255,255,255,0.4); top: 50%; }
        .highlight { color: #059669; font-weight: 800; font-size: 1.2rem; }
        .note { font-size: 0.9rem; color: #64748b; background: #f0f9ff; padding: 12px; border-radius: 6px; margin-top: 20px; }
        .actions { margin-bottom: 20px; }
        .report-title { font-size: 1.6rem; color: var(--primary); margin-bottom: 20px; text-align: center; font-weight: 600; }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;container&quot;&gt;
    &lt;h2&gt;IRC Lane Requirement Calculator&lt;/h2&gt;
    &lt;p style=&quot;color:#64748b;&quot;&gt;Based on IRC:64-1990, Indo-HCM principles &amp; field studies (mixed traffic, rural/inter-urban highways).&lt;/p&gt;

    &lt;div class=&quot;grid&quot;&gt;
        &lt;div class=&quot;input-group&quot;&gt;&lt;label&gt;Name of the Road / Section&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;roadName&quot; placeholder=&quot;e.g. NH-48 Pune–Nashik&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;&lt;label&gt;Current AADT (P) [veh/day]&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;P&quot; value=&quot;6500&quot; min=&quot;100&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;&lt;label&gt;Growth Rate (r) [%]&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;r&quot; value=&quot;7.5&quot; step=&quot;0.1&quot; min=&quot;0&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;&lt;label&gt;Design Life (n) [years]&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;n&quot; value=&quot;15&quot; min=&quot;5&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;&lt;label&gt;K-Factor (Peak Hour %)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;K&quot; value=&quot;0.09&quot; step=&quot;0.01&quot; min=&quot;0.05&quot; max=&quot;0.15&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;&lt;label&gt;D-Factor (Directional Split)&lt;/label&gt;&lt;input type=&quot;number&quot; id=&quot;D&quot; value=&quot;0.60&quot; step=&quot;0.05&quot; min=&quot;0.5&quot; max=&quot;0.75&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;
            &lt;label&gt;Terrain &amp; Base Capacity per Lane as per IRC:64-1990 Table 2&lt;/label&gt;
            &lt;select id=&quot;terrain&quot;&gt;
                &lt;option value=&quot;2000&quot;&gt;Plain - Curvature (Degrres/KM) Low (0 - 50)&lt;/option&gt;
              	&lt;option value=&quot;1900&quot;&gt;Plain - Curvature (Degrres/KM) High (&gt;51)&lt;/option&gt;
                &lt;option value=&quot;1800&quot;&gt;Rolling - Curvature (Degrres/KM) Low (0 - 100)&lt;/option&gt;
              	&lt;option value=&quot;1700&quot;&gt;Rolling - Curvature (Degrres/KM) high (&gt;101)&lt;/option&gt;
              	&lt;option value=&quot;1600&quot;&gt;Hilly - Curvature (Degrres/KM) Low (0 - 200)&lt;/option&gt;
              	&lt;option value=&quot;1400&quot;&gt;Hilly - Curvature (Degrres/KM) high (&gt;201)&lt;/option&gt;
            &lt;/select&gt;
        &lt;/div&gt;
        &lt;div class=&quot;input-group&quot;&gt;
            &lt;label&gt;V/C Ratio (Target LOS)&lt;/label&gt;
            &lt;select id=&quot;vc&quot;&gt;
                &lt;option value=&quot;0.5&quot;&gt;LOS B (High Comfort - 0.5)&lt;/option&gt;
                &lt;option value=&quot;0.7&quot; selected&gt;LOS C (Standard - 1.4 x 0.5)&lt;/option&gt;
                &lt;option value=&quot;0.9&quot;&gt;LOS D (Congested - 0.9, 8-10% of AADT)&lt;/option&gt;
            &lt;/select&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;button onclick=&quot;generateReport()&quot;&gt;Analyze Design Requirements&lt;/button&gt;

    &lt;div id=&quot;reportArea&quot; class=&quot;report-area&quot;&gt;
        &lt;div class=&quot;actions&quot;&gt;
            &lt;button id=&quot;exportBtn&quot; onclick=&quot;exportToPDF()&quot; style=&quot;display:none;&quot;&gt;Export Report as PDF&lt;/button&gt;
        &lt;/div&gt;
        &lt;div id=&quot;mathContent&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
  
  &lt;div class=&quot;container&quot; style=&quot;max-width:1000px; margin:auto; line-height:1.6; font-family:Arial, sans-serif;&quot;&gt;

&lt;h1 style=&quot;text-align:center; color:#1e3a8a;&quot;&gt;
IRC Lane Requirement Calculator – Technical Explanation
&lt;/h1&gt;

&lt;p style=&quot;text-align:center; color:#555;&quot;&gt;
Based on IRC:64-1990, Indo-HCM &amp; Mixed Traffic Flow Principles
&lt;/p&gt;

&lt;hr&gt;

&lt;h2&gt;1. Introduction&lt;/h2&gt;
&lt;p&gt;
This tool is a professional highway design utility developed to estimate the 
&lt;b&gt;required number of traffic lanes&lt;/b&gt; for a road corridor based on projected traffic demand.
&lt;/p&gt;

&lt;p&gt;
It integrates principles from:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;IRC:64-1990&lt;/b&gt; – Capacity of Roads in Rural Areas&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Indo-HCM&lt;/b&gt; – Mixed traffic capacity analysis&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Traffic engineering fundamentals&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;2. Objective of the Tool&lt;/h2&gt;

&lt;p&gt;
To determine the &lt;b&gt;optimum number of lanes&lt;/b&gt; required to safely and efficiently carry future traffic,
while maintaining a desired &lt;b&gt;Level of Service (LOS)&lt;/b&gt;.
&lt;/p&gt;

---

&lt;h2&gt;3. Input Parameters Explained&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;AADT (P):&lt;/b&gt; Average Annual Daily Traffic (vehicles/day)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Growth Rate (r):&lt;/b&gt; Expected annual traffic growth (%)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Design Life (n):&lt;/b&gt; Design period (years)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;K-Factor:&lt;/b&gt; Ratio of peak hour traffic to AADT&lt;/li&gt;
&lt;li&gt;&lt;b&gt;D-Factor:&lt;/b&gt; Directional distribution of traffic&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Terrain:&lt;/b&gt; Influences base capacity per lane&lt;/li&gt;
&lt;li&gt;&lt;b&gt;V/C Ratio:&lt;/b&gt; Desired congestion level (LOS)&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;4. Step-by-Step Design Methodology&lt;/h2&gt;

&lt;h3&gt;Step 1: Traffic Projection&lt;/h3&gt;

&lt;p&gt;
Future traffic is estimated using compound growth:
&lt;/p&gt;

&lt;p style=&quot;background:#f4f6f7; padding:10px; border-left:4px solid #2563eb;&quot;&gt;
A = P × (1 + r)&lt;sup&gt;n&lt;/sup&gt;
&lt;/p&gt;

&lt;p&gt;
This represents the &lt;b&gt;design traffic at the end of design life&lt;/b&gt;.
&lt;/p&gt;

---

&lt;h3&gt;Step 2: Conversion to PCU&lt;/h3&gt;

&lt;p&gt;
Due to heterogeneous traffic conditions in India, traffic is converted into 
&lt;b&gt;Passenger Car Units (PCU)&lt;/b&gt;.
&lt;/p&gt;

&lt;p style=&quot;background:#f4f6f7; padding:10px; border-left:4px solid #16a34a;&quot;&gt;
A&lt;sub&gt;pcu&lt;/sub&gt; = A × PCU Factor
&lt;/p&gt;

&lt;p&gt;
A typical composite value of &lt;b&gt;2.5&lt;/b&gt; is used for mixed traffic.
&lt;/p&gt;

---

&lt;h3&gt;Step 3: Design Hourly Volume (DHV)&lt;/h3&gt;

&lt;p&gt;
Traffic design is based on peak hour conditions:
&lt;/p&gt;

&lt;p style=&quot;background:#f4f6f7; padding:10px; border-left:4px solid #f59e0b;&quot;&gt;
DHV = A&lt;sub&gt;pcu&lt;/sub&gt; × K × D
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;K = Peak hour proportion&lt;/li&gt;
&lt;li&gt;D = Directional split&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
This gives &lt;b&gt;one-direction peak flow (PCU/hr)&lt;/b&gt;.
&lt;/p&gt;

---

&lt;h3&gt;Step 4: Lane Requirement Calculation&lt;/h3&gt;

&lt;p&gt;
The number of lanes is calculated based on capacity:
&lt;/p&gt;

&lt;p style=&quot;background:#f4f6f7; padding:10px; border-left:4px solid #dc2626;&quot;&gt;
N = DHV / (Base Capacity × V/C)
&lt;/p&gt;

&lt;p&gt;
Where:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Base Capacity:&lt;/b&gt; Depends on terrain and curvature&lt;/li&gt;
&lt;li&gt;&lt;b&gt;V/C Ratio:&lt;/b&gt; Desired service level&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;5. Level of Service (LOS)&lt;/h2&gt;

&lt;p&gt;
The &lt;b&gt;V/C ratio&lt;/b&gt; defines traffic conditions:
&lt;/p&gt;

&lt;table border=&quot;1&quot; cellpadding=&quot;6&quot; style=&quot;border-collapse:collapse; width:100%;&quot;&gt;
&lt;tr&gt;&lt;th&gt;LOS&lt;/th&gt;&lt;th&gt;V/C Ratio&lt;/th&gt;&lt;th&gt;Condition&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;B&lt;/td&gt;&lt;td&gt;0.5&lt;/td&gt;&lt;td&gt;Free flow (high comfort)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;C&lt;/td&gt;&lt;td&gt;0.7&lt;/td&gt;&lt;td&gt;Stable flow (design standard)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;D&lt;/td&gt;&lt;td&gt;0.9&lt;/td&gt;&lt;td&gt;Near capacity (congested)&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

---

&lt;h2&gt;6. Terrain-Based Capacity&lt;/h2&gt;

&lt;p&gt;
Base capacity varies with terrain due to speed, curvature, and gradient effects:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Plain Terrain:&lt;/b&gt; Highest capacity (~2000 PCU/hr/lane)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Rolling Terrain:&lt;/b&gt; Moderate capacity&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Hilly Terrain:&lt;/b&gt; Reduced capacity due to constraints&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;7. Output Interpretation&lt;/h2&gt;

&lt;p&gt;
The tool provides:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Future Traffic (veh/day &amp; PCU/day)&lt;/li&gt;
&lt;li&gt;Design Hourly Volume (PCU/hr)&lt;/li&gt;
&lt;li&gt;Calculated Lane Requirement&lt;/li&gt;
&lt;li&gt;Adopted Number of Lanes&lt;/li&gt;
&lt;li&gt;Equivalent Carriageway Width&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Final lane adoption ensures:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimum of 1 lane&lt;/li&gt;
&lt;li&gt;Practical rounding (typically even lanes for divided highways)&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;8. Engineering Assumptions&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Mixed traffic conditions (Indian scenario)&lt;/li&gt;
&lt;li&gt;No major bottlenecks or intersections&lt;/li&gt;
&lt;li&gt;Adequate shoulder and drainage provisions&lt;/li&gt;
&lt;li&gt;Uniform traffic distribution&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;9. Applications&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;National &amp; State Highway Design&lt;/li&gt;
&lt;li&gt;Feasibility Studies (DPR)&lt;/li&gt;
&lt;li&gt;Traffic Impact Assessment&lt;/li&gt;
&lt;li&gt;Road Widening Projects&lt;/li&gt;
&lt;li&gt;PPP / EPC Project Planning&lt;/li&gt;
&lt;/ul&gt;

---

&lt;h2&gt;10. Limitations&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Uses generalized PCU factor (not composition-based)&lt;/li&gt;
&lt;li&gt;Does not consider signalized intersections&lt;/li&gt;
&lt;li&gt;Assumes uninterrupted flow&lt;/li&gt;
&lt;li&gt;Requires engineering judgment for final adoption&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;script&gt;
function generateReport() {
    // ── Inputs ────────────────────────────────────────────────
    const roadName = document.getElementById(&#39;roadName&#39;).value.trim() || &quot;Unnamed Road / Section&quot;;
    const P = parseFloat(document.getElementById(&#39;P&#39;).value) || 0;
    const r = (parseFloat(document.getElementById(&#39;r&#39;).value) || 0) / 100;
    const n = parseFloat(document.getElementById(&#39;n&#39;).value) || 15;
    const K = parseFloat(document.getElementById(&#39;K&#39;).value) || 0.09;
    const D = parseFloat(document.getElementById(&#39;D&#39;).value) || 0.60;
    const vc = parseFloat(document.getElementById(&#39;vc&#39;).value) || 0.7;
    const base_cap = parseFloat(document.getElementById(&#39;terrain&#39;).value) || 2000;

    if (P &lt; 100 || n &lt; 5 || K &lt;= 0 || D &lt; 0.5 || D &gt; 0.75 || vc &lt;= 0) {
        alert(&quot;Please check inputs:\n• AADT ≥ 100\n• Design life ≥ 5 years\n• Valid K, D, V/C ranges&quot;);
        return;
    }

    // ── Calculations ──────────────────────────────────────────
    const A_future = P * Math.pow(1 + r, n);
    const pcuf = 2.5;
    const A_pcu = A_future * pcuf;
    const DHV = A_pcu * K * D;
    const service_cap = base_cap * vc;
    const N_req = DHV / service_cap;
    const N_adopt = Math.max(1, N_req);

    // ── Formatting ────────────────────────────────────────────
    const fmt = (num, dec = 0) =&gt; num.toLocaleString(&#39;en-IN&#39;, {minimumFractionDigits: dec, maximumFractionDigits: dec});

    // ── Build Report ──────────────────────────────────────────
    document.getElementById(&#39;reportArea&#39;).style.display = &#39;block&#39;;
    document.getElementById(&#39;exportBtn&#39;).style.display = &#39;inline-block&#39;;

    document.getElementById(&#39;mathContent&#39;).innerHTML = `
        &lt;div class=&quot;report-title&quot;&gt;Lane Requirement Report for &lt;br&gt;&lt;small&gt;${roadName}&lt;/small&gt;&lt;/div&gt;

        &lt;p&gt;&lt;strong&gt;Step 1: Future Traffic Growth&lt;/strong&gt;&lt;/p&gt;
        &lt;div class=&quot;formula-box&quot;&gt;
            $$ A = P \\times (1 + r)^n $$
            $$ A = ${fmt(P)} \\times (1 + ${r.toFixed(3)})^{${n}} = \\textbf{${fmt(A_future, 0)}} \\text{ veh/day} $$
        &lt;/div&gt;

        &lt;p&gt;&lt;strong&gt;Step 2: Conversion to PCU (mixed traffic)&lt;/strong&gt;&lt;/p&gt;
        &lt;div class=&quot;formula-box&quot;&gt;
            $$ A_{\\text{pcu}} = A \\times \\text{PCU factor} $$
            $$ A_{\\text{pcu}} = ${fmt(A_future, 0)} \\times ${pcuf} = \\textbf{${fmt(A_pcu, 0)}} \\text{ PCU/day} $$
        &lt;/div&gt;

        &lt;p&gt;&lt;strong&gt;Step 3: Directional Design Hourly Volume (DHV)&lt;/strong&gt;&lt;/p&gt;
        &lt;div class=&quot;formula-box&quot;&gt;
            $$ \\text{DHV} = A_{\\text{pcu}} \\times K \\times D $$
            $$ \\text{DHV} = ${fmt(A_pcu, 0)} \\times ${K.toFixed(2)} \\times ${D.toFixed(2)} = \\textbf{${fmt(DHV, 0)}} \\text{ PCU/hr (one direction)} $$
        &lt;/div&gt;

        &lt;p&gt;&lt;strong&gt;Step 4: Required Number of Lanes&lt;/strong&gt;&lt;/p&gt;
        &lt;div class=&quot;formula-box&quot;&gt;
            $$ N = \\frac{\\text{DHV}}{\\text{Base capacity per lane} \\times (V/C)} $$
            $$ N = \\frac{${fmt(DHV, 0)}}{${base_cap} \\times ${vc}} = \\textbf{${N_req.toFixed(2)}} \\text{ lanes (calculated)}$$
            &lt;p style=&quot;margin-top:12px;&quot;&gt;Adopted (min. 1 lanes): &lt;span class=&quot;highlight&quot;&gt;${N_adopt}&lt;/span&gt; lanes&lt;/p&gt;
        &lt;/div&gt;

        &lt;div class=&quot;road-viz&quot;&gt;
            &lt;div class=&quot;lane-markings&quot;&gt;&lt;/div&gt;
            ADOPTED: ${N_adopt} LANE${N_adopt &gt; 1 ? &#39;S&#39; : &#39;&#39;} (${(N_adopt * 3.5).toFixed(1)} m carriageway)
        &lt;/div&gt;

        &lt;div class=&quot;note&quot;&gt;
            &lt;strong&gt;Basis &amp; Notes:&lt;/strong&gt; Base capacity per lane ≈ ${base_cap} PCU/hr/dir (approx. value from field studies/Indo-HCM for mixed traffic; IRC:64-1990 gives tentative daily service volumes, e.g., 35,000–40,000 PCU/day for 4-lane plain). PCU factor 2.5 is typical composite — adjust if detailed composition available. Assumes divided carriageway, good shoulders, no major side friction.
        &lt;/div&gt;
    `;

    // Re-render MathJax
    if (typeof MathJax !== &#39;undefined&#39; &amp;&amp; MathJax.Hub) {
        MathJax.Hub.Queue([&quot;Typeset&quot;, MathJax.Hub, &quot;mathContent&quot;]);
    }
}

async function exportToPDF() {
    const { jsPDF } = window.jspdf;
    const reportElement = document.getElementById(&#39;mathContent&#39;);
    if (!reportElement || reportElement.innerHTML.trim() === &#39;&#39;) {
        alert(&quot;Please generate the report first!&quot;);
        return;
    }

    const exportBtn = document.getElementById(&#39;exportBtn&#39;);
    exportBtn.textContent = &quot;Generating PDF...&quot;;
    exportBtn.disabled = true;

    try {
        const canvas = await html2canvas(reportElement, {
            scale: 2,
            useCORS: true,
            logging: false,
            allowTaint: true,
            letterRendering: true,
            backgroundColor: &#39;#ffffff&#39;
        });

        const imgData = canvas.toDataURL(&#39;image/png&#39;);
        const pdf = new jsPDF({ orientation: &#39;portrait&#39;, unit: &#39;mm&#39;, format: &#39;a4&#39; });

        const pageWidth = pdf.internal.pageSize.getWidth();
        const pageHeight = pdf.internal.pageSize.getHeight();
        const margin = 10;
        const imgWidth = pageWidth - 2 * margin;
        const imgHeight = (canvas.height * imgWidth) / canvas.width;

        let heightLeft = imgHeight;
        let position = margin;

        pdf.addImage(imgData, &#39;PNG&#39;, margin, position, imgWidth, imgHeight);
        heightLeft -= pageHeight - 2 * margin;

        while (heightLeft &gt;= 0) {
            pdf.addPage();
            position = margin - (imgHeight - heightLeft);
            pdf.addImage(imgData, &#39;PNG&#39;, margin, position, imgWidth, imgHeight);
            heightLeft -= pageHeight - 2 * margin;
        }

        const safeName = document.getElementById(&#39;roadName&#39;).value.trim().replace(/[^a-zA-Z0-9-]/g, &#39;_&#39;) || &#39;Report&#39;;
        pdf.save(`IRC_Lane_Requirement_${safeName}_${new Date().toISOString().slice(0,10)}.pdf`);

    } catch (error) {
        console.error(&quot;PDF generation failed:&quot;, error);
        alert(&quot;PDF export failed. Check console or try again.&quot;);
    } finally {
        exportBtn.textContent = &quot;Export Report as PDF&quot;;
        exportBtn.disabled = false;
    }
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/02/carriageway-width-calculator.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-2184669022205603892</guid><pubDate>Tue, 03 Feb 2026 02:34:06 +0000</pubDate><atom:updated>2026-03-05T13:16:51.800+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">PWD Working</category><category domain="http://www.blogger.com/atom/ns#">Tender</category><title>EPC Project Plan and Profile Approving Procedure</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;Government Procedure for Approval of Plan &amp; Profile (P&amp;P) in EPC Road Projects&lt;/title&gt;
    
    &lt;script src=&quot;https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js&quot;&gt;&lt;/script&gt;
    &lt;script&gt;
        mermaid.initialize({
            startOnLoad: true,
            theme: &#39;base&#39;
        });
    &lt;/script&gt;

    &lt;style&gt;
        body {
            background-color: #f5f5f5;
            margin: 0;
            padding: 20px;
            font-family: &quot;Times New Roman&quot;, Times, serif;
            color: #000;
            line-height: 1.5;
        }

        .container {
            max-width: 900px;
            margin: 0 auto 60px auto;
            background: white;
            padding: 30px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        h1, h2 {
            color: #111;
        }

        .note {
            background-color: #fff9e6;
            border-left: 5px solid #ffb300;
            padding: 16px 20px;
            margin: 20px 0;
            font-style: italic;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }

        th, td {
            border: 1px solid #ccc;
            padding: 10px;
            text-align: left;
        }

        th {
            background: #f0f0f0;
            font-weight: bold;
        }

        hr {
            border: 0;
            border-top: 1px solid #aaa;
            margin: 30px 0;
        }

        /* === LETTER STYLING === */
        .page {
            background: white;
            max-width: 210mm;
            width: 100%;
            min-height: 297mm;
            margin: 20px auto 60px auto;
            padding: 5mm 5mm;           /* reduced side padding for better screen fit */
            box-sizing: border-box;
            box-shadow: 0 4px 16px rgba(0,0,0,0.12);
        }

        .header {
            text-align: center;
            border-bottom: 2px solid #000;
            padding-bottom: 15px;
            margin-bottom: 25px;
        }

        .header h2 {
            margin: 0;
            font-size: 22px;
            text-transform: uppercase;
        }

        .header p {
            margin: 4px 0;
            font-size: 14px;
            font-weight: bold;
        }

        .refblock {
            margin: 25px 0;
            display: flex;
            justify-content: space-between;
            font-size: 14px;
            font-weight: 600;
        }

        .to-block {
            margin: 30px 0;
            line-height: 1.6;
            font-size: 15px;
        }

        .subject {
            margin: 35px 0 25px 0;
            font-weight: bold;
            text-decoration: underline;
            font-size: 16px;
        }

        .content {
            font-size: 15px;
            text-align: justify;
        }

        .content p {
            margin-bottom: 18px;
        }

        .footer {
            margin-top: 50px;
            font-size: 13px;
            clear: both;
        }

        .signature {
            margin-top: 60px;
            float: right;
            width: 280px;
            text-align: left;
        }

        .signature p {
            margin: 6px 0;
            font-size: 15px;
        }

        /* Responsive adjustment for small screens */
        @media screen and (max-width: 1000px) {
            .page {
                padding: 18mm 12mm;
                margin: 10px auto;
            }
        }

        /* PRINT – exact A4 behavior */
        @media print {
            body {
                background: white;
                margin: 0;
                padding: 0;
            }
            .container, hr {
                display: none !important;
            }
            .page {
                width: 210mm !important;
                height: 297mm !important;
                min-height: unset !important;
                margin: 0 !important;
                padding: 20mm 18mm !important;   /* classic office margins for print */
                box-shadow: none !important;
            }
            @page {
                size: A4;
                margin: 0;
            }
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

    &lt;!-- Explanatory Part --&gt;
    &lt;div class=&quot;container&quot;&gt;
        &lt;h1&gt;Governmental Procedure for Approval of Plan &amp; Profile (P&amp;P)&lt;br&gt;in EPC Road / Highway Projects (India)&lt;/h1&gt;
        &lt;p&gt;This document explains the standard governmental procedure followed in India for approval of &lt;strong&gt;Plan &amp; Profile (P&amp;P) drawings&lt;/strong&gt; under Engineering, Procurement and Construction (EPC) mode road projects as per MoRTH, NHAI and State PWD practices.&lt;/p&gt;

        &lt;hr&gt;

        &lt;h2&gt;1. Governing Standards &amp; References&lt;/h2&gt;
        &lt;ul&gt;
            &lt;li&gt;MoRTH Specifications for Road &amp; Bridge Works&lt;/li&gt;
            &lt;li&gt;IRC:73 – Geometric Design Standards for Highways&lt;/li&gt;
            &lt;li&gt;IRC:SP:23 – Manual of Specifications &amp; Standards (MSS)&lt;/li&gt;
            &lt;li&gt;IRC:SP:84 – Manual for Road Tunnels / Special Corridors&lt;/li&gt;
            &lt;li&gt;EPC Contract Conditions (Schedule A, B &amp; C)&lt;/li&gt;
        &lt;/ul&gt;

        &lt;h2&gt;2. Preliminary Plan &amp; Profile Before Tender&lt;/h2&gt;
        &lt;p&gt;Prepared by Authority or its Consultant and included in tender documents:&lt;/p&gt;
        &lt;ul&gt;
            &lt;li&gt;Preliminary alignment&lt;/li&gt;
            &lt;li&gt;Topographic survey&lt;/li&gt;
            &lt;li&gt;Longitudinal profile&lt;/li&gt;
            &lt;li&gt;Typical cross-sections&lt;/li&gt;
            &lt;li&gt;Junction layouts&lt;/li&gt;
            &lt;li&gt;Drainage concept&lt;/li&gt;
            &lt;li&gt;Land acquisition plans&lt;/li&gt;
        &lt;/ul&gt;
        &lt;div class=&quot;note&quot;&gt;
            These drawings act as &lt;strong&gt;Reference Alignment&lt;/strong&gt; only. Final responsibility lies with EPC Contractor.
        &lt;/div&gt;

        &lt;h2&gt;3. Award of EPC Contract&lt;/h2&gt;
        &lt;p&gt;After award, EPC Contractor becomes fully responsible for:&lt;/p&gt;
        &lt;ul&gt;
            &lt;li&gt;Detailed survey&lt;/li&gt;
            &lt;li&gt;Geometric design&lt;/li&gt;
            &lt;li&gt;Pavement design&lt;/li&gt;
            &lt;li&gt;Structural design&lt;/li&gt;
            &lt;li&gt;Final Plan &amp; Profile&lt;/li&gt;
        &lt;/ul&gt;

        &lt;!-- Add sections 4–15 here if needed --&gt;

        &lt;h2&gt;16. Approval Workflow&lt;/h2&gt;
        &lt;div class=&quot;mermaid&quot;&gt;
flowchart TD
    A[Start - EPC Contract Awarded]
    B[Authority Provides Reference Alignment and Preliminary P&amp;P]
    C[Contractor Conducts Detailed Topographic and Geotechnical Survey]
    D[Contractor Performs Geometric Design as per IRC and MoRTH]
    E[Prepare Draft Plan and Profile]
    F[Submit Draft P&amp;P with Design Report to IE or AE]

    G1{Technical Scrutiny by Design Consultant}
    G2{Technical Scrutiny by Proof Consultant}
    G3{Technical Scrutiny by Safety Consultant}

    G[IE Recommends P&amp;P to Authority]
    H[Authority Recommends P&amp;P for Approval]
    I[IE Issues Comments or Observations]
    J[Contractor Revises Design]

    K{Authority Review}
    L[Authority Issues Approval]

    M[Seek Special Approval with Justification]
    N{Competent Authority Decision}

    O[Issue Approved for Construction AFC Plan and Profile]
    P[Construction as per AFC Drawings]
    Q{Any Further Change Required}
    R[End]

    A --&gt; B
    B --&gt; C
    C --&gt; D
    D --&gt; E
    E --&gt; F

    F --&gt; G1
    F --&gt; G2
    F --&gt; G3

    G1 --&gt;|Compliant| G
    G2 --&gt;|Compliant| G
    G3 --&gt;|Compliant| G

    G --&gt; H
    G --&gt;|Non Compliant| I

    I --&gt; J
    J --&gt; F

    H --&gt; K

    K --&gt;|Approved| L
    K --&gt;|Modification Required| I
    K --&gt;|Major Deviation from Reference Alignment| M

    M --&gt; N
    N --&gt;|Approved| L
    N --&gt;|Rejected| I

    L --&gt; O
    O --&gt; P
    P --&gt; Q

    Q --&gt;|Yes| I
    Q --&gt;|No| R
&lt;/div&gt;
    &lt;/div&gt;

    &lt;!-- Formal Letter --&gt;
    &lt;div class=&quot;page&quot;&gt;
        &lt;div class=&quot;header&quot;&gt;
            &lt;h2&gt;Government of ____________&lt;/h2&gt;
            &lt;p&gt;Office of the Chief Engineer / Competent Authority&lt;/p&gt;
            &lt;p&gt;[Department Name]&lt;/p&gt;
            &lt;p&gt;[Office Address]&lt;/p&gt;
        &lt;/div&gt;

        &lt;div class=&quot;refblock&quot;&gt;
            &lt;div&gt;Ref No.: ______________________&lt;/div&gt;
            &lt;div&gt;Date: ______________________&lt;/div&gt;
        &lt;/div&gt;

        &lt;div class=&quot;to-block&quot;&gt;
            To,&lt;br&gt;
            The Project Director&lt;br&gt;
            [Name of EPC Contractor]&lt;br&gt;
            [Company Name]&lt;br&gt;
            [Address]
        &lt;/div&gt;

        &lt;div class=&quot;subject&quot;&gt;
            Subject: Approval of Plan &amp; Profile (P&amp;P) Drawings – Approved for Construction (AFC)
        &lt;/div&gt;

        &lt;div class=&quot;content&quot;&gt;
            &lt;p&gt;
                Project: &lt;strong&gt;[Name of Project]&lt;/strong&gt;&lt;br&gt;
                Contract Package No.: &lt;strong&gt;[Package No.]&lt;/strong&gt;&lt;br&gt;
                Agreement No.: &lt;strong&gt;[Agreement No.]&lt;/strong&gt;&lt;br&gt;
                Chainage: &lt;strong&gt;From Km ______ to Km ______&lt;/strong&gt;
            &lt;/p&gt;
            &lt;p&gt;This is with reference to your submission of Draft Plan &amp; Profile (P&amp;P) drawings for the above-mentioned project vide your letter no. __________ dated __________ and subsequent revisions based on observations of the Independent Engineer / Authority Engineer.&lt;/p&gt;
            &lt;p&gt;The Plan &amp; Profile drawings have been examined by the Independent Engineer / Authority Engineer and found to be in conformity with the provisions of the EPC Agreement, Manual of Specifications &amp; Standards, relevant IRC Codes and MoRTH Specifications.&lt;/p&gt;
            &lt;p&gt;Accordingly, the &lt;strong&gt;Plan &amp; Profile (P&amp;P) drawings as per enclosed list are hereby approved for construction (AFC)&lt;/strong&gt; for execution of works under the subject project.&lt;/p&gt;
            &lt;p&gt;You are requested to ensure that construction is carried out strictly in accordance with the approved drawings and contract provisions. Any deviation from the approved alignment, profile or geometry shall require prior approval of the Competent Authority.&lt;/p&gt;
            &lt;p&gt;This approval does not relieve the EPC Contractor of his responsibilities for correctness of design, safety, stability and performance of the works as per the contract.&lt;/p&gt;
        &lt;/div&gt;

        &lt;div class=&quot;footer&quot;&gt;
            &lt;p&gt;&lt;strong&gt;Enclosures:&lt;/strong&gt;&lt;/p&gt;
            &lt;ol&gt;
                &lt;li&gt;List of Approved Plan &amp; Profile Drawings (AFC)&lt;/li&gt;
                &lt;li&gt;Independent Engineer / Authority Engineer Recommendation Letter&lt;/li&gt;
            &lt;/ol&gt;
        &lt;/div&gt;

        &lt;div class=&quot;signature&quot;&gt;
            &lt;p&gt;Yours faithfully,&lt;/p&gt;
            &lt;p&gt;For and on behalf of Competent Authority&lt;/p&gt;
            &lt;br&gt;&lt;br&gt;&lt;br&gt;
            &lt;p&gt;(Signature) _______________________&lt;/p&gt;
            &lt;p&gt;Name: ___________________________&lt;/p&gt;
            &lt;p&gt;Designation: _____________________&lt;/p&gt;
            &lt;p&gt;Organization: ____________________&lt;/p&gt;
            &lt;p&gt;Seal:&lt;/p&gt;
        &lt;/div&gt;
    &lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/02/epc-project-plan-and-profile-approving.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-1258919420549694458</guid><pubDate>Wed, 28 Jan 2026 09:38:00 +0000</pubDate><atom:updated>2026-03-20T13:10:02.924+05:30</atom:updated><title>Project progress monitoring tool</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;Construction PM - Multi-Project Suite (INR)&lt;/title&gt;
    &lt;script src=&quot;https://cdn.jsdelivr.net/npm/chart.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.25/jspdf.plugin.autotable.min.js&quot;&gt;&lt;/script&gt;

&lt;button class=&quot;btn&quot; style=&quot;background:#2980b9; color:white;&quot; onclick=&quot;downloadPDF()&quot;&gt;Download PDF&lt;/button&gt;
    &lt;style&gt;
        body { font-family: &#39;Segoe UI&#39;, Tahoma, Geneva, Verdana, sans-serif; margin: 20px; background-color: #f0f2f5; color: #333; }
        .container { max-width: 1350px; margin: auto; background: white; padding: 5px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
        .nav-bar { display: flex; justify-content: space-between; align-items: center; background: #2c3e50; color: white; padding: 5px 5px; border-radius: 8px; margin-bottom: 25px; }
        .flex-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
        .card { flex: 1; border: 1px solid #ddd; padding: 5px; border-radius: 8px; background: #fff; min-width: 300px; }
        label { font-size: 11px; font-weight: bold; text-transform: uppercase; color: #7f8c8d; display: block; margin-top: 8px; }
        input, select { width: 100%; padding: 5px; margin-top: 4px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
        table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 13px; }
        th, td { padding: 2px; border-bottom: 1px solid #eee; text-align: left; }
        th { background: #f8f9fa; color: #2c3e50; }
        .btn { padding: 2px 2px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; transition: 0.2s; }
        .btn-add { background: #27ae60; color: white; }
        .btn-action { background: #3498db; color: white; }
        .status-behind { color: #e74c3c; font-weight: bold; }
        .status-ahead { color: #27ae60; font-weight: bold; }
        .milestone-badge { background: #f39c12; color: white; padding: 3px 10px; border-radius: 15px; font-size: 11px; margin-right: 5px; display: inline-block; margin-top: 5px; }
        .chart-box { height: 350px; margin-top: 30px; position: relative; }
        #projectSelector { background: #34495e; color: white; border: 1px solid #5d6d7e; padding: 2px; font-size: 16px; min-width: 250px; }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;nav-bar&quot;&gt;
        &lt;div style=&quot;display: flex; align-items: center; gap: 15px;&quot;&gt;
            &lt;span style=&quot;font-weight: bold;&quot;&gt;SELECT PROJECT:&lt;/span&gt;
            &lt;select id=&quot;projectSelector&quot; onchange=&quot;switchProject()&quot;&gt;&lt;/select&gt;
            &lt;button class=&quot;btn btn-add&quot; onclick=&quot;createNewProject()&quot;&gt;+ New Project&lt;/button&gt;
        &lt;/div&gt;
        &lt;div&gt;
            &lt;button class=&quot;btn&quot; style=&quot;background:#5d6d7e; color:white;&quot; onclick=&quot;exportJSON()&quot;&gt;Export JSON&lt;/button&gt;
            &lt;button class=&quot;btn&quot; style=&quot;background:#5d6d7e; color:white;&quot; onclick=&quot;document.getElementById(&#39;fileIn&#39;).click()&quot;&gt;Import JSON&lt;/button&gt;
            &lt;input type=&quot;file&quot; id=&quot;fileIn&quot; style=&quot;display:none&quot; onchange=&quot;importJSON(event)&quot;&gt;
        &lt;/div&gt;
    &lt;/div&gt;

&lt;div class=&quot;card&quot; style=&quot;flex: 2;&quot;&gt;
    &lt;div style=&quot;margin-bottom: 15px;&quot;&gt;
        &lt;label&gt;Current Project Name&lt;/label&gt;
        &lt;input type=&quot;text&quot; id=&quot;projNameInput&quot; onblur=&quot;renameProject()&quot;&gt;
    &lt;/div&gt;

    &lt;div style=&quot;margin-bottom: 15px;&quot;&gt;
        &lt;label&gt;Total Budget (₹)&lt;/label&gt;
        &lt;input type=&quot;number&quot; id=&quot;projBudgetInput&quot; onchange=&quot;updateProjectMeta()&quot;&gt;
    &lt;/div&gt;

    &lt;div style=&quot;margin-bottom: 5px;&quot;&gt;
        &lt;label&gt;Global Milestones (% of Budget)&lt;/label&gt;
        &lt;div style=&quot;display: flex; gap: 10px; align-items: center; flex-wrap: wrap;&quot;&gt;
            &lt;input type=&quot;number&quot; id=&quot;newMilestonePercent&quot; placeholder=&quot;e.g. 50&quot; style=&quot;width: 100px;&quot;&gt;
            &lt;button class=&quot;btn btn-action&quot; onclick=&quot;addGlobalMilestone()&quot;&gt;Add Milestone&lt;/button&gt;
        &lt;/div&gt;
        &lt;div id=&quot;milestoneList&quot; style=&quot;margin-top: 10px;&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

        &lt;div class=&quot;card&quot; style=&quot;flex: 1; background: #ecf0f1; border: none;&quot;&gt;
            &lt;h4 style=&quot;margin:0; color:#2c3e50;&quot;&gt;Summary: &lt;span id=&quot;summaryName&quot;&gt;-&lt;/span&gt;&lt;/h4&gt;
            &lt;p style=&quot;font-size: 24px; font-weight: bold; margin: 10px 0;&quot;&gt;₹&lt;span id=&quot;totalSpent&quot;&gt;0&lt;/span&gt; / &lt;span id=&quot;overallPercent&quot;&gt;0&lt;/span&gt;%&lt;/p&gt;
            &lt;button class=&quot;btn&quot; style=&quot;background:#c0392b; color:white; font-size:10px;&quot; onclick=&quot;deleteCurrentProject()&quot;&gt;Delete This Project&lt;/button&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class=&quot;card&quot;&gt;
    &lt;h4 style=&quot;margin-top:0&quot;&gt;Activity Management&lt;/h4&gt;
    &lt;div style=&quot;display: flex; flex-direction: column; gap: 12px;&quot;&gt;
        
        &lt;div&gt;
            &lt;label&gt;Activity Type&lt;/label&gt;
            &lt;select id=&quot;actName&quot;&gt;&lt;/select&gt;
        &lt;/div&gt;
        
        &lt;div style=&quot;display: flex; gap: 10px;&quot;&gt;
            &lt;div style=&quot;flex:1;&quot;&gt;
                &lt;label&gt;Start Date&lt;/label&gt;
                &lt;input type=&quot;date&quot; id=&quot;actStart&quot;&gt;
            &lt;/div&gt;
            &lt;div style=&quot;flex:1;&quot;&gt;
                &lt;label&gt;End Date&lt;/label&gt;
                &lt;input type=&quot;date&quot; id=&quot;actEnd&quot;&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        &lt;div&gt;
            &lt;label&gt;Total Qty&lt;/label&gt;
            &lt;input type=&quot;number&quot; id=&quot;actTotalQty&quot;&gt;
        &lt;/div&gt;

        &lt;div&gt;
            &lt;label&gt;Achieved Qty&lt;/label&gt;
            &lt;input type=&quot;number&quot; id=&quot;actAchievedQty&quot;&gt;
        &lt;/div&gt;

        &lt;div&gt;
            &lt;label&gt;Unit Cost (₹)&lt;/label&gt;
            &lt;input type=&quot;number&quot; id=&quot;actUnitCost&quot;&gt;
        &lt;/div&gt;

        &lt;div style=&quot;margin-top: 10px;&quot;&gt;
            &lt;button id=&quot;mainActionBtn&quot; class=&quot;btn btn-add&quot; style=&quot;width:100%; padding: 12px;&quot; onclick=&quot;saveActivity()&quot;&gt;Save Entry&lt;/button&gt;
        &lt;/div&gt;

    &lt;/div&gt;
&lt;/div&gt;

    &lt;table&gt;
        &lt;thead&gt;
            &lt;tr&gt;
                &lt;th&gt;Activity&lt;/th&gt;
                &lt;th&gt;Timeline&lt;/th&gt;
                &lt;th&gt;Total Qty&lt;/th&gt;
                &lt;th&gt;Achieved Qty&lt;/th&gt;
                &lt;th&gt;Exp. vs Act. %&lt;/th&gt;
                &lt;th&gt;Cost Achieved&lt;/th&gt;
                &lt;th&gt;Status&lt;/th&gt;
                &lt;th&gt;Actions&lt;/th&gt;
            &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody id=&quot;tableBody&quot;&gt;&lt;/tbody&gt;
    &lt;/table&gt;

    &lt;div class=&quot;chart-box&quot;&gt;
        &lt;canvas id=&quot;progressChart&quot;&gt;&lt;/canvas&gt;
    &lt;/div&gt;

&lt;script&gt;
    let library = { currentProjectId: null, projects: {} };
    let editIdx = -1;
    let chart = null;
    // New Grouped Structure
const activityGroups = {
    &quot;Roadwork - Layers&quot;: [&quot;Site Clearance&quot;, &quot;Excavation for Road&quot;, &quot;Emabankment/Earthwork/Natural Subgrade&quot;, &quot;GSB&quot;, &quot;Sub-Base Course&quot;, &quot;Wet Mix Macadam&quot;, &quot;Grading I&quot;, &quot;Grading II&quot;, &quot;Dry lean Concrete (DLC)&quot;, &quot;Pavement Quality Concrete (PQC)&quot;, &quot;Dense Bituminous Macadam (DBM)&quot;, &quot;Bituminous Concrete (BC)&quot;, &quot;Excavation for Road&quot;,&quot;Side Shoulders&quot;],
  
    &quot;Structures - Culverts &amp; Walls&quot;: [&quot;Slab Culvert&quot;, &quot;Hume Pipe Culvert&quot;, &quot;Box Culvert&quot;, &quot;PCC retaining wall&quot;, &quot;RCC retaining wall&quot;, &quot;Toe wall&quot;, &quot;Approaches Crossing&quot;],
  
    &quot;Bridges (Minor &amp; Major)&quot;: [&quot;Minor Bridge foundation&quot;, &quot;Minor Bridge Sub-structure&quot;, &quot;Minor Bridge Super-structure&quot;, &quot;Major Bridge foundation&quot;, &quot;Major Bridge Sub-structure&quot;, &quot;Major Bridge Super-structure&quot;, &quot;Bridge Approaches&quot;, &quot;Miscellaneous Bridge works&quot;, &quot;Bridge Bearing&quot;, &quot;Crash Barrier&quot;,&quot;Rigid apron&quot;,&quot;Flexible apron&quot;,&quot;Wing wall&quot;,&quot;Wearing Course&quot;],
  
    &quot;Junctions &amp; Safety&quot;: [&quot;Traffic Signs&quot;,&quot;Major Junctions&quot;, &quot;Minor Junctions&quot;, &quot;Road signs, Markings&quot;, &quot;KM stones&quot;, &quot;Metal Beam Crash barrier&quot;, &quot;Hand Railing for built-up section&quot;, &quot;Solar Blinker&quot;, &quot;Solar Street Light&quot;, &quot;High mast&quot;, &quot;Overhead Gantry Mounted Signs&quot;],
  
    &quot;Drainage &amp; Utilities&quot;: [&quot;Excavation For Gutter&quot;, &quot;Cover Slab&quot;, &quot;Utility Duct Across the road&quot;, &quot;Approach Crossing&quot;],
  
    &quot;Ancillary&quot;: [&quot;Bus Shelter&quot;, &quot;Bus Bay&quot;, &quot;Toilet Block&quot;, &quot;Median Kerb&quot;, &quot;Kerb With Channel&quot;, &quot;Road side Plantation&quot;, &quot;Blinkers&quot;, &quot;Cateye&quot;],
  
    &quot;General Components&quot;: [&quot;Reinforcement&quot;, &quot;Formwork&quot;, &quot;Finishing&quot;, &quot;Colouring&quot;],
  
  &quot;Repair works&quot;: [&quot;Repair culvert&quot;],
  
  &quot;River Training&quot;: [&quot;Guide Bunds&quot;, &quot;Spurs&quot;, &quot;Groynes&quot;, &quot;Marginal embankment (dyke or levee)&quot;]
};

    document.addEventListener(&#39;DOMContentLoaded&#39;, () =&gt; {
        const saved = localStorage.getItem(&#39;construction_library&#39;);
        if (saved) { try { library = JSON.parse(saved); } catch (e) { console.error(e); } }
        if (!library.currentProjectId || Object.keys(library.projects).length === 0) {
            createNewProject(&quot;Initial Project&quot;);
        } else {
            refreshProjectList();
            updateUI();
        }
    });

    function createNewProject(name) {
        const id = &#39;proj_&#39; + Date.now();
        const projectName = name || prompt(&quot;Enter Project Name:&quot;);
        if (!projectName) return;
        library.projects[id] = { id, name: projectName, budget: 100000, activities: [], milestones: [], reachedMilestones: [] };
        library.currentProjectId = id;
        saveToStorage();
        refreshProjectList();
    }

    function switchProject() {
        library.currentProjectId = document.getElementById(&#39;projectSelector&#39;).value;
        saveToStorage();
    }

    function deleteCurrentProject() {
        if (Object.keys(library.projects).length &lt;= 1) return alert(&quot;Cannot delete the only project.&quot;);
        if (confirm(&quot;Delete this entire project?&quot;)) {
            delete library.projects[library.currentProjectId];
            library.currentProjectId = Object.keys(library.projects)[0];
            saveToStorage();
            refreshProjectList();
        }
    }

    function updateProjectMeta() {
        const p = library.projects[library.currentProjectId];
        if(!p) return;
        p.budget = parseFloat(document.getElementById(&#39;projBudgetInput&#39;).value) || 0;
        saveToStorage();
    }

    function renameProject() {
        const p = library.projects[library.currentProjectId];
        if(!p) return;
        const newName = document.getElementById(&#39;projNameInput&#39;).value;
        if(newName &amp;&amp; newName !== p.name) {
            p.name = newName;
            saveToStorage();
            refreshProjectList();
        }
    }

    function refreshProjectList() {
        const sel = document.getElementById(&#39;projectSelector&#39;);
        sel.innerHTML = Object.values(library.projects).map(p =&gt; 
            `&lt;option value=&quot;${p.id}&quot; ${p.id === library.currentProjectId ? &#39;selected&#39; : &#39;&#39;}&gt;${p.name}&lt;/option&gt;`
        ).join(&#39;&#39;);
    }

    function addGlobalMilestone() {
        const p = library.projects[library.currentProjectId];
        const val = parseFloat(document.getElementById(&#39;newMilestonePercent&#39;).value);
        if(val &amp;&amp; !p.milestones.includes(val)) {
            p.milestones.push(val);
            p.milestones.sort((a,b) =&gt; a-b);
            document.getElementById(&#39;newMilestonePercent&#39;).value = &#39;&#39;;
            saveToStorage();
        }
    }

    function saveActivity() {
        const p = library.projects[library.currentProjectId];
        const act = {
            name: document.getElementById(&#39;actName&#39;).value,
            start: document.getElementById(&#39;actStart&#39;).value,
            end: document.getElementById(&#39;actEnd&#39;).value,
            totalQty: parseFloat(document.getElementById(&#39;actTotalQty&#39;).value) || 0,
            achievedQty: parseFloat(document.getElementById(&#39;actAchievedQty&#39;).value) || 0,
            unitCost: parseFloat(document.getElementById(&#39;actUnitCost&#39;).value) || 0
        };
        if(editIdx &gt; -1) { p.activities[editIdx] = act; editIdx = -1; document.getElementById(&#39;mainActionBtn&#39;).innerText = &quot;Save Entry&quot;; }
        else { p.activities.push(act); }
        checkMilestones(p);
        saveToStorage();
        clearForm();
    }

    function checkMilestones(p) {
    // Calculate current total spent based on latest activity data
    const currentTotalSpent = p.activities.reduce((sum, a) =&gt; sum + (a.achievedQty * a.unitCost), 0);
    
    // Clear and re-populate based on CURRENT budget and CURRENT costs
    p.reachedMilestones = [];
    (p.milestones || []).forEach(m =&gt; {
        const targetAmount = (m / 100) * p.budget;
        if (currentTotalSpent &gt;= targetAmount) {
            p.reachedMilestones.push(m);
        }
    });
}

function updateUI() {
    const p = library.projects[library.currentProjectId];
    if (!p) return;

    // 1. CRITICAL FIX: Re-calculate milestone achievements before rendering
    checkMilestones(p);

    // 2. Update Header Info
    document.getElementById(&#39;projNameInput&#39;).value = p.name;
    document.getElementById(&#39;projBudgetInput&#39;).value = p.budget;
    document.getElementById(&#39;summaryName&#39;).innerText = p.name;

    // 3. Generate Dropdown (only if empty to prevent losing user selection)
    const actSelect = document.getElementById(&#39;actName&#39;);
    if (actSelect.innerHTML === &quot;&quot;) {
        let groupHtml = &quot;&quot;;
        for (const [group, items] of Object.entries(activityGroups)) {
            groupHtml += `&lt;optgroup label=&quot;${group}&quot;&gt;`;
            items.forEach(item =&gt; {
                groupHtml += `&lt;option value=&quot;${item}&quot;&gt;${item}&lt;/option&gt;`;
            });
            groupHtml += `&lt;/optgroup&gt;`;
        }
        actSelect.innerHTML = groupHtml;
    }

    // 4. Render Milestone Badges with correct colors
    document.getElementById(&#39;milestoneList&#39;).innerHTML = (p.milestones || []).map(m =&gt; {
        const isReached = p.reachedMilestones.includes(m);
        return `&lt;span class=&quot;milestone-badge&quot; style=&quot;background:${isReached ? &#39;#27ae60&#39; : &#39;#f39c12&#39;}&quot;&gt;
            ${m}%
        &lt;/span&gt;`;
    }).join(&#39;&#39;);

    // 5. Build Table Rows
    let totalCost = 0;
    let html = &#39;&#39;;
    p.activities.forEach((a, i) =&gt; {
        const stats = calcStats(a);
        const cost = a.achievedQty * a.unitCost;
        totalCost += cost;
        html += `&lt;tr&gt;
            &lt;td&gt;&lt;b&gt;${a.name}&lt;/b&gt;&lt;/td&gt;
            &lt;td&gt;${a.start}&lt;br&gt;${a.end}&lt;/td&gt;
            &lt;td&gt;${a.totalQty.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
            &lt;td&gt;${a.achievedQty.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
            &lt;td&gt;&lt;small&gt;Exp: ${stats.exp}%&lt;/small&gt;&lt;br&gt;&lt;b&gt;Act: ${stats.act}%&lt;/b&gt;&lt;/td&gt;
            &lt;td&gt;₹${cost.toLocaleString(&#39;en-IN&#39;)}&lt;/td&gt;
            &lt;td class=&quot;${stats.css}&quot;&gt;${stats.status}&lt;/td&gt;
            &lt;td&gt;
                &lt;button class=&quot;btn&quot; style=&quot;padding:2px 8px; background:#3498db; color:white; font-size:11px;&quot; onclick=&quot;editAct(${i})&quot;&gt;Edit&lt;/button&gt;
                &lt;button class=&quot;btn&quot; style=&quot;padding:2px 8px; background:#e74c3c; color:white; font-size:11px;&quot; onclick=&quot;deleteAct(${i})&quot;&gt;Del&lt;/button&gt;
            &lt;/td&gt;
        &lt;/tr&gt;`;
    });

    // 6. Final Summary Update
    document.getElementById(&#39;tableBody&#39;).innerHTML = html;
    document.getElementById(&#39;totalSpent&#39;).innerText = totalCost.toLocaleString(&#39;en-IN&#39;);
    document.getElementById(&#39;overallPercent&#39;).innerText = p.budget &gt; 0 ? ((totalCost / p.budget) * 100).toFixed(1) : 0;
    
    renderChart(p);
}

    function calcStats(a) {
        const start = new Date(a.start), end = new Date(a.end), today = new Date();
        const totalDays = (end - start) / 86400000;
        const passedDays = (today - start) / 86400000;
        let exp = totalDays &gt; 0 ? Math.min(100, Math.max(0, (passedDays / totalDays) * 100)) : 0;
        let act = a.totalQty &gt; 0 ? (a.achievedQty / a.totalQty) * 100 : 0;
        let status = &quot;On Track&quot;, css = &quot;status-ahead&quot;;
        if (act &lt; exp - 5) { status = &quot;Behind&quot;; css = &quot;status-behind&quot;; }
        return { exp: exp.toFixed(1), act: act.toFixed(1), status, css };
    }

    function editAct(i) {
        editIdx = i;
        const a = library.projects[library.currentProjectId].activities[i];
        [&#39;actName&#39;, &#39;actStart&#39;, &#39;actEnd&#39;, &#39;actTotalQty&#39;, &#39;actAchievedQty&#39;, &#39;actUnitCost&#39;].forEach(id =&gt; {
            document.getElementById(id).value = a[id.replace(&#39;act&#39;, &#39;&#39;).charAt(0).toLowerCase() + id.replace(&#39;act&#39;, &#39;&#39;).slice(1)];
        });
        document.getElementById(&#39;mainActionBtn&#39;).innerText = &quot;Update Entry&quot;;
        window.scrollTo(0,0);
    }

    function deleteAct(i) { if(confirm(&quot;Remove this activity?&quot;)) { library.projects[library.currentProjectId].activities.splice(i, 1); saveToStorage(); } }

    function renderChart(p) {
    const ctx = document.getElementById(&#39;progressChart&#39;).getContext(&#39;2d&#39;);
    if (chart) chart.destroy();
    
    chart = new Chart(ctx, {
        type: &#39;bar&#39;,
        data: {
            labels: p.activities.map(a =&gt; a.name),
            datasets: [
                {
                    label: &#39;Expected %&#39;,
                    data: p.activities.map(a =&gt; calcStats(a).exp),
                    backgroundColor: &#39;#bdc3c7&#39;,
                    // This makes the background bar slightly wider
                    barPercentage: 0.8,
                    categoryPercentage: 1,
                    grouped: false // Key property: prevents side-by-side positioning
                },
                {
                    label: &#39;Actual %&#39;,
                    data: p.activities.map(a =&gt; calcStats(a).act),
                    backgroundColor: &#39;#3498db&#39;,
                    // This makes the foreground bar slightly thinner for a &quot;thermometer&quot; effect
                    barPercentage: 0.5,
                    categoryPercentage: 1,
                    grouped: false // Key property: prevents side-by-side positioning
                }
            ]
        },
        options: {
            responsive: true,
            maintainAspectRatio: false,
            scales: {
                y: {
                    beginAtZero: true,
                    max: 100
                }
            }
        }
    });
}
    function clearForm() { [&#39;actStart&#39;, &#39;actEnd&#39;, &#39;actTotalQty&#39;, &#39;actAchievedQty&#39;, &#39;actUnitCost&#39;].forEach(id =&gt; document.getElementById(id).value = &#39;&#39;); }
    function saveToStorage() { localStorage.setItem(&#39;construction_library&#39;, JSON.stringify(library)); updateUI(); }
  
  
function exportJSON() {
    // 1. Generate the current date (YYYY-MM-DD)
    const date = new Date().toISOString().split(&#39;T&#39;)[0];
    const fileName = `Project progress backup dated ${date}.json`;

    // 2. Create the data blob
    const blob = new Blob([JSON.stringify(library, null, 2)], {type: &#39;application/json&#39;});
    
    // 3. Create the hidden link and trigger download
    const url = URL.createObjectURL(blob);
    const a = document.createElement(&#39;a&#39;);
    a.href = url;
    a.download = fileName; // Applies your custom &quot;Project progress backup&quot; name
    
    // 4. Performance &amp; Browser Support cleanup
    document.body.appendChild(a); 
    a.click();
    document.body.removeChild(a);
    URL.revokeObjectURL(url);
}
  
  
    function importJSON(e) {
    const reader = new FileReader();
    reader.onload = (event) =&gt; {
        try {
            const importedData = JSON.parse(event.target.result);
            
            // Merge the projects objects
            library.projects = {
                ...library.projects,
                ...importedData.projects
            };

            // Update the current project ID to the first one in the new list
            const newKeys = Object.keys(importedData.projects);
            if (newKeys.length &gt; 0) {
                library.currentProjectId = newKeys[0];
            }

            refreshProjectList();
            saveToStorage();
            alert(&quot;Projects merged successfully!&quot;);
        } catch (err) {
            alert(&quot;Invalid JSON file. Please ensure it is a valid backup.&quot;);
        }
    };
    if (e.target.files[0]) reader.readAsText(e.target.files[0]);
}
  
  async function downloadPDF() {
    const { jsPDF } = window.jspdf;
    const doc = new jsPDF(&#39;p&#39;, &#39;mm&#39;, &#39;a4&#39;);
    const p = library.projects[library.currentProjectId];
    const totalSpent = document.getElementById(&#39;totalSpent&#39;).innerText;
    const overallPct = document.getElementById(&#39;overallPercent&#39;).innerText;

    // Title &amp; Header
    doc.setFontSize(20);
    doc.setTextColor(44, 62, 80);
    doc.text(&quot;Construction Progress Report&quot;, 14, 20);
    
    doc.setFontSize(12);
    doc.setTextColor(100);
    doc.text(`Project: ${p.name}`, 14, 30);
    doc.text(`Date: ${new Date().toLocaleDateString(&#39;en-IN&#39;)}`, 14, 37);

    // Summary Box
    doc.setDrawColor(200);
    doc.setFillColor(248, 249, 250);
    doc.rect(14, 45, 180, 25, &#39;F&#39;);
    doc.setTextColor(0);
    doc.text(`Total Budget: INR ${p.budget.toLocaleString(&#39;en-IN&#39;)}`, 20, 55);
    doc.text(`Total Spent: INR ${totalSpent} (${overallPct}%)`, 20, 62);

    // Activity Table
    const tableData = p.activities.map(a =&gt; {
        const stats = calcStats(a);
        return [
            a.name,
            `${a.start} to ${a.end}`,
            a.totalQty.toLocaleString(&#39;en-IN&#39;),
            a.achievedQty.toLocaleString(&#39;en-IN&#39;),
            `${stats.act}%`,
            `INR ${(a.achievedQty * a.unitCost).toLocaleString(&#39;en-IN&#39;)}`,
            stats.status
        ];
    });

    doc.autoTable({
        startY: 80,
        head: [[&#39;Activity&#39;, &#39;Timeline&#39;, &#39;Total Qty&#39;, &#39;Achieved&#39;, &#39;Progress&#39;, &#39;Cost&#39;, &#39;Status&#39;]],
        body: tableData,
        theme: &#39;striped&#39;,
        headStyles: { fillColor: [44, 62, 80] },
        styles: { fontSize: 8 }
    });

    // Add Chart Image
    const canvas = document.getElementById(&#39;progressChart&#39;);
    if (canvas) {
        const chartImg = canvas.toDataURL(&#39;image/png&#39;, 1.0);
        const finalY = doc.lastAutoTable.finalY + 10;
        if (finalY &lt; 200) { // Ensure it fits on page
            doc.addImage(chartImg, &#39;PNG&#39;, 14, finalY, 180, 80);
        }
    }

    doc.save(`${p.name}_Report.pdf`);
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/01/project-progress-monitoring-tool.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-8511640587022805298</guid><pubDate>Mon, 26 Jan 2026 17:37:16 +0000</pubDate><atom:updated>2026-01-26T23:07:40.607+05:30</atom:updated><title>Levelling Rise and Fall Method</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;&gt;
&lt;title&gt;Rise &amp; Fall Method Calculator&lt;/title&gt;

&lt;style&gt;
body{font-family:Arial;background:#f4f6f8;}
h2{text-align:center;}
table{width:100%;border-collapse:collapse;background:white;}
th,td{border:1px solid #444;padding:6px;text-align:center;}
th{background:#2c3e50;color:white;}
input{width:90px;padding:5px;text-align:center;}
.info input{width:220px;}
button{padding:8px 14px;margin:5px;background:#3498db;color:white;border:none;cursor:pointer;}
button:hover{background:#2980b9;}
.cp{background:#ffeaa7;font-weight:bold;}
.summary{background:#fff;padding:10px;margin-top:10px;}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;h2&gt;Rise &amp; Fall Method Levelling Calculator&lt;/h2&gt;

&lt;div class=&quot;info&quot; style=&quot;text-align:center&quot;&gt;
Project Name &lt;input id=&quot;project&quot;&gt;
Location &lt;input id=&quot;location&quot;&gt;
&lt;br&gt;&lt;br&gt;
Starting BM RL &lt;input type=&quot;number&quot; id=&quot;bm&quot; value=&quot;100&quot; step=&quot;0.001&quot;&gt;
&lt;/div&gt;

&lt;br&gt;

&lt;div style=&quot;text-align:center&quot;&gt;
&lt;button onclick=&quot;saveData()&quot;&gt;💾 Save&lt;/button&gt;
&lt;button onclick=&quot;exportJSON()&quot;&gt;⬇ Export JSON&lt;/button&gt;
&lt;button onclick=&quot;document.getElementById(&#39;importFile&#39;).click()&quot;&gt;⬆ Import JSON&lt;/button&gt;
&lt;input type=&quot;file&quot; id=&quot;importFile&quot; hidden onchange=&quot;importJSON(event)&quot;&gt;
&lt;/div&gt;

&lt;br&gt;

&lt;table id=&quot;levelTable&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;No&lt;/th&gt;&lt;th&gt;B.S&lt;/th&gt;&lt;th&gt;I.S&lt;/th&gt;&lt;th&gt;F.S&lt;/th&gt;
&lt;th&gt;Rise&lt;/th&gt;&lt;th&gt;Fall&lt;/th&gt;&lt;th&gt;R.L&lt;/th&gt;&lt;th&gt;Remarks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;

&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;input&gt;&lt;/td&gt;&lt;td&gt;&lt;input&gt;&lt;/td&gt;&lt;td&gt;&lt;input&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;div style=&quot;text-align:center&quot;&gt;
&lt;button onclick=&quot;addRow()&quot;&gt;Add Row&lt;/button&gt;
&lt;button onclick=&quot;calculate()&quot;&gt;Calculate&lt;/button&gt;
&lt;button onclick=&quot;clearAll()&quot;&gt;Clear&lt;/button&gt;
&lt;/div&gt;

&lt;div class=&quot;summary&quot;&gt;
&lt;p id=&quot;sumBS&quot;&gt;&lt;/p&gt;
&lt;p id=&quot;sumFS&quot;&gt;&lt;/p&gt;
&lt;p id=&quot;sumRise&quot;&gt;&lt;/p&gt;
&lt;p id=&quot;sumFall&quot;&gt;&lt;/p&gt;
&lt;p id=&quot;check&quot;&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;script&gt;
function addRow(){
let t=document.getElementById(&quot;levelTable&quot;);
let r=t.insertRow();
r.innerHTML=`&lt;td&gt;${t.rows.length-1}&lt;/td&gt;
&lt;td&gt;&lt;input&gt;&lt;/td&gt;&lt;td&gt;&lt;input&gt;&lt;/td&gt;&lt;td&gt;&lt;input&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;`;
}

// ---------------- CALCULATE ----------------
function calculate(){
let bm=parseFloat(document.getElementById(&quot;bm&quot;).value);
let rows=document.querySelectorAll(&quot;#levelTable tbody tr&quot;);
let prev=null,rl=bm;
let sBS=0,sFS=0,sR=0,sF=0;

rows.forEach(r=&gt;{
r.cells[4].innerText=&quot;&quot;;
r.cells[5].innerText=&quot;&quot;;
r.cells[6].innerText=&quot;&quot;;
r.cells[7].innerText=&quot;&quot;;
r.classList.remove(&quot;cp&quot;);
});

rows.forEach((row,i)=&gt;{
let bs=row.cells[1].children[0].value;
let isv=row.cells[2].children[0].value;
let fs=row.cells[3].children[0].value;
let rd=parseFloat(bs||isv||fs);

if(bs) sBS+=+bs;
if(fs) sFS+=+fs;

if(i==0){
prev=rd;
row.cells[6].innerText=rl.toFixed(3);
row.cells[7].innerText=&quot;B.M&quot;;
return;
}

if(prev&gt;rd){
let rise=prev-rd;
sR+=rise;
rl+=rise;
row.cells[4].innerText=rise.toFixed(3);
}else{
let fall=rd-prev;
sF+=fall;
rl-=fall;
row.cells[5].innerText=fall.toFixed(3);
}

row.cells[6].innerText=rl.toFixed(3);
prev=rd;
});

// Auto CP
for(let i=0;i&lt;rows.length-1;i++){
if(rows[i].cells[3].children[0].value &amp;&amp;
   rows[i+1].cells[1].children[0].value){
rows[i].cells[7].innerText=&quot;C.P&quot;;
rows[i].classList.add(&quot;cp&quot;);
}
}

document.getElementById(&quot;sumBS&quot;).innerHTML=&quot;ΣBS=&quot;+sBS.toFixed(3);
document.getElementById(&quot;sumFS&quot;).innerHTML=&quot;ΣFS=&quot;+sFS.toFixed(3);
document.getElementById(&quot;sumRise&quot;).innerHTML=&quot;ΣRise=&quot;+sR.toFixed(3);
document.getElementById(&quot;sumFall&quot;).innerHTML=&quot;ΣFall=&quot;+sF.toFixed(3);
document.getElementById(&quot;check&quot;).innerHTML=
&quot;Check: ΣBS-ΣFS=&quot;+(sBS-sFS).toFixed(3)+
&quot; | ΣRise-ΣFall=&quot;+(sR-sF).toFixed(3)+
&quot; | Last RL-First RL=&quot;+(rl-bm).toFixed(3);
}

// ---------------- SAVE ----------------
function saveData(){
let rows=[...document.querySelectorAll(&quot;#levelTable tbody tr&quot;)].map(r=&gt;({
bs:r.cells[1].children[0].value,
is:r.cells[2].children[0].value,
fs:r.cells[3].children[0].value
}));
let data={
project:project.value,
location:location.value,
bm:bm.value,
rows:rows
};
localStorage.setItem(&quot;levelBook&quot;,JSON.stringify(data));
alert(&quot;Saved Successfully&quot;);
}

// ---------------- LOAD ----------------
window.onload=function(){
let d=localStorage.getItem(&quot;levelBook&quot;);
if(!d) return;
d=JSON.parse(d);
project.value=d.project||&quot;&quot;;
location.value=d.location||&quot;&quot;;
bm.value=d.bm||100;
d.rows.forEach((r,i)=&gt;{
if(i&gt;0) addRow();
let row=document.querySelectorAll(&quot;#levelTable tbody tr&quot;)[i];
row.cells[1].children[0].value=r.bs;
row.cells[2].children[0].value=r.is;
row.cells[3].children[0].value=r.fs;
});
calculate();
}

// ---------------- EXPORT ----------------
function exportJSON(){
let data=localStorage.getItem(&quot;levelBook&quot;);
if(!data){alert(&quot;No data to export&quot;);return;}
let blob=new Blob([data],{type:&quot;application/json&quot;});
let a=document.createElement(&quot;a&quot;);
a.href=URL.createObjectURL(blob);
a.download=&quot;levelbook.json&quot;;
a.click();
}

// ---------------- IMPORT ----------------
function importJSON(e){
let file=e.target.files[0];
let reader=new FileReader();
reader.onload=function(){
localStorage.setItem(&quot;levelBook&quot;,reader.result);
location.reload();
}
reader.readAsText(file);
}

// ---------------- CLEAR ----------------
function clearAll(){
if(confirm(&quot;Clear all data?&quot;)){
localStorage.removeItem(&quot;levelBook&quot;);
location.reload();
}
}
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/01/levelling-rise-and-fall-method.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-5250207348572245040</guid><pubDate>Fri, 23 Jan 2026 14:11:00 +0000</pubDate><atom:updated>2026-01-23T20:24:23.412+05:30</atom:updated><title>Improved Parking Layout generator</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;title&gt;Parking Simulator Pro&lt;/title&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://unpkg.com/leaflet@1.9.4/dist/leaflet.css&quot; /&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.css&quot; /&gt;
    &lt;style&gt;
        /* Main Layout */
        body { font-family: &#39;Segoe UI&#39;, Tahoma, Geneva, Verdana, sans-serif; margin: 0; padding: 0; background-color: #f0f2f5; color: #333; }
        
        .container { max-width: 1100px; margin: 0 auto; padding: 20px; }
        
        #map-container { margin-bottom: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden; background: #fff; }
        #map { height: 550px; width: 100%; z-index: 1; }
        
        .flex-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
        
        #inputs, .legend-static { 
            background: white; padding: 20px; border-radius: 8px; 
            box-shadow: 0 2px 8px rgba(0,0,0,0.05); flex: 1; min-width: 300px; 
        }

        /* Legend Styles (Static) */
        .legend-title { font-weight: bold; margin-bottom: 12px; border-bottom: 1px solid #eee; display: block; padding-bottom: 5px; }
        .legend-item { display: flex; align-items: center; margin-bottom: 8px; font-size: 14px; }
        .color-box { width: 18px; height: 18px; margin-right: 12px; border: 1px solid rgba(0,0,0,0.1); border-radius: 3px; }
        .symbol { font-size: 18px; margin-right: 12px; width: 18px; text-align: center; }

        /* Report Table */
        #report { background: white; padding: 20px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
        table { border-collapse: collapse; width: 100%; }
        th, td { border: 1px solid #ddd; padding: 12px; text-align: left; }
        th { background-color: #f8f9fa; }
        
        /* Buttons */
        .btn-group { margin-top: 15px; border-top: 1px solid #eee; padding-top: 15px; }
        button { padding: 12px 24px; cursor: pointer; border-radius: 4px; border: none; font-weight: bold; transition: 0.3s; }
        #generate { background: #28a745; color: white; }
        #generate:hover { background: #218838; }
        #reset { background: #dc3545; color: white; margin-left: 10px; }

        /* Instructions Section */
        .instructions-container { background: white; padding: 25px; border-radius: 8px; border-left: 6px solid #28a745; margin-bottom: 20px; }
        .step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 15px; }
        .step-card { background: #f8f9fa; padding: 15px; border-radius: 6px; border: 1px solid #e9ecef; }
        .step-number { display: inline-block; background: #28a745; color: white; width: 24px; height: 24px; text-align: center; line-height: 24px; border-radius: 50%; margin-bottom: 8px; font-weight: bold; font-size: 12px; }
        .logic-note { margin-top: 20px; font-size: 0.9em; color: #555; background: #e7f3ff; padding: 12px; border-radius: 4px; }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;instructions-container&quot;&gt;
        &lt;h2&gt;Parking Simulator Quick-Start&lt;/h2&gt;
        &lt;div class=&quot;step-grid&quot;&gt;
            &lt;div class=&quot;step-card&quot;&gt;&lt;span class=&quot;step-number&quot;&gt;1&lt;/span&gt;&lt;strong&gt;Specs&lt;/strong&gt;&lt;p style=&quot;font-size: 0.85em;&quot;&gt;Adjust vehicle dimensions.&lt;/p&gt;&lt;/div&gt;
            &lt;div class=&quot;step-card&quot;&gt;&lt;span class=&quot;step-number&quot;&gt;2&lt;/span&gt;&lt;strong&gt;Boundary&lt;/strong&gt;&lt;p style=&quot;font-size: 0.85em;&quot;&gt;Draw the site polygon.&lt;/p&gt;&lt;/div&gt;
            &lt;div class=&quot;step-card&quot;&gt;&lt;span class=&quot;step-number&quot;&gt;3&lt;/span&gt;&lt;strong&gt;Road&lt;/strong&gt;&lt;p style=&quot;font-size: 0.85em;&quot;&gt;Draw polyline for entry road.&lt;/p&gt;&lt;/div&gt;
            &lt;div class=&quot;step-card&quot;&gt;&lt;span class=&quot;step-number&quot;&gt;4&lt;/span&gt;&lt;strong&gt;Gates&lt;/strong&gt;&lt;p style=&quot;font-size: 0.85em;&quot;&gt;Place 2 markers (Entry/Exit).&lt;/p&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div id=&quot;map-container&quot;&gt;
        &lt;div id=&quot;map&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;

    &lt;div class=&quot;flex-row&quot;&gt;
        &lt;div id=&quot;inputs&quot;&gt;
            &lt;h3 style=&quot;margin-top:0&quot;&gt;Site Parameters&lt;/h3&gt;
            &lt;label&gt;Bus: &lt;input id=&quot;bus_length&quot; type=&quot;number&quot; value=&quot;12&quot; style=&quot;width:45px&quot;&gt;x&lt;input id=&quot;bus_width&quot; type=&quot;number&quot; value=&quot;3.5&quot; style=&quot;width:45px&quot;&gt; (Cap: &lt;input id=&quot;bus_capacity&quot; type=&quot;number&quot; value=&quot;48&quot; style=&quot;width:35px&quot;&gt;)&lt;/label&gt;&lt;br&gt;
            &lt;label&gt;Tempo: &lt;input id=&quot;tempo_length&quot; type=&quot;number&quot; value=&quot;6&quot; style=&quot;width:45px&quot;&gt;x&lt;input id=&quot;tempo_width&quot; type=&quot;number&quot; value=&quot;2.5&quot; style=&quot;width:45px&quot;&gt; (Cap: &lt;input id=&quot;tempo_capacity&quot; type=&quot;number&quot; value=&quot;15&quot; style=&quot;width:35px&quot;&gt;)&lt;/label&gt;&lt;br&gt;
            &lt;label&gt;Car: &lt;input id=&quot;car_length&quot; type=&quot;number&quot; value=&quot;5&quot; style=&quot;width:45px&quot;&gt;x&lt;input id=&quot;car_width&quot; type=&quot;number&quot; value=&quot;2.5&quot; style=&quot;width:45px&quot;&gt; (Cap: &lt;input id=&quot;car_capacity&quot; type=&quot;number&quot; value=&quot;5&quot; style=&quot;width:35px&quot;&gt;)&lt;/label&gt;&lt;br&gt;
            &lt;label&gt;Bike: &lt;input id=&quot;bike_length&quot; type=&quot;number&quot; value=&quot;2.5&quot; style=&quot;width:45px&quot;&gt;x&lt;input id=&quot;bike_width&quot; type=&quot;number&quot; value=&quot;1.2&quot; style=&quot;width:45px&quot;&gt; (Cap: &lt;input id=&quot;bike_capacity&quot; type=&quot;number&quot; value=&quot;2&quot; style=&quot;width:35px&quot;&gt;)&lt;/label&gt;
            
            &lt;div class=&quot;btn-group&quot;&gt;
                &lt;button id=&quot;generate&quot;&gt;Generate Layout&lt;/button&gt;
                &lt;button id=&quot;reset&quot;&gt;Reset Map&lt;/button&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        &lt;div class=&quot;legend-static&quot;&gt;
            &lt;span class=&quot;legend-title&quot;&gt;Drawing Keys&lt;/span&gt;
            &lt;div class=&quot;legend-item&quot;&gt;&lt;div class=&quot;color-box&quot; style=&quot;background: red;&quot;&gt;&lt;/div&gt;Bus Parking Zone&lt;/div&gt;
            &lt;div class=&quot;legend-item&quot;&gt;&lt;div class=&quot;color-box&quot; style=&quot;background: blue;&quot;&gt;&lt;/div&gt;Tempo/Van Zone&lt;/div&gt;
            &lt;div class=&quot;legend-item&quot;&gt;&lt;div class=&quot;color-box&quot; style=&quot;background: green;&quot;&gt;&lt;/div&gt;Car Parking Zone&lt;/div&gt;
            &lt;div class=&quot;legend-item&quot;&gt;&lt;div class=&quot;color-box&quot; style=&quot;background: orange;&quot;&gt;&lt;/div&gt;Two-Wheeler Zone&lt;/div&gt;
            &lt;div class=&quot;legend-item&quot;&gt;&lt;div style=&quot;width:18px; height:3px; border-top:2px dashed #333; margin-right:12px;&quot;&gt;&lt;/div&gt;Access Road (Center)&lt;/div&gt;
            &lt;div class=&quot;legend-item&quot;&gt;&lt;div style=&quot;width:18px; height:2px; background:#FFF; border:1px solid #ccc; margin-right:12px;&quot;&gt;&lt;/div&gt;Internal Aisle&lt;/div&gt;
            &lt;div class=&quot;legend-item&quot;&gt;&lt;span class=&quot;symbol&quot;&gt;📍&lt;/span&gt;Entry / Exit Point&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div id=&quot;report&quot;&gt;&lt;/div&gt;
    &lt;div class=&quot;logic-note&quot;&gt;
        &lt;strong&gt;Technical Note:&lt;/strong&gt; Layout uses 90° &lt;b&gt;Double-Loading&lt;/b&gt; logic. Rows are paired back-to-back to share a central driving aisle.
    &lt;/div&gt;
&lt;/div&gt;

&lt;script src=&quot;https://unpkg.com/leaflet@1.9.4/dist/leaflet.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://unpkg.com/@turf/turf@6/turf.min.js&quot;&gt;&lt;/script&gt;

&lt;script&gt;
    var map = L.map(&#39;map&#39;).setView([20.009130, 73.791004], 18);
    L.tileLayer(&#39;https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}&#39;).addTo(map);

    var drawnItems = new L.FeatureGroup();
    var generatedLayers = new L.FeatureGroup();
    map.addLayer(drawnItems);
    map.addLayer(generatedLayers);

    var drawControl = new L.Control.Draw({
        draw: { circle: false, rectangle: false, circlemarker: false },
        edit: { featureGroup: drawnItems }
    });
    map.addControl(drawControl);

    var polygons = [], polylines = [], markers = [];

    map.on(&#39;draw:created&#39;, function(e) {
        drawnItems.addLayer(e.layer);
        if (e.layerType === &#39;polygon&#39;) polygons.push(e.layer);
        if (e.layerType === &#39;polyline&#39;) polylines.push(e.layer);
        if (e.layerType === &#39;marker&#39;) markers.push(e.layer);
    });

    document.getElementById(&#39;reset&#39;).addEventListener(&#39;click&#39;, function() {
        location.reload();
    });

    function divideIntoTwo(polygon) {
        var bbox = turf.bbox(polygon);
        var midLng = (bbox[0] + bbox[2]) / 2;
        var midLat = (bbox[1] + bbox[3]) / 2;
        var width = bbox[2] - bbox[0];
        var height = bbox[3] - bbox[1];
        var poly1, poly2;
        if (width &gt; height) {
            var left = turf.polygon([[[bbox[0], bbox[1]], [midLng, bbox[1]], [midLng, bbox[3]], [bbox[0], bbox[3]], [bbox[0], bbox[1]]]]);
            var right = turf.polygon([[[midLng, bbox[1]], [bbox[2], bbox[1]], [bbox[2], bbox[3]], [midLng, bbox[3]], [midLng, bbox[1]]]]);
            poly1 = turf.intersect(polygon, left);
            poly2 = turf.intersect(polygon, right);
        } else {
            var top = turf.polygon([[[bbox[0], midLat], [bbox[2], midLat], [bbox[2], bbox[3]], [bbox[0], bbox[3]], [bbox[0], midLat]]]);
            var bottom = turf.polygon([[[bbox[0], bbox[1]], [bbox[2], bbox[1]], [bbox[2], midLat], [bbox[0], midLat], [bbox[0], bbox[1]]]]);
            poly1 = turf.intersect(polygon, top);
            poly2 = turf.intersect(polygon, bottom);
        }
        return [poly1, poly2];
    }

    document.getElementById(&#39;generate&#39;).addEventListener(&#39;click&#39;, function() {
        generatedLayers.clearLayers();
        if (polygons.length &lt; 1 || polylines.length &lt; 1) {
            alert(&#39;Draw 1 Site Polygon and 1 Road Polyline first.&#39;);
            return;
        }

        var parkingGeoJSON = polygons[0].toGeoJSON();
        var mainRoad = polylines[0].toGeoJSON();
        var roadBuffer = turf.buffer(mainRoad, 6, {units: &#39;meters&#39;});

        // Visual improvements for Road
        L.geoJSON(mainRoad, { style: { color: &#39;#333&#39;, weight: 4, dashArray: &#39;10, 10&#39; } }).addTo(generatedLayers);
        L.geoJSON(roadBuffer, { style: { color: &#39;#666&#39;, fillColor: &#39;#999&#39;, fillOpacity: 0.1, weight: 1, dashArray: &#39;5, 5&#39; } }).addTo(generatedLayers);

        var remainingArea = turf.difference(parkingGeoJSON, roadBuffer);
        if (!remainingArea) return;

        var parts = [];
        if (remainingArea.geometry.type === &#39;MultiPolygon&#39;) {
            remainingArea.geometry.coordinates.forEach(c =&gt; parts.push(turf.polygon(c)));
        } else { parts.push(remainingArea); }

        parts.sort((a, b) =&gt; turf.area(b) - turf.area(a));
        var lp = divideIntoTwo(parts[0]);
        var sections = [lp[0], lp[1], null, null];
        if (parts[1]) {
            var sp = divideIntoTwo(parts[1]);
            sections[2] = sp[0]; sections[3] = sp[1];
        }

        var vehicleOrder = [&#39;bus&#39;, &#39;tempo&#39;, &#39;car&#39;, &#39;bike&#39;];
        var colors = [&#39;red&#39;, &#39;blue&#39;, &#39;green&#39;, &#39;orange&#39;];
        var vData = {
            bus: { l: parseFloat(document.getElementById(&#39;bus_length&#39;).value), w: parseFloat(document.getElementById(&#39;bus_width&#39;).value), cap: parseInt(document.getElementById(&#39;bus_capacity&#39;).value) },
            tempo: { l: parseFloat(document.getElementById(&#39;tempo_length&#39;).value), w: parseFloat(document.getElementById(&#39;tempo_width&#39;).value), cap: parseInt(document.getElementById(&#39;tempo_capacity&#39;).value) },
            car: { l: parseFloat(document.getElementById(&#39;car_length&#39;).value), w: parseFloat(document.getElementById(&#39;car_width&#39;).value), cap: parseInt(document.getElementById(&#39;car_capacity&#39;).value) },
            bike: { l: parseFloat(document.getElementById(&#39;bike_length&#39;).value), w: parseFloat(document.getElementById(&#39;bike_width&#39;).value), cap: parseInt(document.getElementById(&#39;bike_capacity&#39;).value) }
        };

        var counts = {bus: 0, tempo: 0, car: 0, bike: 0};
        const M_DEG = 111319.9;
        const aisleM = 6;

        sections.forEach((section, idx) =&gt; {
            if (!section) return;
            var vType = vehicleOrder[idx];
            var bbox = turf.bbox(section);
            var cosLat = Math.cos(((bbox[1] + bbox[3]) / 2) * Math.PI / 180);
            var isH = (bbox[2] - bbox[0]) * cosLat &gt; (bbox[3] - bbox[1]);
            
            var sL = vData[vType].l / M_DEG;
            var sW = vData[vType].w / (M_DEG * cosLat);
            var aW = aisleM / M_DEG;
            var oPos = isH ? bbox[1] : bbox[0];
            var oMax = isH ? bbox[3] : bbox[2];
            var rowT = 0;

            while (oPos + sL &lt; oMax) {
                var iPos = isH ? bbox[0] : bbox[1];
                var iMax = isH ? bbox[2] : bbox[3];
                while (iPos + sW &lt; iMax) {
                    var ring = isH ? 
                        [[[iPos, oPos], [iPos+sW, oPos], [iPos+sW, oPos+sL], [iPos, oPos+sL], [iPos, oPos]]] :
                        [[[oPos, iPos], [oPos+sL, iPos], [oPos+sL, iPos+sW], [oPos, iPos+sW], [oPos, iPos]]];
                    var stall = turf.polygon(ring);
                    if (turf.booleanWithin(stall, section)) {
                        counts[vType]++;
                        L.geoJSON(stall, {style: {color: colors[idx], weight: 1, fillOpacity: 0.4}}).addTo(generatedLayers);
                    }
                    iPos += sW;
                }
                if (rowT % 2 === 1) { // Drawing White Aisle
                    var aLine, aCenter = oPos + sL + (aW/2);
                    if (isH) { aLine = turf.lineString([[bbox[0], aCenter], [bbox[2], aCenter]]); }
                    else { aLine = turf.lineString([[aCenter, bbox[1]], [aCenter, bbox[3]]]); }
                    L.geoJSON(aLine, { style: { color: &#39;#FFF&#39;, weight: 2, opacity: 0.8 } }).addTo(generatedLayers);
                    oPos += (sL + aW);
                } else { oPos += sL; }
                rowT++;
            }
        });

        // Report Logic
        var ha = turf.area(parkingGeoJSON) / 10000;
        var tCap = 0;
        var html = `&lt;h3&gt;Generation Report&lt;/h3&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt;Vehicle&lt;/th&gt;&lt;th&gt;Stalls&lt;/th&gt;&lt;th&gt;Capacity&lt;/th&gt;&lt;/tr&gt;`;
        for (var key in counts) {
            var c = counts[key] * vData[key].cap; tCap += c;
            html += `&lt;tr&gt;&lt;td&gt;${key.toUpperCase()}&lt;/td&gt;&lt;td&gt;${counts[key]}&lt;/td&gt;&lt;td&gt;${c} pax&lt;/td&gt;&lt;/tr&gt;`;
        }
        html += `&lt;tr&gt;&lt;th&gt;Total Density&lt;/th&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;b&gt;${tCap} People&lt;/b&gt; (${(tCap/ha).toFixed(1)}/ha)&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;`;
        document.getElementById(&#39;report&#39;).innerHTML = html;
    });
&lt;/script&gt;
  
&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/01/improved-parking-layout-generator.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-8413721584347003018</guid><pubDate>Fri, 16 Jan 2026 18:04:00 +0000</pubDate><atom:updated>2026-03-20T13:02:41.866+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">PWD Working</category><category domain="http://www.blogger.com/atom/ns#">Tender</category><title>Machinery Scrutiny</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;Tender Evaluation Tool - Participant Selection Mode&lt;/title&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.25/jspdf.plugin.autotable.min.js&quot;&gt;&lt;/script&gt;
    &lt;style&gt;
        body { font-family: &#39;Segoe UI&#39;, sans-serif; margin: 20px; background-color: #f4f7f6; color: #333; }
        section { background: white; margin-bottom: 25px; border: 1px solid #ddd; padding: 20px; border-radius: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
        h1, h2, h3 { color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 5px; }
        .grid-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 15px; }
        input, select, button { padding: 10px; border-radius: 6px; border: 1px solid #ccc; box-sizing: border-box; }
        button { background: #3498db; color: white; border: none; cursor: pointer; font-weight: bold; transition: 0.3s; }
        button:hover { background: #2980b9; }
        .btn-save { background: #27ae60; }
        .btn-eval { background: #8e44ad; width: 100%; font-size: 1.1em; margin-top: 10px; }
        .btn-danger { background: #e74c3c; font-size: 0.85em; }
        .btn-edit { background: #f39c12; font-size: 0.85em; margin-right: 5px; }
        
        /* Highlight the form when in edit mode */
        .edit-highlight { border: 2px solid #f39c12 !important; background: #fffdf0 !important; }
        .editing-row { background-color: #fff9db !important; }

        table { width: 100%; border-collapse: collapse; margin-top: 15px; }
        th, td { border: 1px solid #eee; padding: 10px; text-align: left; }
        th { background: #34495e; color: white; }
        .pass { color: #27ae60; font-weight: bold; }
        .fail { color: #e74c3c; font-weight: bold; }
        .participant-row { display: flex; align-items: center; gap: 10px; background: #f0f3f5; padding: 10px; border-radius: 8px; margin-bottom: 5px; }
        .status-msg { padding: 10px; margin-bottom: 15px; border-radius: 6px; font-weight: bold; text-align: center; }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

    &lt;h1&gt;🏗️ Tender Evaluation Tool&lt;/h1&gt;
    &lt;div id=&quot;db-status&quot; class=&quot;status-msg&quot; style=&quot;background: #ffeaa7;&quot;&gt;Initializing System...&lt;/div&gt;

    &lt;section&gt;
        &lt;h2&gt;Data Management (JSON)&lt;/h2&gt;
        &lt;div class=&quot;grid-inputs&quot;&gt;
            &lt;button onclick=&quot;exportData(&#39;contractors&#39;)&quot;&gt;📤 Export Contractors&lt;/button&gt;
            &lt;button onclick=&quot;document.getElementById(&#39;import-con-file&#39;).click()&quot;&gt;📥 Import Contractors&lt;/button&gt;
            &lt;input type=&quot;file&quot; id=&quot;import-con-file&quot; style=&quot;display:none&quot; accept=&quot;.json&quot; onchange=&quot;importData(event, &#39;contractors&#39;)&quot;&gt;
            &lt;button style=&quot;background:#d35400&quot; onclick=&quot;exportData(&#39;projects&#39;)&quot;&gt;📤 Export Projects&lt;/button&gt;
            &lt;button style=&quot;background:#e67e22&quot; onclick=&quot;document.getElementById(&#39;import-proj-file&#39;).click()&quot;&gt;📥 Import Projects&lt;/button&gt;
            &lt;input type=&quot;file&quot; id=&quot;import-proj-file&quot; style=&quot;display:none&quot; accept=&quot;.json&quot; onchange=&quot;importData(event, &#39;projects&#39;)&quot;&gt;
            &lt;button class=&quot;btn-danger&quot; onclick=&quot;wipeAll()&quot;&gt;⚠️ Wipe Database&lt;/button&gt;
          &lt;button onclick=&quot;exportPDF()&quot; style=&quot;background: #2c3e50; margin-bottom: 10px;&quot;&gt;📄 Export PDF Report&lt;/button&gt;
			&lt;button onclick=&quot;exportExcel()&quot; style=&quot;background: #27ae60; margin-bottom: 10px; margin-left: 5px;&quot;&gt;Excel Export to Excel&lt;/button&gt;
        &lt;/div&gt;
    &lt;/section&gt;

    &lt;section&gt;
        &lt;h2&gt;1. Contractor Database&lt;/h2&gt;
        &lt;div class=&quot;grid-inputs&quot;&gt;
            &lt;select id=&quot;select-con&quot; onchange=&quot;loadContractor()&quot;&gt;&lt;option value=&quot;&quot;&gt;-- New Contractor --&lt;/option&gt;&lt;/select&gt;
            &lt;input type=&quot;text&quot; id=&quot;con-name&quot; placeholder=&quot;Contractor Name&quot;&gt;
        &lt;/div&gt;
        
        &lt;div id=&quot;machinery-form&quot; class=&quot;grid-inputs&quot; style=&quot;background: #f9f9f9; padding: 15px; border-radius: 8px; transition: 0.3s;&quot;&gt;
            &lt;select id=&quot;m-type&quot;&gt;
                &lt;option value=&quot;&quot;&gt;Select machine...&lt;/option&gt;
                    &lt;option&gt;Sensor Paver&lt;/option&gt;
                    &lt;option&gt;Pneumatic Roller&lt;/option&gt;
                    &lt;option&gt;Dozer&lt;/option&gt;
                    &lt;option&gt;Tandem Roller&lt;/option&gt;
                    &lt;option&gt;Sheepfoot Roller&lt;/option&gt;
                    &lt;option&gt;Slip Form Paver&lt;/option&gt;
                    &lt;option&gt;Fixed Form Paver&lt;/option&gt;
                    &lt;option&gt;Grader&lt;/option&gt;
                    &lt;option&gt;Concrete Batching Plant&lt;/option&gt;
                    &lt;option&gt;Chilling Plant&lt;/option&gt;
                    &lt;option&gt;Asphalt Batch Mix Plant&lt;/option&gt;
                    &lt;option&gt;Drum Mix Plant&lt;/option&gt;
                    &lt;option&gt;Front End Loader&lt;/option&gt;
                    &lt;option&gt;Truck&lt;/option&gt;
                    &lt;option&gt;SCADA System Integrated to PWD&lt;/option&gt;
                    &lt;option&gt;Excavator&lt;/option&gt;
                    &lt;option&gt;Backhoe Loader&lt;/option&gt;
                    &lt;option&gt;Vibratory Roller&lt;/option&gt;
                    &lt;option&gt;Static Roller&lt;/option&gt;
                    &lt;option&gt;Water Tanker&lt;/option&gt;
                    &lt;option&gt;Transit Mixer&lt;/option&gt;
                    &lt;option&gt;Concrete Pump&lt;/option&gt;
                    &lt;option&gt;Air Compressor&lt;/option&gt;
                    &lt;option&gt;Crane&lt;/option&gt;
                    &lt;option&gt;Mechanical Broomer&lt;/option&gt;
                    &lt;option&gt;Vibratory Soil Compactor&lt;/option&gt;
                    &lt;option&gt;Mini Vibrator Roller&lt;/option&gt;
                    &lt;option&gt;Tipper&lt;/option&gt;
                    &lt;option&gt;Hot Mix Plant&lt;/option&gt;
                    &lt;option&gt;Wet Mix Plant&lt;/option&gt;
                    &lt;option&gt;Tractor with Rotavator&lt;/option&gt;
                    &lt;option&gt;Internal Concrete Vibrator&lt;/option&gt;
                    &lt;option&gt;Paver Finisher with Electronic Sensors&lt;/option&gt;
                  &lt;option&gt;Mechanical Paver Finisher&lt;/option&gt;
                  &lt;option&gt;Mechanical Bitumen Spayer&lt;/option&gt;
                  &lt;option&gt;Front End Loader&lt;/option&gt;
                  &lt;option&gt;Concrete Paver fully Automatic&lt;/option&gt;
                  &lt;option&gt;Reversible Drum Concrete Mixer&lt;/option&gt;
                  &lt;option&gt;Sand Screening Cum Washing Unit&lt;/option&gt;
                &lt;/select&gt;
            &lt;input type=&quot;number&quot; id=&quot;m-age&quot; placeholder=&quot;Age&quot;&gt;
            &lt;input type=&quot;number&quot; id=&quot;m-owned&quot; placeholder=&quot;Owned&quot;&gt;
            &lt;input type=&quot;number&quot; id=&quot;m-hired&quot; placeholder=&quot;Hired&quot;&gt;
            &lt;button id=&quot;add-btn&quot; onclick=&quot;addOrUpdateMachine()&quot;&gt;+ Add Machine&lt;/button&gt;
            &lt;button id=&quot;cancel-edit&quot; style=&quot;display:none; background:#95a5a6&quot; onclick=&quot;clearMachineInputs()&quot;&gt;Cancel&lt;/button&gt;
        &lt;/div&gt;

        &lt;table id=&quot;m-table&quot;&gt;
            &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Age&lt;/th&gt;&lt;th&gt;Owned&lt;/th&gt;&lt;th&gt;Hired&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
            &lt;tbody id=&quot;m-list&quot;&gt;&lt;/tbody&gt;
        &lt;/table&gt;
        &lt;br&gt;
        &lt;button class=&quot;btn-save&quot; onclick=&quot;saveContractor()&quot;&gt;💾 Save Contractor to Database&lt;/button&gt;
		&lt;button class=&quot;btn-danger&quot; style=&quot;margin-left: 10px;&quot; onclick=&quot;deleteContractor()&quot;&gt;🗑️ Delete Contractor&lt;/button&gt;
    &lt;/section&gt;

    &lt;section&gt;
        &lt;h2&gt;2. Project Requirements&lt;/h2&gt;
        &lt;div class=&quot;grid-inputs&quot;&gt;
            &lt;select id=&quot;select-proj&quot; onchange=&quot;loadProject()&quot;&gt;&lt;option value=&quot;&quot;&gt;-- New Project Template --&lt;/option&gt;&lt;/select&gt;
            &lt;input type=&quot;text&quot; id=&quot;proj-name&quot; placeholder=&quot;Project Name&quot;&gt;
        &lt;/div&gt;
        &lt;div class=&quot;grid-inputs&quot; style=&quot;background: #fff4e6; padding: 15px; border-radius: 8px;&quot;&gt;
            &lt;select id=&quot;req-type&quot;&gt;
          &lt;option value=&quot;&quot;&gt;Select machine...&lt;/option&gt;
                    &lt;option&gt;Sensor Paver&lt;/option&gt;
                    &lt;option&gt;Pneumatic Roller&lt;/option&gt;
                    &lt;option&gt;Dozer&lt;/option&gt;
                    &lt;option&gt;Tandem Roller&lt;/option&gt;
                    &lt;option&gt;Sheepfoot Roller&lt;/option&gt;
                    &lt;option&gt;Slip Form Paver&lt;/option&gt;
                    &lt;option&gt;Fixed Form Paver&lt;/option&gt;
                    &lt;option&gt;Grader&lt;/option&gt;
                    &lt;option&gt;Concrete Batching Plant&lt;/option&gt;
                    &lt;option&gt;Chilling Plant&lt;/option&gt;
                    &lt;option&gt;Asphalt Batch Mix Plant&lt;/option&gt;
                    &lt;option&gt;Drum Mix Plant&lt;/option&gt;
                    &lt;option&gt;Front End Loader&lt;/option&gt;
                    &lt;option&gt;Truck&lt;/option&gt;
                    &lt;option&gt;SCADA System Integrated to PWD&lt;/option&gt;
                    &lt;option&gt;Excavator&lt;/option&gt;
                    &lt;option&gt;Backhoe Loader&lt;/option&gt;
                    &lt;option&gt;Vibratory Roller&lt;/option&gt;
                    &lt;option&gt;Static Roller&lt;/option&gt;
                    &lt;option&gt;Water Tanker&lt;/option&gt;
                    &lt;option&gt;Transit Mixer&lt;/option&gt;
                    &lt;option&gt;Concrete Pump&lt;/option&gt;
                    &lt;option&gt;Air Compressor&lt;/option&gt;
                    &lt;option&gt;Crane&lt;/option&gt;
                    &lt;option&gt;Mechanical Broomer&lt;/option&gt;
                    &lt;option&gt;Vibratory Soil Compactor&lt;/option&gt;
                    &lt;option&gt;Mini Vibrator Roller&lt;/option&gt;
                    &lt;option&gt;Tipper&lt;/option&gt;
                    &lt;option&gt;Hot Mix Plant&lt;/option&gt;
                    &lt;option&gt;Wet Mix Plant&lt;/option&gt;
                    &lt;option&gt;Tractor with Rotavator&lt;/option&gt;
                    &lt;option&gt;Internal Concrete Vibrator&lt;/option&gt;
                    &lt;option&gt;Paver Finisher with Electronic Sensors&lt;/option&gt;
                  &lt;option&gt;Mechanical Paver Finisher&lt;/option&gt;
                  &lt;option&gt;Mechanical Bitumen Spayer&lt;/option&gt;
                  &lt;option&gt;Front End Loader&lt;/option&gt;
                  &lt;option&gt;Concrete Paver fully Automatic&lt;/option&gt;
                  &lt;option&gt;Reversible Drum Concrete Mixer&lt;/option&gt;
                  &lt;option&gt;Sand Screening Cum Washing Unit&lt;/option&gt;
          &lt;/select&gt;
            &lt;input type=&quot;number&quot; id=&quot;req-min&quot; placeholder=&quot;Min Qty&quot;&gt;
            &lt;input type=&quot;number&quot; id=&quot;req-hired&quot; placeholder=&quot;Max Hired&quot;&gt;
            &lt;input type=&quot;number&quot; id=&quot;req-age&quot; placeholder=&quot;Max Age&quot;&gt;
            &lt;button onclick=&quot;addReq()&quot; style=&quot;background:#e67e22&quot;&gt;+ Add Req&lt;/button&gt;
        &lt;/div&gt;
        &lt;table&gt;
            &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Min Qty&lt;/th&gt;&lt;th&gt;Max Hired&lt;/th&gt;&lt;th&gt;Max Age&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
            &lt;tbody id=&quot;req-list&quot;&gt;&lt;/tbody&gt;
        &lt;/table&gt;
        &lt;br&gt;
        &lt;button class=&quot;btn-save&quot; style=&quot;background:#e67e22&quot; onclick=&quot;saveProject()&quot;&gt;🏗️ Save Project&lt;/button&gt;
&lt;button class=&quot;btn-danger&quot; style=&quot;margin-left: 10px;&quot; onclick=&quot;deleteProject()&quot;&gt;🗑️ Delete Project&lt;/button&gt;
    &lt;/section&gt;

    &lt;section style=&quot;border: 2px solid #8e44ad;&quot;&gt;
        &lt;h2&gt;3. Live Evaluation Workflow&lt;/h2&gt;
        &lt;div class=&quot;grid-inputs&quot;&gt;
            &lt;div&gt;
                &lt;label&gt;&lt;b&gt;Target Project&lt;/b&gt;&lt;/label&gt;
                &lt;select id=&quot;eval-proj-select&quot; style=&quot;width:100%&quot;&gt;&lt;/select&gt;
            &lt;/div&gt;
            &lt;div&gt;
                &lt;label&gt;&lt;b&gt;Number of Bidders&lt;/b&gt;&lt;/label&gt;
                &lt;input type=&quot;number&quot; id=&quot;num-participants&quot; value=&quot;1&quot; min=&quot;1&quot; onchange=&quot;generateParticipantInputs()&quot; style=&quot;width:100%&quot;&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div id=&quot;participants-container&quot;&gt;&lt;/div&gt;
        &lt;button class=&quot;btn-eval&quot; onclick=&quot;performEval()&quot;&gt;🔍 Run Comparative Evaluation&lt;/button&gt;
    &lt;/section&gt;

    &lt;section id=&quot;results-area&quot; style=&quot;display:none;&quot;&gt;
        &lt;h2&gt;Evaluation Results&lt;/h2&gt;
        &lt;table id=&quot;results-table&quot;&gt;
            &lt;thead&gt;&lt;tr&gt;&lt;th&gt;Contractor&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Evaluation Breakdown&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
            &lt;tbody id=&quot;results-body&quot;&gt;&lt;/tbody&gt;
        &lt;/table&gt;
    &lt;/section&gt;
   

    &lt;script&gt;
        let state = {
            contractors: JSON.parse(localStorage.getItem(&#39;tender_cons&#39;) || &#39;[]&#39;),
            projects: JSON.parse(localStorage.getItem(&#39;tender_projs&#39;) || &#39;[]&#39;)
        };
        let tempMachines = [];
        let tempReqs = [];
        let editIndex = -1; // -1 means adding new, otherwise contains index of machine being edited

        function init() {
            const mOptions = document.getElementById(&#39;m-type&#39;).innerHTML;
            document.getElementById(&#39;req-type&#39;).innerHTML = mOptions;
            updateDropdowns();
            document.getElementById(&#39;db-status&#39;).innerHTML = &quot;System Ready ✅&quot;;
            document.getElementById(&#39;db-status&#39;).style.background = &quot;#d1f2eb&quot;;
        }

        // --- MACHINERY EDIT &amp; ADD LOGIC ---
        function addOrUpdateMachine() {
            const type = document.getElementById(&#39;m-type&#39;).value;
            const age = parseInt(document.getElementById(&#39;m-age&#39;).value) || 0;
            const owned = parseInt(document.getElementById(&#39;m-owned&#39;).value) || 0;
            const hired = parseInt(document.getElementById(&#39;m-hired&#39;).value) || 0;

            if (!type) return alert(&quot;Please select a machine type&quot;);

            const machineData = { type, age, owned, hired };

            if (editIndex &gt; -1) {
                tempMachines[editIndex] = machineData;
                editIndex = -1;
            } else {
                tempMachines.push(machineData);
            }

            renderMachineTable();
            clearMachineInputs();
        }

        function editMachine(index) {
            const m = tempMachines[index];
            document.getElementById(&#39;m-type&#39;).value = m.type;
            document.getElementById(&#39;m-age&#39;).value = m.age;
            document.getElementById(&#39;m-owned&#39;).value = m.owned;
            document.getElementById(&#39;m-hired&#39;).value = m.hired;

            editIndex = index;
            
            // UI Changes
            document.getElementById(&#39;add-btn&#39;).innerText = &quot;✅ Update Machine&quot;;
            document.getElementById(&#39;cancel-edit&#39;).style.display = &quot;inline-block&quot;;
            document.getElementById(&#39;machinery-form&#39;).classList.add(&#39;edit-highlight&#39;);
            renderMachineTable(); // To apply &#39;editing-row&#39; class
        }

        function clearMachineInputs() {
            [&#39;m-type&#39;, &#39;m-age&#39;, &#39;m-owned&#39;, &#39;m-hired&#39;].forEach(id =&gt; document.getElementById(id).value = &quot;&quot;);
            editIndex = -1;
            document.getElementById(&#39;add-btn&#39;).innerText = &quot;+ Add Machine&quot;;
            document.getElementById(&#39;cancel-edit&#39;).style.display = &quot;none&quot;;
            document.getElementById(&#39;machinery-form&#39;).classList.remove(&#39;edit-highlight&#39;);
            renderMachineTable();
        }

        function renderMachineTable() {
            const tbody = document.getElementById(&#39;m-list&#39;);
            tbody.innerHTML = tempMachines.map((m, i) =&gt; `
                &lt;tr class=&quot;${editIndex === i ? &#39;editing-row&#39; : &#39;&#39;}&quot;&gt;
                    &lt;td&gt;${m.type}&lt;/td&gt;
                    &lt;td&gt;${m.age}&lt;/td&gt;
                    &lt;td&gt;${m.owned}&lt;/td&gt;
                    &lt;td&gt;${m.hired}&lt;/td&gt;
                    &lt;td&gt;
                        &lt;button class=&quot;btn-edit&quot; onclick=&quot;editMachine(${i})&quot;&gt;Edit&lt;/button&gt;
                        &lt;button class=&quot;btn-danger&quot; onclick=&quot;removeIdx(&#39;m-list&#39;, ${i})&quot;&gt;X&lt;/button&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
            `).join(&#39;&#39;);
        }

        function removeIdx(listType, i) {
            if (listType === &#39;m-list&#39;) {
                tempMachines.splice(i, 1);
                if (editIndex === i) clearMachineInputs();
                renderMachineTable();
            } else {
                tempReqs.splice(i, 1);
                renderReqTable();
            }
        }

        // --- CONTRACTOR &amp; PROJECT SYNC ---
        function saveContractor() {
            const name = document.getElementById(&#39;con-name&#39;).value.trim();
            if(!name) return alert(&quot;Enter Contractor Name&quot;);
            
            const idx = state.contractors.findIndex(c =&gt; c.name === name);
            if(idx &gt; -1) state.contractors[idx] = { name, machinery: [...tempMachines] };
            else state.contractors.push({ name, machinery: [...tempMachines] });
            
            localStorage.setItem(&#39;tender_cons&#39;, JSON.stringify(state.contractors));
            updateDropdowns();
            alert(&quot;Contractor Data Saved!&quot;);
        }

        function loadContractor() {
            const con = state.contractors.find(c =&gt; c.name === document.getElementById(&#39;select-con&#39;).value);
            document.getElementById(&#39;con-name&#39;).value = con ? con.name : &quot;&quot;;
            tempMachines = con ? JSON.parse(JSON.stringify(con.machinery)) : [];
            clearMachineInputs(); // Resets edit state and renders table
        }

        // --- OTHER CORE LOGIC ---
        function addReq() {
            const type = document.getElementById(&#39;req-type&#39;).value;
            if(!type) return;
            tempReqs.push({ 
                type, 
                min: parseInt(document.getElementById(&#39;req-min&#39;).value)||0, 
                hired: parseInt(document.getElementById(&#39;req-hired&#39;).value)||0, 
                age: parseInt(document.getElementById(&#39;req-age&#39;).value)||0 
            });
            renderReqTable();
        }

        function renderReqTable() {
            document.getElementById(&#39;req-list&#39;).innerHTML = tempReqs.map((r, i) =&gt; `
                &lt;tr&gt;
                    &lt;td&gt;${r.type}&lt;/td&gt;&lt;td&gt;${r.min}&lt;/td&gt;&lt;td&gt;${r.hired}&lt;/td&gt;&lt;td&gt;${r.age}&lt;/td&gt;
                    &lt;td&gt;&lt;button class=&quot;btn-danger&quot; onclick=&quot;removeIdx(&#39;req-list&#39;, ${i})&quot;&gt;X&lt;/button&gt;&lt;/td&gt;
                &lt;/tr&gt;`).join(&#39;&#39;);
        }

        function saveProject() {
    const name = document.getElementById(&#39;proj-name&#39;).value.trim();
    if (!name) return alert(&quot;Enter Project Name&quot;);

    // Check if the project already exists
    const idx = state.projects.findIndex(p =&gt; p.name === name);

    if (idx &gt; -1) {
        // Update existing project
        state.projects[idx] = { name, requirements: [...tempReqs] };
    } else {
        // Add new project
        state.projects.push({ name, requirements: [...tempReqs] });
    }

    localStorage.setItem(&#39;tender_projs&#39;, JSON.stringify(state.projects));
    updateDropdowns();
    alert(&quot;Project Template Saved Successfully!&quot;);
}

        function loadProject() {
    const selectedName = document.getElementById(&#39;select-proj&#39;).value;
    const proj = state.projects.find(p =&gt; p.name === selectedName);
    
    if (proj) {
        document.getElementById(&#39;proj-name&#39;).value = proj.name;
        tempReqs = JSON.parse(JSON.stringify(proj.requirements)); // Deep copy
    } else {
        // This handles the &quot;-- New Project Template --&quot; case
        document.getElementById(&#39;proj-name&#39;).value = &quot;&quot;;
        tempReqs = [];
    }
    renderReqTable();
}
      
      function deleteProject() {
    const selectedName = document.getElementById(&#39;select-proj&#39;).value;
    
    if (!selectedName) {
        return alert(&quot;Please select a project from the dropdown first to delete it.&quot;);
    }

    if (confirm(`Are you sure you want to delete the project: &quot;${selectedName}&quot;?`)) {
        // Filter out the project with the selected name
        state.projects = state.projects.filter(p =&gt; p.name !== selectedName);
        
        // Update LocalStorage
        localStorage.setItem(&#39;tender_projs&#39;, JSON.stringify(state.projects));
        
        // Reset the UI fields
        document.getElementById(&#39;proj-name&#39;).value = &quot;&quot;;
        tempReqs = [];
        renderReqTable();
        
        // Refresh dropdowns to remove the name from the list
        updateDropdowns();
        
        alert(&quot;Project deleted successfully.&quot;);
    }
}
      
      function deleteContractor() {
    const selectedName = document.getElementById(&#39;select-con&#39;).value;
    
    if (!selectedName) {
        return alert(&quot;Please select a contractor from the dropdown first to delete it.&quot;);
    }

    if (confirm(`Permanently delete &quot;${selectedName}&quot; and all their machinery data?`)) {
        // Filter out the selected contractor
        state.contractors = state.contractors.filter(c =&gt; c.name !== selectedName);
        
        // Update LocalStorage
        localStorage.setItem(&#39;tender_cons&#39;, JSON.stringify(state.contractors));
        
        // Reset the form fields
        document.getElementById(&#39;con-name&#39;).value = &quot;&quot;;
        tempMachines = [];
        clearMachineInputs(); // This will also re-render the empty table
        
        // Refresh dropdowns and participant selectors
        updateDropdowns();
        
        alert(&quot;Contractor deleted successfully.&quot;);
    }
}
      
      

        function updateDropdowns() {
            const mapNames = list =&gt; list.map(i =&gt; `&lt;option value=&quot;${i.name}&quot;&gt;${i.name}&lt;/option&gt;`).join(&#39;&#39;);
            document.getElementById(&#39;select-con&#39;).innerHTML = &#39;&lt;option value=&quot;&quot;&gt;-- New Contractor --&lt;/option&gt;&#39; + mapNames(state.contractors);
            document.getElementById(&#39;select-proj&#39;).innerHTML = &#39;&lt;option value=&quot;&quot;&gt;-- New Project Template --&lt;/option&gt;&#39; + mapNames(state.projects);
            document.getElementById(&#39;eval-proj-select&#39;).innerHTML = &#39;&lt;option value=&quot;&quot;&gt;-- Select Project --&lt;/option&gt;&#39; + mapNames(state.projects);
            generateParticipantInputs();
        }

        function generateParticipantInputs() {
            const container = document.getElementById(&#39;participants-container&#39;);
            const num = document.getElementById(&#39;num-participants&#39;).value;
            container.innerHTML = &quot;&lt;h3&gt;Select Bidding Contractors&lt;/h3&gt;&quot;;
            for(let i = 1; i &lt;= num; i++) {
                container.innerHTML += `
                    &lt;div class=&quot;participant-row&quot;&gt;
                        &lt;span&gt;Bidder #${i}:&lt;/span&gt;
                        &lt;select class=&quot;participant-selector&quot; style=&quot;flex-grow:1&quot;&gt;
                            &lt;option value=&quot;&quot;&gt;-- Select Contractor --&lt;/option&gt;
                            ${state.contractors.map(c =&gt; `&lt;option value=&quot;${c.name}&quot;&gt;${c.name}&lt;/option&gt;`).join(&#39;&#39;)}
                        &lt;/select&gt;
                    &lt;/div&gt;`;
            }
        }

        function performEval() {
            const projName = document.getElementById(&#39;eval-proj-select&#39;).value;
            const proj = state.projects.find(p =&gt; p.name === projName);
            if(!proj) return alert(&quot;Select a project&quot;);

            const selectedNames = Array.from(document.querySelectorAll(&#39;.participant-selector&#39;)).map(s =&gt; s.value).filter(n =&gt; n !== &quot;&quot;);
            const tbody = document.getElementById(&#39;results-body&#39;);
            tbody.innerHTML = &quot;&quot;;

            selectedNames.forEach(name =&gt; {
                const con = state.contractors.find(c =&gt; c.name === name);
                let passed = true, logs = [];
                proj.requirements.forEach(r =&gt; {
                    const match = con.machinery.find(m =&gt; m.type === r.type) || {age:0, owned:0, hired:0};
                    const total = match.owned + match.hired;
                    let errs = [];
                    if(total &lt; r.min) errs.push(`Shortage: ${total}/${r.min}`);
                    if (match.owned &lt; r.required &amp;&amp; match.hired &gt; r.hired) {
    errs.push(`Excess_Hired: ${match.hired}/${r.hired}`);
}

                    if(match.age &gt; r.age &amp;&amp; r.age &gt; 0) errs.push(`Over_aged: ${match.age}/${r.age}`);
                    
                    if(errs.length &gt; 0) { passed = false; logs.push(`❌ ${r.type}: ${errs.join(&#39; | &#39;)}`); }
                    else logs.push(`✅ ${r.type}: OK`);
                });
                tbody.innerHTML += `&lt;tr&gt;&lt;td&gt;&lt;b&gt;${con.name}&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;${passed?&#39;pass&#39;:&#39;fail&#39;}&quot;&gt;${passed?&#39;QUALIFIED&#39;:&#39;REJECTED&#39;}&lt;/td&gt;&lt;td&gt;&lt;small&gt;${logs.join(&#39;&lt;br&gt;&#39;)}&lt;/small&gt;&lt;/td&gt;&lt;/tr&gt;`;
            });
            document.getElementById(&#39;results-area&#39;).style.display = &#39;block&#39;;
        }

function exportData(k) {
    // 1. Generate the date string (YYYY-MM-DD)
    const date = new Date().toISOString().split(&#39;T&#39;)[0];
    const fileName = `Machinery scrutiny backup dated ${date}.json`;

    // 2. Determine which data to export
    const data = k === &#39;contractors&#39; ? state.contractors : state.projects;
    
    // 3. Create the blob and download link
    const blob = new Blob([JSON.stringify(data, null, 2)], {type: &#39;application/json&#39;});
    const url = URL.createObjectURL(blob);
    const a = document.createElement(&#39;a&#39;);
    
    a.href = url;
    a.download = fileName; // Applies the new name
    
    // 4. Trigger download and cleanup
    document.body.appendChild(a); 
    a.click();
    document.body.removeChild(a);
    URL.revokeObjectURL(url);
}

        function importData(e, k) {
            const reader = new FileReader();
            reader.onload = (event) =&gt; {
                state[k] = JSON.parse(event.target.result);
                localStorage.setItem(k===&#39;contractors&#39;?&#39;tender_cons&#39;:&#39;tender_projs&#39;, JSON.stringify(state[k]));
                location.reload();
            };
            reader.readAsText(e.target.files[0]);
        }

        function exportPDF() {
            const { jsPDF } = window.jspdf;
            const doc = new jsPDF();
            doc.text(&quot;Tender Evaluation Report&quot;, 14, 20);
            doc.autoTable({ html: &#39;#results-table&#39;, startY: 30, theme: &#39;grid&#39; });
            doc.save(&quot;Evaluation_Report.pdf&quot;);
        }
      
      function exportExcel() {
    const table = document.getElementById(&quot;results-table&quot;);
    let csvContent = &quot;&quot;;
    
    // Get headers
    const headers = Array.from(table.querySelectorAll(&quot;th&quot;)).map(th =&gt; `&quot;${th.innerText}&quot;`);
    csvContent += headers.join(&quot;,&quot;) + &quot;\n&quot;;
    
    // Get rows
    const rows = Array.from(table.querySelectorAll(&quot;tbody tr&quot;));
    
    rows.forEach(row =&gt; {
        const cells = Array.from(row.querySelectorAll(&quot;td&quot;)).map(td =&gt; {
            // Clean the text: remove newlines, quotes, and extra spaces
            let data = td.innerText.replace(/\n/g, &quot; | &quot;).replace(/&quot;/g, &#39;&quot;&quot;&#39;);
            return `&quot;${data}&quot;`;
        });
        csvContent += cells.join(&quot;,&quot;) + &quot;\n&quot;;
    });

    // Create a Blob and trigger download
    const blob = new Blob([csvContent], { type: &#39;text/csv;charset=utf-8;&#39; });
    const link = document.createElement(&quot;a&quot;);
    const url = URL.createObjectURL(blob);
    
    link.setAttribute(&quot;href&quot;, url);
    link.setAttribute(&quot;download&quot;, `Tender_Evaluation_${new Date().toLocaleDateString()}.csv`);
    link.style.visibility = &#39;hidden&#39;;
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
}

        function wipeAll() { 
    if(confirm(&quot;CRITICAL: This will delete ALL contractors and ALL projects. Are you absolutely sure?&quot;)) { 
        localStorage.clear(); 
        location.reload(); 
    } 
}

        init();
    &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/01/machinery-scrutiny.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-7765566816512166624</guid><pubDate>Mon, 12 Jan 2026 04:42:00 +0000</pubDate><atom:updated>2026-01-12T10:12:20.260+05:30</atom:updated><title>RCC beam deflection check IS:456-2025</title><description>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;RCC Beam Deflection Check – IS 456-2025 Draft&lt;/title&gt;

&lt;style&gt;
body{
    font-family: Arial;
    background:#f4f6f7;
}
.container{
    max-width:900px;
    margin:auto;
    background:white;
    padding:20px;
    border-radius:10px;
    box-shadow:0 0 10px rgba(0,0,0,0.2);
}
h2{
    text-align:center;
    color:#2c3e50;
}
table{
    width:100%;
    border-collapse:collapse;
}
th,td{
    border:1px solid #333;
    padding:8px;
}
input,select{
    width:100%;
    padding:5px;
}
button{
    padding:10px 20px;
    background:#2980b9;
    color:white;
    border:none;
    border-radius:5px;
    cursor:pointer;
}
.result{
    background:#ecf0f1;
    padding:15px;
    margin-top:20px;
}
.pass{color:green;font-weight:bold;}
.fail{color:red;font-weight:bold;}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;div class=&quot;container&quot;&gt;

&lt;h2&gt;RCC Beam Deflection Check (Empirical Method)&lt;/h2&gt;

&lt;table&gt;
&lt;tr&gt;&lt;th colspan=&quot;2&quot;&gt;INPUT DATA&lt;/th&gt;&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Beam Type&lt;/td&gt;
&lt;td&gt;
&lt;select id=&quot;beamType&quot;&gt;
&lt;option value=&quot;16&quot;&gt;Simply Supported&lt;/option&gt;
&lt;option value=&quot;18&quot;&gt;Continuous&lt;/option&gt;
&lt;option value=&quot;7&quot;&gt;Cantilever&lt;/option&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Effective Span Le (mm)&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;Le&quot; value=&quot;6000&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Effective Depth d (mm)&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;d&quot; value=&quot;400&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Beam Width b (mm)&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;b&quot; value=&quot;230&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Area of Compression Steel Asc (mm²)&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;Asc&quot; value=&quot;226&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Ast Required (mm²)&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;Ast_req&quot; value=&quot;743&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Ast Provided (mm²)&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;Ast_prov&quot; value=&quot;804&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Steel Grade&lt;/td&gt;
&lt;td&gt;
&lt;select id=&quot;fy&quot;&gt;
&lt;option value=&quot;415&quot;&gt;Fe 415&lt;/option&gt;
&lt;option value=&quot;500&quot; selected&gt;Fe 500&lt;/option&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Beam Type&lt;/td&gt;
&lt;td&gt;
&lt;select id=&quot;sectionType&quot;&gt;
&lt;option value=&quot;rect&quot;&gt;Rectangular&lt;/option&gt;
&lt;option value=&quot;T&quot;&gt;T Beam&lt;/option&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Flange Width bf (mm) (if T beam)&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;bf&quot; value=&quot;230&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;μG factor&lt;/td&gt;
&lt;td&gt;
&lt;select id=&quot;muG&quot;&gt;
&lt;option value=&quot;0.6667&quot;&gt;2/3 (as per draft)&lt;/option&gt;
&lt;option value=&quot;1.5&quot;&gt;3/2 (suggested)&lt;/option&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;br&gt;
&lt;center&gt;
&lt;button onclick=&quot;calculate()&quot;&gt;CALCULATE&lt;/button&gt;
&lt;/center&gt;

&lt;div class=&quot;result&quot; id=&quot;output&quot;&gt;&lt;/div&gt;

&lt;/div&gt;

&lt;script&gt;
function calculate(){

let Le = parseFloat(document.getElementById(&quot;Le&quot;).value);
let d = parseFloat(document.getElementById(&quot;d&quot;).value);
let b = parseFloat(document.getElementById(&quot;b&quot;).value);
let Asc = parseFloat(document.getElementById(&quot;Asc&quot;).value);
let Ast_req = parseFloat(document.getElementById(&quot;Ast_req&quot;).value);
let Ast_prov = parseFloat(document.getElementById(&quot;Ast_prov&quot;).value);
let fy = parseFloat(document.getElementById(&quot;fy&quot;).value);
let bf = parseFloat(document.getElementById(&quot;bf&quot;).value);
let beamType = parseFloat(document.getElementById(&quot;beamType&quot;).value);
let muG = parseFloat(document.getElementById(&quot;muG&quot;).value);
let sectionType = document.getElementById(&quot;sectionType&quot;).value;

// Basic span/d
let led0 = beamType;

// pc
let pc = (100*Asc)/(b*d);

// alpha
let alpha = (fy==500)?2.0:1.0;

// μT
let muT = alpha /(1+Math.sqrt(2)+ (fy/415)*(Ast_prov/Ast_req));

// μC (as per interpretation)
let muC = 1 - 0.7*pc;

// μF
let muF;
if(sectionType==&quot;rect&quot;){
    muF = 1 + (1/3)*(1-pc);
}else{
    muF = 1 + (1/3)*(bf/b - pc);
}

// (Le/d)max
let led_max = led0 /(muT*muC*muF*muG);

// (Le/d)actual
let led_actual = Le/d;

// Result
let status = (led_actual&lt;led_max)?&quot;PASS&quot;:&quot;FAIL&quot;;
let cls = (status==&quot;PASS&quot;)?&quot;pass&quot;:&quot;fail&quot;;

document.getElementById(&quot;output&quot;).innerHTML = `
&lt;b&gt;CALCULATION RESULTS&lt;/b&gt;&lt;br&gt;&lt;br&gt;

Basic (Le/d)&lt;sub&gt;0&lt;/sub&gt; = ${led0.toFixed(2)}&lt;br&gt;
p&lt;sub&gt;c&lt;/sub&gt; = ${pc.toFixed(4)}&lt;br&gt;&lt;br&gt;

μ&lt;sub&gt;T&lt;/sub&gt; = ${muT.toFixed(3)}&lt;br&gt;
μ&lt;sub&gt;C&lt;/sub&gt; = ${muC.toFixed(3)}&lt;br&gt;
μ&lt;sub&gt;F&lt;/sub&gt; = ${muF.toFixed(3)}&lt;br&gt;
μ&lt;sub&gt;G&lt;/sub&gt; = ${muG.toFixed(3)}&lt;br&gt;&lt;br&gt;

&lt;b&gt;(Le/d)&lt;sub&gt;max&lt;/sub&gt; = ${led_max.toFixed(2)}&lt;/b&gt;&lt;br&gt;
&lt;b&gt;(Le/d)&lt;sub&gt;actual&lt;/sub&gt; = ${led_actual.toFixed(2)}&lt;/b&gt;&lt;br&gt;&lt;br&gt;

Status = &lt;span class=&quot;${cls}&quot;&gt;${status}&lt;/span&gt;
`;
}
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/01/rcc-beam-deflection-check-is456-2025.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-2093594574620251882</guid><pubDate>Fri, 09 Jan 2026 10:52:00 +0000</pubDate><atom:updated>2026-01-09T16:22:44.078+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Design calculations</category><category domain="http://www.blogger.com/atom/ns#">Trending</category><title>Design of Pile Foundation by Indian Standards</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
    &lt;meta charset=&quot;UTF-8&quot;&gt;
    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
    &lt;title&gt;Design Consideration for Pile Foundation&lt;/title&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;&gt;&lt;/script&gt;
    &lt;script&gt;
        MathJax.Hub.Config({
            tex2jax: { inlineMath: [[&#39;$&#39;,&#39;$&#39;], [&#39;\\(&#39;,&#39;\\)&#39;]] }
        });
    &lt;/script&gt;
    &lt;style&gt;
        body {
            font-family: &quot;Times New Roman&quot;, Times, serif;
            line-height: 1.8;
            max-width: 960px;
            margin: 0 auto;
            padding: 20px;
            text-align: justify;
        }
        h1, h2, h3 {
            color: #333;
        }
        h1 { text-align: center; font-size: 2.2em; margin: 1em 0; }
        h2 { margin-top: 2.5em; border-bottom: 1px solid #ccc; padding-bottom: 0.4em; }
        h3 { margin-top: 1.8em; color: #444; }
        .formula {
            font-size: 1.1em;
            font-weight: bold;
            margin: 1em 0;
            text-align: center;
        }
        .definition {
            margin-left: 2em;
            font-style: italic;
        }
        img {
            max-width: 100%;
            height: auto;
            display: block;
            margin: 1.5em auto;
        }
        .center { text-align: center; }
        ul { margin-left: 1.8em; }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;h1&gt;DESIGN CONSIDERATION FOR PILE FOUNDATION&lt;/h1&gt;

&lt;p&gt;Pile foundations shall be designed in such a way that the load from the structure it supports can be transmitted to the soil without causing any soil failure and without causing such settlement, differential or total, under permanent or transient loading as may result in structural damage and/or functional distress. The pile shaft should have adequate structural capacity to withstand all loads (vertical, axial or otherwise) and moments which are to be transmitted to the subsoil.&lt;/p&gt;

&lt;p&gt;The ultimate load capacity of a pile may be estimated using a suitable static formula. However, it should preferably be determined by an initial load test on a trial pile.&lt;/p&gt;

&lt;p&gt;The settlement of a pile obtained at safe load/working load from load test results on a single pile shall not be directly used in forecasting the settlement of a structure unless experience from similar foundations on its settlement behaviour is available.&lt;/p&gt;

&lt;h2&gt;LOAD CARRYING CAPACITY OF PILES (Q&lt;sub&gt;f&lt;/sub&gt;)&lt;/h2&gt;

&lt;h3&gt;(A) Ultimate Load Carrying Capacity&lt;/h3&gt;
&lt;p&gt;The ultimate load carrying capacity or ultimate bearing capacity, or the ultimate bearing resistance Q&lt;sub&gt;f&lt;/sub&gt; of a pile is defined as the maximum load which can be carried by a pile, and at which the pile continues to sink without further increase of load.&lt;/p&gt;

&lt;h3&gt;The load carrying capacity of a pile can be determined by the following methods:&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Dynamic Formulae&lt;/li&gt;
    &lt;li&gt;Static Formulae&lt;/li&gt;
    &lt;li&gt;Pile Load Test&lt;/li&gt;
    &lt;li&gt;As per IRC-78 &amp; IS 14593&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;1. DYNAMIC FORMULAE&lt;/h3&gt;
&lt;p&gt;When a pile hammer hits the pile, the total driving energy is equal to the weight of hammer times the height of drop or stroke. In addition to this, in the case of double acting hammer, some energy is also imparted by the steam pressure during the return stroke. The total downward energy is consumed by the work done in penetrating the pile and by certain losses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The following are some of the commonly used dynamic formulae:&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;i) ENGINEERING NEWS FORMULA&lt;/h4&gt;
&lt;div class=&quot;formula&quot;&gt;\[ Q_a = \frac{W \cdot H}{F(S + C)} \]&lt;/div&gt;
&lt;div class=&quot;definition&quot;&gt;Q&lt;sub&gt;a&lt;/sub&gt; = allowable Load&lt;/div&gt;
&lt;div class=&quot;definition&quot;&gt;W = Weight of hammer, Kg&lt;/div&gt;
&lt;div class=&quot;definition&quot;&gt;H = Height of fall, cm&lt;/div&gt;
&lt;div class=&quot;definition&quot;&gt;F = Factor of safety = 6&lt;/div&gt;
&lt;div class=&quot;definition&quot;&gt;S = penetration per blow in cm&lt;/div&gt;
&lt;div class=&quot;definition&quot;&gt;C = empirical constant, generally = 2.5 cm&lt;/div&gt;

&lt;h4&gt;ii) HILEY’S FORMULA&lt;/h4&gt;
&lt;div class=&quot;formula&quot;&gt;\[ Q_f = \frac{\eta_h W H \eta_b}{S + \frac{C}{2}} \]&lt;/div&gt;
&lt;div class=&quot;definition&quot;&gt;Q&lt;sub&gt;f&lt;/sub&gt; = Ultimate bearing capacity&lt;/div&gt;
&lt;div class=&quot;definition&quot;&gt;C = C&lt;sub&gt;1&lt;/sub&gt; + C&lt;sub&gt;2&lt;/sub&gt; + C&lt;sub&gt;3&lt;/sub&gt; = total elastic compression&lt;/div&gt;
&lt;div class=&quot;definition&quot;&gt;η&lt;sub&gt;h&lt;/sub&gt; = Efficiency of hammer (Vary from 65% to 100%)&lt;/div&gt;
&lt;div class=&quot;definition&quot;&gt;η&lt;sub&gt;b&lt;/sub&gt; = Efficiency of hammer blow&lt;/div&gt;

&lt;h3&gt;2. STATIC FORMULAE&lt;/h3&gt;
&lt;p&gt;The static formulae are based on assumption that the Ultimate load carrying capacity &lt;strong&gt;(Q&lt;sub&gt;f&lt;/sub&gt;)&lt;/strong&gt; of a pile is the sum of the total ultimate Skin friction &lt;strong&gt;(R&lt;sub&gt;f&lt;/sub&gt;)&lt;/strong&gt; and total ultimate point or end bearing resistance &lt;strong&gt;(R&lt;sub&gt;p&lt;/sub&gt;)&lt;/strong&gt;.&lt;/p&gt;

&lt;div class=&quot;formula&quot;&gt;\[ Q_f = R_f + R_p \]&lt;/div&gt;
&lt;div class=&quot;formula&quot;&gt;\[ Q_f = A_s \times r_f + A_p \times r_p \]&lt;/div&gt;

&lt;p&gt;Where:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;A&lt;sub&gt;s&lt;/sub&gt; = Surface area of pile upon which the skin friction acts&lt;/li&gt;
    &lt;li&gt;A&lt;sub&gt;p&lt;/sub&gt; = Area of C/s of pile on which bearing resistance acts&lt;/li&gt;
    &lt;li&gt;r&lt;sub&gt;f&lt;/sub&gt; = Average skin friction&lt;/li&gt;
    &lt;li&gt;r&lt;sub&gt;p&lt;/sub&gt; = unit point or toe resistance&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;A factor of safety of 3 may be adopted for finding the allowable load.&lt;/em&gt;&lt;/p&gt;

&lt;!-- Part 1 ends here --&gt;
  
  &lt;!-- Continuation from Part 1 --&gt;

&lt;h4&gt;i) FOR COHESIVE SOIL&lt;/h4&gt;
&lt;div class=&quot;formula&quot;&gt;\[ Q_f = A_p \times N_c \times C_p + \alpha \times C \times A_s \]&lt;/div&gt;
&lt;p&gt;Where:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;N&lt;sub&gt;c&lt;/sub&gt; = Bearing capacity factor usually taken as 9&lt;/li&gt;
    &lt;li&gt;C&lt;sub&gt;p&lt;/sub&gt; = average cohesion at pile tip in kg/cm²&lt;/li&gt;
    &lt;li&gt;α = Reduction factor&lt;/li&gt;
    &lt;li&gt;C = avg. cohesion throughout the length of pile in kg/cm²&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;ii) FOR NON-COHESIVE SOIL&lt;/h4&gt;
&lt;!-- (Note: Original had incomplete formula - kept placeholder) --&gt;
&lt;p&gt;&lt;em&gt;(Formula for non-cohesive soil was incomplete in original document)&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;3. LOAD CARRYING CAPACITY FROM PILE LOAD TEST&lt;/h3&gt;
&lt;p&gt;The pile load test can be performed either on a working pile or on a test pile (trial pile).&lt;/p&gt;
&lt;p&gt;The ultimate load carrying capacity is preferably determined by an initial load test on trial pile.&lt;/p&gt;
&lt;p&gt;An initial load test should be conducted on a trial pile, particularly in any locality where experience of piling is not available. (&lt;strong&gt;For detailed methodology see chapter 5 testing of pile&lt;/strong&gt;)&lt;/p&gt;

&lt;h3&gt;4. LOAD CARRYING CAPACITY OF PILE IN ROCK AS PER IRC-78 &amp; IS 14593&lt;/h3&gt;

&lt;h4&gt;i) As per IRC-78&lt;/h4&gt;
&lt;div class=&quot;formula&quot;&gt;\[ Q_f = A_s \times q_s + A_p \times \frac{K_p \times q \times d_f}{\text{factor of safety}} \]&lt;/div&gt;
&lt;p&gt;q&lt;sub&gt;s&lt;/sub&gt; = ultimate shear along the socket&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;for hard rock = 50 Kg/cm²&lt;/li&gt;
    &lt;li&gt;For weathered rock = 20 kg/cm²&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;K&lt;sub&gt;p&lt;/sub&gt; = An empirical coefficient = (0.1 to 0.4)&lt;/p&gt;
&lt;p&gt;q = Average uniaxial compressive strength at the tip level&lt;/p&gt;
&lt;p&gt;d&lt;sub&gt;f&lt;/sub&gt; = depth factor = 1 + 0.4 × diameter of socket&lt;/p&gt;

&lt;h4&gt;ii) As per IS 14593&lt;/h4&gt;
&lt;div class=&quot;formula&quot;&gt;\[ Q_f = (q_c \times \pi \times D \times L_s \times \alpha \times \beta) + (q_c \times N_j \times N_d \times A_p) \]&lt;/div&gt;

&lt;h3&gt;Negative Skin Friction or Dragdown Force&lt;/h3&gt;
&lt;p&gt;When a soil stratum through which a pile shaft has penetrated into an underlying hard stratum, compresses as a result of either it being unconsolidated or it being under a newly placed fill or as a result of remoulding during driving of the pile, a drag down force is generated along the pile shaft up to a point in depth where the surrounding soil does not move downward relative to the pile shaft.&lt;/p&gt;

&lt;h2&gt;STRUCTURAL CAPACITY&lt;/h2&gt;
&lt;!-- Axial &amp; Lateral capacity content here (kept short for brevity in this example) --&gt;
&lt;!-- ... rest of structural capacity, spacing, reinforcement, pile cap design ... --&gt;

&lt;!-- Part 2 ends here - continue with case study in Part 3 --&gt;
  
  &lt;!-- Continuation from Part 2 --&gt;

&lt;h2&gt;DESIGN OF PILE FOUNDATION - A Case Study&lt;/h2&gt;

&lt;div style=&quot;margin-left: 2em;&quot;&gt;
    &lt;p&gt;&lt;strong&gt;Design of Pile foundation for Proposed Project having following design data.&lt;/strong&gt;&lt;/p&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;strong&gt;Type&lt;/strong&gt; = Multistoried Residential Building (Ground + 11 Storey)&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Floor to floor height&lt;/strong&gt; = 3.0 m&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Imposed Load&lt;/strong&gt; = As given in Appendix -B&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Exposure condition&lt;/strong&gt; = Moderate&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Earthquake Zone&lt;/strong&gt; = III, Zone factor = 0.16&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Basic wind speed at 10 m height&lt;/strong&gt; = 44 m/s&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Bearing capacity of soil&lt;/strong&gt; = 40 t/m² (as per soil investigation Report)&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Material&lt;/strong&gt; = M-30, Steel = Fe500&lt;/li&gt;
        &lt;li&gt;&lt;strong&gt;Design Philosophy&lt;/strong&gt;: Limit state Method conforming to IS 456-2000, IS-2911 Part-I section-2, IS 14593&lt;/li&gt;
    &lt;/ul&gt;

    &lt;div class=&quot;center&quot;&gt;
        &lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY_1PzktA6GDdpB5zPa2NX7374BYjINpiht95ji7ttw2sdHB5FbqEsTz4C_UrIwEktF2EbXaPxBJ6iqLCLKm5aZq9TocKa_UW1Wy668m2tqRokEJuu6xGwTV8KCejF7kTHPLTCjnE3hCg9nlPkl252LUGvDkO6SXy9AK1mnavpqv-l3K1EJuXyGiyxhg/w591-h539/pile%20foundation%20design%20example.png&quot; alt=&quot;Architectural Plan of Building&quot;&gt;
        &lt;p&gt;&lt;strong&gt;FIG. _______ ARCHITECTURAL PLAN OF BUILDING&lt;/strong&gt;&lt;/p&gt;
    &lt;/div&gt;

    &lt;h3&gt;STEP – 1: STRUCTURAL PLANNING&lt;/h3&gt;
    &lt;p&gt;The width of the beam will be kept 230 mm to meet the fire resistance requirements. The depth of the beam kept twice the width of beam.&lt;/p&gt;
    &lt;p&gt;The width of the column is kept 300 mm for earthquake requirement. The ratio of depth of column to width of column will be limited to 3.&lt;/p&gt;

    &lt;h3&gt;STEP – 2: ANALYSIS&lt;/h3&gt;
    &lt;p&gt;The analysis for this project is done in STAAD and load combination for different nodes (column) is converted into Excel format which are shown in appendix-A.&lt;/p&gt;

    &lt;div class=&quot;center&quot;&gt;
        &lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcHeTfSgAmHr7TVFxiaDiSdlM5j-_8CAwqppUkmYQCjEsAnkQCZxKU_NQvZ7EjFQSL2AAlasNa46sXQpmVcpbXOBOwLsKaSL9EFSIew4N6eW6JSJrNBiOybeNTiOi8L91nOsNiG-F6A7N0fSIYHe5oFpT8FPODUaZYQnf6ARLB-2jSFHB1ETU90ISvRw/w631-h402/node%20number.png&quot; alt=&quot;Node Numbers&quot;&gt;
        &lt;p&gt;&lt;strong&gt;Node Numbers&lt;/strong&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2fX6lcN2_7xK0fzTmLaM3P5e2Fl-6JPMdw0G0dWXUygxoN3PzV1Sp947JIMEL7CxSpIft6E9Zg2axZNtGdF-2beT6H5KTCoIAnGyOGuxpuHCl0fa50SA-rcpx-mJLJna3X47Snm8q3ycwbO81hOeF2XjD4GEAiJN8R3q5rQmfCweP8B-HeI7PlRQY9Q/w560-h719/building%20STAAD%20Model.png&quot; alt=&quot;Building STAAD Model&quot;&gt;
        &lt;p&gt;&lt;strong&gt;Building STAAD Model&lt;/strong&gt;&lt;/p&gt;
    &lt;/div&gt;

    &lt;h3&gt;STEP – 3: To Determine the Ultimate Load carrying capacity of Pile&lt;/h3&gt;
    &lt;p&gt;As per the soil investigation Report, The Average Uniaxial Compressive Strength = 411 Kg/cm² = 4110 t/m²&lt;/p&gt;
    &lt;p&gt;Assume the dia of pile = 500 mm, Length of Socket in Rock = 1000 mm&lt;/p&gt;

    &lt;div class=&quot;formula&quot;&gt;\[ Q_s = q_c \times N_j \times N_d \times A_p + q_c \times \pi \times D \times L_s \times \alpha \times \beta \]&lt;/div&gt;

    &lt;p&gt;Calculation yields: &lt;strong&gt;Q_s = 563.36 Tonne&lt;/strong&gt;&lt;/p&gt;

    &lt;p&gt;Structural capacity: &lt;strong&gt;Q = 125.6 Tonne&lt;/strong&gt;&lt;/p&gt;
    &lt;p&gt;&lt;strong&gt;Hence pile capacity is restricted to structural capacity = 125 t&lt;/strong&gt;&lt;/p&gt;

    &lt;h3&gt;STEP – 3: DESIGN OF PILE&lt;/h3&gt;

    &lt;h4&gt;i) Design of Main Reinforcement for Pile&lt;/h4&gt;
    &lt;p&gt;Provide: &lt;strong&gt;10 Nos – 16 mm dia bars&lt;/strong&gt; (A&lt;sub&gt;st&lt;/sub&gt; = 2009.60 mm² &gt; required)&lt;/p&gt;

    &lt;h4&gt;ii) Design of Lateral Ties&lt;/h4&gt;
    &lt;p&gt;Provide 8 mm dia lateral ties @ &lt;strong&gt;200 mm c/c&lt;/strong&gt;&lt;/p&gt;

    &lt;div class=&quot;center&quot;&gt;
        &lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixGoAs6sOdGwhrHjYNq50rvuypKtVazcuz4TCQSINj-BWHXUpNA_aR7kFnIdl1QTTbQ3I2i3mCIdBtcZ__P8VsCLJvpA8OehTP5Eem7_M7S9rPriE__MfKEI8IRbf7hsH8JWqezfhN-YvC2QI0bcnk6M6jXkMJ2_ABc6Elxsl2Jqjgf-5s1KlqZ6sgXA/s320/pile%20drawing.png&quot; alt=&quot;Pile Reinforcement Details&quot;&gt;
        &lt;p&gt;&lt;strong&gt;Fig. Reinforcement Details of Pile&lt;/strong&gt;&lt;/p&gt;
    &lt;/div&gt;

    &lt;h3&gt;STEP – 4: DESIGN OF PILE CAP&lt;/h3&gt;

    &lt;h4&gt;Example: Node No. 1 (Column size = 300 × 750 mm)&lt;/h4&gt;
    &lt;p&gt;Maximum axial load = 1901.323 kN&lt;/p&gt;
    &lt;p&gt;No. of piles required ≈ 1.52 → Adopt &lt;strong&gt;3 piles&lt;/strong&gt;&lt;/p&gt;

    &lt;!-- More detailed calculation for Node 1, punching shear, reinforcement etc. would follow here --&gt;
&lt;/div&gt;

&lt;!-- Part 3 ends here --&gt;
  
  &lt;!-- Continuation from Part 3 --&gt;

    &lt;h4&gt;Combined Node Example: Nodes 14 &amp; 15 (300 × 600 mm)&lt;/h4&gt;
    &lt;p&gt;Maximum Axial Load on Node 15 = 1920.57 kN&lt;/p&gt;
    &lt;p&gt;Adopt &lt;strong&gt;2 piles&lt;/strong&gt; per node (common pile cap)&lt;/p&gt;

    &lt;!-- Depth, reinforcement, shear checks as per original --&gt;

    &lt;h4&gt;Combined Node: Nodes 64 &amp; 83&lt;/h4&gt;
    &lt;p&gt;Maximum Axial Load on Node 64 = 2307.87 kN&lt;/p&gt;
    &lt;p&gt;Adopt &lt;strong&gt;3 piles&lt;/strong&gt;&lt;/p&gt;

    &lt;h4&gt;Combined Node: Nodes 5 &amp; 10&lt;/h4&gt;
    &lt;p&gt;Maximum Axial Load on Node 5 = 2586.53 kN&lt;/p&gt;
    &lt;p&gt;Adopt &lt;strong&gt;3 piles&lt;/strong&gt;&lt;/p&gt;

    &lt;div class=&quot;center&quot;&gt;
        &lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb04TOfv_UyyK-scmlS2uBTXdoFWz5XkOamPhayEa-OuMgcebTUqM2He3CW_LKkItnFDdDGQtxq6PHr8i_Etn3n6nbrwTktcvvPMT3JhpGCBn3jqOx0YIqBPgvYJB7wIAzYGho5veT3gr2oLitSfYUl7UDSf85Rz91Bjxv20wo_rR1TtqbslHwOsC8Lg/w481-h350/pile%20cap%205.png&quot; alt=&quot;Pile cap arrangement&quot;&gt;
        &lt;p&gt;&lt;strong&gt;Pile Cap Arrangement – Combined Nodes&lt;/strong&gt;&lt;/p&gt;
    &lt;/div&gt;

&lt;/div&gt;

&lt;h2&gt;TESTING OF PILE&lt;/h2&gt;

&lt;h3&gt;INTRODUCTION&lt;/h3&gt;
&lt;p&gt;Construction of pile foundations requires a careful choice of piling system depending upon the subsoil conditions, load characteristics of the structure and limitations of total and differential settlement.&lt;/p&gt;

&lt;p&gt;Installation of piles demands strict control of position, alignment and depth and involves specialised skill and experience. Hence testing of piles becomes necessary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Testing of piles is generally carried out for following reasons:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;To obtain back-calculated soil parameters for design of other piles.&lt;/li&gt;
    &lt;li&gt;To confirm pile lengths and hence contract costs.&lt;/li&gt;
    &lt;li&gt;To counter-check results from geotechnical and pile driving formulae.&lt;/li&gt;
    &lt;li&gt;To determine load–settlement behaviour for group settlement prediction.&lt;/li&gt;
    &lt;li&gt;To verify structural soundness of piles.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;PILE LOAD TEST&lt;/h2&gt;
&lt;p&gt;Pile load test is intended to validate computed capacity of pile foundation and also to provide information for improving design rational.&lt;/p&gt;

&lt;p&gt;Test to pile failure should preferably be conducted instead of testing only up to specified termination load.&lt;/p&gt;

&lt;p&gt;Pile load testing is carried out as per &lt;strong&gt;IS 2911 (Part 4)&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;Information required before pile testing:&lt;/h3&gt;
&lt;ul&gt;
    &lt;li&gt;Pile type, material and reinforcement details.&lt;/li&gt;
    &lt;li&gt;Method of driving with driving records.&lt;/li&gt;
    &lt;li&gt;Pile depth and cross-section details.&lt;/li&gt;
    &lt;li&gt;Type of test proposed.&lt;/li&gt;
    &lt;li&gt;Layout of pile group.&lt;/li&gt;
    &lt;li&gt;Water table depth and soil strata details with test results.&lt;/li&gt;
    &lt;li&gt;Safe and ultimate load capacity.&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- End of document --&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/01/design-of-pile-foundation-by-indian.html</link><author>noreply@blogger.com (Yogendra)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY_1PzktA6GDdpB5zPa2NX7374BYjINpiht95ji7ttw2sdHB5FbqEsTz4C_UrIwEktF2EbXaPxBJ6iqLCLKm5aZq9TocKa_UW1Wy668m2tqRokEJuu6xGwTV8KCejF7kTHPLTCjnE3hCg9nlPkl252LUGvDkO6SXy9AK1mnavpqv-l3K1EJuXyGiyxhg/s72-w591-h539-c/pile%20foundation%20design%20example.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1074964965522467583.post-1009348107393513243</guid><pubDate>Thu, 08 Jan 2026 05:24:14 +0000</pubDate><atom:updated>2026-01-08T11:03:51.125+05:30</atom:updated><title>Rig Based Bearing Capacity Estimator</title><description>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;UTF-8&quot;&gt;
&lt;title&gt;SR-115 Rig Based Multi-Strata Bearing Capacity Calculator&lt;/title&gt;
&lt;style&gt;
body{font-family:Arial;background:#eef2f6;padding:20px;}
.container{background:#fff;padding:25px;border-radius:10px;max-width:1000px;margin:auto;box-shadow:0 0 15px rgba(0,0,0,0.15);} 
h2{text-align:center;color:#003366;}
table{width:100%;border-collapse:collapse;margin-top:15px;}
td,th{border:1px solid #ccc;padding:10px;} 
input,select{width:100%;padding:6px;} 
button{background:#003366;color:#fff;padding:12px 20px;border:none;border-radius:5px;cursor:pointer;margin-top:15px;} 
.result{background:#eef4ff;padding:15px;margin-top:15px;border-radius:5px;} 
.note{font-size:13px;color:#555;margin-top:10px;} 
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;h2&gt;SR‑115 Rig Based Multi‑Strata Bearing Capacity Calculator&lt;/h2&gt;

&lt;table&gt;
&lt;tr&gt;&lt;th colspan=&quot;2&quot;&gt;Rig Input Parameters&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Depth (m)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;depth&quot; step=&quot;0.1&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Torque (kNm)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;torque&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Crowd Force (kN)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;crowd&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;RPM&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;rpm&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Penetration Rate (mm/min)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;pen&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;&lt;th colspan=&quot;2&quot;&gt;Strata Selection&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Soil / Rock Type&lt;/td&gt;
&lt;td&gt;
&lt;select id=&quot;soil&quot;&gt;
&lt;option value=&quot;sand&quot;&gt;Cohesionless Sand&lt;/option&gt;
&lt;option value=&quot;clay&quot;&gt;Cohesive Clay&lt;/option&gt;
&lt;option value=&quot;siltysand&quot;&gt;Silty Sand / Sand with fines&lt;/option&gt;
&lt;option value=&quot;gravel&quot;&gt;Gravel / Sandy Gravel&lt;/option&gt;
&lt;option value=&quot;silt&quot;&gt;Silt&lt;/option&gt;
&lt;option value=&quot;mixed&quot;&gt;Silty Clay / Mixed Soil&lt;/option&gt;
&lt;option value=&quot;softrock&quot;&gt;Weathered / Soft Rock&lt;/option&gt;
&lt;option value=&quot;hardrock&quot;&gt;Hard Rock&lt;/option&gt;
&lt;/select&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;&lt;th colspan=&quot;2&quot;&gt;Design Parameters&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Calibration Factor (k)&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;kfactor&quot; value=&quot;1&quot; step=&quot;0.1&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Factor of Safety&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;number&quot; id=&quot;fos&quot; value=&quot;2.5&quot; step=&quot;0.1&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;button onclick=&quot;calculate()&quot;&gt;CALCULATE&lt;/button&gt;
&lt;div class=&quot;result&quot; id=&quot;output&quot;&gt;&lt;/div&gt;

&lt;div class=&quot;note&quot;&gt;
&lt;b&gt;Engineering Basis:&lt;/b&gt;&lt;br&gt;
• DRI derived from torque, crowd &amp; penetration.&lt;br&gt;
• DRI correlated to SPT‑N (field calibration required).&lt;br&gt;
• Empirical bearing capacity correlations from geotechnical practice.&lt;br&gt;
• Final design must be verified by borehole &amp; load test.
&lt;/div&gt;
&lt;/div&gt;

&lt;script&gt;
function calculate(){
let depth=parseFloat(depthInput());
let torque=parseFloat(document.getElementById(&quot;torque&quot;).value);
let crowd=parseFloat(document.getElementById(&quot;crowd&quot;).value);
let rpm=parseFloat(document.getElementById(&quot;rpm&quot;).value);
let pen=parseFloat(document.getElementById(&quot;pen&quot;).value);
let soil=document.getElementById(&quot;soil&quot;).value;
let k=parseFloat(document.getElementById(&quot;kfactor&quot;).value);
let fos=parseFloat(document.getElementById(&quot;fos&quot;).value);

if(isNaN(torque)||isNaN(crowd)||isNaN(rpm)||isNaN(pen)){
alert(&quot;Please fill all rig inputs&quot;);return;}

/* STEP 1: Drilling Resistance Index */
let DRI=(crowd*torque)/pen;

/* STEP 2: DRI → SPT-N */
let N;
if(DRI&lt;50) N=3;
else if(DRI&lt;150) N=10;
else if(DRI&lt;300) N=22;
else if(DRI&lt;600) N=40;
else N=60;

N=N*k; // calibration

/* STEP 3: Bearing capacity */
let qa,qult,cu;
let note=&quot;&quot;;

switch(soil){
case &quot;sand&quot;:
qa=N*10;
qult=qa*fos;
note=&quot;Based on sand correlation qa=10N&quot;;
break;

case &quot;clay&quot;:
cu=5*N;
qult=5.7*cu;
qa=qult/fos;
note=&quot;Clay: Cu=5N, qult=5.7Cu&quot;;
break;

case &quot;siltysand&quot;:
qa=N*9;
qult=qa*fos;
note=&quot;Reduced friction due to fines&quot;;
break;

case &quot;gravel&quot;:
qa=N*16;
qult=qa*fos;
note=&quot;Higher interlock in gravel&quot;;
break;

case &quot;silt&quot;:
cu=4*N;
qult=5*cu;
qa=qult/fos;
note=&quot;Low strength fine soil&quot;;
break;

case &quot;mixed&quot;:
qa=N*7;
qult=qa*fos;
note=&quot;Mixed fine &amp; coarse soil&quot;;
break;

case &quot;softrock&quot;:
qa=600+N*20;
qult=qa*fos;
note=&quot;Weathered rock empirical model&quot;;
break;

case &quot;hardrock&quot;:
qa=1600+N*30;
qult=qa*fos;
note=&quot;Hard rock foundation class&quot;;
break;
}

/* OUTPUT */
let text=`
&lt;b&gt;Depth:&lt;/b&gt; ${depth} m&lt;br&gt;&lt;br&gt;

&lt;b&gt;1. Drilling Resistance Index&lt;/b&gt;&lt;br&gt;
DRI = (Crowd × Torque) / Penetration&lt;br&gt;
= (${crowd} × ${torque}) / ${pen}&lt;br&gt;
&lt;b&gt;DRI = ${DRI.toFixed(2)}&lt;/b&gt;&lt;br&gt;&lt;br&gt;

&lt;b&gt;2. Equivalent SPT-N&lt;/b&gt;&lt;br&gt;
Corrected N = ${N.toFixed(1)}&lt;br&gt;&lt;br&gt;

&lt;b&gt;3. Bearing Capacity&lt;/b&gt;&lt;br&gt;
${note}&lt;br&gt;
&lt;b&gt;Allowable qa = ${qa.toFixed(1)} kN/m²&lt;/b&gt;&lt;br&gt;
&lt;b&gt;Ultimate qult = ${qult.toFixed(1)} kN/m²&lt;/b&gt;&lt;br&gt;
`;

document.getElementById(&quot;output&quot;).innerHTML=text;
}

function depthInput(){return document.getElementById(&quot;depth&quot;).value||0;}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;https://yogipwd.blogspot.com/&lt;/div&gt;</description><link>https://www.yogipwd.com/2026/01/rig-based-bearing-capacity-estimator.html</link><author>noreply@blogger.com (Yogendra)</author><thr:total>0</thr:total></item></channel></rss>