Subversion Repositories SmartDukaan

Rev

Rev 37460 | Rev 37469 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37460 Rev 37468
Line 1580... Line 1580...
1580
    .xtable .cnt-pill.good {
1580
    .xtable .cnt-pill.good {
1581
      background: #e5f7ee;
1581
      background: #e5f7ee;
1582
      color: #177a3a
1582
      color: #177a3a
1583
    }
1583
    }
1584
 
1584
 
-
 
1585
    /* rbm performance dashboard (extracted from today_po_rbm) */
-
 
1586
    #rdrrPerfWrap {
-
 
1587
      overflow-x: auto
-
 
1588
    }
-
 
1589
 
-
 
1590
    #rdrrPerfWrap table {
-
 
1591
      width: 100%;
-
 
1592
      border-collapse: separate;
-
 
1593
      border-spacing: 0;
-
 
1594
      font-size: 12.5px;
-
 
1595
      background: #fff
-
 
1596
    }
-
 
1597
 
-
 
1598
    #rdrrPerfWrap table th, #rdrrPerfWrap table td {
-
 
1599
      padding: 9px 10px;
-
 
1600
      text-align: center;
-
 
1601
      vertical-align: middle;
-
 
1602
      border-bottom: 1px solid var(--line2);
-
 
1603
      color: var(--ink);
-
 
1604
      font-weight: 500
-
 
1605
    }
-
 
1606
 
-
 
1607
    #rdrrPerfWrap table thead th {
-
 
1608
      font-size: 10.5px;
-
 
1609
      text-transform: uppercase;
-
 
1610
      letter-spacing: .05em;
-
 
1611
      font-weight: 700;
-
 
1612
      background: #1d2433;
-
 
1613
      color: #fff;
-
 
1614
      border-bottom: 0;
-
 
1615
      padding: 10px 8px;
-
 
1616
      line-height: 1.2
-
 
1617
    }
-
 
1618
 
-
 
1619
    #rdrrPerfWrap table thead th small {
-
 
1620
      font-size: 9.5px;
-
 
1621
      color: rgba(255, 255, 255, .7);
-
 
1622
      font-weight: 600;
-
 
1623
      display: block;
-
 
1624
      margin-top: 2px
-
 
1625
    }
-
 
1626
 
-
 
1627
    /* per-column accent badges (keep original palette from today_po_rbm) */
-
 
1628
    #rdrrPerfWrap table thead th:nth-child(4) {
-
 
1629
      background: linear-gradient(180deg, #40c057, #2f9e44)
-
 
1630
    }
-
 
1631
 
-
 
1632
    #rdrrPerfWrap table thead th:nth-child(5) {
-
 
1633
      background: linear-gradient(180deg, #22b8cf, #0e959f)
-
 
1634
    }
-
 
1635
 
-
 
1636
    #rdrrPerfWrap table thead th:nth-child(6) {
-
 
1637
      background: linear-gradient(180deg, #ffa94d, #e8590c)
-
 
1638
    }
-
 
1639
 
-
 
1640
    #rdrrPerfWrap table thead th:nth-child(7) {
-
 
1641
      background: linear-gradient(180deg, #9775fa, #7048e8)
-
 
1642
    }
-
 
1643
 
-
 
1644
    #rdrrPerfWrap table thead th:nth-child(8) {
-
 
1645
      background: linear-gradient(180deg, #ffd43b, #e8ac00);
-
 
1646
      color: #3a2500
-
 
1647
    }
-
 
1648
 
-
 
1649
    #rdrrPerfWrap table thead th:nth-child(8) small {
-
 
1650
      color: rgba(58, 37, 0, .75)
-
 
1651
    }
-
 
1652
 
-
 
1653
    #rdrrPerfWrap table thead th:nth-child(9) {
-
 
1654
      background: linear-gradient(180deg, #ff922b, #e8590c)
-
 
1655
    }
-
 
1656
 
-
 
1657
    #rdrrPerfWrap table thead th:last-child {
-
 
1658
      background: linear-gradient(180deg, #ff6b6b, #e03131)
-
 
1659
    }
-
 
1660
 
-
 
1661
    #rdrrPerfWrap table tbody tr:hover {
-
 
1662
      background: #f6f8fd
-
 
1663
    }
-
 
1664
 
-
 
1665
    /* rank rows keep their original background tint from today_po_rbm inline style */
-
 
1666
    #rdrrPerfWrap table tbody tr td:nth-child(2) {
-
 
1667
      text-align: left;
-
 
