Esempio n. 1
0
function re_viewAgtp($child,$no=0,$ck_edit=0,$cms_id,$rs_file,$link){
	$linkSave = site_url() . "/emeeting/agenda/agdtSave/";
	// Image save
	$save = array(
		"src" => "images/emeeting/icons/edit.png",
		"width" => "16"
	);
	$imgSave = img($save);
	$str_agd = "วาระที่ ";
	$str_detail = "รายละเอียด";
	$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->agdt_id; ?>">
			<?php 
			echo "<span class=\"string\"><div class=\"tbin\">";
			$i = $i + 1;
			if($row_child->agdt_level == 0){
				echo "<b>".$str_agd . al_to_th($i) . "</b>&nbsp;&nbsp;&nbsp;";
				$no_send = $i;
				$agdt_no = $i;
			} else {
				echo "<b>".al_to_th($no) . "." . al_to_th($i) . "</b>&nbsp;&nbsp;&nbsp;";
				$no_send = $no . "." . $i;
				$agdt_no = $no . "." . $i;
			}
			echo "<b>".$row_child->agdt_head."</b><br/>";
			//if($row_child->child->num_rows()==0){
				// Detail
				//echo "<br/><u>".$str_detail."</u>";
				if($row_child->agdt_detail != "")
				{
					echo $row_child->agdt_detail;
					$num1 = 0;
				}
				else
				{
					echo "<br/>";
					$num1 = 1;
				}
				
				//	เสนอโดย
				if($row_child->agdt_by != "")
				{
					echo $row_child->agdt_by."<br/><br/>";
				}
				
				// File
				$ag_file = $rs_file->getFileByAgdtId($row_child->agdt_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/'.$row_file->agfl_nname.'" target="_blank" >- '.$row_file->agfl_oname.'</a></li>';
					}
					echo "</ul>";
					$num2 = 0;
				}
				else
				{
					$num2 = 1;
					
				}
				// Present
				if($row_child->agdt_present != "")
				{
					echo "<b><u>".$str_present."</u></b>";
					echo $row_child->agdt_present;
					$num3 = 0;
				}
				else
				{
					$num3 = 1;
				}
				// Result
				
				if($row_child->agdt_result != "")
				{
					echo "<b><u>".$str_result."</u></b>";
					echo $row_child->agdt_result;
					$num4 = 0;
				}
				else
				{
					$num4 = 1;
				}
				
				$sum = $num1 + $num2 + $num3 + $num4;
				if($sum == 4)
				{
					//echo "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- ไม่มี -<br/>";
				}
			//}
			echo "</div></span>";
			
			if($ck_edit == ""){
				$ck_edit = -1;
			}
			//$no_ag = $no_send;
			
			//$getSave = $row_child->agdt_id."/".$row_child->agdt_level."/".$row_child->agdt_mt_id."/".$cms_id."/".$ck_edit."/".$agdt_no."/1/".$link;
			$getSave = $row_child->agdt_id."/".$row_child->agdt_level."/".$row_child->agdt_mt_id."/".$cms_id."/".$ck_edit."/".$agdt_no."/1";
			$link = str_replace("=",".",base64_encode($getSave));
			$getSave.="/".$link;
			?>
			<span style="float:right;margin:3px;height:18px;">
				<a href="<?php echo $linkSave . $getSave; ?>" class="agdtSave2" id="<?php echo $row_child->agdt_id; ?>" title="บันทึกการประชุม" ><?php echo $imgSave; ?></a>
			</span>
			<?php
			if($row_child->child->num_rows()>0){
				re_viewAgtp($row_child->child,$no_send,$ck_edit,$cms_id,$rs_file,$link);
			}
			?>
		</li>
		<?php
			if($row_child->agdt_level == 0){
				echo "<hr />";
			}
		}
		?>
	</ul>
