Viewing file: v_club_pos.php (7.1 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<link rel="stylesheet" href="<?=base_url();?>/js/textboxlist_proto/textboxlist.css" type="text/css" media="screen" title="Test Stylesheet" charset="utf-8" />
<script src="<?=base_url();?>/js/textboxlist_proto/protoculous-effects-shrinkvars.js" type="text/javascript" charset="utf-8"></script>
<script src="<?=base_url();?>/js/textboxlist_proto/textboxlist.js" type="text/javascript" charset="utf-8"></script>
<script src="<?=base_url();?>/js/textboxlist_proto/textboxlistauto.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
document.observe('dom:loaded', function() {
// init
tlist1 = new FacebookList('wk11_co', 'wk11_auto');
var get_user_list_url = "<?=site_url("esa/search/get_std_list")?>";
// fetch and feed
new Ajax.Request(get_user_list_url, {
onSuccess: function(transport) {
transport.responseText.evalJSON(true).each(function(t){tlist1.autoFeed(t)});
}
});
});
Element.addMethods({
onBoxDispose: function(item,obj) { obj.autoFeed(item.retrieveData('text')); },
onInputFocus: function(el,obj) { obj.autoShow(); },
onInputBlur: function(el,obj) {
obj.lastinput = el;
obj.blurhide = obj.autoHide.bind(obj).delay(0.1);
},
filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B]);}}return C;}
});
function findByYearAndCl(){
jQuery("#myform").attr("action",'<?=site_url().$this->config->item('sa_folder').'smo_club/club_pos'?>');
jQuery("#myform").trigger("submit");
}
</script>
<?php
$_image_reply = array(
'src' => 'images/edit.png',
'width' => '15',
'height' => '15',
'border' => '0',
'title' => 'แก้ไขข้อมูล',
'onmouseover' => "this.style.cursor='pointer'"
);
$_image_del = array(
'src' => 'images/delete.png',
'width' => '15',
'height' => '15',
'border' => '0',
'title' => 'ลบข้อมูล',
'onmouseover' => "this.style.cursor='pointer'"
);
// $cl = $cl_->row();
$row_cmt = ($qu_cmt->num_rows() > 0) ? $qu_cmt->row() : NULL;
?>
<?php echo form_open($this->config->item('sa_folder').'smo_club/add_club_pos', array("name" => "myform", "id" => "myform"));?>
<table width="60%" align="center">
<tr>
<td align="center"><h3>บันทึก/แก้ไขรายชื่อคณะกรรมการชมรม</h3></td>
</tr>
<tr>
<th align="center" colspan="2"></th>
</tr>
<tr>
<td>
<table id="table_input" class='szone2' width="40%" border="0">
<tr class='szone'>
<td width="20%" >ชมรม</td>
<td width="80%" >
<?php
echo form_dropdown('cl_id', $rs_club, $cl , 'onChange="findByYearAndCl()"');
?>
<?php echo form_error('cl_id');?>
</td>
</tr>
<tr class='szone'>
<td >ปีการศึกษา</td>
<td ><?php
krsort($rs_tmc);
echo form_dropdown('tmc_year', $rs_tmc, $year,'onChange="findByYearAndCl()"'); ?>
<?php echo form_error('tmc_year');?>
</td>
</tr>
<tr class='szone'>
<td >ตำแหน่ง</td>
<td >
<?php
$pos = ((isset($error['pos_id']))? $error['pos_id'] : ((set_value('pos_id',getval('cmt_pos_id',$row_cmt))=="")? "":set_value('pos_id',getval('cmt_pos_id',$row_cmt))));
echo form_dropdown('pos_id', $rs_pos, $pos); ?>
<?php echo form_error('pos_id');
if(isset($error['msg'])){
?>
<span class="error"><?=$error['msg']?></span>
<?}?>
</td>
</tr>
<?php
if (isset($row_cmt)) {
?>
<tr class="szone">
<td >รหัส/ชื่อ-สกุลนักศึกษา</td>
<td class='szone2'><?php echo getval('stdCode', $row_cmt).': '.getval('stdName', $row_cmt).' '.getval('stdSurname', $row_cmt);?>
<input type="hidden" id="std" name="std" value="<?php echo getval('stdCode', $row_cmt).': '.getval('stdName', $row_cmt).' '.getval('stdSurname', $row_cmt);?>" /></td>
</tr>
<?php
} else {
?>
<tr class='szone'>
<td >นักศึกษา</td>
<td><input type = "text" value = "" name="wk11_co" id = "wk11_co" /> <!-- 2. textbox's name & id -->
<div id = "wk11_auto"> <!-- 3. div's id -->
<div class = "default">กรุณากรอกรหัส/ชื่อ-สกุลนักศึกษา</div>
<ul class = "feed">
</ul>
</div>
<?php echo form_error('wk11_co');?>
</td>
</tr>
<?php
}
?>
<tr class='szone'>
<td >วันที่แต่งตั้ง</td>
<td><script>DateInput('cmt_fr_date', true, 'DD/MM/YYYY', "<?php echo set_value('cmt_fr_date') ? set_value('cmt_fr_date') : splitDateDb2(getval('cmt_fr_date', $row_cmt, getNowDate()), '/');?>");</script></td>
</tr>
<tr class='szone2'>
<td colspan="2" align="center">
<input type="hidden" name="persons" id="persons" />
<input type="hidden" name="cmt_id" id="cmt_id" value="<?php echo getval('cmt_id',$row_cmt)?>"/>
<input type="submit" name="record" value="บันทึก" onclick="javascript:do_submit();"/></td>
</tr>
</table>
</td>
</tr>
</table><br />
<table class='tb_1' width="70%" border="0">
<tr>
<th align="center" width="10%">ลำดับที่</th>
<th align="center" width="15%">ปีการศึกษา</th>
<th align="center" >ชมรม</th>
<th align="center" >ตำแหน่ง</th>
<th align="center" >ชื่อ</th>
<th align="center" >วันที่แต่งตั้ง</th>
<th align="center" width="5%">แก้ไข</th>
<th align="center" width="5%">ลบ</th>
</tr>
<?php
if ($rs_cmt->num_rows > 0) {
$index=1;
foreach ($rs_cmt->result() as $row) {
?>
<tr >
<td align="center"><?php echo $index;?></td>
<td align="center"><?php echo $row->cmt_year;?></td>
<td align="center"><?php echo $rs_club[$row->cmt_sc_id];?></td>
<td align="center"><?php echo $row->pos_name;?></td>
<td align="left"><?php echo $row->stdName.' '.$row->stdSurname;?></td>
<td align="left"><?php echo fulldate2($row->cmt_fr_date);?></td>
<td align="center"><span class="hand" onClick="sendPost('myform', {'cmt_id':<?php echo $row->cmt_id;?>,'tmc_year':<?php echo $row->cmt_year;?>,'cl_id':<?php echo $row->cmt_sc_id;?>}, 'club_pos')"><?php echo img($this->config->item('sa_image_reply'));?></span></td>
<td align="center"><?php echo anchor($this->config->item('sa_folder').'smo_club/del_club_pos/'.$row->cmt_id,img($_image_del),array('onclick'=>"return confirm('ต้องการลบตำแหน่งนี้ใช่หรือไม่');")); ?></td>
</tr>
<?php
$index++;
}
} else {
?>
<tr class="notfound">
<td colspan="8" >** ไม่พบข้อมูล **</td>
</tr>
<?php
}
?>
</table>
<script language="javascript">
function do_submit(){
tlist1.update();
document.getElementById('persons').value = $F('wk11_co');
document.myform.submit();
}
</script>
|