Clone wiki

khk-independent / Home


Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.

This wiki contains step-by step instructions for your independent work which outline the process. This is not a full copy and paste tutorial since its purpose is not to grind your copy and paste skills (which undoubtedly also are important) but rather to teach you a systematic approach on overcoming any technical issue.

The guide is written in English on purpose - as a software developer you must have excellent English skills.

  • Estimated time to program the project: 12 - 20h
  • Estimated time for independant learning: 10 - 20h

This page describes the overall system and its requirements.


Your assignment is to build a web-based payroll calculator using the Kohana PHP and Bootstrap CSS frameworks.


The system is used to track the working hours of employees. Each employee has a list of tasks and each task has the time it took to perform it. The sum of all the tasks (in a given month) is the total time the employee gets paid for. Pay is calculated like so: NUMBER_OF_WORKED_HOURS * PAYMENT_PER_HOUR. Task tracking is month-based.

Functional requirements

  • The system will have login functionality. Unauthorized users must not be able to interact with the system.
  • The dashboard view will show a summary table of all employees, their total worked hours and earned money.
  • For each employee there is a view that shows only that employees tasks and time, in a given month
  • Tasks and time can be added to an employee
  • Employees task data (description, time) can be changed or deleted
  • Employees can be added to the system. Edit and delete functionality is optional.
  • Employees can add, modify and delete only their own tasks
  • Task time is determined automatically upon task creation, current time is used
  • The summary table has dynamic columns, meaning when a new task is created on the first day of March, a new column (March) appears in the summary table
  • Employee detail view shows only one month. However, the month is determined by a HTTP GET query param, month (example: /employees/view/5?month=4 would show tasks done in April). Each column in the summary table links to the corresponding month.

Non-functional requirements

  • The code is documented (comments, PHPDoc)
  • The code validates (PHP, HTML and CSS)

General steps

Here is a list of steps to implement this system. Research the steps on your own if the terminology or the how? is confusing / unclear. Kohana manual and Google are your friends.

When in trouble - debugging

  • When Kohana gives you a nice red error message, read it. Look the stack trace and its arguments. Look at which file caused the error, which line was wrong. Investigate. Google the error message
  • When you get 500 Internal Server Error, look at the two log files: files under application/logs/2013/ and the PHP general error log: /var/log/apache2/error.log.
  • Ask your classmates for help, maybe they had the same problem?
  • Pair program to solve the problem
  • Think of what you did and when the code broke. Maybe you can undo some changes to detect what went wrong?
  • Use git revert or git reset when your codebase is in a hopeless mess
  • Google what you can: error messages and unfamilar terms in this guide
  • When you have exhausted the data sources above, ask the mentors. They're experienced people and can often pinpoint your error in minutes so you don't have to spend hours searching for that one framework-specific bug that only experience could discover quickly.


  • Take time to make it look pretty.
  • Do as much as you can. If, at some point, you are unable to understand the system or how to continue, ask the mentor(s).
  • Think of things that aren't in the specification, but would be nice to have. This is your chance to differentiate from your peers and make your system unique.
  • Don't have broken links or functionality where the user can see it. If it's not done yet, it shouldn't be visible.
  • Write validating and well-formed code.
  • See the source for some samples (view mockups!)
  • Use PhpStorm code auto-format a lot. Code -> Reformat Code...

Repository listing

It is recommended to do this project in pairs. All projects should be hosted in GitHub or Bitbucket and are public. You can peek what others have done and collaborate. Send links and team names to the mentor(s).


Note that best practices such as decoupling, single responsibility etc are knowingly ignored in places to make the code easier to comprehend.