MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0750) :  /home2/imyrqtmy/public_html/mauryamarriagebureau/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/mauryamarriagebureau/search_profiles.php
<?php
// Database connection
include("admin/includes/config.php");

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Capture form inputs
$gender = isset($_GET['gender']) ? $_GET['gender'] : ''; // Capturing gender filter
$age_range = isset($_GET['age_range']) ? $_GET['age_range'] : '';
$address = isset($_GET['address']) ? $_GET['address'] : ''; // Capture address keyword

// Build the SQL query
$sql = "SELECT * FROM profiles WHERE 1=1";

// Add condition for gender
if (!empty($gender)) {
    if ($gender === "Men") {
        $sql .= " AND category_id = 1"; // Show only data for Men (category_id = 1)
    } elseif ($gender === "Women") {
        $sql .= " AND category_id = 2"; // Show only data for Women (category_id = 2)
    }
}

// Add conditions for age range
if (!empty($age_range)) {
    $age_parts = explode('-', $age_range);
    $min_age = $age_parts[0];
    $max_age = $age_parts[1];
    $sql .= " AND age BETWEEN $min_age AND $max_age";
}

// Add condition for address keyword (case-insensitive search)
if (!empty($address)) {
    $address_keyword = $conn->real_escape_string($address); // Escaping address input to prevent SQL injection
    // echo "<p>Address filter: $address_keyword</p>"; 
    // Debugging address keyword
    $sql .= " AND address LIKE '%" . $address_keyword . "%'"; // Partial match with '%'
}



// Execute the query
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // echo "<h2>Search Results:</h2>";
    while ($row = $result->fetch_assoc()) {
        // echo "<p>Name: " . $row['name'] . ", Age: " . $row['age'] . ", Address: " . $row['address'] . ", Category: " . $row['category_id'] . "</p>";
    }
} else {
    echo "<p>No profiles found matching your criteria.</p>";
}

$conn->close();
?>


<!doctype html>
<html lang="en">


<?php require "inc/head.php"; ?>

