:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/soulmeetvivah.com/member/php/**
:: Editing File: search.php
<?php include('header.php'); ?> <div style="height: 100px;"></div> <!-- ==========Search Section Start Here========== --> <div class="page-content"> <div class="container"> <!-- Search Header --> <div class="block-box user-about mb-4"> <div class="widget-heading" style="background: linear-gradient(135deg, #cd4252 0%, #b83847 100%); padding: 25px; border-radius: 15px 15px 0 0;"> <h3 style="color: #fff; margin: 0; font-size: 28px; font-weight: 600;"> <i class="icofont-search-2" style="margin-right: 10px;"></i>Search Profiles </h3> <p style="color: rgba(255,255,255,0.9); margin: 10px 0 0 0; font-size: 16px;">Find your perfect match using basic or advanced search</p> </div> </div> <!-- Search Type Tabs --> <div class="block-box user-about"> <ul class="nav nav-tabs modern-tabs mb-4" id="searchTabs" role="tablist" style="border-bottom: 2px solid #e0e0e0;"> <li class="nav-item" role="presentation"> <button class="nav-link active modern-tab-btn" id="basic-tab" data-bs-toggle="tab" data-bs-target="#basic-search" type="button" role="tab"> <i class="icofont-id-card" style="margin-right: 8px;"></i>Basic Search </button> </li> <li class="nav-item" role="presentation"> <button class="nav-link modern-tab-btn" id="advanced-tab" data-bs-toggle="tab" data-bs-target="#advanced-search" type="button" role="tab"> <i class="icofont-filter" style="margin-right: 8px;"></i>Advanced Search </button> </li> </ul> <div class="tab-content" id="searchTabsContent"> <!-- Basic Search Tab --> <div class="tab-pane fade show active" id="basic-search" role="tabpanel"> <div class="search-form-container"> <form id="basicSearchForm" action="javascript:void(0);"> <div class="row"> <div class="col-md-8"> <div class="form-group mb-3"> <label for="riv_id" class="form-label modern-label"> <i class="icofont-id-card" style="margin-right: 5px; color: #cd4252;"></i>SV ID </label> <input type="text" class="form-control modern-input" id="riv_id" name="riv_id" placeholder="Enter SV ID (e.g., SV00000)" required> <small class="form-text text-muted modern-help-text"> <i class="icofont-info-circle"></i> Enter the exact SV ID to search for a specific profile </small> </div> </div> <div class="col-md-4 d-flex align-items-end"> <button type="submit" class="btn modern-search-btn w-100"> <i class="icofont-search-2" style="margin-right: 8px;"></i>Search </button> </div> </div> </form> </div> </div> <!-- Advanced Search Tab --> <div class="tab-pane fade" id="advanced-search" role="tabpanel"> <div class="search-form-container"> <form id="advancedSearchForm" action="javascript:void(0);"> <div class="search-section"> <h5 class="section-title"><i class="icofont-search-2"></i> General Search</h5> <div class="row"> <div class="col-md-6 mb-3"> <label for="search_text" class="form-label modern-label"> <i class="icofont-search-1" style="margin-right: 5px; color: #cd4252;"></i>Search Text </label> <input type="text" class="form-control modern-input" id="search_text" name="search_text" placeholder="Search in all fields..."> <small class="form-text text-muted modern-help-text">Search across name, location, profession, education, etc.</small> </div> <div class="col-md-3 mb-3"> <label for="age_from" class="form-label modern-label"> <i class="icofont-calendar" style="margin-right: 5px; color: #cd4252;"></i>Age From </label> <input type="number" class="form-control modern-input" id="age_from" name="age_from" min="18" max="100" placeholder="Min Age"> </div> <div class="col-md-3 mb-3"> <label for="age_to" class="form-label modern-label"> <i class="icofont-calendar" style="margin-right: 5px; color: #cd4252;"></i>Age To </label> <input type="number" class="form-control modern-input" id="age_to" name="age_to" min="18" max="100" placeholder="Max Age"> </div> </div> </div> <div class="search-section"> <h5 class="section-title"><i class="icofont-heart"></i> Personal Details</h5> <div class="row"> <div class="col-md-4 mb-3"> <label for="marital_status" class="form-label modern-label"> <i class="icofont-heart-alt" style="margin-right: 5px; color: #cd4252;"></i>Marital Status </label> <select class="form-control modern-input" id="marital_status" name="marital_status"> <option value="">All</option> <option value="Never Married">Never Married</option> <option value="Divorced">Divorced</option> <option value="Widowed">Widowed</option> <option value="Separated">Separated</option> </select> </div> <div class="col-md-4 mb-3"> <label for="religion" class="form-label modern-label"> <i class="icofont-religious-alt" style="margin-right: 5px; color: #cd4252;"></i>Religion </label> <select class="form-control modern-input" id="religion" name="religion"> <option value="">All Religions</option> </select> </div> <div class="col-md-4 mb-3"> <label for="caste" class="form-label modern-label"> <i class="icofont-users-alt-5" style="margin-right: 5px; color: #cd4252;"></i>Caste </label> <select class="form-control modern-input" id="caste" name="caste"> <option value="">All Castes</option> </select> </div> </div> </div> <div class="search-section"> <h5 class="section-title"><i class="icofont-briefcase"></i> Professional & Location</h5> <div class="row"> <div class="col-md-4 mb-3"> <label for="living_in" class="form-label modern-label"> <i class="icofont-location-pin" style="margin-right: 5px; color: #cd4252;"></i>Living In </label> <select class="form-control modern-input" id="living_in" name="living_in"> <option value="">All Locations</option> </select> </div> <div class="col-md-4 mb-3"> <label for="working_as" class="form-label modern-label"> <i class="icofont-briefcase" style="margin-right: 5px; color: #cd4252;"></i>Profession </label> <select class="form-control modern-input" id="working_as" name="working_as"> <option value="">All Professions</option> <optgroup label="Accounting, Banking & Finance"></optgroup> <option value="Banking Professional">Banking Professional</option> <option value="Chartered Accountant">Chartered Accountant</option> <option value="Company Secretary">Company Secretary</option> <option value="Finance Professional">Finance Professional</option> <option value="Investment Professional">Investment Professional</option> <option value="Accounting Professional (Others)">Accounting Professional (Others)</option> <optgroup label="Administration & HR"></optgroup> <option value="Admin Professional">Admin Professional</option> <option value="Human Resources Professional">Human Resources Professional</option> <optgroup label="Advertising, Media & Entertainment"></optgroup> <option value="Actor">Actor</option> <option value="Advertising Professional">Advertising Professional</option> <option value="Entertainment Professional">Entertainment Professional</option> <option value="Event Manager">Event Manager</option> <option value="Journalist">Journalist</option> <option value="Media Professional">Media Professional</option> <option value="Public Relations Professional">Public Relations Professional</option> <optgroup label="Agriculture"></optgroup> <option value="Farming">Farming</option> <option value="Horticulturist">Horticulturist</option> <option value="Agricultural Professional (Others)">Agricultural Professional (Others)</option> <optgroup label="Airline & Aviation"></optgroup> <option value="Air Hostess / Flight Attendant">Air Hostess / Flight Attendant</option> <option value="Pilot / Co-Pilot">Pilot / Co-Pilot</option> <option value="Other Airline Professional">Other Airline Professional</option> <optgroup label="Architecture & Design"></optgroup> <option value="Architect">Architect</option> <option value="Interior Designer">Interior Designer</option> <option value="Landscape Architect">Landscape Architect</option> <optgroup label="Artists, Animators & Web Designers"></optgroup> <option value="Animator">Animator</option> <option value="Commercial Artist">Commercial Artist</option> <option value="Web / UX Designers">Web / UX Designers</option> <option value="Artist (Others)">Artist (Others)</option> <optgroup label="Beauty, Fashion & Jewellery Designers"></optgroup> <option value="Beautician">Beautician</option> <option value="Fashion Designer">Fashion Designer</option> <option value="Hairstylist">Hairstylist</option> <option value="Jewellery Designer">Jewellery Designer</option> <option value="Designer (Others)">Designer (Others)</option> <optgroup label="BPO, KPO, & Customer Support"></optgroup> <option value="Customer Support / BPO / KPO Professional">Customer Support / BPO / KPO Professional</option> <optgroup label="Civil Services / Law Enforcement"></optgroup> <option value="IAS / IRS / IES / IFS">IAS / IRS / IES / IFS</option> <option value="Indian Police Services (IPS)">Indian Police Services (IPS)</option> <option value="Law Enforcement Employee (Others)">Law Enforcement Employee (Others)</option> <optgroup label="Defense"></optgroup> <option value="Airforce">Airforce</option> <option value="Army">Army</option> <option value="Navy">Navy</option> <option value="Defense Services (Others)">Defense Services (Others)</option> <optgroup label="Education & Training"></optgroup> <option value="Lecturer">Lecturer</option> <option value="Professor">Professor</option> <option value="Research Assistant">Research Assistant</option> <option value="Research Scholar">Research Scholar</option> <option value="Teacher">Teacher</option> <option value="Training Professional (Others)">Training Professional (Others)</option> <optgroup label="Engineering"></optgroup> <option value="Civil Engineer">Civil Engineer</option> <option value="Electronics / Telecom Engineer">Electronics / Telecom Engineer</option> <option value="Mechanical / Production Engineer">Mechanical / Production Engineer</option> <option value="Non IT Engineer (Others)">Non IT Engineer (Others)</option> <optgroup label="Hotel & Hospitality"></optgroup> <option value="Chef / Sommelier / Food Critic">Chef / Sommelier / Food Critic</option> <option value="Catering Professional">Catering Professional</option> <option value="Hotel & Hospitality Professional (Others)">Hotel & Hospitality Professional (Others)</option> <optgroup label="IT & Software Engineering"></optgroup> <option value="Software Developer / Programmer">Software Developer / Programmer</option> <option value="Software Consultant">Software Consultant</option> <option value="Hardware & Networking professional">Hardware & Networking professional</option> <option value="Software Professional (Others)">Software Professional (Others)</option> <optgroup label="Legal"></optgroup> <option value="Lawyer">Lawyer</option> <option value="Legal Assistant">Legal Assistant</option> <option value="Legal Professional (Others)">Legal Professional (Others)</option> <optgroup label="Medical & Healthcare"></optgroup> <option value="Dentist">Dentist</option> <option value="Doctor">Doctor</option> <option value="Medical Transcriptionist">Medical Transcriptionist</option> <option value="Nurse">Nurse</option> <option value="Pharmacist">Pharmacist</option> <option value="Physician Assistant">Physician Assistant</option> <option value="Physiotherapist / Occupational Therapist">Physiotherapist / Occupational Therapist</option> <option value="Psychologist">Psychologist</option> <option value="Surgeon">Surgeon</option> <option value="Veterinary Doctor">Veterinary Doctor</option> <option value="Therapist (Others)">Therapist (Others)</option> <option value="Medical / Healthcare Professional (Others)">Medical / Healthcare Professional (Others)</option> <optgroup label="Merchant Navy"></optgroup> <option value="Merchant Naval Officer">Merchant Naval Officer</option> <option value="Mariner">Mariner</option> <optgroup label="Sales & Marketing"></optgroup> <option value="Marketing Professional">Marketing Professional</option> <option value="Sales Professional">Sales Professional</option> <optgroup label="Science"></optgroup> <option value="Biologist / Botanist">Biologist / Botanist</option> <option value="Physicist">Physicist</option> <option value="Science Professional (Others)">Science Professional (Others)</option> <optgroup label="Corporate Professionals"></optgroup> <option value="CxO / Chairman / Director / President">CxO / Chairman / Director / President</option> <option value="VP / AVP / GM / DGM">VP / AVP / GM / DGM</option> <option value="Sr. Manager / Manager">Sr. Manager / Manager</option> <option value="Consultant / Supervisor / Team Leads">Consultant / Supervisor / Team Leads</option> <option value="Team Member / Staff">Team Member / Staff</option> <optgroup label="Others"></optgroup> <option value="Agent / Broker / Trader / Contractor">Agent / Broker / Trader / Contractor</option> <option value="Business Owner / Entrepreneur">Business Owner / Entrepreneur</option> <option value="Politician">Politician</option> <option value="Social Worker / Volunteer / NGO">Social Worker / Volunteer / NGO</option> <option value="Sportsman">Sportsman</option> <option value="Travel & Transport Professional">Travel & Transport Professional</option> <option value="Writer">Writer</option> <optgroup label="Non Working"></optgroup> <option value="Student">Student</option> <option value="Retired">Retired</option> <option value="Not working">Not working</option> </select> </div> <div class="col-md-4 mb-3"> <label for="highest_qualification" class="form-label modern-label"> <i class="icofont-graduate" style="margin-right: 5px; color: #cd4252;"></i>Education </label> <select class="form-control modern-input" id="highest_qualification" name="highest_qualification"> <option value="">All Qualifications</option> <optgroup label="-ENGINEERING-"></optgroup> <option value="B.E / B.Tech">B.E / B.Tech</option> <option value="M.E / M.Tech">M.E / M.Tech</option> <option value="M.S Engineering">M.S Engineering</option> <option value="B.Eng (Hons)">B.Eng (Hons)</option> <option value="M.Eng (Hons)">M.Eng (Hons)</option> <option value="Engineering Diploma">Engineering Diploma</option> <option value="AE">AE</option> <option value="AET">AET</option> <optgroup label="-ARTS / DESIGN-"></optgroup> <option value="B.A">B.A</option> <option value="B.Ed">B.Ed</option> <option value="BJMC">BJMC</option> <option value="BFA">BFA</option> <option value="B.Arch">B.Arch</option> <option value="B.Des">B.Des</option> <option value="BMM">BMM</option> <option value="MFA">MFA</option> <option value="M.Ed">M.Ed</option> <option value="M.A">M.A</option> <option value="MSW">MSW</option> <option value="MJMC">MJMC</option> <option value="M.Arch">M.Arch</option> <option value="M.Des">M.Des</option> <option value="BA (Hons)">BA (Hons)</option> <option value="MBA">MBA</option> <option value="B.Arch (Hons)">B.Arch (Hons)</option> <option value="DFA">DFA</option> <option value="D.Ed">D.Ed</option> <option value="D.Arch">D.Arch</option> <option value="AA">AA</option> <option value="AFA">AFA</option> <optgroup label="-FINANCE / COMMERCE-"></optgroup> <option value="B.Com">B.Com</option> <option value="CA / CPA">CA / CPA</option> <option value="CFA">CFA</option> <option value="CS">CS</option> <option value="BSc / BFin">BSc / BFin</option> <option value="M.Com">M.Com</option> <option value="MSc / MFin / MS">MSc / MFin / MS</option> <option value="BCom (Hons)">BCom (Hons)</option> <option value="PGD Finance">PGD Finance</option> <optgroup label="-COMPUTERS / IT-"></optgroup> <option value="BCA">BCA</option> <option value="B.IT">B.IT</option> <option value="BCS">BCS</option> <option value="BA Computer Science">BA Computer Science</option> <option value="MCA">MCA</option> <option value="PGDCA">PGDCA</option> <option value="IT Diploma">IT Diploma</option> <option value="ADCA">ADCA</option> <option value="ADIT">ADIT</option> <option value="Software Engineering Diploma">Software Engineering Diploma</option> <option value="DCA">DCA</option> <option value="A+ Certification">A+ Certification</option> <optgroup label="-SCIENCE-"></optgroup> <option value="B.Sc">B.Sc</option> <option value="M.Sc">M.Sc</option> <option value="BSc (Hons)">BSc (Hons)</option> <option value="DipSc">DipSc</option> <option value="AS">AS</option> <option value="AAS">AAS</option> <optgroup label="-MEDICAL / HEALTHCARE-"></optgroup> <option value="MBBS">MBBS</option> <option value="BDS">BDS</option> <option value="BPT">BPT</option> <option value="BAMS">BAMS</option> <option value="BHMS">BHMS</option> <option value="B.Pharma">B.Pharma</option> <option value="BVSc">BVSc</option> <option value="BSN / BScN">BSN / BScN</option> <option value="MDS">MDS</option> <option value="MCh">MCh</option> <option value="M.D">M.D</option> <option value="M.S Medicine">M.S Medicine</option> <option value="MPT">MPT</option> <option value="DM">DM</option> <option value="M.Pharma">M.Pharma</option> <option value="MVSc">MVSc</option> <option value="MMed">MMed</option> <option value="PGD Medicine">PGD Medicine</option> <option value="ADN">ADN</option> <optgroup label="-BUSINESS / MANAGEMENT-"></optgroup> <option value="BBA">BBA</option> <option value="BHM">BHM</option> <option value="BBM">BBM</option> <option value="PGDM">PGDM</option> <option value="ABA">ABA</option> <option value="ADBus">ADBus</option> <optgroup label="-LAW-"></optgroup> <option value="BL / LLB">BL / LLB</option> <option value="ML / LLM">ML / LLM</option> <option value="LLB (Hons)">LLB (Hons)</option> <option value="ALA">ALA</option> <optgroup label="-RESEARCH / DOCTORATE-"></optgroup> <option value="Ph.D">Ph.D</option> <option value="M.Phil">M.Phil</option> <optgroup label="-GENERAL-"></optgroup> <option value="Bachelor">Bachelor</option> <option value="Master">Master</option> <option value="Diploma">Diploma</option> <option value="Honours">Honours</option> <option value="Doctorate">Doctorate</option> <option value="Associate">Associate</option> <option value="High school">High school</option> <option value="Less than high school">Less than high school</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-12 text-center mt-4"> <button type="submit" class="btn modern-search-btn btn-lg"> <i class="icofont-search-2" style="margin-right: 8px;"></i>Search </button> <button type="reset" class="btn modern-reset-btn btn-lg ml-2"> <i class="icofont-refresh" style="margin-right: 8px;"></i>Reset </button> </div> </div> </form> </div> </div> </div> <!-- Search Results --> <div class="mt-5" id="searchResultsSection" style="display: none;"> <div class="block-box user-about"> <div class="widget-heading" style="background: linear-gradient(135deg, #cd4252 0%, #b83847 100%); padding: 20px; border-radius: 15px 15px 0 0;"> <h3 style="color: #fff; margin: 0; font-size: 22px; font-weight: 600; display: flex; align-items: center; justify-content: space-between;"> <span><i class="icofont-list" style="margin-right: 10px;"></i>Search Results</span> <span id="resultCount" class="badge" style="background: rgba(255,255,255,0.3); color: #fff; padding: 8px 15px; border-radius: 20px; font-size: 14px;"></span> </h3> </div> <div class="card-body" style="padding: 30px;"> <div class="row g-4" id="searchResults"> <!-- Results will be displayed here --> </div> </div> </div> </div> <!-- No Results Message --> <div class="mt-5 text-center" id="noResults" style="display: none;"> <div class="block-box user-about"> <div class="widget-heading text-center py-5"> <i class="icofont-search-2" style="font-size: 80px; color: #ddd; margin-bottom: 20px;"></i> <h4 style="color: #999; font-weight: 400;">No profiles found</h4> <p style="color: #bbb; margin-top: 10px;">Try adjusting your search criteria</p> </div> </div> </div> </div> </div> <!-- ==========Search Section End Here========== --> <style type="text/css"> body { background-color: #f5f5f5; } /* Modern Tab Styles */ .modern-tabs { background: transparent; border: none; } .modern-tab-btn { background: transparent; border: none; color: #666; font-weight: 500; font-size: 16px; padding: 15px 30px; border-radius: 10px 10px 0 0; transition: all 0.3s ease; position: relative; } .modern-tab-btn:hover { color: #cd4252; background: rgba(205, 66, 82, 0.05); } .modern-tab-btn.active { background: linear-gradient(135deg, #cd4252 0%, #b83847 100%); color: #fff; border: none; } .modern-tab-btn.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 3px; background: linear-gradient(135deg, #cd4252 0%, #b83847 100%); } /* Search Form Container */ .search-form-container { background: #fff; padding: 30px; border-radius: 0 0 15px 15px; box-shadow: 0 3px 15px rgba(0,0,0,0.08); } .search-section { margin-bottom: 30px; padding-bottom: 25px; border-bottom: 2px solid #f0f0f0; } .search-section:last-child { border-bottom: none; } .section-title { color: #cd4252; font-size: 18px; font-weight: 600; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #cd4252; display: inline-block; } .section-title i { margin-right: 8px; } /* Form Label Styles */ .modern-label { font-weight: 600; color: #333; margin-bottom: 8px; display: block; font-size: 14px; } /* Form Input Styles */ .modern-input { border: 2px solid #e0e0e0; border-radius: 10px; padding: 12px 15px; font-size: 14px; transition: all 0.3s ease; background: #fff; } .modern-input:focus { border-color: #cd4252; box-shadow: 0 0 0 0.2rem rgba(205, 66, 82, 0.15); outline: none; } .modern-input:hover { border-color: #cd4252; } /* Help Text */ .modern-help-text { font-size: 12px; color: #999; margin-top: 5px; display: block; } .modern-help-text i { margin-right: 5px; } /* Button Styles */ .modern-search-btn { background: linear-gradient(135deg, #cd4252 0%, #b83847 100%); color: #fff; border: none; padding: 12px 30px; border-radius: 10px; font-weight: 600; font-size: 16px; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(205, 66, 82, 0.3); } .modern-search-btn:hover { background: linear-gradient(135deg, #b83847 0%, #a83242 100%); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(205, 66, 82, 0.4); } .modern-search-btn:active { transform: translateY(0); } .modern-reset-btn { background: #fff; color: #666; border: 2px solid #e0e0e0; padding: 12px 30px; border-radius: 10px; font-weight: 600; font-size: 16px; transition: all 0.3s ease; } .modern-reset-btn:hover { background: #f8f9fa; border-color: #cd4252; color: #cd4252; } /* Loading Spinner */ .lds-spinner, .lds-spinner div, .lds-spinner div:after { box-sizing: border-box; } .lds-spinner { color: #cd4252; display: inline-block; position: relative; width: 80px; height: 80px; } .lds-spinner div { transform-origin: 40px 40px; animation: lds-spinner 1.2s linear infinite; } .lds-spinner div:after { content: " "; display: block; position: absolute; top: 3.2px; left: 36.8px; width: 6.4px; height: 17.6px; border-radius: 20%; background: currentColor; } .lds-spinner div:nth-child(1) { transform: rotate(0deg); animation-delay: -1.1s; } .lds-spinner div:nth-child(2) { transform: rotate(30deg); animation-delay: -1s; } .lds-spinner div:nth-child(3) { transform: rotate(60deg); animation-delay: -0.9s; } .lds-spinner div:nth-child(4) { transform: rotate(90deg); animation-delay: -0.8s; } .lds-spinner div:nth-child(5) { transform: rotate(120deg); animation-delay: -0.7s; } .lds-spinner div:nth-child(6) { transform: rotate(150deg); animation-delay: -0.6s; } .lds-spinner div:nth-child(7) { transform: rotate(180deg); animation-delay: -0.5s; } .lds-spinner div:nth-child(8) { transform: rotate(210deg); animation-delay: -0.4s; } .lds-spinner div:nth-child(9) { transform: rotate(240deg); animation-delay: -0.3s; } .lds-spinner div:nth-child(10) { transform: rotate(270deg); animation-delay: -0.2s; } .lds-spinner div:nth-child(11) { transform: rotate(300deg); animation-delay: -0.1s; } .lds-spinner div:nth-child(12) { transform: rotate(330deg); animation-delay: 0s; } @keyframes lds-spinner { 0% { opacity: 1; } 100% { opacity: 0; } } /* Responsive */ /* Search Result Card */ .search-result-card { background: #fff; border-radius: 15px; box-shadow: 0 3px 15px rgba(0,0,0,0.08); transition: all 0.3s ease; overflow: hidden; border: 2px solid transparent; } .search-result-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(205, 66, 82, 0.15); border-color: #cd4252; } .result-card-content { padding: 25px; display: flex; gap: 20px; align-items: flex-start; } .result-avatar { flex-shrink: 0; } .result-avatar img { width: 120px; height: 120px; object-fit: cover; border-radius: 15px; border: 3px solid #cd4252; box-shadow: 0 3px 10px rgba(205, 66, 82, 0.2); } .result-info { flex: 1; min-width: 0; } .result-name { color: #333; font-size: 20px; font-weight: 600; margin: 0 0 15px 0; } .result-details { margin-bottom: 15px; } .result-item { color: #666; font-size: 14px; margin: 8px 0; display: flex; align-items: center; } .result-item strong { color: #333; margin-right: 5px; } .result-view-btn { background: linear-gradient(135deg, #cd4252 0%, #b83847 100%); color: #fff; padding: 10px 25px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; display: inline-block; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(205, 66, 82, 0.3); } .result-view-btn:hover { background: linear-gradient(135deg, #b83847 0%, #a83242 100%); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(205, 66, 82, 0.4); } /* Responsive */ @media (max-width: 768px) { .modern-tab-btn { padding: 12px 20px; font-size: 14px; } .search-form-container { padding: 20px; } .section-title { font-size: 16px; } .result-card-content { flex-direction: column; text-align: center; } .result-avatar { margin: 0 auto; } .result-avatar img { width: 100px; height: 100px; } .result-name { text-align: center; } .result-item { justify-content: center; } } </style> <center> <div id="loading" style="display:none;text-align:center;margin:20px;"> <div class="lds-spinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div> <p>Searching...</p> </div> </center> <?php include('footer.php'); ?> <script type="text/javascript"> $(document).ready(function() { // Load all dropdowns on page load loadReligions(); loadCountries(); // Professions and Qualifications are now static HTML, no need to load via AJAX // Load castes when religion is selected $('#religion').on('change', function() { const religionId = $(this).val(); loadCastes(religionId); }); // Function to load religions function loadReligions() { $.ajax({ url: 'php/fetch_religion.php', method: 'GET', dataType: 'json', success: function(data) { const religionSelect = $('#religion'); religionSelect.html('<option value="">All Religions</option>'); if (data && Array.isArray(data)) { data.forEach(function(religion) { religionSelect.append('<option value="' + religion.religion_id + '">' + religion.religion_name + '</option>'); }); } }, error: function(xhr, status, error) { console.error('Error loading religions:', error); } }); } // Function to load castes based on religion function loadCastes(religionId) { const casteSelect = $('#caste'); casteSelect.html('<option value="">All Castes</option>'); if (!religionId || religionId === '') { return; } $.ajax({ url: 'php/fetch_castes_by_religion.php', method: 'GET', data: { religion_id: religionId }, dataType: 'json', success: function(data) { if (data && Array.isArray(data)) { data.forEach(function(caste) { casteSelect.append('<option value="' + caste.caste_id + '">' + caste.caste_name + '</option>'); }); } }, error: function(xhr, status, error) { console.error('Error loading castes:', error); } }); } // Function to load countries function loadCountries() { $.ajax({ url: 'php/fetch_countries.php', method: 'GET', dataType: 'json', success: function(data) { const locationSelect = $('#living_in'); locationSelect.append('<option value="">All Locations</option>'); if (data && Array.isArray(data)) { data.forEach(function(country) { locationSelect.append('<option value="' + country.value + '">' + country.name + '</option>'); }); } }, error: function(xhr, status, error) { console.error('Error loading countries:', error); } }); } // Basic Search Form Submission $('#basicSearchForm').on('submit', function(e) { e.preventDefault(); const rivId = $('#riv_id').val().trim(); if (!rivId) { alert('Please enter a SV ID'); return; } $('#loading').show(); $('#searchResultsSection').hide(); $('#noResults').hide(); $('#searchResults').html(''); $.ajax({ url: 'php/fetch_basic_search.php', method: 'POST', data: { user_id: <?=$_SESSION['user_id']?>, search_text: rivId }, dataType: 'json', beforeSend: function() { console.log('Sending request to: php/fetch_basic_search.php'); console.log('Data:', {user_id: <?=$_SESSION['user_id']?>, search_text: rivId}); }, success: function(data) { $('#loading').hide(); // Check if there's an error in the response if (data && data.error) { alert('Error: ' + data.error); $('#noResults').show(); return; } // Handle both JSON array and string responses if (typeof data === 'string') { try { data = JSON.parse(data); } catch(e) { console.error('Failed to parse response:', e); $('#noResults').show(); return; } } if (data && Array.isArray(data) && data.length > 0) { displayResults(data); } else { $('#noResults').show(); } }, error: function(xhr, status, error) { $('#loading').hide(); console.error('AJAX Error Details:'); console.error('- Status Code:', xhr.status); console.error('- Status Text:', status); console.error('- Error:', error); console.error('- Response Text:', xhr.responseText); console.error('- Response Headers:', xhr.getAllResponseHeaders()); // Try to parse error response let errorMsg = 'An error occurred while searching.'; try { if (xhr.responseText) { const errorData = JSON.parse(xhr.responseText); if (errorData.error) { errorMsg = errorData.error; } else { errorMsg = 'Server returned: ' + JSON.stringify(errorData); } } } catch(e) { // If not JSON, use the raw response if (xhr.responseText) { errorMsg = 'Error: ' + xhr.responseText.substring(0, 200); } else { errorMsg = 'Network error. Please check if the server is running. Status: ' + xhr.status; } } alert(errorMsg + '\n\nCheck browser console (F12) for more details.'); } }); }); // Advanced Search Form Submission $('#advancedSearchForm').on('submit', function(e) { e.preventDefault(); $('#loading').show(); $('#searchResultsSection').hide(); $('#noResults').hide(); $('#searchResults').html(''); const formData = { user_id: <?=$_SESSION['user_id']?>, search_text: $('#search_text').val().trim(), age_from: $('#age_from').val(), age_to: $('#age_to').val(), marital_status: $('#marital_status').val(), religion: $('#religion').val().trim(), caste: $('#caste').val().trim(), living_in: $('#living_in').val().trim(), working_as: $('#working_as').val().trim(), highest_qualification: $('#highest_qualification').val().trim() }; $.ajax({ url: 'php/fetch_advanced_search.php', method: 'POST', data: formData, dataType: 'json', success: function(data) { console.log(data); $('#loading').hide(); // Handle both JSON array and string responses if (typeof data === 'string') { try { data = JSON.parse(data); } catch(e) { console.error('Failed to parse response:', e); $('#noResults').show(); return; } } if (data && Array.isArray(data) && data.length > 0) { displayResults(data); } else { $('#noResults').show(); } }, error: function(xhr, status, error) { $('#loading').hide(); console.error('Error:', error, xhr.responseText); alert('An error occurred while searching. Please try again.'); } }); }); // Function to display search results function displayResults(data) { let html = ''; data.forEach(function(profile) { const profileImg = profile.profile_img === 'default.jpg' ? (profile.gender === 'Female' ? '../images/female.jpg' : '../images/male.png') : '../admin/images/members/' + profile.profile_img; const displayName = profile.display_name_as_title === 'Full Name' ? profile.first_name + ' ' + profile.last_name : profile.first_name; html += ` <div class="col-lg-6 col-md-12 mb-4"> <div class="search-result-card"> <div class="result-card-content"> <div class="result-avatar"> <img src="${profileImg}" alt="${displayName}" onerror="this.src='../admin/images/members/default.jpg'"> </div> <div class="result-info"> <h4 class="result-name">${displayName}</h4> <div class="result-details"> <p class="result-item"> <i class="icofont-id-card" style="color: #cd4252; margin-right: 8px;"></i> <strong>SV ID:</strong> ${profile.member_riv_user_id || profile.member_sv_user_id || 'N/A'} </p> ${profile.age ? `<p class="result-item"><i class="icofont-calendar" style="color: #cd4252; margin-right: 8px;"></i><strong>Age:</strong> ${profile.age} yrs</p>` : ''} ${profile.marital_status ? `<p class="result-item"><i class="icofont-heart-alt" style="color: #cd4252; margin-right: 8px;"></i><strong>Status:</strong> ${profile.marital_status}</p>` : ''} ${profile.religion ? `<p class="result-item"><i class="icofont-religious-alt" style="color: #cd4252; margin-right: 8px;"></i><strong>Religion:</strong> ${profile.religion}</p>` : ''} ${profile.caste ? `<p class="result-item"><i class="icofont-users-alt-5" style="color: #cd4252; margin-right: 8px;"></i><strong>Caste:</strong> ${profile.caste}</p>` : ''} ${profile.living_in ? `<p class="result-item"><i class="icofont-location-pin" style="color: #cd4252; margin-right: 8px;"></i><strong>Location:</strong> ${profile.living_in}</p>` : ''} ${profile.working_as ? `<p class="result-item"><i class="icofont-briefcase" style="color: #cd4252; margin-right: 8px;"></i><strong>Profession:</strong> ${profile.working_as}</p>` : ''} </div> <div class="result-action mt-3"> <a href="profile?profile_id=${profile.member_riv_user_id || profile.member_sv_user_id || ''}&uid=${profile.member_user_id || profile.profile_id || ''}&token=${profile.memeber_token || profile.member_token || ''}" class="result-view-btn"> <i class="icofont-eye" style="margin-right: 5px;"></i>View Profile </a> </div> </div> </div> </div> </div> `; }); $('#searchResults').html(html); $('#resultCount').text(data.length + ' result(s) found'); $('#searchResultsSection').show(); } }); </script>