Viewing file: comment_bkp.php (6.45 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
if (session_is_registered("valid_user"))
{
include("../include/FunctionDB.php");
include("admin_menu.php");
ConnectDB();
$strSQL = "SELECT * FROM comment_tb Order By Info_code DESC ";
if (! $Page)
$Page = 1;
$Pre_Page = $Page - 1;
$Next_Page = $Page +1;
$Per_Page = 20;
$result = mysql_query($strSQL);
$Page_start = ($Per_Page*$Page) - $Per_Page;
$Num_Rows = mysql_num_rows($result);
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;
if (( $Page > $Num_Pages) || ($Page < 0))
echo"Page $Page More than $Num_Pages";
$strSQL .=" LIMIT $Page_start,$Per_Page" ;
$result = mysql_query($strSQL);
///////////////////////////////////////////////////////////////////////////////////
$num = mysql_num_rows( $result );
//$count = 0;
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link href="../source/style.css" rel="stylesheet" type="text/css">
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<style type="text/css">
<!--
.style1 {
font-size: 14px;
font-weight: bold;
}
.style2 {font-size: 14px}
.style3 {color: #000000}
-->
</style>
<table width="812" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="812"><br>
<fieldset>
<legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="Director_menu.php" >หน้าหลัก</a><a href="FrmEditComment.php"></a><img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" />แสดงรายการข้อความสารพันปัญหาถึงผู้อำนวยการ</font></legend>
<label><div align="center">
<form id="form1" name="form1" method="post" action="InsertComment.php">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="242" align="center" valign="top"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#eeeeee">
<tr bgcolor="#7CAB84">
<td height="30" colspan="2" bgcolor="#FFFFFF"><div align="center" class="style1"><font color="#FFCC66" face="Tahoma"><font color="#000000">แสดงรายการข้อความสารพันปัญหา</font></font></div></td>
</tr>
<?php
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bgcolor="#DFDFDF" >
<td width="31" align="center" bordercolor="#D1D1D1" bgcolor="#FFFFFF" ><font color="#003300" size="2" face="Tahoma">
<?=$i?>
</font></td>
<td width="746" bordercolor="#DFDFDF" bgcolor="#FFFFFF" ><div align="left"><font color="#000000" size="2" face="Tahoma"><?php echo $row[Info_detail] ?></font> <font color="#000000" size="2" face="Tahoma"><br />
</font><font color="#000000" face="Tahoma"><span class="style2"><font color="#0000FF">E-mail:</font></span></font><font color="#000000" size="2" face="Tahoma"> <?php echo $row[Organiz] ?></font>
<div align="left" onclick="MM_openBrWindow('CommentDetail.php?Code=<? echo $row[Info_code]?>','Detail','scrollbars=yes,width=700,height=200')"><a href="#">Name : <? echo"$row[Info_name]";?></a> </font></div>
</div></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bgcolor="#DFDFDF" >
<td align="center" bordercolor="#D1D1D1" bgcolor="#FFFFFF" ><font color="#003300" size="2" face="Tahoma">
<?=$i?>
</font></td>
<td bordercolor="#DFDFDF" bgcolor="#FFFFFF" ><div align="left"><font color="#000000" size="2" face="Tahoma"><?php echo $row[Info_detail] ?></font> <font color="#000000" size="2" face="Tahoma"><br />
</font><font color="#000000" face="Tahoma"><span class="style2"><font color="#0000FF">E-mail:</font></span></font><font color="#000000" size="2" face="Tahoma"> <?php echo $row[Organiz] ?></font>
<div align="left" onclick="MM_openBrWindow('CommentDetail.php?Code=<? echo $row[Info_code]?>','Detail','scrollbars=yes,width=700,height=200')"><a href="#">Name : <? echo"$row[Info_name]";?></a> </font></div>
</div></td>
</tr>
<?
$count=0;
}
$i++;
}
CloseDB();
?>
<tr bgcolor="#7CAB84">
<td colspan="2" align="center" bgcolor="#FFFFFF"><div align="center"><span class="style3"><font size="2" face="Tahoma">ทั้งหมด <? echo $num ?> รายการ </font> </span></div></td>
</tr>
</table>
<div align="center"><font color="#FFFFFF"> <font color="#FFFFFF" size="2" face="MS Sans Serif"> <font color="#0033CC"><font size="2" face="Tahoma"> <?php echo $Num_Pages;?></font></font></font><font color="#0033CC" size="2" face="Tahoma"> หน้า</font> <font color="#0033CC" size="2" face="Tahoma">
<?php
if ($Pre_Page)
echo"<a href=\"$PHP_SELF?Page=$Pre_Page\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b><< Previus</b> </font></a>";
for($i=1;$i<=$Num_Pages;$i++)
{
if($i != $Page)
echo" [<a href=\"$PHP_SELF?Page=$i\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b>$i</b></font></a>] ";
else
echo"<b>$i</b>";
}
if($Page != $Num_Pages)
echo"<a href=\"$PHP_SELF?Page=$Next_Page\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b> Next >></b> </font></a>";
?>
</font><font size="2" face="Tahoma"></font> </font></div>
<div align="center"></div></td>
</tr>
</table>
</form>
</div>
</label>
</fieldset>
<font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2"><br>
</font></td>
</tr>
</table>
<?php
}
else
{
echo"<meta http-equiv=\"refresh\" content=\"3;URL=../FrmLogin.php\" target=\"mainFrame\">\n";
echo"Please Login ";
}
?>
|