<?php
#### สคริ๊ปนี้ใช้ในการเช็ค ว่าล็อกอินหรือยัง ให้นำสคริ๊ปนี้ไปไว้ที่หน้าที่คุณต้องการให้เช็ค ####
session_start() ;
if(!session_is_registered("login_true")) {
//  url=index.php คำสั่งนี้จะให้ไปหน้าที่จะต้องกรอก user,pwd ถ้าอยู่โฟล์เดอร์อื่นให้เรียกให้ถูกนะครับ
echo "<meta http-equiv='refresh' content='0;url=index.php'>" ; 
exit() ;
}
### จบการเช็ค ###
?>

<html>
<head>

<!-- จาวา แถบสี -->
<script language="javascript"> 
function mOvr(src,clrOver){ 
if (!src.contains(event.fromElement)){ 
src.style.cursor = 'hand'; 
src.bgColor = clrOver; 
} 
} 
function mOut(src,clrIn){ 
if (!src.contains(event.toElement)){ 
src.style.cursor = 'default'; 
src.bgColor = clrIn; 
} 
} 
</script> 

<title>สวัสดีครับสมาชิกใหม่ และ สมาชิกเก่าทุกๆท่าน</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
</head>

<body bgcolor="#000000" text="#FFFFFF" link="#FFCC99" vlink="#FF9900" alink="#FFCC00" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="775" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <tr> 
    <td height="40" valign="middle" bgcolor="#0066CC"><img src="image/h1.jpg" width="775" height="40"></td>
  </tr>
  <tr> 
    <td height="80"><img src="image/h2.jpg" width="775" height="94"></td>
  </tr>
  <tr> 
    <td height="20" bgcolor="#292001"><img src="image/h3.jpg" width="775" height="40"></td>
  </tr>
</table>
<table width="775" height="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="194" valign="top" bgcolor="#000000"> 
      <div align="center"><br>
        <script language="JavaScript">
function check() {
if(document.checkForm.user_login.value=="") {
alert("กรุณากรอกชื่อที่ใช้ในการล็อกอินด้วยครับ") ;
document.checkForm.user_login.focus() ;
return false ;
}
else if(document.checkForm.pwd_login.value=="") {
alert("กรุณากรอกรหัสผ่านด้วยครับ") ;
document.checkForm.pwd_login.focus() ;
return false ;
}
else
return true ;

}
        </script>
        <br>
  <table width="180" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#000000">
          <tr> 
            <td height="20" background="image/tabmenu.gif"> 
              <div align="center"><img src="image/mem_gold.gif" width="22" height="15" align="absmiddle"> 
                <strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">มุมสมาชิก 
            </font></strong></div></td>
          </tr>
          <tr> 
<a href="../home.php">
      <td height="20" bgcolor="#663300" onmouseover='mOvr(this,"888855");' onmouseout='mOut(this,"#663300");'> 
            <div align="center"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">www.thongbai.com</font></div></td>
</a>  
 </tr>

          <tr> <a href="member_edit.php">
            <td height="20" bgcolor="#663300" onmouseover='mOvr(this,"888855");' onmouseout='mOut(this,"#663300");'> 
            <div align="center"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">แก้ไขรายละเอียด</font></div></td>
          </a>
</tr>
          <tr> 
<a href="change_pwd.php">
            <td height="20" bgcolor="#663300" onmouseover='mOvr(this,"888855");' onmouseout='mOut(this,"#663300");'> 
            <div align="center"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">เปลี่ยนรหัสผ่าน</font></div></td>
         </a>
 </tr>
 <tr>
<a href="forget_pwd.php">
            <td height="20" bgcolor="#663300" onmouseover='mOvr(this,"888855");' onmouseout='mOut(this,"#663300");'><div align="center"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">ลืมรหัสผ่าน</font></div></td>
        </a>  </tr>
        </table>      <p>&nbsp;</p>
        <p>&nbsp;</p>
    </div></td>
    <td width="10">&nbsp;</td>
    <td width="576" valign="top"><div align="center"><br>
        <img src="image/member_important.gif" width="200" height="50"> 
        <?php
include("config.inc.php") ;
mysql_select_db($db) ;


mysql_query("SET character_set_results=tis620");
mysql_query("SET character_set_client=''tis620''");
mysql_query("SET character_set_connection=''tis620''");
mysql_query("collation_connection = tis620_thai_ci");
mysql_query("collation_database = tis620_thai_ci");
mysql_query("collation_server = tis620_thai_ci");
 
@mysql_select_db($db) or die( "Unable to select database");
mysql_db_query($db,"SET NAMES tis620");// 

$result = mysql_query("select * from member where user='$login_true'") or die ("Err Can not to result") ;
$dbarr = mysql_fetch_array($result) ;


