HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/nclive/wp-content/plugins/nc_plugin/nc_state.php
<?php
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$url_slug = basename($actual_link);

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

global $wpdb;
$TT_EXAM = "sp_exam";
$TT_EXAM_LINKS = "sp_exam_links";
$TT_EXAM_CATEGORY = "sp_exam_category";
$TT_EXAM_ENTITY = "sp_exam_entity";
$TT_CITIES = "sp_city";
$TT_STATES = "sp_states";
$TT_KVS_NAVODYA = "sp_kvs_navodya";
$TT_INSTITUTION = "sp_institutions";
$TT_INSTITUTION_CATEGORY = "sp_institutions_category";

$limit = 51; // content limit
$state_id = 0; //define state id
/*************** to get details of kvs school as per state id  ***************/
$stateDetail = $wpdb->get_row("SELECT state_id, state_name, state_adv, h1_title, state_img, state_description, latitude, longitude FROM $TT_STATES WHERE state_slug='$url_slug'");
if ($stateDetail) {
    $state_id = $stateDetail->state_id;
    $state_name = $stateDetail->state_name;
    $state_img = $stateDetail->state_img;
    $h1_title = $stateDetail->h1_title;
}

/*************** to get details for sarkari exam as per state id  ***************/
$examDetail = $wpdb->get_results("select e.exam_id, e.url_slug, e.exam_summary, e.exam_name, c.img_icon FROM $TT_EXAM as e LEFT JOIN $TT_EXAM_CATEGORY as c ON c.cat_id=e.cat_id LEFT JOIN $TT_STATES as s on s.state_id=e.state_id WHERE e.status!='0' and e.state_id='$state_id' order by e.add_date desc limit $limit");
$examCount = $wpdb->num_rows;

/*************** to get details of kvs school as per state id  ***************/
$kvsDetail = $wpdb->get_results("SELECT k.id, k.url_slug, k.name, s.image_icon, c.city, k.address FROM $TT_KVS_NAVODYA as k LEFT JOIN $TT_STATES as s on s.state_id=k.state_id LEFT JOIN $TT_CITIES as c on c.city_id=k.city_id WHERE k.status='1' and k.state_id='$state_id' and k.type='KVS' ORDER BY k.update_date desc");
$kvsCount = $wpdb->num_rows;
/*************** to get details of kvs school as per state id  ***************/
$nvsDetail = $wpdb->get_results("SELECT k.id, k.url_slug, k.name, s.image_icon, c.city, k.address FROM $TT_KVS_NAVODYA as k LEFT JOIN $TT_STATES as s on s.state_id=k.state_id LEFT JOIN $TT_CITIES as c on c.city_id=k.city_id WHERE k.status='1' and k.state_id='$state_id' and k.type='NVS' ORDER BY k.update_date desc");
$nvsCount = $wpdb->num_rows;

// to get details of universoity institute as per state id
$instituteDetail = $wpdb->get_results("SELECT i.id, i.institutions_name, ic.category_name, s.image_icon, c.city, i.address FROM $TT_INSTITUTION AS i LEFT JOIN $TT_INSTITUTION_CATEGORY AS ic ON ic.id=i.category_id LEFT JOIN $TT_STATES AS s on s.state_id = i.state_id LEFT JOIN $TT_CITIES AS c ON c.city_id=i.city_id where i.status='1' and i.state_id='$state_id' order by i.display_order");
$instituteCount = $wpdb->num_rows;

?>


<!-- STATE PAGE HEADER SECTION -->

<section class="StatePageheaderSection">
    <div class="StatePageheaderSectionbg" <?php if ($state_img != '') { ?> style="background: url(<?php echo '/images/' . $state_img; ?>) center center;background-size: cover;" <?php } ?>></div>

    <div class="container">
        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <h2><?php echo $state_name; ?></h2>
                <?php if ($h1_title != '') { ?>
                    <h1><?php echo $h1_title; ?></h1>
                <?php } ?>
                <p><a href="/">Home</a> / <a href="/state/">All State</a> / <?php echo $state_name; ?></p>

                <div class="tab StateDetailsBoxFlex wow fadeInDown">
                    <button class="tablinks active" onclick="openExam(event, 'SE')"><i class="fa fa-book"></i> Sarkari Exam</button>
                    <button class="tablinks" onclick="openExam(event, 'JNV')"><i class="fa fa-graduation-cap"></i> Navodaya Vidyalaya (JNV)</button>
                    <button class="tablinks" onclick="openExam(event, 'KVS')"><i class="fa fa-graduation-cap"></i> Kendriya Vidyalaya (KVS)</button>
                    <button class="tablinks" onclick="openExam(event, 'UI')"><i class="fa fa-university"></i> University / Institution</button>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- END STATE PAGE HEADER SECTION -->

