hi need a hand here..
im having trouble in making my code work(well actually im not getting it)what i need to do is to compute the rate of vehicle that is rented..the only thing ta ht i came up is with the perday rate and the other 2 i cant find a way(i really sucks with formula )here is the thing..
SELF - DRIVE RATES
1. Minimum rental periods :
Daily - 24 hours
Weekly - 7 days
Monthly - 30 days
CAR
Toyota VIOS 1.3 MT
DAILY
2,500
WEEKLY
15,000
MONTHLY
52,500
and this is the code that i can came up
please see attached image to see the output..in need of lot of help right now
im having trouble in making my code work(well actually im not getting it)what i need to do is to compute the rate of vehicle that is rented..the only thing ta ht i came up is with the perday rate and the other 2 i cant find a way(i really sucks with formula )here is the thing..
SELF - DRIVE RATES
1. Minimum rental periods :
Daily - 24 hours
Weekly - 7 days
Monthly - 30 days
CAR
Toyota VIOS 1.3 MT
DAILY
2,500
WEEKLY
15,000
MONTHLY
52,500
and this is the code that i can came up
Code:
<?php
$vehicle;
$rday=$_POST['txtrday'];
$pday=$_POST['txtpday'];
$phr;
$total;
$totalhr;
$pday;
$totald;
$totalday;
$rmonth;
$pmonth;
$totalm;
$totalmonth;
if($vehicle=="Toyota VIOS 1.3 MT")
{
$perday=2500;
$permonth=52500;
$perweek=15000;
if($rday>$pday)
{
$totald=($rday)-($pday);
}
else if($rday==$pday)
{
$totalday=$perday;
}
if($rmonth>$pmonth)
{
$totalm=$rmonth-$pmonth;
}
else if($rmonth==$pmonth)
{
$totalmonth;
}
$totalday=$perday * $totald+2500;
$totalmonth=$totalm * $permonth;
$rate=$totalday + $totalmonth;
}
?>
Comment