<?php 
session_start();

$userID=$_SESSION['sess_userid'];
include('connectsmss.php');  //ไฟล์เชื่อมต่อกับ database ที่เราได้สร้างไว้ก่อนหน้า

if($userID<>""){
$sql_user="select * from adminuser where admin_id = $userID";
$result2 = mysqli_query($con, $sql_user); 
$row2 = mysqli_fetch_array($result2);
$emp_name=$row2["admin_name"];
$error=0;
}else{
   $error=1;
}
?>
<meta charset="UTF-8">
<HTML>
<HEAD>
<title>admin zone to Edit Content</title>
<link href="https://fonts.googleapis.com/css?family=Kanit" rel="stylesheet">

<script language="JavaScript"> 
 
        function highlight(field) { 
         field.focus(); 
         field.select(); 
		}
</script>

<STYLE TYPE="text/css">
        <!--
        A:link {color:"#0000ff";text-decoration:none;}
        A:visited {color:"#0000ff";text-decoration:none;}
        A:hover {color:"FF0000";text-decoration:underline;}
        TD {font-family:Arial;font-size:14;}
        P {font-family:MS Sans Serif,CordiaUPC; }
		 H3 {color:"#3333FF";font-family:MS Sans Serif,CordiaUPC; }
		
textarea {
width: 80%;
    padding: 12px 20px;
    box-sizing: border-box;
	font-size: 16;
	color:#0033cc;
    border: 2px solid #ccc;
    border-radius: 4px;
    background-color: #f8f8f8;
    resize: none;
}
        -->
        </STYLE>
<title>Admin::Reader Club Somdejprayansungworn School</title>
<LINK href="userstyle.css" rel="stylesheet" type="text/css">
	<Script Language=JavaScript>
if(document.images)
{
	im0=new Image();
	im0.src="Butt/bbutt01.jpg";
	im1=new Image();
	im1.src="Butt/bbutt02.jpg";
	im2=new Image();
	im2.src="Butt/bbutt03.jpg";
	im3=new Image();
	im3.src="Butt/bbutt04.jpg";
	im4=new Image();
	im4.src="Butt/bbutt05.jpg";
	im5=new Image();
	im5.src="Butt/bbutt06.jpg";
	im6=new Image();
	im6.src="Butt/bbutt07.jpg";
	im7=new Image();
	im7.src="Butt/bbutt08.jpg";
	im8=new Image();
	im8.src="Butt/bbutt09.jpg";

	im0a=new Image();
	im0a.src="Butt/gbt01.jpg";
	im1a=new Image();
	im1a.src="Butt/gbt02.jpg";
	im2a=new Image();
	im2a.src="Butt/gbt03.jpg";
	im3a=new Image();
	im3a.src="Butt/gbt04.jpg";
	im4a=new Image();
	im4a.src="Butt/gbt05.jpg";
	im5a=new Image();
	im5a.src="Butt/gbt06.jpg";
	im6a=new Image();
	im6a.src="Butt/gbt07.jpg";
	im7a=new Image();
	im7a.src="Butt/gbt08.jpg";
	im8a=new Image();
	im8a.src="Butt/gbt09.jpg";


}

function msOver(num)
{
	if(document.images)
	{
		if(num==1)
		document.images[num].src=im0.src;
		else if(num==2)
		document.images[num].src=im1.src;
		else if(num==3)
		document.images[num].src=im2.src;
		else if(num==4)
		document.images[num].src=im3.src;
		else if(num==5)
		document.images[num].src=im4.src;
		else if(num==6)
		document.images[num].src=im5.src;
		else if(num==7)
		document.images[num].src=im6.src;
		else if(num==8)
		document.images[num].src=im7.src;
		else if(num==9)
		document.images[num].src=im8.src;
       	
	}
}
function msOut(num)
{
	if(document.images)
	{
		if(num==1)
		document.images[num].src=im0a.src;
		else if(num==2)
		document.images[num].src=im1a.src;
		else if(num==3)
		document.images[num].src=im2a.src;
		else if(num==4)
		document.images[num].src=im3a.src;
		else if(num==5)
		document.images[num].src=im4a.src;
		else if(num==6)
		document.images[num].src=im5a.src;
		else if(num==7)
		document.images[num].src=im6a.src;
		else if(num==8)
		document.images[num].src=im7a.src;
		else if(num==9)
		document.images[num].src=im8a.src;
		       	
	}

}
</script>