1668
      font-weight: 700;
-
 
1669
      color: var(--ink)
-
 
1670
    }
-
 
1671
 
-
 
1672
    #rdrrPerfWrap table tbody tr td:first-child img {
-
 
1673
      width: 24px;
-
 
1674
      height: 24px
-
 
1675
    }
-
 
1676
 
-
 
1677
    #rdrrPerfWrap table tbody tr:first-child td {
-
 
1678
      font-weight: 700
-
 
1679
    }
-
 
1680
 
-
 
1681
    #rdrrPerfWrap table tbody tr td:last-child {
-
 
1682
      font-weight: 770;
-
 
1683
      font-size: 13.5px;
-
 
1684
      font-variant-numeric: tabular-nums
-
 
1685
    }
-
 
1686
 
-
 
1687
    /* purchase-milestones (brand × RBM) container — restyles the injected Bootstrap fragment */
-
 
1688
    #rdrrPmWrap {
-
 
1689
      overflow-x: auto
-
 
1690
    }
-
 
1691
 
-
 
1692
    #rdrrPmWrap table {
-
 
1693
      width: 100%;
-
 
1694
      border-collapse: separate;
-
 
1695
      border-spacing: 0;
-
 
1696
      font-size: 12.5px;
-
 
1697
      margin-bottom: 12px;
-
 
1698
      background: #fff
-
 
1699
    }
-
 
1700
 
-
 
1701
    #rdrrPmWrap table th, #rdrrPmWrap table td {
-
 
1702
      padding: 8px 8px;
-
 
1703
      border-bottom: 1px solid var(--line2);
-
 
1704
      border-right: 1px solid var(--line2);
-
 
1705
      text-align: right;
-
 
1706
      font-variant-numeric: tabular-nums;
-
 
1707
      color: var(--ink);
-
 
1708
      vertical-align: middle
-
 
1709
    }
-
 
1710
 
-
 
1711
    #rdrrPmWrap table th:first-child, #rdrrPmWrap table td:first-child {
-
 
1712
      text-align: left;
-
 
1713
      border-left: 1px solid var(--line2);
-
 
1714
      font-weight: 650;
-
 
1715
      position: sticky;
-
 
1716
      left: 0;
-
 
1717
      background: #fff;
-
 
1718
      z-index: 1;
-
 
1719
      min-width: 130px
-
 
1720
    }
-
 
1721
 
-
 
1722
    #rdrrPmWrap table thead th {
-
 
1723
      text-transform: uppercase;
-
 
1724
      letter-spacing: .04em;
-
 
1725
      font-size: 10.5px;
-
 
1726
      color: var(--soft);
-
 
1727
      font-weight: 700;
-
 
1728
      background: #fafbfe;
-
 
1729
      border-top: 1px solid var(--line);
-
 
1730
      border-bottom: 1px solid var(--line);
-
 
1731
      text-align: center
-
 
1732
    }
-
 
1733
 
-
 
1734
    #rdrrPmWrap table thead th[colspan] {
-
 
1735
      font-size: 12px;
-
 
1736
      padding: 8px 6px;
-
 
1737
      color: #fff
-
 
1738
    }
-
 
1739
 
-
 
1740
    #rdrrPmWrap table thead th p {
-
 
1741
      margin: 0;
-
 
1742
      font-size: 13px;
-
 
1743
      font-weight: 770;
-
 
1744
      letter-spacing: .01em;
-
 
1745
      line-height: 1.1
-
 
1746
    }
-
 
1747
 
-
 
1748
    #rdrrPmWrap table thead tr:first-child th:first-child {
-
 
1749
      background: #fafbfe;
-
 
1750
      color: var(--soft)
-
 
1751
    }
-
 
1752
 
-
 
1753
    #rdrrPmWrap table tbody tr:hover {
-
 
1754
      background: #f6f8fd
-
 
1755
    }
-
 
1756
 
-
 
1757
    #rdrrPmWrap table tbody tr:hover td:first-child {
-
 
1758
      background: #f6f8fd
-
 
1759
    }
-
 
1760
 
-
 
1761
    #rdrrPmWrap table tr.green td {
-
 
1762
      background: #eaf7ef !important;
-
 
1763
      font-weight: 770;
-
 
1764
      color: #177a3a
-
 
1765
    }
-
 
1766
 
-
 
1767
    #rdrrPmWrap table tr.green td:first-child {
-
 
1768
      background: #eaf7ef !important;
-
 
1769
      color: #177a3a
-
 
1770
    }
