기본 예산 정보를 묻는 간단한 계산기 양식이 있습니다.서식 처리에서 백분율 계산
사용자 이름, 봉급 (1 개) 양, 봉급이 금액, 임대료, 유틸리티 .....
어떻게 든 나는 총 소득의 비율로 개별적으로 모든 비용 필드를 계산해야합니다. 나는 이것을하는 방법을 모르겠다. 나는 많은 튜토리얼을 거쳤으며 그들 중 누구도 소스 파일을 가지고 작업하지 않았다.
여기 내 처리 PHP입니다. 물론 올바른 방향으로 밀어 넣을 수 있습니다. 감사! 임대료 30 및 총 소득 비가 100 인 경우
<?php
if ($_POST['sum1'] == "yes")
{
$name = $_POST['name'];
$month = $_POST['month'];
$year = $_POST['year'];
$pay1 = $_POST['pay1'];
$pay2 = $_POST['pay2'];
$other1 = $_POST['other1'];
$other2 = $_POST['other2'];
$rent = $_POST['rent'];
$repair = $_POST['repair'];
$utility = $_POST['utility'];
$invest = $_POST['invest'];
$insure = $_POST['insure'];
$groceries = $_POST['groceries'];
$student = $_POST['student'];
$travel = $_POST['travel'];
$ccard1 = $_POST['ccard1'];
$ccard2= $_POST['ccard2'];
$cell = $_POST['cell'];
$cable = $_POST['cable'];
$misc1 = $_POST['misc1'];
$misc2 = $_POST['misc2'];
$ttl_inc = $pay1+$pay2+$other1+$other2;
$ttl_exp = $rent+$repair+$utility+$invest+$insure+$travel+$ccard1+$ccard2+$cell+$cable+$misc1+$misc2+$student+$groceries;
$total = $pay1+$pay2+$other1+$other2-$rent-$repair-$utility-$invest-$insure-$travel-$ccard1-$ccard2-$cell-$cable-$misc1-$misc2-$student-$groceries;
echo "<h2>Budget Recap Prepared For {$name} For Period: {$month} {$year}</h2> <br />";
echo "<br />";
echo "<h3>Income</h3> <br />";
echo "<br />";
echo "Pay Period 1: $ {$pay1} <br />";
echo "Pay Period 2: $ {$pay2} <br />";
echo "Other Income 1: $ {$other1} <br />";
echo "Other Income 2: $ {$other2} <br />";
echo "<strong>TOTAL INCOME: $ {$ttl_inc} </strong><br />";
echo "<br />";
echo "<h3>Expenses</h3> <br />";
echo "<br />";
echo "Rent: $ {$rent} <br />";
echo "Utilities: $ {$utility} <br />";
echo "Groceries: $ {$groceries} <br />";
echo "Insurance: $ {$insure} <br />";
echo "Credit Card 1: $ {$ccard1} <br />";
echo "Credit Card 2: $ {$ccard2} <br />";
echo "Repairs/Maintenance: $ {$repair} <br />";
echo "Savings/Investments: $ {$invest} <br />";
echo "Student Loans: $ {$student} <br />";
echo "Transportation: $ {$travel} <br />";
echo "Cell/Mobile Phone: $ {$cell} <br />";
echo "Cable/Internet/Other: $ {$cable} <br />";
echo "Other Expenses 1: $ {$misc1} <br />";
echo "Other Expenses 2: $ {$misc2} <br />";
echo "<strong>TOTAL EXPENSES: $ - {$ttl_exp} </strong><br />";
echo "<br />";
echo "<strong>NET INCOME FOR {$month} {$year} : $ {$total} </strong><br />";
}
?>
그것은 간단한 기본 (현실) 수학입니다. 모두를 더한 다음 100으로 나눕니다. "퍼센트"는 2 단어로 구성됩니다 : '당'과 '센트'. '센트 '라틴어로 백. –
백분율을 계산하기위한 솔루션을 찾기 위해 검색 한 튜토리얼 중 몇 가지를 지적 해 주시겠습니까? 그냥 궁금해서! – Uours