|
|
|
ช่วยแก้ไขโค๊ดให้ทีครับ รบกวนผู้เชี่ยวชาญที ด่วนที่สุดครับ แบงหน้า ตั้งไว้แต่มันไม่ได้ต้องแก้ตรงไหน ช่วยทีครับ |
|
|
|
|
|
|
|
Code (PHP)
<?php
session_start();
if(!isset($_SESSION['txtUsername'])){
?>
<h2><font color="red"><center><br><br>Please Login</font></h2>
<center><input type="button" value="Go to login" onClick="window.location='login.php'" />
<?php
}else{
?>
<!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=utf-8" />
<title>ระบบแจ้งซ่อมออนไลน์ - Helpdesk System</title>
<!--
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>
<style type="text/css">
<!--
.style1 {
font-size: 14px;
color: #333333;
font-family: Arial, Helvetica, sans-serif;
}
.style13 {font-size: 12px; color: #666666; }
.style16 {font-size: 14px; color: #000000; }
.style15 {font-size: 12px;
font-weight: bold;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
body {
background-image: url(pic/bg_header.gif);
background-color: #F7F6F5;
background-repeat: repeat-x;
}
-->
</style>
</head>
<body>
<div id="container">
<table width="1072" height="293" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td height="225" colspan="2" align="center" class="style15"><div align="right">
<p><a href="memberpage.php"></a></p>
<p><a href="memberpage.php"><img src="pic/login_large.png" width="545" height="194" border="0" /></a><img src="pic/clock.png" width="0" height="18" /></p>
<p>กำลังดำเนินการ <img src="pic/comment.png" width="16" height="16" />ดำเนินการเสร็จสิ้น </p>
</div> </td>
</tr>
<?
include"connect.php";
$objDB = mysql_select_db("$dbname");
$strSQL="select * from quesdata_admin";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
$Per_Page =10; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$strSQL .=" order by Id_Ques desc LIMIT $Page_Start , $Per_Page";
$objQuery = mysql_query($strSQL);
if(empty($Num_Rows)) /* ?????????????????????? */
{
echo"<center></center>";
exit();
}
?>
<tr>
<?php echo $rob++; ?>
<td width="84" align="center" bgcolor="#FFCC00" class="style15">เลขที่แจ้งซ่อม</td>
<td width="466" align="center" bgcolor="#FFCC00" class="style15">ปัญหาการแจ้งซ่อม</td>
<td width="149" align="center" bgcolor="#FFCC00" class="style15">วันที่แจ้ง</td>
<td width="123" align="center" bgcolor="#FFCC00" class="style15">ชือผู้แจ้ง</td>
<td width="134" align="center" bgcolor="#FFCC00" class="style15">หน่วยงาน</td>
<td width="78" align="center" bgcolor="#FFCC00" class="style15">รายละเอียด</td>
</tr>
<?
$db_name="datahelps";// Database name
$connection=mysql_connect("localhost","root","1234") or die("I Couldn't connect");
$db=mysql_select_db($db_name,$connection) or die("I Couldn't select your database");
$sql="select * from quesdata_admin where Username='$Username'";
$result=mysql_query($sql,$connection) or die(mysql_error());
$i=0;
while($row=mysql_fetch_array($result)) {
$Username=$row['Username'];
$i++;
if($i%2==0)
{
$bg = "#CCCCCC";
}else
{
$bg="#FFFFFF";
}
?>
<tr bgcolor="<?=$bg;?>">
<td height="23" align="center" class="style13" > <?php echo $rob++; ?> </td>
<td class="style13"> <? echo $row['6']; ?></td>
<td class="style13"><? echo $row['8']; ?></td>
<td class="style13"> <? echo $row['2']; ?></td>
<td class="style13"> <? echo $row['3']; ?></td>
<td align="center"><a href="<? echo "show_answer_detail.php?Id_Ques=".$row['0']; ?>" class="style16">
<? if($row['9']==""){?>
<img src="pic/clock.png" width="16" height="16" border="0" />
<? }else{ ?>
<img src="pic/comment.png" width="16" height="16" border="0" />
<? }?>
</a></td>
<? } ?>
</tr>
</table>
<tr>
<td><div align="center"><span class="style11">Total </span>
<?= $Num_Rows;?>
<span class="style11"> Record : </span>
<?=$Num_Pages;?>
<span class="style11">Page :</span>
<?
if($Prev_Page)
{
echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&startdate=$startdate&enddate=$enddate'></a> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[<a href='$_SERVER[SCRIPT_NAME]?Page=$i&startdate=$startdate&enddate=$enddate'>$i</a>]";
}
else
{
echo "<b> $i </b>";
}
//}
if($Page!=$Num_Pages)
{
echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&startdate=$startdate&enddate=$enddate'></a> ";
}
?>
</div>
<p> </p>
<p> </p>
</body>
<? } } ?>
</html>
Tag : MySQL, CakePHP, Web (ASP.NET), JAVA
|
|
|
|
|
|
Date :
2012-09-26 15:30:45 |
By :
black |
View :
821 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
บทความก็มีให้ดู คุณน่าจะตั้งใจทำและอ่านมันน่ะครับ
|
|
|
|
|
Date :
2012-09-27 09:27:27 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|