-
 
1771
 
-
 
1772
    /* known brand accents (extend as more brands appear) */
-
 
1773
    #rdrrPmWrap table thead th.vivo {
-
 
1774
      background: linear-gradient(180deg, #00baf2, #0a8fb5)
-
 
1775
    }
-
 
1776
 
-
 
1777
    #rdrrPmWrap table thead th.oppo {
-
 
1778
      background: linear-gradient(180deg, #20a558, #177a3a)
-
 
1779
    }
-
 
1780
 
-
 
1781
    #rdrrPmWrap table thead th.samsung {
-
 
1782
      background: linear-gradient(180deg, #0b3d91, #071e51)
-
 
1783
    }
-
 
1784
 
-
 
1785
    #rdrrPmWrap table thead th.alcatel {
-
 
1786
      background: linear-gradient(180deg, #5c7cfa, #3b5bdb)
-
 
1787
    }
-
 
1788
 
-
 
1789
    #rdrrPmWrap table thead th.motorola {
-
 
1790
      background: linear-gradient(180deg, #495057, #212529)
-
 
1791
    }
-
 
1792
 
-
 
1793
    #rdrrPmWrap table thead th.hmd {
-
 
1794
      background: linear-gradient(180deg, #7048e8, #5b34c9)
-
 
1795
    }
-
 
1796
 
-
 
1797
    #rdrrPmWrap table thead th.xiaomi {
-
 
1798
      background: linear-gradient(180deg, #ffa726, #e8590c)
-
 
1799
    }
-
 
1800
 
-
 
1801
    #rdrrPmWrap table thead th.lava {
-
 
1802
      background: linear-gradient(180deg, #e03131, #a11515)
-
 
1803
    }
-
 
1804
 
-
 
1805
    #rdrrPmWrap table thead th.poco {
-
 
1806
      background: linear-gradient(180deg, #ffd43b, #e8ac00);
-
 
1807
      color: #3a2500
-
 
1808
    }
-
 
1809
 
-
 
1810
    #rdrrPmWrap table thead th.realme {
-
 
1811
      background: linear-gradient(180deg, #f59f00, #e8590c)
-
 
1812
    }
-
 
1813
 
-
 
1814
    #rdrrPmWrap table thead th.apple {
-
 
1815
      background: linear-gradient(180deg, #495057, #141a2b)
-
 
1816
    }
-
 
1817
 
-
 
1818
    #rdrrPmWrap table thead th.oneplus {
-
 
1819
      background: linear-gradient(180deg, #e03131, #a11515)
-
 
1820
    }
-
 
1821
 
-
 
1822
    #rdrrPmWrap table thead th.tecno {
-
 
1823
      background: linear-gradient(180deg, #0ca678, #087a56)
-
 
1824
    }
-
 
1825
 
-
 
1826
    #rdrrPmWrap table thead th.ai + {
-
 
1827
      background: linear-gradient(180deg, #7048e8, #5b34c9)
-
 
1828
    }
-
 
1829
 
-
 
1830
    #rdrrPmWrap table thead th.total {
-
 
1831
      background: linear-gradient(180deg, #3b5bdb, #28449e)
-
 
1832
    }
-
 
1833
 
-
 
1834
    /* default gradient for any unmapped brand */
-
 
1835
    #rdrrPmWrap table thead th[colspan]:not(.vivo):not(.oppo):not(.samsung):not(.alcatel):not(.motorola):not(.hmd):not(.xiaomi):not(.lava):not(.poco):not(.realme):not(.apple):not(.oneplus):not(.tecno):not(.total) {
-
 
1836
      background: linear-gradient(180deg, var(--brand2), var(--brand))
-
 
1837
    }
-
 
1838
 
-
 
1839
    #rdrrPmWrap table td.currency {
-
 
1840
      font-weight: 600
-
 
1841
    }
-
 
1842
 
