Sample PHP Application For Fresh Learners of PHP


Project  Title : Leave Management System

Environment : Xampp,MySql5,Php5 and NetBeans IDE.

Description : This system facilitates orgonization to manage employee leaves 
in sophisticated way.Employee can check their leave balance and also apply 
leaves.Manager and Other Higher officials can view and approve employee 
leaves.Each and every action will trigger appropriate emails based on their
 action.Employee can verify their leave status in the system using their credentials.

     Based on above problem definition actors are 
  •       1.Manager   2 Hr manager   3. Employee

 Responsibilities of Manager :
  •  Login into System and verify Applied leaves
  • Approve/Reject leaves with proper reason
  • manager can verify leave balance of all employees.
Responsibilities of Hr Manager :
  • Login into System and verify manager approved leaves
  • leaves/holidays management of employees
  • report generation of employee leaves.
Responsibilities of  Employee :
  • Login into System and apply leaves
  • employee can check his leave balance
  • employee can verify the status of applied leave.

Database Design :

This table having data related to each and every actor of the system.
userid is a primary key in this table.which will become a foreign key
in other tables. 

Green color  : used for Primary keys

Red color : used for Foreign Keys

 CREATE TABLE LEAVEMGMT_LOGIN (
userid int(10) NOT NULL AUTO_INCREMENT,
name varchar(50) NOT NULL,
email varchar(50) NOT NULL,
password varchar(10) NOT NULL,
usertype varchar(10) NOT NULL,
phone varchar(12) NOT NULL,
PRIMARY KEY (userid)
)

CREATE TABLE LEAVEMGMT_LEAVETYPES (
   leaveid int(10) NOT NULL AUTO_INCREMENT,
   leave_type  varchar(50) NOT NULL,
  PRIMARY KEY (leaveid)
)

CREATE TABLE LEAVEMGMT_EMP_lEAVES (
   emp_leaveid int(10) NOT NULL AUTO_INCREMENT,
   userid int(10) NOT NULL,
   vacation_startdate date  NOT NULL,
   vacation_enddate  date    NOT NULL,
   vacation_cause varchar(1000)  NOT NULL,
   leaveid int(10) NOT NULL,
   leave_status varchar(5) NOT NULL,
   PRIMARY KEY (emp_leaveid)
)

CREATE TABLE LEAVEMGMT_EMP_lEAVES (
   emp_leaveid int(10) NOT NULL AUTO_INCREMENT,
   userid int(10) NOT NULL,
   vacation_startdate date  NOT NULL,
   vacation_enddate  date    NOT NULL,
   vacation_cause varchar(1000)  NOT NULL,
   leaveid int(10) NOT NULL,
   leave_status varchar(5) NOT NULL,
   PRIMARY KEY (emp_leaveid)
)

ALTER TABLE LEAVEMGMT_EMP_lEAVES
  ADD CONSTRAINT applleaves FOREIGN KEY (userid) REFERENCES LEAVEMGMT_LOGIN(userid);

  ALTER TABLE LEAVEMGMT_EMP_lEAVES
  ADD CONSTRAINT leavetype FOREIGN KEY (leaveid) REFERENCES LEAVEMGMT_LEAVETYPES(leaveid);


CREATE TABLE LEAVEMGMT_EMP_LEAVEBALANCE (
   leave_balance_id int(10) NOT NULL AUTO_INCREMENT,
   userid int(10) NOT NULL,
   total_leaves_used number(10) NOT NULL,
   paid_leaves number(10) NOT NULL,
   casual_leaves number(10) NOT NULL,
   sick_leaves int(10) NOT NULL,
   leaves_avilable varchar(5) NOT NULL
   PRIMARY KEY (leave_balance_id)
)

ALTER TABLE LEAVEMGMT_EMP_LEAVEBALANCE
 ADD CONSTRAINT userleaves FOREIGN KEY (userid) REFERENCES LEAVEMGMT_LOGIN(userid);



We are done with database design.Lets move into screen design using php ,html and css.

Next>> 





 

Comments