Пример #1
0
<!-- fancybox -->
Пример #2
0
function re_viewAgdt($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->agdt_id; ?>">
			<?php
			echo "<span class=\"string\"";
			$i = $i + 1;
			if($row_child->agdt_level == 0){
				echo "<br/><b>".$str_agd . al_to_th($i) . "</b>&nbsp;&nbsp;";
				$no_send = $i;
			} else {
				$margin1 = 30;
				for ($j1 = 1; $j1 <= $row_child->agdt_level; $j1++) {
					$margin1 = $margin1 + 30;
				}
				echo "<div style=\"margin-left:".$margin1."px;\"><b>".al_to_th($no) . "." . al_to_th($i) . "</b>&nbsp;&nbsp;";
				$no_send = $no . "." . $i;
			}
			echo str_replace($txt, "<span class=\"hilight\">".$txt."</span>", $row_child->agdt_head)."<br/></div>";
			$margin2 = 45;
			for ($j2 = 1; $j2 <= $row_child->agdt_level; $j2++) {
				$margin2 = $margin2 + 45;
			}
			if($row_child->agdt_detail != "")
			{
				echo "<br/><div class=\"tbin\" style=\"margin-left:".$margin2."px;\">".str_replace($txt, "<span class=\"hilight\">".$txt."</span>", $row_child->agdt_detail)."</div>";
				$num1 = 0;
			}
			else
			{
				echo "<br/>";
				$num1 = 1;
			}
			
			//	เสนอโดย
			if($row_child->agdt_by != "")
			{
				echo "<div style=\"margin-left:".$margin2."px;\"><b><u>".$str_by."</u></b>&nbsp;&nbsp;".$row_child->agdt_by."</div><br/>";
			}
			
			$ag_file = $rs_file->getFileByAgdtId($row_child->agdt_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->agfl_nname.'" target="_blank" >- '.str_replace($txt, "<span class=\"hilight\">".$txt."</span>", $row_file->agfl_oname).'</a></li>';
				}
				echo "</ul></div><br/>";
				$num2 = 0;
			}
			else
			{
				$num2 = 1;
			}
			
			if($row_child->agdt_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->agdt_present))."</div></td>";
				echo "</tr>";
				echo "</table><br/>";
				$num3 = 0;
			}
			else
			{
				$num3 = 1;
			}

			if($row_child->agdt_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->agdt_result))."</div></td>";
				echo "</tr>";
				echo "<tr><td>&nbsp;</td></tr>";
				echo "</table>";
				$num4 = 0;
			}
			else
			{
				$num4 = 1;
			}
			
			if($row_child->agdt_flag_extra == 9 && $row_child->agdt_edit != "")
			{
				echo "<table style=\"border:0px;font-size:16.0pt;font-family:'TH SarabunPSK','sans-serif';\">";
				echo "<tr>";
				echo "<td width=\"90\"><b><u>".$str_edit."</u></b></td>";
				$p = array("<p>", "</p>");
				echo "<td><div class=\"tbin\">".str_replace($p,"",$row_child->agdt_edit)."</div></td>";
				echo "</tr>";
				echo "<tr><td>&nbsp;</td></tr>";
				echo "</table>";
			}
			
			$sum = $num1 + $num2 + $num3 + $num4;
			if($sum == 4)
			{
				//echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- ไม่มี -<br/>";
			}
			
			echo "</span>";
			
			if($row_child->child->num_rows()>0){
				re_viewAgdt($row_child->child,$no_send,$rs_file,$mt_mts_id,$txt);
			}
			?>
		</div>
		<?php
		}
		?>
