<div class="row">
    <div class="col-lg-12">
        <div class="card cardXX d-flex position-relative flex-column cardBg pr3" style="padding-top:0px">
            <div class="row" style="height:60px">
                <div class="col-lg-3">
                    <div class="btnSection">
                        <div class="form-group">
                            <label for="cmd">Current Month</label>
                            <select class="form-control ss" id="cmd" onchange="applyF();">
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="pmd">Previous Month</label>
                            <select class="form-control ss" id="pmd" onchange="applyF();">
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row mt-1 mb-0 ml-2 mr-2 section1">
                <!-- Overall Section -->
                <div class="col-lg-6 pr2">
                    <h5 class="div-head" >
                        <b style="font-weight:500">Current Month (<span id="currentmonthname"></span>) (Base:<span id="currentmonthbase"></span>)</b>
                    </h5>
                    <div class="left-section">
                        <table class="tblA table table-striped table-bordered no-footer text-center display animate__animated animate__fadeInLeft current_tbl" id="current_tbl" cellpadding="0" cellspacing="0">
                            <thead>
                                <tr style="display:none"><td colspan="4"><span class="tbl_filter_show"></span></td></tr>
                                <tr style="display:none"><td colspan="4"><span class="tbl_base_show"></span></td></tr>
                                <tr>    
                                    <th class="dashed_border"></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/filpkart.png" alt="" srcset=""></br><span style="display:none">Flipkart</span></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/amazon.png" alt="" srcset=""></br><span style="display:none">Amazon</span></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/meesho.png" alt="" srcset=""></br><span style="display:none">Meesho</span></th>
                                </tr>
                            </thead>
                            <tbody>
                            <?php
                                foreach ($domain as $key => $value) 
                                {
                                    if($value=="Overall")
                                    {
                                        echo '<tr>';
                                        echo '<th class="tbodyCat '.$value.'_td main_td" rowspan="3">' . $value . '</th>';
                                        
                                        foreach ($brand as $key2 => $value2) {
                                            echo '<td class="dashed_border">
                                                    <div class="tdContent">
                                                        <span class="nps_count nps_count2" id="nps_count_C_'.($key+1).'_'.($key2+1).'">-</span>
                                                    </div>
                                                </td>';
                                        }
                                        echo '</tr>';
                                        
                                        echo '<tr>';
                                        foreach ($brand as $key2 => $value2) 
                                        {
                                            echo '
                                            <td class="" style="border:none !important">
                                                <div class="tdContent">
                                                    <span class="promoterTd">P</span>
                                                    <span class="passiveTd">N</span>
                                                    <span class="detractorTd">D</span>
                                                </div>
                                                
                                            </td>';
                                        }
                                        echo '</tr>';
                                        echo '<tr>';
                                        foreach ($brand as $key2 => $value2) 
                                        {
                                            echo '
                                            <td class="" style="background-color:white;border:none !important;padding-top:0px !important">
                                                <div class="tdContent">
                                                    <span class="solid_border" id="promoterTd_C_'.($key+1).'_'.($key2+1).'">-</span>
                                                    <span class="solid_border2" id="passiveTd_C_'.($key+1).'_'.($key2+1).'">-</span>
                                                    <span class="solid_border" id="detractorTd_C_'.($key+1).'_'.($key2+1).'">-</span>
                                                </div>
                                            </td>';
                                        }
                                        echo '</tr>';
                                    }
                                    else
                                    {
                                        echo '<tr>';
                                        echo '<th class="tbodyCat '.$value.'_td">' . $value . '</th>';
                                        
                                        foreach ($brand as $key2 => $value2) {
                                            echo '<td class="dashed_border">
                                                    <div class="tdContent">
                                                        <span class="nps_count" id="nps_count_C_'.($key+1).'_'.($key2+1).'">-</span>
                                                    </div>
                                                </td>';
                                        }
                                        echo '</tr>';
                                    }
                                }
                            ?>
                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- LOB Section -->
                <div class="col-lg-6 pr5">
                    <h5 class="div-head" >
                        <b style="font-weight:500">Delta VS Previous Month (<span id="previousmonthname"></span>) (Base:<span id="previousmonthbase"></span>)</b>
                    </h5>
                    <div class="right-section">
                        <table class="tblA table table-striped table-bordered no-footer text-center display animate__animated animate__fadeInRight" id="previous_tbl" cellpadding="0" cellspacing="0">
                            <thead>
                                <tr style="display:none"><td colspan="4"><span class="tbl_filter_show"></span></td></tr>
                                <tr style="display:none"><td colspan="4"><span class="tbl_base_show"></span></td></tr>
                                <tr>    
                                    <th class="dashed_border"></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/filpkart.png" alt="" srcset=""></br><span style="display:none">Flipkart</span></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/amazon.png" alt="" srcset=""></br><span style="display:none">Amazon</span></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/meesho.png" alt="" srcset=""></br><span style="display:none">Meesho</span></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                    foreach ($domain as $key => $value) 
                                    {
                                        if($value=="Overall")
                                        {
                                            echo '<tr>';
                                            echo '<th class="tbodyCat '.$value.'_td main_td" rowspan="3">' . $value . '</th>';
                                            
                                            foreach ($brand as $key2 => $value2) {
                                                echo '<td class="dashed_border">
                                                        <div class="tdContent">
                                                            <span class="nps_count nps_count2" id="nps_count_P_'.($key+1).'_'.($key2+1).'">-</span>
                                                        </div>
                                                    </td>';
                                            }
                                            echo '</tr>';
                                            
                                            echo '<tr>';
                                            foreach ($brand as $key2 => $value2) 
                                            {
                                                echo '
                                                <td class="" style="border:none !important">
                                                    <div class="tdContent">
                                                        <span class="promoterTd">P</span>
                                                        <span class="passiveTd">N</span>
                                                        <span class="detractorTd">D</span>
                                                    </div>
                                                </td>';
                                            }
                                            echo '</tr>';

                                            echo '<tr>';
                                            foreach ($brand as $key2 => $value2) 
                                            {
                                                echo '
                                                <td class="" style="background-color:white;border:none !important;padding-top:0px !important">
                                                    <div class="tdContent">
                                                        <span class="solid_border" id="promoterTd_P_'.($key+1).'_'.($key2+1).'">-</span>
                                                        <span class="solid_border2" id="passiveTd_P_'.($key+1).'_'.($key2+1).'">-</span>
                                                        <span class="solid_border" id="detractorTd_P_'.($key+1).'_'.($key2+1).'">-</span>
                                                    </div>
                                                </td>';
                                            }
                                            echo '</tr>';
                                        }
                                        else
                                        {
                                            echo '<tr>';
                                            echo '<th class="tbodyCat '.$value.'_td">' . $value . '</th>';
                                            
                                            foreach ($brand as $key2 => $value2) {
                                                echo '<td class="dashed_border">
                                                        <div class="tdContent">
                                                            <span class="nps_count" id="nps_count_P_'.($key+1).'_'.($key2+1).'">-</span>
                                                        </div>
                                                    </td>';
                                            }
                                            echo '</tr>';
                                        }
                                    }
                                ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--  -->

