|
|
|
ช่วยที่ครับบผมอยากให้ถ้ามาสายให้เป็นสีแดง ถ้า เกิน 10 นาที ให้ ขึ้น สี แดง อ่าาครับมาทันทันขึ้นสีเขียว อ่าครับ |
|
|
|
|
|
|
|
ช่วยที่ครับบผมอยากให้ถ้ามาสายให้เป็นสีแดง ถ้า เกิน 10 นาที ให้ ขึ้น สี แดง อ่าาครับมาทันทันขึ้นสีเขียว อ่าครับ
อันนี้ code ผมครับบ
Code (PHP)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style type="text/css">
td {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
td {
color: #FFF;
line-height: 1;
}
#cssmenu,
#cssmenu ul,
#cssmenu ul li,
#cssmenu ul li a {
margin: 0;
padding: 0;
border: 0;
list-style: none;
line-height: 1;
display: block;
position: relative;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#cssmenu {
width: 900px;
font-family: Helvetica, Arial, sans-serif;
color: #ffffff;
}
#cssmenu.align-right ul li {
float: left;
border-right: 0;
border-left: 1px solid rgba(0, 0, 0, 0.22);
}
#cssmenu.align-right ul li a {
border-right: 0;
border-left: 1px solid rgba(255, 255, 255, 0.15);
}
#cssmenu ul {
background: #222222;
/* Old browsers */
background: -moz-linear-gradient(bottom, #000000 0%, #222222 50%, #3c3c3c 51%, #393939 78%, #888888 100%);
background: -webkit-linear-gradient(bottom, #000000 0%, #222222 50%, #3c3c3c 51%, #393939 78%, #888888 100%);
background: -o-linear-gradient(bottom, #000000 0%, #222222 50%, #3c3c3c 51%, #393939 78%, #888888 100%);
background: -ms-linear-gradient(bottom, #000000 0%, #222222 50%, #3c3c3c 51%, #393939 78%, #888888 100%);
background: linear-gradient(to top, #000000 0%, #222222 50%, #3c3c3c 51%, #393939 78%, #888888 100%);
}
#cssmenu:after,
#cssmenu ul:after {
content: '.';
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#cssmenu ul li {
float: left;
display: block;
border-right: 1px solid rgba(0, 0, 0, 0.22);
z-index: 1;
}
#cssmenu ul li::after {
content: '';
width: 100%;
height: 10px;
position: absolute;
border-top-left-radius: 50% 4px;
border-top-right-radius: 50% 4px;
background: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 60%, #222222 61%, #222222 100%);
background: -o-linear-gradient(bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 60%, #222222 61%, #222222 100%);
background: -ms-linear-gradient(bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 60%, #222222 61%, #222222 100%);
background: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 60%, #222222 61%, #222222 100%);
background: -moz-linear-gradient(bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0));
z-index: 2;
bottom: 10px;
}
#cssmenu ul li a {
display: block;
padding: 10px 30px;
text-decoration: none;
font-size: 12px;
text-transform: uppercase;
color: #ffffff;
border-right: 1px solid rgba(255, 255, 255, 0.15);
z-index: 3;
}
#cssmenu ul li a:hover,
#cssmenu ul li.active a {
color: #ffffff;
font-size: 18px;
}
#cssmenu ul li:hover,
#cssmenu ul li.active {
background: #1275ae;
/* Old browsers */
background: -moz-linear-gradient(bottom, #0b4669 0%, #1275ae 50%, #1794dc 51%, #1691d8 78%, #98d2f4 100%);
background: -webkit-linear-gradient(bottom, #0b4669 0%, #1275ae 50%, #1794dc 51%, #1691d8 78%, #98d2f4 100%);
background: -o-linear-gradient(bottom, #0b4669 0%, #1275ae 50%, #1794dc 51%, #1691d8 78%, #98d2f4 100%);
background: -ms-linear-gradient(bottom, #0b4669 0%, #1275ae 50%, #1794dc 51%, #1691d8 78%, #98d2f4 100%);
background: linear-gradient(to top, #0b4669 0%, #1275ae 50%, #1794dc 51%, #1691d8 78%, #98d2f4 100%);
}
#cssmenu ul li:hover::after,
#cssmenu ul li.active::after {
background: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 60%, #1275ae 61%, #1275ae 100%);
background: -o-linear-gradient(bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 60%, #1275ae 61%, #1275ae 100%);
background: -ms-linear-gradient(bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 60%, #1275ae 61%, #1275ae 100%);
background: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 60%, #1275ae 61%, #1275ae 100%);
background: -moz-linear-gradient(bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0));
}
body {
color: #EEEEEE;
background-color: #666;
background-image: url([email protected]);
}
#cssmenu ul li a span {
font-size: 16px;
}
.ac {
font-size: 36px;
font-weight: bold;
}
.h1 {
font-size: 36px;
}
.sa {
color: #0F0;
}
.sa {
color: #F00;
}
.saa {
color: #0F0;
}
.hes {
font-size: 24px;
}
.AS {
font-size: 20px;
line-height: 0.1mm;
}
.se {
font-size: 20px;
}
</style>
</head>
<body>
<table width="915" height="1641" border="0" align="center">
<tr bgcolor="#000000">
<td width="909" valign="top"><table width="900" height="866" border="0">
<tr>
<td height="143" valign="top"><table width="900" border="0">
<tr>
<td height="137" valign="top" background="tsn.jpg" bgcolor="#D6D6D6" bg><table width="900" border="0">
<tr>
<td width="520" align="right">UserName :</td>
<td width="108" align="left"><input type="text" width="100" name="textfield2" id="textfield2" /></td>
<td width="82">Password : </td>
<td width="111"><input type="text" width="100" name="textfield" id="textfield" /></td>
<td width="57" align="left"><input type="submit" name="button2" id="button2" value="Login" /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="37" valign="top"><div id='cssmenu' class="align-right">
<ul>
<li ><a href='homen.php'><span> HOME </span></a></li>
<li><a href='trainingcourese.php'><span> TRAINING COURSE AND REGISTERATION </span></a></li>
<li class='active'><a href='check1.php'><span> CHECK ATTENDANCE </span></a></li>
</ul>
</div></td>
</tr>
<tr>
<td height="670" valign="top"><table width="904" border="0">
<tr>
<td width="898" height="51" align="center" background="[email protected]" class="ac">CHECK ATTENDANCE</td>
</tr>
</table>
<table width="899" border="0">
<?php
ini_set('display_errors', 1);
error_reporting(~0);
$strUserIDss = null;
if(isset($_GET["UserID"]))
{
$strUserIDss = $_GET["UserID"];
}
$serverName = "localhost";
$userName = "root";
$userPassword = "2439";
$dbName = "project";
$connss = mysqli_connect($serverName,$userName,$userPassword,$dbName);
$sqlss = "SELECT * FROM training WHERE training_id = '".$strUserIDss."' ";
$queryss = mysqli_query($connss,$sqlss);
$resultss=mysqli_fetch_array($queryss,MYSQLI_ASSOC);
?>
<tr>
<td width="178" align="right" valign="bottom"> </td>
<td width="483" height="108" align="center" valign="middle" class="h1" > <p><?php echo $resultss["training_name"];?></p></td>
<td width="229" valign="bottom"><p class="saa"> Green = In time</p>
<p class="sa"> Red = Late </p>
<p style="color: #FF0004"> *(DD/MM/YY)</p></td>
</tr>
<?php
$serverName = "localhost";
$userName = "root";
$userPassword = "2439";
$dbName = "project";
$conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
$sql = "SELECT * FROM classroom_timetable WHERE training_id = '".$strUserIDss."' ";
$query = mysqli_query($conn,$sql);
?>
<tr>
<td height="1264" colspan="3" align="left" valign="top"><table width="898" height="1266" border="1">
<tr>
<td width="172" rowspan="4" align="center" valign="top" class="hes">
<?php
while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
{
?>
<p><a href="checknew.php?UserID=<?php echo $result["training_id"]; ?>&date=<?php echo $result["date_start"];?>"> <?php echo $result["date_start"];?> <span class="se"> <?php echo $result["time_start"];?> -<?php echo $result["time_end"];?></span></a></p>
<?php
}
?>
</td>
<td width="158" height="59" align="center">Username</td>
<td width="259" align="center">Name</td>
<td width="166" align="center">Major</td>
<td width="109" align="center">Adttendance</td>
</tr>
<?php
ini_set('display_errors', 1);
error_reporting(~0);
$UserID = null;
if(isset($_GET["UserID"]))
{
$UserID = $_GET["UserID"];
}
$serverName = "localhost";
$userName = "root";
$userPassword = "2439";
$dbName = "project";
$conns = mysqli_connect($serverName,$userName,$userPassword,$dbName);
$sqls = "select * from users inner join register on users.user_id = register.user_id WHERE register.training_id = '".$UserID."' ";
$querys = mysqli_query($conns,$sqls);
?>
<?php
$date = null;
if(isset($_GET["date"]))
{
$date = $_GET["date"];
}
while($results=mysqli_fetch_array($querys,MYSQLI_ASSOC))
{
?>
<tr>
<td height="29"><?php echo $results["user_id"];?></td>
<td height="29"><?php echo $results["user_fname"];?></td>
<td height="29"><?php echo $results["major_name"];?></td>
<td height="29"><?php
$aa = $results["user_id"];
$sqlsss = "select * from attendanc where user_id = '".$aa."' AND enter_date = '".$date."' ";
$querysss = mysqli_query($conns,$sqlsss);
$resultss=mysqli_fetch_array($querysss,MYSQLI_ASSOC);
echo $resultss["enter_time"];
?></td>
</tr>
<?php
}
?>
<tr>
<td height="1134">a</td>
<td>a</td>
<td>a</td>
<td> </td>
</tr>
</table>
<p style="font-size: 18px"> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p style="font-size: 18px"> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p class="saa"> </p></td>
</tr>
<tr>
<td height="551" colspan="3" valign="top"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
Tag : PHP
|
|
|
|
|
|
Date :
2014-11-21 15:29:27 |
By :
TerkzzZZ |
View :
826 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอาส่วนที่คิวรี่ แล้ว มี field เวลา สำหรับตรวจสอบเวลาสาย เท่านั้นพอ เอามาซะเยอะเลย
อ้อ แทก ที่แสดง สี ด้วยครับ
|
|
|
|
|
Date :
2014-11-21 16:52:29 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|