0

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 that 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

<?php
$rday=$_POST['txtrday'];
$pday=$_POST['txtpday'];
  $vehicle;

    $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;     
}
?>

this will be the weekly rate output

e.g
form1
vehicle=Toyota VIOS 1.3 MT
pday=3
rday=10
when click submit it will be directed in

form2

rate=15000

because it is already equivalent to 7 days

in need of lot of help right now ..this will be the last part of my project so please

Edited by ehpratah: forgot something

1
Contributor
3
Replies
12
Views
5 Years
Discussion Span
Last Post by ehpratah
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.