pull/15/head
Suvodip 2024-12-26 18:22:47 +05:30
parent aa252de5c9
commit d212f88f27
4 changed files with 89 additions and 26 deletions

View File

@ -18,7 +18,7 @@
</a> </a>
</div> </div>
</div> </div>
<div class="col-12 col-md-6 col-lg-4 pt-2"> <div class="col-12 col-md-6 col-lg-4 pt-2 ">
<h2 class="text-uppercase">About College</h2> <h2 class="text-uppercase">About College</h2>
<p class="fw-normal" style="text-align: justify;">Sree Chaitanya College, Habra occupies a very distinguished status in the higher education map of the district of North 24 Parganas as well as of the state of West Bengal. The institution with its imposing building-structures amid a lush green of more than 20 acres of land, overlooking Jessore Road (NH 35), is about 40 km from Kolkata.</p> <p class="fw-normal" style="text-align: justify;">Sree Chaitanya College, Habra occupies a very distinguished status in the higher education map of the district of North 24 Parganas as well as of the state of West Bengal. The institution with its imposing building-structures amid a lush green of more than 20 acres of land, overlooking Jessore Road (NH 35), is about 40 km from Kolkata.</p>
</div> </div>

View File

@ -5,7 +5,7 @@
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass); $conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// $stmt = $conn->prepare("SELECT * FROM `scc22` WHERE `type` = 'notice'"); // $stmt = $conn->prepare("SELECT * FROM `scc22` WHERE `type` = 'notice'");
$stmt = $conn->prepare("SELECT * FROM `scc24` WHERE `type` = 'notice' ORDER BY `date_created` DESC"); $stmt = $conn->prepare("SELECT * FROM `scc24` WHERE `type` = 'notice' ORDER BY `date_created` DESC LIMIT 20");
$stmt->execute(); $stmt->execute();
$notices = $stmt->fetchAll(PDO::FETCH_ASSOC); $notices = $stmt->fetchAll(PDO::FETCH_ASSOC);
@ -21,18 +21,17 @@
$in_page_message = "<p class='text-danger'>Error: " . $e->getMessage() . "</p>"; $in_page_message = "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
} }
?> ?>
<div style="width: 100%;height: 480px;"> <div style="width: 100%;height: 100%;">
<img style="width: 100%;height: 100%;" src="/assets/adminstration/clg.jpg" alt="clg"> <img style="width: 100%;height: 100%;" src="/assets/adminstration/clg.jpg" alt="clg">
</div> </div>
<main class="container my-5 "> <main class="container my-5 ">
<div class="container row "> <div class="container row ">
<div class=" fw-normal col-lg-9 col-12"> <div class=" fw-normal col-lg-9 col-12">
<!-- Main Heading --> <!-- Main Heading -->
<h3 class="mb-4 text-center" style="color: #6b6245;">Vision of The College <hr></h3> <h3 class="mb-2 text-center" style="color: #6b6245;">Vision of The College <hr></h3>
<p class="text-center mb-4">Character Formation through Knowledge and Value-based Education for <p class="text-center mb-2">Character Formation through Knowledge and Value-based Education for
Transformation Transformation
of the Society and the Nation</p> of the Society and the Nation</p>
@ -73,42 +72,81 @@
</p> </p>
</div> </div>
</div> </div>
<div class="col-lg-3 col-12 gap-3">
<div class="col-lg-3 col-12"> <div class="card" style="width: 250px; border: 1px solid #ccc; margin-bottom: 10px;">
<div class="card" style="width: 250px; border: 1px solid #ccc;"> <div class="card-header fw-bold" style="color: #402517; background-color: #ffddcc">Notice</div>
<div class="card-header text-white fw-bold" style="background-color: #868756">Notice</div> <div id="scrollable" class="content list-group list-group-flush" style="height: 200px; overflow-y: auto;">
<div class="list-group list-group-flush" style="height: 200px; overflow-y: auto;">
<?php <?php
foreach ($notices as $notice) { foreach ($notices as $notice) {
echo '<a href="/notice/'.$notice['slug'].'" class="list-group-item list-group-item-action" style="color: #6b6245;">'.$notice['title'].'</a>'; echo '<a id="" href="/notice/'.$notice['slug'].'.html" class="list-group-item list-group-item-action" style="color: #6b6245;">'.$notice['title'].'</a>';
} }
?> ?>
</div> </div>
<div class="text-center" style="background-color: #868756; padding: 5px;"> <div class="text-center" style="background-color: #ffddcc; padding: 5px;">
<a href="/notice" class="w-100" style="color: #ffffff;">View All</a> <a href="/notice?type=notice" class="w-100" style="color: #402517; text-decoration: none;">View All</a>
</div> </div>
</div> </div>
<div class="card" style="width: 250px; border: 1px solid #ccc;"> <div class="card" style="width: 250px; border: 1px solid #ccc; margin-bottom: 10px;">
<div class="card-header text-white fw-bold" style="background-color: #868756">Important Links</div> <div class="card-header fw-bold" style="color: #402517; background-color: #ffddcc">Important Links</div>
<div class="list-group list-group-flush" style="height: 200px; overflow-y: auto;"> <div class="list-group list-group-flush" style="height: 200px; overflow-y: auto;">
<?php <?php
foreach ($importants as $important) { foreach ($importants as $important) {
echo '<a href="/notice/'.$important['slug'].'" class="list-group-item list-group-item-action" style="color: #6b6245;">'.$important['title'].'</a>'; echo '<a href="/notice/'.$important['slug'].'.html" class="list-group-item list-group-item-action" style="color: #6b6245;">'.$important['title'].'</a>';
} }
?> ?>
</div> </div>
</div> </div>
<div class="card" style="width: 250px; border: 1px solid #ccc;"> <div class="card" style="width: 250px; border: 1px solid #ccc;">
<div class="card-header text-white fw-bold" style="background-color: #868756">Important Links</div> <div class="card-header fw-bold" style="color: #402517; background-color: #ffddcc">Events</div>
<div class="list-group list-group-flush" style="height: 200px; overflow-y: auto;"> <div class="list-group list-group-flush" style="height: 200px; overflow-y: auto;">
<?php <?php
foreach ($events as $event) { foreach ($events as $event) {
echo '<a href="/notice/'.$event['slug'].'" class="list-group-item list-group-item-action" style="color: #6b6245;">'.$event['title'].'</a>'; echo '<a href="/notice/'.$event['slug'].'.html" class="list-group-item list-group-item-action" style="color: #6b6245;">'.$event['title'].'</a>';
} }
?> ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</main> </main>
<script>
const scrollableContent = document.querySelector("#scrollable .content");
let scrollInterval;
function startAutoScroll() {
scrollInterval = setInterval(() => {
scrollable.scrollTop += 1; // Adjust the increment as needed
if (scrollable.scrollTop + scrollable.clientHeight >= scrollable.scrollHeight) {
scrollable.scrollTop = 0; // Reset to the top if reached the end
}
}, 20); // Adjust the speed in milliseconds
}
function stopAutoScroll() {
clearInterval(scrollInterval);
}
// Start scrolling when the page loads
startAutoScroll();
// Optionally, stop scrolling on mouse hover
scrollableContent.addEventListener("mouseover", stopAutoScroll);
scrollableContent.addEventListener("mouseout", startAutoScroll);
</script>
<style>
#scrollable {
overflow: scroll; /* Enable scrolling */
border: 1px solid #ccc;
}
/* Hide scrollbar for modern browsers */
#scrollable::-webkit-scrollbar {
display: none; /* For Chrome, Safari, and Edge */
}
#scrollable {
scrollbar-width: none; /* For Firefox */
-ms-overflow-style: none; /* For Internet Explorer and Edge */
}
</style>