?>
        <br>
        <table width="575" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr> 
            <td align="center"><div align="center"> 
                <p><font color="#ffffff" size="2" face="MS Sans Serif, Tahoma, sans-serif"><strong><img src="image/w1.gif" width="19" height="19" align="absmiddle"> 
                  สวัสดีครับคุณ &nbsp;<?php echo $dbarr['name'] ; ?>&nbsp;<img src="image/w1.gif" width="19" height="19" align="absmiddle"></strong></font><font size=2><strong>สถานะ</strong>
                  <?php 
					if($dbarr['member_level'] ==0) {
					     echo "<font color=ffff88>สมาชิกใหม่</font>";
					}elseif($dbarr['member_level'] ==1) {
					     echo "<font color=ffff88>สมาชิกทั่วไป</font>";				
					}elseif($dbarr['member_level'] ==2) {
					     echo "<font color=ffff88>สมาชิกVIP</font>";								
					}
					?>
                  </font></p>
              </div>
              <div align="left"> 
                <p align="center"><img src="image/great.gif" width="13" height="11"> <strong><font color="#FF9900" size="3" face="MS Sans Serif, Tahoma, sans-serif">รายละเอียดส่วนตัวของคุณ 
                  </font></strong><font color="#FF9900" size="3" face="MS Sans Serif, Tahoma, sans-serif"></font></p>
              </div>
                <div align="left">
                  
                <table border="0" align="center" cellpadding="3" cellspacing="0">
                  <tr> 
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">ชื่อ-นามสกุล 
                      </font></strong></td>
                    <td><div align="left"></div>
                      <font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['name'] ; ?></font></td>
                    <td colspan="2"> <font face="MS Sans Serif, Tahoma, sans-serif"><font size="2"></font></font></td>
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">หมายเลขสมาชิก</font></strong></td>
                    <td><div align="left"></div>
                      <font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['member_id'] ; ?></font></td>
                  </tr>
                  <tr> 
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">วัน/เดือน/ปีเกิด</font></strong></td>
                    <td><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['date']."/".$dbarr['month']."/".$dbarr['year']  ; ?></font></td>
                    <td colspan="2"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">&nbsp;</font></td>
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">อายุ</font></strong></td>
                    <td><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['age'] ; ?></font></td>
                  </tr>
                  <tr> 
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">เพศ</font></strong></td>
                    <td><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['sex'] ; ?></font></td>
                    <td colspan="2"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">&nbsp;</font></td>
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">email</font></strong></td>
                    <td><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['email'] ;?></font></td>
                  <tr> 
                    <td colspan="6"><div align="center"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">..............................................................................................................................................</font></div></td>
                  <tr> 
                    <td colspan="6" align="center"><p><img src="image/home0.gif" width="16" height="15"> 
                        <font color="#0000FF" size="3" face="MS Sans Serif, Tahoma, sans-serif"><font color="#FFFF99"><strong>ที่อยู่ในการติดต่อ</strong></font> 
                        <br>
                        <br>
                        </font></p></td>
                  </tr>
                  <tr> 
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">บ้านเลขที่ 
                      </font></strong></td>
                    <td colspan="5"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['address'] ; ?></font></td>
                  </tr>
                  <tr> 
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">อำเภอ</font></strong></td>
                    <td colspan="5"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['amper'] ; ?></font></td>
                  </tr>
                  <tr> 
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">จังหวัด</font></strong></td>
                    <td><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['province'] ; ?></font></td>
                    <td width="50">&nbsp;</td>
                    <td><div align="left"><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">รหัสไปรษณีย์</font></strong></div></td>
                    <td colspan="2"><div align="left"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['zipcode'] ; ?></font></div></td>
                  </tr>
                  <tr> 
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">เบอร์โทรศัพท์</font></strong></td>
                    <td colspan="5"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['phone'] ;?></font></td>
                  </tr>
                  <tr> 
                    <td><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">การศึกษา</font></strong></td>
                    <td><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['education'] ; ?></font></td>
                    <td>&nbsp;</td>
                    <td><div align="left"><strong><font color="#FFCC00" size="2" face="MS Sans Serif, Tahoma, sans-serif">อาชีพ</font></strong></div></td>
                    <td colspan="2"> <div align="left"><font size="2" face="MS Sans Serif, Tahoma, sans-serif">:<?php echo $dbarr['work'] ; ?></font></div></td>
                  </tr>
                </table>
                <p align="center"><a href="logout.php"><img src="image/logout.gif" width="58" height="22" border="0" align="absbottom"></a> 
                  &nbsp;&nbsp; <img src="image/rubble.gif" width="18" height="18" align="absbottom"><font size="2" face="MS Sans Serif, Tahoma, sans-serif"><a href="member_edit.php">แก้ไขรายละเอียด</a></font></p>
              </div>
           
              <div align="left"></div>
              <div align="left"></div>
              <div align="center"></div>
            <div align="center"></div></td>
          </tr>
        </table>
    <p></p></div></td>
  </tr>
</table>
</body>
</html>
