:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/soulmeetvivah.com/V1.0-main/member/**
:: Editing File: edit-profile.php
<?php include('header.php'); include('php/db.php'); // Get user_id from session $user_id = $_SESSION['user_id']; // Fetch all user details $sql_user_details = "SELECT * FROM user_details WHERE user_id = '$user_id'"; $result_user_details = $conn->query($sql_user_details); $user_data = []; if ($result_user_details && $result_user_details->num_rows > 0) { $user_data = $result_user_details->fetch_assoc(); } // Fetch personal details $sql_personal = "SELECT * FROM personal_details WHERE user_id = '$user_id'"; $result_personal = $conn->query($sql_personal); $personal_data = []; if ($result_personal && $result_personal->num_rows > 0) { $personal_data = $result_personal->fetch_assoc(); } // Fetch education/profession $sql_education = "SELECT * FROM education_profession WHERE user_id = '$user_id'"; $result_education = $conn->query($sql_education); $education_data = []; if ($result_education && $result_education->num_rows > 0) { $education_data = $result_education->fetch_assoc(); } // Fetch family details $sql_family = "SELECT * FROM family_details WHERE user_id = '$user_id'"; $result_family = $conn->query($sql_family); $family_data = []; if ($result_family && $result_family->num_rows > 0) { $family_data = $result_family->fetch_assoc(); } // Fetch horoscope $sql_horoscope = "SELECT * FROM horoscope WHERE user_id = '$user_id'"; $result_horoscope = $conn->query($sql_horoscope); $horoscope_data = []; if ($result_horoscope && $result_horoscope->num_rows > 0) { $horoscope_data = $result_horoscope->fetch_assoc(); } // Fetch other details $sql_other = "SELECT * FROM other_details WHERE user_id = '$user_id'"; $result_other = $conn->query($sql_other); $other_data = []; if ($result_other && $result_other->num_rows > 0) { $other_data = $result_other->fetch_assoc(); } // Fetch about_us $sql_about = "SELECT * FROM about_users WHERE user_id = '$user_id'"; $result_about = $conn->query($sql_about); $about_text = ''; if ($result_about && $result_about->num_rows > 0) { $row_about = $result_about->fetch_assoc(); $about_text = $row_about['about_text'] ?? ''; } // Fetch religions $sql_religions = "SELECT * FROM religion WHERE status = '1' ORDER BY religion_name"; $result_religions = $conn->query($sql_religions); // Fetch castes (will be loaded dynamically based on religion) $current_religion = $user_data['religion'] ?? ''; $sql_castes = "SELECT * FROM castes WHERE religion_id = '$current_religion' AND status = '1' ORDER BY caste_name"; $result_castes = $conn->query($sql_castes); ?> <style> .edit-profile-container { max-width: 1200px; margin: 0 auto; padding: 20px; } .profile-tabs { background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); margin-bottom: 20px; } .tab-nav { display: flex; flex-wrap: wrap; border-bottom: 2px solid #f0f0f0; padding: 0; margin: 0; list-style: none; } .tab-nav li { flex: 1; min-width: 150px; } .tab-nav a { display: block; padding: 15px 20px; text-align: center; color: #666; text-decoration: none; border-bottom: 3px solid transparent; transition: all 0.3s; font-weight: 500; } .tab-nav a:hover, .tab-nav a.active { color: #cd4252; border-bottom-color: #cd4252; background: #fff5f5; } .tab-content { display: none; padding: 30px; } .tab-content.active { display: block; } .form-section { margin-bottom: 30px; } .form-section h4 { color: #cd4252; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #f0f0f0; } .form-group { margin-bottom: 20px; } .form-group label { display: block; margin-bottom: 8px; color: #333; font-weight: 500; } .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; transition: border-color 0.3s; } .form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #cd4252; } .form-group textarea { min-height: 100px; resize: vertical; } .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; } .btn-save { background: #cd4252; color: #fff; padding: 12px 30px; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: 500; transition: background 0.3s; } .btn-save:hover { background: #b83847; } .alert { padding: 15px; margin-bottom: 20px; border-radius: 5px; display: none; } .alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; } .alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; } .loading { display: none; text-align: center; padding: 20px; } </style> <div style="height: 100px;"></div> <div class="page-content"> <div class="container edit-profile-container"> <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-edit" style="margin-right: 10px;"></i>Edit Profile </h3> <p style="color: rgba(255,255,255,0.9); margin: 10px 0 0 0; font-size: 16px;">Update your profile information</p> </div> </div> <div class="profile-tabs"> <ul class="tab-nav"> <li><a href="#basic" class="active" data-tab="basic">Basic Info</a></li> <li><a href="#personal" data-tab="personal">Personal Details</a></li> <li><a href="#education" data-tab="education">Education & Profession</a></li> <li><a href="#family" data-tab="family">Family Details</a></li> <li><a href="#horoscope" data-tab="horoscope">Horoscope</a></li> <li><a href="#about" data-tab="about">About Me</a></li> </ul> <div id="alertMessage" class="alert"></div> <div class="loading" id="loadingIndicator">Saving...</div> <!-- Basic Info Tab --> <div id="basic" class="tab-content active"> <form id="basicInfoForm"> <div class="form-section"> <h4>Basic Information</h4> <div class="form-row"> <div class="form-group"> <label>Mobile Number *</label> <input type="text" name="mobile_no" value="<?= htmlspecialchars($user_data['mobile'] ?? '') ?>" required> </div> <div class="form-group"> <label>Date of Birth *</label> <input type="date" name="date_of_birth" value="<?= htmlspecialchars($user_data['date_of_birth'] ?? '') ?>" required> </div> <div class="form-group"> <label>Gender *</label> <select name="gender" required> <option value="">Select Gender</option> <option value="Male" <?= ($user_data['gender'] ?? '') == 'Male' ? 'selected' : '' ?>>Male</option> <option value="Female" <?= ($user_data['gender'] ?? '') == 'Female' ? 'selected' : '' ?>>Female</option> </select> </div> <div class="form-group"> <label>Profile For *</label> <select name="account_for" required> <option value="">Select</option> <option value="Self" <?= ($user_data['profile_for'] ?? '') == 'Self' ? 'selected' : '' ?>>Self</option> <option value="Son" <?= ($user_data['profile_for'] ?? '') == 'Son' ? 'selected' : '' ?>>Son</option> <option value="Daughter" <?= ($user_data['profile_for'] ?? '') == 'Daughter' ? 'selected' : '' ?>>Daughter</option> <option value="Brother" <?= ($user_data['profile_for'] ?? '') == 'Brother' ? 'selected' : '' ?>>Brother</option> <option value="Sister" <?= ($user_data['profile_for'] ?? '') == 'Sister' ? 'selected' : '' ?>>Sister</option> </select> </div> <div class="form-group"> <label>Marital Status *</label> <select name="marital_status" required> <option value="">Select</option> <option value="Never Married" <?= ($user_data['marital_status'] ?? '') == 'Never Married' ? 'selected' : '' ?>>Never Married</option> <option value="Divorced" <?= ($user_data['marital_status'] ?? '') == 'Divorced' ? 'selected' : '' ?>>Divorced</option> <option value="Widowed" <?= ($user_data['marital_status'] ?? '') == 'Widowed' ? 'selected' : '' ?>>Widowed</option> <option value="Awaiting Divorce" <?= ($user_data['marital_status'] ?? '') == 'Awaiting Divorce' ? 'selected' : '' ?>>Awaiting Divorce</option> </select> </div> </div> </div> <button type="submit" class="btn-save">Save Basic Info</button> </form> </div> <!-- Personal Details Tab --> <div id="personal" class="tab-content"> <form id="personalDetailsForm"> <div class="form-section"> <h4>Personal Details</h4> <div class="form-row"> <div class="form-group"> <label>Mother Tongue</label> <input type="text" name="mother_tongue" value="<?= htmlspecialchars($personal_data['mother_tongue'] ?? '') ?>"> </div> <div class="form-group"> <label>Height (cm)</label> <input type="text" name="height" value="<?= htmlspecialchars($personal_data['height'] ?? '') ?>" placeholder="e.g., 165"> </div> <div class="form-group"> <label>Weight (kg)</label> <input type="text" name="weight" value="<?= htmlspecialchars($personal_data['weight'] ?? '') ?>" placeholder="e.g., 65"> </div> <div class="form-group"> <label>Build</label> <select name="build"> <option value="">Select</option> <option value="Slim" <?= ($personal_data['build'] ?? '') == 'Slim' ? 'selected' : '' ?>>Slim</option> <option value="Average" <?= ($personal_data['build'] ?? '') == 'Average' ? 'selected' : '' ?>>Average</option> <option value="Athletic" <?= ($personal_data['build'] ?? '') == 'Athletic' ? 'selected' : '' ?>>Athletic</option> <option value="Heavy" <?= ($personal_data['build'] ?? '') == 'Heavy' ? 'selected' : '' ?>>Heavy</option> </select> </div> <div class="form-group"> <label>Complexion</label> <select name="complexion"> <option value="">Select</option> <option value="Very Fair" <?= ($personal_data['complexion'] ?? '') == 'Very Fair' ? 'selected' : '' ?>>Very Fair</option> <option value="Fair" <?= ($personal_data['complexion'] ?? '') == 'Fair' ? 'selected' : '' ?>>Fair</option> <option value="Wheatish" <?= ($personal_data['complexion'] ?? '') == 'Wheatish' ? 'selected' : '' ?>>Wheatish</option> <option value="Dark" <?= ($personal_data['complexion'] ?? '') == 'Dark' ? 'selected' : '' ?>>Dark</option> </select> </div> <div class="form-group"> <label>Diet</label> <select name="diet"> <option value="">Select</option> <option value="Vegetarian" <?= ($personal_data['diet'] ?? '') == 'Vegetarian' ? 'selected' : '' ?>>Vegetarian</option> <option value="Non-Vegetarian" <?= ($personal_data['diet'] ?? '') == 'Non-Vegetarian' ? 'selected' : '' ?>>Non-Vegetarian</option> <option value="Eggetarian" <?= ($personal_data['diet'] ?? '') == 'Eggetarian' ? 'selected' : '' ?>>Eggetarian</option> <option value="Jain" <?= ($personal_data['diet'] ?? '') == 'Jain' ? 'selected' : '' ?>>Jain</option> </select> </div> <div class="form-group"> <label>Blood Group</label> <select name="blood"> <option value="">Select</option> <option value="A+" <?= ($personal_data['blood'] ?? '') == 'A+' ? 'selected' : '' ?>>A+</option> <option value="A-" <?= ($personal_data['blood'] ?? '') == 'A-' ? 'selected' : '' ?>>A-</option> <option value="B+" <?= ($personal_data['blood'] ?? '') == 'B+' ? 'selected' : '' ?>>B+</option> <option value="B-" <?= ($personal_data['blood'] ?? '') == 'B-' ? 'selected' : '' ?>>B-</option> <option value="AB+" <?= ($personal_data['blood'] ?? '') == 'AB+' ? 'selected' : '' ?>>AB+</option> <option value="AB-" <?= ($personal_data['blood'] ?? '') == 'AB-' ? 'selected' : '' ?>>AB-</option> <option value="O+" <?= ($personal_data['blood'] ?? '') == 'O+' ? 'selected' : '' ?>>O+</option> <option value="O-" <?= ($personal_data['blood'] ?? '') == 'O-' ? 'selected' : '' ?>>O-</option> </select> </div> <div class="form-group"> <label>Drinking</label> <select name="drinking"> <option value="">Select</option> <option value="No" <?= ($personal_data['drinking'] ?? '') == 'No' ? 'selected' : '' ?>>No</option> <option value="Occasionally" <?= ($personal_data['drinking'] ?? '') == 'Occasionally' ? 'selected' : '' ?>>Occasionally</option> <option value="Regularly" <?= ($personal_data['drinking'] ?? '') == 'Regularly' ? 'selected' : '' ?>>Regularly</option> </select> </div> <div class="form-group"> <label>Smoking</label> <select name="smoking"> <option value="">Select</option> <option value="No" <?= ($personal_data['smooking'] ?? '') == 'No' ? 'selected' : '' ?>>No</option> <option value="Occasionally" <?= ($personal_data['smooking'] ?? '') == 'Occasionally' ? 'selected' : '' ?>>Occasionally</option> <option value="Regularly" <?= ($personal_data['smooking'] ?? '') == 'Regularly' ? 'selected' : '' ?>>Regularly</option> </select> </div> <div class="form-group"> <label>Spectacles</label> <select name="spectacles"> <option value="">Select</option> <option value="Yes" <?= ($personal_data['spectacles'] ?? '') == 'Yes' ? 'selected' : '' ?>>Yes</option> <option value="No" <?= ($personal_data['spectacles'] ?? '') == 'No' ? 'selected' : '' ?>>No</option> </select> </div> <div class="form-group"> <label>Physical Disability</label> <select name="physical_disability"> <option value="">Select</option> <option value="None" <?= ($personal_data['disability'] ?? '') == 'None' ? 'selected' : '' ?>>None</option> <option value="Yes" <?= ($personal_data['disability'] ?? '') == 'Yes' ? 'selected' : '' ?>>Yes</option> </select> </div> <div class="form-group"> <label>Lifestyle</label> <input type="text" name="lifestyle" value="<?= htmlspecialchars($personal_data['lifestyle'] ?? '') ?>"> </div> <div class="form-group"> <label>Assets</label> <input type="text" name="assets" value="<?= htmlspecialchars($personal_data['assets'] ?? '') ?>"> </div> <div class="form-group" style="grid-column: 1 / -1;"> <label>Hobbies</label> <textarea name="hobbies"><?= htmlspecialchars($personal_data['hobbies'] ?? '') ?></textarea> </div> </div> </div> <div class="form-section"> <h4>Other Details</h4> <div class="form-row"> <div class="form-group"> <label>Alternate Mobile Number</label> <input type="text" name="alternate_mobile_no" value="<?= htmlspecialchars($other_data['alternate_contact_no'] ?? '') ?>"> </div> <div class="form-group"> <label>Marry to Other Caste</label> <select name="marry_to_other_cast"> <option value="">Select</option> <option value="Yes" <?= ($other_data['marry_to_other_cast'] ?? '') == 'Yes' ? 'selected' : '' ?>>Yes</option> <option value="No" <?= ($other_data['marry_to_other_cast'] ?? '') == 'No' ? 'selected' : '' ?>>No</option> </select> </div> <div class="form-group"> <label>Ready to Settle Abroad</label> <select name="ready_to_settle_abroad"> <option value="">Select</option> <option value="Yes" <?= ($other_data['ready_to_settle_in_abroad'] ?? '') == 'Yes' ? 'selected' : '' ?>>Yes</option> <option value="No" <?= ($other_data['ready_to_settle_in_abroad'] ?? '') == 'No' ? 'selected' : '' ?>>No</option> </select> </div> </div> </div> <button type="submit" class="btn-save">Save Personal Details</button> </form> </div> <!-- Education & Profession Tab --> <div id="education" class="tab-content"> <form id="educationForm"> <div class="form-section"> <h4>Education & Profession</h4> <div class="form-row"> <div class="form-group"> <label>Highest Qualification</label> <select name="highest_qualification"> <option value="">Select</option> <option value="Ph.D" <?= ($education_data['highest_qualification'] ?? '') == 'Ph.D' ? 'selected' : '' ?>>Ph.D</option> <option value="Post Graduation" <?= ($education_data['highest_qualification'] ?? '') == 'Post Graduation' ? 'selected' : '' ?>>Post Graduation</option> <option value="Graduation" <?= ($education_data['highest_qualification'] ?? '') == 'Graduation' ? 'selected' : '' ?>>Graduation</option> <option value="HSC (12th)" <?= ($education_data['highest_qualification'] ?? '') == 'HSC (12th)' ? 'selected' : '' ?>>HSC (12th)</option> <option value="SSC (10th)" <?= ($education_data['highest_qualification'] ?? '') == 'SSC (10th)' ? 'selected' : '' ?>>SSC (10th)</option> </select> </div> <div class="form-group"> <label>College Name</label> <input type="text" name="college_name" value="<?= htmlspecialchars($education_data['college_name'] ?? '') ?>"> </div> <div class="form-group"> <label>Working With</label> <select name="working_with"> <option value="">Select</option> <option value="Private Company" <?= ($education_data['working_with'] ?? '') == 'Private Company' ? 'selected' : '' ?>>Private Company</option> <option value="Government/PSU" <?= ($education_data['working_with'] ?? '') == 'Government/PSU' ? 'selected' : '' ?>>Government/PSU</option> <option value="Defense" <?= ($education_data['working_with'] ?? '') == 'Defense' ? 'selected' : '' ?>>Defense</option> <option value="Business" <?= ($education_data['working_with'] ?? '') == 'Business' ? 'selected' : '' ?>>Business</option> <option value="Self Employed" <?= ($education_data['working_with'] ?? '') == 'Self Employed' ? 'selected' : '' ?>>Self Employed</option> <option value="Not Working" <?= ($education_data['working_with'] ?? '') == 'Not Working' ? 'selected' : '' ?>>Not Working</option> </select> </div> <div class="form-group"> <label>Working As</label> <input type="text" name="working_as" value="<?= htmlspecialchars($education_data['working_as'] ?? '') ?>"> </div> <div class="form-group"> <label>Company Email</label> <input type="email" name="company_email" value="<?= htmlspecialchars($education_data['company_email'] ?? '') ?>"> </div> <div class="form-group"> <label>Company Location</label> <input type="text" name="company_location" value="<?= htmlspecialchars($education_data['company_location'] ?? '') ?>"> </div> <div class="form-group"> <label>Annual Income</label> <input type="text" name="annual_income" value="<?= htmlspecialchars($education_data['annual_income'] ?? '') ?>" placeholder="e.g., 500000"> </div> </div> </div> <button type="submit" class="btn-save">Save Education & Profession</button> </form> </div> <!-- Family Details Tab --> <div id="family" class="tab-content"> <form id="familyForm"> <div class="form-section"> <h4>Family Details</h4> <div class="form-row"> <div class="form-group"> <label>Father Name</label> <input type="text" name="father_name" value="<?= htmlspecialchars($family_data['father_name'] ?? '') ?>"> </div> <div class="form-group"> <label>Father Status</label> <select name="father_status"> <option value="">Select</option> <option value="Alive" <?= ($family_data['father_status'] ?? '') == 'Alive' ? 'selected' : '' ?>>Alive</option> <option value="Deceased" <?= ($family_data['father_status'] ?? '') == 'Deceased' ? 'selected' : '' ?>>Deceased</option> </select> </div> <div class="form-group"> <label>Mother Name</label> <input type="text" name="mother_name" value="<?= htmlspecialchars($family_data['mother_name'] ?? '') ?>"> </div> <div class="form-group"> <label>Mother Status</label> <select name="mother_status"> <option value="">Select</option> <option value="Alive" <?= ($family_data['mother_status'] ?? '') == 'Alive' ? 'selected' : '' ?>>Alive</option> <option value="Deceased" <?= ($family_data['mother_status'] ?? '') == 'Deceased' ? 'selected' : '' ?>>Deceased</option> </select> </div> <div class="form-group"> <label>Family Location</label> <input type="text" name="family_location" value="<?= htmlspecialchars($family_data['family_location'] ?? '') ?>"> </div> <div class="form-group"> <label>Native Place</label> <input type="text" name="native_place" value="<?= htmlspecialchars($family_data['native_place'] ?? '') ?>"> </div> <div class="form-group"> <label>Married Brothers</label> <input type="number" name="married_brothers" value="<?= htmlspecialchars($family_data['married_brothers'] ?? '0') ?>" min="0"> </div> <div class="form-group"> <label>Unmarried Brothers</label> <input type="number" name="not_married_brothers" value="<?= htmlspecialchars($family_data['not_married_brothers'] ?? '0') ?>" min="0"> </div> <div class="form-group"> <label>Married Sisters</label> <input type="number" name="married_sisters" value="<?= htmlspecialchars($family_data['married_sisters'] ?? '0') ?>" min="0"> </div> <div class="form-group"> <label>Unmarried Sisters</label> <input type="number" name="not_married_sisters" value="<?= htmlspecialchars($family_data['not_married_sisters'] ?? '0') ?>" min="0"> </div> <div class="form-group"> <label>Family Type</label> <select name="family_type"> <option value="">Select</option> <option value="Nuclear" <?= ($family_data['family_type'] ?? '') == 'Nuclear' ? 'selected' : '' ?>>Nuclear</option> <option value="Joint" <?= ($family_data['family_type'] ?? '') == 'Joint' ? 'selected' : '' ?>>Joint</option> </select> </div> <div class="form-group" style="grid-column: 1 / -1;"> <label>Family Values</label> <textarea name="family_values"><?= htmlspecialchars($family_data['family_values'] ?? '') ?></textarea> </div> </div> </div> <button type="submit" class="btn-save">Save Family Details</button> </form> </div> <!-- Horoscope Tab --> <div id="horoscope" class="tab-content"> <form id="horoscopeForm"> <div class="form-section"> <h4>Horoscope Details</h4> <div class="form-row"> <div class="form-group"> <label>Country of Birth</label> <input type="text" name="country_of_birth" value="<?= htmlspecialchars($horoscope_data['country_of_birth'] ?? '') ?>"> </div> <div class="form-group"> <label>City of Birth</label> <input type="text" name="city_of_birth" value="<?= htmlspecialchars($horoscope_data['city_of_birth'] ?? '') ?>"> </div> <div class="form-group"> <label>Time of Birth</label> <input type="time" name="time_of_birth" value="<?= htmlspecialchars($horoscope_data['time_of_birth'] ?? '') ?>"> </div> <div class="form-group"> <label>AM/PM</label> <select name="am_or_pm"> <option value="">Select</option> <option value="AM" <?= ($horoscope_data['am_or_pm'] ?? '') == 'AM' ? 'selected' : '' ?>>AM</option> <option value="PM" <?= ($horoscope_data['am_or_pm'] ?? '') == 'PM' ? 'selected' : '' ?>>PM</option> </select> </div> <div class="form-group"> <label>Rashi</label> <select name="rashi"> <option value="">Select Rashi</option> <option value="Mesha (Aries)" <?= ($horoscope_data['rashi'] ?? '') == 'Mesha (Aries)' ? 'selected' : '' ?>>Mesha (Aries)</option> <option value="Vrishabha (Taurus)" <?= ($horoscope_data['rashi'] ?? '') == 'Vrishabha (Taurus)' ? 'selected' : '' ?>>Vrishabha (Taurus)</option> <option value="Mithuna (Gemini)" <?= ($horoscope_data['rashi'] ?? '') == 'Mithuna (Gemini)' ? 'selected' : '' ?>>Mithuna (Gemini)</option> <option value="Karka (Cancer)" <?= ($horoscope_data['rashi'] ?? '') == 'Karka (Cancer)' ? 'selected' : '' ?>>Karka (Cancer)</option> <option value="Simha (Leo)" <?= ($horoscope_data['rashi'] ?? '') == 'Simha (Leo)' ? 'selected' : '' ?>>Simha (Leo)</option> <option value="Kanya (Virgo)" <?= ($horoscope_data['rashi'] ?? '') == 'Kanya (Virgo)' ? 'selected' : '' ?>>Kanya (Virgo)</option> <option value="Tula (Libra)" <?= ($horoscope_data['rashi'] ?? '') == 'Tula (Libra)' ? 'selected' : '' ?>>Tula (Libra)</option> <option value="Vrishchika (Scorpio)" <?= ($horoscope_data['rashi'] ?? '') == 'Vrishchika (Scorpio)' ? 'selected' : '' ?>>Vrishchika (Scorpio)</option> <option value="Dhanu (Sagittarius)" <?= ($horoscope_data['rashi'] ?? '') == 'Dhanu (Sagittarius)' ? 'selected' : '' ?>>Dhanu (Sagittarius)</option> <option value="Makara (Capricorn)" <?= ($horoscope_data['rashi'] ?? '') == 'Makara (Capricorn)' ? 'selected' : '' ?>>Makara (Capricorn)</option> <option value="Kumbha (Aquarius)" <?= ($horoscope_data['rashi'] ?? '') == 'Kumbha (Aquarius)' ? 'selected' : '' ?>>Kumbha (Aquarius)</option> <option value="Meena (Pisces)" <?= ($horoscope_data['rashi'] ?? '') == 'Meena (Pisces)' ? 'selected' : '' ?>>Meena (Pisces)</option> </select> </div> <div class="form-group"> <label>Manglik Dosham</label> <select name="manglik"> <option value="">Select</option> <option value="Yes" <?= ($horoscope_data['maglik_dosham'] ?? '') == 'Yes' ? 'selected' : '' ?>>Yes</option> <option value="No" <?= ($horoscope_data['maglik_dosham'] ?? '') == 'No' ? 'selected' : '' ?>>No</option> </select> </div> </div> </div> <button type="submit" class="btn-save">Save Horoscope Details</button> </form> </div> <!-- About Me Tab --> <div id="about" class="tab-content"> <form id="aboutForm"> <div class="form-section"> <h4>About Me</h4> <div class="form-group"> <label>About Me</label> <textarea name="about_us" rows="10"><?= htmlspecialchars($about_text) ?></textarea> </div> </div> <button type="submit" class="btn-save">Save About Me</button> </form> </div> </div> </div> </div> <?php include('footer.php'); ?> <script> jQuery(document).ready(function($) { // Tab navigation $('.tab-nav a').on('click', function(e) { e.preventDefault(); const tabId = $(this).data('tab'); $('.tab-nav a').removeClass('active'); $(this).addClass('active'); $('.tab-content').removeClass('active'); $('#' + tabId).addClass('active'); }); // Show alert message function showAlert(message, type) { const alertDiv = $('#alertMessage'); alertDiv.removeClass('alert-success alert-error') .addClass('alert-' + type) .text(message) .fadeIn(); setTimeout(function() { alertDiv.fadeOut(); }, 5000); } // Basic Info Form $('#basicInfoForm').on('submit', function(e) { e.preventDefault(); const formData = $(this).serialize() + '&user_id=<?= $user_id ?>'; $('#loadingIndicator').show(); $.ajax({ url: '../app/api/personal_deatils_update.php', method: 'POST', data: formData, dataType: 'json', success: function(response) { $('#loadingIndicator').hide(); if (response.success) { showAlert(response.message, 'success'); } else { showAlert(response.message || 'Update failed', 'error'); } }, error: function(xhr, status, error) { $('#loadingIndicator').hide(); showAlert('An error occurred. Please try again.', 'error'); } }); }); // Personal Details Form $('#personalDetailsForm').on('submit', function(e) { e.preventDefault(); const formData = $(this).serialize() + '&user_id=<?= $user_id ?>'; $('#loadingIndicator').show(); $.ajax({ url: '../app/api/personal_deatils_update.php', method: 'POST', data: formData, dataType: 'json', success: function(response) { $('#loadingIndicator').hide(); if (response.success) { showAlert(response.message, 'success'); } else { showAlert(response.message || 'Update failed', 'error'); } }, error: function(xhr, status, error) { $('#loadingIndicator').hide(); showAlert('An error occurred. Please try again.', 'error'); } }); }); // Education Form $('#educationForm').on('submit', function(e) { e.preventDefault(); const formData = $(this).serialize() + '&user_id=<?= $user_id ?>'; $('#loadingIndicator').show(); $.ajax({ url: '../app/api/update_education_profession.php', method: 'POST', data: formData, dataType: 'json', success: function(response) { $('#loadingIndicator').hide(); if (response.success) { showAlert(response.message, 'success'); } else { showAlert(response.message || 'Update failed', 'error'); } }, error: function(xhr, status, error) { $('#loadingIndicator').hide(); showAlert('An error occurred. Please try again.', 'error'); } }); }); // Family Form $('#familyForm').on('submit', function(e) { e.preventDefault(); const formData = $(this).serialize() + '&user_id=<?= $user_id ?>'; $('#loadingIndicator').show(); $.ajax({ url: '../app/api/update_family_details.php', method: 'POST', data: formData, dataType: 'json', success: function(response) { $('#loadingIndicator').hide(); if (response.success) { showAlert(response.message, 'success'); } else { showAlert(response.message || 'Update failed', 'error'); } }, error: function(xhr, status, error) { $('#loadingIndicator').hide(); showAlert('An error occurred. Please try again.', 'error'); } }); }); // Horoscope Form $('#horoscopeForm').on('submit', function(e) { e.preventDefault(); const formData = $(this).serialize() + '&user_id=<?= $user_id ?>'; $('#loadingIndicator').show(); $.ajax({ url: '../app/api/update_horoscope.php', method: 'POST', data: formData, dataType: 'json', success: function(response) { $('#loadingIndicator').hide(); if (response.success) { showAlert(response.message, 'success'); } else { showAlert(response.message || 'Update failed', 'error'); } }, error: function(xhr, status, error) { $('#loadingIndicator').hide(); showAlert('An error occurred. Please try again.', 'error'); } }); }); // About Form $('#aboutForm').on('submit', function(e) { e.preventDefault(); const formData = $(this).serialize() + '&user_id=<?= $user_id ?>'; $('#loadingIndicator').show(); $.ajax({ url: '../app/api/update_about_us.php', method: 'POST', data: formData, dataType: 'json', success: function(response) { $('#loadingIndicator').hide(); if (response.success) { showAlert(response.message, 'success'); } else { showAlert(response.message || 'Update failed', 'error'); } }, error: function(xhr, status, error) { $('#loadingIndicator').hide(); showAlert('An error occurred. Please try again.', 'error'); } }); }); }); </script>