|
|
|
อยากแก้โค้ด ที่แสดงผลเป็น CSS ให้แสดงผลผ่าน Form ธรรมดา |
|
|
|
|
|
|
|
ผมอยากจะแก้โค้ดที่แสดงผลผ่าน CSS ให้แสดงผลผ่าน Form ธรรมดาครับ
แก้ยังไงก็แก้ไม่ได้ ขอคำแนะนำหน่อยครับ
Code (PHP)
<?
Session_Start();
if (isset($_SESSION[login_true])){
?>
<!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>
<script language="javascript" src="datetimepicker.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>:: ขออนุญาตใช้ยานพาหนะ ::</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:478px;
top:664px;
width:115px;
height:29px;
z-index:1;
}
#Layer2 {
position:absolute;
left:408px;
top:242px;
width:348px;
height:68px;
z-index:1;
}
#Layer4 {
position:absolute;
left:499px;
top:309px;
width:306px;
height:74px;
z-index:1;
}
#Layer3 {
position:absolute;
left:115px;
top:50px;
width:713px;
height:69px;
z-index:1;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
#Layer5 {
position:absolute;
left:49px;
top:350px;
width:225px;
height:36px;
z-index:2;
}
#Layer6 {
position:absolute;
left:47px;
top:398px;
width:229px;
height:43px;
z-index:3;
}
.style2 {font-family: tahoma; font-size: small; }
.style1 {color: #FFFFFF}
.style4 {font-family: tahoma; font-size: small; color: #FFFFFF;}
.style5 {font-family: tahoma}
.style7 {
color: #FFFFFF;
font-size: small;
font: tahoma;
font-weight: bold;
background-color: #6600CC;
}
-->
</style>
</head>
<body>
<div id="Layer3">
<p>
<body>
<?
include ("../../func/connect.php"); "connect.php";
//echo "  login_true = $login_true";
$log = $_SESSION[login_true];
//echo"LOG : $log";
$sql_driver = "select * from userrequest where userrequest_name = '$log' ";
$re_driver = mysql_db_query($db,$sql_driver);
$dirver_num = mysql_num_rows($re_driver);
$sql_approver = "select * from approver where username = '$log'";
$re_approver = mysql_db_query($db,$sql_approver);
$approver_num = mysql_num_rows($re_approver);
if($driver_num == '1' or $approver_num =='0'){
$driver_show = mysql_fetch_array($re_driver);
$usertype_show =$driver_show[usertype_id]; //รับค่าตัวแปรรหัสบุคคลหลังจากเข้าสู่ระบบ เป็น session
$driver_show =$driver_show[driver_id]; //รับค่าตัวแปรรหัสบุคคลหลังจากเข้าสู่ระบบ เป็น session
//echo "  ตำแหน่ง :$usertype_show  <b>";
//echo "รหัสบุคคล :$driver_show<br>";
}else if($driver_num=='1' or $approver_num =='1'){
$approver_show = mysql_fetch_array($re_approver);
$usertype_show = $approver_show[usertype_id];
$driver_show = $approver_show[approver_id];
}
switch ($usertype_show) {
case "0":
//echo "คนขับรถ";
//กรณี case 0 เป็นคนขับรถ
?>
<FORM method="POST" Action=""NAME="frm" target='_parent'><?
$sqluser_n = "select * from driver where usertype_id = '$usertype_show' and driver_id = '$driver_show'";
$reuser_n = mysql_db_query($db,$sqluser_n);
$rsuser_n = mysql_fetch_array($reuser_n);
$usertype_id = $rsuser_n[usertype_id];
$userdep_id = $rsuser_n[dep_id];
$driver_id = $rsuser_n[driver_id];
echo"เรียน คณะบดี คณะบริหารธุรกิจ<br>";
echo"ข้าพเจ้า $rsuser_n[driver_name] $rsuser_n[surename] ";
echo "<br>ผู้ขับ: $driver_id<br>";
echo "สังกัด : $userdep_id<br>";echo"</tr>\n";
echo"เรื่อง";
echo"<br><center><b>รายการแจ้งซ่อม</center>";
echo "<table width=\"91%\" border=\"1\" align=\"center\" border=\"1\">\n";
echo"<tr>\n";
echo"\t<td width=\"10%\" align=\"center\"width=\"35\">ลำดับ</td>\n";
echo"\t<td width=\"10%\" align=\"center\"width=\"40\">รายการ</td>\n";
echo"\t<td width=\"10%\" align=\"center\"width=\"15\">จำนวน</td>\n";
echo"\t<td width=\"10%\" align=\"center\"width=\"50\">เหตุแจ้งซ่อม</td>\n";
?>
<input name="subj_repair" type="text" id=<? echo $subj_repair;?> size="50" maxlength="255" />
<?
for ($y=1;$y<=10;$y++)
{
echo"<tr>\n";
echo"\t<td align=\"center\">";
//$rc[$y][$x]=2*$y+$x;
echo "$y";
echo"</td>\n";
echo"\t<td align=\"center\">";
?>
<input name= "list_repair[]" type="text" id=<? echo $list_repair[$y];?> size="40" maxlength="40" />
<?
echo"</td>\n";
echo"\t<td align=\"center\">";
?>
<input name= "num_repair[]" type="text" id=<? echo $num_repair[$y];?> size="15" maxlength="2" />
<?
echo"</td>\n";
echo"\t<td align=\"center\"width=\"35\">";
?>
<input name="res_repair[]" type="text" id=<? echo $res_repair[$y];?> size="50" maxlength="200" />
<?
echo"</td>\n";
echo"</tr>\n";
}
echo"</table>";
?>
<table width="100%" border="0">
<tr>
<td width="46%">
<div align="right">
<input type="submit" name="Save" value="บันทึก" >
</div></td>
<td width="54%">
<div align="left">
<input type="reset" name="Reset" value="Reset" >
</div></td></tr>
</table>
<!-- ส่งค่าตัวแปรเมื่อกด บันทึก -->
<table width="100%" border="0">
<tr>
<td><input type = 'hidden' name="usertype_id" value ="<?=$usertype_id?>" />
<input type = 'hidden' name="userdep_id" value ="<?=$userdep_id?>" />
<input type = 'hidden' name="driver_id" value ="<?=$driver_id?>" /></td>
</tr>
</table>
<?
break;
case "1":
//กรณี case 3 เป็นรองคณบดีคนที่1
//echo"รองคณบดีฝ่ายบริหารและวางแผน<br><br>";
?>
<?
echo"<br>";
$log = $_SESSION[login_true];
//echo "log : $log<br>";
$sql_userid = "select * from userrequest where userrequest_name = '$log'"; //select เพื่อให้ได้รหัสพนักงานมา
$re_userid = mysql_db_query($db,$sql_userid);
$result_userid = mysql_fetch_array($re_userid);
//echo"userrequest : $result_userid[userrequest_id]";
$sqlcnt_id = "select * from permission where userrequest_id = '$result_userid[userrequest_id]' and car_id <> '0'order by date_do desc";
$Per_Page = 10;
if ( !$Page )
$Page = 1;
$Prev_Page = $Page - 1;
$Next_Page = $Page + 1;
$result = mysql_query( $sqlcnt_id );
$Page_start = ( $Per_Page * $Page ) - $Per_Page;
$Num_Rows = mysql_num_rows( $result );
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;
if ( ( $Page > $Num_Pages ) || ( $Page < 0 ) )
print "จำนวน $Page มากกว่า $Num_Pages";
$sqlcnt_id .= " LIMIT $Page_start, $Per_Page";
$j = 0;
?>
<br>
<br> <div align="center"><tr><table width="350" border="1">
<td bordercolor="#FFFFFF" bgcolor="#6600cc"><span class="style7">ตารางแสดงผลการพิจารณาขออนุญาตใช้ยานพาหนะ</span></td>
</tr>
</table></div>
<td>
<? echo"<br>"; ?>
<table width="97%" border="1" cellpadding="1" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#CCAAFF">
<!--DWLayoutTable-->
<tr bgcolor="#6600cc">
<td></center>
<div align="center" class="font_basic" ><span class="style4">ลำดับ</span></div></td>
<td></center>
<div align="center" class="font_basic"><span class="style4">วันที่</span></div></td>
<td width="163"></center>
<div align="center" class="font_basic"><span class="style4">ขออนุญาตใช้รถไปที่</span></div></td>
<td width="275"></center>
<div align="center" class="font_basic"><span class="style4 style1">เพื่อ</span></div></td>
<td></center>
<div align="center" class="font_basic style5"><span class="style4"> ดูข้อมูล</span></div></td>
</tr>
<?
$result = mysql_query( $sqlcnt_id );
$recnt_id = mysql_db_query($db,$sqlcnt_id);
while($rscnt_id = mysql_fetch_array($recnt_id)){
$j = $j+1;
//koy open
$sql_shwuse = "select * from permission where userrequest_id = '$result_userid[userrequest_id]' order by date_do desc"; //เรียงตามวันที่ออกเดินทาง
$re_shwuse = mysql_db_query($db,$sql_shwuse);
$num_shwuse = mysql_num_rows($re_shwuse);
if ($num_shwuse > 0){
//while($result_shwuse = mysql_fetch_array($re_shwuse)){
$sql_status = "select * from per_status where permission_id = '$rscnt_id[permission_id]' "; //เพื่อให้ได้ผลลัพธ์การพิจารณา
$re_status = mysql_db_query($db,$sql_status);
$result_status = mysql_fetch_array($re_status);
if ($result_status[per_one] == "0" and $result_status[per_two] == "0") {
$shw_status = "กำลังพิจารณา";
}elseif ($result_status[per_one] == "1" and $result_status[per_two] == "0") {
$shw_status = "กำลังพิจารณา";
}elseif ($result_status[per_one] == "2" and $result_status[per_two] == "0") {
$shw_status = "ไม่อนุมัติ";
}elseif ($result_status[per_one] == "1" and $result_status[per_two] == "1") {
$shw_status = "อนุมัติ";
}elseif ($result_status[per_one] == "1" and $result_status[per_two] == "2") {
$shw_status = "ไม่อนุมัติ";
}
$jj = ($Page-1);
?>
<tr>
<td width=34 height="35" align="center" valign="middle"><div align="center" class="style2"><? echo "$jj$j"; ?></div></td>
<td><div align="center" class="style2"> <?
$date_do= ereg_replace( "([0-9]+)-([0-9]+)-([0-9]+)", "\\3-\\2-\\1", $rscnt_id[date_do] );
echo "$date_do"; ?></div></td>
<td><div align="center" class="style2"><? echo "$rscnt_id[go_usecar]"; ?></div></td>
<td><div align="center" class="style2"><? echo "$rscnt_id[forr]"; ?></div></td>
<? if ($result_status[per_one] == "1" and $result_status[per_two] == "1"){ ?>
<td width="52" align="center" valign="middle"><div align="center"><span class="style5"><a href="fm_user.php?permission_id=<?=$rscnt_id[permission_id]?>" target="_blank" ><img src="images/Printer_Landscape.gif" width="28" height="28"border=0 /></a>
<? }elseif(($result_status[per_one] == "1" and $result_status[per_two] == "0")or($result_status[per_one] == "0" and $result_status[per_two] == "0")){?>
</span>
</div>
<td width="59" align="center" valign="middle"><div align="center" class="style5"><a href="home_usecardata.php?permission_id=<?=$rscnt_id[permission_id]?>"><font color="#0000FF" size="2" face="tahoma">รอพิจารณา</font></a>
<? }else{ ?>
</span>
</div>
<td width="56" align="center" valign="middle"><div align="center" class="style5"><a href="home_usecardata.php?permission_id=<?=$rscnt_id[permission_id]?>" ><font color="#FF0000" size="2" face="tahoma">ไม่อนุมัติ</font></a>
<? }?>
</div> </tr>
<?
}
//}
} ?></table>
<? echo"</table>";
//koy close
break;
case "4":
//กรณี case 4 เป็นรองคณบดีคนที่2
//echo"รองคณบดีฝ่ายกิจการนักศึกษา<br><br>";
?>
<?
echo"<br>";
$sqlcnt_id = "select a.permission_id from permission a inner join per_status b on a.permission_id = b.permission_id and ((b.per_one = '0' and b.per_two = '0') or (b.per_one = '1' and b.per_two = '0') or (b.per_one = '2' and b.per_two = '0'))";
$Per_Page = 10;
$Per_Page = 10;
if ( !$Page )
$Page = 1;
$Prev_Page = $Page - 1;
$Next_Page = $Page + 1;
$result = mysql_query( $sqlcnt_id );
$Page_start = ( $Per_Page * $Page ) - $Per_Page;
$Num_Rows = mysql_num_rows( $result );
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;
if ( ( $Page > $Num_Pages ) || ( $Page < 0 ) )
print "จำนวน $Page มากกว่า $Num_Pages";
$sqlcnt_id .= " LIMIT $Page_start, $Per_Page";
$sql_condition1 = "select * from per_status where per_one= '0' and per_two = '0' ";
$result_condition1 = mysql_db_query($db,$sql_condition1);
$num_condition1 = mysql_num_rows($result_condition1);
?>
<? echo" <br>";
echo"<br>";
?>
<table width="100%" border="1" bordercolor="#ccaaff">
<tr>
<td><center>สถานะ</td>
<td><center>อนุมัติเลขที่</td>
<td><center>เรื่อง</td>
<td><center>วันที่เดินทางไป/กลับ</td>
<td><center>เวลาเดินทางไป/กลับ</td>
</tr>
<? if ($num_condition1>"0") {
$show_st1 ="ยังไม่พิจารณา";
$result = mysql_query( $sqlcnt_id );
$sql_App_dep= "select * from approver where username = '$login_true' ";
$re_App_dep=mysql_db_query($db,$sql_App_dep);
$result_App_dep=mysql_fetch_array($re_App_dep);
//echo"$result_App_dep";
$sql_log_App="select * from permission where dep_id = $result_App_dep[dep_id] ";
$re_log_App=mysql_db_query($db,$sql_log_App);
$num_log_App=mysql_num_rows($re_log_App);
if($num_log_App>0){
for($i=1; $i<=$num_log_App; $i++){
$result_log_App=mysql_fetch_array($re_log_App);
$sql_status1 = "select * from per_status where permission_id = '$result_log_App[permission_id]' ";
$re_status1=mysql_db_query($db,$sql_status1);
$result_status1=mysql_fetch_array($re_status1);
if ($result_status1[per_one]== "0" and $result_status1[per_two]== "0" ){
$show_st ="ยังไม่พิจารณา";
echo" <tr >
<td align='center'>$show_st</td>
<td align='center' >$result_log_App[permission_id]</td>
<td width=\"30%\"align='center'><A HREF=\"req_usecarApp.php?idrepair_list=$result_log_App[permission_id]\">$result_log_App[go_usecar]</A></td>
<td align='center'>$result_log_App[demo]<br>$result_log_App[demo2]</td>
<td align='center'>$result_log_App[time_start].$result_log_App[minute_start]<br>$result_log_App[time_stop].$result_log_App[minute_stop]</td>
</tr>";
}
}
}?>
</table><br />
<?
}
$sql_condition2 = "select * from per_status where (per_one= '1' and per_two = '0') or (per_one= '2' and per_two = '0') ";
$result_condition2 = mysql_db_query($db,$sql_condition2);
$num_condition2 = mysql_num_rows($result_condition2);
?>
<? echo"<br>"; ?>
<? echo" รายการพิจารณาเรียบร้อยแล้ว<br>";
echo"<br>";
?>
<table width="100%" border="1"bordercolor="#ccaaff">
<tr>
<td><center>สถานะ</td>
<td><center>อนุมัติเลขที่</td>
<td><center>เรื่อง</td>
<td><center>วันที่เดินทางไป/กลับ</td>
<td><center>เวลาเดินทางไป/กลับ</td>
</tr>
<?
if ($num_condition2>"0") {
$show_st2 ="พิจารณาแล้ว";
$result = mysql_query( $sqlcnt_id );
$sql_App_dep= "select * from approver where username = '$login_true' ";
$re_App_dep=mysql_db_query($db,$sql_App_dep);
$result_App_dep=mysql_fetch_array($re_App_dep);
//echo"$result_App_dep";
$sql_log_App="select * from permission where dep_id = $result_App_dep[dep_id] ";
$re_log_App=mysql_db_query($db,$sql_log_App);
$num_log_App=mysql_num_rows($re_log_App);
if($num_log_App>0){
for($i=1; $i<=$num_log_App; $i++){
$result_log_App=mysql_fetch_array($re_log_App);
$sql_status1 = "select * from per_status where permission_id = '$result_log_App[permission_id]' ";
$re_status1=mysql_db_query($db,$sql_status1);
$result_status1=mysql_fetch_array($re_status1);
if($result_status1[per_one]== "1" and $result_status1[per_two]== "0"){
$show_st ="พิจารณาแล้ว";
echo"
<tr >
<td align='center'>$show_st</td>
<td align='center' >$result_log_App[permission_id]</td>
<td width=\"30%\" align='center'><A HREF=\"req_usecarApp.php?idrepair_list=$result_log_App[permission_id]\">$result_log_App[go_usecar]</A></td>
<td align='center'>$result_log_App[demo]<br>$result_log_App[demo2]</td>
<td align='center'>$result_log_App[time_start].$result_log_App[minute_start]<br>$result_log_App[time_stop].$result_log_App[minute_stop]</td>
</tr>
";
} elseif($result_status1[per_one]== "2" and $result_status1[per_two]== "0" ){
$show_st ="พิจารณาแล้ว";
echo"
<tr >
<td align='center'>$show_st</td>
<td align='center' >$result_log_App[permission_id]</td>
<td width=\"30%\"align='center'><A HREF=\"req_usecarApp.php?idrepair_list=$result_log_App[permission_id]\">$result_log_App[go_usecar]</A></td>
<td align='center'>$result_log_App[demo]<br>$result_log_App[demo2]</td>
<td align='center'>$result_log_App[time_start].$result_log_App[minute_start]<br>$result_log_App[time_stop].$result_log_App[minute_stop]</td>
</tr>";
}
}
}?>
<br />
<?
}
//close table 2
echo"</table>";
break;
case "5":
//กรณี case 5 เป็นรองคณบดีคนที่3
//echo"รองคณบดีฝ่ายบริหารและวางแผน<br><br>";
?>
<?
echo"<br>";
$sqlcnt_id = "select a.permission_id from permission a inner join per_status b on a.permission_id = b.permission_id and ((b.per_one = '0' and b.per_two = '0') or (b.per_one = '1' and b.per_two = '0') or (b.per_one = '2' and b.per_two = '0'))";
$Per_Page = 10;
$Per_Page = 10;
if ( !$Page )
$Page = 1;
$Prev_Page = $Page - 1;
$Next_Page = $Page + 1;
$result = mysql_query( $sqlcnt_id );
$Page_start = ( $Per_Page * $Page ) - $Per_Page;
$Num_Rows = mysql_num_rows( $result );
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;
if ( ( $Page > $Num_Pages ) || ( $Page < 0 ) )
print "จำนวน $Page มากกว่า $Num_Pages";
$sqlcnt_id .= " LIMIT $Page_start, $Per_Page";
$sql_condition1 = "select * from per_status where per_one= '0' and per_two = '0' ";
$result_condition1 = mysql_db_query($db,$sql_condition1);
$num_condition1 = mysql_num_rows($result_condition1);
?>
<? echo" รายการรอพิจารณา<br>";
echo"<br>";
?>
<table width="100%" border="1" bordercolor="#ccaaff">
<tr>
<td><center>สถานะ</td>
<td><center>อนุมัติเลขที่</td>
<td><center>เรื่อง</td>
<td><center>วันที่เดินทางไป/กลับ</td>
<td><center>เวลาเดินทางไป/กลับ</td>
</tr>
<? if ($num_condition1>"0") {
$show_st1 ="ยังไม่พิจารณา";
$result = mysql_query( $sqlcnt_id );
$sql_App_dep= "select * from approver where username = '$login_true' ";
$re_App_dep=mysql_db_query($db,$sql_App_dep);
$result_App_dep=mysql_fetch_array($re_App_dep);
//echo"$result_App_dep";
$sql_log_App="select * from permission where dep_id = $result_App_dep[dep_id] ";
$re_log_App=mysql_db_query($db,$sql_log_App);
$num_log_App=mysql_num_rows($re_log_App);
if($num_log_App>0){
for($i=1; $i<=$num_log_App; $i++){
$result_log_App=mysql_fetch_array($re_log_App);
$sql_status1 = "select * from per_status where permission_id = '$result_log_App[permission_id]' ";
$re_status1=mysql_db_query($db,$sql_status1);
$result_status1=mysql_fetch_array($re_status1);
if ($result_status1[per_one]== "0" and $result_status1[per_two]== "0" ){
$show_st ="ยังไม่พิจารณา";
echo" <tr >
<td align='center'>$show_st</td>
<td align='center' >$result_log_App[permission_id]</td>
<td width=\"30%\"align='center'><A HREF=\"req_usecarApp.php?idrepair_list=$result_log_App[permission_id]\">$result_log_App[go_usecar]</A></td>
<td align='center'>$result_log_App[demo]<br>$result_log_App[demo2]</td>
<td align='center'>$result_log_App[time_start].$result_log_App[minute_start]<br>$result_log_App[time_stop].$result_log_App[minute_stop]</td>
</tr>";
}
}
}?>
</table><br />
<?
}
$sql_condition2 = "select * from per_status where (per_one= '1' and per_two = '0') or (per_one= '2' and per_two = '0') ";
$result_condition2 = mysql_db_query($db,$sql_condition2);
$num_condition2 = mysql_num_rows($result_condition2);
?>
<? echo"<br>"; ?>
<? echo" รายการพิจารณาเรียบร้อยแล้ว<br>";
?>
<table width="100%" border="1"bordercolor="#ccaaff">
<tr>
<td><center>สถานะ</td>
<td><center>อนุมัติเลขที่</td>
<td><center>เรื่อง</td>
<td><center>วันที่เดินทางไป/กลับ</td>
<td><center>เวลาเดินทางไป/กลับ</td>
</tr>
<?
if ($num_condition2>"0") {
$show_st2 ="พิจารณาแล้ว";
$result = mysql_query( $sqlcnt_id );
$sql_App_dep= "select * from approver where username = '$login_true' ";
$re_App_dep=mysql_db_query($db,$sql_App_dep);
$result_App_dep=mysql_fetch_array($re_App_dep);
//echo"$result_App_dep";
$sql_log_App="select * from permission where dep_id = $result_App_dep[dep_id] ";
$re_log_App=mysql_db_query($db,$sql_log_App);
$num_log_App=mysql_num_rows($re_log_App);
if($num_log_App>0){
for($i=1; $i<=$num_log_App; $i++){
$result_log_App=mysql_fetch_array($re_log_App);
$sql_status1 = "select * from per_status where permission_id = '$result_log_App[permission_id]' ";
$re_status1=mysql_db_query($db,$sql_status1);
$result_status1=mysql_fetch_array($re_status1);
if($result_status1[per_one]== "1" and $result_status1[per_two]== "0"){
$show_st ="พิจารณาแล้ว";
echo"
<tr >
<td align='center'>$show_st</td>
<td align='center' >$result_log_App[permission_id]</td>
<td width=\"30%\"align='center'><A HREF=\"req_usecarApp.php?idrepair_list=$result_log_App[permission_id]\">$result_log_App[go_usecar]</A></td>
<td align='center'>$result_log_App[demo]<br>$result_log_App[demo2]</td>
<td align='center'>$result_log_App[time_start].$result_log_App[minute_start]<br>$result_log_App[time_stop].$result_log_App[minute_stop]</td>
</tr>
";
} elseif($result_status1[per_one]== "2" and $result_status1[per_two]== "0" ){
$show_st ="พิจารณาแล้ว";
echo"
<tr >
<td align='center'>$show_st</td>
<td align='center' >$result_log_App[permission_id]</td>
<td width=\"30%\"align='center'><A HREF=\"req_usecarApp.php?idrepair_list=$result_log_App[permission_id]\">$result_log_App[go_usecar]</A></td>
<td align='center'>$result_log_App[demo]<br>$result_log_App[demo2]</td>
<td align='center'>$result_log_App[time_start].$result_log_App[minute_start]<br>$result_log_App[time_stop].$result_log_App[minute_stop]</td>
</tr>";
}
}
}?>
<br />
<?
}
//close table 2
echo"</table>";
break;
case "6":
echo "คณบดี";
//กรณี case 6 คณะบดี
?>
<?
echo"<br>";
/* $sqlcnt_id = "select distinct(permission_id) from permission order by permission_id";
$Per_Page = 10;
if ( !$Page )
$Page = 1;
$Prev_Page = $Page - 1;
$Next_Page = $Page + 1;
$result = mysql_query( $sqlcnt_id );
$Page_start = ( $Per_Page * $Page ) - $Per_Page;
$Num_Rows = mysql_num_rows( $result );
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;
if ( ( $Page > $Num_Pages ) || ( $Page < 0 ) )
print "จำนวน $Page มากกว่า $Num_Pages";
$sqlcnt_id .= " LIMIT $Page_start, $Per_Page";
$result = mysql_query( $sqlcnt_id ); */
$sqlcnt_id = "select a.permission_id from permission a inner join per_status b on a.permission_id = b.permission_id and ((b.per_one = '1' and b.per_two = '0') or (b.per_one = '1' and b.per_two = '1') or (b.per_one = '1' and b.per_two = '2'))";
$Per_Page = 10;
if ( !$Page )
$Page = 1;
$Prev_Page = $Page - 1;
$Next_Page = $Page + 1;
$result = mysql_query( $sqlcnt_id );
$Page_start = ( $Per_Page * $Page ) - $Per_Page;
$Num_Rows = mysql_num_rows( $result );
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;
if ( ( $Page > $Num_Pages ) || ( $Page < 0 ) )
print "จำนวน $Page มากกว่า $Num_Pages";
$sqlcnt_id .= " LIMIT $Page_start, $Per_Page";
$sql_condition1 = "select * from per_status where per_one= '1' and per_two = '0' ";
$result_condition1 = mysql_db_query($db,$sql_condition1);
$num_condition1 = mysql_num_rows($result_condition1);
?>
<? echo" รายการรอพิจารณา<br>";
echo"<br>";
?>
<table width="100%" border="1" bordercolor="#ccaaff">
<tr>
<td><center>สถานะ</td>
<td><center>อนุมัติเลขที่</td>
<td><center>เรื่อง</td>
<td><center>วันที่เดินทางไป/กลับ</td>
<td><center>เวลาเดินทางไป/กลับ</td>
</tr>
<? if ($num_condition1>"0") {
$show_st1 ="ยังไม่พิจารณา";
$result = mysql_query( $sqlcnt_id );
$recnt_id = mysql_db_query($db,$sqlcnt_id);
while($rscnt_id = mysql_fetch_array($recnt_id)){
$sqlapp = "select * from permission where permission_id = $rscnt_id[permission_id] ";
$reapp = mysql_db_query($db,$sqlapp);
$rsapp = mysql_fetch_array($reapp);
// $sql_status1 = "select * from repair_status where repair_id = '$rsapp[subject_repair]' ";
$sql_status1 = "select * from per_status where permission_id = '$rscnt_id[permission_id]' ";
$re_status1 = mysql_db_query($db,$sql_status1);
$result_status1 = mysql_fetch_array($re_status1);
if ($result_status1[per_one]== "1" and $result_status1[per_two]== "0" ){
echo" <tr >
<td align='center'>$show_st1</td>
<td align='center' >$rsapp[permission_id]</td>
<td width=\"30%\"align='center'><A HREF=\"req_usecarApp.php?idrepair_list=$rsapp[permission_id]\">$rsapp[go_usecar]</A></td>
<td align='center'>$rsapp[demo]<br>$rsapp[demo2]</td>
<td align='center'>$rsapp[time_start].$rsapp[minute_start]<br>$rsapp[time_stop].$rsapp[minute_stop]</td>
</tr>";
}
}?>
</table><br />
<?
}
//close table 1
// openShow table2
$sql_condition2 = "select * from per_status where (per_one= '1' and per_two = '1') or (per_one= '1' and per_two = '2') ";
$result_condition2 = mysql_db_query($db,$sql_condition2);
$num_condition2 = mysql_num_rows($result_condition2);
?>
<? echo"<br>"; ?>
<? echo" รายการพิจารณาเรียบร้อยแล้ว<br>";
echo"<br>";
?>
<table width="100%" border="1"bordercolor="#ccaaff">
<tr>
<td><center>สถานะ</td>
<td><center>อนุมัติเลขที่</td>
<td><center>เรื่อง</td>
<td><center>วันที่เดินทางไป/กลับ</td>
<td><center>เวลาเดินทางไป/กลับ</td>
</tr>
<?
if ($num_condition2>"0") {
$show_st2 ="พิจารณาแล้ว";
$result = mysql_query( $sqlcnt_id );
$recnt_id = mysql_db_query($db,$sqlcnt_id);
while($rscnt_id = mysql_fetch_array($recnt_id)){
$sqlapp = "select * from permission where permission_id = $rscnt_id[permission_id] ";
$reapp = mysql_db_query($db,$sqlapp);
$rsapp = mysql_fetch_array($reapp);
// $sql_status1 = "select * from repair_status where repair_id = '$rsapp[subject_repair]' ";
$sql_status1 = "select * from per_status where permission_id = '$rscnt_id[permission_id]' ";
$re_status1 = mysql_db_query($db,$sql_status1);
$result_status1 = mysql_fetch_array($re_status1);
if ($result_status1[per_one]== "1" and $result_status1[per_two]== "1" ){
echo" <tr >
<td align='center'>$show_st2</td>
<td align='center' >$rsapp[permission_id]</td>
<td width=\"30%\"align='center'><A HREF=\"req_usecarApp.php?idrepair_list=$rsapp[permission_id]\">$rsapp[go_usecar]</A></td>
<td align='center'>$rsapp[demo]<br>$rsapp[demo2]</td>
<td align='center'>$rsapp[time_start].$rsapp[minute_start]<br>$rsapp[time_stop].$rsapp[minute_stop]</td>
</tr>";
} elseif ($result_status1[per_one]== "1" and $result_status1[per_two]== "2" ){
echo" <tr >
<td align='center'>$show_st2</td>
<td align='center' >$rsapp[permission_id]</td>
<td width=\"30%\"align='center'><A HREF=\"req_usecarApp.php?idrepair_list=$rsapp[permission_id]\">$rsapp[go_usecar]</A></td>
<td align='center'>$rsapp[demo]<br>$rsapp[demo2]</td>
<td align='center'>$rsapp[time_start].$rsapp[minute_start]<br>$rsapp[time_stop].$rsapp[minute_stop]</td>
</tr>";
}
}?>
<br />
<?
}
//close table 2
echo"</table>";
break;
default:
echo "คุณไม่ได้รับอนุญาตเข้าใช้งานระบบ";
}
}else{
header("Location: index.php");
}
?>
<p class="Small"><? echo"<br>"; ?>
<span class="style2"> รวมทั้งหมด <b><?php echo $Num_Rows; ?></b> รายการ| <b><?php echo $Num_Pages; ?></b> หน้า|หน้าที่
<?php
/* สร้างปุ่มย้อนกลับ */
if ( $Prev_Page )
echo "<a href=\"$PHP_SELF?Page=$Prev_Page\"><< ถอยหลัง </a>";
/* สร้างตัวเลขหน้า */
for ( $i=1; $i<=$Num_Pages; $i++ )
{
if ( $i != $Page )
echo "[<a href=\"$PHP_SELF?Page=$i\">$i</a>]";
else
echo " <b>$i</b> ";
}
/* สร้างปุ่มเดินหน้า */
if ( $Page != $Num_Pages )
echo "<a href=\"$PHP_SELF?Page=$Next_Page\"> เดินหน้า >></a>";
?>
</boby>
</span>
<p> </p>
</form>
</div>
<map name="Map" id="Map"><area shape="rect" coords="503,2,555,25" href="#http://www.sanook.com" />
<area shape="rect" coords="569,3,630,21" href="#http://www.sanook.com" />
<area shape="rect" coords="644,1,697,26" href="#" /></map>
<map name="Map2" id="Map2">
<area shape="rect" coords="574,2,630,20" href="login.php" />
<area shape="rect" coords="376,3,429,20" href="index.php" />
<area shape="rect" coords="644,2,699,19" />
</map>
</body>
</html>
Tag : - - - -
|
|
|
|
|
|
Date :
2010-03-18 14:57:59 |
By :
chonsenger |
View :
888 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ผมอยากจะให้มันแสดงผล โดยผ่านในรูปแบบ Form Table ธรรมดาอ่ะครับ
อยากขอคำแนะนำ หรือ วิธีทำหน่อยครับ :)
|
|
|
|
|
Date :
2010-03-18 14:59:04 |
By :
chonsenger |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|