|
|
|
ช่วยหน่อยครับ จะเปลี่ยนไปอีกอีกหน้า แต่ จำนวนเงินมันไม่บวกเพิ่มจากหน้าเก่าครับ มีรูปครับ |
|
|
|
|
|
|
|
ต้องมีการส่งตัวแปรข้ามไปด้วยครับ
Code หงะ
|
|
|
|
|
Date :
2012-09-25 14:23:46 |
By :
popypreaw |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?
session_start();
include ("../config.php");
$eid = $_SESSION["eid"];
mysql_query("SET NAMES UTF8");
$checkin = "SELECT * FROM checkin INNER JOIN customer ON
checkin.ch_cid = customer.cid INNER JOIN employee ON checkin.ch_eid = employee.e_id INNER JOIN room ON
checkin.ch_rid = room.r_id ";
$Querycheckin = mysql_query($checkin);
function DateThai($strDate) {
$strYear = date("Y", strtotime($strDate)) + 543;
$strMonth = date("n", strtotime($strDate));
$strDay = date("j", strtotime($strDate));
$strHour = date("H", strtotime($strDate));
$strMinute = date("i", strtotime($strDate));
$strSeconds = date("s", strtotime($strDate));
$strMonthCut = Array("", "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.");
$strMonthThai = $strMonthCut[$strMonth];
return "$strDay $strMonthThai $strYear";
}
$Num_Rows = mysql_num_rows($Querycheckin);
$Per_Page = 1;
// Per Page
$Page_Start = 1;
$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;
}
$checkin .= " order by ch_id ASC LIMIT $Page_Start , $Per_Page";
$objQuery = mysql_query($checkin);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="../datestyle.css" />
<script type="text/javascript" src="../datepicker.js"></script>
<!-- jQuery -->
<!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>-->
<link rel="stylesheet" type="text/css" media="all" href="admin.css" />
<link rel="stylesheet" type="text/css" media="all" href="../style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>รายการ Check IN</title>
<script language="javascript">
function printpr() {
var OLECMDID = 7;
/* OLECMDID values:
* 6 - print
* 7 - print preview
* 1 - open window
* 4 - Save As
*/
var PROMPT = 1;
// 2 DONTPROMPTUSER
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(OLECMDID, PROMPT);
WebBrowser1.outerHTML = "";
}
</script>
</head>
<body>
<div id="wrapper">
<!-- left -->
<div id="left-col">
<div class="logo">
<img src="../images/home/logo.jpg" style="width: 279px;">
</div>
<ul class="userpanel">
<li><?=$_SESSION['useradmin']; ?></li>
<li><a href="chang_pwd.php">เปลี่ยนพาสเวิร์ด</a></li><br>
<li><a href="logout.php">ออกจากระบบ</a></li>
</ul>
<?
include ("sidemenuadmin.php");
?>
</div>
<!-- left -->
<!-- start right -->
<div id="right-col">
<div class="pageheader" style="height: 25px;">
<span class="h3" ><div style="float: left;" ></div><span>Check In</span></span>
</div>
<br>
<center>
<table class="bkstatus1" border="1" bordercolor="blue">
<tr>
<th>ห้องพักเลขที่</th>
<th>ประเภท</th>
<th>ชื่อลูกค้า</th>
<th>ชื่อพนักงานที่ Check IN</th>
<th>เช็คอิน</th>
<th>เช็คเอาท์</th>
<th>บริการเสริม</th>
<th>ราคารวม (บาท)</th>
</tr>
<?
while($row=mysql_fetch_array($objQuery))
{
$roomid = $row["ch_rid"];
$rtype = $row["r_type"];
$cname = $row["cname"];
$ename = $row["e_name"];
$checkin = $row["ch_startdate"];
$checkout = $row["ch_enddate"];
$net = $row["ch_balance"];
$price = number_format($row["ch_balance"]);
$service = explode(',', $row["ch_service"]);
$c = count($service);
$total +=$net;
// = $row["bookstatus"];
if($Page > 1)
{
$it += $total ;
}else{
$it = $total;
}
?>
<form name="frmupcheckin" method="post" action="update_checkin.php?book=<?=$row["book"]; ?>&booknum=<?=$row["booknum"]; ?>">
<tr>
<input type="hidden" name="book" value="<?=$row["book"]; ?>" />
<input type="hidden" name="booknum" value="<?=$row["booknum"]; ?>" />
<input type="hidden" name="roomid" value="<?=$row["bookrid"]; ?>" />
<input type="hidden" name="cid" value="<?=$row["bookcid"]; ?>" />
<input type="hidden" name="eid" value="<?=$eid; ?>" />
<input type="hidden" name="startdate" value="<?=$checkin; ?>" />
<input type="hidden" name="enddate" value="<?=$checkout; ?>" />
<input type="hidden" name="balance" value="<?=$row["bookprice"]; ?>" />
<input type="hidden" name="service" value="<?=$row["bookservice"]; ?>" />
<td><?=$roomid; ?></td>
<td><?=$rtype; ?></td>
<td><?=$cname; ?></td>
<td><?=$ename; ?></td>
<td><?=DateThai($checkin); ?></td>
<td><?=DateThai($checkout); ?></td>
<td>
<?for($i=0;$i<$c;$i++){
$sql1 = "select * from service_other where s_id = '$service[$i]'";
$query1 = mysql_query($sql1);
$res1 = mysql_fetch_array($query1);
?>
<?=$res1["s_name"] . "<br>"; ?><input type="hidden" name="sid[]" value="<?=$res1["s_id"]; ?>" />
<? } ?>
</td>
<td><font color="red"><b><?=$price; ?></b></font></td>
</form>
<?
}
?>
</tr>
<tr>
<td colspan="7" align="right"><font color="red"><b>รวมเงินทั้งสิ้น</b></font></td>
<td><?=number_format($it); ?></td>
</tr>
</table>
</center><br><br>
<div style="margin-left: 10px;float: left;">
<?echo "หน้าที่: ";
if ($Prev_Page) {
echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> ";
}
for ($i = 1; $i <= $Num_Pages; $i++) {
if ($i != $Page) {
echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]";
} else {
echo "<b> $i </b>";
}
}
if ($Page != $Num_Pages) {
echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> ";
}
?>
</div>
</div>
<!-- end left right -->
</div>
</body>
</html>
|
ประวัติการแก้ไข 2012-09-25 14:29:09
|
|
|
|
Date :
2012-09-25 14:28:36 |
By :
dorankseo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
if ($Prev_Page) {
echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&it=$it'><< Back</a> ";
}
for ($i = 1; $i <= $Num_Pages; $i++) {
if ($i != $Page) {
echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&it=$it'>$i</a> ]";
} else {
echo "<b> $i </b>";
}
}
if ($Page != $Num_Pages) {
echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&it=$it'>Next>></a> ";
}
ลองดูนะไม่รุได้ป่าวคับ
|
|
|
|
|
Date :
2012-09-25 14:39:17 |
By :
popypreaw |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้ละครับ ขอบคุณครับ
|
|
|
|
|
Date :
2012-09-25 14:47:30 |
By :
dorankseo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
^ ^
|
|
|
|
|
Date :
2012-09-25 14:48:25 |
By :
popypreaw |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|