Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 12th, 2004, 02:43 PM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Kilbey1 Send a message via AIM to Kilbey1
Default How to calculate after calculating through POST?

I've got a form that essentially calculates a worker's withholdings, exemptions, etc. I have managed this through functions, but I've also done some calculations right in the form itself. It works; I get the results I want.

But now, I need to total all columns to get "TOTAL COST". How do I manage this?

Here is an example output so you can see what I'm talking about.

Example code:

Code:
<div align="right">$<?php echo number_format(GLIcalc($_POST['salary']) * 12, 2); ?></div>
Example output:

CALCULATOR RESULTS

State: CA
Salary: 5000 (assumed monthly for test purposes)


 Yearly Monthly Hourly
SSA $3,720.00 $310.00 $1.85
Mth-Medicare $870.00 $72.50 $0.43
Mth-SUI $2,040.00 $170.00 $1.01
G/L Ins $420.00 $35.00 $0.21
WC $1,212.00 $101.00 $0.60
FUTA $56.00 $40.00 $0.24
Retirement
 $ 1200 $ 100.00 $ 0.595238095238
Health $ 1800 $ 150.00 $ 0.892857142857
Vacation $ 1200 $ 100.00 $ 0.595238095238
Total Cost







Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating time Marta Access 0 April 15th, 2008 10:34 PM
calculating work_days jonsey SQL Server 2005 1 February 5th, 2008 05:37 PM
Calculating ashik112 ASP.NET 1.0 and 1.1 Basics 2 February 14th, 2007 12:49 PM
calculating values aceconcepts PHP How-To 0 February 16th, 2006 09:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.