1585
    @media (max-width: 960px) {
1843
    @media (max-width: 960px) {
1586
      .kpis {
1844
      .kpis {
1587
        grid-template-columns:repeat(2, 1fr)
1845
        grid-template-columns:repeat(2, 1fr)
1588
      }
1846
      }
1589
 
1847
 
Line 1735... Line 1993...
1735
        <div class="spinner"></div>
1993
        <div class="spinner"></div>
1736
        Loading&hellip;
1994
        Loading&hellip;
1737
      </div>
1995
      </div>
1738
    </div>
1996
    </div>
1739
  </div>
1997
  </div>
-
 
1998
 
-
 
1999
  <!-- RBM Performance Dashboard (MTD) — extracted from /indent/today_po_rbm without any backend change -->
-
 
2000
  <div class="sectionlabel">RBM Performance Dashboard (MTD)</div>
-
 
2001
  <div class="card">
-
 
2002
    <div class="card-hd">
-
 
2003
      <div>
-
 
2004
        <h2>Composite MTD Ranking</h2>
-
 
2005
        <p class="desc">Rank of RBMs by weighted score across Talk Time (10%) + MTD Achievement (55%) + Aging (2%) +
-
 
2006
          &gt;1L Partners (29%) + Rating (2%) + Partners Rated (2%).</p>
-
 
2007
      </div>
-
 
2008
      <span class="badge-period" id="rdrrPerfMonth">MTD</span>
-
 
2009
    </div>
-
 
2010
    <div id="rdrrPerfWrap">
-
 
2011
      <div class="loading">
-
 
2012
        <div class="spinner"></div>
-
 
2013
        Loading&hellip;
-
 
2014
      </div>
-
 
2015
    </div>
-
 
2016
  </div>
-
 
2017
 
-
 
2018
  <!-- RBM Call Target Summary — full interactive page embedded via iframe (no backend change) -->
-
 
2019
  <div class="sectionlabel">RBM Call Target Summary</div>
-
 
2020
  <div class="card">
-
 
2021
    <div class="card-hd">
-
 
2022
      <div>
-
 
2023
        <h2>Today's Call Coverage per RBM</h2>
-
 
2024
        <p class="desc">Full interactive view — all popups, drill-downs and downloads work exactly like the standalone
-
 
2025
          page.</p>
-
 
2026
      </div>
-
 
2027
      <a class="badge-period" href="/indent/rbm_call_target" target="_blank" style="text-decoration:none">Open in new
-
 
2028
        tab &rsaquo;</a>
-
 
2029
    </div>
-
 
2030
    <iframe id="rdrrCallFrame" src="/indent/rbm_call_target" title="RBM Call Target Summary"
-
 
2031
            style="width:100%;min-height:800px;border:0;border-radius:10px;background:#fff;display:block"></iframe>
-
 
2032
  </div>
-
 
2033
 
-
 
2034
  <!-- Today PO & Billed — Brand × RBM matrix (reuses /indent/today_po_table_fragment) -->
-
 
2035
  <div class="sectionlabel">Today PO &amp; Billed — Brand &times; RBM</div>
-
 
2036
  <div class="card">
-
 
2037
    <div class="card-hd">
-
 
2038
      <div>
-
 
2039
        <h2>Purchase Milestones by Brand</h2>
-
 
2040
        <p class="desc">Today's PO value / partner count / total billed, per RBM &times; brand. Always today
-
 
2041
          (independent of the range picker above).</p>
-
 
2042
      </div>
-
 
2043
      <select id="rdrrPmCategory" class="ctl" style="min-width:170px;height:34px;padding:6px 12px">
-
 
2044
        <option value="RBM">All RBMs</option>
-
 
2045
        <option value="NSM">All NSMs</option>
-
 
2046
        <option value="RSM">All RSMs</option>
-
 
2047
        <option value="BM">All BMs</option>
-
 
2048
        <option value="DM">All DMs</option>
-
 
2049
        <option value="CM">All CMs</option>
-
 
2050
        <option value="ASM">All ASMs</option>
-
 
2051
      </select>
-
 
2052
    </div>
-
 
2053
    <div id="rdrrPmWrap">
-
 
2054
      <div class="loading">
-
 
2055
        <div class="spinner"></div>
-
 
2056
        Loading&hellip;
-
 
2057
      </div>
-
 
2058
    </div>
-
 
2059
  </div>
1740
</div>
2060
</div>
1741
 
2061
 
1742
<!-- achieved-vs-pending modal (opens from the RBMs ≥ 100% Target KPI card) -->
2062
<!-- achieved-vs-pending modal (opens from the RBMs ≥ 100% Target KPI card) -->
1743
<div class="status-back" id="rdrrStatusBack">
2063
<div class="status-back" id="rdrrStatusBack">
1744
  <div class="status-modal">
2064
  <div class="status-modal">
Line 2320... Line 2640...
2320
                '</div>';
2640
                '</div>';
2321
      });
2641
      });
2322
      return html;
2642
      return html;
2323
    }
2643
    }
2324
 
2644
 
-
 
2645
    // ------------------------- Today PO & Billed matrix -------------------------
