|
|
|
ผู้รู้รบกวนแก้ให้ที่ครับ จะสร้างหน้าให้เเบ่งหน้าลองทำดูหลายครั้งก็ยังไม่ขึ้นและเเจ้ง error ตลอด รวบกวนช่วยแก้ให้ทีครับ |
|
|
|
|
|
|
|
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="1020" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td colspan="2" align="center" class="style15"><a href="memberpage.php"><img src="pic/login_large.png" width="554" height="197" /></a>
<form id="form1" name="form1" method="post" action="">
<label></label>
</form> </td>
</tr>
<tr>
<?php echo $rob++; ?>
<td width="50" align="center" bgcolor="#FFCC00" class="style15">ลำดับ</td>
<td width="853" align="center" bgcolor="#FFCC00" class="style15">ปัญหา</td>
<td width="97" 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 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 class="style13"align="center"> <?php echo $rob++; ?> </td>
<td class="style13"> <? echo $row['6']; ?></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>
</div>
<?php
$page = (isset($_GET['page']))? intval($_GET['page']) : 1;
$limit_end = 3;
$limit_start = ($page-1)*$limit_end;
$send = "";
if(isset($_GET["id"]) and $_GET["id"] != ""){
$send = "id=" . $_GET["id"];
$condition= " WHERE brand_id = '" . $_GET["id"] . "'";
}
$sql = "SELECT * FROM quesdata" . $condition;
$query_id = mysql_query($sql . " Id_Ques " . $limit_start. "," . $limit_end, $connect);
$count = mysql_num_rows($query_id);
$total = mysql_num_rows(mysql_query($sql, $connect));
if($total > 0){
$i=0;
while($rows = mysql_fetch_assoc($query_id))
{
$i++;
$brand_name = $rows["brand_name"]."<br>";
?>
<tr>
<td height="25">
<div align="center">
<?=$i?>
</div></td>
<td height="25"><?=$brand_name?></td>
</tr>
<?
}
?>
<tr>
<td height="25"> </td>
<td height="25"> </td>
</tr>
</table>
<?
echo "\n<div style=\"float:left;\">หน้าที่ : " . page_navi($page, $limit_end, 4, $total, $send) . " </div><div style=\"float:right;\">แสดงข้อมูลแถวที่ [" . ($limit_start+1) . "-" . ($limit_start+$count) . "] จากข้อมูล <strong>" . $total . "</strong></div>";
}
?>
<p> </p>
<p> </p>
</body>
<? } ?>
</html>
Tag : MySQL, CakePHP
|
|
|
|
|
|
Date :
2012-09-26 15:04:26 |
By :
blackberryone |
View :
908 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เหมือนกับว่า Connection มันหาย หรือว่า ไม่มี Connection ครับ
|
|
|
|
|
Date :
2012-09-27 09:26:42 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|