CodeIgniter Forums
Attendance Log Web Site - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Attendance Log Web Site (/thread-52434.html)



Attendance Log Web Site - El Forum - 06-11-2012

[eluser]buddyram[/eluser]
Hi CodeIgniter Geeks,

I am planning to develop a web site on Employee's Attendance tracker. I want to do this Project in CodeIgniter. I want the guidance on how the general coding structure should i be.

Should i integrate any libraries to enhance the features.

suggestions/feedback are welcome


Attendance Log Web Site - El Forum - 06-11-2012

[eluser]boltsabre[/eluser]
Hi buddyram,

It's a very broad question you've asked, and you've not noted your skills, so I'll just give you a broad answer that hopefully helps you a little.

Quote:I want the guidance on how the general coding structure should i be.
This completely depends on what kind of functionality you plan to have. My suggestion, DO YOUR PLANNING! By this, I mean:
- Work out what users groups you will have for your system (will there just "admin", or will there be various groups of users that have various levels of access which allows them to do different actions from other groups?).
- Work out what functionality you want, generally each one is called a "use case or UC" (for example, "register account" would be one UC, "login" would be another, "delete account" yet another, and "edit profile" yet another. Register account could have a "sub UC" which could be "email user their "authenication/login" link" if you plan to have a 2 level/step registration process.
- What CRUD(Create, Read, Update, Deleting of data?) does each use case require?
- One you have an organised list of Use Cases, grouped into their related groups, you can then start drawing "flow charts" or "Use Case diagrams" for each one. For example, the Login Use Case would be something like: Display "login screen" to user -> User submits form passing data from view to controller -> Controller validates form -> Either return form to user if it fails validation (eg, user didn't enter a valid email address) or if passes validation cleanse input and pass input to model to check if they are a registered user. If registered user redirect them to homepage else display login screen again with appropriate "email address/password not found" error message.

Once you have done the above, you'll have a very good idea of what contollers you'll need (and their internal methods/functions), and well as your models (and their internal methods/functions). Then you can go and start coding!!!

Quote:Should i integrate any libraries to enhance the features
Don't know... depends on your application. Perhaps the pagination library would be a good idea, but again, without intimately knowing your application requirements, this is simple speculation.


Attendance Log Web Site - El Forum - 06-11-2012

[eluser]buddyram[/eluser]
Thank You very much boltsabre for your detailed description. I wanted to start it in small which caters to around 50 employees & would expand accordingly.

I have overviewed your inputs. I would prepare well and revert to you soon.

Thanks once again


Attendance Log Web Site - El Forum - 06-11-2012

[eluser]boltsabre[/eluser]
No worries champ.

One other thing I forgot to mention... if CodeIgniter is really new for you, I'd highly recommend following some of the video tutorials online (try netutts, they're pretty good, but based on the old CI1.7 version, but still good value)
http://codeigniter.com/wiki/Category:Help::Tutorials

And actually code them as you are watching them!

It will give you some very good ideas and tips about how best to code in the Codeigniter MVC way.


Attendance Log Web Site - El Forum - 06-11-2012

[eluser]boltsabre[/eluser]
I was just thinking about your application, I think your most important UCs will be:

- Login. But how does your system work, do employees login and record their attendance or does an "Admin" person/s do this for them? Either way you'll have to have 2 levels of users - normal "employees" who can only add their own attendance, and "admin" who can go in and change a record of any employee if it needs updating/deleting/editing, creating a new "employee account", etc. What about another user group, "Management" who can go in and view reports, but not edit details?
Do some research, there are already lots of good secure CI libraries/modules out there.

Another thought... if it is employees who are entering their own attendance, can they just ADD, or can they edit existing attendance? If they can only ADD, but they make a mistake when inputting it then you'll need some way for them to contact "admin" to correct it for them... will you make/use existing "email" accounts, or build a form in your application that stores the message in a database? But if employees can edit/delete their own attendance records, do you need to have some kind of "safety" mechanism to ensure they cannot do bad things? (ie. what if they don't come to work on monday, and this gets entered into your DB by admin, can the employee come to work on tuesday and edit their attendance for monday so that it looks like they did actually work?!?).

- Create new "employee".
- Edit existing employee.
- View existing employee (will it just list them all, or will you also have a "search for employee"? If so, search by what? Their employee number? Their first/last name? DOB? All three???).
- Delete existing employee (will it be "delete" completely from the DB, or "archive"? or do you need both?)

- Create new attendance record for an employee
- Edit this record?
- Delete it? Can you ever delete/archive a record? Or once it is there it stays there forever?
- View attendance record (as per view existing employee, how? Just list them by employee? Or by date?)

- Reports for management? If so, what kind?

