 |
แจกกันเล่นๆ ครับ อันนี้โพสถูกที่ .. คำสั่งที่ให้ไปยังเพจอื่นเมื่อถึงเวลาที่กำหนด |
|
 |
|
|
 |
 |
|
ลืม <?=time_of_work()?> คือเวลาที่กำหนดครับ หน่วยเป็นนาที ใส่ตัวเลขโดยตรงเลยก็ได้ เผอิญผมต้องดึงมาจากฐานข้อมูล เลยต้องเก็บไว้ในตัวแปรพีเอชพีก่อนครับ
|
 |
 |
 |
 |
Date :
2009-09-22 23:25:40 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เยี่ยมมากครับ 
|
 |
 |
 |
 |
Date :
2009-09-23 08:09:12 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
cool สุดๆ
|
 |
 |
 |
 |
Date :
2009-09-23 09:33:52 |
By :
nilas |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2009-09-23 09:41:24 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอานะ
|
 |
 |
 |
 |
Date :
2009-09-23 09:43:43 |
By :
Sek-Artdrinker |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ
ปักหมุดทีนะครับ 
|
 |
 |
 |
 |
Date :
2009-09-23 09:44:52 |
By :
kalamell |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้เลยครับคุณลาชิ อัพทูยู แล้วแต่ประยุกต์เอาไปใช้ครับ
|
 |
 |
 |
 |
Date :
2009-09-23 09:52:46 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ ว่าแล้วก็ขอแฮบไปใช้เลยนะครับ 
|
 |
 |
 |
 |
Date :
2009-09-23 10:05:12 |
By :
zepherus |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2009-09-23 10:07:19 |
By :
taobsd |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จัดไปๆ
|
 |
 |
 |
 |
Date :
2009-09-23 10:28:40 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เยี่ยมยอด กระเทียมเจียวครับ มีประโยชน์สุดๆๆ
|
 |
 |
 |
 |
Date :
2009-09-23 11:23:44 |
By :
Dragons_first |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอเป็นหอมเจียวได้ไหม ไม่ค่อยชอบกระเทียม อิอิอิอิ
|
 |
 |
 |
 |
Date :
2009-09-23 11:27:58 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
copy ไปทั้งดุ้นเลยไปบ้างครับ
|
 |
 |
 |
 |
Date :
2009-09-23 12:37:47 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมลอง copy ไปทั้งดุ้น หน้า page ไม่โชว์เลยครับ ทำไงดีเอ่ย
ตัด RightFrame ออกแล้วด้วยอ่ะครับ
|
 |
 |
 |
 |
Date :
2009-09-23 12:38:36 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาไปใช้ยังงัยครับ
|
 |
 |
 |
 |
Date :
2009-09-23 15:06:52 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอดูโค้ดทั้งหมดหน่อยครับ
|
 |
 |
 |
 |