<?php
}
Пример #3
0
function re_viewAgdt($child, $no=0, $ck_edit=0, $cms_id, $rs_file, $magap, $psId, $mtsId, &$ck_result){
	$str_agd = "วาระที่ ";
	$str_detail = "รายละเอียด";
	$str_by = "เสนอโดย";
	$str_present = "ประเด็นเสนอ";
	$str_result = "มติ";
	$str_edit = "สิ่งที่ต้องแก้ไข";
	$str_file = "เอกสารแนบ";
	$no_send = "";
	
	// Image Loader
	$load = array(
		"src" => "images/emeeting/loadera16.gif",
		"width" => "16",
		"border" => "0"
	);
	$imgLoad = img($load);
	
	// 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);
	
	?>
	<ul class="sortable" >
		<?php
		$i = 0;
		foreach($child->result() as $row_child){
		?>
		<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;
			}
			else
			{
				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><a href="'.base_url().'uploads/emeeting/docs/'.$row_file->agfl_nname.'" target="_blank" >- '.$row_file->agfl_oname.'</a></li>';
				}
				echo "</ul><br/>";
			}
			
			// Present
			if($row_child->agdt_present != "")
			{
				echo "<b><u>".$str_present."</u></b>";
				echo $row_child->agdt_present;
			}
			
			/*if($row_child->agdt_flag_extra == 9 && $row_child->agdt_edit != "")
			{
				echo "<b><u>".$str_edit."</u></b>";
				echo $row_child->agdt_edit;
			}*/
		
			// Result
			if($mtsId >= 25 && $row_child->agdt_result != "")
			{
				$ck_result = 1;
				echo "<b><u>".$str_result."</u></b>";
				echo $row_child->agdt_result;
				
				$rs_agap = $magap->getByAgdtIdAndPsId($row_child->agdt_id,$psId);
				if($rs_agap->num_rows() > 0){
					if($rs_agap->row()->agap_status == "Y"){
						$checked = "checked";
					} else {
						$checked = "";
					}
					$agap_note = $rs_agap->row()->agap_note;
				} else {
					$checked = "";
					$agap_note = "";
				}
				
			?>
				<br/><div style="width:750px;border:1px solid #CCC;padding:5px 5px 5px 5px;">
				<input type="checkbox" name="approvelist_<?php echo $row_child->agdt_id; ?>" class="approvelist_<?php echo $row_child->agdt_id; ?>" value="" <?php echo $checked; ?> onclick="approveList(this.checked, '<?php echo $row_child->agdt_id; ?>')" style="width:20;"><b>รับรองมติ</b>
				&nbsp;&nbsp;&nbsp;<b>หมายเหตุ (ถ้ามี) : </b><input type="text" name="approveNotelist_<?php echo $row_child->agdt_id; ?>" class="approveNotelist_<?php echo $row_child->agdt_id; ?>" value="<?php echo $agap_note; ?>" style="width:300;">
				&nbsp;&nbsp;&nbsp;<input type="button" name="btnApprovelist_<?php echo $row_child->agdt_id; ?>" value="บันทึก" onclick="apprNotelist('<?php echo $row_child->agdt_id; ?>')" style="width:70;">
				&nbsp;<span class="load_<?php echo $row_child->agdt_id; ?>" style="display:none;"><?php echo $imgLoad; ?></span>
				<span class="yes_<?php echo $row_child->agdt_id; ?>" style="display:none;"><?php echo $imgOK; ?></span>
				<span class="ok_<?php echo $row_child->agdt_id; ?>" style="display:none;color:green;"><?php echo $imgOK; ?>รับรองมติ</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>
				</div><br/>
			<?php
			}
			
			echo "</div></span>";
			
			if($row_child->child->num_rows()>0){
				re_viewAgdt($row_child->child,$no_send,$ck_edit,$cms_id,$rs_file,$magap,$psId,$mtsId,$ck_result);
			} 
			?>
		</li>
		<?php
			if($row_child->agdt_level == 0){
				echo "<hr />";
			}
		}
		?>
	</ul>
<?php
}
Пример #4
0
function re_viewAgdt($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->agdt_id; ?>">
			<?php
			echo "<span class=\"string\">";
			$i = $i + 1;
			if($row_child->agdt_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->agdt_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_viewAgdt($row_child->child,$no_send);
			}
			?>
		</li>
		<?php
		}
		?>
	</ul>
	<?php
	}
