|
|
|
ช่วยที่ครับคือผมต้องการกดเลือกแล้วขึ้นข้อมูลอ่าครับแต่ตรงเมนูมันหายอ่าครับ |
|
|
|
|
|
|
|
code ที่เป็น text ครับ เอามาด้วย แบบนี้ มีวิธีเขียนตั้งหลาย อย่าง
เอาโค๊ดมาแปะ จะได้คอมเม้นท์ได้ว่า ผิดตรงไหน ให้โค๊ดใหม่ไปก็ไม่ค่อยได้อ่านกัน 5555
|
|
|
|
|
Date :
2014-11-18 07:19:09 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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?ID=<?php echo $result["training_id"];?>"> <?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["ID"]))
{
$UserID = $_GET["ID"];
}
$serverName = "localhost";
$userName = "root";
$userPassword = "2439";
$dbName = "project";
$conns = mysqli_connect($serverName,$userName,$userPassword,$dbName);
$sqls = "select * from (users inner join training on users.user_id = training.user_id)inner join register on training.training_id = register.training_id WHERE register.training_id = '".$UserID."' ";
$querys = mysqli_query($conns,$sqls);
?>
<?php
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 echo $results["training_name"];?></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>
นี้อ่าครับบบ
|
|
|
|
|
Date :
2014-11-18 23:16:01 |
By :
TerkzzZZ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="checknew.php?ID=$result[training_id]"> $result[date_start]
197.$strUserIDss = null;
198.
199.if(isset($_GET["UserID"]))
200.{
201.$strUserIDss = $_GET["UserID"];
202.}
260.ini_set('display_errors', 1);
261.error_reporting(~0);
262.$UserID = null;
263.
264.if(isset($_GET["ID"]))
265.{
266.$UserID = $_GET["ID"];
267.}
เลือกเอาครับว่าจะให้เป็น UserID หรือ ID
|
|
|
|
|
Date :
2014-11-19 09:59:08 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คือ userid ผม get มาจากหน้า ที่ แล้วCode (PHP)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
function confirmDelete(delUrl) {
if (confirm("Do you want Register?")) {
document.location = delUrl;
}
}
</script>
<style type="text/css">
td {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}
td {
color: #FFF;
line-height: 0.75;
}
#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: 24px;
font-weight: bold;
}
.ts {
font-size: 24px;
}
</style>
</head>
<body>
<?php
$serverName = "localhost";
$userName = "root";
$userPassword = "2439";
$dbName = "project";
$conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
$sql = "select * from (users inner join training on users.user_id = training.user_id)inner join classroom_timetable on training.training_id = classroom_timetable.training_id group by training_name ";
$query = mysqli_query($conn,$sql);
?>
<table width="900" height="1641" border="0" align="center">
<tr bgcolor="#000000">
<td valign="top"><table width="911" height="866" border="0">
<tr>
<td width="905" 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>
<form name="form1" method="post" action="check_login.php">
<td align="right"> </td>
<td align="right">UserName :</td>
<td><input type="text" width="100" name="username" /></td>
<td align="right">Password :</td>
<td align="left"><input type="text" width="100" name="pass" /></td>
</tr>
<tr>
<td width="479" align="right"> </td>
<td width="92" align="left"> </td>
<td width="100"> </td>
<td width="86" align="center"><input type="button" name="button2" id="button2" value="Sign up" onClick="parent.location='register.php'" /></td>
<td width="121" align="center"><input type="submit" name="button2" id="button2" value="Login" /></td>
</form>
</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 COURESE </span></a></li>
<li class='active' ><a href='check1.php'><span> CHECK ADTENDANCE </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="905" height="558" border="0">
<tr>
<td width="899" colspan="4" align="center" valign="top"><table width="895" border="0">
<tr>
<td width="217" height="117" align="right" valign="top" class="ts3" style="font-size: 18px"><p> </p>
<p>Course Name : </p></td>
<td width="168" align="left" valign="top"><p>
</p>
<p>
<input type="text" name="textfield" id="textfield" />
</p></td>
<td width="139" align="right" valign="top" class="ts3" style="font-size: 18px"><p> </p>
<p>Lecturer Name : </p></td>
<td width="176" align="left" valign="top"><p>
</p>
<p>
<input type="text" name="textfield" id="textfield" />
</p></td>
<td width="176" align="left" valign="top"><p>
</p>
<p>
<input type="submit" name="button2" id="button2" onClick="parent.location='studentin.php'" value="Search" />
</p></td>
</tr>
<tr>
<td colspan="5"><table width="896" border="1">
<tr>
<td width="210" align="center" class="ts" background="[email protected]"> Course Name</td>
<td width="216" align="center" class="ts"background="[email protected]">Lecturer Name</td>
<td width="340" align="center" class="ts"background="[email protected]">Date and time </td>
<td width="102" background="[email protected]"> </td>
</tr>
<?php
while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
{
$tra= $result['training_id'];
$sq12 = "SELECT * from classroom_timetable where training_id = '$tra' ";
$query2 = mysqli_query($conn,$sq12);
?><tr>
<td height="35" ><?php echo $result['training_name']; ?></td>
<td><?php echo $result['user_fname']?> <?php echo $result['user_lname']?></td>
<td>
<?php
while($result2 = mysqli_fetch_array($query2,MYSQLI_ASSOC))
{
?>
<br> <?php echo $result2['date_start']?> (<?php echo $result2['time_start']?> - <?php echo $result2['time_end']?>) <?php echo $result2['room_id']?>
</br>
<?php
}
?>
</td>
<td align="center"><a href="checknew.php?UserID=<?php echo $result["training_id"];?>">Adtendance List</a></td>
</tr>
<?php
}
?>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
อ่าครับ อันนี้อ่าา ครับบ
|
|
|
|
|
Date :
2014-11-19 12:02:56 |
By :
TerkzzZZ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
กลับไปคห. 3 ครับ เมื่อถูกบังคับจากโค๊ดนี้ ให้ใช้ UserID คุณก็ต้องแก้ส่วนที่เป็น ID ให้เป็น UserID ทั้งหมดครับ
|
|
|
|
|
Date :
2014-11-19 12:13:37 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้ละครับขอบคุณครับบบ
|
|
|
|
|
Date :
2014-11-19 19:33:46 |
By :
TerkzzZZ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|