查看文件: pro_welcome.php
大小: 4.33 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_GET['check_id'])) && ($_GET['check_id'] != "") && ($_SESSION['login_lv']>3) ) { $deleteSQL = sprintf("DELETE FROM fixnews WHERE id='%s'",$_GET['check_id']); mysql_select_db($database_BE2, $BE2); $Result1= mysql_query($deleteSQL, $BE2) or die(mysql_error()); } $maxRows_Rt2 = 10; $pageNum_Rt2 = 0; if (isset($_GET['pageNum_Rt2'])) { $pageNum_Rt2 = $_GET['pageNum_Rt2']; } $startRow_Rt2 = $pageNum_Rt2 * $maxRows_Rt2; mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT * FROM fixnews ORDER BY idate DESC"); $query_limit_Rt2 = sprintf("%s LIMIT %d, %d", $query_Rt2, $startRow_Rt2, $maxRows_Rt2); $Rt2 = mysql_query($query_limit_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); if (isset($_GET['totalRows_Rt2'])) { $totalRows_Rt2 = $_GET['totalRows_Rt2']; } else { $all_Rt2 = mysql_query($query_Rt2); $totalRows_Rt2 = mysql_num_rows($all_Rt2); } $totalPages_Rt2 = ceil($totalRows_Rt2/$maxRows_Rt2)-1; $currentPage="main.php?act=pro_welcome"; $queryString_Rt2 = sprintf("&totalRows_Rt2=%d", $totalRows_Rt2); ?> <table width="92%" border="0" cellspacing="0" cellpadding="3"> <tr> <th width="82" nowrap="nowrap" class="font2"> </th> <th width="95" nowrap="nowrap" class="font2">日期</th> <th width="573" nowrap="nowrap" class="font2">標題/內文</th> <? if($_SESSION['login_lv']>8){ ?> <? }?> <th colspan="3" align="center" nowrap="nowrap" class="font2">修改/刪除</th> </tr> <?php do { ?> <tr> <td rowspan="2" class="font3"> </td> <td rowspan="2" valign="top" class="font3"><?php echo $row_Rt2['idate']; ?></td> <td class="font3"><span style="font-size:16px; color:#06F"><?php echo nl2br($row_Rt2['title']); ?></span></td> <? if($_SESSION['login_lv']>8){ ?> <? }?> <td width="68" rowspan="2" align="center" class="font3">11<? if($row_Rt2['wflag']=='Y'){?><img src="images/Y.gif" width="26" height="26" /><? } ?></td> <td width="31" rowspan="2" align="center" class="font3"> <? $welcome=false; if($_SERVER['REMOTE_ADDR']=="220.130.43.121" ){ $welcome=true; } if(($_SESSION['login_lv']>3) || ( $welcome ) ){ ?> <a href="main.php?act=pro_welcome_edit&id=<?php echo $row_Rt2['id']; ?>"><img src="images/edit.png" alt="修改項目名稱" width="16" height="16" border="0" /></a></td> <? }?> <td width="43" rowspan="2" align="center" class="font3"> <? if($_SESSION['login_lv']>3){ ?> <a href="javascript:if(confirm('確實要刪除嗎?'))location='main.php?act=pro_welcome&pageNum_Rt2=<?php echo pageNum_Rt2;?>&check_id=<? echo $row_Rt2['id']; ?>'"><img src="images/del.png" alt="刪除項目" width="16" height="16" border="0"/></a> <? }?> </td> </tr> <tr> <td class="font3"><?php echo nl2br($row_Rt2['doc']); ?></td> </tr> <?php } while ($row_Rt2 = mysql_fetch_assoc($Rt2)); ?> <? /* <tr> <td height="40" colspan="<? echo ($_SESSION['login_lv']>8)?"7":"6"; ?>" align="center" ><table border="0"> <tr> <td><?php if ($pageNum_Rt2 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Rt2=%d%s", $currentPage, 0, $queryString_Rt2); ?>">第一頁</a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_Rt2 > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_Rt2=%d%s", $currentPage, max(0, $pageNum_Rt2 - 1), $queryString_Rt2); ?>">上一頁</a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_Rt2 < $totalPages_Rt2) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Rt2=%d%s", $currentPage, min($totalPages_Rt2, $pageNum_Rt2 + 1), $queryString_Rt2); ?>">下一頁</a> <?php } // Show if not last page ?></td> <td><?php if ($pageNum_Rt2 < $totalPages_Rt2) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_Rt2=%d%s", $currentPage, $totalPages_Rt2, $queryString_Rt2); ?>">最後一頁</a> <?php } // Show if not last page ?></td> </tr> </table></td> <td colspan="5"></td> </tr> */ ?> </table> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表