/
home
/
u764571690
/
domains
/
ojaspunj.com
/
public_html
/
/home/u764571690/domains/ojaspunj.com/public_html
mkdir
upload
Name
Size
Mode
Actions
api/
-
0755
rm
app/
-
0755
rm
billing/
-
0755
rm
certificates/
-
0755
rm
css/
-
0755
rm
detail image/
-
0755
rm
favicon_io/
-
0755
rm
fontawesome/
-
0755
rm
fonts/
-
0755
rm
image/
-
0755
rm
indeximage/
-
0755
rm
js/
-
0755
rm
OFFER PRODUCT/
-
0755
rm
offer product/
-
0755
rm
our product/
-
0755
rm
productdetail/
-
0755
rm
qwertyuiopasdfghjklzxcvbnmmnbvcxzlkjhgfdsapoiuytrewqqazwsxedcrfvtgbyhnujmikolppolikujmyhntgbrfvedcwsxqazasdfghjklpoiuytrewqzxcvbnmqwasedrftgyhjuikoplkjhgfdsazxcvbnmkoiuyhgtfrdeswqaszxdfcvgfdewwsdwasjdjfoifsdnjfhsudhfgjdssdhfgushfgbdghuifgbdgvhsdfg/
-
0755
rm
scholarship/
-
0755
rm
upload product/
-
0755
rm
vendor/
-
0755
rm
.htaccess
2654
0644
edit
dl
rm
about.php
23570
0644
edit
dl
rm
add_certificate.php
7159
0644
edit
dl
rm
add_offer_product.php
9101
0644
edit
dl
rm
add_our_product.php
7146
0644
edit
dl
rm
add_product.php
7186
0644
edit
dl
rm
admin_dashboard.php
27932
0644
edit
dl
rm
admin_login.php
4991
0644
edit
dl
rm
android-chrome-192x192.png
26999
0644
edit
dl
rm
android-chrome-512x512.png
130182
0644
edit
dl
rm
apple-touch-icon.png
24276
0644
edit
dl
rm
bmi.html
11059
0644
edit
dl
rm
buy.php
34458
0644
edit
dl
rm
check_session.php
3228
0644
edit
dl
rm
composer-setup.php
58444
0644
edit
dl
rm
composer.json
99
0644
edit
dl
rm
composer.lock
47706
0644
edit
dl
rm
composer.phar
3125568
0644
edit
dl
rm
config.php
246
0644
edit
dl
rm
contact.php
5852
0644
edit
dl
rm
create_remember_tokens.php
573
0644
edit
dl
rm
dashboard.php
140056
0644
edit
dl
rm
db_connect.php
712
0644
edit
dl
rm
delete_product.php
2567
0644
edit
dl
rm
edit_offer_product.php
7258
0644
edit
dl
rm
favicon-16x16.png
738
0644
edit
dl
rm
favicon.ico
15406
0644
edit
dl
rm
favicon.png
1958
0644
edit
dl
rm
get_product_detail_filename.php
647
0644
edit
dl
rm
google8752ffcd74dff0e8.html
53
0644
edit
dl
rm
googledc4255937cf5f8da.html
53
0644
edit
dl
rm
google_oauth.php
6539
0644
edit
dl
rm
index.php
69621
0644
edit
dl
rm
loading.html
584
0644
edit
dl
rm
log.php
596
0644
edit
dl
rm
login.php
17416
0644
edit
dl
rm
logout.php
598
0644
edit
dl
rm
my_orders.php
13285
0644
edit
dl
rm
order_success.php
3544
0644
edit
dl
rm
our_certificate.php
10809
0644
edit
dl
rm
our_product.php
9589
0644
edit
dl
rm
privacypolicy.php
4277
0644
edit
dl
rm
product1.php
22023
0644
edit
dl
rm
profile.php
18426
0644
edit
dl
rm
refund.php
6282
0644
edit
dl
rm
register.php
15800
0644
edit
dl
rm
robots.txt
742
0644
edit
dl
rm
savitrfoundationscholarship.php
160332
0644
edit
dl
rm
sitemap.xml
935
0644
edit
dl
rm
specialoffer.php
13234
0644
edit
dl
rm
terms$condition.php
6412
0644
edit
dl
rm
verify_payment.php
19770
0644
edit
dl
rm
view.php
4870
0644
edit
dl
rm
x.php
19056
0644
edit
dl
rm
Edit:
/home/u764571690/domains/ojaspunj.com/public_html/profile.php
(18426B)
<?php session_start(); require_once 'db_connect.php'; // Check if user is logged in if (!isset($_SESSION['user_id'])) { header('Location: login.php'); exit(); } $user_id = $_SESSION['user_id']; // Handle profile update (only text fields) if ($_SERVER['REQUEST_METHOD'] === 'POST') { $fullname = $_POST['fullname'] ?? ''; $mobile = $_POST['mobile'] ?? ''; $house_flat_no = $_POST['house_flat_no'] ?? ''; $street_area = $_POST['street_area'] ?? ''; $city = $_POST['city'] ?? ''; $state = $_POST['state'] ?? ''; $pincode = $_POST['pincode'] ?? ''; $landmark = $_POST['landmark'] ?? ''; $alternate_phone = $_POST['alternate_phone'] ?? ''; // Profile photo is NOT updated from this form // Prepare the update query for text fields only $sql = "UPDATE users SET fullname=?, mobile=?, house_flat_no=?, street_area=?, city=?, state=?, pincode=?, landmark=?, alternate_phone=? WHERE user_id=?"; $stmt = $conn->prepare($sql); $stmt->bind_param("sssssssssi", $fullname, $mobile, $house_flat_no, $street_area, $city, $state, $pincode, $landmark, $alternate_phone, $user_id); if ($stmt->execute()) { // Redirect back to the profile page or show a success message header('Location: profile?status=success'); exit(); } else { // Handle database error $error_message = "Error updating profile: " . $conn->error; // Redirect back to profile with error status and message header('Location: profile?status=error&message=' . urlencode($error_message)); exit(); } } // Get user data for display (runs on GET request or after POST redirect) $sql = "SELECT user_id, fullname, email, mobile, picture, house_flat_no, street_area, city, state, pincode, landmark, alternate_phone FROM users WHERE user_id = ?"; $stmt = $conn->prepare($sql); $stmt->bind_param("i", $user_id); $stmt->execute(); $result = $stmt->get_result(); $user = $result->fetch_assoc(); // Include HTML structure ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>User Profile - Ojas Punj</title> <link rel="shortcut icon" href="/favicon_io/favicon.ico" type="image/x-icon"> <link rel="icon" type="image/png" href="/image/logo.png"> <!-- SEO Meta Tags --> <meta name="description" content="Manage your Ojas Punj profile, view your details, and track your orders." /> <link rel="stylesheet" href="fonts/poppins/poppins.css"> <link rel="stylesheet" href="fontawesome/css/all.min.css"> <style> :root { --primary-color: #2E7D32; --accent-color: #4CAF50; --bg-color: #f8f9fa; --card-bg: #ffffff; --text-color: #2c3e50; --gradient-primary: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%); } body { font-family: 'Poppins', sans-serif; background-color: var(--bg-color); color: var(--text-color); line-height: 1.6; margin: 0; padding: 20px; display: flex; justify-content: center; align-items: flex-start; /* Align items to the top */ min-height: 100vh; /* Use min-height */ background: linear-gradient(135deg, #f8f9fa 60%, #e0f2f1 100%); /* Match dashboard body gradient */ background-attachment: fixed; } body.dark-mode { background: linear-gradient(135deg, #181a1b 60%, #232526 100%) !important; color: #f1f1f1; } .profile-container { background-color: #fff; padding: 30px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); width: 90%; max-width: 600px; margin-top: 30px; /* Add some top margin */ margin-bottom: 30px; /* Add some bottom margin */ } .dark-mode .profile-container { background-color: #232526; color: #f1f1f1; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); } h2 { font-size: 1.8rem; font-weight: 700; color: var(--text-color); margin-bottom: 25px; text-align: center; } .dark-mode h2 { color: #f1f1f1; } .profile-header { display: flex; align-items: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #eee; position: relative; /* Needed for photo upload button positioning */ } .dark-mode .profile-header { border-bottom-color: #333; } .profile-image-large { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; margin-right: 20px; border: 3px solid var(--primary-color); flex-shrink: 0; position: relative; /* Needed for photo upload button positioning */ } .profile-image-large img { width: 100%; height: 100%; object-fit: cover; } /* Removed profile photo upload icon and input */ .profile-info-large { display: flex; flex-direction: column; } .profile-info-large h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 5px; color: var(--text-color); text-align: left; /* Align text to left */ } .dark-mode .profile-info-large h2 { color: #f1f1f1; } .profile-info-large p { font-size: 1rem; color: #777; } .dark-mode .profile-info-large p { color: #ccc; } .profile-fields { display: grid; grid-template-columns: 1fr 1fr; /* Two columns */ gap: 20px; /* Space between fields */ margin-bottom: 30px; /* Space before button */ } .field-group { background-color: #f8f9fa; /* Light background */ padding: 15px 20px; /* Padding inside the field */ border-radius: 8px; /* Rounded corners */ display: flex; flex-direction: column; } .dark-mode .field-group { background-color: #333; } .field-group label { font-size: 0.9rem; /* Label size */ color: #555; /* Label color */ margin-bottom: 5px; /* Space between label and value */ font-weight: 500; } .dark-mode .field-group label { color: #ccc; } .field-group input[type="text"], .field-group input[type="email"], .field-group input[type="tel"] { background: none; /* Remove background from inputs */ border: none; /* Remove border from inputs */ padding: 0; /* Remove padding from inputs */ font-size: 1.1rem; /* Value size */ color: var(--text-color); /* Value color */ font-weight: 400; width: 100%; /* Make input take full width */ outline: none; /* Remove outline on focus */ } .dark-mode .field-group input[type="text"], .dark-mode .field-group input[type="email"], .dark-mode .field-group input[type="tel"] { color: #f1f1f1; } /* Style for inputs on focus */ .field-group input[type="text"]:focus, .field-group input[type="email"]:focus, .field-group input[type="tel"]:focus { border-bottom: 1px solid var(--primary-color); /* Add bottom border on focus */ } .dark-mode .field-group input[type="text"]:focus, .dark-mode .field-group input[type="email"]:focus, .dark-mode .field-group input[type="tel"]:focus { border-bottom-color: #4CAF50; /* Darker green border on focus in dark mode */ } /* Special handling for full-width fields */ .profile-fields .full-width { grid-column: span 2; /* Field takes full width */ } .edit-profile-btn { background: linear-gradient(45deg, #4CAF50, #8BC34A); /* Green gradient */ color: white; padding: 12px 25px; border: none; border-radius: 25px; /* Pill shape */ font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; /* Fit to content */ margin: 0 auto; /* Center the button */ } .edit-profile-btn:hover { background: linear-gradient(45deg, #8BC34A, #4CAF50); /* Reverse gradient on hover */ box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4); } .status-message { text-align: center; margin-bottom: 20px; padding: 10px; border-radius: 5px; } .status-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; } .status-error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; } /* Responsive adjustments */ @media (max-width: 600px) { body { padding: 10px; } .profile-container { padding: 20px; width: 95%; margin-top: 10px; margin-bottom: 10px; } .profile-header { flex-direction: column; /* Stack image and info on smaller screens */ text-align: center; } .profile-image-large { margin-right: 0; margin-bottom: 15px; /* Space below image when stacked */ } /* Removed profile photo upload icon and input */ .profile-info-large h2 { font-size: 1.3rem; text-align: center; /* Center text when stacked */ } .profile-info-large p { font-size: 0.9rem; } .profile-fields { grid-template-columns: 1fr; /* Single column layout on smaller screens */ gap: 15px; } .profile-fields .full-width { grid-column: span 1; /* Full width field goes back to single column */ } .field-group { padding: 12px 15px; } .field-group label { font-size: 0.85rem; } .field-group input[type="text"], .field-group input[type="email"], .field-group input[type="tel"] { font-size: 1rem; } .edit-profile-btn { padding: 10px 20px; font-size: 0.95rem; } } </style> </head> <body> <div class="profile-container"> <h2>My Profile</h2> <?php if (isset($_GET['status'])): ?> <div class="status-message status-<?php echo htmlspecialchars($_GET['status']); ?>"> <?php echo htmlspecialchars($_GET['message'] ?? ( $_GET['status'] === 'success' ? 'Profile updated successfully!' : 'An error occurred.' )); ?> </div> <?php endif; ?> <form action="profile" method="POST"> <div class="profile-header"> <div class="profile-image-large"> <img src="<?php echo htmlspecialchars($user['picture'] ?? 'image/default-avatar.png'); ?>" alt="Profile Picture" id="userProfilePicLarge"> <!-- Removed photo upload input --> </div> <div class="profile-info-large"> <h2><?php echo htmlspecialchars($user['fullname'] ?? 'User Name'); ?></h2> <p><?php echo htmlspecialchars($user['email'] ?? 'user@email.com'); ?></p> </div> </div> <div class="profile-fields"> <div class="field-group"> <label for="fullname">Full Name</label> <input type="text" id="fullname" name="fullname" value="<?php echo htmlspecialchars($user['fullname'] ?? ''); ?>"> </div> <div class="field-group"> <label for="email">Email</label> <!-- Email is displayed but not editable --> <input type="email" id="email" value="<?php echo htmlspecialchars($user['email'] ?? ''); ?>" readonly style="color: #666;"> </div> <div class="field-group"> <label for="mobile">Phone</label> <input type="tel" id="mobile" name="mobile" value="<?php echo htmlspecialchars($user['mobile'] ?? ''); ?>"> </div> <div class="field-group full-width"> <label for="house_flat_no">House/Flat No.</label> <input type="text" id="house_flat_no" name="house_flat_no" value="<?php echo htmlspecialchars($user['house_flat_no'] ?? ''); ?>"> </div> <div class="field-group full-width"> <label for="street_area">Street/Area</label> <input type="text" id="street_area" name="street_area" value="<?php echo htmlspecialchars($user['street_area'] ?? ''); ?>"> </div> <div class="field-group"> <label for="city">City</label> <input type="text" id="city" name="city" value="<?php echo htmlspecialchars($user['city'] ?? ''); ?>"> </div> <div class="field-group"> <label for="state">State</label> <input type="text" id="state" name="state" value="<?php echo htmlspecialchars($user['state'] ?? ''); ?>"> </div> <div class="field-group"> <label for="pincode">Pincode</label> <input type="text" id="pincode" name="pincode" value="<?php echo htmlspecialchars($user['pincode'] ?? ''); ?>"> </div> <div class="field-group full-width"> <label for="landmark">Landmark (Optional)</label> <input type="text" id="landmark" name="landmark" value="<?php echo htmlspecialchars($user['landmark'] ?? ''); ?>"> </div> <div class="field-group"> <label for="alternate_phone">Alternate Phone (Optional)</label> <input type="tel" id="alternate_phone" name="alternate_phone" value="<?php echo htmlspecialchars($user['alternate_phone'] ?? ''); ?>"> </div> </div> <button type="submit" class="edit-profile-btn"> <i class="fas fa-edit"></i> Update Profile </button> </form> </div> <script> // Optional: Display success/error message for a few seconds const statusMessage = document.querySelector('.status-message'); if (statusMessage) { setTimeout(() => { statusMessage.style.display = 'none'; }, 5000); // Hide after 5 seconds } // Removed photo preview script // Basic Dark Mode Toggle (can be integrated with dashboard's toggle if needed) // For a simple page, we can add a separate toggle or assume state from session/local storage // Here's a basic example: const darkToggle = document.createElement('button'); darkToggle.classList.add('dark-toggle'); // Use a class for positioning/styling darkToggle.innerHTML = '<i class="fas fa-moon"></i>'; darkToggle.style.position = 'fixed'; darkToggle.style.bottom = '20px'; darkToggle.style.right = '20px'; darkToggle.style.zIndex = '1000'; darkToggle.style.background = '#fff'; darkToggle.style.color = '#222'; darkToggle.style.border = 'none'; darkToggle.style.borderRadius = '50%'; darkToggle.style.width = '48px'; darkToggle.style.height = '48px'; darkToggle.style.boxShadow = '0 2px 8px rgba(0,0,0,0.15)'; darkToggle.style.display = 'flex'; darkToggle.style.alignItems = 'center'; darkToggle.style.justifyContent = 'center'; darkToggle.style.fontSize = '1.5rem'; darkToggle.style.cursor = 'pointer'; darkToggle.style.transition = 'background 0.3s, color 0.3s'; document.body.appendChild(darkToggle); darkToggle.addEventListener('click', () => { document.body.classList.toggle('dark-mode'); // Save preference to local storage if needed if(document.body.classList.contains('dark-mode')) { darkToggle.innerHTML = '<i class="fas fa-sun"></i>'; localStorage.setItem('darkMode', 'enabled'); } else { darkToggle.innerHTML = '<i class="fas fa-moon"></i>'; localStorage.setItem('darkMode', 'disabled'); } }); // Apply dark mode on load based on local storage if (localStorage.getItem('darkMode') === 'enabled') { document.body.classList.add('dark-mode'); darkToggle.innerHTML = '<i class="fas fa-sun"></i>'; } </script> </body> </html>
Save
cmd:
run