Date :
2009-09-23 15:20:49 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โค้ดนี้ครับ
Code (PHP)
<?
session_start();
include "check.php";
include "conn.php";
?>
<!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>ระบบจองห้องประชุม สำนักงานจังหวัดลำปาง</title>
<link rel="stylesheet" type="text/css" href="epoch_styles.css" />
<script type="text/javascript" src="epoch_classes.js"></script>
<script type="text/javascript">
var bas_cal,dp_cal,ms_cal;
window.onload = function () {
dp_cal = new Epoch('epoch_popup','popup',document.getElementById('popup_container'));
};
</script>
<script language="javascript" type="text/javascript">
function LogoutSystem() //ประยุกใช้เอาตามสถานการณ์นะครับ
{
parent.location.replace("page-home.php"); //คำสั่งที่ให้ไปยังเพจอื่นเมื่อถึงเวลาที่กำหนด ใช้แพแรนท์ตามด้วยชื่อเฟรม หากไม่มีเฟรมก็ตัดทิ้งไป แล้วทามด้วยโลเคชั่น ตามด้วยรีเพลค สาเหตุที่ใช้รีเพลคเพราะไม่ต้องการให้สามารถกดปุ่มย้อนกลับได้
}
var timer1;
function Ehandler()
{
clearTimeout(timer1);
timer1 = setTimeout("LogoutSystem()", 1000*60*<?=time_of_work()?>);
return true;
}
Ehandler();
if(!document.all){window.captureEvents(Event.CLICK | Event.KEYPRESS);}
window.onclick = Ehandler;
window.onkeypress = Ehandler;
</script>
<style type="text/css">
<!--
body,td,th {
font-family: MS Reference Sans Serif;
}
a {
font-family: MS Reference Sans Serif;
}
h1,h2,h3,h4,h5,h6 {
font-family: MS Reference Sans Serif;
}
.style1 {color: #990000}
.style2 {
color: #CC3300;
font-size: 14px;
}
.style3 {font-size: 14px}
-->
</style></head>
<body onclick="Ehandler()" onkeypress="Ehandler()">
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">
<table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="pic/head03.gif" width="650" height="80" border="0" /></td>
</tr>
<tr>
<td valign="middle"><table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="290" align="left" valign="middle"><span class="style1"><span class="style3"><img src="pic/2.gif" width="20" height="29" border="0" align="absmiddle" />
<?
if ($_SESSION['level']=="1")$_SESSION['level']="ผู้ดูแลระบบ";
if ($_SESSION['level']=="2")$_SESSION['level']="ผู้ใช้ทั่วไป";
echo $_SESSION['level'];?>
</span> : <span class="style2"><?echo $_SESSION['units'];?></span></span></td>
<td width="360" height="33" align="right" valign="middle"><a href="index.php"><img src="pic/home.gif" alt="กลับสู่หน้าหลัก" width="88" height="30" border="0" align="absmiddle" /></a> <a href="list.php"><img src="pic/list.gif" alt="ตารางข้อมูลการจอก" width="123" height="30" border="0" align="absmiddle" /></a> <a href="logout.php"><img src="pic/logout.gif" alt="ออกจากระบบ" width="122" height="30" border="0" align="absmiddle" /></a> </td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td height="400" background="body.gif"><table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="400" background="pic/body.gif"><table width="650" height="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="400" valign="top" background="pic/book05.gif">
<table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="right" valign="bottom"><span class="style3">วันที่
<?include "date.php";?>
</span></td>
</tr>
<tr>
<td height="20" valign="top"> </td>
</tr>
</table>
<table width="650" height="285" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20"> </td>
<td height="20"> </td>
<td height="20"> </td>
<td height="20"> </td>
</tr>
<FORM METHOD=POST ACTION="insert.php">
<tr>
<td height="25"> </td>
<td height="25"><div align="right">ห้องประชุม : </div></td>
<td height="25"><div align="left">
<select name="roomddl" size="1" id="roomddl">
<option>-- เลือกห้องประชุม --</option>
<option value="1">ห้องประชุม 1</option>
<option value="2">ห้องประชุม 2</option>
<option value="3">ห้อง POC</option>
</select>
</div></td>
<td height="25"> </td>
</tr>
<tr>
<td width="82" height="25"> </td>
<td width="249" height="25"><div align="right">วันที่ต้องการจอง : </div></td>
<td width="249" height="25"><div align="left">
<input name="txtdate" id="popup_container" type="date" size="10"/>
</div></td>
<td width="70" height="25"> </td>
</tr>
<tr>
<td height="25"> </td>
<td height="25"><div align="right">ช่วงเวลา : </div></td>
<td height="25"><div align="left">
<select name="timedll" id="timedll">
<option>--เลือกช่วงเวลา --</option>
<option value="1">เช้า</option>
<option value="2">บ่าย</option>
<option value="3">เช้า - บ่าย</option>
</select>
</div></td>
<td height="25"> </td>
</tr>
<tr>
<td height="25"> </td>
<td height="25"><div align="right">ชื่อผู้จอง : </div></td>
<td height="25"><div align="left">
<input name="namerestxt" type="text" size="30" />
</div></td>
<td height="25"> </td>
</tr>
<tr>
<td height="25"> </td>
<td height="25"><div align="right">หน่วยงาน: </div></td>
<td height="25"><div align="left"> <INPUT NAME="txtunit" TYPE="text" value="<?echo $_SESSION['units'];?>" size="18" readonly >
</div></td>
<td height="25"> </td>
</tr>
<tr>
<td height="105"> </td>
<td height="105"> </td>
<td height="105"><div align="right">
<input type="submit" value="จองห้องประชุม" />
<img src="pic/ok.gif" width="67" height="101" border="0" align="bottom"/></div></td>
<td height="105"> </td>
</tr>
</FORM>
</table>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="middle"> </td>
</tr>
<tr>
<td><div align="center"><img src="pic/foot.gif" width="650" height="70" border="0" /></div></td>
</tr>
</table>
</body>
</html>
|
 |
 |
 |
 |
Date :
2009-09-23 15:25:34 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?=time_of_work()?> ตรงนี้เปลี่ยนเป็นจำนวนนาทีด้วยครับ เช่นคุณกำหนดว่าถ้าผู้ใช้เปิดหน้านี้ทิ้งไว้ภายใน 5 นาที ให้ทำการเปลี่ยนไปยังเพจโฮม ในที่นี้หากเขาไม่ทำงานใดๆ ในหน้าเพจนะครับ ถ้าเขาคลิก หรือกดคีย์อยู่ที่หน้าเพจหน้านี้ ก็จะไม่เปลี่ยน ฟังก์ชั่นจะเริ่มนับเวลาทันทีที่คุณปล่อยคีย์ หรือปล่อยเมาส์ครับ
|
 |
 |
 |
 |
Date :
2009-09-23 15:45:24 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
parent.location.replace("page-home.php"); ตรงนี้ถูกแล้วครับ แต่ชื่อไฟล์เพจโฮมของคุณมีจริงหรือเปล่าครับ ถ้าไม่มีก็เปลี่ยนให้ไปยังเพจอื่นที่คุณต้องการครับ
|
 |
 |
 |
 |
Date :
2009-09-23 15:47:42 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วใส่ เวลายังไงครับ
เช่น จะตั้งไว้ 5 นาที ให้ <?=time_of_work(5)?>
แบบนี้รึป่าวครับ
|
 |
 |
 |
 |
Date :
2009-09-23 15:50:37 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
5 ตัวเดียว ลบ <?.....?> ออกไปเลยครับ
|
 |
 |
 |
 |
Date :
2009-09-23 15:56:01 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมตั้งไว้ 1 เพื่อทดลองดู
เมื่อเวลาผ่านไปไม่เห็นมันจะไปอีกเพจเลยครับ ผมทำผิดขั้นตอนตรงไหนรึป่าว? ช่วยให้ทีครับ
Code (PHP)
<?
session_start();
include "check.php";
include "conn.php";
?>
<!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>ระบบจองห้องประชุม สำนักงานจังหวัดลำปาง</title>
<link rel="stylesheet" type="text/css" href="epoch_styles.css" />
<script type="text/javascript" src="epoch_classes.js"></script>
<script type="text/javascript">
var bas_cal,dp_cal,ms_cal;
window.onload = function () {
dp_cal = new Epoch('epoch_popup','popup',document.getElementById('popup_container'));
};
</script>
<script language="javascript" type="text/javascript">
function LogoutSystem() //ประยุกใช้เอาตามสถานการณ์นะครับ
{
parent.location.replace("login.html"); //คำสั่งที่ให้ไปยังเพจอื่นเมื่อถึงเวลาที่กำหนด ใช้แพแรนท์ตามด้วยชื่อเฟรม หากไม่มีเฟรมก็ตัดทิ้งไป แล้วทามด้วยโลเคชั่น ตามด้วยรีเพลค สาเหตุที่ใช้รีเพลคเพราะไม่ต้องการให้สามารถกดปุ่มย้อนกลับได้
}
var timer1;
function Ehandler()
{
clearTimeout(timer1);
timer1 = setTimeout("LogoutSystem()", 1000*60*<?1?>);
return true;
}
Ehandler();
if(!document.all){window.captureEvents(Event.CLICK | Event.KEYPRESS);}
window.onclick = Ehandler;
window.onkeypress = Ehandler;
</script>
<style type="text/css">
<!--
body,td,th {
font-family: MS Reference Sans Serif;
}
a {
font-family: MS Reference Sans Serif;
}
h1,h2,h3,h4,h5,h6 {
font-family: MS Reference Sans Serif;
}
.style1 {color: #990000}
.style2 {
color: #CC3300;
font-size: 14px;
}
.style3 {font-size: 14px}
-->
</style></head>
<body onclick="Ehandler()" onkeypress="Ehandler()">
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">
<table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="pic/head03.gif" width="650" height="80" border="0" /></td>
</tr>
<tr>
<td valign="middle"><table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="290" align="left" valign="middle"><span class="style1"><span class="style3"><img src="pic/2.gif" width="20" height="29" border="0" align="absmiddle" />
<?
if ($_SESSION['level']=="1")$_SESSION['level']="ผู้ดูแลระบบ";
if ($_SESSION['level']=="2")$_SESSION['level']="ผู้ใช้ทั่วไป";
echo $_SESSION['level'];?>
</span> : <span class="style2"><?echo $_SESSION['units'];?></span></span></td>
<td width="360" height="33" align="right" valign="middle"><a href="index.php"><img src="pic/home.gif" alt="กลับสู่หน้าหลัก" width="88" height="30" border="0" align="absmiddle" /></a> <a href="list.php"><img src="pic/list.gif" alt="ตารางข้อมูลการจอก" width="123" height="30" border="0" align="absmiddle" /></a> <a href="logout.php"><img src="pic/logout.gif" alt="ออกจากระบบ" width="122" height="30" border="0" align="absmiddle" /></a> </td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td height="400" background="body.gif"><table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="400" background="pic/body.gif"><table width="650" height="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="400" valign="top" background="pic/book05.gif">
<table width="650" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="right" valign="bottom"><span class="style3">วันที่
<?include "date.php";?>
</span></td>
</tr>
<tr>
<td height="20" valign="top"> </td>
</tr>
</table>
<table width="650" height="285" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20"> </td>
<td height="20"> </td>
<td height="20"> </td>
<td height="20"> </td>
</tr>
<FORM METHOD=POST ACTION="insert.php">
<tr>
<td height="25"> </td>
<td height="25"><div align="right">ห้องประชุม : </div></td>
<td height="25"><div align="left">
<select name="roomddl" size="1" id="roomddl">
<option>-- เลือกห้องประชุม --</option>
<option value="1">ห้องประชุม 1</option>
<option value="2">ห้องประชุม 2</option>
<option value="3">ห้อง POC</option>
</select>
</div></td>
<td height="25"> </td>
</tr>
<tr>
<td width="82" height="25"> </td>
<td width="249" height="25"><div align="right">วันที่ต้องการจอง : </div></td>
<td width="249" height="25"><div align="left">
<input name="txtdate" id="popup_container" type="date" size="10"/>
</div></td>
<td width="70" height="25"> </td>
</tr>
<tr>
<td height="25"> </td>
<td height="25"><div align="right">ช่วงเวลา : </div></td>
<td height="25"><div align="left">
<select name="timedll" id="timedll">
<option>--เลือกช่วงเวลา --</option>
<option value="1">เช้า</option>
<option value="2">บ่าย</option>
<option value="3">เช้า - บ่าย</option>
</select>
</div></td>
<td height="25"> </td>
</tr>
<tr>
<td height="25"> </td>
<td height="25"><div align="right">ชื่อผู้จอง : </div></td>
<td height="25"><div align="left">
<input name="namerestxt" type="text" size="30" />
</div></td>
<td height="25"> </td>
</tr>
<tr>
<td height="25"> </td>
<td height="25"><div align="right">หน่วยงาน: </div></td>
<td height="25"><div align="left"> <INPUT NAME="txtunit" TYPE="text" value="<?echo $_SESSION['units'];?>" size="18" readonly >
</div></td>
<td height="25"> </td>
</tr>
<tr>
<td height="105"> </td>
<td height="105"> </td>
<td height="105"><div align="right">
<input type="submit" value="จองห้องประชุม" />
<img src="pic/ok.gif" width="67" height="101" border="0" align="bottom"/></div></td>
<td height="105"> </td>
</tr>
</FORM>
</table>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="middle"> </td>
</tr>
<tr>
<td><div align="center"><img src="pic/foot.gif" width="650" height="70" border="0" /></div></td>
</tr>
</table>
</body>
</html>
|
 |
 |
 |
 |
Date :
2009-09-23 16:11:00 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อิอิอิอิ
timer1 = setTimeout("LogoutSystem()", 1000*60*1);
เอาไปเลยครับ
|
 |
 |
 |
 |
Date :
2009-09-23 16:17:32 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?....?> จาว่าไม่มีเท็กแบบนี้ครับ
|
 |
 |
 |
 |
Date :
2009-09-23 16:19:17 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
5555
อาจารย์กับศิษย์คู่นี้สงสัยเข้าใจกันคนละแบบ
|
 |
 |
 |
 |
Date :
2009-09-23 16:23:10 |
By :
somparn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณค่ะนะจะมีประโยชน์
|
 |
 |
 |
 |
Date :
2009-10-25 12:44:34 |
By :
aob19148 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณค่ะ....กำลังหาอยู่พอดี มีประโยชน์มากๆเลยค่ะ
|
 |
 |
 |
 |
Date :
2009-10-25 20:25:39 |
By :
kataidee |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โผล่มาได้งัยเนี่ย โพสไปตั้งแต่ พศ. ใดหว่า....
|
 |
 |
 |
 |
Date :
2009-10-26 01:04:05 |
By :
NanoThoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|