-
 
2646
    // Reuses the existing /indent/today_po_table_fragment endpoint (unchanged).
-
 
2647
    // Injects the returned HTML and restyles it via #rdrrPmWrap CSS.
-
 
2648
    function loadPurchaseMilestones() {
-
 
2649
      var cat = $("#rdrrPmCategory").val() || "RBM";
-
 
2650
      $("#rdrrPmWrap").html('<div class="loading"><div class="spinner"></div>Loading&hellip;</div>');
-
 
2651
      $.ajax({
-
 
2652
        url: "/indent/today_po_table_fragment",
-
 
2653
        type: "GET",
-
 
2654
        data: {categoryType: cat},
-
 
2655
        success: function (html) {
-
 
2656
          $("#rdrrPmWrap").html(html);
-
 
2657
          $("#rdrrPmWrap .currency").each(function () {
-
 
2658
            var elem = $(this);
-
 
2659
            var n = parseInt(elem.text().replace(/[^\d.-]/g, ""), 10);
-
 
2660
            if (!isNaN(n)) elem.text(numberToIndianCurrency(n));
-
 
2661
          });
-
 
2662
        },
-
 
2663
        error: function () {
-
 
2664
          $("#rdrrPmWrap").html('<div class="empty">Failed to load purchase-milestones data.</div>');
-
 
2665
        }
-
 
2666
      });
-
 
2667
    }
-
 
2668
 
-
 
2669
    function numberToIndianCurrency(n) {
-
 
2670
      if (n === 0) return "0";
-
 
2671
      var s = n.toString();
-
 
2672
      var lastThree = s.substring(s.length - 3);
-
 
2673
      var other = s.substring(0, s.length - 3);
-
 
2674
      if (other !== "") lastThree = "," + lastThree;
-
 
2675
      return other.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + lastThree;
-
 
2676
    }
-
 
2677
 
-
 
2678
    $("#rdrrPmCategory").on("change", loadPurchaseMilestones);
-
 
2679
 
-
 
2680
    // ------------------------- RBM Performance Dashboard (MTD) -------------------------
-
 
2681
    // No dedicated backend endpoint exists — the perf-dashboard table is only rendered
-
 
2682
    // inline in /indent/today_po_rbm. We fetch that page and extract just the table.
-
 
2683
    // Trade-off: heavier request (server re-runs full page prep). Consider adding a
-
 
2684
    // /rbm-drr/performance fragment endpoint later if this becomes a hot path.
-
 
2685
    function loadPerformanceDashboard() {
-
 
2686
      $("#rdrrPerfWrap").html('<div class="loading"><div class="spinner"></div>Loading&hellip;</div>');
-
 
2687
      $.ajax({
-
 
2688
        url: "/indent/today_po_rbm",
-
 
2689
        type: "GET",
-
 
2690
        dataType: "html",
-
 
2691
        success: function (fullHtml) {
-
 
2692
          var doc = new DOMParser().parseFromString(fullHtml, "text/html");
-
 
2693
          var tbl = doc.querySelector("#performance-dashboard-table");
-
 
2694
          if (!tbl) {
-
 
2695
            $("#rdrrPerfWrap").html('<div class="empty"><div class="ei">📊</div>No performance dashboard data available yet.</div>');
-
 
2696
            return;
-
 
2697
          }
-
 
2698
          // Fix any relative image paths (e.g. king.png / trophy-cup.png) to be root-relative.
-
 
2699
          tbl.querySelectorAll("img").forEach(function (im) {
-
 
2700
            var src = im.getAttribute("src") || "";
-
 
2701
            if (src.indexOf("resources/") !== -1 && src.charAt(0) !== "/") {
-
 
2702
              im.setAttribute("src", "/" + src.replace(/^\.\.\/+/, ""));
-
 
2703
            }
-
 
2704
          });
-
 
2705
          $("#rdrrPerfWrap").empty().append(tbl);
-
 
2706
        },
-
 
2707
        error: function () {
-
 
2708
          $("#rdrrPerfWrap").html('<div class="empty">Failed to load performance dashboard.</div>');
-
 
2709
        }
-
 
2710
      });
-
 
2711
    }
-
 
2712
 
2325
    // initial load
2713
    // initial load
2326
    load();
2714
    load();
-
 
2715
    loadPurchaseMilestones();
-
 
2716
    loadPerformanceDashboard();
2327
  })();
2717
  })();
2328
</script>
2718
</script>
2329
</body>
2719
</body>
2330
</html>
2720
</html>