查看文件: showwebpic.php
大小: 4.46 KB
类型: application/octet-stream
<? require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php //if (isset($_GET['del_id'])){ // mysql_select_db($database_BE2, $BE2); // $delete_Rt2 = sprintf("delete FROM food WHERE id3= '%s' ",$_GET['del_id'] ); // mysql_query($delete_Rt2, $BE2) or die(mysql_error()); //} $currentPage = "main.php?act=showwebpic";//$_SERVER["PHP_SELF"]; $maxRows_Rr3 = 30; $pageNum_Rr3 = 0; if (isset($_GET['pageNum_Rr3'])) { $pageNum_Rr3 = $_GET['pageNum_Rr3']; } $startRow_Rr3 = $pageNum_Rr3 * $maxRows_Rr3; mysql_select_db($database_BE2, $BE2); $query_Rr3 = "SELECT * FROM webpic WHERE 1 ORDER BY gid DESC" ; $query_limit_Rr3 = sprintf("%s LIMIT %d, %d", $query_Rr3, $startRow_Rr3, $maxRows_Rr3); $Rr3 = mysql_query($query_limit_Rr3, $BE2) or die(mysql_error()); $row_Rr3 = mysql_fetch_assoc($Rr3); if (isset($_GET['totalRows_Rr3'])) { $totalRows_Rr3 = $_GET['totalRows_Rr3']; } else { $all_Rr3 = mysql_query($query_Rr3); $totalRows_Rr3 = mysql_num_rows($all_Rr3); } $totalPages_Rr3 = ceil($totalRows_Rr3/$maxRows_Rr3)-1; $queryString_Rr3 = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_Rr3") == false && stristr($param, "totalRows_Rr3") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_Rr3 = "&" . htmlentities(implode("&", $newParams)); } } $queryString_Rr3 = sprintf("&totalRows_Rr3=%d%s", $totalRows_Rr3, $queryString_Rr3); ?> <table width="1043" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="870"> </td> </tr> <tr> <td height="87"><table border="0" cellpadding="0" cellspacing="0" > <tr> <?php $Rr3_endRow = 0; $Rr3_columns = 5; // number of columns $Rr3_hloopRow1 = 0; // first row flag do { if($Rr3_endRow == 0 && $Rr3_hloopRow1++ != 0) echo "<tr>"; ?> <td width="166"><table width="158" border="0" cellspacing="2" cellpadding="2"> <tr> <td height="39" colspan="2" align="center"><? $mmfile='../webpic/_thumbs/'.$row_Rr3['jpg'];?> <img src="<?php echo $mmfile; ?>" border="0" /></td> </tr> <tr> <td width="113" class="font7"><?php echo $row_Rr3['gdoc']."<br>".$row_Rr3['wsize']; ?></td> <td width="31" class="font7"><a href="javascript:if(confirm('確實要刪除嗎?'))location='<? echo 'main.php?act=showwebpic&del_id='.$row_Rr3['gid']."&ifile=".$row_Rt2['jpg'] ;?>'"><img src="images/del.png" alt="刪除項目" width="17" height="17" border="0"/></a></td> </tr> </table></td> <?php $Rr3_endRow++; if($Rr3_endRow >= $Rr3_columns) { ?> </tr> <?php $Rr3_endRow = 0; } } while ($row_Rr3 = mysql_fetch_assoc($Rr3)); if($Rr3_endRow != 0) { while ($Rr3_endRow < $Rr3_columns) { echo("<td> </td>"); $Rr3_endRow++; } echo("</tr>"); }?> </table></td> </tr> <tr> <td> <table border="0" width="55%" align="center"> <tr> <td width="23%" align="center"><?php if ($pageNum_Rr3 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Rr3=%d%s", $currentPage, 0, $queryString_Rr3); ?>">第一頁</a> <?php } // Show if not first page ?> </td> <td width="31%" align="center"><?php if ($pageNum_Rr3 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Rr3=%d%s", $currentPage, max(0, $pageNum_Rr3 - 1), $queryString_Rr3); ?>">上一頁</a> <?php } // Show if not first page ?> </td> <td width="23%" align="center"><?php if ($pageNum_Rr3 < $totalPages_Rr3) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Rr3=%d%s", $currentPage, min($totalPages_Rr3, $pageNum_Rr3 + 1), $queryString_Rr3); ?>">下一頁</a> <?php } // Show if not last page ?> </td> <td width="23%" align="center"><?php if ($pageNum_Rr3 < $totalPages_Rr3) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Rr3=%d%s", $currentPage, $totalPages_Rr3, $queryString_Rr3); ?>">最後一頁</a> <?php } // Show if not last page ?> </td> </tr> </table></td> </tr> </table> <?php mysql_free_result($Rr3); ?>
保存
取消
返回文件列表