473,473 Members | 4,208 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

help with the formula to compute rate

35 New Member
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

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.   $vehicle;
  3. $rday=$_POST['txtrday'];
  4. $pday=$_POST['txtpday'];
  5.     $phr;
  6.     $total;
  7.     $totalhr;
  8.     $pday;
  9.     $totald;
  10.     $totalday;
  11.     $rmonth;
  12.     $pmonth;
  13.     $totalm;
  14.     $totalmonth;
  15.  
  16. if($vehicle=="Toyota VIOS 1.3 MT")
  17. {
  18.     $perday=2500;
  19.     $permonth=52500;
  20.     $perweek=15000;
  21.  
  22.     if($rday>$pday)
  23.         {
  24.         $totald=($rday)-($pday);
  25.  
  26.         }
  27.     else if($rday==$pday)
  28.         {
  29.         $totalday=$perday;
  30.         }
  31.  
  32.  
  33.     if($rmonth>$pmonth)
  34.         {
  35.         $totalm=$rmonth-$pmonth;
  36.  
  37.  
  38.         }
  39.     else if($rmonth==$pmonth)
  40.         {
  41.         $totalmonth;
  42.         }
  43.  
  44.         $totalday=$perday * $totald+2500;
  45.         $totalmonth=$totalm * $permonth;
  46.         $rate=$totalday + $totalmonth;     
  47. }
  48. ?>
  49.  
please see attached image to see the output..in need of lot of help right now
Attached Images
File Type: jpg 1.jpg (19.8 KB, 137 views)
File Type: jpg 2.jpg (41.6 KB, 168 views)
Jun 21 '12 #1
1 1562
ehpratah
35 New Member
and if you need to see the actual web here is the link http://europcar1.com.ph/selfdrive.php

just choose NO in the part that will ask you if you have a corporate accnt..thanks
Jun 21 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Josh | last post by:
Howdy i am newb somewhat to programing and i was just for fun trying to compile a program that asks the user for an odd int less than 22 and then returns this ***************** ******* *********...
8
by: drose0927 | last post by:
Please help! I can't get my program to exit if the user hits the Escape button: When I tried exit(EXIT_SUCCESS), it wouldn't compile and gave me this error: Parse Error, expecting `'}''...
4
by: sara | last post by:
i am studying a computer engineering and i started taking programming using C++ since month i have question i think it`s easy for you all *prof.programmer* but it`s bit diffecult for me plzz i...
0
by: RaiderXCChamp | last post by:
Hi! I am supposed to create a program that will display an investment schedule in a list box for my Visual Basics Class. 1. It says that annual interest is calculated using the simple interest...
5
by: Drakscon | last post by:
Some one helped out but completely confused me. this is a senario so i can take it into the actually program im using(variables a, b, c, d are generic but i have commented about what they are for)...
8
by: teddarr | last post by:
I'm having trouble getting a mathmatical formula to work in my code. I am supposed to write a program in java that calculates the ending balance each month. The user is supposed to input the...
8
by: Energizer100 | last post by:
My assignment is LoanTable Background: When buying a home, a very important financial consideration that many buyers face is obtaining a qualifying loan from a financial institution. ...
2
by: aszush | last post by:
//Title: Programming Assignment 1 //Version: //Copyright: Copyright (c) 1999 //Author: Andrew //Company: //Description: Computes employee's weekly gross and net pay....
7
by: xirowei | last post by:
Let's say i create a String array that store 4 Alphabets {"A","B","C","D"} How can i get the result if i need permutation of 4P3 and 4P2? I had refer to many examples from the internet, but...
2
by: dreamer1963 | last post by:
Write a Java program without a graphical user interface that calculates and displays the monthly mortgage payment amount, given the amount of the mortgage, the term of the mortgage, and the interest...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.