Viewing file: v_showCourse.php (4.92 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<table width="95%" align="center"> <tr> <td><br> <div align="center"><br> <table width="100%" class="szone"> <tr> <td align="right"><?php echo form_open($this->config->item("rg_folder")."curpbri/crs_show");?><b>รหัสรายวิชา</b> <input type="text" name="crsCodeSearch" size="10" /> <b>ชื่อรายวิชา</b> <input type="text" name="crsNameSearch" /> <input type="submit" name="search" value="ค้นหา" /> <?php echo form_close();?></td> </tr> <tr bgcolor="<?=$tr_color_even?>" > <td align="left" class="coltd_szone"> <?php $total = $rs_totalRecord->num_rows(); echo "<b>แสดง</b> ".$this->config->item("rg_max_row")." <b>รายการจาก</b> $total รายการ";//->totalRecord วิชา"; ?> </td> </tr> <tr> <td><br></td> </tr> <tr> <td align="right"> <?php $lnk = "<input type=\"submit\" name=\"add\" value=\"เพิ่มรายวิชาใหม่\" onClick=\"window.location = '".site_url($this->config->item("rg_folder")."curpbri/crs_input")."'\" />"; echo $lnk; ?> </td> </tr> <?php if(isset($rs_crs)) { if($rs_crs->num_rows()) { ?> <tr> <td><table class="headCol"> <tr bgcolor="<?php echo $this->config->item("rg_table_color");?>"> <th class="stdCodeCol">รหัสรายวิชา</th> <th>ชื่อรายวิชา</th> <th class="editCol">แก้ไข</th> <th class="deleteCol">ลบ</th> </tr> <?php // if($rs_crs && $rs_crs->num_rows()) { $i = 0; foreach($rs_crs->result() as $row) { if($i >= $this->config->item("rg_max_row")){ break; } echo "<tr onmouseover=\"bgColor='".$tr_color_even."'\" onmouseout=\"bgColor='".$this->config->item("rg_mouseout")."'\">"; ?> <td align="center"><?php echo $row->crsCode;?></td> <td class="indent"><?php $lnk = "<span class=\"hand\" onClick=\"sendPost('hidform', {'id':$row->crsId}, '".site_url($this->config->item("rg_folder")."curpbri/crs_detail")."',{height:600})\" title=\"".$row->crsDescription."\">".explodeSquare($row->crsName)."</span>"; echo $lnk; ?></td> <td align="center"> <?php $lnk = "<span class=\"hand\" onClick=\"sendPost('hidform2', {'id':$row->crsId}, '".site_url($this->config->item("rg_folder")."curpbri/crs_input")."')\"><img src=\"".base_url().$this->config->item("rg_edit")."\" width=\"23\" height=\"19\" align=\"absmiddle\" border=\"0\" /></span>"; echo $lnk;
?> </td> <td align="center"> <?php $co = (isset($code))? $code:""; $na = (isset($name))? $name:""; if($prc_rs->num_rows()>0){ $flag = 0; foreach($prc_rs->result() as $prc_row) { if($row->crsId==$prc_row->pcrCrsId){ $lnk = "<span class=\"hand\"><img src=\"".base_url().$this->config->item("rg_deleted")."\" width=\"16\" height=\"19\" align=\"absmiddle\" border=\"0\" /></span>"; $flag++; echo $lnk; } } if($flag==0){ $lnk = "<span class=\"hand\" onClick=\"confirmDel2({'id':$row->crsId,'code':'".$co."','name':'".$na."'},'hidform3', '".site_url($this->config->item("rg_folder")."curpbri/crs_delete")."')\"><img src=\"".base_url().$this->config->item("rg_delete")."\" width=\"16\" height=\"19\" align=\"absmiddle\" border=\"0\" /></span>"; echo $lnk; } }else{ $lnk = "<span class=\"hand\" onClick=\"confirmDel2({'id':$row->crsId,'code':'".$co."','name':'".$na."'},'hidform3', '".site_url($this->config->item("rg_folder")."curpbri/crs_delete")."')\"><img src=\"".base_url().$this->config->item("rg_delete")."\" width=\"16\" height=\"19\" align=\"absmiddle\" border=\"0\" /></span>"; echo $lnk; } ?> </td> </tr> <?php $i++; } ?> </table> <tr> <td align="right">รวม <?php echo ($rs_crs) ? $i : 0;?> รายการ</td> </tr> <tr> <td align="left"><span class="error"><b>หมายเหตุ :</b> ใช้เมาส์คลิกที่ชื่อรายวิชาเพื่อดูรายละเอียดของรายวิชา<br></span></td> </tr> </td> </tr> <? }else{ ?> <tr> <td colspan="4" align="center"><span class="error">** ไม่ปรากฏรายการในฐานข้อมูล **</span></td> </tr> <?php } } // End if isset crs ?>
</table></div> </td> </tr> </td> </tr> </table>
|