<?php
}
Esempio n. 2
0
function re_viewAgtp($child,$no=0){
	$str_agd = "วาระที่ ";
	$no_send = "";
	?>
	<ul class="sortable">
		<?php
		$i = 0;
		foreach($child->result() as $row_child){
		?>
		<li id="<?php echo $row_child->agtp_id; ?>">
			<?php
			echo "<span class=\"string\">";
			$i = $i + 1;
			if($row_child->agtp_level == 0){
				echo $str_agd . al_to_th($i) . "&nbsp;&nbsp;&nbsp;";
				$no_send = $i;
			} else {
				echo al_to_th($no) . "." . al_to_th($i) . "&nbsp;&nbsp;&nbsp;";
				$no_send = $no . "." . $i;
			}
			echo $row_child->agtp_head . "</span>";
			//$getAdd = $row_child->agtp_id . "/" . ($row_child->agtp_level+1) . "/" .$row_child->agtp_cms_id;
			//$getEdit = $row_child->agtp_id . "/" . $row_child->agtp_level . "/" .$row_child->agtp_cms_id;
			if($row_child->child->num_rows()>0){
				re_viewAgtp($row_child->child,$no_send);
			}
			?>
		</li>
		<?php
		}
		?>
	</ul>
<?php
}
Esempio n. 3
0
function re_viewAgtp($child,$no=0,$cms_id,$rs_file){
	// Image OK
	$ok = array(
		"src" => "images/emeeting/yes.png",
		"width" => "16",
		"border" => "0"
	);
	$imgOK = img($ok);
	
	// Image Cancel
	$cancel = array(
		"src" => "images/emeeting/dialog_cancel.png",
		"width" => "16",
		"border" => "0"
	);
	$imgCancel = img($cancel);
	
	// Image Loader
	$load = array(
		"src" => "images/emeeting/loadera16.gif",
		"width" => "16",
		"border" => "0"
	);
	$imgLoad = img($load);
	
	$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){
			if($row_child->agdt_add == '1'){
				?>
				<li id="<?php echo $row_child->agdt_id; ?>" name="<?php echo $row_child->agdt_id; ?>" class="appv">
				<?php
			}
			else{
				?>
				<li id="<?php echo $row_child->agdt_id; ?>" name="<?php echo $row_child->agdt_id; ?>">
				<?php 
			}
			echo "<span class=\"string\" id=\"agdt_".$row_child->agdt_id."\"><div class=\"tbin\">";
			
			$i = $i + 1;
			if($row_child->agdt_level == 0){
				echo "<b>".$str_agd . al_to_th($i) . "</b>&nbsp;&nbsp;&nbsp;";
				$no_send = $i;
				$agdt_no = $i;
			} else {
				echo "<b>".al_to_th($no) . "." . al_to_th($i) . "</b>&nbsp;&nbsp;&nbsp;";
				$no_send = $no . "." . $i;
				$agdt_no = $no . "." . $i;
			}
			echo "<b>".$row_child->agdt_head."</b><br/>";

			if($row_child->agdt_detail != "")
			{
				echo $row_child->agdt_detail;
				$num1 = 0;
			}
			else
			{
				$num1 = 1;
				echo "<br/>";
			}
			
			//	เสนอโดย
			if($row_child->agdt_by != "")
			{
				echo "<b><u>".$str_by."</u></b>&nbsp;&nbsp;".$row_child->agdt_by."<br/><br/>";
			}
			
			// File
			$ag_file = $rs_file->getFileByAgdtId($row_child->agdt_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 color="#"><a href="'.base_url().'uploads/emeeting/docs/'.$row_file->agfl_nname.'" target="_blank" >- '.$row_file->agfl_oname.'</a></li>';
				}
				echo "</ul><br/>";
				$num2 = 0;
			}
			else
			{
				$num2 = 1;
				
			}
			// Present
			if($row_child->agdt_present != "")
			{
				echo "<b><u>".$str_present."</u></b>";
				echo $row_child->agdt_present;
				$num3 = 0;
			}
			else
			{
				$num3 = 1;
			}
			// Result
			
			if($row_child->agdt_result != "")
			{
				echo "<b><u>".$str_result."</u></b>";
				echo $row_child->agdt_result;
				$num4 = 0;
			}
			else
			{
				$num4 = 1;
			}
			
			$sum = $num1 + $num2 + $num3 + $num4;
			
			// จัดการวาระเพิ่มเติม
			if($row_child->agdt_add == '1')
			{
				if($row_child->agdt_flag_appv == 'Y' || $row_child->agdt_flag_appv == 'N'){
					$agdt_appv_note = $row_child->agdt_appv_note;
					$showInput = "";
				}
				else{
					$agdt_appv_note = "";
					$showInput = "style=\"display:none;\"";
				}
				?>
				<br/><div style="width:760px;border:1px solid #D0DCF0;background:white;padding:5px 5px 5px 5px;">
				<input type="radio" name="approvelist_<?php echo $row_child->agdt_id; ?>" class="approvelist_<?php echo $row_child->agdt_id; ?>" value="Y" <?php if($row_child->agdt_flag_appv == 'Y') echo "checked=\"checked\""; ?> onclick="approveList(this.value, '<?php echo $row_child->agdt_id; ?>', 1)" style="width:20;"><b>อนุมัติ</b>
				<input type="radio" name="approvelist_<?php echo $row_child->agdt_id; ?>" class="approvelist_<?php echo $row_child->agdt_id; ?>" value="N" <?php if($row_child->agdt_flag_appv == 'N') echo "checked=\"checked\""; ?> onclick="approveList(this.value, '<?php echo $row_child->agdt_id; ?>', 1)" style="width:20;"><b>ไม่อนุมัติ</b>
				
				<span class="showInput_<?php echo $row_child->agdt_id; ?>" <?php echo $showInput; ?> >&nbsp;&nbsp;&nbsp;<b>หมายเหตุ (ถ้ามี) : </b>
					<input type="text" name="notelist_<?php echo $row_child->agdt_id; ?>" class="notelist_<?php echo $row_child->agdt_id; ?>" value="<?php echo $agdt_appv_note; ?>" style="width:300;">
					&nbsp;&nbsp;&nbsp;<input type="button" name="btnApprovelist_<?php echo $row_child->agdt_id; ?>" value="บันทึก" onclick="appvNotelist('<?php echo $row_child->agdt_id; ?>', 1)" style="width:70;">
				</span>
				
				&nbsp;&nbsp;&nbsp;&nbsp;<span class="load_<?php echo $row_child->agdt_id; ?>" style="display:none;"><?php echo $imgLoad; ?></span>
				<span class="ok_<?php echo $row_child->agdt_id; ?>" style="display:none;color:green;"><?php echo $imgOK; ?>&nbsp;อนุมัติแล้ว</span>
				<span class="cancel_<?php echo $row_child->agdt_id; ?>" style="display:none;color:green;"><?php echo $imgOK; ?>&nbsp;ไม่อนุมัติ</span>
				<span class="valid_<?php echo $row_child->agdt_id; ?>" style="display:none;color:red;"><?php echo $imgCancel; ?>&nbsp;กรุณากรอกข้อมูล</span>
				<span class="yes_<?php echo $row_child->agdt_id; ?>" style="display:none;color:green;"><?php echo $imgOK; ?>&nbsp;บันทึกข้อมูลเรียบร้อย</span>
				</div><br/>
				<?php
			}
			echo "</div></span>";

			if($row_child->child->num_rows()>0){
				re_viewAgtp($row_child->child,$no_send,$cms_id,$rs_file);
			} 
			?>
		</li>
		<?php
			if($row_child->agdt_level == 0){
				echo "<hr />";
			}
		}
		?>
	</ul>