<!-- STATE PAGE DETAILS SECTION -->

<section class="StatePageDetailsSection">
    <div class="container">
        <!-- Display-Horizontal-Full -->
        <ins class="adsbygoogle"
            style="display:block"
            data-ad-client="ca-pub-2967295438144070"
            data-ad-slot="7766773989"
            data-ad-format="auto"
            data-full-width-responsive="true"></ins>
        <script>
            (adsbygoogle = window.adsbygoogle || []).push({});
        </script>

        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="SearchSarkariExamsFormFlex wow fadeInUp">
                    <div class="SearchSarkariExamsForm">
                        <h4 id="search_heading">Search Sarkari Exams</h4>
                        <form action="" id="form-id" onkeydown="if(event.keyCode === 13) { return false; }">
                            <i class="fas fa-search"></i>
                            <input type="text" name="search_data" id="search_data" onkeyup="checkSearch()" placeholder="Sarkari Exam Name...">
                        </form>
                    </div>
                    <div style="width: 22%;text-align: right;">
                        <a href="/state-board-exam/" class="StateBoardExamsBtn">State Board Exams</a>
                    </div>
                </div>
                <div id="SE" class="tabcontent check" style="display: block;">
                    <div class="SearchStateExamsBox wow fadeInUp">
                        <div class="row">
                            <div class="col-md-12 col-sm-12 col-xs-12">
                                <h3>Show <span id="countSEData"><b><?php echo $examCount; ?></b></span> Count </h3>
                            </div>
                            <?php if ($examCount > 0) {  ?>
                                <div id="sarkari-exam" class="examList">
                                    <?php foreach ($examDetail as $exam) {
                                        $exam_id = $exam->exam_id;
                                        /*************** to get entity name as per state id ***************/
                                        $linkDetail = $wpdb->get_results("SELECT distinct n.name,l.display_text,l.update_date FROM $TT_EXAM_LINKS as l LEFT JOIN $TT_EXAM_ENTITY as n ON n.id=l.entity_id WHERE l.status!='0' and n.status!='0' and exam_id='$exam_id' order by l.update_date desc limit 2");
                                    ?>
                                        <div class="col-md-4 col-sm-4 col-xs-12">
                                            <div class="NotificationExamBox wow fadeInUp">
                                                <a href="/exam-details/<?php echo $exam->url_slug; ?>/">
                                                    <div class="NotificationExamFlexBox">
                                                        <?php if ($exam->img_icon != '') { ?>
                                                            <img src="/images/<?php echo $exam->img_icon; ?>" alt="">
                                                        <?php } ?>
                                                        <div class="NotificationExamBoxDetails">
                                                            <?php echo $exam->exam_name; ?>
                                                            <h6>
                                                                <?php if (strlen($exam->exam_summary) < 90) {
                                                                    echo $exam->exam_summary;
                                                                } else {
                                                                    echo substr($exam->exam_summary, 0, 90) . "...";
                                                                } ?>
                                                            </h6>
                                                            <p>
                                                                <?php $i = 1;
                                                                foreach ($linkDetail as $link) { ?>
                                                                    <?php if ($i % 2 == 0) { ?><span style="background: #03a84e;"><?php echo $link->name; ?></span> <?php } else { ?> <span style="background: #ed2551;"><?php echo $link->name; ?></span><?php } ?>
                                                                <?php $i++;
                                                                } ?>
                                                            </p>
                                                        </div>
                                                    </div>
                                                </a>
                                            </div>
                                        </div>
                                    <?php  } ?>
                                </div>

                                <div class="col-md-12 col-sm-12 col-xs-12">
                                    <div class="loadmore">
                                        <input type="button" id="loadBtn" class="SeeMoreBtn wow fadeInUp" value="See More">
                                        <input type="hidden" id="data_row" value="0">
                                    </div>
                                    <a id="showBlankData" style="display:none;" href="/state/<?php echo $url_slug; ?>" class="SeeMoreBtn wow fadeInUp"></a>
                                </div>

                            <?php } else { ?>
                                <div class="col-md-8 col-sm-8 col-xs-12">
                                    <a href="/">No information available: Click here to go on home page</a>
                                </div>
                            <?php } ?>
                        </div>
                    </div>
                </div>

                <div id="JNV" class="tabcontent">
                    <div class="SearchStateExamsBox wow fadeInUp">
                        <div class="row">
                            <div class="col-md-12 col-sm-12 col-xs-12">
                                <h3>Show <b><?php echo $nvsCount; ?></b> Count</h3>
                            </div>
                            <?php if ($nvsCount > 0) {  ?>
                                <div id="nvs-exam">
                                    <?php foreach ($nvsDetail as $nvs) {  ?>
                                        <div class="col-md-4 col-sm-4 col-xs-12">
                                            <div class="NotificationExamBox wow fadeInUp">
                                                <div class="NotificationExamFlexBox">
                                                    <?php if ($nvs->image_icon != '') { ?>
                                                        <img src="/images/<?php echo $nvs->image_icon; ?>" alt="">
                                                    <?php } ?>
                                                    <div class="NotificationExamBoxDetails jnvBox">
                                                        <a href="/nvs/<?php echo $nvs->url_slug; ?>/"><?php echo $nvs->name; ?></a>
                                                        <h6><?php echo $nvs->city; ?></h6>
                                                        <p><span> <i class="fas fa-map-marker-alt"></i> <?php echo $nvs->address; ?></span></p>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    <?php } ?>
                                </div>
                            <?php } else { ?>
                                <div class="col-md-8 col-sm-8 col-xs-12">
                                    <a href="<?php echo $actual_link; ?>">No information available: Click here to load all data</a>
                                </div>
                            <?php } ?>
                        </div>
                    </div>
                </div>

                <div id="KVS" class="tabcontent">
                    <div class="SearchStateExamsBox wow fadeInUp">
                        <div class="row">
                            <div class="col-md-12 col-sm-12 col-xs-12">
                                <h3>Show <b><?php echo $kvsCount; ?></b> Count</h3>
                            </div>
                            <?php if ($kvsCount > 0) {  ?>
                                <div id="kvs-exam">
                                    <?php foreach ($kvsDetail as $kvs) {    ?>
                                        <div class="col-md-4 col-sm-4 col-xs-12">
                                            <div class="NotificationExamBox wow fadeInUp">
                                                <div class="NotificationExamFlexBox">
                                                    <?php if ($kvs->image_icon != '') { ?>
                                                        <img src="/images/<?php echo $kvs->image_icon; ?>" alt="">
                                                    <?php } ?>
                                                    <div class="NotificationExamBoxDetails jnvBox">
                                                        <a href="/kvs/<?php echo $kvs->url_slug; ?>/"><?php echo $kvs->name; ?></a>
                                                        <h6><?php echo $kvs->city; ?></h6>
                                                        <p><span> <i class="fas fa-map-marker-alt"></i> <?php echo $kvs->address; ?> </span></p>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    <?php } ?>
                                </div>
                            <?php } else { ?>
                                <div class="col-md-8 col-sm-8 col-xs-12">
                                    <a href="<?php echo $actual_link; ?>">No information available: Click here to load all data</a>
                                </div>
                            <?php } ?>
                        </div>
                    </div>
                </div>

                <div id="UI" class="tabcontent">
                    <div class="SearchStateExamsBox wow fadeInUp">
                        <div class="row">
                            <div class="col-md-12 col-sm-12 col-xs-12">
                                <h3>Show <b><?php echo $instituteCount; ?></b> Count</h3>
                            </div>
                            <?php if ($instituteCount > 0) {  ?>
                                <div id="ui-exam">
                                    <?php foreach ($instituteDetail as $inst) { ?>
                                        <div class="col-md-4 col-sm-4 col-xs-12">
                                            <div class="NotificationExamBox wow fadeInUp">
                                                <div class="NotificationExamFlexBox">
                                                    <?php if ($inst->image_icon != '') { ?>
                                                        <img src="/images/<?php echo $inst->image_icon; ?>" alt="">
                                                    <?php } ?>
                                                    <div class="NotificationExamBoxDetails jnvBox">
                                                        <a href="#"><?php echo $inst->institutions_name; ?></a>
                                                        <p><span> <i class="fas fa-map-marker-alt"></i> <?php echo $inst->city; ?> </span> <span> <i class="fas fa-globe-asia"></i> <?php echo $inst->address; ?> </span></p>
                                                        <span class="TagsNotificationExam"><?php echo $inst->category_name; ?></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    <?php } ?>
                                </div>
                            <?php } else { ?>
                                <div class="col-md-8 col-sm-8 col-xs-12">
                                    <a href="<?php echo $actual_link; ?>">No information available: Click here to load all data</a>
                                </div>
                            <?php } ?>
                        </div>
                    </div>
                </div>

                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="DisclaimerBox wow fadeInUp">
                        <h4>DISCLAIMER</h4>
                        <p>All the given information is sourced from public domains and is likely to change without prior notice. GEPL makes every effort to provide you the latest and correct information but is not responsible for authenticity and veracity of the given information. Students are encouraged to lookout for the official websites of the given institutions to corroborate.</p>
                    </div>
                </div>
            </div>
        </div>
