Viewing file: StdHealth.php (10.96 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); if (session_is_registered("valid_user")&&session_is_registered("password")&&session_is_registered("Priority")) { $Username = $valid_user; $Password = $password; include("../../../include/FunctionDB.php"); include("../../../include/Function.php"); ConnectDB(); $sql1 = "Select * From student_tb Where Student_id='$Student_id'"; $result1 = mysql_query($sql1) or die(" Error".mysql_error()); $rs = mysql_fetch_array($result1); $sql = "Select * From std_health_tb Where Student_id='$Student_id'"; $result = mysql_query($sql) or die(" Error".mysql_error()); $num = mysql_num_rows($result); ?> <html> <head> <title>Add Student's Health</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link href="../../../css/style1.css" rel="stylesheet" type="text/css"> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } //--> </script> </head>
<body bgcolor="#FFFFFF"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="20%" background="../../../Image/barh.jpg" class="table"> <div align="center"><strong><font size="2" face="Tahoma"><a href="../../Menu_Std_Acc.php" class="d">¡ÅѺ˹éÒËÅÑ¡</a></font></strong></div></td> <td width="20%" background="../../../Image/barh.jpg" class="table"> <div align="center"><font size="2" face="Tahoma"><strong><a href="AddHealthData.php?Student_id=<? echo $rs[Student_id]?>" class="d">à¾ÔèÁ¢éÍÁÙÅ</a></strong></font></div></td> <td width="20%" background="../../../Image/barh.jpg" class="table"> <div align="center"><font size="2" face="Tahoma"><strong><a href="EditHealthList.php?Student_id=<? echo $rs[Student_id]?>" class="d">á¡éä¢</a></strong></font></div></td> <td width="20%" background="../../../Image/barh.jpg" class="table"> <div align="center" ><strong><font size="2" face="Tahoma"><a href="../../../logout.php" class="d">Logout</a></font></strong></div></td> </tr> </table> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2"> </td> </tr> <tr bgcolor="#D7EABD"> <td colspan="2"> <div align="center"><font size="4" face="Tahoma"><strong>¢éÍÁÙÅÊØ¢ÀÒ¾</strong></font></div></td> </tr> <tr> <td width="83%"> <table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#999999"> <tr bgcolor="#FFFFFF"> <td width="33%" bgcolor="#FFFEF4"> <div align="center"><font color="#003366" size="2" face="Tahoma">ÃËÑÊ</font></div></td> <td width="67%" bgcolor="#FBF5E3"><strong><font color="#003300" size="2" face="Tahoma"> <?=$rs["Student_id"]?> </font></strong></td> </tr> <tr bgcolor="#FFFFFF"> <td bgcolor="#FFFEF4"> <div align="center"><font color="#003366" size="2" face="Tahoma">ª×èÍ-¹ÒÁÊ¡ØÅ</font></div></td> <td bgcolor="#FFFEF4"><font color="#003300" size="2" face="Tahoma"> <?=$rs["First_name"]?> <?=$rs["Name"]?> <?=$rs["Lastname"]?> </font></td> </tr> <tr bgcolor="#FFFFFF"> <td bgcolor="#FFFEF4"> <div align="center"><font color="#003366" size="2" face="Tahoma">ËÅÑ¡ÊÙµÃ</font></div></td> <td bgcolor="#FBF5E3"><font color="#003300" size="2" face="Tahoma"> <?php $Course_code = $rs["Course_code"]; $sql2= "Select * From course_tb Where Course_code='$Course_code'"; $result2 = mysql_query($sql2) or die("Error Select".mysql_query()); $rs2 = mysql_fetch_array($result2); echo"$rs2[Course_name]"; ?> ÃØè¹ </font><font color="#990099" size="2" face="Tahoma"> <?=$rs["Class"]?> </font></td> </tr> <tr bgcolor="#FFFFFF"> <td bgcolor="#FFFEF4"> <div align="center"><font size="2" face="Tahoma">ÍÒÂ</font>Ø</div></td> <td bgcolor="#FFFEF4"><font color="#003366" size="2" face="Tahoma"> <?php //// Show Age $age = $rs[DateBirth]; $year = explode("-",$age); $year = intval($year[0]); $year = $year - 543; $currentyear = date("Y"); // $currentyear = intval($currentyear[0]); $age = $currentyear - $year ; echo"$age"; ?> </font><font color="#000000" size="2" face="Tahoma">»Õ</font></td> </tr> <tr bgcolor="#FFFFFF"> <td bgcolor="#FFFEF4"><div align="center"><font color="#003366" size="2" face="Tahoma">¡ÃØê»àÅ×Í´</font></div></td> <td bgcolor="#FBF5E3"><font color="#003366" size="2" face="Tahoma"> <?php //// Show Age $Student_id = $rs[Student_id]; $sql2 = "Select * From std_health_tb Where Student_id='$Student_id' GROUP By B_group"; $result2 = mysql_query($sql2) or die("Error".mysql_error()); $rss = mysql_fetch_array($result2); echo"$rss[B_group]"; ?> </font><font color="#000000" size="2" face="Tahoma"> </font></td> </tr> <tr bgcolor="#FFFFFF"> <td height="20" bgcolor="#FFFEF4"> </td> <td bgcolor="#FFFEF4"> </td> </tr> </table></td> <td width="17%" colspan="-2" bgcolor="#FBF5E3"> <div align="center"> <?php echo"<center>"; echo"<img src=\"../$rs[Img1]\" width=\"100\" height=\"110\" >"; echo"</center>"; ?> </div></td> </tr> <tr> <td colspan="2"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" > <tr bgcolor="#E7F2D9" > <td colspan="5"> <div align="center"><font color="#003366" size="4" face="Tahoma"><strong>ÃÒ¡Òúѹ·Ö¡ÊØ¢ÀÒ¾</strong></font></div></td> </tr> <tr bgcolor="#EEEEEE"> <td width="2%" style="border:1px solid gray"><div align="center"><font color="#003366" size="1" face="Tahoma"><strong>No.</strong></font></div></td> <td width="13%" bgcolor="#EEEEEE" style="border:1px solid gray"><div align="center"><font size="2" face="Tahoma"><strong>Çѹ·ÕèºÑ¹·Ö¡</strong></font></div></td> <td width="7%" bgcolor="#EEEEEE" style="border:1px solid gray"><div align="center"><strong><font size="2" face="Tahoma">¹éÓ˹ѡ</font></strong></div></td> <td width="6%" bgcolor="#EEEEEE" style="border:1px solid gray"><div align="center"><strong><font size="2" face="Tahoma">ÊèǹÊÙ§</font></strong></div></td> <td width="72%" bgcolor="#EEEEEE" style="border:1px solid gray"><div align="center"><font color="#000000" size="2" face="Tahoma"><strong>âä»ÃШӵÑÇ</strong></font></div></td> </tr> <? $i = 1; while($row = mysql_fetch_array($result)) {
if($count==0) { ?> <tr bordercolor="#EEEEEE" bgcolor="#FFFFFF" > <td align=center bgcolor="#F7F7F7" ><font color="#003366" size="2" face="Tahoma"> <?=$i?> </font></td> <td align=center bgcolor="#F7F7F7" ><font color="#006633" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma"> <?php $dday = $row[Date_note]; $yearthai = explode("-",$dday); $day = intval($yearthai[2]); $month = intval($yearthai[1]); $year = intval($yearthai[0]); ////////////////// // $yearthai = $day ; $m = getThaiSubMonth($month); echo"$day"." "."$m"." "."$year"; ?> </font><font color="#006633" size="2" face="Tahoma"> </font></td> <td align=center bgcolor="#F7F7F7" ><font color="#003399" size="2" face="Tahoma"> <?=$row["Weight"]?> </font></td> <td align=center bgcolor="#F7F7F7" ><font color="#993333" size="2" face="Tahoma"> <?=$row["Height"]?> </font></td> <td align=center bgcolor="#F7F7F7" > <div align="left"><font color="#990099" size="2" face="Tahoma"> <a href="../Student/menu_std.php?Student_id=<?=$row["Student_id"]?>" title="Click to see Detail" class="d"> </a> </font></div> <div align="left"><font color="#000000" size="2" face="Tahoma"> <a href="HealthDetail.php?code=<? echo $row[code]?>" class="black" > <?=$row["Disease"]?> </a> </font> </div></td> </tr> <? $count=1; } else { ?> <tr bordercolor="#EEEEEE" bgcolor="#FFFFFF"> <td align="center" ><font color="#003366" size="2" face="Tahoma"> <?=$i?> </font></td> <td align="center" bgcolor="#FFFFFF" ><font color="#006633" size="2" face="Tahoma"> </font><font color="#003366" size="2" face="Tahoma"> <?php $dday = $row[Date_note]; $yearthai = explode("-",$dday); $day = intval($yearthai[2]); $month = intval($yearthai[1]); $year = intval($yearthai[0]); ////////////////// // $yearthai = $day ; $m = getThaiSubMonth($month); echo"$day"." "."$m"." "."$year"; ?> </font><font color="#006633" size="2" face="Tahoma"> </font></td> <td align="center" bgcolor="#FFFFFF" ><font color="#003399" size="2" face="Tahoma"> <?=$row["Weight"]?> </font></td> <td align="center" bgcolor="#FFFFFF" ><font color="#993333" size="2" face="Tahoma"> <?=$row["Height"]?> </font></td> <td align="center" bgcolor="#FFFFFF" > <div align="left"><font color="#990099" size="2" face="Tahoma"> <a href="../Student/menu_std.php?Student_id=<?=$row["Student_id"]?>" title="Click to see Detail" class="d"> </a> </font></div> <div align="left"><font color="#000000" size="2" face="Tahoma"> </font> <div align="left"><font color="#000000" size="2" face="Tahoma"> <a href="HealthDetail.php?code=<? echo $row[code]?>" class="black" > <?=$row["Disease"]?> </a></font></div> </div></td> </tr> <? $count=0; } $i++; } CloseDB(); ?> <tr bgcolor="#E7F2D9"> <td colspan="5" align="center"> <div align="center"><font color="#003366" size="2" face="Tahoma">·Ñé§ËÁ´</font><font color="#FF0000" size="2" face="Tahoma"> <strong><? echo $num ?> </strong></font><font color="#003366" size="2" face="Tahoma">¤ÃÑé§</font></div></td> </table></td> </tr> <tr bgcolor="#D7EABD"> <td colspan="2"> </td> </tr> </table> </body> </html> <?php } else { echo"<body bgcolor=\"#CCCCCC\">"; echo"<meta http-equiv=\"refresh\" content=\"3;URL=../logout.php\" target=\"mainFrame\">\n"; echo"<center>"; echo"<br><br><br><b><font face=\"Tahoma\" size=\"4\" color=\"#FF0000\">Please Login</font> </b><br>"; echo"<br><br><font face=\"Tahoma\" size=\"10\" color=\"#000000\"> ERROR 404 PERMISION DENY</font><br>"; echo"<br><font face=\"Tahoma\" size=\"4\" color=\"#000000\"> ¤Ø³äÁèÁÕÊÔ·¸ìãªé§Ò¹</font>"; echo"</center>"; echo"</body>"; } ?>
|