Пример #5
0
function re_viewAgdt($child, $no=0, $rs_file, $rs_agap, $qu_apprv, &$ck_result){
	$str_agd = "วาระที่ ";
	$str_detail = "รายละเอียด";
	$str_by = "เสนอโดย";
	$str_present = "ประเด็นเสนอ";
	$str_result = "มติ";
	$str_edit = "สิ่งที่ต้องแก้ไข";
	$str_file = "เอกสารแนบ";
	$no_send = "";
	
	// Image Loader
	$load = array(
		"src" => "images/emeeting/loadera16.gif",
		"width" => "16",
		"border" => "0"
	);
	$imgLoad = img($load);
	
	// 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);
	
	echo "<ul class=\"sortable\" >";
	
		$i = 0;
		foreach($child->result() as $row_child){
		
			echo "<li id=\"{$row_child->agdt_id}\" name=\"{$row_child->agdt_id}\" >";
				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;
				}
				else
				{
					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><a href="'.base_url().'uploads/emeeting/docs/'.$row_file->agfl_nname.'" target="_blank" >- '.$row_file->agfl_oname.'</a></li>';
					}
					echo "</ul><br/>";
				}
				
				// Present
				if($row_child->agdt_present != "")
				{
					echo "<b><u>".$str_present."</u></b>";
					echo $row_child->agdt_present;
				}
			
				// Result
				if($row_child->agdt_result != "")
				{
					$ck_result = 1;
					echo "<b><u>".$str_result."</u></b>";
					echo $row_child->agdt_result;
					
					$agap_appv_id = 0;
					$agap_note = "";
					if($rs_agap->num_rows() > 0){
						foreach($rs_agap->result() as $row_agap){
							if($row_agap->agap_agdt_id == $row_child->agdt_id){
								$agap_appv_id = $row_agap->agap_appv_id;
								$agap_note = $row_agap->agap_note;
								break;
							}
						}
					}
					
					// display approve checked 
					if($qu_apprv->num_rows() > 0){
						// init name to check invalid
						$appv_name_2 = "";
						echo "<br /><div style=\"width:75%;border:1px solid #CCC;padding:5px 5px 5px 5px;\" >";
						foreach($qu_apprv->result() as $row_appv){
							$checked = "";
							if($row_appv->appv_id == $agap_appv_id){
								$checked = "checked";
							}
							
							
							echo "<input type=\"radio\" name=\"approvelist_{$row_child->agdt_id}\" class=\"approvelist_{$row_child->agdt_id} approveAll_{$row_appv->appv_id}\" value=\"{$row_appv->appv_id}\" {$checked} onclick=\"approveList('{$row_appv->appv_id}', '{$row_child->agdt_id}')\" style=\"width:20px;margin:10px; 0px; 10px; 20px;\">{$row_appv->appv_name}";
							
							if($row_appv->appv_flag_note == 'Y'){
								// get name to check invalid
								$appv_name_2 = $row_appv->appv_name;
								echo " ดังนี้";
							}
							
							// display save for each appv_id
							echo "<span class=\"load_{$row_child->agdt_id} loadAppv_{$row_child->agdt_id}_{$row_appv->appv_id}\" style=\"margin-left:20px;display:none;\">{$imgLoad}</span>";
							echo "<span class=\"ok_{$row_child->agdt_id} okAppv_{$row_child->agdt_id}_{$row_appv->appv_id}\" style=\"margin-left:20px;display:none;color:green;\">{$imgOK}</span>";
							
							echo "<br />";	//ckeditor
							if($row_appv->appv_flag_note == 'Y'){
								echo "<div style=\"margin-left:40px;width:90%;align:left;margin-bottom:5px;\" >";
								echo "<textarea name=\"approveNotelist_{$row_child->agdt_id}\" class=\"approveNotelist_{$row_child->agdt_id}\" style=\"resize:none;\" rows=\"5\" cols=\"80%\" >{$agap_note}</textarea>";
								echo "</div><br />";
								echo "<input type=\"button\" class=\"da-button green\" name=\"btnApprovelist_{$row_child->agdt_id}\" value=\"บันทึก\" id=\"{$row_child->agdt_id}\" style=\"width:70px;margin-bottom:10px;margin-left:250px;\" >";
								//onclick=\"apprvNotelist('{$row_child->agdt_id}')\"
								
								// display save for note
								echo "<span class=\"loadNote_{$row_child->agdt_id}\" style=\"margin-left:40px;display:none;\">{$imgLoad}</span>";
								echo "<span class=\"okNote_{$row_child->agdt_id}\" style=\"margin-left:40px;display:none;color:green;\">{$imgOK}&nbsp;บันทึกข้อมูลเรียบร้อย</span>";
								echo "<br />";
								
								// display save for check valid
								echo "<div style=\"margin-left:40px;\" >";
								echo "<span class=\"invalid_{$row_child->agdt_id}\" style=\"display:none;color:red;\">{$imgCancel}&nbsp;กรุณาเลือก{$appv_name_2}</span>";
								echo "</div>";
							}
						}
						echo "</div><br />";
					}
				}
				
				echo "</div></span>";
				
				if($row_child->child->num_rows()>0){
					re_viewAgdt($row_child->child, $no_send, $rs_file, $rs_agap, $qu_apprv, $ck_result);
				} 
				
			echo "</li>";
			if($row_child->agdt_level == 0){
				echo "<hr />";
			}
		}
	echo "</ul>";
}