</section>

<div class="modal fade" id="StatePageMap" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Modal Header</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12 modal_body_map">
                        <div class="location-map" id="map_location">
                            <div style="width: 600px; height: 400px;" id="show_map"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>

    </div>
</div>
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>

<script>
    function openExam(evt, cityName) {
        var i, tabcontent, tablinks;
        tabcontent = document.getElementsByClassName("tabcontent");
        for (i = 0; i < tabcontent.length; i++) {
            tabcontent[i].style.display = "none";
            tabcontent[i].className = tabcontent[i].className.replace(" check", "");
        }
        tablinks = document.getElementsByClassName("tablinks");
        for (i = 0; i < tablinks.length; i++) {
            tablinks[i].className = tablinks[i].className.replace(" active", "");
        }
        document.getElementById(cityName).style.display = "block";
        evt.currentTarget.className += " active";

        document.getElementById(cityName).className += " check";
        // Sarkari Exam = Navodaya Vidyalaya (JNV) = Kendriya Vidyalaya = University / Institution

        if (cityName == 'JNV') {
            document.getElementById("search_data").placeholder = "Navodaya Vidyalaya Name...";
            document.getElementById("search_data").value = '';
            document.getElementById("search_heading").textContent = "Search Navodaya Vidyalaya";
            document.getElementById("search_heading").value = '';
        } else if (cityName == 'KVS') {
            document.getElementById("search_data").placeholder = "Kendriya Vidyalaya Name...";
            document.getElementById("search_data").value = '';
            document.getElementById("search_heading").textContent = "Search Kendriya Vidyalaya";
            document.getElementById("search_heading").value = '';
        } else if (cityName == 'UI') {
            document.getElementById("search_data").placeholder = "University / Institution Name...";
            document.getElementById("search_data").value = '';
            document.getElementById("search_heading").textContent = "Search University / Institution";
            document.getElementById("search_heading").value = '';
        } else {
            document.getElementById("search_data").placeholder = "Sarkari Exam Name...";
            document.getElementById("search_data").value = '';
            document.getElementById("search_heading").textContent = "Search Sarkari Exam";
            document.getElementById("search_heading").value = '';
        }
    }

    // search data as per state name and tab
    function checkSearch() {
        var search = document.getElementById("search_data");
        var search_val = search.value.toLowerCase();
        var tabcontent = document.getElementsByClassName('check')[0].id;

        if (tabcontent == 'JNV') {
            var mainDiv = document.getElementById('nvs-exam');
        } else if (tabcontent == 'KVS') {
            var mainDiv = document.getElementById('kvs-exam');
        } else if (tabcontent == 'UI') {
            var mainDiv = document.getElementById('ui-exam');
        } else {
            var mainDiv = document.getElementById('sarkari-exam');
        }

        var a = mainDiv.getElementsByTagName('div');
        for (var i = 0; i < a.length; i++) {
            if (a[i].innerText.toLowerCase().includes(search_val)) {
                a[i].style.display = "";
                // console.log(a[i].length );
            } else {
                a[i].style.display = "none";
            }
        }
    }
