|
|
|
ช่วยหน่อยนะคร่าเรื่องการส่งข้อความหาอีกคนนึงคล้ายๆเฟสบุคแสดงการแจ้งเตือนเมื่อมีข้อความเข้า |
|
|
|
|
|
|
|
นี่เป็นโค้ดที่ทำไว้คร่า
Code (C#)
<?php
session_start();
$ids=$_SESSION['id_a'];
$ida=$_GET['ida'];
?>
<!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"><!-- InstanceBegin template="/Templates/tmp_add.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>คำปรึกษา</title>
<link rel="stylesheet" type="text/css" href="../epoch_styles.css" />
<script type="text/javascript" src="../epoch_classes.js"></script>
<script type="text/javascript">
/*You can also place this code in a separate file and link to it like epoch_classes.js*/
var bas_cal,dp_cal,ms_cal;
window.onload = function () {
dp_cal = new Epoch('epoch_popup','popup',document.getElementById('popup_container2'));
};
</script>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #666666;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #FF66CC;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
color: #FF66CC;
}
a:active {
text-decoration: none;
}
-->
</style>
<style type="text/css">
<!--
.style5 {font-size: 12px}
.style6 {font-size: 12px; font-weight: bold; }
-->
</style>
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.style25 {font-size: 14px}
-->
</style>
<!-- InstanceEndEditable -->
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style7 {font-size: 36px}
.style24 { color: #FFFFFF;
font-size: 24px;
font-weight: bold;
font-family: "Comic Sans MS";
}
-->
</style>
</head>
<body>
<table width="100%" height="47" border="0" align="center" bordercolor="#FF99FF" bgcolor="#FF99FF">
<!--DWLayoutTable-->
<tr>
<td width="73" height="43" valign="top" bgcolor="#FF99FF"><!--DWLayoutEmptyCell--> </td>
<td width="312" bgcolor="#FF99FF"><span class="style24"><span class="style7">ComNpru@</span>dviser.com</span></td>
<td width="625" align="center" valign="bottom" bgcolor="#FF99FF">
<p>
<?
if($_SESSION['logged_in'] == 1){
?>
</p>
<p> </p>
<p> </p>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li> <strong><a href="../index.php" class=" style5">หน้าแรก</a></strong> </li>
<li><a href="../webboard/index.php" class="style6">เว็บบอร์ด</a></li>
<li><a href="index.php" class="style6">คำปรึกษา</a></li>
<li><a href="../search/index.php" class="style6">เรียกดูู</a></li>
<li><a href="../news/index.php" class="style6">ฝากข่าว</a></li>
<li><a href="../pic/index.php" class="style6">ภาพกิจกรรม</a></li>
<li><a href="../schedule/index.php" class="style5"><strong>ตารางเรียน/ตารางสอบ</strong></a> </li>
<? if($_SESSION['logged_ad'] == 1) {?>
<li><a href="../add_meber/index.php" class="style5"><strong>ผู้ใช้ระบบ</strong></a></li>
<? }?>
</ul>
<p>
<? } ?>
</p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td width="8%" height="419" valign="top"> </td>
<td width="26%" valign="top"><? if($_SESSION['logged_in'] == 1){
?>
<fieldset>
<legend>ยินดีต้อนรับ</legend>
<p><img src='../images_pro/<? echo $_SESSION['img_a'];?>' alt="" width='129' height='150' border="0" /><br />
<?
$id=$_SESSION['id_a'];
echo $_SESSION['id_a'],"<br>";
echo $_SESSION['f_name'],"<br>";
echo "E-Mail ",$_SESSION['e_mail'],"<br>";
?>
<a href="../register/index.php?id_ed=<? echo"$id";?>">ข้อมูลส่วนตัว</a></p>
<p><a href="../report/index.php">
<? if($_SESSION['logged_in'] == 1) {?>
</a><a href="../messenger/index.php" class="style5">แจ้งเตือน </a>
<?
include("../include/conf.php");
$sql_alert="SELECT * FROM tb_alert";
$db_query_alert=mysql_db_query($db,$sql_alert);
$num_rows_alert=mysql_num_rows($db_query_alert); /* นับ Reccord ที่พบ */
echo"$num_rows_alert";
?>
(
<?
$sql_alert="SELECT * FROM tb_alert where status_alert='0'";
$db_query_alert=mysql_db_query($db,$sql_alert);
$num_rows_alert=mysql_num_rows($db_query_alert); /* นับ Reccord ที่พบ */
echo"$num_rows_alert";
?>
)</p>
<p><a href="../report/index.php" class="style5">
</a><a href="../report/index.php">
<? if($_SESSION['logged_ad'] == 1) {?>
</a><a href="../report/index.php" class="style5">รายงานจากระบบ</a><br />
</p>
<? }?><? }?>
<a href="../logout.php" class="style5">ออกจากระบบ</a>
</fieldset><?
}else{ ?>
<p></p>
<form action="../check.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<fieldset>
<legend>เข้าสู่ระบบ</legend>
<table width="200" height="82" border="0">
<tr>
<td width="44" height="24">ID</td>
<td width="140"><input name="id" type="text" id="id" /></td>
</tr>
<tr>
<td height="24">Password</td>
<td><input type="password" name="pass" id="pass" /></td>
</tr>
<tr>
<td> </td>
<td><div align="right">
<input name="button" type="submit" class="MenuBarActive" id="button" value="เข้าสู่ระบบ" />
</div>
<label for="button"></label>
<label></label></td>
</tr>
</table>
</fieldset>
</form>
<p>
<? } ?>
</p>
<p> </p>
<p> </p>
<table width="251" border="0">
<tr>
<td><img src="../images/index_32.gif" width="222" height="50" /></td>
</tr>
<tr>
<td><a href="http://home.npru.ac.th/webhome/index.html">โฮมเพจอาจารย์</a></td>
</tr>
<tr>
<td><a href="http://ct.npru.ac.th/">โปรแกรมวิชา</a></td>
</tr>
</table> <p> </p> </td>
<td width="66%" align="left" valign="top"><!-- InstanceBeginEditable name="tem_add" -->
<table width="630" height="346" border="0">
<tr>
<td width="803"><form id="form2" name="form2" method="post" enctype="multipart/form-data" action="save_con.php">
<?
include("../include/conf.php");
$sql="Select * From tb_consul where to_con ='$ids'";
$db_query=mysql_db_query($db,$sql);
$num_rows=mysql_num_rows($db_query); /* นับ Reccord ที่พบ */
$a = $num_rows;
$b = $a+1 ;
?>
<fieldset>
<legend>การให้คำปรึกษา</legend>
<table width="622" height="306" border="0">
<tr>
<td colspan="4"><div align="center" class="style25">การให้คำปรึกษา</div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td width="102"><div align="center">หัวข้อเรื่อง:</div></td>
<td colspan="3"><input name="title_con" type="text" id="title_con" size="40" /></td>
</tr>
<tr>
<td> </td>
<td colspan="3"> </td>
</tr>
<tr>
<td><div align="center">รายละเอียดของเรื่อง:</div></td>
<td colspan="3"><textarea name="detail_con" id="detail_con" cols="40" rows="5"></textarea></td>
</tr>
<tr>
<td><div align="center">วันที่ :</div></td>
<td colspan="3"><input name="day" type="text" id="popup_container2" /></td>
</tr>
<tr>
<td><div align="center">ถึง:</div></td>
<td width="54"><input name="radio1" type="radio" id="radio1" onclick="hideobj('to_con');
showBtn();" value="radio1" checked="checked"/>
ทั่วไป</td>
<td width="56"><input name="radio1" type="radio" id="radio2" onclick="showobj('to_con');" value="radio1" />
ส่วนตัว</td>
<td width="392"><label>
<input name="to_con" type="text" id="to_con" size="30" value=" <? echo "$ida"?>"/>
<a href="show_name.php">ดูรายชื่อ </a></label></td>
</tr>
<tr>
<td> </td>
<td colspan="3"> </td>
</tr>
<tr>
<td> </td>
<td colspan="3"><input type="submit" name="pass2" id="pass2" value="ส่งข้อมูล" /></td>
</tr>
</table>
</fieldset>
</form></td>
</tr>
</table>
<p> </p>
<script type="text/javascript">
function showobj(obj){
document.getElementById(obj).style.display = '';
}
function hideobj(obj){
document.getElementById(obj).style.display = 'none';
}
</script>
<script>
function showBtn()
{
document.getElementById("btn").style.display = "block";
}
</script>
<!-- InstanceEndEditable --></td>
</tr>
</table>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
<!-- InstanceEnd --></html>
ตารางในdatabase
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-05-31 18:41:20 |
By :
panghom |
View :
883 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
databaseที่ทำไว้แล้ว
|
|
|
|
|
Date :
2011-05-31 18:45:37 |
By :
panghom |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|