<?php
}
Esempio n. 4
0
	function re_viewAgtp($child,$no=0,$ck_edit=-1,$cms_id){
		$linkAdd = site_url() . "emeeting/agenda/agdtAdd/";
		$linkEdit = site_url() . "emeeting/agenda/agdtEdit/";
		// 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 = "วาระที่ ";
		$no_send = "";
		?>
		<ul class="sortable" >
		
			<?php
			
			$i = 0;
			foreach($child->result() as $row_child){
				/*if($row_child->agdt_add == '1')
				{
					continue;
				}*/
			?>
			<li id="<?php echo $row_child->agdt_id; ?>">
				<?php 
				echo "<div class=\"string\" style=\"float:left;width:80%\" >";
				$i = $i + 1;
				if($row_child->agdt_level == 0){
					echo $str_agd . $i . "&nbsp;&nbsp;&nbsp;";
					$no_send = $i;
				} else {
					echo $no . "." . $i . "&nbsp;&nbsp;&nbsp;";
					$no_send = $no . "." . $i;
				}
				echo $row_child->agdt_head . "</div>";
				
				if($ck_edit == ""){
					$ck_edit = -1;
				}
				$no_parent = $no_ag = $no_send;
				$getAdd = $row_child->agdt_id."/".($row_child->agdt_level+1)."/".$row_child->agdt_mt_id."/".$cms_id."/".$ck_edit."/".$no_parent;
				$getEdit = $row_child->agdt_id."/".$row_child->agdt_level."/".$row_child->agdt_mt_id."/".$cms_id."/".$ck_edit."/".$no_ag."/-1/-1";
				?>
				<div style="float:right;margin:3px;height:18px;width:nowrap;">
				<?php if( $ck_edit != "short" ){ ?>
					<a href="<?php echo $linkAdd . $getAdd; ?>" class="agdtAdd" title="เพิ่มระเบียบวาระ" ><?php echo $imgAdd; ?></a>
				<?php } ?>
					<a href="javascript:void(0);" class="agdtDel" id="<?php echo $row_child->agdt_id; ?>" title="ลบระเบียบวาระ" onclick="agdtDel('<?php echo $row_child->agdt_id ?>','<?php echo "วาระที่&nbsp;".$no_send."&nbsp;".$row_child->agdt_head ?>')"><?php echo $imgDel; ?></a>
					
					<!--<a href="javascript:void(0);" class="agdtDel" id="<?php echo $row_child->agdt_id; ?>" title="ลบระเบียบวาระ" ><?php echo $imgDel; ?></a>-->
					<a href="<?php echo $linkEdit . $getEdit; ?>" class="agdtEdit" id="<?php echo $row_child->agdt_id; ?>" title="แก้ไขระเบียบวาระ" ><?php echo $imgEdit; ?></a>
				</div>
				<br style="clear:both; line-height:0; height:0; font-size: 1px;" />
				<?php
				if($row_child->child->num_rows()>0){
					re_viewAgtp($row_child->child,$no_send,$ck_edit,$cms_id);
				}
				?>
			</li>
			<?php
			}
			?>
		</ul>
	<?php
	}