</script>

<script>
    $(document).ready(function() {

        // load more button
        $(document).on('click', '#loadBtn', function() {
            var data_row = Number($('#data_row').val());
            var row_count = $('#countData').text();
            var filter = $("input[name='get_data']:checked").val();
            var limit = <?php echo $limit; ?>;
            var state_id = '<?php echo $state_id; ?>';
            data_row = data_row + limit;
            $('#data_row').val(data_row);

            var url = '/wp-content/plugins/nc_plugin/api/nc_sarkari_exam_data.php';
            $.ajax({
                url: url,
                type: 'POST',
                data: {
                    'data_row': data_row,
                    "state_id": state_id,
                    'limit': limit
                },
                success: function(data) {
                    var rowCount = data_row + limit;
                    $('.examList').append(data);
                    $('#countSEData').html(rowCount);
                    var pagenum = $('input[name="page_count"]').val();
                    var totalnum = $('input[name="data_row_count"]').val();

                    console.log(pagenum);
                    console.log(totalnum);

                    if (parseInt(totalnum) > parseInt(pagenum)) {
                        $("#loadBtn").show();
                        $('#showBlankData').css("display", "none");
                        $('#showBlankData').html('')
                    } else {
                        $("#loadBtn").hide();
                        $('#showBlankData').css("display", "block");
                        $('#showBlankData').html('No information available: Click here to load all sarkari exam')
                    }
                }
            });
        });

    });
</script>


<!-- END STATE PAGE DETAILS SECTION -->