MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 18.190.160.6
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0750) :  /home2/ppcad7no/snackpoint.co.nz/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/snackpoint.co.nz/locations.php
<style>
    #loc {
        background-color:#eeeeee;
    }

    #loc h2 span {
        color: #ebbc2d;
    }

    .loc-inner ul li {
        list-style: none;
        margin-bottom: 8px;
    }

    .loc-inner ul li a {
        text-decoration: none;
        color: #141414;
    }


    .loc-inner ul li:hover {
        transform: translateX(8px);
        transition: 0.4s ease-in-out;
    }


    .loc-inner ul li:hover a {
        color: #9a7f33;

    }
</style>
<section id="loc" class="pb-2">
    <h2 class="text-center py-5">Area <span> We Covered</span></h2>
    <div class="container">
        <div class="row" id="locationContainer">
            <?php
                $sqlloc = "SELECT * FROM `tbl_location` LIMIT 8";
                $runloc = mysqli_query($db, $sqlloc) or die("Query Not run");
                while ($dataloc = mysqli_fetch_assoc($runloc)) {
            ?>
                <div class="col-lg-3 text-start">
                    <div class="loc-inner">
                        <ul>
                            <li><a href="<?php echo $wspath ?><?php echo $dataloc['loc_slug']; ?>"><i class="fa fa-caret-right" aria-hidden="true"></i> <?php echo $dataloc['loc_name'] ?></a></li>
                        </ul>
                    </div>
                </div>
            <?php
                }
            ?>
        </div>
        <div class="text-center mt-3">
            <button id="readMoreBtn" class="btn btn-primary btn-hover-dark mt-3">View More Location</button>
            <a href="<?php echo $wspath?>all-locations.html"><button class="btn btn-secondary btn-hover-dark mt-3">View All Location</button></a>
        </div>
        
    </div>

    <script>
        var offset = 8;

        document.getElementById('readMoreBtn').addEventListener('click', function() {
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function() {
                if (xhr.readyState == 4 && xhr.status == 200) {
                    var newLocations = JSON.parse(xhr.responseText);
                    var locationContainer = document.getElementById('locationContainer');
                    newLocations.forEach(function(location) {
                        var newLocationElement = document.createElement('div');
                        newLocationElement.className = 'col-lg-3 text-start';
                        newLocationElement.innerHTML = '<div class="loc-inner"><ul><li><a href="' + location.wspath + location.loc_slug + '"><i class="fa fa-caret-right" aria-hidden="true"></i> ' + location.loc_name + '</a></li></ul></div></div>';
                        locationContainer.appendChild(newLocationElement);
                    });
                    offset += 8;
                }
            };
            xhr.open('GET', 'get_more_locations.php?offset=' + offset, true);
            xhr.send();
        });
    </script>
</section>

MMCT - 2023