<?php	
/** ensure this file is being included by a parent file */
defined( '_VALID_' ) or die( 'Direct Access to this location is not allowed.' );

$sql_permission = "select * from  bookpv_permission where person_id='$_SESSION[login_user_id]'";
$dbquery_permission = mysqli_query($connect,$sql_permission);
$result_permission = mysqli_fetch_array($dbquery_permission);

if(!isset($_SESSION['admin_bookpv'])){
$_SESSION['admin_bookpv']="";
}

echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"; 
echo "<tr bgcolor='#FFCC00'><td>";
echo "<ul id='nav' class='dropdown dropdown-horizontal'>";
	echo "<li><a href='./'>รายการหลัก</a></li>";
	if($_SESSION['admin_bookpv']=="bookpv"){
	echo "<li><a href='?option=bookpv' class='dir'>ตั้งค่าระบบ</a>";
		echo "<ul>";
			echo "<li><a href='?option=bookpv&task=permission'>กำหนดเจ้าหน้าที่</a></li>";
			echo "<li><a href='?option=bookpv&task=main/sync_code'>ข้อมูลเชื่อมระบบ PMSS</a></li>";
		echo "</ul>";
	echo "</li>";
	}
	
if(($result_permission['p1_book']==1) and ($_SESSION['login_status']<=4)){
	echo "<li><a href='?option=bookpv&task=main/receive' class='dir'>รับหนังสือ</a>";
		echo "<ul>";
			echo "<li><a href='?option=bookpv&task=main/receive'>รับหนังสือ</a></li>";
			echo "<li><a href='?option=bookpv&task=main/receive_register'>รับหนังสือพร้อมลงทะเบียน</a></li>";
		echo "</ul>";
	echo "</li>";
}
else if($_SESSION['login_status']<=4){
	echo "<li><a href='?option=bookpv&task=main/receive_other' class='dir'>รายการหนังสือรับ</a>";
		echo "<ul>";
			echo "<li><a href='?option=bookpv&task=main/receive_other'>รายการหนังสือรับ ศธจ.</a></li>";
		echo "</ul>";
	echo "</li>";
}	
	
if(($result_permission['p2_book']==1) and ($_SESSION['login_status']<=4)){
	echo "<li><a href='?option=bookpv&task=main/send' class='dir'>ส่งหนังสือ</a>";
		echo "<ul>";
			echo "<li><a href='?option=bookpv&task=main/send'>ส่งหนังสือ ศธจ.</a></li>";
		echo "</ul>";
	echo "</li>";
}

if($_SESSION['login_status']<=4){
	echo "<li><a href='?option=bookpv&task=main/send_report' class='dir'>รายการหนังสือส่ง</a>";
		echo "<ul>";
			echo "<li><a href='?option=bookpv&task=main/send_report'>รายการหนังสือส่ง ศธจ.</a></li>";
		echo "</ul>";
	echo "</li>";
}
	echo "<li><a href='?option=bookpv' class='dir'>คู่มือ</a>";
		echo "<ul>";
				//echo "<li><a href='modules/bookpv/manual/bookpv.pdf' target='_blank'>คู่มือ</a></li>";
		echo "</ul>";
	echo "</li>";
echo "</ul>";
echo "</td></tr>";
echo "</table>";
?>
