|
|
|
ขอคำแนะนำจากพี่ๆ และอยากให้พี่ๆช่วยดูโค้ดให้หน่อยน่ะค่ะว่าผิดพลาดยังไงอ่ะค่ะ หนูไม่ค่อยเข้าใจการใช้ JavaScript เลย |
|
|
|
|
|
|
|
Code (PHP)
<?
include ("connect_db.php");
$objParse = oci_parse ($objConnect, $strSQL);
oci_execute ($objParse,OCI_DEFAULT);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ระบบประเมินการสอน</title>
<script language = "JavaScript">
//**** List Province (Start) ***//
function ListFACULTY(SelectValue)
{
frmMain.ddlPROGRAM.length = 0
frmMain.ddlCATEGORY.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frmMain.ddlPROGRAM.options[frmMain.ddlPROGRAM.length]= myOption
<?
$intRows = 0;
$strSQL = "SELECT DISTINCT EVALUATE.TQF.PROGRAMID,
AVSREG.PROGRAM.PROGRAMNAME,
EVALUATE.TQF.CAT_ID,
EVALUATE.TQF.TQF_ID,
EVALUATE.TQF.DESCRIPTION,
EVALUATE.TQF.FACULTYID,
AVSREG.FACULTY.FACULTYNAME,
EVALUATE.CATEGORY.CAT_NAME
FROM
EVALUATE.TQF
Inner Join AVSREG.PROGRAM ON AVSREG.PROGRAM.PROGRAMID = EVALUATE.TQF.PROGRAMID
Inner Join AVSREG.FACULTY ON EVALUATE.TQF.FACULTYID = AVSREG.FACULTY.FACULTYID AND AVSREG.PROGRAM.FACID = AVSREG.FACULTY.FACULTYID
Inner Join EVALUATE.CATEGORY ON EVALUATE.TQF.CAT_ID = EVALUATE.CATEGORY.CAT_ID
ORDER BY
EVALUATE.TQF.PROGRAMID ASC";
$objParse = oci_parse ($objConnect, $strSQL);
$intRows = 0;
while($objResult = oci_fetch_array($objParse,OCI_BOTH))
{
$intRows++;
?>
x = <?=$intRows;?>;
mySubList = new Array();
strGroup = <?=$objResult["FACULTYID"];?>;
strValue = "<?=$objResult["PROGRAMID"];?>";
strItem = "<?=$objResult["PROGRAMNAME"];?>";
mySubList[x,0] = strItem;
mySubList[x,1] = strGroup;
mySubList[x,2] = strValue;
if (mySubList[x,1] == SelectValue){
var myOption = new Option(mySubList[x,0], mySubList[x,2])
frmMain.ddlPROGRAM.options[frmMain.ddlPROGRAM.length]= myOption
}
<?
}
?>
}
//**** List Province (End) ***//
//**** List Amphur (Start) ***//
function ListCATEGORY(SelectValue)
{
frmMain.ddlCATEGORY.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frmMain.ddlCATEGORY.options[frmMain.ddlCATEGORY.length]= myOption
<?
$intRows = 0;
$strSQL = "SELECT DISTINCT EVALUATE.TQF.PROGRAMID,
AVSREG.PROGRAM.PROGRAMNAME,
EVALUATE.TQF.CAT_ID,
EVALUATE.TQF.TQF_ID,
EVALUATE.TQF.DESCRIPTION,
EVALUATE.TQF.FACULTYID,
AVSREG.FACULTY.FACULTYNAME,
EVALUATE.CATEGORY.CAT_NAME
FROM
EVALUATE.TQF
Inner Join AVSREG.PROGRAM ON AVSREG.PROGRAM.PROGRAMID = EVALUATE.TQF.PROGRAMID
Inner Join AVSREG.FACULTY ON EVALUATE.TQF.FACULTYID = AVSREG.FACULTY.FACULTYID AND AVSREG.PROGRAM.FACID = AVSREG.FACULTY.FACULTYID
Inner Join EVALUATE.CATEGORY ON EVALUATE.TQF.CAT_ID = EVALUATE.CATEGORY.CAT_ID
ORDER BY
EVALUATE.TQF.PROGRAMID ASC";
$objParse = oci_parse ($objConnect, $strSQL);
$intRows = 0;
while($objResult = oci_fetch_array($objParse,OCI_BOTH))
{
$intRows++;
?>
x = <?=$intRows;?>;
mySubList = new Array();
strGroup = <?=$objResult["PROGRAMID"];?>;
strValue = "<?=$objResult["CAT_ID"];?>";
strItem = "<?=$objResult["CAT_NAME"];?>";
mySubList[x,0] = strItem;
mySubList[x,1] = strGroup;
mySubList[x,2] = strValue;
if (mySubList[x,1] == SelectValue){
var myOption = new Option(mySubList[x,0], mySubList[x,2])
frmMain.ddlCATEGORY.options[frmMain.ddlCATEGORY.length]= myOption
}
<?
}
?>
}
//**** List Amphur (End) ***//
</script>
</head>
<?php /*?><form name="frmMain" action="" method="post">
Geography
<select id="ddlGeo" name="ddlGeo" onChange = "ListProvince(this.value)">
<option selected value=""></option>
<?
$strSQL = "SELECT DISTINCT EVALUATE.TQF.PROGRAMID,
AVSREG.PROGRAM.PROGRAMNAME,
EVALUATE.TQF.CAT_ID,
EVALUATE.TQF.TQF_ID,
EVALUATE.TQF.DESCRIPTION,
EVALUATE.TQF.FACULTYID,
AVSREG.FACULTY.FACULTYNAME,
EVALUATE.CATEGORY.CAT_NAME
FROM
EVALUATE.TQF
Inner Join AVSREG.PROGRAM ON AVSREG.PROGRAM.PROGRAMID = EVALUATE.TQF.PROGRAMID
Inner Join AVSREG.FACULTY ON EVALUATE.TQF.FACULTYID = AVSREG.FACULTY.FACULTYID AND AVSREG.PROGRAM.FACID = AVSREG.FACULTY.FACULTYID
Inner Join EVALUATE.CATEGORY ON EVALUATE.TQF.CAT_ID = EVALUATE.CATEGORY.CAT_ID
ORDER BY
EVALUATE.TQF.PROGRAMID ASC";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
while($objResult = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$objResult["GEO_ID"];?>"><?=$objResult["GEO_NAME"];?></option>
<?
}
?>
</select>
Province
<select id="ddlProvince" name="ddlProvince" style="width:120px" onChange = "ListAmphur(this.value)"></select>
Amphur
<select id="ddlAmphur" name="ddlAmphur" style="width:200px"></select>
</form><?php */?>
</body>
</html>
<?
oci_close($objConnect);
?>
Tag : PHP, Oracle, JavaScript
|
|
|
|
|
|
Date :
2012-03-30 10:20:16 |
By :
comerror |
View :
994 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันทำงานยังไงและพลาดยังไงบ้างล่ะครับ
|
|
|
|
|
Date :
2012-03-30 11:25:55 |
By :
Dragons_first |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตอนที่รันมันจะไม่แสดงอะไรเลย แล้วก็ลองไป view source ดู มันจะฟ้องให้แบบนี้ค่ะ
Code (PHP)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ระบบประเมินการสอน</title>
<script language = "JavaScript">
//**** List Province (Start) ***//
function ListFACULTY(SelectValue)
{
frmMain.ddlPROGRAM.length = 0
frmMain.ddlCATEGORY.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frmMain.ddlPROGRAM.options[frmMain.ddlPROGRAM.length]= myOption
<br />
<b>Warning</b>: oci_fetch_array() [<a href='function.oci-fetch-array'>function.oci-fetch-array</a>]: ORA-24374: ไม่มีการ define ก่อนการดึงข้อมูลหรือรันและดึงข้อมูล in <b>C:\AppServ\www\login\long.php</b> on line <b>41</b><br />
}
//**** List Province (End) ***//
//**** List Amphur (Start) ***//
function ListCATEGORY(SelectValue)
{
frmMain.ddlCATEGORY.length = 0
//*** Insert null Default Value ***//
var myOption = new Option('','')
frmMain.ddlCATEGORY.options[frmMain.ddlCATEGORY.length]= myOption
<br />
<b>Warning</b>: oci_fetch_array() [<a href='function.oci-fetch-array'>function.oci-fetch-array</a>]: ORA-24374: ไม่มีการ define ก่อนการดึงข้อมูลหรือรันและดึงข้อมูล in <b>C:\AppServ\www\login\long.php</b> on line <b>93</b><br />
}
//**** List Amphur (End) ***//
</script>
</head>
</body>
</html>
ขอคำแนะนำด้วยน่ะค่ะ
|
|
|
|
|
Date :
2012-03-30 15:09:25 |
By :
comerror |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|