Viewing file: v_add_edit_budget.php (8.98 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
if(isset($rs_dpj)){
?>
<table class='tb_1' width="100%" border="0">
<tr>
<th align="center">ลำดับที่</th>
<th align="center">ปีงบประมาณ</th>
<th align="center">รหัสโครงการ</th>
<th align="center">ชื่อโครงการ/กิจกรรม</th>
<th align="center">เสนอโครงการ/กิจกรรม</th>
<th align="center">แก้ไข</th>
<th align="center">ลบ</th>
</tr>
<?php
if ($rs_dpj->num_rows > 0) {
$index=1;
$p = 1;
$p_index=0;
foreach ($rs_dpj->result() as $row) {
if($row->dpj_id != $p_index){
$p_index = $row->dpj_id ;
$p = 1;
?>
<tr>
<td align="center"><?php
echo $index;
?></td>
<td align="center"><?php
echo $row->dpj_bgY;
?></td>
<td ><?php
echo $row->dpj_code;
?></td>
<td >[ โครงการ ]
<span class="hand" onClick="sendPost('myform0', {'dpj_id':'<?php echo $row->dpj_id; ?>'}, 'detail_dpj',{})"><?php echo $row->dpj_sub_name;?></span>
</td>
<td align="center">
<?php if ($row->dpj_status==1) {
echo '<font color="#ff6600">รออนุมัติ</font>';
} elseif($row->dpj_status==2){
echo '<font color="#669900">อนุมัติ<br>';
echo '('.fulldate2($row->dpj_date_approve).')</font>';
}else {
echo anchor($this->config->item('sa_folder').'project/offer_dpj/'.$row->dpj_id,img($this->config->item('sa_image_subject')),array('onclick'=>"return confirm('ต้องการเสนอโครงการนี้ใช่หรือไม่');"));
}
?>
</td>
<td align="center">
<?php if ($row->dpj_status==1 || $row->dpj_status==2) {
echo img($this->config->item('sa_image_nreply'));
} else {
?>
<span class="hand" onClick="sendPost('myform1', {'mpj_id':'<?php echo $row->dpj_id; ?>'}, 'plandetail')"><?php echo img($this->config->item('sa_image_reply'));?></span>
<?php }
?>
</td>
<td align="center">
<?php if ($row->dpj_status==1 || $row->dpj_status==2) {
echo img($this->config->item('sa_image_ndel'));
} else {
echo anchor($this->config->item('sa_folder').'project/delete_dpj/'.$row->dpj_id,img($this->config->item('sa_image_del')),array('onclick'=>"return confirm('ต้องการลบกิจกรรมนี้ใช่หรือไม่');"));
}
?>
</td>
</tr>
<?php
if($row->dpj2_id !=NULL){
$index++;
?>
<tr>
<td align="center"><?php
echo $index;
?></td>
<td align="center"><?php
echo $row->dpj2_bgY;
?></td>
<td ><?php
echo $row->dpj2_code;
?></td>
<td > [ กิจกรรม ]
<span class="hand" onClick="sendPost('myform2', {'dpj_id':'<?php echo ($row->dpj2_id==NULL)?$row->dpj_id:$row->dpj2_id; ?>'}, 'detail_dpj',{})"><?php echo $row->dpj2_sub_name;?></span>
</td>
<td align="center">
<?php if ($row->dpj2_status==1) {
echo '<font color="#ff6600">รออนุมัติ</font>';
} elseif($row->dpj2_status==2){
echo '<font color="#669900">อนุมัติ<br>';
echo '('.fulldate2($row->dpj2_date_approve).')</font>';
} else {
echo anchor($this->config->item('sa_folder').'project/offer_dpj/'.(($row->dpj2_id==NULL)?$row->dpj_id:$row->dpj2_id),img($this->config->item('sa_image_subject')),array('onclick'=>"return confirm('ต้องการเสนอกิจกรรมนี้ใช่หรือไม่');"));
}
?>
</td>
<td align="center">
<?php if ($row->dpj2_status==1 || $row->dpj2_status==2) {
echo img($this->config->item('sa_image_nreply'));
} else {
?>
<span class="hand" onClick="sendPost('myform3', {'mpj_id':'<?php echo ($row->dpj2_id==NULL)?$row->dpj_id:$row->dpj2_id; ?>'}, 'plandetail')"><?php echo img($this->config->item('sa_image_reply'));?></span>
<?php }
?>
</td>
<td align="center">
<?php if ($row->dpj2_status==1 || $row->dpj2_status==2) {
echo img($this->config->item('sa_image_ndel'));
} else {
echo anchor($this->config->item('sa_folder').'project/delete_dpj/'.(($row->dpj2_id==NULL)?$row->dpj_id:$row->dpj2_id),img($this->config->item('sa_image_del')),array('onclick'=>"return confirm('ต้องการลบกิจกรรมนี้ใช่หรือไม่');"));
}
?>
</td>
</tr>
<?
}
$p++;
}else{
?>
<tr>
<td align="center"><?php
echo $index;
?></td>
<td align="center"><?php
echo $row->dpj2_bgY;
?></td>
<td ><?php
echo $row->dpj2_code;
?></td>
<td > [ กิจกรรม ]
<span class="hand" onClick="sendPost('myform4', {'dpj_id':'<?php echo ($row->dpj2_id==NULL)?$row->dpj_id:$row->dpj2_id; ?>'}, 'detail_dpj',{})"><?php echo $row->dpj2_sub_name;?></span>
</td>
<td align="center">
<?php if ($row->dpj2_status==1) {
echo '<font color="#ff6600">รออนุมัติ</font>';
} elseif($row->dpj2_status==2){
echo '<font color="#669900">อนุมัติ<br>';
echo '('.fulldate2($row->dpj2_date_approve).')</font>';
} else {
echo anchor($this->config->item('sa_folder').'project/offer_dpj/'.(($row->dpj2_id==NULL)?$row->dpj_id:$row->dpj2_id),img($this->config->item('sa_image_subject')),array('onclick'=>"return confirm('ต้องการเสนอกิจกรรมนี้ใช่หรือไม่');"));
}
?>
</td>
<td align="center">
<?php if ($row->dpj2_status==1 || $row->dpj2_status==2) {
echo img($this->config->item('sa_image_nreply'));
} else {
?>
<span class="hand" onClick="sendPost('myform5', {'mpj_id':'<?php echo ($row->dpj2_id==NULL)?$row->dpj_id:$row->dpj2_id; ?>'}, 'plandetail')"><?php echo img($this->config->item('sa_image_reply'));?></span>
<?php }
?>
</td>
<td align="center">
<?php if ($row->dpj2_status==1 || $row->dpj2_status==2) {
echo img($this->config->item('sa_image_ndel'));
} else {
echo anchor($this->config->item('sa_folder').'project/delete_dpj/'.(($row->dpj2_id==NULL)?$row->dpj_id:$row->dpj2_id),img($this->config->item('sa_image_del')),array('onclick'=>"return confirm('ต้องการลบกิจกรรมนี้ใช่หรือไม่');"));
}
?>
</td>
</tr>
<?php
$p++;
}
$index++;
}
}else{
?>
<tr class='notfound'>
<td colspan="7" align="center"><?php echo $this->config->item('sa_not_found');?></td>
</tr>
<?php
}
?>
</table>
<?php
}else{
?>
<script src="<?=base_url();?>libraries/fcbkcomplete/jquery.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function() {
display();
});
function display(){
var url = "<?=site_url($this->config->item('sa_folder').'project/main_project');?>";
$.ajax({
url: url,
global: false,
type: "POST",
data: ({year : $('#year').val()}),
dataType: "html",
async:false,
success: function(data)
{ //alert("success"+data);
$('#dpj').html(data);
},
error: function(xhr,state,exception)
{ //alert("error");
alert(state+', xhr.status = '+xhr.status);
}
});
}
</script>
<?php echo form_open($this->config->item('sa_folder')."project/plandetail", array("name" => "myform", "id" => "myform"));//add_edit_project
//$atb = $atb_->row();
?>
<table width="80%" align="center">
<tr>
<td align="center"><h3>บันทึกโครงการ</h3></td>
</tr>
<tr>
<th align="center" colspan="2"></th>
</tr>
<tr>
<td>
<table class='szone2' width="100%" border='0'>
<tr class='szone'>
<th width="15%">ปีงบประมาณ</th>
<th width="5%"><?=form_dropdown('mpj_year', $qu_ib ,'','id="year" onchange="JavaScript: display();"'); ?><font color="#FF0000"> </th>
<th align="left" ><input type="submit" name="save" value="เพิ่มโครงการ" <?php echo ($yr)? '': 'disabled';?>></th>
</tr>
</table>
</td>
</tr>
<tr>
<td><div id='dpj'></div></td>
</tr>
</table>
<?php
echo form_close();
} //END if isset
?>
|