|
|
|
ทำไม function ผมไม่ทำงานรันแล้วก็ไม่ error ผิดตรงไหนแก้ยังไงคับ |
|
|
|
|
|
|
|
ทำไม ทำไม funcn ผมไม่ทำงานรันแล้วก็ไม่errorผิดตรงไหนแก้ยังไงคับ
<?php
session_start();
?>
<html>
<head>
<title>ออกบิลการขาย</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link rel="shortcut icon" href="../zom.ico">
<link href="admin.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style3 {color: #666666;
font-size: small;
font-weight: bold;
font-family: "Courier New", Courier, monospace;
}
.style29 { color: #000000;
font-weight: bold;
}
.style30 {
color: #008000;
font-weight: bold;
}
.style13 {font-family: "Courier New", Courier, monospace; font-size: 18px; font-weight: bold; color: #666666; }
.style19 {font-family: "Courier New", Courier, monospace; font-size: 16px; font-weight: bold; color: #666666; }
.style22 {font-size: 16px; font-family: "Courier New", Courier, monospace; }
.style28 {font-size: 16px}
-->
</style>
</head>
<script language="JavaScript">
<!--
function delsure(){
question = confirm("คุณแน่ใจว่าต้องการจะลบ!!")
if (question !="0"){
return ture;
}
}
-->
</script>
<script language="JavaScript">
var flag=0;
function checkNum(){
var v4 = document.num.num_get.value;
if ( v4.length == ""){
alert("กรุณาใส่จำนวนสินค้าด้วยค่ะ");
document.num.num_get.focus();
return false;
}
else if (v4.length == 0){
alert("กรุณาใส่จำนวนสินค้าด้วยค่ะ");
document.num.num_get.focus();
return false;
}
else
flag=1;
return true;
}
</script>
<body onmouseover="window.status=':::. Lover Delivery page Admin Editor :::..'; return true" onmouseout="window.status=':::. Lover Delivery page Admin Editor :::.. '; return true" oncontextmenu="return false">
<form name="form1" method="post" action="">
<p>
<?
include("config.php");
$sql1 = "SELECT * FROM fixproduct"; //SELECT แรกดึกข้อมูลในTabel และแสดงจำนวน
mysql_query("SET NAMES 'tis620'");
$table1 = mysql_query($sql1,$conn) or die("ไม่สามารถติดต่อฐานข้อมูลได้1");
$totalrow = mysql_num_rows($table1);
$pagesize=10; //แสดงจำนวนคนโพสต่อหน้า
$totalpage=(int)($totalrow/$pagesize); //แบ่งหน้า-ทั้งหารจำนวณคนต่อหน้า
if(($totalrow%$pagesize)!=0){
$totalpage+=1;
}
if(isset($_GET['page'])){
$pageno=$_GET['page'];
$start=$pagesize*($pageno-1);
}
else{
$pageno=1;
$start=0;
}
?>
</p>
<table width="813" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td width="832" bgcolor="#EDF7DE"><table width="809" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse; border: 1px dotted #008000">
<tr>
<td height="28" colspan="7"><span class="style3"><span class="style29">:: ข้อมูลการสั่งซื้อ :: </span></span></td>
</tr>
<tr>
<td colspan="7">จำนวนสินค้าทั้งหมดมี
<?=$totalrow?>
รายการ
<?
if($pageno >1){
echo " <a href='orders.php?page=",$pageno-1,"'>หน้าที่แล้ว</a> |";
}
for($i=1;$i<=$totalpage;$i++){
if($pageno==$i){
echo "<b>no ".$i."</b> |";
}
else{
echo " <a href=\"orders.php?page=$i\">$i</a> |";
}
}
if($pageno<$totalpage){
echo " <a href='orders.php?page=",$pageno+1,"'>หน้าถัดไป</a>";
}
?></td>
</tr>
<td width="74" height="32"><div align="center">รหัสสินค้า</div></td>
<td width="281"><div align="center">ชื่อสินค้า</div></td>
<td width="87"><div align="center">ราคา</div></td>
<td width="74"><div align="center">คะแนน</div></td>
<td width="33"><div align="center">จำนวน</div></td>
<td width="138"><div align="center">รวม</div></td>
<td width="106"><div align="center">รวมคะแนน</div></td>
</tr>
<?php
if($totalrow==0) {
echo "<font color=#FFFFFF>ยังไม่มีรายชื่อสมาชิกในระบบ</font>";
}
else{
$sql3 ="SELECT * FROM fixproduct ORDER BY IDProduct ASC"; // SELECT data product
mysql_query("SET NAMES 'tis620'");
$table3 = mysql_query($sql3,$conn) or die("ไม่สามารถติดต่อฐานข้อมูลได้");
while($row=mysql_fetch_array($table3)){
$id = $row['IDProduct'];
$Description = $row['Description'];
$Retail = $row['Retail'];
$PV = $row['PV'];
?>
<tr bgcolor="#FFFFCC">
<td width="74"border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="left"><? echo $id ?></div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="left"><span class="style1">
<?=$row['Description']?>
</span></div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="right"><?php echo number_format($row['Retail'],2,'.',','); ?></div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="right"><span class="style1">
<?=$row['PV']?>
</span></div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<input name="num_get" type="text" class="textfild" id="num_get" size="3" maxlength="3" value="<? echo $qty;?>">
</div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<?php
if(isset($num_get) && $num_get != 0)
{
$_SESSION['ses_num'] = $num_get;
if($num_get = stristr($num_get,"-"))
{
echo "จำนวนที่กรอกติดลบ";
}
else
{
$num = $_SESSION['ses_num'];
$_SESSION['ses_numget'] = $num;
$total_price = ($num*$Retail);
$_SESSION['ses_totalprice'] = $total_price;
echo $total_price;
echo "\n\nบาท";
}
}
?>
</div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<div align="right">
<?php
$total_PV = ($num*$PV);
$_SESSION['ses_totalPV'] = $total_PV;
echo $total_PV;
echo "\n\nPV";
?>
</div>
<div align="right">
<?php
$count--;
}
}
include("endconnect.inc.php");
?>
</div>
</div></td>
</tr>
<tr bgcolor="#FFFFCC">
<td height="27" colspan="5" valign="top"><div align="right"><b><font color="#008000">รวม:</font></b></div>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<?php
$TalBa = ($total_price+$total_price);
$_SESSION['ses_TalBa'] = $TalBa;
echo $TalBa;
echo "\n\nบาท";
?>
</div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center"></div></td>
</tr>
<tr bgcolor="#FFFFCC">
<td height="27" colspan="5"><div align="right"><b><font color="#008000"> ภาษีมูลค่าเพิ่ม (7%):</font></b> </div>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<?php
$total_vat = ($TalBa*0.07);
$_SESSION['ses_totalvat'] = $total_vat;
echo $total_vat;
echo "\n\nบาท";
?>
</div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center"></div></td>
</tr>
<tr bgcolor="#FFFFCC">
<td height="27" colspan="5"><div align="right"><b><font color="#008000">ราคารวมทั้งสิ้น</font></b><font color="#008000"></font><span class="style30">:</span> </div>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<?php
$total_TalBa = ($TalBa+total_vat);
$_SESSION['ses_total_TalBa'] = $total_TalBa;
echo $total_TalBa;
echo "\n\nบาท";
?>
</div> </td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"> </td>
</tr>
<tr bgcolor="#FFFFCC">
<td height="27" colspan="7"><div align="center">
<input type="submit" name="Submit" value="คำนวนราคา" class="bottom1">
<br />
</div>
<div align="right"><a href="adminproduct-del-all.php" onClick="delsure(); return false;"></a></div>
<div align="center"></div>
<div align="center"></div> </tr>
</table></td>
</tr>
</table>
<p> </p>
</form>
<p> </p>
</body>
</html>
Tag : - - - -
|
|
|
|
|
|
Date :
2009-08-03 21:36:51 |
By :
gofgof |
View :
878 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่ทำงานอยู่แล้วครับ function ไม่มีสักตัว
|
|
|
|
|
Date :
2009-08-03 22:45:25 |
By :
teez1232002 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เห็นแวปๆๆ
function delsure(){
question = confirm("คุณแน่ใจว่าต้องการจะลบ!!")
if (question !="0"){
return ture;
}
นี่เหรอที่ไม่ทำงาน รึตัวไหน
|
|
|
|
|
Date :
2009-08-03 22:48:40 |
By :
teez1232002 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
คับคือตัวที่ไม่ทำงานfunctionใบเสร็จ+-ราคาคับ
|
|
|
|
|
Date :
2009-08-04 02:31:48 |
By :
gofgof |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอโทษคับที่คำถามทำให้ งง functionตรงนี้คับ
<form name="form1" method="post" action="">
<p>
<?
include("config.php");
$sql1 = "SELECT * FROM fixproduct"; //SELECT แรกดึกข้อมูลในTabel และแสดงจำนวน
mysql_query("SET NAMES 'tis620'");
$table1 = mysql_query($sql1,$conn) or die("ไม่สามารถติดต่อฐานข้อมูลได้1");
$totalrow = mysql_num_rows($table1);
$pagesize=10; //แสดงจำนวนคนโพสต่อหน้า
$totalpage=(int)($totalrow/$pagesize); //แบ่งหน้า-ทั้งหารจำนวณคนต่อหน้า
if(($totalrow%$pagesize)!=0){
$totalpage+=1;
}
if(isset($_GET['page'])){
$pageno=$_GET['page'];
$start=$pagesize*($pageno-1);
}
else{
$pageno=1;
$start=0;
}
?>
</p>
<table width="813" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td width="832" bgcolor="#EDF7DE"><table width="809" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse; border: 1px dotted #008000">
<tr>
<td height="28" colspan="7"><span class="style3"><span class="style29">:: ข้อมูลการสั่งซื้อ :: </span></span></td>
</tr>
<tr>
<td colspan="7">จำนวนสินค้าทั้งหมดมี
<?=$totalrow?>
รายการ
<?
if($pageno >1){
echo " <a href='orders.php?page=",$pageno-1,"'>หน้าที่แล้ว</a> |";
}
for($i=1;$i<=$totalpage;$i++){
if($pageno==$i){
echo "<b>no ".$i."</b> |";
}
else{
echo " <a href=\"orders.php?page=$i\">$i</a> |";
}
}
if($pageno<$totalpage){
echo " <a href='orders.php?page=",$pageno+1,"'>หน้าถัดไป</a>";
}
?></td>
</tr>
<td width="74" height="32"><div align="center">รหัสสินค้า</div></td>
<td width="281"><div align="center">ชื่อสินค้า</div></td>
<td width="87"><div align="center">ราคา</div></td>
<td width="74"><div align="center">คะแนน</div></td>
<td width="33"><div align="center">จำนวน</div></td>
<td width="138"><div align="center">รวม</div></td>
<td width="106"><div align="center">รวมคะแนน</div></td>
</tr>
<?php
if($totalrow==0) {
echo "<font color=#FFFFFF>ยังไม่มีรายชื่อสมาชิกในระบบ</font>";
}
else{
$sql3 ="SELECT * FROM fixproduct ORDER BY IDProduct ASC"; // SELECT data product
mysql_query("SET NAMES 'tis620'");
$table3 = mysql_query($sql3,$conn) or die("ไม่สามารถติดต่อฐานข้อมูลได้");
while($row=mysql_fetch_array($table3)){
$id = $row['IDProduct'];
$Description = $row['Description'];
$Retail = $row['Retail'];
$PV = $row['PV'];
?>
<tr bgcolor="#FFFFCC">
<td width="74"border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="left"><? echo $id ?></div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="left"><span class="style1">
<?=$row['Description']?>
</span></div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="right"><?php echo number_format($row['Retail'],2,'.',','); ?></div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="right"><span class="style1">
<?=$row['PV']?>
</span></div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<input name="num_get" type="text" class="textfild" id="num_get" size="3" maxlength="3" value="<? echo $qty;?>">
</div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<?php
if(isset($num_get) && $num_get != 0)
{
$_SESSION['ses_num'] = $num_get;
if($num_get = stristr($num_get,"-"))
{
echo "จำนวนที่กรอกติดลบ";
}
else
{
$num = $_SESSION['ses_num'];
$_SESSION['ses_numget'] = $num;
$total_price = ($num*$Retail);
$_SESSION['ses_totalprice'] = $total_price;
echo $total_price;
echo "\n\nบาท";
}
}
?>
</div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<div align="right">
<?php
$total_PV = ($num*$PV);
$_SESSION['ses_totalPV'] = $total_PV;
echo $total_PV;
echo "\n\nPV";
?>
</div>
<div align="right">
<?php
$count--;
}
}
include("endconnect.inc.php");
?>
</div>
</div></td>
</tr>
<tr bgcolor="#FFFFCC">
<td height="27" colspan="5" valign="top"><div align="right"><b><font color="#008000">รวม:</font></b></div>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<?php
$TalBa = ($total_price+$total_price);
$_SESSION['ses_TalBa'] = $TalBa;
echo $TalBa;
echo "\n\nบาท";
?>
</div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center"></div></td>
</tr>
<tr bgcolor="#FFFFCC">
<td height="27" colspan="5"><div align="right"><b><font color="#008000"> ภาษีมูลค่าเพิ่ม (7%):</font></b> </div>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<?php
$total_vat = ($TalBa*0.07);
$_SESSION['ses_totalvat'] = $total_vat;
echo $total_vat;
echo "\n\nบาท";
?>
</div></td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center"></div></td>
</tr>
<tr bgcolor="#FFFFCC">
<td height="27" colspan="5"><div align="right"><b><font color="#008000">ราคารวมทั้งสิ้น</font></b><font color="#008000"></font><span class="style30">:</span> </div>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"><div align="center">
<?php
$total_TalBa = ($TalBa+total_vat);
$_SESSION['ses_total_TalBa'] = $total_TalBa;
echo $total_TalBa;
echo "\n\nบาท";
?>
</div> </td>
<td border="1" style="border-collapse: collapse; border: 1px dotted #008000" bordercolor="#111111" cellpadding="0" cellspacing="0"> </td>
</tr>
<tr bgcolor="#FFFFCC">
<td height="27" colspan="7"><div align="center">
<input type="submit" name="Submit" value="คำนวนราคา" class="bottom1">
<br />
</div>
<div align="right"><a href="adminproduct-del-all.php" onClick="delsure(); return false;"></a></div>
<div align="center"></div>
<div align="center"></div> </tr>
</table></td>
</tr>
</table>
<p> </p>
</form>
ไม่errorแต่ไม่ทำงานไม่+-ราคาให้คับขอบคุณคับ
|
|
|
|
|
Date :
2009-08-04 02:51:57 |
By :
gofgof |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|