eren_greenlady
New member
i got three table 1. tbl_user, 2. tbl_EmpLeave, 3. tbl_sLeave
attributes are tbl_user(uid, user_id, name), tbl_EmpLeave(lid, ctype, cldays, user_id), tbl_sLeave(sid, type). cldays is the days taken. ctype is id that linked to tbl_sleave. type in tbl_sleave is type of leave such as annual leave, emergency leave and maternity leave. the problem is i want to calculate all total leave that a user had taken in a year, lets say that user A had taken 3 different leave AL - annual leave, EL - emergency leave and ML - maternity leave. AL=2, EL=4, ML=4 so total leave is 10. 1 year user entitle 12 days leave. how to do the codes for this. please help, i spent so much time to figure out this problem.. help me, im really poor in programming.
attributes are tbl_user(uid, user_id, name), tbl_EmpLeave(lid, ctype, cldays, user_id), tbl_sLeave(sid, type). cldays is the days taken. ctype is id that linked to tbl_sleave. type in tbl_sleave is type of leave such as annual leave, emergency leave and maternity leave. the problem is i want to calculate all total leave that a user had taken in a year, lets say that user A had taken 3 different leave AL - annual leave, EL - emergency leave and ML - maternity leave. AL=2, EL=4, ML=4 so total leave is 10. 1 year user entitle 12 days leave. how to do the codes for this. please help, i spent so much time to figure out this problem.. help me, im really poor in programming.