/
/
home
/
u523034047
/
domains
/
rakeshfilms.in
/
public_html
/
skw
/
admin
Server: in-mum-web1112.main-hosting.eu (62.72.28.111)
You: 216.73.216.130
PHP 8.3.16
Dir:
/home/u523034047/domains/rakeshfilms.in/public_html/skw/admin
Edit:
/home/u523034047/domains/rakeshfilms.in/public_html/skw/admin/setting.php
<?php include('conn.php'); session_start(); error_reporting(0); if (!isset($_SESSION['username'])) { header('location:index.php'); exit(); } // Fetch current settings $result = mysqli_query($connection, "SELECT * FROM settings WHERE id=1"); $row = mysqli_fetch_assoc($result); // Update settings on submit if (isset($_POST['update'])) { $address = $_POST['address']; $mobile_no = $_POST['mobile_no']; $email_id = $_POST['email_id']; $facebook = $_POST['facebook']; $instagram = $_POST['instagram']; $youtube = $_POST['youtube']; $stmt = $connection->prepare("UPDATE settings SET address=?, mobile_no=?, email_id=?, facebook=?, instagram=?, youtube=? WHERE id=1"); $stmt->bind_param("ssssss", $address, $mobile_no, $email_id, $facebook, $instagram, $youtube); if ($stmt->execute()) { echo "<script>alert('✅ Settings updated successfully');</script>"; } else { echo "<script>alert('❌ Failed to update settings');</script>"; } $stmt->close(); // Refresh values $result = mysqli_query($connection, "SELECT * FROM settings WHERE id=1"); $row = mysqli_fetch_assoc($result); } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Admin</title> <!-- BOOTSTRAP STYLES--> <link href="assets/css/bootstrap.css" rel="stylesheet" /> <!-- FONTAWESOME STYLES--> <link href="assets/css/font-awesome.css" rel="stylesheet" /> <!-- CUSTOM STYLES--> <link href="assets/css/custom.css" rel="stylesheet" /> <!-- GOOGLE FONTS--> <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' /> </head> <body> <div id="wrapper"> <div class="navbar navbar-inverse navbar-fixed-top"> <?php include ('header.php');?> </div> <!-- /. NAV TOP --> <nav class="navbar-default navbar-side" role="navigation"> <?php include ('menu.php');?> </nav> <!-- /. NAV SIDE --> <div id="page-wrapper" > <div id="page-inner"> <!-- /. ROW --> <div class="panel panel-primary" data-collapsed="0"> <div class="panel-heading"> <div class="panel-title" > <i class="entypo-plus-circled"></i> </div> </div> <form method="post" action="" enctype="multipart/form-data"> <div class="panel-body"> <div class="container bg-white p-4 rounded shadow"> <h3 class="mb-4 text-center text-success">🌐 Website Settings</h3> <form method="post"> <div class="mb-3"> <label>Address</label> <textarea name="address" class="form-control" rows="2"><?php echo $row['address']; ?></textarea> </div> <div class="mb-3"> <label>Mobile No</label> <input type="text" name="mobile_no" class="form-control" value="<?php echo $row['mobile_no']; ?>"> </div> <div class="mb-3"> <label>Email ID</label> <input type="email" name="email_id" class="form-control" value="<?php echo $row['email_id']; ?>"> </div> <div class="mb-3"> <label>Facebook</label> <input type="text" name="facebook" class="form-control" value="<?php echo $row['facebook']; ?>"> </div> <div class="mb-3"> <label>Instagram</label> <input type="text" name="instagram" class="form-control" value="<?php echo $row['instagram']; ?>"> </div> <div class="mb-3"> <label>YouTube</label> <input type="text" name="youtube" class="form-control" value="<?php echo $row['youtube']; ?>"> </div> <div class="text-center"> <button type="submit" name="update" class="btn btn-success px-4">Update Settings</button> </div> </form> </div> </form> </div> </div> <div class="panel panel-primary" data-collapsed="0"> <div class="panel-heading"> <div class="panel-title" > <i class="entypo-plus-circled"></i> Status </div> </div> <div class="panel-body"> <div style="overflow-x:auto;"> <div class="col-lg-12 col-md-12"> <div class="table-responsive"> <table class="table table-bordered table-striped"> <thead class="bg-success text-white"> <tr> <th>#</th> <th>Address</th> <th>Mobile No</th> <th>Email ID</th> <th>Facebook</th> <th>Instagram</th> <th>YouTube</th> <th>Action</th> </tr> </thead> <tbody> <?php include("connection.php"); // Fetch settings $sql = "SELECT * FROM settings ORDER BY id DESC"; $query = mysqli_query($connection, $sql); $count = 1; while ($fetch = mysqli_fetch_assoc($query)) { ?> <tr> <td><?php echo $count++; ?></td> <td><?php echo htmlspecialchars($fetch['address']); ?></td> <td><?php echo htmlspecialchars($fetch['mobile_no']); ?></td> <td><?php echo htmlspecialchars($fetch['email_id']); ?></td> <td><a href="<?php echo htmlspecialchars($fetch['facebook']); ?>" target="_blank">Facebook</a></td> <td><a href="<?php echo htmlspecialchars($fetch['instagram']); ?>" target="_blank">Instagram</a></td> <td><a href="<?php echo htmlspecialchars($fetch['youtube']); ?>" target="_blank">YouTube</a></td> <td> <form method="POST" style="display:inline-block;"> <input type="hidden" name="id" value="<?php echo $fetch['id']; ?>"> <button type="submit" name="edit" class="btn btn-primary btn-sm">Edit</button> </form> <form method="POST" style="display:inline-block;"> <input type="hidden" name="id" value="<?php echo $fetch['id']; ?>"> </form> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> <!-- /. PAGE INNER --> </div> <!-- /. PAGE WRAPPER --> </div> <div class="footer"> <?php include ('footer.php');?> </div> <!-- /. WRAPPER --> <!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME--> <!-- JQUERY SCRIPTS --> <script src="assets/js/jquery-1.10.2.js"></script> <!-- BOOTSTRAP SCRIPTS --> <script src="assets/js/bootstrap.min.js"></script> <!-- CUSTOM SCRIPTS --> <script src="assets/js/custom.js"></script> </body> </html>
Ukuran: 7.8 KB