View File

@ -54,6 +54,8 @@
<link rel="stylesheet" type="text/css" href="/assets/pell.css"> <link rel="stylesheet" type="text/css" href="/assets/pell.css">
<script src="/assets/pell.js"></script> <script src="/assets/pell.js"></script>
<?php <?php
$fileName = $_GET['slug'] . '.html';
$contentType = $_GET['type'];
$getID = $_GET['id']; $getID = $_GET['id'];
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
@ -68,6 +70,26 @@
$stmt->bindParam(':content', $_POST['content']); $stmt->bindParam(':content', $_POST['content']);
$stmt->execute(); $stmt->execute();
// echo "<script>window.location.href='edit-news-list';</script>"; // echo "<script>window.location.href='edit-news-list';</script>";
if ($contentType === 'page') {
$contentFolder = '/';
} elseif ($contentType === 'notice') {
$contentFolder = '/notice/';
} else {
$contentFolder = ''; // Default case, you can adjust this as needed
}
$filePath = $_SERVER['DOCUMENT_ROOT'] . $contentFolder . $fileName;
// echo $filePath;
if (file_exists($filePath)) {
if (unlink($filePath)) {
// echo "File deleted successfully.";
} else {
// echo "Error: Unable to delete the file.";
}
} else {
// echo "File does not exist.";
}
} catch (PDOException $e) { } catch (PDOException $e) {
echo "Err: " . $e->getMessage(); echo "Err: " . $e->getMessage();
} }
@ -138,12 +160,15 @@ try {
updateEditorContent(' . json_encode($row['content']) . '); updateEditorContent(' . json_encode($row['content']) . ');
</script>'; </script>';
}; };
// exit(); // exit();
} catch (PDOException $e) { } catch (PDOException $e) {
echo json_encode(array('success' => false, 'message' => 'Database error: ' . $e->getMessage())); echo json_encode(array('success' => false, 'message' => 'Database error: ' . $e->getMessage()));
} }
?> ?>
<?php <?php
// echo $fileName;
// echo $contentType;
require('../.hta_footer.php'); require('../.hta_footer.php');
?> ?>

View File

@ -29,7 +29,7 @@
<td style="border: 2px solid #7a7a7a;"><?php echo $pageData['title']; ?></td> <td style="border: 2px solid #7a7a7a;"><?php echo $pageData['title']; ?></td>
<td style="border: 2px solid #7a7a7a;"> <td style="border: 2px solid #7a7a7a;">
<div style="display: flex; flex-direction: row; justify-content: center; color: blue;"> <div style="display: flex; flex-direction: row; justify-content: center; color: blue;">
<a href="edit-content.php?id=<?php echo $pageData['id']; ?>">Edit</a> &nbsp; <a href="edit-content.php?id=<?php echo $pageData['id'] . '&slug=' . $pageData['slug'] . '&type=' . $pageData['type']; ?>">Edit</a> &nbsp;
<a target="_blank" href="<?php if($pageData['type'] === 'notice'){echo '/notice/'.$pageData['slug'].'.html';} elseif($pageData['type'] === 'page'){echo '/'.$pageData['slug'].'.html';}?>">View</a> <a target="_blank" href="<?php if($pageData['type'] === 'notice'){echo '/notice/'.$pageData['slug'].'.html';} elseif($pageData['type'] === 'page'){echo '/'.$pageData['slug'].'.html';}?>">View</a>
</div> </div>
</td> </td>