<script language=JavaScript>
function check_b_id(subj_id){
HttPRequest = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
HttPRequest = new XMLHttpRequest();
 if (HttPRequest.overrideMimeType) {
 HttPRequest.overrideMimeType('text/html');
 }
} else if (window.ActiveXObject) { // IE
 try {
 HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
  HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e) {}
 }
}

if (!HttPRequest) {
alert('Cannot create XMLHTTP instance');
return false;
}

var url = 'checksubject.php';
var pmeters ="subj_id="+subj_id;
HttPRequest.open('POST',url,true);
HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
HttPRequest.setRequestHeader("Content-length", pmeters.length);
HttPRequest.setRequestHeader("Connection", "close");
if(subj_id!=""){
HttPRequest.send(pmeters);
}else{
document.getElementById("subj_id").className=""
document.getElementById("err_user_same").style.display="none"
}

 HttPRequest.onreadystatechange = function(){
  if(HttPRequest.readyState == 4) // Return Request
  {
   if(HttPRequest.responseText==0){
    document.getElementById("subj_id").className=""
    document.getElementById("err_user_same").style.display="none"
   }else{
    document.getElementById("subj_id").focus()
    document.getElementById("subj_id").className="errtext"
    document.getElementById("err_user_same").style.display=""
   }
  }
 }
}
</script>


<style>
.button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 8px 8px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
	font-family: 'Kanit', sans-serif;
    font-size: 18px;
    margin: 4px 2px;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
    cursor: pointer;
}
.butt {
	border-radius: 8px;
    color: #ffffff; 
    border: 2px solid #336600;
	background-color: #33cc00; /* Green */
    padding: 3px 3px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
    cursor: pointer;
}
.butt:hover {
    background-color: #ffff66;
    color: #ff0000;
}

.button1 {
    background-color: white; 
	border-radius: 8px;
    color: black; 
    border: 2px solid #4CAF50;
}

.button1:hover {
    background-color: #4CAF50;
    color: white;
}

.button2 {
    background-color: white; 
	border-radius: 8px;
    color: black; 
    border: 2px solid #008CBA;
}

.button2:hover {
    background-color: #008CBA;
    color: white;
}

.button3 {
    background-color: white; 
	border-radius: 8px;
    color: black; 
    border: 2px solid #f44336;
}

.button3:hover {
    background-color: #f44336;
    color: white;
}

.button4 {
    background-color: #66ff00;
	border-radius: 8px;
    color: black;
    border: 2px solid #339900;
}

.button4:hover {background-color: #00ffff;}

.button5 {
    background-color: #0066ff;
	border-radius: 8px;
    color: black;
    border: 2px solid #000099;
}

.button5:hover {
    background-color: #ff6633;
    color: white;
	border: 2px solid #ffff33;
}
</style>
<style>
input[type=text], select {
    padding: 8px 8px;
    margin: 8px 0;
	font-family: 'Kanit', sans-serif;
	font-size:18px;
    color: #339900;
	display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
TD {
	font-family: 'Kanit', sans-serif;
	font-size:18px;
    color: #990033;
}

input[type=password] {
    width: 100%;
    background-color: #ffffff;
	font-family: 'Kanit', sans-serif;
	font-size:18px;
    color: #000099;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.Round1 {
    border-radius: 5px;
    background-color: #f2f2f2;
    padding: 20px;
}
.Round2 {
    border-radius: 5px;
    background-color: #00ccff;
    padding: 3px;
}
.Round3 {
    border-radius: 5px;
    background-color: #ffffff;
    padding: 3px;
	border: 2px solid #0099ff;
}

</style>

</HEAD>
<BODY onLoad='highlight(bookRent.BookID);'  TOPMARGIN="0" LEFTMARGIN="5" MARGINWIDTH="0" MARGINHEIGHT="0" BGCOLOR="#FFFFFF">
<CENTER>
<table id="Table_01" width="933"  border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<img src="images/social-logo_01.jpg"  alt=""></td>
	</tr>
	<tr>
		<td>
		<DIV class="Round3">
		<DIV align=right class="font_user">
<?php
      echo  "user:$emp_name[<A href=\"logout.php\">ออกจากระบบ</A>]--";

?>
<center>
<TABLE width=1000  border=0 cellspacing=0 cellpadding=0 >
<TR><TD COLSPAN=3 ALIGN=CENTER BGCOLOR="#FFFFFF" >
</TD></TR></TABLE>


