Viewing file: v_courseTable.php (2.45 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<script>
//alert(self.opener.document.myform.seq2.value);
var dex = 0;
for(var i=2;i<6;i++){
if(window.opener.document.myform.elements["crsId" + i].value==""){
//document.myform.elements["ndex"].value = i;
var dex = i;
break;
}
}
//alert(document.myform.elements["ndex"].value);
function ReturnValue(crsId, crsName, dex)
{
window.opener.document.myform.elements["crsId" + dex].value = crsId;
window.opener.document.myform.elements["crsName" + dex].value = crsName;
window.close();
}
</script>
<table class="szone">
<tr>
<td align="center"><?php echo form_open($this->config->item("rg_folder")."curpbri/crs_popup", array("name" => "myform", "id" => "myform"));?>
<b>ชื่อรายวิชา</font>
<input type="text" name="crsNameSearch" />
<input type="hidden" name="ndex" value='<?echo $ndex;?>' />
<input type="submit" name="search" value="ค้นหา" />
<?php echo form_close();?></td>
</tr>
<tr><td>
<table class="headCol">
<tr bgcolor="<?php echo $this->config->item("rg_table_color");?>">
<th class="seqCol">ลำดับที่</th>
<th>รายวิชา</th>
<th>หน่วยกิต</th>
</tr>
<?php
if($rs_crs->num_rows()) {
$i = 0;
foreach($rs_crs->result() as $row) {
echo "<tr onmouseover=\"bgColor='".$tr_color_even."'\" onmouseout=\"bgColor='".$this->config->item("rg_mouseout")."'\">";
?>
<td align="center" onClick="ReturnValue(<?php echo $row->crsId;?>,'<?php echo $row->crsCode." ".explodeSquare($row->crsName);?>',<?php echo $ndex;?>)" onMouseOver="this.style.cursor='pointer'"><?php echo $i+1;?></td>
<td onClick="ReturnValue(<?php echo $row->crsId;?>,'<?php echo $row->crsCode." ".explodeSquare($row->crsName);?>',<?php echo $ndex;?>)" onMouseOver="this.style.cursor='pointer'"><?php echo $row->crsCode." ".explodeSquare($row->crsName);?></td>
<td align="center" onClick="ReturnValue(<?php echo $row->crsId;?>,'<?php echo $row->crsCode." ".explodeSquare($row->crsName);?>',<?php echo $ndex;?>)" onMouseOver="this.style.cursor='pointer'"><?php echo $row->crsUnit;?></td>
</tr>
<?php
$i++;
}
}
else {
?>
<tr>
<td colspan="3" align="center"><font size="2" color="<?php echo $font_color_err?>">** ไม่ปรากฏรายการในฐานข้อมูล **</font></td>
</tr>
<?php
}
?>
</table>
</td></tr>
<tr>
<td align="right">รวม <?php echo $rs_crs->num_rows();?> รายการ</td>
</tr>
</table>
|