Result and Payslip Calculation PHP Script- can calculate average results and employee's weekly or monthly payslip with date and time in a table format in connecting with MYSQL. So, you can record, edit, check and stats your data easily. Both PHP scripts are very easy and clear or simple enough to understand. So anybody can edit or add information, data or values and make their own result or payslip format as per the requirements. BY these two PHP scripts - which allows user shorten difficult tasks, find quick productivity and get a “ready to use” PHP setup from both scripts.
Result PHP Scripts: - It has created to facilitate to solve the problem of result checking for institutions like School, Colleges and Universities. . When it comes to educational institution, it is often need to calculate exam grades, report statistics of average results, and how students have performed and these types of tasks are take a long time as well as put pressure on people if you do it manually. Result PHP Script is able to calculate result report card with Students exam grades & report statistics of average results with date & time, by one click .It is connected with MYSQL database so users can keep the records of the marks with exam result, view and check in the view result data bar option.
Payslip PHP Scripts:-This Script would be perfect for Individual employers or small or medium business owners to find out the employee's Payslip with very easily & quickly by one click just putting the employees working hours and wage rate. Payslip PHP calculation Script can perform calculation of employee's net income, gross income, and tax deduction as well as superannuation payment with date & time. By this, Employers can maintain Payslips in weekly, Fortnightly or monthly as per the requirement. It is also connected with MYSQL database so users can keep the records of the Employee Payroll data, view and check in the view payslip data bar option.
My PHP scripts combo runs perfectly well on a low cost. You don’t need to use so many resources like software or any PHP framework. So, overall-By these scripts you can maintain your data, easy calculation, save your time, help to reduce your manual workload pressure and ease your workload pain. Apart from this, It can be used in several different ways-it can be easily customized as per the business specific needs of any organization as well as demands for ecommerce development too, because these two scripts could be give you an clear idea about the how to make calculation script by PHP with database.
Code is clean with proper commenting. The home page allows it to be beautifully and correctly displayed on various mobile or any devices as its compiled on the latest version of Bootstrap 4 and Bootstrap date-time picker calendar will allow users to enter specific date and time which also will be stored in database to ensure your result and payroll date- time period.
It has created to facilitate to solve the problem of result checking for institutions like School, Colleges and Universities. When it comes to educational institution, it is often need to calculate exam grades, report statistics of average results, and how students have performed and these types of tasks are take a long time as well as put pressure on people if you do it manually. Result PHP Script is able to calculate result report card with Students exam grades & report statistics of average results with date & time, by one click .It is connected with MYSQL database so users can keep the records of the marks with exam result, view and also view result data by view php in the view result data bar option.You just need to put the following sql table format in your database php my admin Run SQL query/queries on your database and your exam marks with grade and gradepoint database will be ready to use.
CREATE TABLE `marks` ( `name` varchar(30) NOT NULL, `id` varchar(10) NOT NULL, `resultdate` varchar(30) NOT NULL, `math` varchar(10) NOT NULL, `english` varchar(10) NOT NULL, `geography` varchar(10) NOT NULL, `computer` varchar(10) NOT NULL, `science` varchar(10) NOT NULL, `gradepoint` varchar(10) NOT NULL, `gpa` varchar(10) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Look at the following screenshots images example
In result.php file I have used 5 exam subjects and their mark option in a Table.You can edit or add your subject option.
Put your subject name here |
In input type the word "required" means you must have to fill up this in Marksheet form to calculate result.Here, on top of the table,there is a option for students name.You can also add like this student's roll number,registration number etc. and in input type you can keep required or without required-its up to you.
Student's Name |
This Script would be perfect for Individual employers or small business owners to find out the employee's Payslip with very easily & quickly by one click just putting the employees working hours and wage rate. Payslip PHP calculation Script can perform calculation of employee's net income, gross income, and tax deduction as well as superannuation payment with date & time. By this, Employers can maintain Payslips in weekly, Fortnightly or monthly as per the requirement. It is also connected with MYSQL database so users can keep the records of the Employee Payroll data, view and also check by view php in the view payslip data bar option.You just need to put the following sql table format in your database php my admin Run SQL query/queries on your database and your payslip with payment date database will be ready to use.
CREATE TABLE `payroll` ( `name` varchar(30) NOT NULL, `id` varchar(10) NOT NULL, `paymentdate` varchar(30) NOT NULL, `grossamount` varchar(10) NOT NULL, `tax_amount` varchar(10) NOT NULL, `super_amount` varchar(10) NOT NULL, `net_amount` varchar(10) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Look at the following screenshots images example
In payslip.php file I have used employee's name,working hours and wages.You can edit or add more(like-employee's id,tax number,pay period, pay number,account name and number,pay group etc.) according to your demand .
put your option name here |
And,if you edit or add more option then put Employee Working Information Form with method="post",like below in the top of the payslip-process.php file from line 5 , so that The $_POST variable is used to collect values to determine payslip data.
$name = $_POST['name']; $hours = $_POST['hours']; //The $_POST variable is used to collect values from the payslip.php Employee Working Information Form with method="post". $wage = $_POST['wage'];
Money you get paid, before taxes and other deductions come out,is called gross amount.Here,In order to calculate the gross amount, we multiply the hours worked with wage rate. see in the payslip-process.php file in line 12.
//Gross income calculation $grossamount = ($hours * $wage);
Payroll taxes are taxes imposed on employers or employees, and are usually calculated as a percentage of the salaries that employers pay their staff. Payroll taxes generally fall into two categories: deductions from an employee's wages, and taxes paid by the employer based on the employee's wages.Employee's payroll tax,generally depend on employee's income; the more you earn the more tax you pay, and the less you earn the less tax you pay.The following Script in the payslip-process.php file from line 17, that allows a user to determine the employee payroll Tax amount which is deducted from employee's gross income.
$tax=0; if($grossamount>=5000 and $grossamount<=6000) $tax = $hours*$wage*.36; else if($grossamount>=4000 and $grossamount<=4999) $tax = $hours*$wage*.34; else if($grossamount>=3000 and $grossamount<=3999) $tax = $hours*$wage*.32; else if($grossamount>=2500 and $grossamount<=2999) $tax = $hours*$wage*.30; else if($grossamount>=2000 and $grossamount<=2499) $tax = $hours*$wage*.28; else if($grossamount>=1600 and $grossamount<=1999) $tax = $hours*$wage*.26; else if($grossamount>=1400 and $grossamount<=1599) $tax = $hours*$wage*.24; else if($grossamount>=1200 and $grossamount<=1399) $tax = $hours*$wage*.22; //if...else statement - executes some code if a condition is true and else if($grossamount>=1000 and $grossamount<=1199) //else if - executes different codes for more than two conditions. $tax = $hours*$wage*.19; else if($grossamount>=800 and $grossamount<=999) $tax = $hours*$wage*.18; else if($grossamount>=600 and $grossamount<=799) $tax = $hours*$wage*.09; else if($grossamount>=400 and $grossamount<=599) $tax = $hours*$wage*.07; else if($grossamount>=200 and $grossamount<=399) $tax = $hours*$wage*.04;
The above statements showing different taxable amount for on the basis of income.Here,we take the income range between $200 to $6000.Example-the first statement shows employee who earns between $5000 to $6000,so he will pay tax of 36% of his gross income and like this,the last statement showing whose income is between $200 to $399,will pay 4% f his gross income.So,whenever you need to create your own format,put your income amount and tax payable percentage rate according to your requirement.
In this script,I have shown Employee Payroll Tax on employees income basis.But,it can be also set up by employee's working hours.Where,the employee who works more hours-earn more money and pay higher tax.So,in that case,if anybody wants to make employee payroll tax on the basis of employees working hours need to follow the below scripts,have been shown by example in the in the payslip-process.php file from line 50
$tax=0; if($hours>=150 and $hours<=160) $tax = $hours*$wage*.36; else if($hours>=140 and $hours<=149) $tax = $hours*$wage*.34; else if($hours>=130 and $hours<=139) $tax = $hours*$wage*.32; else if($hours>=120 and $hours<=129) $tax = $hours*$wage*.30; else if($hours>=100 and $hours<=119) $tax = $hours*$wage*.28; else if($hours>=80 and $hours<=99) $tax = $hours*$wage*.26; else if($hours>=70 and $hours<=79) $tax = $hours*$wage*.24; else if($hours>=60 and $hours<=69) $tax = $hours*$wage*.22; else if($hours>=50 and $hours<=59) $tax = $hours*$wage*.19; else if($hours>=40 and $hours<=49) $tax = $hours*$wage*.18; else if($hours>=30 and $hours<=39) $tax = $hours*$wage*.09; else if($hours>=0 and $hours<=29) $tax = $hours*$wage*.04;
The above statements condition showing different taxable amount for on the basis of employees working hours.Here,we assume employees working time is up to 0 to 160 hours.Example-the first statement shows employee who works between 150 to 160 hours-earns more,so he will pay tax of 36% of his gross income and like this,the last statement showing whose working time is between 0 to 29 hours,earns less-will pay 4% of his gross income.
And therefore, you can edit or create your own weekly or monthly payslip format,whatever suits your requirement.
To calculate net income,Deduct tax from the gross amount to find the employee's net income.see in the payslip-process.php file in line 77.
//Net income calculation $net_amount = ($hours * $wage)-($tax);
Payroll taxes are taxes imposed on employers or employees on their income.so after figure out employees net income then we deduct it from gross income to get the how much tax amount imposed on employee.See in the payslip-process.php file in line 79.
//Employee payroll tax amount calculation $tax_amount = $grossamount - $net_amount;
The minimum amount of super your employer must pay on your behalf, known as the Superannuation Guarantee Contribution (SGC). The Super Guarantee Contribution rate is currently equal to 9.5% of your ordinary or gross earnings.So, we get the super amount by the below script in payslip-process.php file line 81.
//Super amount calculation.Here,we fix super amount-9.5% of the employee's gross income. $super_amount = $grossamount *.095;
Here,Here we have attached payslip table elements into echo to get the output data to the screen.See the below example-
Gross Amount |
The above echo commands simply display the corresponding string using variable from the top page of the PHP Script which allows to determine the output(employee's gross amount) of the payslip data showing in payslip Table.
For home page in the index.php file have a Responsive layout and is based on the Bootstrap 4 Framework. For more information about the grid please visit Bootstrap Site
.The banner image used For the demo live preview are from Pexel.
Datetimepicker for Bootstrap 4
I have used HTML table in four PHP files.An HTML table is defined with the table tag.Each table row is defined with the tr tag andA table data/cell is defined with the td tag.I have used the following table format
So that you can easily fix up your background color(bgcolor) and size(width & height) of the table.The table border="1" means table will be displayed with 1 line borders around the table cells.CellPadding means the padding around the table cell content. Cell spacing and margin is the space between cells. Cell padding is space inside cells, between the cell border (even if invisible) and the cell content, such as text.
Look at the below example of colspan has been used in table in the payslip-process.php file line 73.
Employee's Payslip |
The attribute, colspan (how many across) which means column span defines the number of columns a cell should span.In some situations we need the Table Cells span across more than one column, In these situations we can use Colspan attribute.So,here colspan="2" means- merge two Cells horizontally in a row into a single Cell.
#Extract all files from Zip file.
#Check out the documentation file.
#Go to your hosting server and then click file manager.
#Go to public html and Upload the main file zip to your hosting server.
#After upload extract all files from your main file zip.
#Create a database in mysql wizard,then next step put your own databse username and password.
#put your servername, username, password ,database name in your file according to the requirement like the following-
#Go to php my admin,open your database,click sql and put your two database table structures one by one in run sql and click go.
#PHP 5 or higher