|
 |
|
ช่วยดูโค๊ดแบ่งหน้าให้ผมหน่อยครับ คือเวลาเราล็อกอินหรือเพิ่มข้อมูลหรือลบข้อมูลมันจะ error แต่เมื่อกดหน้าสองแล้วจะใช้งานได้ (มีโค๊ดและภาพให้ดู) |
|
 |
|
|
 |
 |
|
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>แสดงจดหมาย</title>
</head>
<style type="text/css">
<!--
body,td,th {
color: #000000;
}
body {
background-color: #CCCCCC;
}
-->
</style><BODY><center>
<p><img src="../Head/head.gif" width="1000" height="150"> </p>
<p>
<?
include "connect.php";
//$count=0;
$sql="select * from email order by id desc ";
$result=mysql_db_query($dbname,$sql);
echo"<br>";
$numrow = mysql_num_rows($result);
echo "
<a href='letter_view3.php'><font color='#0443AA'><b>[จัดการข้อมูลสมาชิก]</a></font> <a href='../webboard/login.php'><font color='#0443AA'>[เว็บบอร์ด]</a></font></b><p>
<table width='800' border='0'><tr><td align='left'>จำนวนข้อมูลที่พบ $numrow</td></tr></table>
<table width='800' border='1'>
<tr bgcolor='color='#0443AA'>
<td width='50'><center><b><font size='2' face='MS Sans Serif'color='#FFFFFF'>ลำดับที่
</font></b></center></td>
<td width='150'><center><b><font size='2' face='MS Sans Serif'color='#FFFFFF'>หมายเลขจดหมาย
</font></b></center></td>
<td width='250'><center><b><font size='2' face='MS Sans Serif'color='#FFFFFF'>ชื่อผู้รับ
</font></b></center></td>
<td width='150'><center><b><font size='2' face='MS Sans Serif'color='#FFFFFF'>ประเภทจดหมาย</font></b></center></td>
<td width='250'><center><b><font size='2' face='MS Sans Serif'color='#FFFFFF'>วันที่ได้รับ
</font></b></center></td>
<td width='100'><center><b><font size='2' face='MS Sans Serif'color='#FFFFFF'>สถานะ
</font></b></center></td>
<td width='100'><center><b><font size='2' face='MS Sans Serif'color='#FFFFFF'>แก้ไข</font></b></center></td>
<td width='100'><center><b><font size='2' face='MS Sans Serif'color='#FFFFFF'>ลบ</font></b></center></td></tr>";
?>
<?
$sql="select * from email order by id desc limit $start,10";
$result=mysql_db_query($dbname,$sql);
while($record=mysql_fetch_array($result))
{
//$count++;
$id=$record[id];
$iddoc=$record[iddoc];
$name=$record[name];
$lastname=$record[lastname];
$doctype=$record[doctype];
$day=$record[day];
$status=$record[status];
//$day=$record[day];
//$month=$record[month];
//$year=$record[year];
echo "<tr bgcolor='#FFFFFF'>
<td width='50'><center><font size='2' face='MS Sans Serif'color='#0443AA'>$id</font></center></td>
<td width='150'><center><font size='2' face='MS Sans Serif'color='#0443AA'>$iddoc</font></center></td>
<td width='250'><center><font size='2' face='MS Sans Serif'color='#0443AA'>$name $lastname</font></center></td>
<td width='150'><center><font size='2' face='MS Sans Serif'color='#0443AA'>$doctype</font><center></td>
<td width='250'><center><font size='2' face='MS Sans Serif'color='#0443AA'>$day</font></center></td>
<td width='100'><center><font size='2' face='MS Sans Serif'color='#0443AA'>$status</font></center></td>
<TD width='100'><A HREF=\"letter_edit2.php?id_edit=$id\"onclick=\" return confirm('ยืนยันแก้ไข$name ออกจากระบบ')\"><center>แก้ไข</A></TD></center>
<TD width='100'><A HREF=\"admin_type_delete.php?id_del=$id\"onclick=\" return confirm('ยืนยันลบ$name ออกจากระบบ')\"><center>ลบ</A></TD></center>
</tr>";
}
echo "</table>";
echo "<table width='800' border='0'><tr><td align='left'>รายการหน้าที่ $tpage</td></tr></table>";
$tpage = round($numrow/10);
$ch = $numrow / 10;
if ($tpage < $ch) {
$tpage++;
}
$tt = ($numrow %10);
$a=1;
for ($i=0;$i<$tpage;$i++) {
$st = ($a-1)*10;
$x = $st;
if ($st == $start) {
$link ="<b><font color=blue>";
$clo ="</b></font>";
}else {
$link ="<a href=letter_view.php?tp=1&type=$type&start=$st&r_ctl=$r_ctl&id=$x>";
$clo ="</a>";
}
echo"$link $a $clo |";
$a++;
}
?>
</p>
<p><a href="adminlogout.php"><center>[ออกจากระบบ]</center><br></a></p>
</center>
</center>
<tr>
<td><h2 align="center" class="style1"> </h2>
<h3 align="center" class="style1"><font color="#0000FF">เพิ่มจดหมาย</font></h3>
<form name="checkForm" method="POST" action="letter_save.php" onSubmit="return check()">
<table width="512" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#99FFFF" size ="10">
<tr>
<td>ประเภทจดหมาย</td>
<td><font size="2" face="MS Sans Serif, Tahoma, sans-serif">
<select name=doctype >
<option selected value="">เลือกประเภท</option>
<option value="จดหมาย">จดหมาย</option>
<option value="EMS">EMS</option>
<option value="พัสดุ">พัสดุ</option>
</select>
</font></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="120">หมายเลข</td>
<td width="382"><input name="iddoc" type="text" id="iddoc" size="30" maxlength="13"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>ชื่อ-นามสกุล</td>
<td><label for="name"></label>
<input name="name" type="text" id="name" size="25">
-
<label for="lastname"></label>
<input name="lastname" type="text" id="lastname" size="25"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>วันที่ได้รับ</td>
<td><font size="2" face="MS Sans Serif, Tahoma, sans-serif">
<label for="year"></label>
</font><?
$c_date = date("d");
$m_app = array ("ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.");
$mounth_app = $m_app[date("n") - 1];
$y_app = date("Y") + 543;
$c_time = date("H:i");
$day = "$c_date $mounth_app $y_app เวลา$c_time น.";
?>
<input name="day"type="text" id="day" value="<?=$day ?>"/></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>สถานะ</td>
<td><select name=status >
<option selected value="">เลือกสถานะ</option>
<option value="ยังไม่รับ">ยังไม่รับ</option>
<option value="รับแล้ว">รับแล้ว</option>
</select></td>
</tr>
</table>
<script language="javascript">
function check() {
if(document.checkForm.doctype.value=="") {
alert("กรุณาเลือกประเภท") ;
document.checkForm.doctype .focus() ;
return false ;
}
if(document.checkForm.iddoc.value=="") {
alert("กรุณาใสหมายเลขจดหมาย") ;
document.checkForm.iddoc .focus() ;
return false ;
}
if(document.checkForm.name.value=="") {
alert("กรุณาใส่ชื่อผู้รับ") ;
document.checkForm.doctype .focus() ;
return false ;
}
if(document.checkForm.lastname.value=="") {
alert("กรุณาใส่นามสกุลผู้รับ") ;
document.checkForm.doctype .focus() ;
return false ;
}
if(document.checkForm.status.value=="") {
alert("กรุณาเลือกสถานะ") ;
document.checkForm.doctype .focus() ;
return false ;
}
else
return true ;
}
</script>
<div align="center"><br>
<input name="submit" type="submit" value="ตกลง">
<input name="reset" type="reset" value="ยกเลิก">
</div>
</form>
</BODY>
</HTML>
รูป1

รูป2

รบกวนพี่ๆๆช่วยดูให้น่อยคับว่าต้องแก้ไขโค้ดยังไงให้เวลาล็อกอินแล้วขึ้นโชว์เลย
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2011-03-23 22:49:39 |
By :
เด็กกระทิง |
View :
844 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 00
|