|
|
|
ขอ Code PHP เกี่ยวกับการคำนวณภาษีมูลค่าเพิ่ม 7% หน่อยครับ ขอบคุณครับ |
|
|
|
|
|
|
|
ยอดรวม <?php echo number_format($total,'2','.',',')?>บาท<br>
ภาษี 7 %
<?php
$tax = ($total*0.07);
?>
<?php echo number_format($tax,'2','.',',')?>บาท<br>
รวมทั้งสิ้น
<?php
$payment = ($total + $tax);
?>
|
|
|
|
|
Date :
14 พ.ย. 2551 08:18:45 |
By :
แง้ว |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ยอดรวม <?php echo number_format($total,'2','.',',')?>บาท<br>
ภาษี 7 %
<?php
$tax = ($total*0.07);
?>
<?php echo number_format($tax,'2','.',',')?>บาท<br>
รวมทั้งสิ้น
<?php
$payment = ($total + $tax);
?>
|
|
|
|
|
Date :
2009-04-22 17:59:56 |
By :
POOM |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr bordercolor="#333333" bgcolor="#FFFFFF">
<td width="20"><div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC"><strong>ที่</strong></font></div></td>
<td width="70" height="26"> <div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC"><strong>รหัสนักศึกษา</strong></font></div></td>
<td width="165"><div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC"><strong>ชื่อ
สกุล </strong></font></div></td>
<td width="30"><div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC"><strong>Md</strong></font></div></td>
<td width="30"><div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC"><strong>Fn</strong></font></div></td>
<td width="30"><div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC"><strong>Tt</strong></font></div></td>
<td width="30"><div align="center"><font size="3" face="AngsanaUPC, BrowalliaUPC, CordiaUPC"><strong>Gd</strong></font></div></td>
</tr>
</table>
<? $i=0;
while ($i<20){
?>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="20" height="20" align="center"> <font face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<?echo $i+1 ;?>
<input type="hidden" name="i2" value="<? echo $i ;?>">
</font></td>
<td width="70" height="20"> <div align="center"> <font face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<? echo $id_no;?>
</font></div></td>
<td width="165" height="20"> <font face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<?echo "$pname $name";?>
</font></td>
<td width="30"><div align="center"> <font face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<input name="t1" type="text" id="t1[" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" size="1" maxlength="2" style="width:20px;border:none;text-align:center;" />
</font></div></td>
<td width="30"><div align="center"> <font face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<input name="t2" type="text" id="t2" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" size="1" maxlength="2" style="width:20px;border:none;text-align:center; "/>
</font></div></td>
<td width="30"><div align="center"> <font face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<input name="t3" type="text" id="t3" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" size="1" maxlength="3" style="width:20px;border:none;text-align:center; "/>
</font></div></td>
<td width="30"><div align="center"> <font face="AngsanaUPC, BrowalliaUPC, CordiaUPC">
<input name="t4" type="text" id="t4[$a]" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" size="1" style="width:20px;border:none; text-align:center;"/>
</font></div></td>
</tr>
</table>
<font size="2"> </font>
<? $i++; } ?>
<font size="2"> </font><font size="2">
<script language="javascript">
var obj= document.all;
function sum(){
for (var a=0; a<100 ;a++){
obj.t3[a].value=parseInt(obj.t1[a].value)+parseInt(obj.t2[a].value);
if ((!obj.t1[a].value)||(!obj.t2[a].value))
{
obj.t3[a].value='-';
obj.t4[a].value='-';
}
else if (obj.t3[a].value>100)
{
obj.t4[a].value='Error';
}
else if ((obj.t3[a].value>=obj.a1.value)||(obj.t3[a].value==100))
{
obj.t4[a].value='A';
}
else if ((obj.t3[a].value>=obj.b1.value)&&(obj.t3[a].value<=obj.b2.value))
{
obj.t4[a].value='B+';
}
else if ((obj.t3[a].value>=obj.b3.value)&&(obj.t3[a].value<=obj.b4.value))
{
obj.t4[a].value='B';
}
else if ((obj.t3[a].value>=obj.c1.value)&&(obj.t3[a].value<=obj.c2.value))
{
obj.t4[a].value='C+';
}
else if ((obj.t3[a].value>=obj.c3.value)&&(obj.t3[a].value<=obj.c4.value))
{
obj.t4[a].value='C';
}
else if ((obj.t3[a].value>=obj.d1.value)&&(obj.t3[a].value<=obj.d2.value))
{
obj.t4[a].value='D+';
}
else if ((obj.t3[a].value>=obj.d3.value)&&(obj.t3[a].value<=obj.d4.value))
{
obj.t4[a].value='D';
}
else if (obj.t3[a].value<=obj.e2.value)
{
obj.t4[a].value='E';
}
}
}
</script>
</font><font face="AngsanaUPC, BrowalliaUPC, CordiaUPC"><strong></strong></font>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" >
<tr bordercolor="#000000" bgcolor="#FFFFFF">
<td width="150" height="15" align="center" ><strong>ช่วงคะแนน</strong></td>
<td width="55" height="15" align="center" ><strong>ระดับ</strong></td>
</tr>
<tr bordercolor="#000000" bgcolor="#FFFFFF">
<td width="150" height="15"><div align="center">
<input name="a1" type="text" id="a1" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="80" size="1" maxlength="3" style="width:24px;border:none;text-align:center; "/>
- 100</div></td>
<td width="55" height="15" align="center" >A</td>
</tr>
<tr bordercolor="#000000" bgcolor="#FFFFFF">
<td width="150" height="15"><div align="center">
<input name="b1" type="text" id="b1" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="75" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
-
<input name="b2" type="text" id="b2" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="79" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
</div></td>
<td width="55" height="15" align="center" > B+</td>
</tr>
<tr bordercolor="#000000" bgcolor="#FFFFFF">
<td width="150" height="15"><div align="center">
<input name="b3" type="text" id="b3" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="70" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
-
<input name="b4" type="text" id="b4" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="74" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
</div></td>
<td width="55" height="15" align="center" >B</td>
</tr>
<tr bordercolor="#000000" bgcolor="#FFFFFF">
<td width="150" height="26"><div align="center">
<input name="c1" type="text" id="c1" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="65" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
-
<input name="c2" type="text" id="c2" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="69" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
</div></td>
<td width="55" height="26" align="center" > C+</td>
</tr>
<tr bordercolor="#000000" bgcolor="#FFFFFF">
<td width="150" height="15"><div align="center">
<input name="c3" type="text" id="c3" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="60" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
-
<input name="c4" type="text" id="c4" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="64" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
</div></td>
<td width="55" height="15" align="center" >C</td>
</tr>
<tr bordercolor="#000000" bgcolor="#FFFFFF">
<td width="150" height="15"><div align="center">
<input name="d1" type="text" id="d1" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="55" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
-
<input name="d2" type="text" id="d2" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="59" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
</div></td>
<td width="55" height="15" align="center" > D+</td>
</tr>
<tr bordercolor="#000000" bgcolor="#FFFFFF">
<td width="150" height="15"><div align="center">
<input name="d3" type="text" id="d3" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="50" size="1" maxlength="2" style="width:24px;border:none; text-align:center;"/>
-
<input name="d4" type="text" id="d4" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="54" size="1" maxlength="2" style="width:24px;border:none; text-align:center; "/>
</div></td>
<td width="55" height="15" align="center" >D</td>
</tr>
<tr bordercolor="#000000" bgcolor="#FFFFFF">
<td width="150" height="15"><div align="center">
0 -
<input name="e2" type="text" id="e2" onFocus="sum()" onBlur="sum()" onChange="sum()" onKeyUp="sum()" value="49" size="1" maxlength="2" style="width:24px;border:none; text-align:center;"/>
</div></td>
<td width="55" height="15" align="center" > F</td>
</tr>
</table>
<div align="center"><font size="2"> </font></div>
|
|
|
|
|
Date :
2011-01-24 11:16:19 |
By :
444 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|