<?php htmltage("ເອກະສານໃໝ່"); 
/*-------- Check if user not have permission ---------------- kong*/
// the I fixed role access app -- if you change info in table app you should check this again ==>> kong
if (strlen(session_id()) < 1)  session_start();
if(!isset($_SESSION['sys_id'])) header("Location: ?d=index");

			$ptn_id = $_SESSION['position_id'];
			$user_role = $_SESSION['role_id'];
			$orgunitid = $_SESSION['orgunitid_r'];
		}
		$cnt++;
	}
}
if($user_role == 1){
	unset($_SESSION['tmp_doc_pop']);
	header("Location: ?d=index");
}
?>
<div class="contentpage">
<div id="dialogparent_poplog">
<div class="mask"></div>
<div id="dialog_poplog">
	<h1 class="h1">ມີເອກະສານຂາເຂົ້າມາໃໝ່</h1>
	
<div class="contentpage">
<div class="indexpage centered">
	<h3>ຈໍານວນ ເອກະສານເຂົ້າໃໝ່ <?php if($user_role != 1){ echo " ".$_SESSION['sys_user'][0]['name'];} ?></h3>
	<ul class="titles">
		<?php
		
			$docnum = num_doc();
			$rs_docin = mysql_fetch_array($docnum);
		?>
		<?php if($ptn_id == 1 || $ptn_id ==2){ ?>
			<a href="?d=document/list_docin/confirm_doc_head&position_id=<?=$rs_docin['position_id']?>&status=1"><li><label><?php  if($rs_docin["num"] != ""){ echo $rs_docin["num"];}else{echo "0";}?></label>
		<?php }elseif($ptn_id == 3 || $ptn_id == 4){ ?>
			<a href="?d=document/list_docin/confirm_doc&orgunitid=<?=$rs_docin['orgunitid']?>&status=1"><li><label><?php  if($rs_docin["num"] != ""){ echo $rs_docin["num"];}else{echo "0";}?></label>
		<?php }else{ ?>
			<a href="?d=document/list_docin/confirm_doc_emp&orgunitid=<?=$rs_docin['orgunitid']?>&status=1"><li><label><?php  if($rs_docin["num"] != ""){ echo $rs_docin["num"];}else{echo "0";}?></label>
		<?php } ?>
            <img src="img/doc_num_in.png" /><div class="titlenames"></div></li></a>	
		
	</ul>
	</div>
		
</div>
</div>
</div>
</div>
