|
 |
|
ช่วยหน่อยครับ ผมทำโปรเจคเรื่องการเรียนการสอนผ่านเว็บนะครับ แบบว่า ฟอร์มตัวนี้เป็นฟอร์มสั่งงานตรวจงาน แต่ดึงข้อมูลจากฐานข้อมูลมาให้สั่งงานไม่ได้นะครับ |
|
 |
|
|
 |
 |
|

ฐานข้อมูลที่จะดึงมาแสดง และก้อสั่งงานที่ อาจารย์คนนั้นเปิดสอนครับ

แสดงในนี้ครับ
ฟอร์ม Examine1.php
Code (PHP)
<?php
@session_start();
?>
<style type="text/css">
<!--
.style8 {font-size: 14px; color: #000000; }
.style9 {font-size: 16px}
-->
</style>
<form name="form1" method="post" action=""><fieldset><legend>สั่งงาน/ตรวจงาน</legend>
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
<tr>
<td><table width="819" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="6"><div align="center" class="style9">เลือกหมู่เรียนที่ต้องการสั่งงาน</div></td>
</tr>
<tr>
<td height="27"><div align="center" class="style9">Section</div></td>
<td><div align="center" class="style9">รหัสวิชา</div></td>
<td><div align="center" class="style9">วิชา</div></td>
<td width="97"><div align="center" class="style9">สั่งงาน</div></td>
<td width="105"><div align="center" class="style9">ดูรายละเอียดการสั่งงาน</div></td>
<td width="93"><div align="center" class="style9">ตรวจงาน</div></td>
</tr>
<?php
include("connectdatabase.php");
//$username=$_SESSION['username'];
switch($select)
{
case "code_sub":
$query="Select S.code_sub,S.name_sub,S2.name_section,S.id_sub
FROM tb_subject S,section S2
WHERE
S.id_section=S2.id_section
AND
S.name='$name'
AND
S.code_sub LIKE '$TextSearch%' ";break;
case "name_sub":
$query="Select S.code_sub,S.name_sub,S2.name_section,S.id_sub
FROM tb_subject S,section S2
WHERE
S.id_section=S2.id_section
AND
S.name='$name'
AND
S.name_sub LIKE '$TextSearch%' ";break;
default:
$query="Select S.code_sub,S.name_sub,S2.name_section,S.id_sub
FROM tb_subject S,section S2
WHERE
S.id_section=S2.id_section
AND
S.name='$name'
AND
S2.name_section LIKE '$TextSearch%' ";break;
}
$sql_per=mysql_db_query($dbname,$query);
//$num_r= mysql_num_rows($sql_per);
if($num_r==0)
{
$a="คุณยังไม่มีข้อมูลวิชาที่สอน !";
}
//while($arr=mysql_fetch_array($sql_per))
{
?>
<tr>
<td width="55"><span class="style8"> <? echo $arr[name_section];?></span></td>
<td width="119"><span class="style8"> <? echo $arr[id_sub];?></span></td>
<td width="336"><span class="style8"> <? echo $arr[name_sub];?></span></td>
<td align="middle" ><div align="center" class="style8"><a href="index1.php?main=add_Examine_work&id_sub=<?php echo($arr[id_sub]);?>&name_section=<?php echo($arr[name_section]);?>&name_sub=<?php echo $arr[name_sub];?>&id_sub=<? echo $arr[id_sub];?>"
onclick="return confirm('คุณต้องการสั่งงาน Section <?php echo $arr[name_section];?> ใช่ หรือ ไม่')"><img src="icon/addedit.png" alt="สั่งงาน" width="25" height="25" border="0" /></a> </div>
</div></td>
<td align="middle" ><div align="center" class="style8"><a href="index1.php?main=detail_command_work&id_sub=<?php echo($arr[id_sub]);?>"><img src="icon/inbox.png" alt="ดูรายละเอียดการสั่งงาน" width="25" height="25" border="0" /></a> </div>
</div></td>
<td align="middle" ><div align="center" class="style8"><a href="index1.php?main=inspect&id_sub=<?php echo($arr[id_sub]);?>&command=<? echo $arr[name_section];?>"><img src="icon/Icon-Folder02-Yellow.png" alt="ตรวจงาน" width="30" height="30" border="0" /></a> </div>
</div></td>
<?php
}
?>
</tr>
<tr>
<td colspan="6"><div align="center" class="style1"><?php echo $a;?></div></td>
</tr>
</table></td>
</tr>
</table>
</fieldset>
<p> </p>
</form>
Tag : PHP, CakePHP

|
ประวัติการแก้ไข 2011-06-30 15:03:27
|
 |
 |
 |
 |
Date :
2011-06-30 13:44:35 |
By :
FREEDOOM |
View :
1058 |
Reply :
6 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยหน่อยครับ อิอิ
|
 |
 |
 |
 |
Date :
2011-06-30 14:32:01 |
By :
FREEDOOM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าดึงเป็นlistbox ได้ไหม
|
 |
 |
 |
 |
Date :
2011-06-30 14:40:46 |
By :
deedee2338 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<form name="frmSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>">
<tr>
<td align="right" colspan="2"><font color="#000000" size="5" face="Arial, Helvetica, sans-serif">กรุณาเลือก
<?php
// ติดต่อฐานข้อมูล
?>
<select name="txtKeyword" type="text" id="txtKeyword" value="<?=$_GET["txtKeyword"];?>">
<?php
$sql_store="select * from tblstore order by name_store ASC";
$sql_store1=mysql_query($sql_store);
?>
<option value="">ดูข้อมูล<?
while($result_store=mysql_fetch_array($sql_store1)){
$id_user_status = $result_store[id_user_status];
if($id_user_status == 0)//พอใสค่าที่เก็บไป 1 ไม่เห็น
{
?>
<option value="<?=$result_store['id_store']?>" <?
if($_GET[txtKeyword]==$result_store["id_store"]){
echo "selected"; } ?>
><?=$result_store["name_store"];?></option>
<?php } } ?>
</select>
<input type="submit" value="แสดง">
</font>
</td>
</tr>
</form>
<?
if($_GET["txtKeyword"] <> "")
{
?>
<tr>
<td colspan = "2" bgcolor="#่33FFFF" align="center"><font color="#000000" size="5" face="Arial, Helvetica, sans-serif">แสดงชื่อร้านค้า</font></td>
</tr>
<?
$sql_store = "SELECT * FROM tblstore WHERE (id_store = '".$_GET["txtKeyword"]."')";
$result_store1=mysql_query($sql_store,$dbconnect)or die("ไม่สามารถเชื่อมต่อฐานข้อมูลได้!!").mysql_error();
while($result_store=mysql_fetch_array($result_store1))
{
?>
<tr>
<td bgcolor="#66CCFF"align="right" ><font color="#000000" size="3" face="Arial, Helvetica, sans-serif">รหัสร้านค้า:</font></td>
<td bgcolor="#66CCFF"><font color="#000000" size="3" face="Arial, Helvetica, sans-serif">
<?=$result_store["id_store"];?>
</font></td>
</tr>
|
 |
 |
 |
 |
Date :
2011-06-30 15:08:07 |
By :
deedee2338 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คือผมอยากให้แสดงในหน้าต่างแบบที่ในรูปนะครับ อิอิ
|
 |
 |
 |
 |
Date :
2011-06-30 15:39:28 |
By :
FREEDOOM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อย่างนี้คุณจะต้องกำหนด seesion คุณกำหนดแล้วหรือยัง
|
 |
 |
 |
 |
Date :
2011-06-30 16:43:41 |
By :
deedee2338 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|