Now when you go and analyse "Create new employee", you start to get into some complex things...
- What data do you need? Employee number (are they 100% unique and thus they can be used as your primary key?), first name, last name, DOB, drivers licence number, tax number, tax group, home address, next of kin, phone number1, phone number2, mobile/cell number 1, mobile/cell number 2, emergency contact number, date employment started, date employment finished, etc etc etc.
- Do you have different "employee" types? (ie, management, grunt, admin, payroll)? If so, do you need to collect different/extra information for the different groups?
- What data is mandatory, which is optional?
- Does the data need to be split into 2 or more tables?


And we haven't actually even started looking at the code yet!

So, I'm sure you get the idea of why it is very important to do all this first, and do it proper. It may take a long time, but it will save you hours and hours (days/weeks/months even!) later when you are coding. In fact, some projects never get finished because they didn't plan first, they just get into the coding and then go "ah, we need this now", then "now we need this and that" and just end up with one big jumbled mess of bugs and bits of code that fail.

Have fun :-)



Attendance Log Web Site - El Forum - 06-11-2012

[eluser]buddyram[/eluser]
[quote author="boltsabre" date="1339420682"]I was just thinking about your application, I think your most important UCs will be:

- Login. But how does your system work, do employees login and record their attendance or does an "Admin" person/s do this for them? Either way you'll have to have 2 levels of users - normal "employees" who can only add their own attendance, and "admin" who can go in and change a record of any employee if it needs updating/deleting/editing, creating a new "employee account", etc. What about another user group, "Management" who can go in and view reports, but not edit details?
Do some research, there are already lots of good secure CI libraries/modules out there.
[/quote]

Employees have to login and update their attendances. Admin will have all the CRUD operation rights of the employees as well as managements.

Quote:Another thought... if it is employees who are entering their own attendance, can they just ADD, or can they edit existing attendance? If they can only ADD, but they make a mistake when inputting it then you'll need some way for them to contact "admin" to correct it for them... will you make/use existing "email" accounts, or build a form in your application that stores the message in a database? But if employees can edit/delete their own attendance records, do you need to have some kind of "safety" mechanism to ensure they cannot do bad things? (ie. what if they don't come to work on monday, and this gets entered into your DB by admin, can the employee come to work on tuesday and edit their attendance for monday so that it looks like they did actually work?!?).

employees are strictly restricted by editing their own accounts, they can only log in and log out of the present day timings, and if any discrepancies they need to contact the administrator.

Quote:- Create new "employee".
- Edit existing employee.
- View existing employee (will it just list them all, or will you also have a "search for employee"? If so, search by what? Their employee number? Their first/last name? DOB? All three???).
- Delete existing employee (will it be "delete" completely from the DB, or "archive"? or do you need both?)
- Create new attendance record for an employee
- Edit this record?
- Delete it? Can you ever delete/archive a record? Or once it is there it stays there forever?
- View attendance record (as per view existing employee, how? Just list them by employee? Or by date?)

- Reports for management? If so, what kind?

All the above operations is restricted only to the Admin!

Quote:Now when you go and analyse "Create new employee", you start to get into some complex things...
- What data do you need? Employee number (are they 100% unique and thus they can be used as your primary key?), first name, last name, DOB, drivers licence number, tax number, tax group, home address, next of kin, phone number1, phone number2, mobile/cell number 1, mobile/cell number 2, emergency contact number, date employment started, date employment finished, etc etc etc.
- Do you have different "employee" types? (ie, management, grunt, admin, payroll)? If so, do you need to collect different/extra information for the different groups?
- What data is mandatory, which is optional?
- Does the data need to be split into 2 or more tables?

Yeah. I need to do some home work on this part. Thanks for pointing out.

Quote:And we haven't actually even started looking at the code yet!

So, I'm sure you get the idea of why it is very important to do all this first, and do it proper. It may take a long time, but it will save you hours and hours (days/weeks/months even!) later when you are coding. In fact, some projects never get finished because they didn't plan first, they just get into the coding and then go "ah, we need this now", then "now we need this and that" and just end up with one big jumbled mess of bugs and bits of code that fail.

Have fun :-)


Oh. I'm overwhelmed with your response. Thank you so much. Yes I need to do the home work.

This is what i was expecting from codeigniter/forum. I have got valuable inputs from your your end sir. By the by i am a proficient in Codeigniter. I have done couple of web applications on Codeigniter. So now i want to use all my knowledge and develop the Attendance Tracker Website on my own.

I would prepare well and get back to you soon!!!


Attendance Log Web Site - El Forum - 06-12-2012

[eluser]boltsabre[/eluser]
Glad to be of assistance!

Quote: i am a proficient in Codeigniter. I have done couple of web applications on Codeigniter...
That is good news! It makes things a lot easier for you! All you need to do now is figure out what you application needs to do, and how it will do it (and how certain parts will integrate/interact with the other parts of your application). Once you've done that then you can jump into the coding.

Good luck champ!