Esempio n. 5
0
function re_viewAgtp($child, $no=0, $ck_edit=0, $cms_id, $rs_file, $row_mt, $qu_magap){
	$linkSave = site_url() . "/emeeting/agenda/agdtSave/";
	// Image save
	$save = array(
		"src" => "image/icons/color/application_edit.png",
		"width" => "16",
		"border" => "0"
	);
	$imgSave = img($save);
	$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){
			if($row_child->agdt_add == '1')
			{
				continue;
			}
		?>
		<li id="<?php echo $row_child->agdt_id; ?>" name="<?php echo $row_child->agdt_id; ?>">
			<?php 
			echo "<span class=\"string\" id=\"agdt_".$row_child->agdt_id."\"><div class=\"tbin\">";
			
			$i = $i + 1;
			if($row_child->agdt_level == 0){
				echo "<b>".$str_agd . al_to_th($i) . "</b>&nbsp;&nbsp;&nbsp;";
				$no_send = $i;
				$agdt_no = $i;
			} else {
				echo "<b>".al_to_th($no) . "." . al_to_th($i) . "</b>&nbsp;&nbsp;&nbsp;";
				$no_send = $no . "." . $i;
				$agdt_no = $no . "." . $i;
			}
			echo "<b>".$row_child->agdt_head."</b><br/>";
			//if($row_child->child->num_rows()==0){
				// Detail
				//echo "<br/><u>".$str_detail."</u>";
				if($row_child->agdt_detail != "")
				{
					echo $row_child->agdt_detail;
					$num1 = 0;
				}
				else
				{
					echo "<br/>";
					$num1 = 1;
				}
				
				//	เสนอโดย
				if($row_child->agdt_by != "")
				{
					echo "<b><u>".$str_by."</u></b>&nbsp;&nbsp;".$row_child->agdt_by."<br/><br/>";
				}
				
				// File
				$ag_file = $rs_file->getFileByAgdtId($row_child->agdt_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/'.$row_file->agfl_nname.'" target="_blank" >- '.$row_file->agfl_oname.'</a></li>';
					}
					echo "</ul>";
					$num2 = 0;
				}
				else
				{
					$num2 = 1;
					
				}
				// Present
				if($row_child->agdt_present != "")
				{
					echo "<b><u>".$str_present."</u></b>";
					echo $row_child->agdt_present;
					$num3 = 0;
				}
				else
				{
					$num3 = 1;
				}
				// Result
				
				if($row_child->agdt_result != "")
				{
					echo "<b><u>".$str_result."</u></b>";
					echo $row_child->agdt_result;
					$num4 = 0;
				}
				else
				{
					$num4 = 1;
				}
				
				// show approved agenda
				if($row_mt->mt_mts_id == 32 && $row_child->agdt_result != ""){
					// Load model
					$magap = $qu_magap;
					$magap->agap_agdt_id = $row_child->agdt_id;
					$magap->agap_mt_id = $row_mt->mt_id;
					$qu_appv = $magap->get_countByAgdtAndMt();
					if($qu_appv->num_rows() > 0){
						echo "<br/><div style=\"width:45%;border:1px solid #D0DCF0;background:#EEF2F7;padding:5px 5px 5px 5px;margin-left:40px;\" >";
						foreach($qu_appv->result() as $row_appv){  
							echo "<span style=\"margin-left:25px;\">";
							echo $row_appv->appv_name;
							if($row_appv->num_ps > 0){
								$getSave = str_replace("=",".",base64_encode($row_child->agdt_id."/".$row_appv->appv_id."/".$row_mt->mt_id."/".$agdt_no));
								echo "&nbsp;&nbsp;<a href=\"javascript:void(0);\" title=\"คลิกดูรายละเอียด\" class=\"linkDetail\" onclick=\"getPntApprv('{$getSave}')\" >(&nbsp;" . al_to_th($row_appv->num_ps) . "&nbsp;คน&nbsp;)</a>";
							}
							echo "</span>";
							if($row_appv->appv_id < 3){
								// no last type
								echo "<br />";
							}
						}
						echo "</div><br/>";
					}
				
					
					/*echo "<table style=\"border:1px solid #D0DCF0;background:red;margin-left:40px;\" >";
					echo "<tr>";
					echo "<td>";
					echo "ตาราง";
					echo "</td>";
					echo "</tr>";
					echo "</table>";*/
					
				}
				
				
				$sum = $num1 + $num2 + $num3 + $num4;
				//echo $sum;
				if($sum == 4)
				{
					//echo "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- ไม่มี -<br/>";
				}
			//}
			echo "</div></span>";
			
			if($ck_edit == ""){
				$ck_edit = -1;
			}
			//$no_ag = $no_send;
				
			$getSave = $row_child->agdt_id."/".$row_child->agdt_level."/".$row_child->agdt_mt_id."/".$cms_id."/".$ck_edit."/".$agdt_no."/0";
			$link = str_replace("=",".",base64_encode($getSave));
			$getSave.="/".$link;
			?>
			<span style="float:right;margin:3px;height:18px;">
				<a href="javascript:void(0)" class="agdtSave" id="<?php echo $row_child->agdt_id; ?>" title="บันทึกการประชุม" onclick="callfancybox('<?php echo $row_child->agdt_id ?>','<?php echo $getSave ?>')"><?php echo $imgSave; ?></a>
			</span>
			<?php
			if($row_child->child->num_rows()>0){
				re_viewAgtp($row_child->child, $no_send, $ck_edit, $cms_id, $rs_file, $row_mt, $qu_magap);
			} 
			?>
		</li>
		<?php
			if($row_child->agdt_level == 0){
				echo "<hr />";
			}
		}
		?>
	</ul>
<?php
}