|
 |
|
ดูให้ทีครับผม ทำงานช้ามาก ใครมีไอเดียดีๆ แก้ให้ทีจ๊ะ ขอบคุณมากมาย |
|
 |
|
|
 |
 |
|
ยังไม่เสร็จอะครับ แต่ลองทดสอบเป็นส่วนๆ มาติดที่คำนวนดอกเบี้ยทบต้นนี่แหละครับ ทำงานช้าจัด
ใครไอเดียเจ๋งๆ ย่อให้ทีนะจ๊ะ
ขอบคุณมากมายคร้าบ
Code (PHP)
<?php
<?
set_time_limit(0);
$money=$_REQUEST['money'];
$interest=$_REQUEST['interest'];
$year=$_REQUEST['year'];
?>
<form action="interest.php" method="post"><center><table border="1"><tr><td><center>จำนวนเงินฝาก
ต่อเดือน</center></td><td><center>อัตราดอกเบี้ย (%)</center></td><td><center>จำนวนปีที่
ฝาก</center></td></tr><tr><td><input type="text" name="money" value="<?=$money;?
>"></td><td><input type="text" name="interest" value="<?=$interest;?>"></td><td><input type="text"
name="year" value="<?=$year;?>"></td></tr><tr><td colspan="3"><center><input type="submit"
value="คำนวน"></center></td></tr></table></center></form>
<?
$average=($interest/100)/365;
$m1=$average*31;
$m2=$average*28;
$m3=$average*31;
$m4=$average*30;
$m5=$average*31;
$m6=$average*30;
$m7=$average*31;
$m8=$average*31;
$m9=$average*30;
$m10=$average*31;
$m11=$average*30;
$m12=$average*31;
?>
<?
if($money!=""&&$interest!=""&&$year!=""){
?><center><table border="1"><tr><td colspan="4"><center>แบบที่ 1</center></td></tr>
<tr><td><center>ปีที่</center></td><td><center>เงินฝากประจำเดือน</center></td><td><center>ยอดคง
เหลือ</center></td><td><center>ดอกเบี้ยที่ได้</center></td></tr>
<?
$month=array($m1,$m2,$m3,$m4,$m5,$m6,$m7,$m8,$m9,$m10,$m11,$m12);
for($i=1;$i<=$year;$i++){
for($j=1;$i<=12;$j++){
if($i==1&&$j==1){
$total=$money+($money*$month[$j]);
$total=number_format($total, 2, '.', ',');
}
$total=$total+($total*$month[$j]);
}
print"<tr><td><center>$i</center></td><td><center>$money</center></td><td><center>$total</center>
</td><td><center></center></td></tr>";
}
?>
</table></center>
<?
}
?>
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-09-13 19:05:59 |
By :
monotakari |
View :
1110 |
Reply :
7 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สงสัยช้าเพราะ bug น่ะครับ
for($j=1;$i<=12;$j++){
|
 |
 |
 |
 |
Date :
2009-09-13 19:18:36 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วจะแก้ยังไงล่ะคับท่านพี่ num T-T
|
 |
 |
 |
 |
Date :
2009-09-13 19:20:33 |
By :
monotakari |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ดอกเบี้ย จะบาน 
|
 |
 |
 |
 |
Date :
2009-09-13 19:40:49 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เก็บดอกเขาแบบขูดรีดหรือเปล่าครับ อิอิอิ
|
 |
 |
 |
 |
Date :
2009-09-13 21:32:14 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ่อ ผมตาถั่ว 555
ขอบคุณมากนะครับ ได้แล้ว
นี่แหละน๊า ใช้ชื่อตัวแปลใกล้เคียงกัน ตัวคล้ายๆกัน
|
 |
 |
 |
 |
Date :
2009-09-13 22:54:38 |
By :
monotakari |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|