function re_viewAgs($child,$no=0,$ck_edit=-1,$cms_id,$rs_files){ $linkSave = site_url() . "emeeting/shortAgenda/agdtSave/"; // Image Add8 $add = array( "src" => "image/icons/color/add.png", "width" => "16", "border" => "0" ); $imgAdd = img($add); // Image Delete $del = array( "src" => "image/icons/color/cross.png", "width" => "16", "border" => "0" ); $imgDel = img($del); // Image Edit $edit = array( "src" => "image/icons/color/application_edit.png", "width" => "16", "border" => "0" ); $imgEdit = img($edit); $str_agd = "วาระที่ "; $str_detail = "รายละเอียด"; $str_by = "เสนอโดย"; $str_present = "ประเด็นเสนอ"; $str_result = "มติ"; $str_edit = "แก้ไข"; $str_file = "เอกสารแนบ"; $no_send = ""; $num1 = 0; $num2 = 0; $num3 = 0; $num4 = 0; $sum = 0; ?> <ul class="sortable" > <?php $i = 0; foreach($child->result() as $row_child){ ?> <li id="<?php echo $row_child->ags_id; ?>"> <?php echo "<div class=\"tbin\"><div class=\"string\" style=\"float:left;width:80%\" >"; $i = $i + 1; if($row_child->ags_level == 0){ echo "<b>".$str_agd . $i . "</b> "; $no_send = $i; $ags_no = $i; } else { echo "<b>".$no . "." . $i . "</b> "; $no_send = $no . "." . $i; $ags_no = $no . "." . $i; } echo "<b>".$row_child->ags_head . "</b></div>"; //if($row_child->child->num_rows()==0){ $getAdd = $row_child->ags_id."/".($row_child->ags_level+1)."/".$row_child->ags_mt_id."/".$cms_id."/".$ck_edit; $getEdit = $row_child->ags_id."/".$row_child->ags_level."/".$row_child->ags_mt_id."/".$cms_id."/".$ck_edit; $getSave = $row_child->ags_id."/".$row_child->ags_level."/".$row_child->ags_mt_id."/".$cms_id."/".$ck_edit."/".$ags_no."/0"; $link = str_replace("=",".",base64_encode($getSave)); $getSave.="/".$link; ?> <div style="float:right;margin:3px;height:18px;width:nowrap;"> <a href="javascript:void(0);" class="agsDel" id="<?php echo $row_child->ags_id; ?>" title="ลบระเบียบวาระ" onclick="agdtDel('<?php echo $row_child->ags_id ?>','<?php echo "วาระที่ ".$ags_no." ".$row_child->ags_head ?>')"><?php echo $imgDel; ?></a> <a href="javascript:void(0)" class="agsEdit" id="<?php echo $row_child->ags_id; ?>" title="แก้ไขระเบียบวาระ" onclick="callfancybox('<?php echo $row_child->ags_id ?>','<?php echo $getSave ?>')"><?php echo $imgEdit; ?></a> </div> <br style="clear:both; line-height:0; height:0; font-size: 1px;" /> <!--<span style="float:right;margin:3px;height:18px;"> <a href="javascript:void(0);" class="agdtDel" id="<?php echo $row_child->ags_id; ?>" title="ลบระเบียบวาระ" ><?php echo $imgDel; ?></a> <a href="<?php echo $linkSave . $getSave; ?>" class="agdtSave" id="<?php echo $row_child->ags_id; ?>" title="แก้ไขระเบียบวาระ" ><?php echo $imgEdit; ?></a> </span>--> <?php //echo "<br/>"; // Detail //echo "<br/><u>".$str_detail."</u>"; if($row_child->ags_detail != "") { echo $row_child->ags_detail; $num1 = 0; } else { echo "<br/>"; $num1 = 1; } // เสนอโดย if($row_child->ags_by != "") { echo "<b><u>".$str_by."</u></b> ".$row_child->ags_by."<br/><br/>"; } // File $ag_file = $rs_files->getFileByAgdtId($row_child->ags_id); if($ag_file->num_rows() > 0){ echo "<b><u>".$str_file."</u></b>"; echo "<ul>"; foreach($ag_file->result() as $row_file) { echo '<li><a href="'.base_url().'uploads/emeeting/docs/docs_short/'.$row_file->agfls_nname.'" target="_blank" >- '.$row_file->agfls_oname.'</a></li>'; } echo "</ul>"; $num2 = 0; } else { $num2 = 1; } // Present if($row_child->ags_present != "") { echo "<b><u>".$str_present."</u></b>"; echo $row_child->ags_present; $num3 = 0; } else { $num3 = 1; } // Result if($row_child->ags_result != "") { echo "<b><u>".$str_result."</u></b>"; echo $row_child->ags_result; $num4 = 0; } else { $num4 = 1; } /*if($row_child->agdt_flag_extra == 9 && $row_child->agdt_edit != "") { echo "<b><u>".$str_edit."</u></b>"; echo $row_child->agdt_edit; }*/ /*echo "<br/>"; echo "num1=".$num1."<br/>"; echo "num2=".$num2."<br/>"; echo "num3=".$num3."<br/>"; echo "num4=".$num4."<br/>";*/ $sum = $num1 + $num2 + $num3 + $num4; //echo $sum; if($sum == 4) { //echo "<br/> - ไม่มี -<br/>"; } //} echo "</div>"; ?> <?php if($row_child->child->num_rows()>0){ re_viewAgs($row_child->child,$no_send,$ck_edit,$cms_id,$rs_files); } ?> </li> <?php if($row_child->ags_level == 0){ echo "<hr />"; } } ?> </ul> <?php }
function re_viewAgs($child,$no=0,$rs_file="",$mt_mts_id="",$txt=""){ $str_agd = "วาระที่ "; $str_detail = "รายละเอียด"; $str_by = "เสนอโดย"; $str_present = "ประเด็นเสนอ"; $str_result = "มติ"; $str_edit = "สิ่งที่ต้องแก้ไข"; $str_file = "เอกสารแนบ"; $no_send = ""; $num1 = 0; $num2 = 0; $num3 = 0; $num4 = 0; $sum = 0; $p = array("<p>", "</p>"); ?> <?php $i = 0; foreach($child->result() as $row_child){ ?> <div id="<?php echo $row_child->ags_id; ?>"> <?php echo "<span class=\"string\">"; $i = $i + 1; if($row_child->ags_level == 0){ echo "<br/><b>".$str_agd . al_to_th($i) . "</b> "; $no_send = $i; } else { $margin1 = 30; for ($j1 = 1; $j1 <= $row_child->ags_level; $j1++) { $margin1 = $margin1 + 30; } echo "<div style=\"margin-left:".$margin1."px;\"><b>".al_to_th($no) . "." . al_to_th($i) . "</b> "; $no_send = $no . "." . $i; } echo str_replace($txt, "<span class=\"hilight\">".$txt."</span>", $row_child->ags_head)."<br/></div>"; $margin2 = 45; for ($j2 = 1; $j2 <= $row_child->ags_level; $j2++) { $margin2 = $margin2 + 45; } if($row_child->ags_detail != "") { echo "<div class=\"tbin\" style=\"margin-left:".$margin2."px;\">".str_replace($txt, "<span class=\"hilight\">".$txt."</span>", $row_child->ags_detail)."</div>"; $num1 = 0; } else { echo "<br/>"; $num1 = 1; } // เสนอโดย if($row_child->ags_by != "") { echo "<div style=\"margin-left:".$margin2."px;\"><b><u>".$str_by."</u></b> ".$row_child->ags_by."</div><br/>"; } $ag_file = $rs_file->getFileByAgdtId($row_child->ags_id); if($ag_file->num_rows() > 0){ echo "<div style=\"margin-left:".$margin2."px;\"><b><u>".$str_file."</u></b>"; echo "<ul>"; foreach($ag_file->result() as $row_file) { echo '<li><a href="'.base_url().'uploads/emeeting/docs/'.$row_file->agfls_nname.'" target="_blank" >- '.str_replace($txt, "<span class=\"hilight\">".$txt."</span>", $row_file->agfls_oname).'</a></li>'; } echo "</ul></div><br/>"; $num2 = 0; } else { $num2 = 1; } if($row_child->ags_present != "") { echo "<table style=\"border:0px;font-size:16.0pt;font-family:'TH SarabunPSK','sans-serif';\">"; echo "<tr>"; echo "<td width=\"90\" valign=\"top\"><b><u>".$str_present."</u></b></td>"; echo "<td valign=\"top\" ><div class=\"tbin\">".str_replace($txt, "<span class=\"hilight\">".$txt."</span>", str_replace($p,"",$row_child->ags_present))."</div></td>"; echo "</tr>"; echo "</table><br/>"; $num3 = 0; } else { $num3 = 1; } if($row_child->ags_result != "" && $mt_mts_id > 25) { echo "<table style=\"border:0px;font-size:16.0pt;font-family:'TH SarabunPSK','sans-serif';\">"; echo "<tr>"; echo "<td width=\"90\" valign=\"top\"><b><u>".$str_result."</u></b></td>"; echo "<td valign=\"top\"><div class=\"tbin\">".str_replace($txt, "<span class=\"hilight\">".$txt."</span>", str_replace($p,"",$row_child->ags_result))."</div></td>"; echo "</tr>"; echo "<tr><td> </td></tr>"; echo "</table>"; $num4 = 0; } else { $num4 = 1; } $sum = $num1 + $num2 + $num3 + $num4; if($sum == 4) { //echo " - ไม่มี -<br/>"; } echo "</span>"; if($row_child->child->num_rows()>0){ re_viewAgs($row_child->child,$no_send,$rs_file,$mt_mts_id,$txt); } ?> </div> <?php } ?> <?php }