Viewing file: v_plandetail.php (20.51 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<link rel="stylesheet" href="<?=base_url();?>/js/textboxlist_proto/textboxlist2.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 language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" ></script>
-->
<script type="text/javascript">
jQuery(document).ready(function(){
//get_option();
jQuery('#atb_type1').click(function() {
jQuery('#atb1').show('slow');
jQuery('#atb2').hide('slow');
jQuery('#atb3').hide('slow');
});
jQuery('#atb_type2').click(function() {
jQuery('#atb2').show('slow');
jQuery('#atb1').hide('slow');
jQuery('#atb3').hide('slow');
});
jQuery('#atb_type3').click(function() {
jQuery('#atb1').hide('slow');
jQuery('#atb2').hide('slow');
jQuery('#atb3').show('slow');
});
if (jQuery("#jatb_type").val() == 1) {
jQuery('#atb1').show('slow');
jQuery('#atb2').hide('slow');
jQuery('#atb3').hide('slow');
} else if (jQuery("#jatb_type").val() == 2) {
jQuery('#atb1').hide('slow');
jQuery('#atb2').show('slow');
jQuery('#atb3').hide('slow');
} else {
jQuery('#atb1').hide('slow');
jQuery('#atb2').hide('slow');
jQuery('#atb3').hide('slow');
}
});
var auto_num =0;
function addRow () {
var target = jQuery("#co_owner");
var childObj = target.clone();
var text = target.parents("td:first").prev().text();
var no = jQuery(":input[name='co_owner\[\]']").length +1;
var color = target.parents("tr:first").prev().attr("bgcolor");
text = text.replace(/[0-9]/,"");
var html = "<tr bgcolor=\""+color+"\">";
html += "<td>";
html += "<select name=\"co_owner[]\" class=\"co_owner\" id=\"co_owner_"+no+"\">";
html += childObj.html();
html += "</select>";
html += "</td>"
html += "</tr>";
jQuery(html).insertAfter(jQuery(":input[name='co_owner\[\]']:last").parents("tr:first"));
jQuery(":input[id='co_owner_"+no+"']").val("");
}
document.observe('dom:loaded', function() {
// init
tlist1 = new FacebookList('wk11_co', 'crs_auto');
var get_user_list_url = "<?=site_url("esa/search/get_crs_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;}
});
</script>
<?php
//if($qu_mpj!='')
if(is_object($qu_mpj))
$mpj = ($qu_mpj->row()) ? $qu_mpj->row() : '';
$dpj = ($qu_dpj->row()) ? $qu_dpj->row() : '';
$stp = ($qu_stp->row()) ? $qu_stp->row() : NULL;
?>
<?php
$_image_add = array(
'src' => 'images/esa/add_2.gif',
'width' => '15',
'height' => '15',
'border' => '0',
'title' => 'เพิ่มกลุ่มนักศึกษา',
'align' => 'absmiddle',
'onClick' => 'addRow()',
'onmouseover' => "this.style.cursor='pointer'"
);
$_image_del = array(
'src' => 'images/delete.png',
'width' => '15',
'height' => '15',
'border' => '0',
'title' => 'ลบข้อมูล',
'onmouseover' => "this.style.cursor='pointer'"
);
?>
<table border='0' width="100%">
<tr><td><?php //echo link_tag('css/nav_esa.css');?></td></tr>
<tr><td>
<?php
echo form_open($this->config->item('sa_folder').'project/do_add_project', array("name" => "myform", "id" => "myform"));
//$year = $mpj_year;//(isset($mpj->mpj_year))?$mpj->mpj_year:date("Y")+543;
$year = (isset($dpj->dpj_bgY))?$dpj->dpj_bgY:$mpj_year;
?>
<table class='szone2' width="85%" border="0" align="left">
<tr class='szone'>
<td width="20%" align="right">ปีงบประมาณ </td>
<td width="30%"><!-- <?=form_dropdown('mpj_year', $qu_ib, set_value('mpj_year',$year)); ?> -->
<input type="text" name="mpj_year" id="mpj_year" size="4" value="<?php echo set_value('mpj_year',$year); ?>" readonly>
</td>
<td width="50%" align="left"><?php
//if($acp_id=='') echo 'รหัสโครงการ'; else echo 'รหัสกิจกรรม';
echo ($qu_dpj->num_rows() > 0)?($dpj->dpj_mpj_id==0)?'รหัสโครงการ':'รหัสกิจกรรม' :'รหัสโครงการ';
?> <input type="text" name="mpj_code" id="mpj_code"
value="<?php
//if($qu_dpj!=''){
echo set_value('mpj_code',(isset($dpj->dpj_code))?$dpj->dpj_code:'');
//}
?>"
size="10" maxlength='10'/> <span class="error">* <?php echo form_error('mpj_code');?></span></td>
</tr>
<tr class='szone'>
<td align="right">ชื่อโครงการ </td>
<td colspan="2">
<?php
//if($dpj!=''){
if(is_object($dpj)){
//if($qu_mpj!=''){ //หน้าจอกิจกรรม
if(is_object($qu_mpj)){ //หน้าจอกิจกรรม
echo isset($mpj->dpj_sub_name)?$mpj->dpj_sub_name:'';
}else{ //หน้าจอโครงการ
?>
<input type="text" name="mpj_name" id="mpj_name" value="<?php
echo set_value('mpj_name',$dpj->dpj_sub_name); ?> " size="70" maxlength='100' /><span class="error">* <?php echo form_error('mpj_name');?></span>
<?php
}
}else{
?>
<input type="text" name="mpj_name" id="mpj_name" value="" size="70" maxlength='100'><span class="error">* <?php echo form_error('mpj_name');?></span>
<?php
}
?>
</td>
</tr>
<?php
//if($qu_mpj!=''){
//if($mpj!=''){
if(is_object($qu_mpj)){
if(is_object($mpj)){
?> <tr class='szone'>
<td align="right">ชื่อกิจกรรม </td>
<td colspan="2"><input type="text" name="mpj_name" id="mpj_name" value="<?php
$dpj_name = '';
echo set_value('dpj_sub_name',(isset($dpj->dpj_sub_name))?$dpj->dpj_sub_name:''); ?>" size="70" maxlength='100' /><span class="error">* <?php echo form_error('mpj_name');?> </span></td>
</tr>
<?php
} }
?>
<tr class='szone'>
<td align="right">เจ้าของโครงการ (หลัก) </td>
<td colspan="2"><?=form_dropdown('dpj_owner', $opt_sc, set_value('dpj_owner',(isset($dpj->dpj_owner))?$dpj->dpj_owner:'')); ?></td>
</tr>
<tr class='szone' valign='top'>
<td align="right">เจ้าของโครงการ (ร่วม) <?php echo img($_image_add);?></td>
<td colspan="2">
<table>
<?php
$index = 1;
if ($rs_co->num_rows()>0) {
foreach ($rs_co->result() as $row_co) {
?>
<tr><td>
<?=form_dropdown('co_owner[]', $opt_sc, set_value('co_owner[]',$row_co->cop_sc_id) ,"id=\"co_owner\""); ?>
<?php echo anchor($this->config->item('sa_folder').'project/delete_cop/'.$row_co->cop_id.'/'.$dpj->dpj_id,img($_image_del),array('onclick'=>"return confirm('ต้องการลบแถวนี้ใช่หรือไม่');")); ?>
</td></tr>
<?php
$index++;
}
} else {
?>
<tr><td>
<?=form_dropdown('co_owner[]', $opt_sc, set_value('co_owner[]') ,"id=\"co_owner\""); ?></td></tr>
<?php
}
?>
</table>
<?php echo form_error('co_owner[]');?>
</td>
</tr>
<tr class='szone'>
<td align="right">ผู้ดำเนินโครงการ</td>
<td colspan="2"><input type="text" name="dpj_manager" id="dpj_manager" value="<?php echo set_value('dpj_manager',(isset($dpj->dpj_manager))?$dpj->dpj_manager:''); ?>" size="40" /></td>
</tr>
<tr class='szone'>
<td align="right">ที่ปรึกษาโครงการ</td>
<td colspan="2"><input type="text" name="dpj_adviser" id="dpj_adviser" value="<?php echo set_value('dpj_adviser',(isset($dpj->dpj_adviser))?$dpj->dpj_adviser:''); ?>" size="40" /></td>
</tr>
<tr class='szone'>
<td valign="top" align="right">วัตถุประสงค์</td>
<td colspan="2"><textarea id="dpj_objective" name="dpj_objective" rows="2" cols="50" class=""><?php echo set_value('dpj_objective',(isset($dpj->dpj_objective))?$dpj->dpj_objective:''); ?></textarea></td>
</tr>
<tr class='szone' valign="top">
<td align="right">ผลผลิต/ผลลัพธ์</td>
<td colspan="2"><textarea id="dpj_result" name="dpj_result" rows="2" cols="50" class=""><?php echo set_value('dpj_result',(isset($dpj->dpj_result))?$dpj->dpj_result:''); ?></textarea></td>
</tr>
<tr class='szone'>
<td valign="top" align="right">คุณลักษณะโครงการ </td>
<td valign="top" colspan="2">
<input type="radio" name="atb_type1" id="atb_type1" value="1" <?php echo (set_value('atb_type1',(isset($dpj->dpj_attribute))?$dpj->dpj_attribute:'')==1)? 'checked' : ''; ?> /> ภารกิจ
<input type="radio" name="atb_type1" id="atb_type2" value="2" <?php echo (set_value('atb_type1',(isset($dpj->dpj_attribute))?$dpj->dpj_attribute:'')==2)? 'checked' : ''; ?> /> กลยุทธ์
<input type="hidden" name="jatb_type" id="jatb_type" value="<?php echo set_value('atb_type1',(isset($dpj->dpj_attribute))?$dpj->dpj_attribute:'')?>" />
<?php echo isset($ch_atb_id)? $ch_atb_id : '' ;?>
<div id='atb1' style="display:none;">
<table border='0'>
<?php
// atb
if ($qu_atb->num_rows > 0) {
$index=1;
$p = 1;
$p_index=0;
foreach ($qu_atb->result() as $row) {
if($row->p_atb_id != $p_index){
$p_index = $row->p_atb_id ;
?>
<tr >
<td align="left"> <?php if($row->p_atb_parentId!=0){echo nbs(2); }else{ echo ''; } ?> <font size="2">
<?php echo form_checkbox("atb_id".$index, $row->p_atb_id, set_value("atb_id".$index,$row->tp_atb_id)).nbs(1).$row->p_atb_name;?></td>
</tr>
<?
if($row->atb_id !=NULL){
$index++;
?>
<tr class='szone2'>
<td align="left"> <?php if($row->atb_parentId!=0){echo nbs(2); }else{ echo ''; } ?> <font size="2">
<?php echo form_checkbox("atb_id".$index, $row->atb_id, set_value("atb_id".$index,$row->tp_atb_id)).nbs(1).$row->atb_name;?></td>
</tr>
<?
}
}else{
?>
<tr class='szone2'>
<td align="left"> <?php if($row->atb_parentId!=0){echo nbs(2); }else{ echo ''; } ?> <font size="2">
<?php echo form_checkbox("atb_id".$index, $row->atb_id, set_value("atb_id".$index,$row->tp_atb_id)).nbs(1).$row->atb_name;?></td>
</tr><!-- img($_image_del,array('onClick'=>"do_delete($row->atb_id,1);")); -->
<?php
}
$index++;
}
?>
<input type="hidden" name="atb_id" value="<?php echo $index?>" />
<?
} else {
?>
<tr>
<td colspan="3" height="22" align="center" bgcolor="#D1DCF3">ไม่พบคุณลักษณะโครงการ</td>
</tr>
<?php
}
// end atb
?>
</table>
</div>
<div id='atb2' style="display:none;">
<table border='0'>
<tr valign="top">
<td align="right" >ประเด็นยุทธศาสตร์ </td>
<td align="left" ><?=form_dropdown('stp_stg_id', $qu_stg, set_value('stp_stg_id',getval('stp_stg_id',$stp))); ?></td>
</tr>
<tr valign="top">
<td align="right">กลยุทธ์</td>
<td colspan="2"><textarea id="stp_strategy" name="stp_strategy" rows="2" cols="50" class=""><?php echo set_value('stp_strategy',getval('stp_strategy',$stp))?></textarea></td>
</tr>
<tr valign="top">
<td align="right">เป้าประสงค์</td>
<td colspan="2"><textarea id="stp_goal" name="stp_goal" rows="2" cols="50" class=""><?php echo set_value('stp_goal',getval('stp_goal',$stp))?></textarea></td>
</tr>
</table>
</div>
<div id='atb3' style="display:none;">
<table border='0'>
</table>
</div>
</br>
</td>
</tr>
<tr class='szone' valign="top">
<td align="right">บูรณาการกับฝ่ายอื่นๆ</td>
<td colspan="2">
<table border='0' width="80%">
<?php
// atb
if ($qu_itg->num_rows > 0) {
$index=1;
$p = 1;
$p_index=0;
?>
<?php
foreach ($qu_itg->result() as $row) {
if($row->p_itg_id != $p_index){
$p_index = $row->p_itg_id ;
?>
<tr class='szone2'>
<td align="left"> <?php if($row->p_itg_parentId!=0){echo nbs(2); }else{ echo ''; } ?> <font size="2">
<?php echo form_checkbox("itg_id".$index, $row->p_itg_id, set_value("itg_id".$index,$row->igp_itg_id)).nbs(1).$row->p_itg_name;?></td>
</tr>
<?
if($row->itg_id !=NULL){
$index++;
?>
<tr class='szone2'>
<td align="left"> <?php if($row->itg_parentId!=0){echo nbs(2); }else{ echo ''; } ?> <font size="2">
<?php echo form_checkbox("itg_id".$index, $row->itg_id, set_value("itg_id".$index,$row->igp_itg_id)).nbs(1).$row->itg_name;?></td>
</tr>
<?
}
}else{
?>
<tr class='szone2'>
<td align="left"> <?php if($row->itg_parentId!=0){echo nbs(2); }else{ echo ''; } ?> <font size="2">
<?php echo form_checkbox("itg_id".$index, $row->itg_id, set_value("itg_id".$index,$row->igp_itg_id)).nbs(1).$row->itg_name;?></td>
</tr>
<?php
}
$index++;
}
?>
<input type="hidden" name="itg_id" value="<?php echo $index?>" />
<?
} else {
?>
<tr class='notfound'>
<td colspan="3" height="22" align="center" bgcolor="#D1DCF3">ไม่พบบูรณาการ</td>
</tr>
<?php
}
// end atb
?>
</table>
</td>
</tr>
<tr class='szone' valign="top">
<td align="right">บูรณาการกับรายวิชา </td>
<td colspan="2" id="is_list" class="input-text">
<input type = "text" value = "" name="wk11_co" id = "wk11_co" width="500"/> <!-- 2. textbox's name & id -->
<div id = "crs_auto"> <!-- 3. div's id -->
<div class = "default">รายชื่อวิชา</div>
<ul class = "feed">
<?
if($rs_igc->num_rows() > 0) {
echo "<br />";
foreach ($rs_igc->result() as $crs_row) {
echo "<li>".$crs_row->crsCode." ".explodeSquare($crs_row->crsName)." ".anchor($this->config->item('sa_folder').'project/delete_igc/'.$crs_row->igc_id.'/'.$mpj->mpj_id,img($_image_del),array('onclick'=>"return confirm('ต้องการลบแถวนี้ใช่หรือไม่');"))."</li>";
}
}
?> </ul>
</div>
</td>
</tr>
<tr class='szone' valign="top">
<td align="right">ตัวชี้วัด</td>
<td colspan="2">
<textarea id="dpj_indicator" name="dpj_indicator" rows="2" cols="50" class=""><?php echo set_value('dpj_indicator',(isset($dpj->dpj_indicator))?$dpj->dpj_indicator:''); ?></textarea>
</td>
</tr>
<tr class='szone' valign="top">
<td align="right">เป้าหมาย</td>
<td colspan="2"><textarea id="dpj_target" name="dpj_target" rows="2" cols="50" class=""><?php echo set_value('dpj_target',(isset($dpj->dpj_target))?$dpj->dpj_target:''); ?></textarea>
</td>
</tr>
<tr class='szone'>
<td align="right">สถานที่ดำเนินการ </td>
<td colspan="2"><input type="text" name="dpj_place" id="dpj_place" value="<?php echo set_value('set_value',(isset($dpj->dpj_place))?$dpj->dpj_place:''); ?>" size="70" /></td>
</tr>
<tr class='szone'>
<td align="right">ระยะเวลาในการดำเนินงาน</td>
<td colspan="2">
<table border='0'>
<tr>
<td >วันที่เริ่มต้น </td><td ><script>DateInput('dpj_fr_date', true, 'DD/MM/YYYY',"<?php echo set_value('dpj_fr_date') ? set_value('dpj_fr_date') : splitDateDb2((isset($dpj->dpj_fr_date))?$dpj->dpj_fr_date:getNowDate(), '/');?>");</script></td>
<td >วันที่สิ้นสุด </td><td ><script>DateInput('dpj_to_date', true, 'DD/MM/YYYY',"<?php echo set_value('dpj_to_date') ? set_value('dpj_to_date') : splitDateDb2((isset($dpj->dpj_to_date))?$dpj->dpj_to_date:getNowDate(), '/')?>");</script></td>
</tr>
</table>
</td>
</tr>
<tr class='szone'>
<td align="right" valign="top">วิธีดำเนินการ </td>
<td colspan="2"><textarea id="dpj_procedure" name="dpj_procedure" rows="7" cols="50" class=""><?php echo set_value('dpj_procedure',(isset($dpj->dpj_procedure))?$dpj->dpj_procedure:''); ?></textarea></td>
</tr>
<tr class='szone'>
<td align="right">ผู้จัดทำโครงการ</td>
<td colspan="2"><input type="text" name="dpj_creator" id="dpj_creator" value="<?php echo set_value('dpj_creator',(isset($dpj->dpj_creator))?$dpj->dpj_creator:''); ?>" size="40" /></td>
</tr>
<tr class='szone'>
<td colspan="3" height="22" align="center">
<?php echo $this->session->flashdata('set_error');?>
<?php echo isset($set_error)? $set_error : '';?>
</td>
</tr>
<tr class='szone2'>
<td colspan="3" align="center">
<input type="hidden" name="mpj_id" value="<?php echo (isset($dpj->dpj_mpj_id))?$dpj->dpj_mpj_id:''; ?>" />
<input type="hidden" name="dpj_id" value="<?php echo (isset($dpj->dpj_id))?$dpj->dpj_id:''; ?>" />
<input type="submit" name="add" value="บันทึก" onclick="javascript:do_submit();"/></td>
</tr>
<?php echo form_close();?>
</table>
</td></tr>
</table>
<script language="javascript">
function do_submit(){
tlist1.update();
document.getElementById('persons').value = $F('wk11_co');
document.myform.submit();
}
</script>
|