|
|
|
ติดหน้าสุดท้ายดูทีครับ ภาพไม่ออกตามชื่อกิจกรรม code สุดท้ายนะครับ pic_all มันไม่แสดงตามชื่อกิจกรรม |
|
|
|
|
|
|
|
code สุดท้ายนะครับ pic_all
มันไม่แสดงตามชื่อกิจกรรม ดูทีครับ
files_all1.php
Code (PHP)
<?
include ("connect.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<style type="text/css">
<!--
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
-->
</style><head>
<meta http-equiv=Content-Type content="text/html; charset=windows-874">
<title>:: ข่าวทั่วไป ::</title>
<link href="css/home_style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #D8D8D8;
color: #000;
}
.style1 {font-size: x-small}
-->
</style></head>
<body>
<table width="600" border="1" align="center"bgcolor="#FFFFFF">
<tr >
<td width="5%"><? //include ("left_menu.php");?></td>
<td width="75%" valign="top" ><img src="Images/bar/tt.gif" width="623" height="35"><br><font size="2">
</font>
<br><font size="2"><?
//mysql_query("select * from กิจกรรม where พ.ศ.=$_post[พ.ศ.] limit ....
$sql=mysql_query("select * from pic ")or die(mysql_error());
$yea=mysql_query("select DISTINCT year_pic from pic order by year_pic desc")or die (mysql_error());
$num=mysql_num_rows($sql);
?></font>
<?
while($y=mysql_fetch_array($yea)){
?>
<img src="Images/yellow.gif" width="7" height="11" border="0">
<font size="2"><a href="/teacher/files_all2.php?id=<? echo $y[year_pic];?>">ภาพกิจกรรมประจำปี พ.ศ. <? echo $y["year_pic"] ."<BR>";
}
?> </a></font></td>
</tr>
</table>
</body>
</html>
files_all2.php
Code (PHP)
<?
include ("connect.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=tis-620">
<title>:: ข่าวทั่วไป ::</title>
<link href="css/home_style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #D8D8D8;
color: #000;
}
.style1 {font-size: x-small}
-->
</style></head>
<body>
<table width="600" border="1" align="center"bgcolor="#FFFFFF">
<tr >
<td width="5%"><? //include ("left_menu.php");?></td>
<td width="75%" valign="top" ><img src="Images/bar/tt.gif" width="623" height="35"><br><font size="2">
</font>
<br>
<font size="2">
<?
$sql1=mysql_query("select * from pic ")or die(mysql_error());
//$yea=mysql_query("select DISTINCT name_pic from pic order by id_pic desc")or die (mysql_error());
$yea=mysql_query("select id_pic,name_pic from pic WHERE year_pic = '".$_GET['id']."' order by name_pic desc")or die (mysql_error());
$num=mysql_num_rows($sql1);
while($y=mysql_fetch_array($yea)){
?>
<img src="Images/yellow.gif" width="7" height="11" border="0">
<font size="2"><a href="/teacher/pic_all.php?id=<? echo str_pad($y[id_pic], 3, "0", STR_PAD_LEFT);?>"> <? echo $y["name_pic"] ."<BR>";
}
?></a></font></td>
</tr>
</table>
</body>
</html>
หน้านี้ละครับดูให้ที่
pic_all.php
Code (PHP)
<? include('connect.php');
?>
</head>
<?
if(isset($_GET[n])){$en=9*$_GET[n]; $st=$en-9;}else{$st=0;$en=9;}
$sql=mysql_query("select * from pic ")or die(mysql_error());
$yea=mysql_query("select id_pic,year_pic from pic WHERE name_pic = '".$_GET['id']."' order by id_pic desc")or die (mysql_error());
$num=mysql_num_rows($sql);
?>
<body>
<br>
<td width="721"><table width="700border=" align="right" cellpadding="0"" cellspacing="0"0>
<? for($i=1;$i<4;$i++){?>
<tr>
<?
$sql1=mysql_query("select * from pic order by id_pic desc limit $st,3");
while($a=mysql_fetch_array($sql1)){
?>
<td>
<table width="80" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="107" border="0" cellspacing="1" cellpadding="1">
<tr>
<td background="images/bg-tb03.jpg"><? //?> </td>
</tr>
<tr>
<td width="103" height="69"><img src="../Images/auction/<? echo str_pad($a[id_pic], 3, "0", STR_PAD_LEFT);?>.jpg" width="103" height="125" border="0"></td>
</tr>
<tr>
<td align="right" background="images/bg-tb04.jpg"> </td>
</tr>
</table></td>
</tr>
</table>
</td> <? }?>
</tr><tr></tr><? $st=$st+3;}?>
</table></td>
</tr>
</table>
<table width="782" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<? /*
$p=$num/9;
settype($p,'INT');
if($p>=1){
$s=$num%9;
if($s>0){ $p=$p+1;}
for($i=1;$i<=$p;$i++){
echo '| <a href=auction.php?n='.$i.'>'.$i.' </a>|';
} */?></td></tr><? //$st=$st+3;}?>
</table></td>
</tr>
</table>
</body>
</html>
ขอบคุณครับ ติดตรงนี้ที่เดียวจะได้ส่งอาจารย์
Tag : - - - -
|
|
|
|
|
|
Date :
2009-11-04 14:02:25 |
By :
เบิร์ด |
View :
810 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<img src="Images/auction/<? echo str_pad($a[id_pic], 3, "0", STR_PAD_LEFT);?>.jpg"
อาจจะมั้งครับ
|
|
|
|
|
Date :
2009-11-04 17:37:01 |
By :
Sek-Artdrinker |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|