<? session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title><?=$CFG->title?></title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link href="css/style-main.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="includes/javascript.js"></script>
<script language="javascript" src="includes/jquery.js"></script>
<link rel="stylesheet" href="Files/jquery.ui.all.css">
	<script src="Files/jquery-1.4.4.js"></script>
	<script src="Files/jquery.ui.core.js"></script>
	<script src="Files/jquery.ui.widget.js"></script>
	<script src="Files/jquery.ui.datepicker.js"></script>
	<link rel="stylesheet" href="Files/demos.css">
	<script>
	$(function() {
		$( "#datepicker" ).datepicker({
			changeMonth: true,
			changeYear: true
		});
	});
	</script>
   
<style type="text/css">
<!--
.style12 {
	font-size: 16px;
	font-family: BrowalliaUPC, CordiaUPC;
	color: #0099FF;
}
#Layer1 {
	position:absolute;
	left:390px;
	top:37px;
	width:42px;
	height:14px;
	z-index:1;
}
#Layer2 {
	position:absolute;
	left:308px;
	top:26px;
	width:29px;
	height:35px;
	z-index:1;
body {
	background-image: url(images/bg.png);
}

-->
</style><link rel="stylesheet" type="text/css" href="style.css">
<style type="text/css">
<!--
body {
	background-image: url(images/bg.png);
}
-->
</style>
<link rel="stylesheet" media="all" type="text/css" href="pro_dropline_1/pro_dropline_1.css" />
<style type="text/css">
<!--
.style9 {font-family: BrowalliaUPC, CordiaUPC;
	font-size: 20px;
}
a:link {
	color: #990000;
}
.style29 {color: #000000; font-size: 18px;}
.style30 {color: #FFFFFF}
.style37 {
	font-family: BrowalliaUPC, CordiaUPC;
	font-size: 16px;
}
.style40 {
	color: #0099FF;
	font-style: normal;
	font-size: 16px;
	font-family: BrowalliaUPC, CordiaUPC;
}
body,td,th {
	color: #990000;
}
.style43 {font-size: 9px}
.style44 {
	color: #0000FF;
	font-size: 12px;
}
.style47 {color: #FF0000}
.style58 {color: #FF3366}
-->
</style>
</head>

<body>
<table width="884" border="0" align="center" bgcolor="#CCFF00">
  <tr>
    <th width="884" bgcolor="#FFFFFF" scope="row"><div align="left">
      <table width="823" border="0">
        <tr>
          <td width="192" height="83"><img src="mcomputer/images/logo.png" width="192" height="81" /></td>
          <td width="6">&nbsp;</td>
          <td width="585"><table width="200" border="0">
              <tr>
                <td><table width="660" border="0" align="center">
                  <tr>
                    <th width="194" scope="row"><div align="right"><img src="images/guest.gif" width="24" height="22" /></div></th>
                    <td width="43">&nbsp;</td>
                    <td width="40"><div align="center"><img src="images/books_024.gif" width="24" height="24" /></div></td>
                    <td width="31">&nbsp;</td>
                    <td width="38"><div align="center"><img src="images/register.png" width="24" height="24" /></div></td>
                    <td width="26">&nbsp;</td>
                    <td width="24"><div align="center"><img src="images/xToon Icon 63.png" width="24" height="22" /></div></td>
                    <td width="35">&nbsp;</td>
                    <td width="24"><div align="center"><img src="images/icon_search(1).gif" width="24" height="24" /></div></td>
                    <td width="30">&nbsp;</td>
                    <td width="24"><div align="center"><img src="images/AQUA ICONS APPLICATIONS TEXT EDIT.png" width="24" height="24" /></div></td>
                    <td width="29">&nbsp;</td>
                    <td width="30"><div align="center"><img src="images/67.png" width="28" height="28" /></div></td>
                    <td width="34">&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
            </table>            
            <table width="667" border="0">
              <tr>
                <td width="661"><div align="right"><span class="style9"><img src="images/arrow_126.gif" width="9" height="9" /><span class="style29"><a href="?module=Member"> ระบบสมาชิก</a><span class="style30">.....</span><a href="?module=Book">ระบบหนังสือ</a><span class="style30">.....</span><a href="?module=BookBorow">ยืมหนังสือ</a><span class="style30">.....</span><a href="?module=BookSent">คืนหนังสือ</a><span class="style30">.....</span><a href="?module=Search">ค้นหา</a><span class="style30">.....</span><a href="?module=Report">รายงาน</a><span class="style30">........</span><a href="?module=Admin">ผู้ดูแลระบบ</a></span> <img src="images/arrow_126.gif" width="9" height="9" /></span></div></td>
              </tr>
            </table>
            </td>
        </tr>
      </table>
    </div></th>
  </tr>
  
  <?	if($user_id  != "" ){
	
	?>
  <tr class="select">
    <th bgcolor="#00CCFF" scope="row"><div id="nav" align="center">
<ul class="select">
  <li class="select"><a href="?module=Member"><b>ระบบสมาชิก</b></a></li>
  <li><a href="?module=Book"><b>ระบบหนังสือ</b></a></li>
<li><a href="?module=BookBorow"><b>&nbsp;ยืมหนังสือ&nbsp;</b></a></li>
<li><a href="?module=BookSent"><b>&nbsp;คืนหนังสือ &nbsp;</b></a></li>
<li><a href="?module=Search"><b>ค้นหา&nbsp;</b></a></li>
<li><a href="?module=Report"><b>รายงาน</b></a></li>
<li><a href="?module=Admin_"><b>ผู้ดูแลระบบ</b></a></li>
</ul>
</div></th>
  </tr> <? }?>
</table>
<table width="882" border="0" align="center" bordercolor="#00CCFF" bgcolor="#CCFF00">
  <tr>
    <th width="763" height="13" bgcolor="#FFFFFF" scope="row"><div align="right">
      <? 

	if($sess_id != session_id() && $user  == "" ){
	
	?>
      <? echo $user?>
      <form id="form1" name="form1" method="post" action="">
        <span class="textstyle3 style44"><span class="style47">@@@--ยินดีต้อนรับทุกคนเข้าสู่ ระบบยืม-คืนออนไลน์--@@@ </span></span><span class="style5"><span class="style43"><span class="style30">.....................</span> </span><img src="images/icon_community.gif" width="20" height="20" /></span><span class="style12">Username</span><span class="style5 style37 style40"> :
          <input name="username" type="text" class="textstyle3" id="username" size="10" maxlength="10" />
        </span><span class="style12">Password</span><span class="style5 style37"> :
          <input name="pass" type="password" class="intro" id="pass" size="10" maxlength="10" />
        </span>
        <input name="login" type="submit" class="textstyle3" id="login" value="LOG IN" />
      </form>
      <span class="login">
       <? }else{ ?>
       <img src="images/check-1.gif" width="15" height="14" /></span><span class="style40">ยินดีต้อนรับ <? echo $user; ?> เข้าสู่ระบบ&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class="style40"><a href="logout.php"><span class="style58">ออกจากระบบ</span> <img src="../New Folder/mcomputer/images/cancel.gif" width="15" height="15" /></a></span><span class="inputtext"><a href="logout.php">
        <? }?>
           </a></span> </div></th>
  </tr>

    <th height="150" bgcolor="#CCFFCC" scope="row"><div align="left">


     
    </div>
      <? include("modules/".$module.".php"); ?>
      <p>
        <? if($login!=""){

		$sql=mysql_query("select * from tbl_admin where username='$username' and password='$pass'");
		$num=mysql_num_rows($sql);
	//	echo $aa ; exit();
		if($num>0){
		$data=mysql_fetch_array($sql);
		session_start();
		$_SESSION['user']=$username;
		$_SESSION['user_id']=$data[id];
		echo "<script>alert('ข้อมูลถูกต้อง $username ยินดีเข้าสู่ระบบ')</script>";
		echo "<script>window.location='index.php'</script>";exit();
		}else{
				echo "<script>alert('คุณกรอกข้อมูลไม่ถูกต้อง')</script>";
		echo "<script>window.location='index.php'</script>";exit();
		}
		}?>
      </p>    </th>
  </tr>
</table>
