<body> <div id="wrapper"> <header id="title_top"> <h1 class="title_top">Gallery List</h1> <h3><a href="Images_add.php?Gallery_id=<?=$_GET["Gallery_id"];?>">Insert Picture </a></h3> </header> <? include('Part_Header.php'); ?> <section> <?php include('include/connect.php'); ini_set('display_error', 1); error_reporting(E_ALL); $sql = "SELECT * FROM gallery WHERE GalleryID = '".$_GET["Gallery_id"]."'"; $result = mysqli_query($con,$sql)or die("Error Query[".$sql."]"); $rows = mysqli_fetch_array($result); //echo $rows["GalleryID"]; ?> <?php $sql = "SELECT * FROM images_gallery WHERE GalleryID = '".$_GET["Gallery_id"]."'"; $result = mysqli_query($con,$sql) or die("Error Query[".$sql."]"); $Num_Rows = mysqli_num_rows($result); $Per_Page = 3; // Per Page if(isset($_GET["Page"])){ $Page = $_GET["Page"]; }else{ $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $sql .=" order by ImagesID DESC LIMIT $Page_Start , $Per_Page"; $result = mysqli_query($con,$sql); ?> <table align='center'width="471"> <tr> <!--<th width="136"><div align="center">Image ID </div></th>--> <th width="106"><div align="center">ImageShot </div></th> <th width="162"><div align="center">ImageName</div></th> <th width="43"><div align="center">Edit</div></th> <th width="42"><div align="center">Delete</div></th> </tr> <?php while($rows = mysqli_fetch_array($result)){ ?> <tr> <td> <center><a href="resource/Gallery/<?=$rows["ImagesName"];?>"target="_blank"> <img src="resource/Gallery/<?=$rows["ImagesName"];?>" width="100" height="100"></a></center> </td> <td><center><?=$rows["ImagesName"];?></center></td> <td> <center> <a href="Images_edit.php?Gallery_id=<?=$rows["GalleryID"];?>&Images_id=<?=$rows["ImagesID"];?>"> <img src="images/img_form/kate.png" width='28'> </a> </center> </td> <!--แก้ไขรูปภาพ images_gallery--> <td> <a href="JavaScript:if(confirm('Confirm Delete?')==true){ window.location='Images_delete.php?Gallery_id=<?=$rows["GalleryID"];?>&Images_id=<?=$rows["ImagesID"];?>'}"> <img src="images/img_form/bin.png" width="28"> </a> </td> </tr> <? } ?> </table> <div id="num_page"> Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page :<br><br> <? if($Page >= 4) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=1&Gallery_id=".$_GET["Gallery_id"]."'>First</a> "; } if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&Gallery_id=".$_GET["Gallery_id"]."'><< Back</a> "; } if($Page <= 3) $x = 1; else $x = $Page-3; if($Page >= $Num_Pages - 3) $y = $Num_Pages; else $y = $Page + 3; for($i=$x; $i<=$y; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&Gallery_id=".$_GET["Gallery_id"]."'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&Gallery_id=".$_GET["Gallery_id"]."'>Next>></a> "; } if($Page!=$Num_Pages - 3) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Num_Pages&Gallery_id=".$_GET["Gallery_id"]."'>Last</a> "; } ?> </div> </section> <? include('Part_Footer.php'); ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง