|
 |
|
ช่วยดูให้หน่อยครับ ต้องการแทรกข้อมูลเข้าตาราง แต่มันไม่เข้าทั้งหมด |
|
 |
|
|
 |
 |
|
อย่าเพิ่งรีบปิด </table> ในลูปสิครับ
Code (PHP)
echo"<center>";
echo"<table width=\"500\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\" style='background:#8B658B;' >";
echo"<tr height=\"25\">";
echo"<td align=\"center\"><b><font color=\"FFFFFF\">วันเสาร์</font></b></td>";
while (strtotime($strStartDate) <= strtotime($strEndDate)) {
$DayOfWeek = date("w", strtotime($strStartDate));
if($DayOfWeek ==6) // 0 = Sunday, 6 = Saturday;
{
$intHoliday++;
echo"<tr height=\"22\" bgcolor=\"#FFFFFF\" onMouseOver=\"switchBg(this, 'mOUT')\" onMouseOut=\"switchBg(this, 'mIN')\">";
echo "<td align=\"center\">".thaidate($strStartDate)." </td></tr>";
}
}
echo"</table>";
echo"</center>";
|
 |
 |
 |
 |
Date :
2012-06-01 10:49:14 |
By :
mangkunzo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ ขอบคุณมาก
ตารางเลื่อนลงมาอยู่กลางจอ ทำไงให้อยู่บนสุดครับ

Code เต็มๆ ครับ
<?
include "function.inc.php";
$strStartDate = date("Y")."-01-01";
$strEndDate = date("Y-m-d");
$yearnow = date ("Y")+543;
$intWorkDay = 0;
$intHoliday = 0;
$intPublicHoliday = 0;
$intTotalDay = ((strtotime($strEndDate) - strtotime($strStartDate))/ ( 60 * 60 * 24 )) + 1;
echo"<center>";
echo"<table width=\"300\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\" style='background:#8B658B;' >";
echo"<td align=\"center\"><b><font color=\"FFFFFF\">วันเสาร์</font></b></td>";
while (strtotime($strStartDate) <= strtotime($strEndDate)) {
$DayOfWeek = date("w", strtotime($strStartDate));
if($DayOfWeek ==6) // 0 = Sunday, 6 = Saturday;
{
$intHoliday++;
echo"<tr height=\"22\" bgcolor=\"#FFFFFF\" onMouseOver=\"switchBg(this, 'mOUT')\" onMouseOut=\"switchBg(this, 'mIN')\">";
echo"<td align=\"center\">".thaidate($strStartDate)." </td></tr>";
echo "<br>";
}
$strStartDate = date ("Y-m-d", strtotime("+1 day", strtotime($strStartDate)));
}
echo"</table>";
echo"</center>";
echo"</form>";
?>
|
 |
 |
 |
 |
Date :
2012-06-01 14:03:28 |
By :
poomloom |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ok แล้วครับติด echo "<br>"; 
|
 |
 |
 |
 |
Date :
2012-06-01 14:12:11 |
By :
poomloom |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รบกวนอีกรอบครับ ถ้า $strStartDate มีค่าตรงกับฟิลด์ call_date ให้แสดงรหัสพนักงานออกมา แต่ถ้าในฐานข้อมูลไม่มีค่า หรือค่าไม่ตรงกับ $strStartDate ให้โชว์ว่า "ว่าง" ครับ
ตอนนี้ให้แสดงรหัสพนักงานกรณี call_date=$strStartDate ได้แล้วครับ แต่ติดตรงกรณีที่สอง ถ้าค่าไม่ตรงกันให้แสดงค่า "ว่าง" แทนรหัสพนักงานครับ


Code (PHP)
echo"<center>";
echo"<table width=\"300\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\" style='background:#8B658B;' >";
echo"<td align=\"center\"><b><font color=\"FFFFFF\">วันเสาร์</font></b></td>";
echo"<td align=\"center\"><b><font color=\"FFFFFF\">STATUS</font></b></td>";
while (strtotime($strStartDate) <= strtotime($strEndDate)) {
$DayOfWeek = date("w", strtotime($strStartDate));
if($DayOfWeek ==6) // 0 = Sunday, 6 = Saturday;
{
$intHoliday++;
echo"<tr height=\"22\" bgcolor=\"#FFFFFF\" onMouseOver=\"switchBg(this, 'mOUT')\" onMouseOut=\"switchBg(this, 'mIN')\">";
echo"<td align=\"center\">$strStartDate</td>";
$sql_chk_call="Select tb_oncall.*,users.U_username,users.U_name,users.U_surname from tb_oncall INNER JOIN users ON tb_oncall.call_user=users.U_username WHERE tb_oncall.U_province=30 order by call_id asc";
mysql_query("SET NAMES tis620");
$rs_call=mysql_query($sql_chk_call);
while ($result=mysql_fetch_array($rs_call))
{
if($strStartDate==$result['call_date'])
{
echo"<td align=\"center\">".$result['call_user']."</td>";
}
}
}
$strStartDate = date ("Y-m-d", strtotime("+1 day", strtotime($strStartDate)));
}
echo"</table>";
echo"</center>";
|
 |
 |
 |
 |
Date :
2012-06-03 21:39:47 |
By :
poomloom |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|