<div class="row mt-2">
    <div class="col-lg-12">
        <div class="card cardXX d-flex position-relative flex-column cardBg pr3" style="padding-top:0px">
            <select class="js-select2 form-control slectX" name="domainDrop" id="domainDrop" onchange="domainDropC(this.id);">
                <?php
                    echo '<option value="0">-SELECT DOMAIN-</option>';
                    foreach($domain as $key => $value) {
                        if($key!=0)
                        {
                            echo '<option value='.($key+1).'>'.$value.'</option>';
                        }
                    }
                ?>
            </select>
            <div class="dropDownSelect2 pr2 ml-2"></div>
            <div class="domainbasediv ml-2">
                <span class="dbb" id="domainbasedivF"></span>
                <span class="dbb" id="domainbasedivA"></span>
                <span class="dbb" id="domainbasedivM"></span>
            </div>
            <div class="domainbasediv ml-2">
                <span class="dbb" id="domainbasedivF2"></span>
                <span class="dbb" id="domainbasedivA2"></span>
                <span class="dbb" id="domainbasedivM2"></span>
            </div>
            <div class="row mt-1 mb-0 ml-2 mr-2 section1">
                <!-- Overall Section -->
                <div class="col-lg-6 pr2">
                    <h5 class="div-head" >
                        <b style="font-weight:500">Current Month (<span id="currentmonthname2"></span>) (Base:<span id="currentmonthbase2"></span>)</b>
                    </h5>
                    <div class="left-section">
                        <table class="tblA table table-striped table-bordered no-footer text-center display animate__animated animate__fadeInLeft" id="sd_current_tbl" cellpadding="0" cellspacing="0">
                            <thead>
                                <tr style="display:none"><td colspan="4"><span class="tbl_filter_show"></span></td></tr>
                                <tr style="display:none"><td colspan="4"><span class="tbl_base_show"></span></td></tr>
                                <tr>    
                                    <th class="dashed_border"></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/filpkart.png" alt="" srcset=""></br><span style="display:none">Flipkart</span></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/amazon.png" alt="" srcset=""></br><span style="display:none">Amazon</span></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/meesho.png" alt="" srcset=""></br><span style="display:none">Meesho</span></th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td colspan="4">Please select domain</td>
                                </tr>
                            </tbody>
                        </table>
                        <!-- <h6 class="redcolor" id="LBTEXT" style="display:none;text-align:end;font-size:0.7rem">LB means Lower Base: NPS not visible</h6> -->
                    </div>
                </div>
                <!-- LOB Section -->
                <div class="col-lg-6 pr5">
                    <h5 class="div-head" >
                        <!-- (Jan'25) Base:<span id="previousmonthbase2"></span> -->
                        <b style="font-weight:500">Delta VS Previous Month (<span id="previousmonthname2"></span>) (Base:<span id="previousmonthbase2"></span>)</b>
                    </h5>
                    <div class="right-section">
                        <table class="tblA table table-striped table-bordered no-footer text-center display animate__animated animate__fadeInRight" id="sd_previous_tbl" cellpadding="0" cellspacing="0">
                            <thead>
                                <tr style="display:none"><td colspan="4"><span class="tbl_filter_show"></span></td></tr>
                                <tr style="display:none"><td colspan="4"><span class="tbl_base_show"></span></td></tr>
                                <tr>    
                                    <th class="dashed_border"></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/filpkart.png" alt="" srcset=""></br><span style="display:none">Flipkart</span></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/amazon.png" alt="" srcset=""></br><span style="display:none">Amazon</span></th>
                                    <th class="dashed_border"><img class="brand_img" src="assets/images/meesho.png" alt="" srcset=""></br><span style="display:none">Meesho</span></th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td colspan="4">Please select domain</td>
                                </tr>
                            </tbody>
                        </table>
                        <h6 class="redcolor" id="LBTEXT2" style="display:none;text-align:end;font-size:0.5rem;font-style:italic">LB - Low Base : NPS not visible</h6>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>