<?php 
htmltage("ລະດັບຊັ້ນຕໍາແໜ່ງ");
?>
<div class="contentpage">
	<h1 class="headtitle">ໂຄງຮ່າງການຈັດຕັ້ງ ຂອງ ພະແນກ ໄອຊີທີ / ຄຣິກເພື່ອເພີ່ມ</h1>
	<div class="searchbox">
	<form method="get">
		<input type="hidden" name="d" value="manage/manage_emp" />
		<!--
		<table class="">
			<tr>
				<td>ຄົ້ນຫາ: </td>
				<td><input type="text" name="orgunitname" placeholder="ຊື່ຊັ້ນຕໍາແໜ່ງ (ລາວ)" size="30" value="<?//= $_GET['orgunitname'] ?>" /></td>
				<td><input type="submit" value="Search" class="btn2" /><input type="reset" value="Reset" class="btn2" 
                onclick="document.location='?d=manage/manage_emp'"  /></td>
			</tr>
		</table>
		-->
	</form>
	</div>
	
<!-- The table Select From -->

<?php if ($eqcount == 0) { ?>
	<div class="centered messagebox">
		<p class="errormessage">ບໍ່ພົບລາຍການ, ກະລຸນາປ້ອນລະດັບຊັ້ນຂອງອົງກອນໃຫ້ຄົບຖ້ວນກ່ອນ</p>
	</div>	 	
<?php } else { ?>	  <?}?>  
<h4><?//=$pagedescription ?></h4>
<form method="post" id="frmmanage_emp" action="?d=manage/manage_emp">
	<table class="flowchar_a">
		<!--
		<tr>
			<th class="centered" colspan = "5"><a href="?d=staff/staff&parent_id=0"><li>ບໍ່ຂື້ກັບໃຜ (ຫົວໜ້າພະແນກ)</li></a></th>
		</tr>
		-->
		<tr>
			<?php $rs_m = mysql_fetch_array($manager); ?>
			<th class="centered" colspan = "5"><a href="?d=staff/staff&parent_id=<?=$rs_m['orgunitid'] ?>"><li><?=$rs_m['orgunitname'] ?></li></a></th>
		</tr>
		<tr class = "section">
		<?php 
		$rs_sec = section($rs_m['orgunitid']);
		$arr_sec_id = array();
		while ($rs_s = mysql_fetch_array($rs_sec)) {	
		?>
			<?php echo "<td><a href='?d=staff/staff&parent_id=$rs_s[orgunitid]'><li>$rs_s[orgunitname]</li></a></td>"?>
		<?php
		$arr_sec_id[] = $rs_s['orgunitid'];
		}
		?>
		</tr>
		<tr >
		<?php
		foreach($arr_sec_id as $key => $sec_id){
			$rs_unit = unit($sec_id);
			?>
			<td><div id="unit_chart"><ol>
			<?php
			while ($rs_u = mysql_fetch_array($rs_unit)) { ?>
			
				<?php echo "<a href='?d=staff/staff&parent_id=$rs_u[orgunitid]'><li>$rs_u[orgunitname]</li></a> <br />"?>	
			
			<?php $i++; } 
			?>
			</ol></div></td>
			<?php
		} ?>
		</tr>
	</table>
	<?php if($_SESSION['role_id'] ==1){ ?>
	<!---
	<div class="menubox">		
		<input type="button" id="addEq" class = "btn2" value="  &#3776;&#3742;&#3765;&#3784;&#3745;  " />
		<input type="button" id="reset" class = "btn2" value="  &#3725;&#3771;&#3713;&#3776;&#3749;&#3765;&#3713;  " />
		<input type="submit" class = "btn2 right" value="  &#3738;&#3761;&#3737;&#3735;&#3766;&#3713;  "  id="right" onclick="return confirm('ທ່ານຕ້ອງການບັນທຶກແທ້ບໍ...?')"/>
	</div>
	-->
	<? }?>

</form>
<div class="paging">
<?php
/*
	if ($pagecount > 1){
		if ($pagenum > 1) echo "<a href='?d=manage/manage_emp&$params&start=".(($pagenum-2)*$pagesize)."' $isselected>&lt; ກັບຄືນ</a>";
		for ($i = 0; $i < $pagecount; $i++){
			if ($i == $pagenum-1) $isselected = "class='selected'";
			else $isselected = "";
			echo "<a href='?d=manage/manage_emp&$params&start=".($i*$pagesize)."' $isselected>".($i+1)."</a>";
		}
		if ($pagenum < $pagecount) echo "<a href='?d=manage/manage_emp&$params&start=".($pagenum*$pagesize)."' $isselected>ຕໍ່ໄປ  &gt;</a>";
	}
*/
?>
</div>
</div>
