Viewing file: BookList-old.php (13.65 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include("./include/FunctionDB.php");
include("./include/Function.php");
include("admin_menu.php");
ConnectDB();
$strSQL = "SELECT * FROM bookmant_tb Where Year='$Year' Order By No DESC ";
if (! $Page)
$Page = 1;
$Pre_Page = $Page - 1;
$Next_Page = $Page +1;
$Per_Page = 50;
$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 );
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link href="./source/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #0000FF}
.style4 {color: #003366}
.style8 {font-size: 14px}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<table width="854" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="854"><br>
<fieldset>
<legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="./BookByYear.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="get" action="SearchbookList.php">
<p align="left"><font size="2" face="Tahoma"><img src="./picture/previous.gif" onclick="window.history.back()" width="85" height="22" border="0" /></font></p>
<table width="100%" border="0" cellspacing="1" cellpadding="0" style="border:1px solid #CCCCFF">
<tr>
<td width="14%" height="24" bgcolor="#FFFFFF"> </td>
<td width="14%" bgcolor="#FFFFFF"> </td>
<td width="40%" bgcolor="#FFFFFF"><div align="center"><span class="style8"><font color="#000000" face="Tahoma">ÃÒ¡ÒÃ˹ѧÊ×ÍÃѺ-Êè§ »Õ ¾.È</font> <font face="Tahoma"><font color="#003399"><? echo $Year?></font></font></span></div></td>
<td width="24%" bgcolor="#FFFFFF"> </td>
<td width="8%" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="24" colspan="5" bgcolor="#DFDFFF"><div align="center"><span class="style8"><font face="Tahoma"> ª×èÍ·Õèµéͧ¡Òäé¹ËÒ</font></span> <font size="2" face="Tahoma"> <img src="./picture/search.gif" width="15" height="15" align="absmiddle" border="0" />
<input name="keyword" type="text" style="background-color:#F0FFD2;" value="<? echo"$keyword"; ?>" size="30">
</font><font face="Tahoma"> <span class="style8">¨Ò¡</span></font> <font size="2" face="Tahoma">
<select name="fields" style="background-color:#F0FFD2;" >
<option value="<? echo "$fields"; ?>">àÅ×Í¡ÃÒ¡ÒÃ</option>
<option value="Book_code">ª¹Ô´Ë¹Ñ§Ê×Í</option>
<option value="No_in">àÅ¢·Õè˹ѧÊ×Í</option>
<option value="Date_buy">Çѹ-à´×͹-»Õ </option>
<option value="No">àÅ¢·ÐàºÕ¹˹ѧÊ×Í</option>
<option value="Status">àÃ×èͧ</option>
</select>
<input type="submit" name="Submit" value="¤é¹ËÒ" />
</font></div></td>
</tr>
</table>
</form>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="#E6E6E6">
<td width="23" height="26" align="center" bgcolor="#CCCCFF" style="border:1px solid gray"><span class="style8"><font color="#000000" face="Tahoma">No.</font></span></td>
<td width="42" align="center" bgcolor="#CCCCFF" style="border:1px solid gray"><font face="Tahoma"><span class="style8">àÅ¢·</span></font><font size="2" face="Tahoma">Õè</font></td>
<td width="70" align="center" bgcolor="#CCCCFF" style="border:1px solid gray"><div align="center" class="style8"> <font face="Tahoma">Çѹ·Õè</font></div></td>
<td width="222" align="center" bgcolor="#CCCCFF" style="border:1px solid gray"><span class="style8"><font face="Tahoma">àŢ˹ѧÊ×Í</font></span></td>
<td width="411" align="center" bgcolor="#CCCCFF" style="border:1px solid gray"><span class="style8"><font color="#000000" face="Tahoma">àÃ×èͧ</font></span></td>
<td width="72" align="center" bgcolor="#CCCCFF" style="border:1px solid gray"><span class="style8"><font face="Tahoma">¼ÙéÃѺ˹ѧÊ×Í</font></span></td>
</tr>
<?php
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bgcolor="#FFFFFF">
<td align="center" bordercolor="#FFFFFF" bgcolor="#eeeeee" ><font color="#996600" size="1" face="Tahoma">
<?=$i?>
</font></td>
<td align="center" bordercolor="#FFFFFF" bgcolor="#eeeeee" ><div align="left"><font color="#336600" size="2" face="Tahoma"> <? echo $row["No"]?></a></font></font></div></td>
<td align="center" bordercolor="#FFFFFF" bgcolor="#eeeeee" ><div align="left"><font color="#336600" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma"> </font><font color="#336600" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma">
<?php
$sday = $row[Date_buy];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>
</font><font color="#336600" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma"> </font><font color="#336600" size="2" face="Tahoma"> </font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#eeeeee"><div align="left"><font color="#003366" size="2" face="Tahoma"> </font>
<div align="left"><font color="#336600" size="2" face="Tahoma"> </font>
<div align="left">
<div align="center" onclick="MM_openBrWindow('BookDetail.php?code=<?=$row["code"]?>','Detail','width=500,height=250,scrollbars=yes')">
<div align="left"><font color="#996600" size="2" face="Tahoma"><a href="#"><? echo $row["No_in"]?></a></font></div>
</div>
</div>
</div>
<font color="#003366" size="2" face="Tahoma"><span class="style1"><font color="#003366" size="2" face="Tahoma"><font size="2" face="Tahoma"><a href="BookDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a></font></font><font size="2" face="Tahoma"></font></span> </font><font color="#336600" size="2" face="Tahoma"> </font></div></td>
<td height="18" bordercolor="#FFFFFF" bgcolor="#eeeeee"><div align="left"><font color="#996600" size="2" face="Tahoma"> </font><font color="#996600" size="2" face="Tahoma"><a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" > </a><? echo $row["Status"]?></a> </font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#eeeeee" ><div align="left"><span class="style4"><font size="2" face="Tahoma">
<?php
$Teacher_code = $row["Teacher_code"];
$sql = "Select * From personal_tb Where Teacher_code='$Teacher_code'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
echo "Í.$rss[Teacher_name] ";
?>
</font></span></div></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bgcolor="#FFFFFF">
<td align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><font color="#996600" size="1" face="Tahoma">
<?=$i?>
</font></td>
<td align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="left"><font color="#336600" size="2" face="Tahoma"> <? echo $row["No"]?></a></font></font></div></td>
<td align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="left"><font color="#336600" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma"> </font><font color="#336600" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma">
<?php
$sday = $row[Date_buy];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>
</font><font color="#336600" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma"> </font><font color="#336600" size="2" face="Tahoma"> </font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF"><div align="left"><font color="#003366" size="2" face="Tahoma"> </font>
<div align="left"><font color="#336600" size="2" face="Tahoma"> </font>
<div align="left">
<div align="center" onclick="MM_openBrWindow('BookDetail.php?code=<?=$row["code"]?>','Detail','width=500,height=250,scrollbars=yes')">
<div align="left"><font color="#996600" size="2" face="Tahoma"><a href="#"><? echo $row["No_in"]?></a></font></div>
</div>
</div>
</div>
<font color="#003366" size="2" face="Tahoma"><span class="style1"><font color="#003366" size="2" face="Tahoma"><font size="2" face="Tahoma"><a href="BookDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" ></a></font></font><font size="2" face="Tahoma"></font></span> </font><font color="#336600" size="2" face="Tahoma"> </font></div></td>
<td height="18" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><div align="left"><font color="#996600" size="2" face="Tahoma"> </font><font color="#996600" size="2" face="Tahoma"><a href="ManDetail.php?code=<?=$row["code"]?>"title="Click to see Detail" class="d" > </a><? echo $row["Status"]?></a> </font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="left"><span class="style4"><font size="2" face="Tahoma">
<?php
$Teacher_code = $row["Teacher_code"];
$sql = "Select * From personal_tb Where Teacher_code='$Teacher_code'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
echo "Í.$rss[Teacher_name] ";
?>
</font></span></div></td>
</tr>
<?
$count=0;
}
$i++;
}
?>
<tr bgcolor="#CCCCFF">
<td height="18" colspan="6" align="center" bgcolor="#FFFFFF" ><div align="center"><span class="style8"><font color="#000000" face="Tahoma">·Ñé§ËÁ´</font></span><strong><font color="#003399" size="2" face="Tahoma"> <? echo $num ?> </font></strong><span class="style8"><font color="#FFFFFF" face="Tahoma"><font color="#003366">ÃÒ¡ÒÃ</font></font></span><strong><font color="#FFFFFF" size="2" face="Tahoma"><font color="#FFFFFF"> </font></font> </strong></div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC">
<tr>
<td align="right" bordercolor="#CCCCCC" class="Tahoma11"><div align="center"><font color="#FFFFFF"> <font color="#FFFFFF" size="3" face="MS Sans Serif"><strong> <font color="#0033CC"><font color="#FFFFFF"><font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2" face="MS Sans Serif"><strong><font color="#0033CC"><?php echo $Num_Pages;?></font></strong></font></font><font size="2" face="Tahoma"> </font></font></strong></font><span class="style8"><font color="#000000" face="Tahoma"> ˹éÒ</font></span> <font color="#0033CC" size="2" face="Tah<?php echo $Num_Pages;?>oma">
<?php
if ($Pre_Page)
echo"<a href=\"$PHP_SELF?Page=$Pre_Page&Year=$Year\" 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&Year=$Year\" 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&Year=$Year\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b> Next >></b> </font></a>";
?>
</font> </font> </div></td>
</tr>
</table>
</div>
</label>
</fieldset><br>
<font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2"><b>ËÁÒÂà赯 :</b> ãªéàÁÒÊì¤ÅÔ¡<br>
</font></td>
</tr>
</table>
|