-
Notifications
You must be signed in to change notification settings - Fork 0
/
cl_summary.php
214 lines (206 loc) · 8.94 KB
/
cl_summary.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?php
include("config.php");
// Everything that was collected in the previous forms
$cl_input = array();
foreach($_POST as $key => $value) {
$cl_input[$key] = $value;
}
$json = json_encode($cl_input);
if($_GET['download'] == 1) {
header('Content-disposition: attachment; filename=test.json');
header('Content-type: application/json');
echo $json;
exit;
}
?>
<!DOCTYPE HTML>
<html>
<?php
if('Production' != constant('DEPLOY_MODE')) {
echo '<h3>Site is running in ' . constant('DEPLOY_MODE') . ': all warnings and errors will be displayed!</h3>';
echo "<pre>";
require 'dump-errors.php';
echo "</pre>";
}
require_once('functions.php');
LogPostValuesToLog($_POST['this_log'], 'cl_income');
?>
<head>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
/**
* @brief Go to the results (cl_results.php) page
*/
function GoResults() {
$f = $('#cl_summary_form');
$f.submit();
}
function DownloadResults() {
var form = document.getElementById('cl_summary_form');
form.action = 'cl_summary.php?download=1';
form.submit();
}
</script>
</head>
<body>
<h1>Summary</h1>
<p>Here's all the data you've provided:
<?php
/**this is a summary table of all values entered thus far
* with a look-up table to print human-readable key names
* @todo change the following variables to correct names:
* "EIupemp" => "NOT SURE WHAT THIS MEANS!",
* "EIupPart" => "NOT SURE ABOUT THIS EITHER!",
* "IncomeUp" => "IDK!", **/
function cl_input_print($cl_input) {
$human_readable_names = array(
"GrossIncomeAmount" => "Gross Income",
"NetBusinessAmount" => "Net Business Income",
"ArmedForcesAmount" => "Armed Forces Income",
"TotalEarned" => "Total Earned Income",
"UnEarnedSSIEtc" => "Unearned Income (SSI, etc.)",
"UnEmploymentEtc" => "Unemployment Income",
"AlimonyReceived" => "Alimony Received",
"ChildSupportReceived" => "Child Support Received",
"TANFreceived" => "TANF Received",
"MonthlyGifts" => "Gifts Received",
"InterestDividendsEtc" => "Interest Dividend Income",
"TotalUnEarned" => "Total Unearned Income",
"TotalMonthlyExpenses" => "Total Monthly Expenses",
"PostMonthlyExpenses" => "Monthly Expenses",
"CombineIncome" => "Monthly Combined Income",
"NetIncome" => "Net Income",
"CheckingAccountBal" => "Checking Account Balance",
"SavingsAccountBal" => "Savings Account Balance",
"EVvehicle1" => "Estimated Value of Primary Vehicle",
"EVothervehicle" => "Estimated Value of Other Vehicle(s)",
"EVpersonal" => "Estimated Value of Personal Belongings",
"EVnonResi" => "Estimated Value of Non-Resident Belongings",
"EVallCountable" => "Estimated Value of Countable Possessions",
"TotalHouseholdAssets" => "Total Value of Household Assets",
"Butt_Section8" => "Section 8 Help",
"EIupemp" => "NOT SURE WHAT THIS MEANS!",
"EIupPart" => "NOT SURE ABOUT THIS EITHER!",
"IncomeUp" => "IDK!",
"MortgageRentAmount" => "Mortgage or Rent Payment",
"InsuranceNotInc" => "Additional Home Insurance Payment",
"TaxesNotInc" => "Additional Home Tax Payment",
"GasAmount" => "Gas Bill",
"ElectricAmount" => "Electricity Bill",
"WaterAmount" => "Water Bill",
"SewageAmount" => "Sewage Bill",
"TrashAmount" => "Trash Pickup Bill",
"PhoneAmount" => "Phone Bill",
"InternetAmount" => "Internet Bill",
"CableAmount" => "Cable Bill",
"TotalHousing" => "Total Housing Expenses",
"GroceriesAmount" => "Groceries",
"SchoolLunchesAmount" => "School Lunches",
"TotalFood" => "Total Food Expenses",
"CarPaymentAmount" => "Car Payment",
"CarInsuranceAmount" => "Car Insurance",
"GasolineAmount" => "Gasoline",
"MaintainRepairAmount" => "Vehicle Maintenance and Repairs",
"BusCabAmount" => "Amount Spent on Bus or Cab Fare",
"TotalTransport" => "Total Transportation Costs",
"MovieDateAmount" => "Movie or Date Budget",
"EntertainOther1Amount" => "Entertainment Budget 1",
"EntertainOther2Amount" => "Entertainment Budget 2",
"EntertainOther3Amount" => "Entertainment Budget 3",
"TotalEntertain" => "Total Entertainment Budget",
"SchoolLoanAmount" => "Student Loan Payment(s)",
"CreditCardAmount" => "Credit Card Payment(s)",
"OtherLoansAmount" => "Other Loan Payments",
"OtherDebtAmount" => "Other Debt Payments",
"TotalDebt" => "Total Debt Payments",
"KitchenAmount" => "Kitchen Needs Budget",
"BathroomAmount" => "Bathroom Needs Budget",
"BedroomAmount" => "Bedroom Needs Budget",
"OtherRoomsAmount" => "Other Rooms Budget",
"TotalHousehold" => "Total Household Needs Budget",
"JunkFoodAmount" => "Junk Food Budget",
"SchoolExpenseAmount" => "School Expenses",
"OtherTaxesAmount" => "Other Tax Expenses",
"OtherExpense1Amount" => "Other Expenses 1",
"OtherExpense2Amount" => "Other Expenses 2",
"OtherExpense3Amount" => "Other Expenses 3",
"TotalOtherExpenses" => "Total of Other Expenses",
"HealthInsuranceAmount" => "Health Insurance",
"PrescriptionsAmount" => "Prescription Medication Costs",
"DoctorAmount" => "Doctor Visit Costs",
"DentistAmount" => "Dentist Visit Costs",
"HealthOtherAmount" => "Other Healthcare Costs",
"TotalHealthcare" => "Total Spent on Healthcare",
"ChildSupportPaidAmount" => "Child Support Paid",
"SpouseSupportPaidAmount" => "Spousal Support Paid",
"ChildcareAmount" => "Childcare Cost",
"SchoolFeesPaidAmount" => "School Fees",
"ExpenseDisabledAmount" => "Expenses for Disability",
"MedicalElderlyAmount" => "Medical Expenses for Elderly",
"OtherDependentAmount" => "Other Dependent Expenses",
"TotalDependentExpense" => "Total Dependent Expenses",
"LaundryAmount" => "Laundry Expenses",
"ToiletriesAmount" => "Toiletries Expenses",
"HaircutsAmount" => "Haircut Expenses",
"OtherPersonalAmount" => "Other Personal Expenses",
"TotalPersonalCare" => "Total Personal Care Expenses",
"AdultClothesAmount" => "Adult Clothing Budget",
"ChildClothesAmount" => "Child Clothing Budget",
"TotalClothing" => "Total Clothing Budget",
"PetFoodAmount" => "Pet Food Expenses",
"PetHealthAmount" => "Pet Health Expenses",
"PetOtherAmount" => "Other Pet Expenses",
"TotalPets" => "Total Pet Expenses",
"BdayAnnivAmount" => "Gift Budget",
"DogmaAmount" => "Religious Donations",
"FundraisersAmount" => "Fundraiser Donations",
"TotalGifts" => "Total Gift Expenses",
"FurnitureAmount" => "Savings Toward Furniture",
"AppliancesAmount" => "Savings Toward Appliances",
"TripsAmount" => "Savings Toward Travel",
"OtherSavingsAmount" => "Other Savings",
"TotalSavings" => "Total Savings",
"cl_city" => "City",
"cl_state" => "State",
"cl_county" => "County",
"cl_stateinits" => "State Initials",
"bedrooms" => "Number of Bedrooms",
"cl_utilities" => "Utilities",
"twentyone_or_older_check" => "Are there household members over 21?",
"cl_adults" => "Number of Adults",
"twentyone_or_older_PTcheck" => "Do any adults work part time?",
"twentyone_or_older_FTcheck" => "Do any adults work full time?",
"cl_adults_PT" => "Number of adults working part time",
"cl_adults_FT" => "Number of adults working full time",
"twentyone_or_older_Expcheck" => "Do any of the adults have work expenses?",
"WorkExpenseAmount" => "Work-related Expenses",
"thirteen_to_twenty_check" => "Are any household members between 13 and 20 years old?",
"less_than_thirteen_check" => "Are any household members less than 13 years old?",
"FTCollegeStudents_check" => "Are any household members full-time college stuents?",
"cl_family_pregnancy_check" => "Are any household members pregnant?",
"cl_family_stepparent_check" => "Are any household members step-parents?",
"cl_family_All_onBenefits_check" => "Are all members of the household receiving benefits?",
"cl_family_over60_check" => "Are any household members over 60?",
"this_log" => "Log File Information"
);
echo "<table>";
foreach($cl_input as $key => $value) {
echo "<tr><th>$human_readable_names[$key]</th> <td>($key)</td><td>$value</td></tr>";
}
echo "</table>";
}
cl_input_print($cl_input);
?>
<p><a href="javascript:DownloadResults();">Click here to download all the data you've provided for offline use.</a></p>
<p><a href="javascript:GoResults();">Go to the results page.</a></p>
<!-- As a hack, print everything from cl_input back out as hidden form entries; this will
work w/ cl_results which expects everything to come from HTTP POST -->
<form id="cl_summary_form" enctype="multipart/form-data" method="POST" action="cl_results.php">
<?php
foreach($cl_input as $key => $value) {
echo "<input type='hidden' id='$key' name='$key' value='$value'>\n";
}
?>
</form>
</body>
</html>