0byt3m1n1
Path:
C:
/
Users
/
Administrator
/
Desktop
/
CWRDM Backup
/
WaterCat
/
[
Home
]
File: newsnew.php
<?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "watercat"; $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } $query =$sql = "SELECT image_name, image_description FROM images ORDER BY id DESC LIMIT 6"; // Modify the query to fetch image details $result = mysqli_query($conn, $query); if (!$result) { die("Error fetching data: " . mysqli_error($conn)); } ?> <!DOCTYPE html> <html> <head> <title>Image Slideshow</title> <link rel="stylesheet" type="text/css" href="styles.css"> <link rel="stylesheet" type="text/css" href="nav.css"> <style> /* Global styles */ body { font-family: Arial, sans-serif; background-color: #f0f0f0; color: #333; margin: 0; padding: 0; } /* Container styles */ .container { max-width: 1200px; margin: 0 auto; padding: 20px; } /* Gallery section */ #gallery { padding: 50px 0; background-color: #fff; border-radius: 10px; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1); } .gallery-title { text-align: center; margin-bottom: 30px; font-size: 24px; color: #333; } .gallery-item { margin-bottom: 30px; display: flex; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 20px; } .gallery-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; } .gallery-item img { flex: 0 0 auto; width: 500px; /* Adjust image width as needed */ height: auto; border-radius: 5px; margin-right: 20px; } .gallery-details { flex: 1; } .gallery-details h3 { font-size: 18px; margin-bottom: 10px; color: #333; } .gallery-details p { font-size: 14px; color: #666; } .button { background-color: #4CAF50; /* Green */ border: none; color: white; padding: 10px 30px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; } footer { background-color: #508ab3; /* Background color of the footer */ color: #fff; /* Text color */ padding: 20px 0; /* Padding around the footer content */ } .footer-content { display: flex; justify-content: space-between; align-items: flex-start; max-width: 1200px; /* Maximum width of the footer content */ margin: 0 auto; /* Center the footer content horizontally */ } .logo img { max-width: 100px; /* Adjust the maximum width of the logo */ height: auto; /* Maintain aspect ratio */ } .institution-name, .contact-info { flex: 1; padding: 0 20px; /* Spacing between elements */ } .contact-info h3, .institution-name h3 { margin-top: 0; /* Remove margin from the top of the headings */ } .copyright { text-align: center; /* Center the copyright text */ margin-top: 20px; /* Spacing between content and copyright */ } .copyright p { margin: 0; /* Remove margin from the paragraph */ } </style> </head> <body class="bg-white" style="background-image: url('assets/images/slider/s1.jpg');"> <div class="topnav"> <a class="active" href="indexnew.php">Home</a> <a href="newsnew.php">News</a> <a href="contact.php">Contact</a> <a href="about.html">About</a> </div> <div id="gallery" class="service container-fluid px-4"> <div class="container"> <h2 class="gallery-title">Gallery</h2> <p style="text-align: center; font-weight: bold; font-style: italic;">Capturing Moments: A Visual Journey through images</p> <?php // Loop through the fetched images and generate gallery items while ($row = mysqli_fetch_assoc($result)) { $image_name = $row['image_name']; $image_description = $row['image_description']; ?> <div class="gallery-item"> <img class="img-fluid square-image" src="gallery/<?php echo $image_name; ?>" alt="<?php echo $image_name; ?>"> <div class="gallery-details"> <p><?php echo $image_description; ?></p> </div> </div> <?php } ?> </div> </div> <footer> <div class="footer-content"> <div class="logo"> <img class="footer-logo" alt src="assets/images/logooo.jpg"> </div> <div class="institution-name"> <h3>Centre for Water Resources Development and Management Kunnamangalam, </h3> <p>Kozhikode-673 571</p> <p>Kerala , India</p> </div> <div class="contact-info"> <h3>Contact Information</h3> <p>Email: ed@cwrdm.org</p> <p>Phone: (91) 495 2351800,2351801, 2351803, 2351804<br> Fax: (91) 495 2351808</p> </div> </div> <div class="copyright"> <p>© 2024 CWRDM. All rights reserved.</p> </div> </footer> </body> </html>