<body>
  

    <!-- HEADER & MENU -->
    <?php require "inc/header.php"; ?>
    <!-- END USER PROFILE MENU POPUP -->

    <!-- SUB-HEADING -->


    <section>
        <div class="all-pro-head">
            <div class="container">
                <div class="row">
                    <h1>Lakhs of Happy Marriages</h1>
                    <a href="sign-up.php">Join now for Free <i class="fa fa-handshake-o" aria-hidden="true"></i></a>
                </div>
            </div>
        </div>
        <!--FILTER ON MOBILE VIEW-->
        <div class="fil-mob fil-mob-act">
            <h4>Profile filters <i class="fa fa-filter" aria-hidden="true"></i> </h4>
        </div>
    </section>
    <!-- END -->

    <!-- START -->

               
    <section>
        <div class="all-weddpro all-jobs all-serexp chosenini">
            <div class="container">
                <div class="row">
                  
                    <div class="col-md-12">
                      
                        <div class="all-list-sh">
                            <ul>

                            <?php
                        $result = $conn->query($sql);
                        if ($result->num_rows > 0) {
                        while ($row = $result->fetch_assoc()) {

                            ?>
                                <li>
                                    <div class="all-pro-box user-avil-onli" data-useravil="avilyes"
                                        data-aviltxt="Available online">
                                      
                                        <div class="pro-img">
                                            <a href="profile-details.php?id=<?php echo $row['id']; ?>">
                                                <img src="<?php echo "vendor/profile/" . $row['photo']; ?>" alt="">
                                            </a>
                                            <!-- <div class="pro-ave" title="User currently available">
                                                <span class="pro-ave-yes"></span>
                                            </div> -->
                                           
                                        </div>
                            
                                        <div class="pro-detail">
                                            <h4><a href="profile-details.php?id=<?php echo $row['id']; ?>"><?php echo $row['name']; ?></a></h4>
                                            <div class="pro-bio">
                                                <span><?php echo $row['degree']; ?></span>
                                                <span><?php echo $row['position']; ?> </span>
                                                <span><?php echo $row['age']; ?> Yeard old</span>
                                                <span>Height: <?php echo $row['height']; ?></span>
                                            </div>
                                            <div class="links">
                                                <!-- <span class="cta-chat">Chat now</span> -->
                                              
                                                <a href="https://wa.me/<?php echo $row['mobile']; ?>">WhatsApp</a>
                                                <!-- <a href="#!" class="cta cta-sendint" data-bs-toggle="modal" data-bs-target="#sendInter">Send interest</a> -->
                                                <a href="profile-details.php?id=<?php echo $row['id']; ?>">More detaiils</a>
                                            </div>
                                        </div>
                                       
                                      
                                    </div>
                                </li>

                                <?php 
                            }
                           
                        }
                            ?>
                             
                              

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

   
    <!-- END -->


    <!-- INTEREST POPUP -->
    <div class="modal fade" id="sendInter">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">

                <!-- Modal Header -->
                <div class="modal-header">
                    <h4 class="modal-title seninter-tit">Send interest to <span class="intename2">Jolia</span></h4>
                    <button type="button" class="close" data-bs-dismiss="modal">&times;</button>
                </div>

                <!-- Modal body -->
                <div class="modal-body seninter">
                    <div class="lhs">
                        <img src="images/profiles/1.jpg" alt="" class="intephoto2">
                    </div>
                    <div class="rhs">
                        <h4>Permissions: <span class="intename2">Jolia</span> Can able to view the below details</h4>
                        <ul>
                            <li>
                                <div class="chbox">
                                    <input type="checkbox" id="pro_about" checked="">
                                    <label for="pro_about">About section</label>
                                </div>
                            </li>
                            <li>
                                <div class="chbox">
                                    <input type="checkbox" id="pro_photo">
                                    <label for="pro_photo">Photo gallery</label>
                                </div>
                            </li>
                            <li>
                                <div class="chbox">
                                    <input type="checkbox" id="pro_contact">
                                    <label for="pro_contact">Contact info</label>
                                </div>
                            </li>
                            <li>
                                <div class="chbox">
                                    <input type="checkbox" id="pro_person">
                                    <label for="pro_person">Personal info</label>
                                </div>
                            </li>
                            <li>
                                <div class="chbox">
                                    <input type="checkbox" id="pro_hobbi">
                                    <label for="pro_hobbi">Hobbies</label>
                                </div>
                            </li>
                            <li>
                                <div class="chbox">
                                    <input type="checkbox" id="pro_social">
                                    <label for="pro_social">Social media</label>
                                </div>
                            </li>
                        </ul>
                        <div class="form-floating">
                            <textarea class="form-control" id="comment" name="text"
                                placeholder="Comment goes here"></textarea>
                            <label for="comment">Write some message to <span class="intename"></span></label>
                        </div>
                    </div>
                </div>

                <!-- Modal footer -->
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary">Send interest</button>
                    <button type="button" class="btn btn-outline-danger" data-dismiss="modal">Cancel</button>
                </div>

            </div>
        </div>
    </div>
    <!-- END INTEREST POPUP -->

    <!-- CHAT CONVERSATION BOX START -->
    <div class="chatbox">
        <span class="comm-msg-pop-clo"><i class="fa fa-times" aria-hidden="true"></i></span>

        <div class="inn">
            <form name="new_chat_form" method="post">
                <div class="s1">
                    <img src="images/user/2.jpg" class="intephoto2" alt="">
                    <h4><b class="intename2">Julia</b>,</h4>
                    <span class="avlsta avilyes">Available online</span>
                </div>
                <div class="s2 chat-box-messages">
                    <span class="chat-wel">Start a new chat!!! now</span>
                    <div class="chat-con">
                        <div class="chat-lhs">Hi</div>
                        <div class="chat-rhs">Hi</div>
                    </div>
                   
                </div>
                <div class="s3">
                    <input type="text" name="chat_message" placeholder="Type a message here.." required="">
                    <button id="chat_send1" name="chat_send" type="submit">Send <i class="fa fa-paper-plane-o"
                            aria-hidden="true"></i>
                    </button>
                </div>
            </form>
        </div>
    </div>
    <!-- END -->


    <!-- FOOTER -->
   <?php require "inc/footer.php" ?>
    <!-- END -->
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="js/jquery.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/select-opt.js"></script>
    <script src="js/custom.js"></script>
</body>


</html>

MMCT - 2023