This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi,
I need some major help and I don't know if you can. I have an assignment due tomorrow and I've tried time and time again to work this out on my own and I've failed. I don't expect anyone to do this for me but I need help figuring out where I've messed and how I fix it.
My code has basically been created by using examples from the lecturer.
The task:
To create a payroll page that lists all the employees, their salary, the tax they pay and monthly income, to then click through on each person and see their individual payslip.
The minimum requirements of the project are this -
• Read the JSON input file of employee data to import a list of employees and their salaries
• Import tax tables from the JSON file to determine what rate of tax each employee will pay
• Produce a list of all employees with their monthly take-home (net, after tax) pay
• Calculate tax home-page (‘net’ or after tax) for each employee for the current month
• Display a list of all employees
• Allow click-through to individual employee’s payslip
So far I have been able to read and import the 2 JSON files, have displayed a list of all the employees in a table and set up a click through to each individual payslip.
What I can't get to work is the functions to calculate tax band(it's graduated so say someone is in tax band 3, they have to go through the 3 tax bands and pay appropriate tax on each) and then how much tax each employee is paying, what their net salary is and finally what their monthly is.
I keep getting warnings and errors about syntax errors (it doesn't like the switch or it doesn't like the foreach), parse errors or undefined variables.
The code: https://pastebin.com/0JvMFz7f
JSON - Employee Data: https://pastebin.com/Ge2kq9zY
JSON - Tax Data: https://pastebin.com/3BAteb4s
Can anyone help me put of my misery? Otherwise this is how I'm submitting my code tomorrow.
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PHPhelp/com...