|
 |
|
เรื่องส่งค่าตัวแปรผ่านฟอร์ม คือว่าหนูทำระบบ e-learning ค่ะ อาจารย์สามารถอัพโหลดไฟล์ใบงาน |
|
 |
|
|
 |
 |
|
ใช้ $work_id=$_REQUEST[work_id];
ประมาณนี้
หรือถ้าใช้ประมาณนี้แล้ว
ลองเช็คลิงค์ ดีๆ นะครับ หรือ เอา โค้ดมาแปะ ครับ จะได้ช่วยๆ กันดูครับ
|
 |
 |
 |
 |
Date :
2010-01-25 11:21:53 |
By :
yomaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไปหาเสื้อมาใส่ก่อนครับ   
เดี๋ยวจะคุยกับเขาไม่รู้เรื่อง เกี่ยวไหมเนี่ยะ
ล้อเล่นเน้ออออออออออออออ
|
 |
 |
 |
 |
Date :
2010-01-25 11:23:42 |
By :
ไวยวิทย์ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
/**********************ทำปุ่มค้นหา*****************************/
/***********************************/
<div id="apDiv24">
<form name="frmSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>">
<table width="250" border="0" align="center">
<tr>
<td width="73" >ค้นจาก:</td>
<td width="83" ><label>
<select name="section">
<option value="all">ตอนเรียน</option>
<?
$sql="select sec_name,sec_id from section where sec_status='1' and section.sec_year='".$date."' ";
$result=mysql_query($sql,$conn);
while($row=mysql_fetch_array($result)){?>
<option value="<?=$row[1]?>" ><?=$row[0]?></option>
<? } unset($result);mysql_close($conn);?>
</select>
</label></td>
<td width="80"><input type="image" name="imageField" id="imageField" src="../images/search.png" /></td>
</tr>
</table>
</form>
</div>
/**********************เรียกฐานข้อมูลขึ้นมาดู*************************/
<div id="apDiv21">
<? include"chk_date.php";
if($_GET["section"] != "all")
{ $strSQL="select user_id,user_name,user_surname from user where sec_id='".$_GET["section"]."' ";
}
if(($_GET["section"] == "all") || ($_GET["section"]=="" ))
{$strSQL="select user_id,user_name,user_surname from user ";
}
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
$Per_Page = 5; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
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;
}
$strSQL .=" order by sec_id ASC LIMIT $Page_Start , $Per_Page";
$objQuery = mysql_query($strSQL);
if((mysql_num_rows($objQuery))!=0){?>
<table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFF99">
<th colspan="5">รายละเอียด</th>
</tr>
<tr bgcolor="#FFFFD2">
<th width="100">รหัสนักศึกษา</th>
<th width="125">ชื่อ - นามสกุล</th>
<th width="117">วันที่ส่ง</th>
<th width="79">ไฟล์</th>
<th width="119">สถานะการตรวจ</th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr bgcolor="#F8FEE2">
<td><?=$objResult[0]?></td>
<td><?=$objResult[1]?>-<?=$objResult[2]?></td>
<?
$sql="select sent_date,sent_file,sent_status,user_id,workshop_id from sent_workshop where workshop_id='".$_SESSION["ses_workID"]."' and user_id ='".$objResult[0]."' ";
$result=mysql_query($sql,$conn);
$n=mysql_num_rows($result);
if($n!=0){
if($row=mysql_fetch_array($result)){
?>
<td align='center'><?=date_thai($row[0]);?></td>
<td align='center'><a href='download_workshop.php?download_sent_workshop=<?=$row[1];?>'><img src='../images/Pdf.png' alt='ไฟล์' border='0' /></a></td>
<td align='center'><? if($row[2]==0){?><a href="javascript:if(confirm('ยืนยันการลบ')){document.location='chang_sent_status_workshop.php?work_id=<?=$row[4];?>&page=workshop_detail&user_id=<?=$row[3];?>';}"><? echo "ยังไม่ตรวจ";?></a><? }else { echo "ตรวจแล้ว";}?></td>
<? }unset($result); }else { ?>
<td align='center'>-</td>
<td align='center'>-</td>
<td align='center'>-</td>
<? }
?></tr><?
} unset($objQuery);?>
</table>
<?
echo "<center>";
if($Prev_Page)
{
echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page§ion=$_GET[section]'></a> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i§ion=$_GET[section]'>$i</a> ]";
}
else
{
echo "<b> $i </b>";
}
}
if($Page!=$Num_Pages)
{
echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page§ion=$_GET[section]'></a> ";
}
echo "</center>";
echo "<center><font color=red>/*หมายเหตุ : ระบบจะแสดงรายการข้อมูลนักศึกษาที่เรียนในปีล่าสุด*/</font></center>";
}else{echo "<center><font color=red>ยังไม่มีคนส่งใบงาน</font></center>";}?>
</div>
/***************************************/
|
 |
 |
 |
 |
Date :
2010-01-25 16:21:20 |
By :
bigboomzuza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|