diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..dad62749
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/.settings
+/.buildpath
+/.project
+/.idea
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
new file mode 100644
index 00000000..dbfe8c7b
--- /dev/null
+++ b/CHANGELOG.txt
@@ -0,0 +1,157 @@
+Release note v9.1
+-----------------
+### Fixes
+ *Add missing S3FileSystem class
+
+Release note v9.0
+-----------------
+### Features
+ *New user interface
+ *Decimal leave counts supported
+
+
+Release note v8.4
+-----------------
+### Fixes
+ * Fix leave carry forward rounding issues
+ * Fix issue: select2 default value not getting set for select2
+ * Fix issue: email not sent when admin changing leave status
+
+Release note v8.3
+-----------------
+### Fixes
+* Fix user table issue on windows, this will resolve errors such as: (Note that this fix has no effect on unix based installations)
+ * Admin not able to view user uploaded documents
+ * Admin not able to upload documants for users
+ * Admin can not view employee attendance records
+ * Employee projects can not be added
+
+
+Release note v8.2
+-----------------
+### Features
+*Instance verification added
+
+Release note v8.1
+-----------------
+### Fixes
+*Fixed bug that caused a fatal error in php v5.4
+*aws2.7.11 phar file replaced by a aws2.7.11 extracted files
+*old aws sdk removed
+
+Release note v8.0
+-----------------
+### Features
+*Admin dashbord module
+*If the employee joined in current leave period, his leave entitlement is calculated proportional to joined date
+*Improvements to reporting module
+*Adding new employee time tracking report
+*Join date for employees made mandatory
+*Sending welcome email when a user is added
+*Let users directly reply to admin user from any email sent out from icehrm
+*All the users who are not admins must have an employee object attached
+*Upgrade aws sdk to v2.7.11
+*Allow employees to change password
+*Use only the email address defined under user for sending mails
+*Making work_email and private_email fields optional
+
+
+### Fixes
+*Upload dialog close button issue fixed
+
+
+Release note v7.2
+-----------------
+*Fixes
+*Some critical vulnerabilities are fixed as recommend by http://zeroscience.mk/en/
+
+Release note v7.1
+-----------------
+*Features
+*Improved company structure graph
+*Leave notes implementation – Supervisor can add a note when approving or rejecting leaves
+*Filtering support
+*Select boxes with long lists are now searchable
+*Add/Edit/Delete company structure permissions added for managers
+*Add ability to disable employee information editing
+
+*Fixes
+*Make loans editable only by admin
+*Fix: permissions not getting applied to employee documents
+*Fix error adding employee documents when no user assigned to the admin
+
+*Code Quality
+*Moving all module related code and data into module folders
+
+Release note v6.0
+-----------------
+* Features
+* Notifications for leaves and timesheets
+* Leave module accrue and leave carry forward
+* Employee leave entitlement sub module
+* Ability to put system on debug mode
+* Allow admins to see documents of all the employees at one place
+* Backup data when deleting an employee
+* Employee attendance report added
+* Changes to time entry form in timesheet module to make time entry process faster
+* Admin can make all projects available to employees or just the set of prjects assigned to them using Setting "Projects: Make All Projects Available to Employees"
+* Employee document, date added field can not be changed by the employee anymore
+* About dialog added for admins
+
+* Fixes
+* Fix default employee delete issue (when the default employee is deleted the admin user attached to it also get deleted)
+* Fix user duplicate email issue
+* Fix manager can not logout from switched employee
+* Remove admin guide from non admin users
+
+Release note v5.3
+-----------------
+* Fixes
+* Fix missing employee name in employee details report
+
+Release note v5.2
+-----------------
+* Fixes
+* Remove unwanted error logs
+* Fix attendance module employee permission issue
+* Resolve warnings
+* Remove add new button from subordinates module
+* Adding administrators' guide
+
+Release note v5.1
+-----------------
+* Fixes
+* Fixing for non updating null fields
+* https://bitbucket.org/thilina/icehrm-opensource/commits/df57308b53484a2e43ef5c72967ed1cd0dc756cc
+
+Release note v5.0
+-----------------
+* Features
+* New user permission implementation
+* Adding new user level - Manager
+
+* Fixes
+* Fixing remote table loading issue
+
+Release note v4.2
+-----------------
+* Fixes
+* https://bitbucket.org/thilina/icehrm-opensource/issue/23/subordinate-leaves-pagination-not-working
+* https://bitbucket.org/thilina/icehrm-opensource/issue/20/error-occured-while-time-punch
+
+
+Release note v4.1
+-----------------
+* Features
+* Better email format for notifications
+* Convert upload dialog to a bootstrp model
+
+* Fixes
+* Fix error sending emails with amazon SES
+* Fix errors related to XAMPP and WAMPP servers
+* Fix php warnings and notifications
+* Fix company structure graph issues
+* Allow icehrm client to work without an internet connection
+* Fix installer incorrect base url issue
+* Fix empty user creation issue
+
diff --git a/build.xml b/build.xml
new file mode 100644
index 00000000..8a0b6273
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,275 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core-ext/app/config.sample.php b/core-ext/app/config.sample.php
new file mode 100644
index 00000000..f91261af
--- /dev/null
+++ b/core-ext/app/config.sample.php
@@ -0,0 +1,18 @@
+baseService = $baseService;
+ }
+
+ public function addNotification($toEmployee, $message, $action, $type, $toUserId = null, $fromSystem = false){
+
+ $userEmp = new User();
+
+ if(!empty($toEmployee)){
+ $userEmp->load("employee = ?",array($toEmployee));
+
+ if(!empty($userEmp->employee) && $userEmp->employee == $toEmployee){
+ $toUser = $userEmp->id;
+ }else{
+ return;
+ }
+ }else if(!empty($toUserId)){
+ $toUser = $toUserId;
+ }
+
+
+ $noti = new Notification();
+ if($fromSystem){
+ $noti->fromUser = 0;
+ $noti->fromEmployee = 0;
+ $noti->image = BASE_URL."images/icehrm.png";
+ }else{
+ $user = $this->baseService->getCurrentUser();
+ $noti->fromUser = $user->id;
+ $noti->fromEmployee = $user->employee;
+ }
+
+ $noti->toUser = $toUser;
+ $noti->message = $message;
+
+ if(!empty($noti->fromEmployee) && $noti->fromEmployee != 0){
+ $employee = $this->baseService->getElement('Employee',$noti->fromEmployee,null,true);
+ if(!empty($employee)){
+ $employee = FileService::getInstance()->updateProfileImage($employee);
+ $noti->image = $employee->image;
+ }
+ }
+
+ if(empty($noti->image)){
+ if($employee->gender == 'Male'){
+ $noti->image = BASE_URL."images/user_male.png";
+ }else{
+ $noti->image = BASE_URL."images/user_female.png";
+ }
+
+ }
+
+ $noti->action = $action;
+ $noti->type = $type;
+ $noti->time = date('Y-m-d H:i:s');
+ $noti->status = 'Unread';
+
+ $ok = $noti->Save();
+ if(!$ok){
+ error_log("Error adding notification: ".$noti->ErrorMsg());
+ }
+ }
+
+ public function clearNotifications($userId){
+ $notification = new Notification();
+
+ $listUnread = $notification->Find("toUser = ? and status = ?",array($userId,'Unread'));
+
+ foreach($listUnread as $not){
+ $not->status = "Read";
+ $not->Save();
+ }
+ }
+
+ public function getNotificationByTypeAndDate($type, $date){
+ $noti = new Notification();
+ $noti->Load("date(time) = ? and type = ?",array($date,$type));
+ if(!empty($noti->id) && $noti->type = $type){
+ return $noti;
+ }
+ return null;
+ }
+
+ public function getLatestNotificationsAndCounts($userId){
+ $notification = new Notification();
+
+ $listUnread = $notification->Find("toUser = ? and status = ?",array($userId,'Unread'));
+ $unreadCount = count($listUnread);
+
+ $limit = ($unreadCount < 10)?10:$unreadCount;
+
+ $list = $notification->Find("toUser = ? order by time desc limit ?",array($userId,$limit));
+
+ $newList = array();
+ $fs = FileService::getInstance();
+
+ foreach($list as $noti){
+ if($noti->fromEmployee > 0){
+ $employee = $this->baseService->getElement('Employee',$noti->fromEmployee,null,true);
+ if(!empty($employee)){
+ $employee = $fs->updateProfileImage($employee);
+ $noti->image = $employee->image;
+
+ if(empty($noti->image)){
+ if($employee->gender == 'Male'){
+ $noti->image = BASE_URL."images/user_male.png";
+ }else{
+ $noti->image = BASE_URL."images/user_female.png";
+ }
+
+ }
+ $newList[] = $noti;
+ }
+ }else{
+ $noti->image = BASE_URL."images/icehrm.png";
+ $newList[] = $noti;
+ }
+
+ }
+
+ return array($unreadCount, $list);
+
+ }
+
+}
\ No newline at end of file
diff --git a/core-ext/config.base.php b/core-ext/config.base.php
new file mode 100644
index 00000000..727c7c6d
--- /dev/null
+++ b/core-ext/config.base.php
@@ -0,0 +1,21 @@
+ li > a {
+font-weight: bold;
+font-size: 12px;
+}
+
+.categoryWrap p{
+ font-size:16px;
+ font-weight:bold;
+ padding: 3px;
+}
+
+.categoryWrap p:hover{
+ font-size:16px;
+ font-weight:bold;
+ color:white;
+ background: gray;
+ padding: 3px;
+ cursor:pointer;
+ border-radius: 4px;
+
+}
+
+.resultLogo{
+ text-align: center;
+}
+
+.pbar{
+ font-weight:bold;
+ font-size:11px;
+}
+
+.pbar .progress{
+ height: 10px;
+}
+
+.bs-docs-sidenav {
+ width: 228px;
+ margin: 30px 0 0;
+ padding: 0;
+ background-color: #fff;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+ border-radius: 6px;
+ -webkit-box-shadow: 0 1px 4px rgba(0,0,0,.065);
+ -moz-box-shadow: 0 1px 4px rgba(0,0,0,.065);
+ box-shadow: 0 1px 4px rgba(0,0,0,.065);
+}
+.bs-docs-sidenav > li > a {
+ display: block;
+ *width: 190px;
+ margin: 0 0 -1px;
+ padding: 8px 14px;
+ border: 1px solid #e5e5e5;
+}
+.bs-docs-sidenav > li:first-child > a {
+ -webkit-border-radius: 6px 6px 0 0;
+ -moz-border-radius: 6px 6px 0 0;
+ border-radius: 6px 6px 0 0;
+}
+.bs-docs-sidenav > li:last-child > a {
+ -webkit-border-radius: 0 0 6px 6px;
+ -moz-border-radius: 0 0 6px 6px;
+ border-radius: 0 0 6px 6px;
+}
+.bs-docs-sidenav > .active > a {
+ position: relative;
+ z-index: 2;
+ padding: 9px 15px;
+ border: 0;
+ text-shadow: 0 1px 0 rgba(0,0,0,.15);
+ -webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
+ -moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
+ box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
+}
+/* Chevrons */
+.bs-docs-sidenav .icon-chevron-right {
+ float: right;
+ margin-top: 2px;
+ margin-right: -6px;
+ opacity: .25;
+}
+.bs-docs-sidenav > li > a:hover {
+ background-color: #f5f5f5;
+}
+.bs-docs-sidenav a:hover .icon-chevron-right {
+ opacity: .5;
+}
+.bs-docs-sidenav .active .icon-chevron-right,
+.bs-docs-sidenav .active a:hover .icon-chevron-right {
+ background-image: url(../img/glyphicons-halflings-white.png);
+ opacity: 1;
+}
+.bs-docs-sidenav.affix {
+ top: 40px;
+}
+.bs-docs-sidenav.affix-bottom {
+ position: absolute;
+ top: auto;
+ bottom: 270px;
+}
+
+
+
+
+/* Responsive
+-------------------------------------------------- */
+
+/* Desktop large
+------------------------- */
+@media (min-width: 1200px) {
+ .bs-docs-container {
+ max-width: 970px;
+ }
+ .bs-docs-sidenav {
+ width: 258px;
+ }
+}
+
+.reviewPoints{
+ margin-top:10px;
+}
+
+.reviewPoints .star{
+ margin-left: 10px;
+}
+
+.reviewBlock {
+position: relative;
+margin: 0px 0;
+padding: 39px 19px 14px;
+background-color: white;
+border: 1px solid #DDD;
+/*
+-webkit-border-radius: 4px;
+-moz-border-radius: 4px;
+border-radius: 4px;
+*/
+font-size:12px;
+}
+
+/*.reviewBlock::after {
+content: attr(data-content);
+position: absolute;
+top: -1px;
+left: -1px;
+padding: 3px 7px;
+font-size: 12px;
+font-weight: bold;
+background-color: whiteSmoke;
+border: 1px solid #DDD;
+color: #9DA0A4;
+-webkit-border-radius: 4px 0 4px 0;
+-moz-border-radius: 4px 0 4px 0;
+border-radius: 4px 0 4px 0;
+}*/
+
+.box_ws{
+ background: white;
+ border-left: 1px solid #DDD;
+ border-right: 1px solid #DDD;
+ border-bottom: 1px solid #DDD;
+ color: #555;
+}
+
+.cal_box_ws{
+ background: white;
+ border: 1px solid #DDD;
+ color: #555;
+ height: 100px;
+}
+
+.cal_box_ws .wd_date_full{
+ font-weight:bold;
+ font-size:10px;
+ float: right;
+ margin-right: 5px;
+}
+
+.cal_box_ws .wd_date{
+ font-size:10px;
+ float: right;
+ margin-right: 5px;
+}
+
+.nav-pills li a:hover{
+ background: #1D64AD;
+ color:white;
+};
+
+.nav-tabs > li > a {
+ color:white;
+}
+
+.nav-tabs > li > a:hover{
+ color:#555;
+}
+
+
+.topheader {
+background: -moz-linear-gradient(#829AA8, #405A6A);
+background: -webkit-linear-gradient(#829AA8, #405A6A);
+background: linear-gradient(#829AA8, #405A6A);
+border: 1px solid #677C89;
+border-bottom-color: #6B808D;
+box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
+}
+
+
+.bgbody{
+background: #FAFAFA;
+background: -moz-linear-gradient(#FAFAFA, #EAEAEA);
+background: -webkit-linear-gradient(#FAFAFA, #EAEAEA);
+background: linear-gradient(#FAFAFA, #EAEAEA);
+border-bottom: 1px solid #CACACA;
+box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
+}
+
+.leftMenu{
+ background-color: #E9F1F4;
+ border-style: solid;
+ border-width: 1px 1px 2px;
+ border-color: #E9F1F4 #D8DEE2 #D8DEE2;
+ border-radius: 0 0 5px 5px;
+}
+
+.nav > li > a:hover {
+text-decoration: none;
+background-color: whitesmoke;
+border-radius: 5px;
+}
+
+/*
+.nav-list > .active > a, .nav-list > .active > a:hover{
+color: white;
+text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
+background-color: #405A6A;
+box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
+border-radius: 5px;
+}
+*/
+
+a {
+color: #405A6A;
+text-decoration: none;
+}
+
+.nav-header {
+display: block;
+padding: 3px 15px;
+font-size: 15px;
+font-weight: bold;
+line-height: 20px;
+text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
+text-transform: none;
+background: -moz-linear-gradient(#829AA8, #405A6A);
+background: -webkit-linear-gradient(#829AA8, #405A6A);
+background: linear-gradient(#829AA8, #405A6A);
+color: white;
+border-radius: 2px;
+}
+
+.modal-backdrop,
+.modal-backdrop.fade.in {
+ opacity: 0.4;
+ filter: alpha(opacity=40);
+}
+
+.error{
+ color:red;
+}
+
+.columnMain{
+ font-weight: bold;
+}
+
+.borderBox{
+padding-bottom: 10px;
+padding-left: 10px;
+padding-top: 10px;
+-moz-border-radius: 5px;
+border-radius: 5px;
+-webkit-border-radius: 5px;
+margin-bottom: 20px;
+-moz-box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
+-webkit-box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
+box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
+border: 1px solid #EEE;
+}
+
+
+.iceicon_edit{
+ background-image: url("../images/edit.png");
+}
+
+.iceicon_delete{
+ background-image: url("../images/delete.png");
+}
+
+.iceicon_user{
+ background-image: url("../images/user.png");
+}
+
+.dropdown-menu{
+ z-index: 10000;
+}
+
+.lightface .lightfaceContent .lightfaceTitle {
+font-size: 14px;
+color: #fff;
+background-color: #405A6A;
+border: 1px solid #405A6A;
+font-weight: bold;
+margin: -1px;
+margin-bottom: 0;
+padding: 5px 10px;
+line-height: 30px;
+}
+
+.label-ice, .badge-ice{
+background-color: #405A6A;
+}
+
+.dataTables_processing{
+position: absolute;
+margin-left: 40px;
+font-weight: bold;
+font-size: 13px;
+color: gray;
+}
+
+
+
+/*changes to full caledar*/
+.fc-header-title h2 {
+margin-top: 0;
+white-space: nowrap;
+font-size: 20px;
+margin-left: 10px;
+color:#405A6A;
+}
+
+table.dataTable{
+ font-size: 1.1em;
+}
+
+.form-horizontal{
+ font-size: 1.2em;
+}
+
+.form-horizontal .row{
+ margin-bottom: 10px;
+}
+
+.table.dataTable {width:100% !important;}
+
+.iceLabel{
+ font-size: 12px !important;
+ font-weight: bold;
+ color: #3c8dbc;
+}
+
+.nav-tabs>li>a{
+ border-radius:0px;
+}
+
+.nav > li > a:hover {
+ border-radius:0px;
+}
+
+.btn {
+ -webkit-border-radius: 0px;
+ -moz-border-radius: 0px;
+ border-radius: 0px;
+
+}
+
+
+/* select2 style overide */
+.select2-choice{
+border: none !important;
+width: 100% !important;
+border-radius: 0px !important;
+background-color: #FFF !important;
+background-image: none !important;
+}
+
+
+.select2-container{
+ padding:3px !important;
+}
+
+.select2-container-multi{
+ padding:0px !important;
+ border:none;
+}
+
+.select2-arrow{
+background-image: none !important;
+background: #FFF !important;
+border: none !important;
+}
+
+.select2-drop-active {
+/*border: 1px solid black !important;*/
+border-top: none !important;
+background: #f0f0f0 !important;
+}
+
+.logTime{
+ font-weight: bold;
+ font-size: 13px;
+ font-style: italic;
+}
+
+.popupForm{
+ border: none !important;
+ padding: 0px 19px 14px !important;
+}
+
+.content {
+background: #FFF;
+}
+
+.wrapper {
+background: #FFF;
+}
+
+.user-panel > .info > p {
+margin-bottom: 9px;
+max-width: 135px;
+line-height: 17px;
+}
+
+.list-group-item-text{
+ margin-bottom:5px;
+}
+
+.list-group-item{
+ padding-bottom:30px;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/custom for v11.0 */
+
+
+.table-bordered>thead>tr>th{
+ border:none !important;
+}
+
+.table-bordered>thead>tr>th, .table-bordered>thead>tr>td {
+ border-bottom-width: 2px;
+ border: none;
+}
+
+.table{
+ -webkit-transition: margin-left .15s linear;
+ transition: margin-left .15s linear;
+ -webkit-user-select: none;
+ background-color: #fff;
+ -webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
+ box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
+}
+
+.reviewBlock{
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box
+}
+
+.treeview-menu li:hover{
+ font-weight:bold;
+}
\ No newline at end of file
diff --git a/core-ext/images/connect-no.png b/core-ext/images/connect-no.png
new file mode 100644
index 00000000..ccac9f60
Binary files /dev/null and b/core-ext/images/connect-no.png differ
diff --git a/core-ext/images/icehrm.png b/core-ext/images/icehrm.png
new file mode 100644
index 00000000..2e28250c
Binary files /dev/null and b/core-ext/images/icehrm.png differ
diff --git a/core-ext/images/logo.png b/core-ext/images/logo.png
new file mode 100644
index 00000000..6f8efc4c
Binary files /dev/null and b/core-ext/images/logo.png differ
diff --git a/core-ext/images/redo.png b/core-ext/images/redo.png
new file mode 100644
index 00000000..f1e45cff
Binary files /dev/null and b/core-ext/images/redo.png differ
diff --git a/core-ext/login.php b/core-ext/login.php
new file mode 100644
index 00000000..4108c87b
--- /dev/null
+++ b/core-ext/login.php
@@ -0,0 +1,317 @@
+Load("(username = ? or email = ?) and password = ?",array($_REQUEST['username'],$_REQUEST['username'],md5($_REQUEST['password'])));
+ }
+
+ if($suser->password == md5($_REQUEST['password']) || $ssoUserLoaded){
+ $user = $suser;
+ SessionUtils::saveSessionObject('user', $user);
+ $suser->last_login = date("Y-m-d H:i:s");
+ $suser->Save();
+
+ if(!$ssoUserLoaded && !empty(BaseService::getInstance()->auditManager)){
+ BaseService::getInstance()->auditManager->user = $user;
+ BaseService::getInstance()->audit(IceConstants::AUDIT_AUTHENTICATION, "User Login");
+ }
+
+ if($user->user_level == "Admin"){
+ header("Location:".HOME_LINK_ADMIN);
+ }else{
+ header("Location:".HOME_LINK_OTHERS);
+ }
+ }else{
+ header("Location:".CLIENT_BASE_URL."login.php?f=1");
+ }
+ }
+}else{
+ if($user->user_level == "Admin"){
+ header("Location:".HOME_LINK_ADMIN);
+ }else{
+ header("Location:".HOME_LINK_OTHERS);
+ }
+
+}
+
+$tuser = SessionUtils::getSessionObject('user');
+//check user
+
+$logoFileName = CLIENT_BASE_PATH."data/logo.png";
+$logoFileUrl = CLIENT_BASE_URL."data/logo.png";
+if(!file_exists($logoFileName)){
+ $logoFileUrl = BASE_URL."images/logo.png";
+}
+
+?>
+
+
+
+ =APP_NAME?> Login v=VERSION?> © http://icehrm.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
IceHrm Pro -
+
+ REQUIRES
Windows, OSX, Linux
+
+
+ RATING:
+
+ 4.5 (
+ 12 ratings )
+
+
+
+ Price: $199.99
+
+
+
+
+
+
+
+
+
+
+
+ Admin: (Username = admin/ Password = admin)
+ Manager: (Username = manager/ Password = demouserpwd)
+ User: (Username = user1/ Password = demouserpwd)
+ User: (Username = user2/ Password = demouserpwd)
+
+
+
+
+
+
+
diff --git a/core-ext/model/models.base.php b/core-ext/model/models.base.php
new file mode 100644
index 00000000..649a3f46
--- /dev/null
+++ b/core-ext/model/models.base.php
@@ -0,0 +1,72 @@
+getUserAccess();
+ }
+
+ public function getAnonymousAccess(){
+ return array();
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("get","element");
+ }
+
+ public function getUserOnlyMeAccessField(){
+ return "employee";
+ }
+
+ public function getUserOnlyMeAccessRequestField(){
+ return "employee";
+ }
+
+ public function validateSave($obj){
+ return new IceResponse(IceResponse::SUCCESS,"");
+ }
+
+ public function executePreSaveActions($obj){
+ return new IceResponse(IceResponse::SUCCESS,$obj);
+ }
+
+ public function executePreUpdateActions($obj){
+ return new IceResponse(IceResponse::SUCCESS,$obj);
+ }
+
+ public function executePostSaveActions($obj){
+
+ }
+
+ public function executePostUpdateActions($obj){
+
+ }
+
+ public function postProcessGetData($obj){
+ return $obj;
+ }
+
+ public function getDefaultAccessLevel(){
+ return array("get","element","save","delete");
+ }
+
+ public function getVirtualFields(){
+ return array(
+ );
+ }
+}
\ No newline at end of file
diff --git a/core-ext/popups.php b/core-ext/popups.php
new file mode 100644
index 00000000..6c3e48ac
--- /dev/null
+++ b/core-ext/popups.php
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+user_level == 'Admin'){?>
+
+
+
+
+
+
+
Select the employee to Edit
+
+
+
+ get('Employee');
+ foreach($employees as $empTemp){
+ ?>
+ =$empTemp->first_name." ".$empTemp->last_name?>
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core-ext/scripts/icehrm_master_data.sql b/core-ext/scripts/icehrm_master_data.sql
new file mode 100644
index 00000000..d8ed3ee5
--- /dev/null
+++ b/core-ext/scripts/icehrm_master_data.sql
@@ -0,0 +1,892 @@
+INSERT INTO `CurrencyTypes`(`id`, `code`, `name`) VALUES
+ (3, 'AED', 'Utd. Arab Emir. Dirham'),
+ (4, 'AFN', 'Afghanistan Afghani'),
+ (5, 'ALL', 'Albanian Lek'),
+ (6, 'ANG', 'NL Antillian Guilder'),
+ (7, 'AOR', 'Angolan New Kwanza'),
+ (177, 'ARP', 'Argentina Pesos'),
+ (8, 'ARS', 'Argentine Peso'),
+ (10, 'AUD', 'Australian Dollar'),
+ (11, 'AWG', 'Aruban Florin'),
+ (12, 'BBD', 'Barbados Dollar'),
+ (13, 'BDT', 'Bangladeshi Taka'),
+ (15, 'BGL', 'Bulgarian Lev'),
+ (16, 'BHD', 'Bahraini Dinar'),
+ (17, 'BIF', 'Burundi Franc'),
+ (18, 'BMD', 'Bermudian Dollar'),
+ (19, 'BND', 'Brunei Dollar'),
+ (20, 'BOB', 'Bolivian Boliviano'),
+ (21, 'BRL', 'Brazilian Real'),
+ (22, 'BSD', 'Bahamian Dollar'),
+ (23, 'BTN', 'Bhutan Ngultrum'),
+ (24, 'BWP', 'Botswana Pula'),
+ (25, 'BZD', 'Belize Dollar'),
+ (26, 'CAD', 'Canadian Dollar'),
+ (27, 'CHF', 'Swiss Franc'),
+ (28, 'CLP', 'Chilean Peso'),
+ (29, 'CNY', 'Chinese Yuan Renminbi'),
+ (30, 'COP', 'Colombian Peso'),
+ (31, 'CRC', 'Costa Rican Colon'),
+ (171, 'CZK', 'Czech Koruna'),
+ (32, 'CUP', 'Cuban Peso'),
+ (33, 'CVE', 'Cape Verde Escudo'),
+ (34, 'CYP', 'Cyprus Pound'),
+ (37, 'DJF', 'Djibouti Franc'),
+ (38, 'DKK', 'Danish Krona'),
+ (39, 'DOP', 'Dominican Peso'),
+ (40, 'DZD', 'Algerian Dinar'),
+ (41, 'ECS', 'Ecuador Sucre'),
+ (43, 'EEK', 'Estonian Krona'),
+ (44, 'EGP', 'Egyptian Pound'),
+ (46, 'ETB', 'Ethiopian Birr'),
+ (42, 'EUR', 'Euro'),
+ (48, 'FJD', 'Fiji Dollar'),
+ (49, 'FKP', 'Falkland Islands Pound'),
+ (51, 'GBP', 'Pound Sterling'),
+ (52, 'GHC', 'Ghanaian Cedi'),
+ (53, 'GIP', 'Gibraltar Pound'),
+ (54, 'GMD', 'Gambian Dalasi'),
+ (55, 'GNF', 'Guinea Franc'),
+ (57, 'GTQ', 'Guatemalan Quetzal'),
+ (58, 'GYD', 'Guyanan Dollar'),
+ (59, 'HKD', 'Hong Kong Dollar'),
+ (60, 'HNL', 'Honduran Lempira'),
+ (61, 'HRK', 'Croatian Kuna'),
+ (62, 'HTG', 'Haitian Gourde'),
+ (63, 'HUF', 'Hungarian Forint'),
+ (64, 'IDR', 'Indonesian Rupiah'),
+ (66, 'ILS', 'Israeli New Shekel'),
+ (67, 'INR', 'Indian Rupee'),
+ (68, 'IQD', 'Iraqi Dinar'),
+ (69, 'IRR', 'Iranian Rial'),
+ (70, 'ISK', 'Iceland Krona'),
+ (72, 'JMD', 'Jamaican Dollar'),
+ (73, 'JOD', 'Jordanian Dinar'),
+ (74, 'JPY', 'Japanese Yen'),
+ (75, 'KES', 'Kenyan Shilling'),
+ (76, 'KHR', 'Kampuchean Riel'),
+ (77, 'KMF', 'Comoros Franc'),
+ (78, 'KPW', 'North Korean Won'),
+ (79, 'KRW', 'Korean Won'),
+ (80, 'KWD', 'Kuwaiti Dinar'),
+ (81, 'KYD', 'Cayman Islands Dollar'),
+ (82, 'KZT', 'Kazakhstan Tenge'),
+ (83, 'LAK', 'Lao Kip'),
+ (84, 'LBP', 'Lebanese Pound'),
+ (85, 'LKR', 'Sri Lanka Rupee'),
+ (86, 'LRD', 'Liberian Dollar'),
+ (87, 'LSL', 'Lesotho Loti'),
+ (88, 'LTL', 'Lithuanian Litas'),
+ (90, 'LVL', 'Latvian Lats'),
+ (91, 'LYD', 'Libyan Dinar'),
+ (92, 'MAD', 'Moroccan Dirham'),
+ (93, 'MGF', 'Malagasy Franc'),
+ (94, 'MMK', 'Myanmar Kyat'),
+ (95, 'MNT', 'Mongolian Tugrik'),
+ (96, 'MOP', 'Macau Pataca'),
+ (97, 'MRO', 'Mauritanian Ouguiya'),
+ (98, 'MTL', 'Maltese Lira'),
+ (99, 'MUR', 'Mauritius Rupee'),
+ (100, 'MVR', 'Maldive Rufiyaa'),
+ (101, 'MWK', 'Malawi Kwacha'),
+ (102, 'MXN', 'Mexican New Peso'),
+ (172, 'MXP', 'Mexican Peso'),
+ (103, 'MYR', 'Malaysian Ringgit'),
+ (104, 'MZM', 'Mozambique Metical'),
+ (105, 'NAD', 'Namibia Dollar'),
+ (106, 'NGN', 'Nigerian Naira'),
+ (107, 'NIO', 'Nicaraguan Cordoba Oro'),
+ (109, 'NOK', 'Norwegian Krona'),
+ (110, 'NPR', 'Nepalese Rupee'),
+ (111, 'NZD', 'New Zealand Dollar'),
+ (112, 'OMR', 'Omani Rial'),
+ (113, 'PAB', 'Panamanian Balboa'),
+ (114, 'PEN', 'Peruvian Nuevo Sol'),
+ (115, 'PGK', 'Papua New Guinea Kina'),
+ (116, 'PHP', 'Philippine Peso'),
+ (117, 'PKR', 'Pakistan Rupee'),
+ (118, 'PLN', 'Polish Zloty'),
+ (120, 'PYG', 'Paraguay Guarani'),
+ (121, 'QAR', 'Qatari Rial'),
+ (122, 'ROL', 'Romanian Leu'),
+ (123, 'RUB', 'Russian Rouble'),
+ (180, 'RUR', 'Russia Rubles'),
+ (125, 'SBD', 'Solomon Islands Dollar'),
+ (126, 'SCR', 'Seychelles Rupee'),
+ (127, 'SDD', 'Sudanese Dinar'),
+ (128, 'SDP', 'Sudanese Pound'),
+ (129, 'SEK', 'Swedish Krona'),
+ (131, 'SGD', 'Singapore Dollar'),
+ (132, 'SHP', 'St. Helena Pound'),
+ (130, 'SKK', 'Slovak Koruna'),
+ (135, 'SLL', 'Sierra Leone Leone'),
+ (136, 'SOS', 'Somali Shilling'),
+ (137, 'SRD', 'Surinamese Dollar'),
+ (138, 'STD', 'Sao Tome/Principe Dobra'),
+ (139, 'SVC', 'El Salvador Colon'),
+ (140, 'SYP', 'Syrian Pound'),
+ (141, 'SZL', 'Swaziland Lilangeni'),
+ (142, 'THB', 'Thai Baht'),
+ (143, 'TND', 'Tunisian Dinar'),
+ (144, 'TOP', 'Tongan Pa''anga'),
+ (145, 'TRL', 'Turkish Lira'),
+ (146, 'TTD', 'Trinidad/Tobago Dollar'),
+ (147, 'TWD', 'Taiwan Dollar'),
+ (148, 'TZS', 'Tanzanian Shilling'),
+ (149, 'UAH', 'Ukraine Hryvnia'),
+ (150, 'UGX', 'Uganda Shilling'),
+ (151, 'USD', 'United States Dollar'),
+ (152, 'UYP', 'Uruguayan Peso'),
+ (153, 'VEB', 'Venezuelan Bolivar'),
+ (154, 'VND', 'Vietnamese Dong'),
+ (155, 'VUV', 'Vanuatu Vatu'),
+ (156, 'WST', 'Samoan Tala'),
+ (158, 'XAF', 'CFA Franc BEAC'),
+ (159, 'XAG', 'Silver (oz.)'),
+ (160, 'XAU', 'Gold (oz.)'),
+ (161, 'XCD', 'Eastern Caribbean Dollars'),
+ (179, 'XDR', 'IMF Special Drawing Right'),
+ (162, 'XOF', 'CFA Franc BCEAO'),
+ (163, 'XPD', 'Palladium (oz.)'),
+ (164, 'XPF', 'CFP Franc'),
+ (165, 'XPT', 'Platinum (oz.)'),
+ (166, 'YER', 'Yemeni Riyal'),
+ (167, 'YUM', 'Yugoslavian Dinar'),
+ (175, 'YUN', 'Yugoslav Dinar'),
+ (168, 'ZAR', 'South African Rand'),
+ (176, 'ZMK', 'Zambian Kwacha'),
+ (169, 'ZRN', 'New Zaire'),
+ (170, 'ZWD', 'Zimbabwe Dollar'),
+ (173, 'SAR', 'Saudi Arabia Riyal');
+
+
+INSERT INTO `Country`(`code`, `namecap`, `name`, `iso3`, `numcode`) VALUES
+ ('AF', 'AFGHANISTAN', 'Afghanistan', 'AFG', 4),
+ ('AL', 'ALBANIA', 'Albania', 'ALB', 8),
+ ('DZ', 'ALGERIA', 'Algeria', 'DZA', 12),
+ ('AS', 'AMERICAN SAMOA', 'American Samoa', 'ASM', 16),
+ ('AD', 'ANDORRA', 'Andorra', 'AND', 20),
+ ('AO', 'ANGOLA', 'Angola', 'AGO', 24),
+ ('AI', 'ANGUILLA', 'Anguilla', 'AIA', 660),
+ ('AQ', 'ANTARCTICA', 'Antarctica', NULL, NULL),
+ ('AG', 'ANTIGUA AND BARBUDA', 'Antigua and Barbuda', 'ATG', 28),
+ ('AR', 'ARGENTINA', 'Argentina', 'ARG', 32),
+ ('AM', 'ARMENIA', 'Armenia', 'ARM', 51),
+ ('AW', 'ARUBA', 'Aruba', 'ABW', 533),
+ ('AU', 'AUSTRALIA', 'Australia', 'AUS', 36),
+ ('AT', 'AUSTRIA', 'Austria', 'AUT', 40),
+ ('AZ', 'AZERBAIJAN', 'Azerbaijan', 'AZE', 31),
+ ('BS', 'BAHAMAS', 'Bahamas', 'BHS', 44),
+ ('BH', 'BAHRAIN', 'Bahrain', 'BHR', 48),
+ ('BD', 'BANGLADESH', 'Bangladesh', 'BGD', 50),
+ ('BB', 'BARBADOS', 'Barbados', 'BRB', 52),
+ ('BY', 'BELARUS', 'Belarus', 'BLR', 112),
+ ('BE', 'BELGIUM', 'Belgium', 'BEL', 56),
+ ('BZ', 'BELIZE', 'Belize', 'BLZ', 84),
+ ('BJ', 'BENIN', 'Benin', 'BEN', 204),
+ ('BM', 'BERMUDA', 'Bermuda', 'BMU', 60),
+ ('BT', 'BHUTAN', 'Bhutan', 'BTN', 64),
+ ('BO', 'BOLIVIA', 'Bolivia', 'BOL', 68),
+ ('BA', 'BOSNIA AND HERZEGOVINA', 'Bosnia and Herzegovina', 'BIH', 70),
+ ('BW', 'BOTSWANA', 'Botswana', 'BWA', 72),
+ ('BV', 'BOUVET ISLAND', 'Bouvet Island', NULL, NULL),
+ ('BR', 'BRAZIL', 'Brazil', 'BRA', 76),
+ ('IO', 'BRITISH INDIAN OCEAN TERRITORY', 'British Indian Ocean Territory', NULL, NULL),
+ ('BN', 'BRUNEI DARUSSALAM', 'Brunei Darussalam', 'BRN', 96),
+ ('BG', 'BULGARIA', 'Bulgaria', 'BGR', 100),
+ ('BF', 'BURKINA FASO', 'Burkina Faso', 'BFA', 854),
+ ('BI', 'BURUNDI', 'Burundi', 'BDI', 108),
+ ('KH', 'CAMBODIA', 'Cambodia', 'KHM', 116),
+ ('CM', 'CAMEROON', 'Cameroon', 'CMR', 120),
+ ('CA', 'CANADA', 'Canada', 'CAN', 124),
+ ('CV', 'CAPE VERDE', 'Cape Verde', 'CPV', 132),
+ ('KY', 'CAYMAN ISLANDS', 'Cayman Islands', 'CYM', 136),
+ ('CF', 'CENTRAL AFRICAN REPUBLIC', 'Central African Republic', 'CAF', 140),
+ ('TD', 'CHAD', 'Chad', 'TCD', 148),
+ ('CL', 'CHILE', 'Chile', 'CHL', 152),
+ ('CN', 'CHINA', 'China', 'CHN', 156),
+ ('CX', 'CHRISTMAS ISLAND', 'Christmas Island', NULL, NULL),
+ ('CC', 'COCOS (KEELING) ISLANDS', 'Cocos (Keeling) Islands', NULL, NULL),
+ ('CO', 'COLOMBIA', 'Colombia', 'COL', 170),
+ ('KM', 'COMOROS', 'Comoros', 'COM', 174),
+ ('CG', 'CONGO', 'Congo', 'COG', 178),
+ ('CD', 'CONGO, THE DEMOCRATIC REPUBLIC OF THE', 'Congo, the Democratic Republic of the', 'COD', 180),
+ ('CK', 'COOK ISLANDS', 'Cook Islands', 'COK', 184),
+ ('CR', 'COSTA RICA', 'Costa Rica', 'CRI', 188),
+ ('CI', 'COTE D''IVOIRE', 'Cote D''Ivoire', 'CIV', 384),
+ ('HR', 'CROATIA', 'Croatia', 'HRV', 191),
+ ('CU', 'CUBA', 'Cuba', 'CUB', 192),
+ ('CY', 'CYPRUS', 'Cyprus', 'CYP', 196),
+ ('CZ', 'CZECH REPUBLIC', 'Czech Republic', 'CZE', 203),
+ ('DK', 'DENMARK', 'Denmark', 'DNK', 208),
+ ('DJ', 'DJIBOUTI', 'Djibouti', 'DJI', 262),
+ ('DM', 'DOMINICA', 'Dominica', 'DMA', 212),
+ ('DO', 'DOMINICAN REPUBLIC', 'Dominican Republic', 'DOM', 214),
+ ('EC', 'ECUADOR', 'Ecuador', 'ECU', 218),
+ ('EG', 'EGYPT', 'Egypt', 'EGY', 818),
+ ('SV', 'EL SALVADOR', 'El Salvador', 'SLV', 222),
+ ('GQ', 'EQUATORIAL GUINEA', 'Equatorial Guinea', 'GNQ', 226),
+ ('ER', 'ERITREA', 'Eritrea', 'ERI', 232),
+ ('EE', 'ESTONIA', 'Estonia', 'EST', 233),
+ ('ET', 'ETHIOPIA', 'Ethiopia', 'ETH', 231),
+ ('FK', 'FALKLAND ISLANDS (MALVINAS)', 'Falkland Islands (Malvinas)', 'FLK', 238),
+ ('FO', 'FAROE ISLANDS', 'Faroe Islands', 'FRO', 234),
+ ('FJ', 'FIJI', 'Fiji', 'FJI', 242),
+ ('FI', 'FINLAND', 'Finland', 'FIN', 246),
+ ('FR', 'FRANCE', 'France', 'FRA', 250),
+ ('GF', 'FRENCH GUIANA', 'French Guiana', 'GUF', 254),
+ ('PF', 'FRENCH POLYNESIA', 'French Polynesia', 'PYF', 258),
+ ('TF', 'FRENCH SOUTHERN TERRITORIES', 'French Southern Territories', NULL, NULL),
+ ('GA', 'GABON', 'Gabon', 'GAB', 266),
+ ('GM', 'GAMBIA', 'Gambia', 'GMB', 270),
+ ('GE', 'GEORGIA', 'Georgia', 'GEO', 268),
+ ('DE', 'GERMANY', 'Germany', 'DEU', 276),
+ ('GH', 'GHANA', 'Ghana', 'GHA', 288),
+ ('GI', 'GIBRALTAR', 'Gibraltar', 'GIB', 292),
+ ('GR', 'GREECE', 'Greece', 'GRC', 300),
+ ('GL', 'GREENLAND', 'Greenland', 'GRL', 304),
+ ('GD', 'GRENADA', 'Grenada', 'GRD', 308),
+ ('GP', 'GUADELOUPE', 'Guadeloupe', 'GLP', 312),
+ ('GU', 'GUAM', 'Guam', 'GUM', 316),
+ ('GT', 'GUATEMALA', 'Guatemala', 'GTM', 320),
+ ('GN', 'GUINEA', 'Guinea', 'GIN', 324),
+ ('GW', 'GUINEA-BISSAU', 'Guinea-Bissau', 'GNB', 624),
+ ('GY', 'GUYANA', 'Guyana', 'GUY', 328),
+ ('HT', 'HAITI', 'Haiti', 'HTI', 332),
+ ('HM', 'HEARD ISLAND AND MCDONALD ISLANDS', 'Heard Island and Mcdonald Islands', NULL, NULL),
+ ('VA', 'HOLY SEE (VATICAN CITY STATE)', 'Holy See (Vatican City State)', 'VAT', 336),
+ ('HN', 'HONDURAS', 'Honduras', 'HND', 340),
+ ('HK', 'HONG KONG', 'Hong Kong', 'HKG', 344),
+ ('HU', 'HUNGARY', 'Hungary', 'HUN', 348),
+ ('IS', 'ICELAND', 'Iceland', 'ISL', 352),
+ ('IN', 'INDIA', 'India', 'IND', 356),
+ ('ID', 'INDONESIA', 'Indonesia', 'IDN', 360),
+ ('IR', 'IRAN, ISLAMIC REPUBLIC OF', 'Iran, Islamic Republic of', 'IRN', 364),
+ ('IQ', 'IRAQ', 'Iraq', 'IRQ', 368),
+ ('IE', 'IRELAND', 'Ireland', 'IRL', 372),
+ ('IL', 'ISRAEL', 'Israel', 'ISR', 376),
+ ('IT', 'ITALY', 'Italy', 'ITA', 380),
+ ('JM', 'JAMAICA', 'Jamaica', 'JAM', 388),
+ ('JP', 'JAPAN', 'Japan', 'JPN', 392),
+ ('JO', 'JORDAN', 'Jordan', 'JOR', 400),
+ ('KZ', 'KAZAKHSTAN', 'Kazakhstan', 'KAZ', 398),
+ ('KE', 'KENYA', 'Kenya', 'KEN', 404),
+ ('KI', 'KIRIBATI', 'Kiribati', 'KIR', 296),
+ ('KP', 'KOREA, DEMOCRATIC PEOPLE''S REPUBLIC OF', 'Korea, Democratic People''s Republic of', 'PRK', 408),
+ ('KR', 'KOREA, REPUBLIC OF', 'Korea, Republic of', 'KOR', 410),
+ ('KW', 'KUWAIT', 'Kuwait', 'KWT', 414),
+ ('KG', 'KYRGYZSTAN', 'Kyrgyzstan', 'KGZ', 417),
+ ('LA', 'LAO PEOPLE''S DEMOCRATIC REPUBLIC', 'Lao People''s Democratic Republic', 'LAO', 418),
+ ('LV', 'LATVIA', 'Latvia', 'LVA', 428),
+ ('LB', 'LEBANON', 'Lebanon', 'LBN', 422),
+ ('LS', 'LESOTHO', 'Lesotho', 'LSO', 426),
+ ('LR', 'LIBERIA', 'Liberia', 'LBR', 430),
+ ('LY', 'LIBYAN ARAB JAMAHIRIYA', 'Libyan Arab Jamahiriya', 'LBY', 434),
+ ('LI', 'LIECHTENSTEIN', 'Liechtenstein', 'LIE', 438),
+ ('LT', 'LITHUANIA', 'Lithuania', 'LTU', 440),
+ ('LU', 'LUXEMBOURG', 'Luxembourg', 'LUX', 442),
+ ('MO', 'MACAO', 'Macao', 'MAC', 446),
+ ('MK', 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF', 'Macedonia, the Former Yugoslav Republic of', 'MKD', 807),
+ ('MG', 'MADAGASCAR', 'Madagascar', 'MDG', 450),
+ ('MW', 'MALAWI', 'Malawi', 'MWI', 454),
+ ('MY', 'MALAYSIA', 'Malaysia', 'MYS', 458),
+ ('MV', 'MALDIVES', 'Maldives', 'MDV', 462),
+ ('ML', 'MALI', 'Mali', 'MLI', 466),
+ ('MT', 'MALTA', 'Malta', 'MLT', 470),
+ ('MH', 'MARSHALL ISLANDS', 'Marshall Islands', 'MHL', 584),
+ ('MQ', 'MARTINIQUE', 'Martinique', 'MTQ', 474),
+ ('MR', 'MAURITANIA', 'Mauritania', 'MRT', 478),
+ ('MU', 'MAURITIUS', 'Mauritius', 'MUS', 480),
+ ('YT', 'MAYOTTE', 'Mayotte', NULL, NULL),
+ ('MX', 'MEXICO', 'Mexico', 'MEX', 484),
+ ('FM', 'MICRONESIA, FEDERATED STATES OF', 'Micronesia, Federated States of', 'FSM', 583),
+ ('MD', 'MOLDOVA, REPUBLIC OF', 'Moldova, Republic of', 'MDA', 498),
+ ('MC', 'MONACO', 'Monaco', 'MCO', 492),
+ ('MN', 'MONGOLIA', 'Mongolia', 'MNG', 496),
+ ('MS', 'MONTSERRAT', 'Montserrat', 'MSR', 500),
+ ('MA', 'MOROCCO', 'Morocco', 'MAR', 504),
+ ('MZ', 'MOZAMBIQUE', 'Mozambique', 'MOZ', 508),
+ ('MM', 'MYANMAR', 'Myanmar', 'MMR', 104),
+ ('NA', 'NAMIBIA', 'Namibia', 'NAM', 516),
+ ('NR', 'NAURU', 'Nauru', 'NRU', 520),
+ ('NP', 'NEPAL', 'Nepal', 'NPL', 524),
+ ('NL', 'NETHERLANDS', 'Netherlands', 'NLD', 528),
+ ('AN', 'NETHERLANDS ANTILLES', 'Netherlands Antilles', 'ANT', 530),
+ ('NC', 'NEW CALEDONIA', 'New Caledonia', 'NCL', 540),
+ ('NZ', 'NEW ZEALAND', 'New Zealand', 'NZL', 554),
+ ('NI', 'NICARAGUA', 'Nicaragua', 'NIC', 558),
+ ('NE', 'NIGER', 'Niger', 'NER', 562),
+ ('NG', 'NIGERIA', 'Nigeria', 'NGA', 566),
+ ('NU', 'NIUE', 'Niue', 'NIU', 570),
+ ('NF', 'NORFOLK ISLAND', 'Norfolk Island', 'NFK', 574),
+ ('MP', 'NORTHERN MARIANA ISLANDS', 'Northern Mariana Islands', 'MNP', 580),
+ ('NO', 'NORWAY', 'Norway', 'NOR', 578),
+ ('OM', 'OMAN', 'Oman', 'OMN', 512),
+ ('PK', 'PAKISTAN', 'Pakistan', 'PAK', 586),
+ ('PW', 'PALAU', 'Palau', 'PLW', 585),
+ ('PS', 'PALESTINIAN TERRITORY, OCCUPIED', 'Palestinian Territory, Occupied', NULL, NULL),
+ ('PA', 'PANAMA', 'Panama', 'PAN', 591),
+ ('PG', 'PAPUA NEW GUINEA', 'Papua New Guinea', 'PNG', 598),
+ ('PY', 'PARAGUAY', 'Paraguay', 'PRY', 600),
+ ('PE', 'PERU', 'Peru', 'PER', 604),
+ ('PH', 'PHILIPPINES', 'Philippines', 'PHL', 608),
+ ('PN', 'PITCAIRN', 'Pitcairn', 'PCN', 612),
+ ('PL', 'POLAND', 'Poland', 'POL', 616),
+ ('PT', 'PORTUGAL', 'Portugal', 'PRT', 620),
+ ('PR', 'PUERTO RICO', 'Puerto Rico', 'PRI', 630),
+ ('QA', 'QATAR', 'Qatar', 'QAT', 634),
+ ('RE', 'REUNION', 'Reunion', 'REU', 638),
+ ('RO', 'ROMANIA', 'Romania', 'ROM', 642),
+ ('RU', 'RUSSIAN FEDERATION', 'Russian Federation', 'RUS', 643),
+ ('RW', 'RWANDA', 'Rwanda', 'RWA', 646),
+ ('SH', 'SAINT HELENA', 'Saint Helena', 'SHN', 654),
+ ('KN', 'SAINT KITTS AND NEVIS', 'Saint Kitts and Nevis', 'KNA', 659),
+ ('LC', 'SAINT LUCIA', 'Saint Lucia', 'LCA', 662),
+ ('PM', 'SAINT PIERRE AND MIQUELON', 'Saint Pierre and Miquelon', 'SPM', 666),
+ ('VC', 'SAINT VINCENT AND THE GRENADINES', 'Saint Vincent and the Grenadines', 'VCT', 670),
+ ('WS', 'SAMOA', 'Samoa', 'WSM', 882),
+ ('SM', 'SAN MARINO', 'San Marino', 'SMR', 674),
+ ('ST', 'SAO TOME AND PRINCIPE', 'Sao Tome and Principe', 'STP', 678),
+ ('SA', 'SAUDI ARABIA', 'Saudi Arabia', 'SAU', 682),
+ ('SN', 'SENEGAL', 'Senegal', 'SEN', 686),
+ ('CS', 'SERBIA AND MONTENEGRO', 'Serbia and Montenegro', NULL, NULL),
+ ('SC', 'SEYCHELLES', 'Seychelles', 'SYC', 690),
+ ('SL', 'SIERRA LEONE', 'Sierra Leone', 'SLE', 694),
+ ('SG', 'SINGAPORE', 'Singapore', 'SGP', 702),
+ ('SK', 'SLOVAKIA', 'Slovakia', 'SVK', 703),
+ ('SI', 'SLOVENIA', 'Slovenia', 'SVN', 705),
+ ('SB', 'SOLOMON ISLANDS', 'Solomon Islands', 'SLB', 90),
+ ('SO', 'SOMALIA', 'Somalia', 'SOM', 706),
+ ('ZA', 'SOUTH AFRICA', 'South Africa', 'ZAF', 710),
+ ('GS', 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS', 'South Georgia and the South Sandwich Islands', NULL, NULL),
+ ('ES', 'SPAIN', 'Spain', 'ESP', 724),
+ ('LK', 'SRI LANKA', 'Sri Lanka', 'LKA', 144),
+ ('SD', 'SUDAN', 'Sudan', 'SDN', 736),
+ ('SR', 'SURINAME', 'Suriname', 'SUR', 740),
+ ('SJ', 'SVALBARD AND JAN MAYEN', 'Svalbard and Jan Mayen', 'SJM', 744),
+ ('SZ', 'SWAZILAND', 'Swaziland', 'SWZ', 748),
+ ('SE', 'SWEDEN', 'Sweden', 'SWE', 752),
+ ('CH', 'SWITZERLAND', 'Switzerland', 'CHE', 756),
+ ('SY', 'SYRIAN ARAB REPUBLIC', 'Syrian Arab Republic', 'SYR', 760),
+ ('TW', 'TAIWAN, PROVINCE OF CHINA', 'Taiwan', 'TWN', 158),
+ ('TJ', 'TAJIKISTAN', 'Tajikistan', 'TJK', 762),
+ ('TZ', 'TANZANIA, UNITED REPUBLIC OF', 'Tanzania, United Republic of', 'TZA', 834),
+ ('TH', 'THAILAND', 'Thailand', 'THA', 764),
+ ('TL', 'TIMOR-LESTE', 'Timor-Leste', NULL, NULL),
+ ('TG', 'TOGO', 'Togo', 'TGO', 768),
+ ('TK', 'TOKELAU', 'Tokelau', 'TKL', 772),
+ ('TO', 'TONGA', 'Tonga', 'TON', 776),
+ ('TT', 'TRINIDAD AND TOBAGO', 'Trinidad and Tobago', 'TTO', 780),
+ ('TN', 'TUNISIA', 'Tunisia', 'TUN', 788),
+ ('TR', 'TURKEY', 'Turkey', 'TUR', 792),
+ ('TM', 'TURKMENISTAN', 'Turkmenistan', 'TKM', 795),
+ ('TC', 'TURKS AND CAICOS ISLANDS', 'Turks and Caicos Islands', 'TCA', 796),
+ ('TV', 'TUVALU', 'Tuvalu', 'TUV', 798),
+ ('UG', 'UGANDA', 'Uganda', 'UGA', 800),
+ ('UA', 'UKRAINE', 'Ukraine', 'UKR', 804),
+ ('AE', 'UNITED ARAB EMIRATES', 'United Arab Emirates', 'ARE', 784),
+ ('GB', 'UNITED KINGDOM', 'United Kingdom', 'GBR', 826),
+ ('US', 'UNITED STATES', 'United States', 'USA', 840),
+ ('UM', 'UNITED STATES MINOR OUTLYING ISLANDS', 'United States Minor Outlying Islands', NULL, NULL),
+ ('UY', 'URUGUAY', 'Uruguay', 'URY', 858),
+ ('UZ', 'UZBEKISTAN', 'Uzbekistan', 'UZB', 860),
+ ('VU', 'VANUATU', 'Vanuatu', 'VUT', 548),
+ ('VE', 'VENEZUELA', 'Venezuela', 'VEN', 862),
+ ('VN', 'VIET NAM', 'Viet Nam', 'VNM', 704),
+ ('VG', 'VIRGIN ISLANDS, BRITISH', 'Virgin Islands, British', 'VGB', 92),
+ ('VI', 'VIRGIN ISLANDS, U.S.', 'Virgin Islands, U.s.', 'VIR', 850),
+ ('WF', 'WALLIS AND FUTUNA', 'Wallis and Futuna', 'WLF', 876),
+ ('EH', 'WESTERN SAHARA', 'Western Sahara', 'ESH', 732),
+ ('YE', 'YEMEN', 'Yemen', 'YEM', 887),
+ ('ZM', 'ZAMBIA', 'Zambia', 'ZMB', 894),
+ ('ZW', 'ZIMBABWE', 'Zimbabwe', 'ZWE', 716);
+
+INSERT INTO `Province`(`id`, `name`, `code`, `country`) VALUES
+ (1, 'Alaska', 'AK', 'US'),
+ (2, 'Alabama', 'AL', 'US'),
+ (3, 'American Samoa', 'AS', 'US'),
+ (4, 'Arizona', 'AZ', 'US'),
+ (5, 'Arkansas', 'AR', 'US'),
+ (6, 'California', 'CA', 'US'),
+ (7, 'Colorado', 'CO', 'US'),
+ (8, 'Connecticut', 'CT', 'US'),
+ (9, 'Delaware', 'DE', 'US'),
+ (10, 'District of Columbia', 'DC', 'US'),
+ (11, 'Federated States of Micronesia', 'FM', 'US'),
+ (12, 'Florida', 'FL', 'US'),
+ (13, 'Georgia', 'GA', 'US'),
+ (14, 'Guam', 'GU', 'US'),
+ (15, 'Hawaii', 'HI', 'US'),
+ (16, 'Idaho', 'ID', 'US'),
+ (17, 'Illinois', 'IL', 'US'),
+ (18, 'Indiana', 'IN', 'US'),
+ (19, 'Iowa', 'IA', 'US'),
+ (20, 'Kansas', 'KS', 'US'),
+ (21, 'Kentucky', 'KY', 'US'),
+ (22, 'Louisiana', 'LA', 'US'),
+ (23, 'Maine', 'ME', 'US'),
+ (24, 'Marshall Islands', 'MH', 'US'),
+ (25, 'Maryland', 'MD', 'US'),
+ (26, 'Massachusetts', 'MA', 'US'),
+ (27, 'Michigan', 'MI', 'US'),
+ (28, 'Minnesota', 'MN', 'US'),
+ (29, 'Mississippi', 'MS', 'US'),
+ (30, 'Missouri', 'MO', 'US'),
+ (31, 'Montana', 'MT', 'US'),
+ (32, 'Nebraska', 'NE', 'US'),
+ (33, 'Nevada', 'NV', 'US'),
+ (34, 'New Hampshire', 'NH', 'US'),
+ (35, 'New Jersey', 'NJ', 'US'),
+ (36, 'New Mexico', 'NM', 'US'),
+ (37, 'New York', 'NY', 'US'),
+ (38, 'North Carolina', 'NC', 'US'),
+ (39, 'North Dakota', 'ND', 'US'),
+ (40, 'Northern Mariana Islands', 'MP', 'US'),
+ (41, 'Ohio', 'OH', 'US'),
+ (42, 'Oklahoma', 'OK', 'US'),
+ (43, 'Oregon', 'OR', 'US'),
+ (44, 'Palau', 'PW', 'US'),
+ (45, 'Pennsylvania', 'PA', 'US'),
+ (46, 'Puerto Rico', 'PR', 'US'),
+ (47, 'Rhode Island', 'RI', 'US'),
+ (48, 'South Carolina', 'SC', 'US'),
+ (49, 'South Dakota', 'SD', 'US'),
+ (50, 'Tennessee', 'TN', 'US'),
+ (51, 'Texas', 'TX', 'US'),
+ (52, 'Utah', 'UT', 'US'),
+ (53, 'Vermont', 'VT', 'US'),
+ (54, 'Virgin Islands', 'VI', 'US'),
+ (55, 'Virginia', 'VA', 'US'),
+ (56, 'Washington', 'WA', 'US'),
+ (57, 'West Virginia', 'WV', 'US'),
+ (58, 'Wisconsin', 'WI', 'US'),
+ (59, 'Wyoming', 'WY', 'US'),
+ (60, 'Armed Forces Africa', 'AE', 'US'),
+ (61, 'Armed Forces Americas (except Canada)', 'AA', 'US'),
+ (62, 'Armed Forces Canada', 'AE', 'US'),
+ (63, 'Armed Forces Europe', 'AE', 'US'),
+ (64, 'Armed Forces Middle East', 'AE', 'US'),
+ (65, 'Armed Forces Pacific', 'AP', 'US');
+
+
+
+INSERT INTO `Nationality` (`id`, `name`) VALUES
+(1, 'Afghan'),
+(2, 'Albanian'),
+(3, 'Algerian'),
+(4, 'American'),
+(5, 'Andorran'),
+(6, 'Angolan'),
+(7, 'Antiguans'),
+(8, 'Argentinean'),
+(9, 'Armenian'),
+(10, 'Australian'),
+(11, 'Austrian'),
+(12, 'Azerbaijani'),
+(13, 'Bahamian'),
+(14, 'Bahraini'),
+(15, 'Bangladeshi'),
+(16, 'Barbadian'),
+(17, 'Barbudans'),
+(18, 'Batswana'),
+(19, 'Belarusian'),
+(20, 'Belgian'),
+(21, 'Belizean'),
+(22, 'Beninese'),
+(23, 'Bhutanese'),
+(24, 'Bolivian'),
+(25, 'Bosnian'),
+(26, 'Brazilian'),
+(27, 'British'),
+(28, 'Bruneian'),
+(29, 'Bulgarian'),
+(30, 'Burkinabe'),
+(31, 'Burmese'),
+(32, 'Burundian'),
+(33, 'Cambodian'),
+(34, 'Cameroonian'),
+(35, 'Canadian'),
+(36, 'Cape Verdean'),
+(37, 'Central African'),
+(38, 'Chadian'),
+(39, 'Chilean'),
+(40, 'Chinese'),
+(41, 'Colombian'),
+(42, 'Comoran'),
+(43, 'Congolese'),
+(44, 'Costa Rican'),
+(45, 'Croatian'),
+(46, 'Cuban'),
+(47, 'Cypriot'),
+(48, 'Czech'),
+(49, 'Danish'),
+(50, 'Djibouti'),
+(51, 'Dominican'),
+(52, 'Dutch'),
+(53, 'East Timorese'),
+(54, 'Ecuadorean'),
+(55, 'Egyptian'),
+(56, 'Emirian'),
+(57, 'Equatorial Guinean'),
+(58, 'Eritrean'),
+(59, 'Estonian'),
+(60, 'Ethiopian'),
+(61, 'Fijian'),
+(62, 'Filipino'),
+(63, 'Finnish'),
+(64, 'French'),
+(65, 'Gabonese'),
+(66, 'Gambian'),
+(67, 'Georgian'),
+(68, 'German'),
+(69, 'Ghanaian'),
+(70, 'Greek'),
+(71, 'Grenadian'),
+(72, 'Guatemalan'),
+(73, 'Guinea-Bissauan'),
+(74, 'Guinean'),
+(75, 'Guyanese'),
+(76, 'Haitian'),
+(77, 'Herzegovinian'),
+(78, 'Honduran'),
+(79, 'Hungarian'),
+(80, 'I-Kiribati'),
+(81, 'Icelander'),
+(82, 'Indian'),
+(83, 'Indonesian'),
+(84, 'Iranian'),
+(85, 'Iraqi'),
+(86, 'Irish'),
+(87, 'Israeli'),
+(88, 'Italian'),
+(89, 'Ivorian'),
+(90, 'Jamaican'),
+(91, 'Japanese'),
+(92, 'Jordanian'),
+(93, 'Kazakhstani'),
+(94, 'Kenyan'),
+(95, 'Kittian and Nevisian'),
+(96, 'Kuwaiti'),
+(97, 'Kyrgyz'),
+(98, 'Laotian'),
+(99, 'Latvian'),
+(100, 'Lebanese'),
+(101, 'Liberian'),
+(102, 'Libyan'),
+(103, 'Liechtensteiner'),
+(104, 'Lithuanian'),
+(105, 'Luxembourger'),
+(106, 'Macedonian'),
+(107, 'Malagasy'),
+(108, 'Malawian'),
+(109, 'Malaysian'),
+(110, 'Maldivan'),
+(111, 'Malian'),
+(112, 'Maltese'),
+(113, 'Marshallese'),
+(114, 'Mauritanian'),
+(115, 'Mauritian'),
+(116, 'Mexican'),
+(117, 'Micronesian'),
+(118, 'Moldovan'),
+(119, 'Monacan'),
+(120, 'Mongolian'),
+(121, 'Moroccan'),
+(122, 'Mosotho'),
+(123, 'Motswana'),
+(124, 'Mozambican'),
+(125, 'Namibian'),
+(126, 'Nauruan'),
+(127, 'Nepalese'),
+(128, 'New Zealander'),
+(129, 'Nicaraguan'),
+(130, 'Nigerian'),
+(131, 'Nigerien'),
+(132, 'North Korean'),
+(133, 'Northern Irish'),
+(134, 'Norwegian'),
+(135, 'Omani'),
+(136, 'Pakistani'),
+(137, 'Palauan'),
+(138, 'Panamanian'),
+(139, 'Papua New Guinean'),
+(140, 'Paraguayan'),
+(141, 'Peruvian'),
+(142, 'Polish'),
+(143, 'Portuguese'),
+(144, 'Qatari'),
+(145, 'Romanian'),
+(146, 'Russian'),
+(147, 'Rwandan'),
+(148, 'Saint Lucian'),
+(149, 'Salvadoran'),
+(150, 'Samoan'),
+(151, 'San Marinese'),
+(152, 'Sao Tomean'),
+(153, 'Saudi'),
+(154, 'Scottish'),
+(155, 'Senegalese'),
+(156, 'Serbian'),
+(157, 'Seychellois'),
+(158, 'Sierra Leonean'),
+(159, 'Singaporean'),
+(160, 'Slovakian'),
+(161, 'Slovenian'),
+(162, 'Solomon Islander'),
+(163, 'Somali'),
+(164, 'South African'),
+(165, 'South Korean'),
+(166, 'Spanish'),
+(167, 'Sri Lankan'),
+(168, 'Sudanese'),
+(169, 'Surinamer'),
+(170, 'Swazi'),
+(171, 'Swedish'),
+(172, 'Swiss'),
+(173, 'Syrian'),
+(174, 'Taiwanese'),
+(175, 'Tajik'),
+(176, 'Tanzanian'),
+(177, 'Thai'),
+(178, 'Togolese'),
+(179, 'Tongan'),
+(180, 'Trinidadian or Tobagonian'),
+(181, 'Tunisian'),
+(182, 'Turkish'),
+(183, 'Tuvaluan'),
+(184, 'Ugandan'),
+(185, 'Ukrainian'),
+(186, 'Uruguayan'),
+(187, 'Uzbekistani'),
+(188, 'Venezuelan'),
+(189, 'Vietnamese'),
+(190, 'Welsh'),
+(191, 'Yemenite'),
+(192, 'Zambian'),
+(193, 'Zimbabwean');
+
+INSERT INTO `WorkDays` (`id`, `name`, `status`, `country`) VALUES
+(1, 'Monday', 'Full Day',NULL),
+(2, 'Tuesday', 'Full Day',NULL),
+(3, 'Wednesday', 'Full Day',NULL),
+(4, 'Thursday', 'Full Day',NULL),
+(5, 'Friday', 'Full Day',NULL),
+(6, 'Saturday', 'Non-working Day',NULL),
+(7, 'Sunday', 'Non-working Day',NULL);
+
+
+INSERT INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES
+(1, 'Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query'),
+(3, 'Employee Time Entry Report', 'This report list all employee time entries by employee, date range and project', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimesheetReport', '["employee","date_start","date_end","status"]', 'Class'),
+(4, 'Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class'),
+(5, 'Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class');
+
+
+
+INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
+('Company: Name', 'Sample Company Pvt Ltd', 'Update your company name - For updating company logo copy a file named logo.png to /app/data/ folder', ''),
+('Email: Enable', '1', '0 will disable all outgoing emails from modules. Value 1 will enable outgoing emails','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
+('Email: Mode', 'SMTP', 'SMTP, PHP Mailer or Amazon SES. SMTP = send emails using local or a remote smtp server. PHP Mailer = send emails using mail function provided by php. Amazon SES = send emails trough amazon Simple Email Service.','["value", {"label":"Value","type":"select","source":[["SMTP","SMTP"],["PHP Mailer","PHP Mailer"],["SES","Amazon SES"]]}]'),
+('Email: SMTP Host', 'localhost', 'SMTP host IP',''),
+('Email: SMTP Authentication Required', '0', 'Is authentication required by this SMTP server','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
+('Email: SMTP User', 'none', 'SMTP user',''),
+('Email: SMTP Password', 'none', 'SMTP password',''),
+('Email: SMTP Port', 'none', '25',''),
+('Email: Amazon Access Key ID', '', 'If email mode is Amazon SNS please provide SNS Key',''),
+('Email: Amazon Secret Access Key', '', 'If email mode is Amazon SNS please provide SNS Secret',''),
+('Email: Email From', 'icehrm@mydomain.com', '',''),
+('System: Do not pass JSON in request', '0', 'Select Yes if you are having trouble loading data for some tables','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
+('System: Reset Modules and Permissions', '0', 'Select this to reset module and permission information in Database (If you have done any changes to meta files)','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
+('System: Add New Permissions', '0', 'Select this to add new permission changes done to meta.json file of any module','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
+('System: Debug Mode', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
+('Projects: Make All Projects Available to Employees', '1', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
+('Attendance: Time-sheet Cross Check', '0', 'Only allow users to add an entry to a timesheet only if they have marked atteandance for the selected period','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
+('Api: REST Api Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]');
+
+
+INSERT INTO `Certifications` (`id`, `name`, `description`) VALUES
+(1, 'Red Hat Certified Architect (RHCA)', 'Red Hat Certified Architect (RHCA)'),
+(2, 'GIAC Secure Software Programmer -Java', 'GIAC Secure Software Programmer -Java'),
+(3, 'Risk Management Professional (PMI)', 'Risk Management Professional (PMI)'),
+(4, 'IT Infrastructure Library (ITIL) Expert Certification', 'IT Infrastructure Library (ITIL) Expert Certification'),
+(5, 'Microsoft Certified Architect', 'Microsoft Certified Architect'),
+(6, 'Oracle Exadata 11g Certified Implementation Specialist', 'Oracle Exadata 11g Certified Implementation Specialist'),
+(7, 'Cisco Certified Design Professional (CCDP)', 'Cisco Certified Design Professional (CCDP)'),
+(8, 'Cisco Certified Internetwork Expert (CCIE)', 'Cisco Certified Internetwork Expert (CCIE)'),
+(9, 'Cisco Certified Network Associate', 'Cisco Certified Network Associate'),
+(10, 'HP/Master Accredited Solutions Expert (MASE)', 'HP/Master Accredited Solutions Expert (MASE)'),
+(11, 'HP/Master Accredited Systems Engineer (Master ASE)', 'HP/Master Accredited Systems Engineer (Master ASE)'),
+(12, 'Certified Information Security Manager (CISM)', 'Certified Information Security Manager (CISM)'),
+(13, 'Certified Information Systems Auditor (CISA)', 'Certified Information Systems Auditor (CISA)'),
+(14, 'CyberSecurity Forensic Analyst (CSFA)', 'CyberSecurity Forensic Analyst (CSFA)'),
+(15, 'Open Group Certified Architect (OpenCA)', 'Open Group Certified Architect (OpenCA)'),
+(16, 'Oracle DBA Administrator Certified Master OCM', 'Oracle DBA Administrator Certified Master OCM'),
+(17, 'Project Management Professional', 'Project Management Professional'),
+(18, 'Apple Certified Support Professional', 'Apple Certified Support Professional'),
+(19, 'Certified Public Accountant (CPA)', 'Certified Public Accountant (CPA)'),
+(20, 'Chartered Financial Analyst', 'Chartered Financial Analyst'),
+(21, 'Professional in Human Resources (PHR)', 'Professional in Human Resources (PHR)');
+
+
+
+INSERT INTO `Clients` (`id`, `name`, `details`, `first_contact_date`, `created`, `address`, `contact_number`, `contact_email`, `company_url`, `status`) VALUES
+(1, 'IceHrm Sample Client 1', NULL, '2012-01-04', '2013-01-03 05:47:33', '001, Sample Road,\nSample City, USA', '678-894-1047', 'icehrm+client1@web-stalk.com', 'http://icehrm.com', 'Active'),
+(2, 'IceHrm Sample Client 2', NULL, '2012-01-04', '2013-01-03 05:47:33', '001, Sample Road,\nSample City, USA', '678-894-1047', 'icehrm+client1@web-stalk.com', 'http://icehrm.com', 'Active'),
+(3, 'IceHrm Sample Client 3', NULL, '2012-01-04', '2013-01-03 05:47:33', '001, Sample Road,\nSample City, USA', '678-894-1047', 'icehrm+client1@web-stalk.com', 'http://icehrm.com', 'Active');
+
+
+INSERT INTO `CompanyLoans` (`id`, `name`, `details`) VALUES
+(1, 'Personal loan', 'Personal loans'),
+(2, 'Educational loan', 'Educational loan');
+
+
+INSERT INTO `CompanyStructures` (`id`, `title`, `description`, `address`, `type`, `country`, `parent`) VALUES
+(1, 'Your Company', 'Please update your company name here. You can update, delete or add units according to your needs', '', 'Company', 'US', NULL),
+(2, 'Head Office', 'US Head office', 'PO Box 001002\nSample Road, Sample Town', 'Head Office', 'US', 1),
+(3, 'Marketing Department', 'Marketing Department', 'PO Box 001002\nSample Road, Sample Town', 'Department', 'US', 2);
+
+
+INSERT INTO `Documents` (`id`, `name`, `details`) VALUES
+(1, 'ID Copy', 'Your ID copy'),
+(2, 'Degree Ceritficate', 'Degree Ceritficate'),
+(3, 'Driving License', 'Driving License');
+
+
+INSERT INTO `Educations` (`id`, `name`, `description`) VALUES
+(1, 'Bachelors Degree', 'Bachelors Degree'),
+(2, 'Diploma', 'Diploma'),
+(3, 'Masters Degree', 'Masters Degree'),
+(4, 'Doctorate', 'Doctorate');
+
+INSERT INTO `HoliDays` (`id`, `name`, `dateh`, `status`) VALUES
+(1, 'New Year''s Day', '2015-01-01', 'Full Day'),
+(2, 'Christmas Day', '2015-12-25', 'Full Day');
+
+
+INSERT INTO `JobTitles` (`id`, `code`, `name`, `description`, `specification`) VALUES
+(1, 'SE', 'Software Engineer', 'The work of a software engineer typically includes designing and programming system-level software: operating systems, database systems, embedded systems and so on. They understand how both software a', 'Software Engineer'),
+(2, 'ASE', 'Assistant Software Engineer', 'Assistant Software Engineer', 'Assistant Software Engineer'),
+(3, 'PM', 'Project Manager', 'Project Manager', 'Project Manager'),
+(4, 'QAE', 'QA Engineer', 'Quality Assurance Engineer ', 'Quality Assurance Engineer '),
+(5, 'PRM', 'Product Manager', 'Product Manager', 'Product Manager'),
+(6, 'AQAE', 'Assistant QA Engineer ', 'Assistant QA Engineer ', 'Assistant QA Engineer '),
+(7, 'TPM', 'Technical Project Manager', 'Technical Project Manager', 'Technical Project Manager'),
+(8, 'PRS', 'Pre-Sales Executive', 'Pre-Sales Executive', 'Pre-Sales Executive'),
+(9, 'ME', 'Marketing Executive', 'Marketing Executive', 'Marketing Executive'),
+(10, 'DH', 'Department Head', 'Department Head', 'Department Head'),
+(11, 'CEO', 'Chief Executive Officer', 'Chief Executive Officer', 'Chief Executive Officer'),
+(12, 'DBE', 'Database Engineer', 'Database Engineer', 'Database Engineer'),
+(13, 'SA', 'Server Admin', 'Server Admin', 'Server Admin');
+
+
+INSERT INTO `Languages` (`id`, `name`, `description`) VALUES
+(1, 'English', 'English'),
+(2, 'French', 'French'),
+(3, 'German', 'German'),
+(4, 'Chinese', 'Chinese');
+
+
+
+INSERT INTO `PayGrades` (`id`, `name`, `currency`, `min_salary`, `max_salary`) VALUES
+(1, 'Manager', 'SGD', '5000.00', '15000.00'),
+(2, 'Executive', 'SGD', '3500.00', '7000.00'),
+(3, 'Assistant ', 'SGD', '2000.00', '4000.00'),
+(4, 'Administrator', 'SGD', '2000.00', '6000.00');
+
+INSERT INTO `Projects` (`id`, `name`, `client`, `details`, `created`, `status`) VALUES
+(1, 'Project 1', 3, NULL, '2013-01-03 05:53:38', 'Active'),
+(2, 'Project 2', 3, NULL, '2013-01-03 05:54:22', 'Active'),
+(3, 'Project 3', 1, NULL, '2013-01-03 05:55:02', 'Active'),
+(4, 'Project 4', 2, NULL, '2013-01-03 05:56:16', 'Active');
+
+INSERT INTO `Skills` (`id`, `name`, `description`) VALUES
+(1, 'Programming and Application Development', 'Programming and Application Development'),
+(2, 'Project Management', 'Project Management'),
+(3, 'Help Desk/Technical Support', 'Help Desk/Technical Support'),
+(4, 'Networking', 'Networking'),
+(5, 'Databases', 'Databases'),
+(6, 'Business Intelligence', 'Business Intelligence'),
+(7, 'Cloud Computing', 'Cloud Computing'),
+(8, 'Information Security', 'Information Security'),
+(9, 'HTML Skills', 'HTML Skills'),
+(10, 'Graphic Designing', 'Graphic Designing');
+
+INSERT INTO `EmploymentStatus` (`id`, `name`, `description`) VALUES
+(1, 'Full Time Contract', 'Full Time Contract'),
+(2, 'Full Time Internship', 'Full Time Internship'),
+(3, 'Full Time Permanent', 'Full Time Permanent'),
+(4, 'Part Time Contract', 'Part Time Contract'),
+(5, 'Part Time Internship', 'Part Time Internship'),
+(6, 'Part Time Permanent', 'Part Time Permanent');
+
+INSERT INTO `FieldNameMappings` (`type`, `name`, `textOrig`, `textMapped`, `display`) VALUES
+ ('Employee', 'employee_id', 'Employee Number', 'Employee Number', 'Table and Form'),
+ ('Employee', 'first_name', 'First Name', 'First Name', 'Table and Form'),
+ ('Employee', 'middle_name', 'Middle Name', 'Middle Name', 'Form'),
+ ('Employee', 'last_name', 'Last Name', 'Last Name', 'Table and Form'),
+ ('Employee', 'nationality', 'Nationality', 'Nationality', 'Form'),
+ ('Employee', 'ethnicity', 'Ethnicity', 'Ethnicity', 'Form'),
+ ('Employee', 'immigration_status', 'Immigration Status', 'Immigration Status', 'Form'),
+ ('Employee', 'birthday', 'Date of Birth', 'Date of Birth', 'Form'),
+ ('Employee', 'gender', 'Gender', 'Gender', 'Form'),
+ ('Employee', 'marital_status', 'Marital Status', 'Marital Status', 'Form'),
+ ('Employee', 'ssn_num', 'SSN/NRIC', 'SSN/NRIC', 'Form'),
+ ('Employee', 'nic_num', 'NIC', 'NIC', 'Form'),
+ ('Employee', 'other_id', 'Other ID', 'Other ID', 'Form'),
+ ('Employee', 'driving_license', 'Driving License No', 'Driving License No', 'Form'),
+ ('Employee', 'employment_status', 'Employment Status', 'Employment Status', 'Form'),
+ ('Employee', 'job_title', 'Job Title', 'Job Title', 'Form'),
+ ('Employee', 'pay_grade', 'Pay Grade', 'Pay Grade', 'Form'),
+ ('Employee', 'work_station_id', 'Work Station Id', 'Work Station Id', 'Form'),
+ ('Employee', 'address1', 'Address Line 1', 'Address Line 1', 'Form'),
+ ('Employee', 'address2', 'Address Line 2', 'Address Line 2', 'Form'),
+ ('Employee', 'city', 'City', 'City', 'Form'),
+ ('Employee', 'country', 'Country', 'Country', 'Form'),
+ ('Employee', 'province', 'Province', 'Province', 'Form'),
+ ('Employee', 'postal_code', 'Postal/Zip Code', 'Postal/Zip Code', 'Form'),
+ ('Employee', 'home_phone', 'Home Phone', 'Home Phone', 'Form'),
+ ('Employee', 'mobile_phone', 'Mobile Phone', 'Mobile Phone', 'Table and Form'),
+ ('Employee', 'work_phone', 'Work Phone', 'Work Phone', 'Form'),
+ ('Employee', 'work_email', 'Work Email', 'Work Email', 'Form'),
+ ('Employee', 'private_email', 'Private Email', 'Private Email', 'Form'),
+ ('Employee', 'joined_date', 'Joined Date', 'Joined Date', 'Form'),
+ ('Employee', 'confirmation_date', 'Confirmation Date', 'Confirmation Date', 'Form'),
+ ('Employee', 'termination_date', 'Termination Date', 'Termination Date', 'Form'),
+ ('Employee', 'supervisor', 'Supervisor', 'Supervisor', 'Table and Form'),
+ ('Employee', 'department', 'Department', 'Department', 'Table and Form'),
+ ('Employee', 'notes', 'Notes', 'Notes', 'Form');
+
+
+INSERT INTO `CustomFields` (`type`, `name`, `data`,`display`) VALUES
+ ('Employee', 'custom1', '', 'Hidden'),
+ ('Employee', 'custom2', '', 'Hidden'),
+ ('Employee', 'custom3', '', 'Hidden'),
+ ('Employee', 'custom4', '', 'Hidden'),
+ ('Employee', 'custom5', '', 'Hidden'),
+ ('Employee', 'custom6', '', 'Hidden'),
+ ('Employee', 'custom7', '', 'Hidden'),
+ ('Employee', 'custom8', '', 'Hidden'),
+ ('Employee', 'custom9', '', 'Hidden'),
+ ('Employee', 'custom10', '', 'Hidden');
+
+
+INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) VALUES
+(1, 'EMP001', 'IceHrm', 'Sample', 'Employee', 35, '1984-03-17 18:30:00', 'Male', 'Married', '', '294-38-3535', '294-38-3535', '', NULL, 3, 11, 2, '', '2772 Flynn Street', 'Willoughby', 'Willoughby', 'US', 41, '44094', '440-953-4578', '440-953-4578', '440-953-4578', 'icehrm+admin@web-stalk.com', 'icehrm+admin@web-stalk.com', '2005-08-03 18:00:00', '0000-00-00 00:00:00', NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO `UserRoles` VALUES
+ (1,'Report Manager'),
+ (2,'Attendance Manager');
+
+
+INSERT INTO `Users` VALUES
+(1,'admin','icehrm+admin@web-stalk.com','21232f297a57a5a743894a0e4a801fc3',1,NULL,'Admin','',NULL,NULL,NULL);
+
+
+INSERT INTO `SalaryComponentType` (`id`,`code`, `name`) VALUES
+ (1,'B001', 'Basic'),
+ (2,'B002', 'Allowance');
+
+
+INSERT INTO `SalaryComponent` VALUES
+(1,'Basic Salary', 1,''),(2,'Fixed Allowance', 1,''),(3,'Car Allowance', 2,''),(4,'Telephone Allowance', 2,'');
+
diff --git a/core-ext/scripts/icehrm_sample_data.sql b/core-ext/scripts/icehrm_sample_data.sql
new file mode 100644
index 00000000..14f287e7
--- /dev/null
+++ b/core-ext/scripts/icehrm_sample_data.sql
@@ -0,0 +1,93 @@
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+
+
+INSERT INTO `CompanyStructures` (`id`, `title`, `description`, `address`, `type`, `country`, `parent`) VALUES
+(4, 'Development Center', 'Development Center', 'PO Box 001002\nSample Road, Sample Town', 'Regional Office', 'SG', 1),
+(5, 'Engineering Department', 'Engineering Department', 'PO Box 001002\nSample Road, Sample Town, 341234', 'Department', 'SG', 4),
+(6, 'Development Team', 'Development Team', '', 'Unit', 'SG', 5),
+(7, 'QA Team', 'QA Team', '', 'Unit', 'SG', 5),
+(8, 'Server Administration', 'Server Administration', '', 'Unit', 'SG', 5),
+(9, 'Administration & HR', 'Administration and Human Resource', '', 'Department', 'SG', 4);
+
+
+INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) VALUES
+(2, 'EMP002', 'Lala', 'Nadila ', 'Lamees', 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+manager@web-stalk.com', 'icehrm+manager@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 1, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(3, 'EMP003', 'Sofia', '', 'O''Sullivan', 4, '1975-08-28 18:30:00', 'Female', 'Married', '', '768-20-4394', '768-20-4394', '', NULL, 3, 10, 2, '', '2792 Trails End Road', 'Fort Lauderdale', 'Fort Lauderdale', 'US', 12, '33308', '954-388-3340', '954-388-3340', '954-388-3340', 'icehrm+user1@web-stalk.com', 'icehrm+user1@web-stalk.com', '2010-02-08 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(4, 'EMP004', 'Taylor', '', 'Holmes', 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+
+
+INSERT INTO `EmergencyContacts` (`id`, `employee`, `name`, `relationship`, `home_phone`, `work_phone`, `mobile_phone`) VALUES
+(1, 1, 'Emma Owns', 'Mother', '+874463422', '+874463422', '+874463422'),
+(2, 2, 'Casey Watson', 'Sister', '231-453-876', '231-453-876', '231-453-876');
+
+
+INSERT INTO `EmployeeCertifications` (`id`, `certification_id`, `employee`, `institute`, `date_start`, `date_end`) VALUES
+(1, 21, 1, 'PHR', '2012-06-04', '2016-06-13'),
+(2, 19, 1, 'CPA', '2010-02-16', '2019-02-28'),
+(3, 17, 2, 'PMP', '2011-06-14', '2019-10-20'),
+(4, 3, 2, 'PMI', '2004-06-08', '2017-09-14');
+
+INSERT INTO `EmployeeCompanyLoans` (`id`, `employee`, `loan`, `start_date`, `last_installment_date`, `period_months`, `amount`, `monthly_installment`, `status`, `details`) VALUES
+(1, 2, 2, '2013-02-05', '0000-00-00', 12, '12000.00', '1059.45', 'Approved', '');
+
+INSERT INTO `EmployeeDependents` (`id`, `employee`, `name`, `relationship`, `dob`, `id_number`) VALUES
+(1, 1, 'Emma Owns', 'Parent', '1940-06-11', '475209UHB'),
+(2, 1, 'Mica Singroo', 'Other', '2000-06-13', '');
+
+
+INSERT INTO `EmployeeDocuments` (`id`, `employee`, `document`, `date_added`, `valid_until`, `status`, `details`) VALUES
+(1, 2, 2, '2013-01-08', '0000-00-00', 'Active', 'zxczx');
+
+
+INSERT INTO `EmployeeEducations` (`id`, `education_id`, `employee`, `institute`, `date_start`, `date_end`) VALUES
+(1, 1, 1, 'National University of Turky', '2004-02-03', '2006-06-13'),
+(2, 1, 2, 'MIT', '1995-02-21', '1999-10-12');
+
+
+INSERT INTO `EmployeeLanguages` (`id`, `language_id`, `employee`, `reading`, `speaking`, `writing`, `understanding`) VALUES
+(1, 1, 1, 'Full Professional Proficiency', 'Full Professional Proficiency', 'Full Professional Proficiency', 'Native or Bilingual Proficiency'),
+(2, 1, 2, 'Native or Bilingual Proficiency', 'Native or Bilingual Proficiency', 'Native or Bilingual Proficiency', 'Native or Bilingual Proficiency'),
+(3, 2, 2, 'Limited Working Proficiency', 'Professional Working Proficiency', 'Limited Working Proficiency', 'Professional Working Proficiency');
+
+
+INSERT INTO `EmployeeProjects` (`id`, `employee`, `project`, `date_start`, `date_end`, `status`, `details`) VALUES
+(1, 2, 1, '2010-03-18', '2014-03-06', 'Inactive', ''),
+(3, 2, 2, '2013-02-05', '2013-02-11', 'Current', ''),
+(5, 2, 3, '2013-02-24', '0000-00-00', 'Current', '');
+
+
+
+INSERT INTO `EmployeeSalary` (`id`, `employee`, `component`, `pay_frequency`, `currency`, `amount`, `details`) VALUES
+(1, 1, 'Basic', 'Monthly', 131, '2700.00', ''),
+(2, 2, 'Basic Salary', 'Monthly', 151, '12000.00', ''),
+(3, 2, 'Travelling Allowance', 'Monthly', 131, '5000.00', '');
+
+
+INSERT INTO `EmployeeSkills` (`id`, `skill_id`, `employee`, `details`) VALUES
+(1, 9, 1, 'Creating web sites'),
+(2, 6, 2, 'Certified Business Intelligence Professional');
+
+
+
+INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`, `user_level`, `last_login`, `last_update`, `created`) VALUES
+(2, 'manager', 'icehrm+manager@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 2, 'Manager', '2013-01-03 02:47:37', '2013-01-03 02:47:37', '2013-01-03 02:47:37'),
+(3, 'user1', 'icehrm+user1@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 3, 'Employee', '2013-01-03 02:48:32', '2013-01-03 02:48:32', '2013-01-03 02:48:32'),
+(4, 'user2', 'icehrm+user2@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 4, 'Employee', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55');
+
+
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core-ext/scripts/icehrm_upgrade_opensource_latest_to_12.6.sql b/core-ext/scripts/icehrm_upgrade_opensource_latest_to_12.6.sql
new file mode 100644
index 00000000..0ea2898c
--- /dev/null
+++ b/core-ext/scripts/icehrm_upgrade_opensource_latest_to_12.6.sql
@@ -0,0 +1,248 @@
+/* Upgrade v10.2 to v11.0 */
+
+ALTER TABLE `LeaveTypes` ADD COLUMN `leave_color` varchar(10) NULL;
+
+create table `RestAccessTokens` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `userId` bigint(20) NOT NULL,
+ `hash` varchar(32) default null,
+ `token` varchar(500) default null,
+ `created` DATETIME default '0000-00-00 00:00:00',
+ `updated` DATETIME default '0000-00-00 00:00:00',
+ primary key (`id`),
+ unique key `userId` (`userId`)
+) engine=innodb default charset=utf8;
+
+REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
+('Api: REST Api Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]');
+
+ALTER TABLE Employees ADD COLUMN `status` enum('Active','Terminated') default 'Active';
+
+ALTER TABLE EmployeeLeaves MODIFY COLUMN `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
+
+ALTER TABLE EmployeeLeaveLog MODIFY COLUMN `status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
+ALTER TABLE EmployeeLeaveLog MODIFY COLUMN `status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
+
+create table `ArchivedEmployees` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `ref_id` bigint(20) NOT NULL,
+ `employee_id` varchar(50) default null,
+ `first_name` varchar(100) default '' not null,
+ `last_name` varchar(100) default '' not null,
+ `gender` enum('Male','Female') default NULL,
+ `ssn_num` varchar(100) default '',
+ `nic_num` varchar(100) default '',
+ `other_id` varchar(100) default '',
+ `work_email` varchar(100) default null,
+ `joined_date` DATETIME default '0000-00-00 00:00:00',
+ `confirmation_date` DATETIME default '0000-00-00 00:00:00',
+ `supervisor` bigint(20) default null,
+ `department` bigint(20) default null,
+ `termination_date` DATETIME default '0000-00-00 00:00:00',
+ `notes` text default null,
+ `data` longtext default null,
+ primary key (`id`)
+
+) engine=innodb default charset=utf8;
+
+
+/* Upgrade v11.0 to v11.1 */
+
+create table `FieldNameMappings` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `type` varchar(20) NOT NULL,
+ `name` varchar(20) NOT NULL,
+ `textOrig` varchar(200) default null,
+ `textMapped` varchar(200) default null,
+ `display` enum('Form','Table and Form','Hidden') default 'Form',
+ `created` DATETIME default '0000-00-00 00:00:00',
+ `updated` DATETIME default '0000-00-00 00:00:00',
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+INSERT INTO `FieldNameMappings` (`type`, `name`, `textOrig`, `textMapped`, `display`) VALUES
+ ('Employee', 'employee_id', 'Employee Number', 'Employee Number', 'Table and Form'),
+ ('Employee', 'first_name', 'First Name', 'First Name', 'Table and Form'),
+ ('Employee', 'middle_name', 'Middle Name', 'Middle Name', 'Form'),
+ ('Employee', 'last_name', 'Last Name', 'Last Name', 'Table and Form'),
+ ('Employee', 'nationality', 'Nationality', 'Nationality', 'Form'),
+ ('Employee', 'ethnicity', 'Ethnicity', 'Ethnicity', 'Form'),
+ ('Employee', 'immigration_status', 'Immigration Status', 'Immigration Status', 'Form'),
+ ('Employee', 'birthday', 'Date of Birth', 'Date of Birth', 'Form'),
+ ('Employee', 'gender', 'Gender', 'Gender', 'Form'),
+ ('Employee', 'marital_status', 'Marital Status', 'Marital Status', 'Form'),
+ ('Employee', 'ssn_num', 'SSN/NRIC', 'SSN/NRIC', 'Form'),
+ ('Employee', 'nic_num', 'NIC', 'NIC', 'Form'),
+ ('Employee', 'other_id', 'Other ID', 'Other ID', 'Form'),
+ ('Employee', 'driving_license', 'Driving License No', 'Driving License No', 'Form'),
+ ('Employee', 'employment_status', 'Employment Status', 'Employment Status', 'Form'),
+ ('Employee', 'job_title', 'Job Title', 'Job Title', 'Form'),
+ ('Employee', 'pay_grade', 'Pay Grade', 'Pay Grade', 'Form'),
+ ('Employee', 'work_station_id', 'Work Station Id', 'Work Station Id', 'Form'),
+ ('Employee', 'address1', 'Address Line 1', 'Address Line 1', 'Form'),
+ ('Employee', 'address2', 'Address Line 2', 'Address Line 2', 'Form'),
+ ('Employee', 'city', 'City', 'City', 'Form'),
+ ('Employee', 'country', 'Country', 'Country', 'Form'),
+ ('Employee', 'province', 'Province', 'Province', 'Form'),
+ ('Employee', 'postal_code', 'Postal/Zip Code', 'Postal/Zip Code', 'Form'),
+ ('Employee', 'home_phone', 'Home Phone', 'Home Phone', 'Form'),
+ ('Employee', 'mobile_phone', 'Mobile Phone', 'Mobile Phone', 'Table and Form'),
+ ('Employee', 'work_phone', 'Work Phone', 'Work Phone', 'Form'),
+ ('Employee', 'work_email', 'Work Email', 'Work Email', 'Form'),
+ ('Employee', 'private_email', 'Private Email', 'Private Email', 'Form'),
+ ('Employee', 'joined_date', 'Joined Date', 'Joined Date', 'Form'),
+ ('Employee', 'confirmation_date', 'Confirmation Date', 'Confirmation Date', 'Form'),
+ ('Employee', 'termination_date', 'Termination Date', 'Termination Date', 'Form'),
+ ('Employee', 'supervisor', 'Supervisor', 'Supervisor', 'Table and Form'),
+ ('Employee', 'department', 'Department', 'Department', 'Table and Form'),
+ ('Employee', 'notes', 'Notes', 'Notes', 'Form');
+
+
+ create table `CustomFields` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `type` varchar(20) NOT NULL,
+ `name` varchar(20) NOT NULL,
+ `data` text default null,
+ `display` enum('Form','Table and Form','Hidden') default 'Form',
+ `created` DATETIME default '0000-00-00 00:00:00',
+ `updated` DATETIME default '0000-00-00 00:00:00',
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+INSERT INTO `CustomFields` (`type`, `name`, `data`,`display`) VALUES
+ ('Employee', 'custom1', '', 'Hidden'),
+ ('Employee', 'custom2', '', 'Hidden'),
+ ('Employee', 'custom3', '', 'Hidden'),
+ ('Employee', 'custom4', '', 'Hidden'),
+ ('Employee', 'custom5', '', 'Hidden'),
+ ('Employee', 'custom6', '', 'Hidden'),
+ ('Employee', 'custom7', '', 'Hidden'),
+ ('Employee', 'custom8', '', 'Hidden'),
+ ('Employee', 'custom9', '', 'Hidden'),
+ ('Employee', 'custom10', '', 'Hidden');
+
+
+Alter table `Employees` MODIFY COLUMN `middle_name` varchar(100) default null;
+Alter table `Employees` MODIFY COLUMN `last_name` varchar(100) default null;
+Alter table `Employees` MODIFY COLUMN `ssn_num` varchar(100) default NULL;
+Alter table `Employees` MODIFY COLUMN `nic_num` varchar(100) default NULL;
+Alter table `Employees` MODIFY COLUMN `other_id` varchar(100) default NULL;
+Alter table `Employees` MODIFY COLUMN `driving_license` varchar(100) default NULL;
+Alter table `Employees` MODIFY COLUMN `work_station_id` varchar(100) default NULL;
+Alter table `Employees` MODIFY COLUMN `address1` varchar(100) default NULL;
+Alter table `Employees` MODIFY COLUMN `address2` varchar(100) default NULL;
+Alter table `Employees` MODIFY COLUMN `city` varchar(150) default NULL;
+
+
+Alter table `Employees` ADD COLUMN `ethnicity` bigint(20) default null;
+Alter table `Employees` ADD COLUMN `immigration_status` bigint(20) default null;
+
+
+Alter table `EmployeeSalary` MODIFY COLUMN `component` bigint(20) NOT NULL;
+Alter table `EmployeeSalary` MODIFY COLUMN `currency` bigint(20) NULL;
+
+INSERT INTO `SalaryComponentType` (`id`,`code`, `name`) VALUES
+ (1,'B001', 'Basic'),
+ (2,'B002', 'Allowance');
+
+
+INSERT INTO `SalaryComponent` VALUES
+ (1,'Basic Salary', 1,''),(2,'Fixed Allowance', 1,''),(3,'Car Allowance', 2,''),(4,'Telephone Allowance', 2,'');
+
+
+
+/* Upgrade v11.1 to v12.0 */
+
+ALTER TABLE Users ADD COLUMN user_roles text null;
+ALTER TABLE Users ADD COLUMN `default_module` bigint(20) null after `employee`;
+ALTER TABLE Modules ADD COLUMN user_roles text null AFTER `user_levels`;
+ALTER TABLE Modules ADD COLUMN label varchar(100) NOT NULL AFTER `name`;
+
+create table `UserRoles` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) default null,
+ primary key (`id`),
+ unique key `name` (`name`)
+) engine=innodb default charset=utf8;
+
+ALTER TABLE `Users` CHANGE `user_level` `user_level` enum('Admin','Employee','Manager','Other') default NULL;
+
+create table `EmployeeEducationsTemp` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `education_id` bigint(20) NULL,
+ `employee` bigint(20) NOT NULL,
+ `institute` varchar(400) default null,
+ `date_start` date default '0000-00-00',
+ `date_end` date default '0000-00-00',
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+insert into EmployeeEducationsTemp select * from EmployeeEducations;
+
+drop table EmployeeEducations;
+
+create table `EmployeeEducations` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `education_id` bigint(20) NULL,
+ `employee` bigint(20) NOT NULL,
+ `institute` varchar(400) default null,
+ `date_start` date default '0000-00-00',
+ `date_end` date default '0000-00-00',
+ CONSTRAINT `Fk_EmployeeEducations_Educations` FOREIGN KEY (`education_id`) REFERENCES `Educations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeEducations_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+insert into EmployeeEducations select * from EmployeeEducationsTemp;
+
+drop table EmployeeEducationsTemp;
+
+UPDATE `Settings` set value = '1' where name = 'System: Reset Modules and Permissions';
+UPDATE `Settings` set value = '1' where name = 'System: Add New Permissions';
+
+create table `SalaryComponentType` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `code` varchar(10) NOT NULL,
+ `name` varchar(100) NOT NULL,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `SalaryComponent` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `componentType` bigint(20) NULL,
+ `details` text default null,
+ CONSTRAINT `Fk_SalaryComponent_SalaryComponentType` FOREIGN KEY (`componentType`) REFERENCES `SalaryComponentType` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `ImmigrationStatus` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Ethnicity` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeImmigrationStatus` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `status` bigint(20) NOT NULL,
+ CONSTRAINT `Fk_EmployeeImmigrationStatus_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeImmigrationStatus_Type` FOREIGN KEY (`status`) REFERENCES `ImmigrationStatus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeEthnicity` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `ethnicity` bigint(20) NOT NULL,
+ CONSTRAINT `Fk_EmployeeEthnicity_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeEthnicity_Ethnicity` FOREIGN KEY (`ethnicity`) REFERENCES `Ethnicity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
\ No newline at end of file
diff --git a/core-ext/scripts/icehrmdb.sql b/core-ext/scripts/icehrmdb.sql
new file mode 100644
index 00000000..56c46e77
--- /dev/null
+++ b/core-ext/scripts/icehrmdb.sql
@@ -0,0 +1,775 @@
+create table `CompanyStructures` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `title` tinytext not null,
+ `description` text not null,
+ `address` text default NULL,
+ `type` enum('Company','Head Office','Regional Office','Department','Unit','Sub Unit','Other') default NULL,
+ `country` varchar(2) not null default '0',
+ `parent` bigint(20) NULL,
+ CONSTRAINT `Fk_CompanyStructures_Own` FOREIGN KEY (`parent`) REFERENCES `CompanyStructures` (`id`),
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Country` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `code` char(2) not null default '',
+ `namecap` varchar(80) null default '',
+ `name` varchar(80) not null default '',
+ `iso3` char(3) default null,
+ `numcode` smallint(6) default null,
+ UNIQUE KEY `code` (`code`),
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Province` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(40) not null default '',
+ `code` char(2) not null default '',
+ `country` char(2) not null default 'US',
+ CONSTRAINT `Fk_Province_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`code`),
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `CurrencyTypes` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `code` varchar(3) not null default '',
+ `name` varchar(70) not null default '',
+ primary key (`id`),
+ UNIQUE KEY `CurrencyTypes_code` (`code`)
+) engine=innodb default charset=utf8;
+
+create table `PayGrades` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) default null,
+ `currency` varchar(3) not null,
+ `min_salary` decimal(12,2) DEFAULT 0.00,
+ `max_salary` decimal(12,2) DEFAULT 0.00,
+ CONSTRAINT `Fk_PayGrades_CurrencyTypes` FOREIGN KEY (`currency`) REFERENCES `CurrencyTypes` (`code`),
+ primary key(`id`)
+) engine=innodb default charset=utf8;
+
+create table `JobTitles` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `code` varchar(10) not null default '',
+ `name` varchar(100) default null,
+ `description` varchar(200) default null,
+ `specification` varchar(400) default null,
+ primary key(`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmploymentStatus` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) default null,
+ `description` varchar(400) default null,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Skills` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) default null,
+ `description` varchar(400) default null,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Educations` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) default null,
+ `description` varchar(400) default null,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Certifications` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) default null,
+ `description` varchar(400) default null,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Languages` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) default null,
+ `description` varchar(400) default null,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Nationality` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) default null,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Employees` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee_id` varchar(50) default null,
+ `first_name` varchar(100) default '' not null,
+ `middle_name` varchar(100) default null,
+ `last_name` varchar(100) default null,
+ `nationality` bigint(20) default null,
+ `birthday` DATETIME default '0000-00-00 00:00:00',
+ `gender` enum('Male','Female') default NULL,
+ `marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL,
+ `ssn_num` varchar(100) default NULL,
+ `nic_num` varchar(100) default NULL,
+ `other_id` varchar(100) default NULL,
+ `driving_license` varchar(100) default NULL,
+ `driving_license_exp_date` date default '0000-00-00',
+ `employment_status` bigint(20) default null,
+ `job_title` bigint(20) default null,
+ `pay_grade` bigint(20) null,
+ `work_station_id` varchar(100) default NULL,
+ `address1` varchar(100) default NULL,
+ `address2` varchar(100) default NULL,
+ `city` varchar(150) default NULL,
+ `country` char(2) default null,
+ `province` bigint(20) default null,
+ `postal_code` varchar(20) default null,
+ `home_phone` varchar(50) default null,
+ `mobile_phone` varchar(50) default null,
+ `work_phone` varchar(50) default null,
+ `work_email` varchar(100) default null,
+ `private_email` varchar(100) default null,
+ `joined_date` DATETIME default '0000-00-00 00:00:00',
+ `confirmation_date` DATETIME default '0000-00-00 00:00:00',
+ `supervisor` bigint(20) default null,
+ `department` bigint(20) default null,
+ `custom1` varchar(250) default null,
+ `custom2` varchar(250) default null,
+ `custom3` varchar(250) default null,
+ `custom4` varchar(250) default null,
+ `custom5` varchar(250) default null,
+ `custom6` varchar(250) default null,
+ `custom7` varchar(250) default null,
+ `custom8` varchar(250) default null,
+ `custom9` varchar(250) default null,
+ `custom10` varchar(250) default null,
+ `termination_date` DATETIME default '0000-00-00 00:00:00',
+ `notes` text default null,
+ `status` enum('Active','Terminated') default 'Active',
+ `ethnicity` bigint(20) default null,
+ `immigration_status` bigint(20) default null,
+ CONSTRAINT `Fk_Employee_Nationality` FOREIGN KEY (`nationality`) REFERENCES `Nationality` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_Employee_JobTitle` FOREIGN KEY (`job_title`) REFERENCES `JobTitles` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_Employee_EmploymentStatus` FOREIGN KEY (`employment_status`) REFERENCES `EmploymentStatus` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_Employee_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`code`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_Employee_Province` FOREIGN KEY (`province`) REFERENCES `Province` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_Employee_Supervisor` FOREIGN KEY (`supervisor`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_Employee_CompanyStructures` FOREIGN KEY (`department`) REFERENCES `CompanyStructures` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_Employee_PayGrades` FOREIGN KEY (`pay_grade`) REFERENCES `PayGrades` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ primary key (`id`),
+ unique key `employee_id` (`employee_id`)
+
+) engine=innodb default charset=utf8;
+
+create table `ArchivedEmployees` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `ref_id` bigint(20) NOT NULL,
+ `employee_id` varchar(50) default null,
+ `first_name` varchar(100) default '' not null,
+ `last_name` varchar(100) default '' not null,
+ `gender` enum('Male','Female') default NULL,
+ `ssn_num` varchar(100) default '',
+ `nic_num` varchar(100) default '',
+ `other_id` varchar(100) default '',
+ `work_email` varchar(100) default null,
+ `joined_date` DATETIME default '0000-00-00 00:00:00',
+ `confirmation_date` DATETIME default '0000-00-00 00:00:00',
+ `supervisor` bigint(20) default null,
+ `department` bigint(20) default null,
+ `termination_date` DATETIME default '0000-00-00 00:00:00',
+ `notes` text default null,
+ `data` longtext default null,
+ primary key (`id`)
+
+) engine=innodb default charset=utf8;
+
+create table `UserRoles` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) default null,
+ primary key (`id`),
+ unique key `name` (`name`)
+) engine=innodb default charset=utf8;
+
+create table `Users` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `username` varchar(100) default null,
+ `email` varchar(100) default null,
+ `password` varchar(100) default null,
+ `employee` bigint(20) null,
+ `default_module` bigint(20) null,
+ `user_level` enum('Admin','Employee','Manager','Other') default NULL,
+ `user_roles` text null,
+ `last_login` timestamp default '0000-00-00 00:00:00',
+ `last_update` timestamp default '0000-00-00 00:00:00',
+ `created` timestamp default '0000-00-00 00:00:00',
+ CONSTRAINT `Fk_User_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ primary key (`id`),
+ unique key `username` (`username`)
+) engine=innodb default charset=utf8;
+
+
+create table `EmployeeSkills` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `skill_id` bigint(20) NULL,
+ `employee` bigint(20) NOT NULL,
+ `details` varchar(400) default null,
+ CONSTRAINT `Fk_EmployeeSkills_Skills` FOREIGN KEY (`skill_id`) REFERENCES `Skills` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeSkills_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`),
+ unique key (`employee`,`skill_id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeEducations` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `education_id` bigint(20) NULL,
+ `employee` bigint(20) NOT NULL,
+ `institute` varchar(400) default null,
+ `date_start` date default '0000-00-00',
+ `date_end` date default '0000-00-00',
+ CONSTRAINT `Fk_EmployeeEducations_Educations` FOREIGN KEY (`education_id`) REFERENCES `Educations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeEducations_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeCertifications` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `certification_id` bigint(20) NULL,
+ `employee` bigint(20) NOT NULL,
+ `institute` varchar(400) default null,
+ `date_start` date default '0000-00-00',
+ `date_end` date default '0000-00-00',
+ CONSTRAINT `Fk_EmployeeCertifications_Certifications` FOREIGN KEY (`certification_id`) REFERENCES `Certifications` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeCertifications_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`),
+ unique key (`employee`,`certification_id`)
+) engine=innodb default charset=utf8;
+
+
+create table `EmployeeLanguages` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `language_id` bigint(20) NULL,
+ `employee` bigint(20) NOT NULL,
+ `reading` enum('Elementary Proficiency','Limited Working Proficiency','Professional Working Proficiency','Full Professional Proficiency','Native or Bilingual Proficiency') default NULL,
+ `speaking` enum('Elementary Proficiency','Limited Working Proficiency','Professional Working Proficiency','Full Professional Proficiency','Native or Bilingual Proficiency') default NULL,
+ `writing` enum('Elementary Proficiency','Limited Working Proficiency','Professional Working Proficiency','Full Professional Proficiency','Native or Bilingual Proficiency') default NULL,
+ `understanding` enum('Elementary Proficiency','Limited Working Proficiency','Professional Working Proficiency','Full Professional Proficiency','Native or Bilingual Proficiency') default NULL,
+ CONSTRAINT `Fk_EmployeeLanguages_Languages` FOREIGN KEY (`language_id`) REFERENCES `Languages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeLanguages_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`),
+ unique key (`employee`,`language_id`)
+) engine=innodb default charset=utf8;
+
+create table `EmergencyContacts` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `name` varchar(100) NOT NULL,
+ `relationship` varchar(100) default null,
+ `home_phone` varchar(15) default null,
+ `work_phone` varchar(15) default null,
+ `mobile_phone` varchar(15) default null,
+ CONSTRAINT `Fk_EmergencyContacts_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeDependents` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `name` varchar(100) NOT NULL,
+ `relationship` enum('Child','Spouse','Parent','Other') default NULL,
+ `dob` date default '0000-00-00',
+ `id_number` varchar(25) default null,
+ CONSTRAINT `Fk_EmployeeDependents_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+
+create table `Files` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `filename` varchar(100) NOT NULL,
+ `employee` bigint(20) NULL,
+ `file_group` varchar(100) NOT NULL,
+ primary key (`id`),
+ unique key `filename` (`filename`)
+) engine=innodb default charset=utf8;
+
+create table `Clients` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `details` text default null,
+ `first_contact_date` date default '0000-00-00',
+ `created` timestamp default '0000-00-00 00:00:00',
+ `address` text default null,
+ `contact_number` varchar(25) NULL,
+ `contact_email` varchar(25) NULL,
+ `company_url` varchar(500) NULL,
+ `status` enum('Active','Inactive') default 'Active',
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Projects` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `client` bigint(20) NULL,
+ `details` text default null,
+ `created` timestamp default '0000-00-00 00:00:00',
+ `status` enum('Active','Inactive') default 'Active',
+ CONSTRAINT `Fk_Projects_Client` FOREIGN KEY (`client`) REFERENCES `Clients` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeTimeSheets` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `date_start` date NOT NULL,
+ `date_end` date NOT NULL,
+ `status` enum('Approved','Pending','Rejected','Submitted') default 'Pending',
+ CONSTRAINT `Fk_EmployeeTimeSheets_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ UNIQUE KEY `EmployeeTimeSheetsKey` (`employee`,`date_start`,`date_end`),
+ KEY `EmployeeTimeSheets_date_end` (`date_end`),
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeProjects` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `project` bigint(20) NULL,
+ `date_start` date NULL,
+ `date_end` date NULL,
+ `status` enum('Current','Inactive','Completed') default 'Current',
+ `details` text default null,
+ CONSTRAINT `Fk_EmployeeProjects_Projects` FOREIGN KEY (`project`) REFERENCES `Projects` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeProjects_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ UNIQUE KEY `EmployeeProjectsKey` (`employee`,`project`),
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeTimeEntry` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `project` bigint(20) NULL,
+ `employee` bigint(20) NOT NULL,
+ `timesheet` bigint(20) NOT NULL,
+ `details` text default null,
+ `created` timestamp default '0000-00-00 00:00:00',
+ `date_start` timestamp default '0000-00-00 00:00:00',
+ `time_start` varchar(10) NOT NULL,
+ `date_end` timestamp default '0000-00-00 00:00:00',
+ `time_end` varchar(10) NOT NULL,
+ `status` enum('Active','Inactive') default 'Active',
+ CONSTRAINT `Fk_EmployeeTimeEntry_Projects` FOREIGN KEY (`project`) REFERENCES `Projects` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeTimeEntry_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeTimeEntry_EmployeeTimeSheets` FOREIGN KEY (`timesheet`) REFERENCES `EmployeeTimeSheets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ KEY `employee_project` (`employee`,`project`),
+ KEY `employee_project_date_start` (`employee`,`project`,`date_start`),
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Documents` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `details` text default null,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeDocuments` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `document` bigint(20) NULL,
+ `date_added` date NOT NULL,
+ `valid_until` date NOT NULL,
+ `status` enum('Active','Inactive','Draft') default 'Active',
+ `details` text default null,
+ `attachment` varchar(100) NULL,
+ CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY (`document`) REFERENCES `Documents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeDocuments_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `CompanyLoans` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `details` text default null,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeCompanyLoans` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `loan` bigint(20) NULL,
+ `start_date` date NOT NULL,
+ `last_installment_date` date NOT NULL,
+ `period_months` bigint(20) NULL,
+ `currency` bigint(20) NULL DEFAULT NULL,
+ `amount` decimal(10,2) NOT NULL,
+ `monthly_installment` decimal(10,2) NOT NULL,
+ `status` enum('Approved','Repayment','Paid','Suspended') default 'Approved',
+ `details` text default null,
+ CONSTRAINT `Fk_EmployeeCompanyLoans_CompanyLoans` FOREIGN KEY (`loan`) REFERENCES `CompanyLoans` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeCompanyLoans_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Settings` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `value` text default null,
+ `description` text default null,
+ `meta` text default null,
+ primary key (`id`),
+ UNIQUE KEY(`name`)
+) engine=innodb default charset=utf8;
+
+
+create table `Modules` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `menu` varchar(30) NOT NULL,
+ `name` varchar(100) NOT NULL,
+ `label` varchar(100) NOT NULL,
+ `icon` VARCHAR( 50 ) NULL,
+ `mod_group` varchar(30) NOT NULL,
+ `mod_order` INT(11) NULL,
+ `status` enum('Enabled','Disabled') default 'Enabled',
+ `version` varchar(10) default '',
+ `update_path` varchar(500) default '',
+ `user_levels` varchar(500) NOT NULL,
+ `user_roles` text null,
+ primary key (`id`),
+ UNIQUE KEY `Modules_name_modgroup` (`name`,`mod_group`)
+) engine=innodb default charset=utf8;
+
+create table `Reports` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `details` text default null,
+ `parameters` text default null,
+ `query` text default null,
+ `paramOrder` varchar(500) NOT NULL,
+ `type` enum('Query','Class') default 'Query',
+ primary key (`id`),
+ UNIQUE KEY `Reports_Name` (`name`)
+) engine=innodb default charset=utf8;
+
+
+create table `Attendance` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `in_time` timestamp default '0000-00-00 00:00:00',
+ `out_time` timestamp default '0000-00-00 00:00:00',
+ `note` varchar(500) default null,
+ CONSTRAINT `Fk_Attendance_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ KEY `in_time` (`in_time`),
+ KEY `out_time` (`out_time`),
+ KEY `employee_in_time` (`employee`,`in_time`),
+ KEY `employee_out_time` (`employee`,`out_time`),
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+create table `Permissions` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `user_level` enum('Admin','Employee','Manager') default NULL,
+ `module_id` bigint(20) NOT NULL,
+ `permission` varchar(200) default null,
+ `meta` varchar(500) default null,
+ `value` varchar(200) default null,
+ UNIQUE KEY `Module_Permission` (`user_level`,`module_id`,`permission`),
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `DataEntryBackups` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `tableType` varchar(200) default null,
+ `data` longtext default null,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `AuditLog` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `time` datetime default '0000-00-00 00:00:00',
+ `user` bigint(20) NOT NULL,
+ `ip` varchar(100) NULL,
+ `type` varchar(100) NOT NULL,
+ `employee` varchar(300) NULL,
+ `details` text default null,
+ CONSTRAINT `Fk_AuditLog_Users` FOREIGN KEY (`user`) REFERENCES `Users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+create table `Notifications` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `time` datetime default '0000-00-00 00:00:00',
+ `fromUser` bigint(20) NULL,
+ `fromEmployee` bigint(20) NULL,
+ `toUser` bigint(20) NOT NULL,
+ `image` varchar(500) default null,
+ `message` text default null,
+ `action` text default null,
+ `type` varchar(100) NULL,
+ `status` enum('Unread','Read') default 'Unread',
+ CONSTRAINT `Fk_Notifications_Users` FOREIGN KEY (`touser`) REFERENCES `Users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`),
+ KEY `toUser_time` (`toUser`,`time`),
+ KEY `toUser_status_time` (`toUser`,`status`,`time`)
+) engine=innodb default charset=utf8;
+
+create table `Courses` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `code` varchar(300) NOT NULL,
+ `name` varchar(300) NOT NULL,
+ `description` text default null,
+ `coordinator` bigint(20) NULL,
+ `trainer` varchar(300) NULL,
+ `trainer_info` text default null,
+ `paymentType` enum('Company Sponsored','Paid by Employee') default 'Company Sponsored',
+ `currency` varchar(3) not null,
+ `cost` decimal(12,2) DEFAULT 0.00,
+ `status` enum('Active','Inactive') default 'Active',
+ `created` datetime default '0000-00-00 00:00:00',
+ `updated` datetime default '0000-00-00 00:00:00',
+ CONSTRAINT `Fk_Courses_Employees` FOREIGN KEY (`coordinator`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `TrainingSessions` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(300) NOT NULL,
+ `course` bigint(20) NOT NULL,
+ `description` text default null,
+ `scheduled` datetime default '0000-00-00 00:00:00',
+ `dueDate` datetime default '0000-00-00 00:00:00',
+ `deliveryMethod` enum('Classroom','Self Study','Online') default 'Classroom',
+ `deliveryLocation` varchar(500) NULL,
+ `status` enum('Pending','Approved','Completed','Cancelled') default 'Pending',
+ `attendanceType` enum('Sign Up','Assign') default 'Sign Up',
+ `attachment` varchar(300) NULL,
+ `created` datetime default '0000-00-00 00:00:00',
+ `updated` datetime default '0000-00-00 00:00:00',
+ CONSTRAINT `Fk_TrainingSessions_Courses` FOREIGN KEY (`course`) REFERENCES `Courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+create table `EmployeeTrainingSessions` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `trainingSession` bigint(20) NULL,
+ `feedBack` varchar(1500) NULL,
+ `status` enum('Scheduled','Attended','Not-Attended') default 'Scheduled',
+ CONSTRAINT `Fk_EmployeeTrainingSessions_TrainingSessions` FOREIGN KEY (`trainingSession`) REFERENCES `TrainingSessions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeTrainingSessions_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+create table `ImmigrationDocuments` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `details` text default null,
+ `required` enum('Yes','No') default 'Yes',
+ `alert_on_missing` enum('Yes','No') default 'Yes',
+ `alert_before_expiry` enum('Yes','No') default 'Yes',
+ `alert_before_day_number` int(11) NOT NULL,
+ `created` timestamp NULL default '0000-00-00 00:00:00',
+ `updated` timestamp NULL default '0000-00-00 00:00:00',
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeImmigrations` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `document` bigint(20) NULL,
+ `documentname` varchar(150) NOT NULL,
+ `valid_until` date NOT NULL,
+ `status` enum('Active','Inactive','Draft') default 'Active',
+ `details` text default null,
+ `attachment1` varchar(100) NULL,
+ `attachment2` varchar(100) NULL,
+ `attachment3` varchar(100) NULL,
+ `created` timestamp NULL default '0000-00-00 00:00:00',
+ `updated` timestamp NULL default '0000-00-00 00:00:00',
+ CONSTRAINT `Fk_EmployeeImmigrations_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeImmigrations_ImmigrationDocuments` FOREIGN KEY (`document`) REFERENCES `ImmigrationDocuments` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+create table `EmployeeTravelRecords` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `type` enum('Local','International') default 'Local',
+ `purpose` varchar(200) NOT NULL,
+ `travel_from` varchar(200) NOT NULL,
+ `travel_to` varchar(200) NOT NULL,
+ `travel_date` datetime NULL default '0000-00-00 00:00:00',
+ `return_date` datetime NULL default '0000-00-00 00:00:00',
+ `details` varchar(500) default null,
+ `attachment1` varchar(100) NULL,
+ `attachment2` varchar(100) NULL,
+ `attachment3` varchar(100) NULL,
+ `created` timestamp NULL default '0000-00-00 00:00:00',
+ `updated` timestamp NULL default '0000-00-00 00:00:00',
+ CONSTRAINT `Fk_EmployeeTravelRecords_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+create table `RestAccessTokens` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `userId` bigint(20) NOT NULL,
+ `hash` varchar(32) default null,
+ `token` varchar(500) default null,
+ `created` DATETIME default '0000-00-00 00:00:00',
+ `updated` DATETIME default '0000-00-00 00:00:00',
+ primary key (`id`),
+ unique key `userId` (`userId`)
+) engine=innodb default charset=utf8;
+
+create table `FieldNameMappings` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `type` varchar(20) NOT NULL,
+ `name` varchar(20) NOT NULL,
+ `textOrig` varchar(200) default null,
+ `textMapped` varchar(200) default null,
+ `display` enum('Form','Table and Form','Hidden') default 'Form',
+ `created` DATETIME default '0000-00-00 00:00:00',
+ `updated` DATETIME default '0000-00-00 00:00:00',
+ primary key (`id`),
+ unique key `name` (`name`)
+) engine=innodb default charset=utf8;
+
+create table `CustomFields` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `type` varchar(20) NOT NULL,
+ `name` varchar(20) NOT NULL,
+ `data` text default null,
+ `display` enum('Form','Table and Form','Hidden') default 'Form',
+ `created` DATETIME default '0000-00-00 00:00:00',
+ `updated` DATETIME default '0000-00-00 00:00:00',
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+create table `SalaryComponentType` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `code` varchar(10) NOT NULL,
+ `name` varchar(100) NOT NULL,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `SalaryComponent` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `componentType` bigint(20) NULL,
+ `details` text default null,
+ CONSTRAINT `Fk_SalaryComponent_SalaryComponentType` FOREIGN KEY (`componentType`) REFERENCES `SalaryComponentType` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `ImmigrationStatus` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Ethnicity` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeImmigrationStatus` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `status` bigint(20) NOT NULL,
+ CONSTRAINT `Fk_EmployeeImmigrationStatus_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeImmigrationStatus_Type` FOREIGN KEY (`status`) REFERENCES `ImmigrationStatus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `EmployeeEthnicity` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `ethnicity` bigint(20) NOT NULL,
+ CONSTRAINT `Fk_EmployeeEthnicity_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeEthnicity_Ethnicity` FOREIGN KEY (`ethnicity`) REFERENCES `Ethnicity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+create table `EmployeeSalary` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `employee` bigint(20) NOT NULL,
+ `component` bigint(20) NOT NULL,
+ `pay_frequency` enum('Hourly','Daily','Bi Weekly','Weekly','Semi Monthly','Monthly') default NULL,
+ `currency` bigint(20) NULL,
+ `amount` decimal(10,2) NOT NULL,
+ `details` text default null,
+ CONSTRAINT `Fk_EmployeeSalary_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_EmployeeSalary_Currency` FOREIGN KEY (`currency`) REFERENCES `CurrencyTypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Deductions` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `contributor` enum('Employee','Employer') default NULL,
+ `type` enum('Fixed','Percentage') default NULL,
+ `percentage_type` enum('On Component','On Component Type') default NULL,
+ `componentType` bigint(20) NULL,
+ `component` bigint(20) NULL,
+ `rangeAmounts` text default null,
+ `country` bigint(20) NULL,
+ CONSTRAINT `Fk_Deductions_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `Tax` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `name` varchar(100) NOT NULL,
+ `contributor` enum('Employee','Employer') default NULL,
+ `type` enum('Fixed','Percentage') default NULL,
+ `percentage_type` enum('On Component','On Component Type') default NULL,
+ `componentType` bigint(20) NULL,
+ `component` bigint(20) NULL,
+ `rangeAmounts` text default null,
+ `country` bigint(20) NULL,
+ CONSTRAINT `Fk_Tax_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `TaxRules` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `apply` enum('Yes','No') default 'Yes',
+ `application_type` enum('All','Condition - OR','Condition - AND') default 'All',
+ `tax` bigint(20) NOT NULL,
+ `job_title` bigint(20) NULL,
+ `ethnicity` bigint(20) NULL,
+ `nationality` bigint(20) NULL,
+ `immigration_status` bigint(20) NULL,
+ `pay_grade` bigint(20) NULL,
+ `country` bigint(20) NULL,
+ CONSTRAINT `Fk_TaxRules_Tax` FOREIGN KEY (`tax`) REFERENCES `Tax` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_TaxRules_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+create table `DeductionRules` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `apply` enum('Yes','No') default 'Yes',
+ `application_type` enum('All','Condition - OR','Condition - AND') default 'All',
+ `deduction` bigint(20) NOT NULL,
+ `job_title` bigint(20) NULL,
+ `ethnicity` bigint(20) NULL,
+ `nationality` bigint(20) NULL,
+ `immigration_status` bigint(20) NULL,
+ `pay_grade` bigint(20) NULL,
+ `country` bigint(20) NULL,
+ CONSTRAINT `Fk_DeductionRules_Deductions` FOREIGN KEY (`deduction`) REFERENCES `Deductions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `Fk_DeductionRules_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ primary key (`id`)
+) engine=innodb default charset=utf8;
+
+
+
+
diff --git a/core-ext/scripts/reports/active_employees.txt b/core-ext/scripts/reports/active_employees.txt
new file mode 100644
index 00000000..e69de29b
diff --git a/core-ext/scripts/reports/employee_details.txt b/core-ext/scripts/reports/employee_details.txt
new file mode 100644
index 00000000..25b16ec9
--- /dev/null
+++ b/core-ext/scripts/reports/employee_details.txt
@@ -0,0 +1,35 @@
+
+
+Select id, employee_id as 'Employee ID',
+concat(`first_name`,' ',`middle_name`,' ', `last_name`) as 'Name',
+(SELECT name from Nationality where id = nationality) as 'Nationality',
+birthday as 'Birthday',
+gender as 'Gender',
+marital_status as 'Marital Status',
+ssn_num as 'SSN Number',
+nic_num as 'NIC Number',
+other_id as 'Other IDs',
+driving_license as 'Driving License Number',
+(SELECT name from EmploymentStatus where id = employment_status) as 'Employment Status',
+(SELECT name from JobTitles where id = job_title) as 'Job Title',
+(SELECT name from PayGrades where id = pay_grade) as 'Pay Grade',
+work_station_id as 'Work Station ID',
+address1 as 'Address 1',
+address2 as 'Address 2',
+city as 'City',
+(SELECT name from Country where code = country) as 'Country',
+(SELECT name from Province where id = province) as 'Province',
+postal_code as 'Postal Code',
+home_phone as 'Home Phone',
+mobile_phone as 'Mobile Phone',
+work_phone as 'Work Phone',
+work_email as 'Work Email',
+private_email as 'Private Email',
+joined_date as 'Joined Date',
+confirmation_date as 'Confirmation Date',
+(SELECT title from CompanyStructures where id = department) as 'Department',
+(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`,' [Employee ID:',`employee_id`,']') from Employees e1 where e1.id = e.supervisor) as 'Supervisor'
+FROM Employees e _where_
+
+
+This report list all employee details and you can filter employees by department, employment status or job title
\ No newline at end of file
diff --git a/core-ext/scripts/reports/employee_leaves.txt b/core-ext/scripts/reports/employee_leaves.txt
new file mode 100644
index 00000000..bc1df011
--- /dev/null
+++ b/core-ext/scripts/reports/employee_leaves.txt
@@ -0,0 +1,24 @@
+[
+[ "employee", {"label":"Employee","type":"select","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
+[ "date_start", {"label":"Start Date","type":"date"}],
+[ "date_end", {"label":"End Date","type":"date"}],
+[ "status", {"label":"Leave Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]
+]
+
+["employee","date_start","date_end","status"]
+
+
+SELECT *,
+(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee) as 'Employee',
+(SELECT name from LeaveTypes where id = leave_type) as 'Leave Type',
+(SELECT name from LeavePeriods where id = leave_type) as 'Leave Type',
+date_start as 'Start Date',
+date_end as 'End Date',
+details as 'Reason',
+status as 'Leave Status',
+(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Full Day') as 'Full Day Count',
+(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Half Day - Morning') as 'Half Day (Morning) Count',
+(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Half Day - Afternoon') as 'Half Day (Afternoon) Count'
+from EmployeeLeaves lv where employee = ? and date_start >= ? and date_end <= ? and status = ?;
+
+This report list all employee leaves by employee, date range and leave status
\ No newline at end of file
diff --git a/core-ext/scripts/reports/employee_timesheet.txt b/core-ext/scripts/reports/employee_timesheet.txt
new file mode 100644
index 00000000..e2e34562
--- /dev/null
+++ b/core-ext/scripts/reports/employee_timesheet.txt
@@ -0,0 +1,20 @@
+[
+[ "employee", {"label":"Employee","type":"select","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
+[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],
+[ "date_start", {"label":"Start Date","type":"date"}],
+[ "date_end", {"label":"End Date","type":"date"}]
+]
+
+["date_start","date_end","project","employee"]
+
+SELECT
+(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = te.employee) as 'Employee',
+(SELECT name from Projects where id = te.project) as 'Project',
+details as 'Details',
+date_start as 'Start Time',
+date_end as 'End Time',
+SEC_TO_TIME(TIMESTAMPDIFF(SECOND,te.date_start,te.date_end)) as 'Duration'
+FROM EmployeeTimeEntry te
+WHERE date_start >= ? and date_end <= ? and project = ? and employee = ?
+
+This report list all employee time entries by employee, date range and project
\ No newline at end of file
diff --git a/core-ext/scripts/test/add_attendance.sql b/core-ext/scripts/test/add_attendance.sql
new file mode 100644
index 00000000..fd79d7f9
--- /dev/null
+++ b/core-ext/scripts/test/add_attendance.sql
@@ -0,0 +1,169 @@
+SET @employee = 1;
+SET @startInTime = '2014-08-01 08:15:15';
+SET @startOutTime = '2014-08-01 12:15:15';
+
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+SET @startInTime = DATE_ADD(@startInTime, INTERVAL 1 DAY);
+SET @startOutTime = DATE_ADD(@startOutTime, INTERVAL 1 DAY);
+INSERT INTO `Attendance` (`employee`, `in_time`, `out_time`, `note`) VALUES
+(@employee, FROM_UNIXTIME(UNIX_TIMESTAMP(@startInTime) + FLOOR(0 + (RAND() * 60*60*4))), FROM_UNIXTIME(UNIX_TIMESTAMP(@startOutTime) + FLOOR(0 + (RAND() * 60*60*4))), 'Test Entry');
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core-ext/scripts/test/add_test_employees.sql b/core-ext/scripts/test/add_test_employees.sql
new file mode 100644
index 00000000..d45aedce
--- /dev/null
+++ b/core-ext/scripts/test/add_test_employees.sql
@@ -0,0 +1,267 @@
+INSERT INTO `Employees` (`employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) VALUES
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
+(FLOOR(RAND() * 50000), concat('Employee ',FLOOR(RAND() * 50000)), '', concat('E',FLOOR(RAND() * 50000)), 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+1@web-stalk.com', 'icehrm+1@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
\ No newline at end of file
diff --git a/ext/admin/attendance/api/AttendanceActionManager.php b/ext/admin/attendance/api/AttendanceActionManager.php
new file mode 100644
index 00000000..8c30f95c
--- /dev/null
+++ b/ext/admin/attendance/api/AttendanceActionManager.php
@@ -0,0 +1,105 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+*/
+
+class AttendanceActionManager extends SubActionManager{
+
+ public function savePunch($req){
+
+
+ $employee = $this->baseService->getElement('Employee',$req->employee,null,true);
+ $inDateTime = $req->in_time;
+ $inDateArr = explode(" ",$inDateTime);
+ $inDate = $inDateArr[0];
+ $outDateTime = $req->out_time;
+ $outDate = "";
+ if(!empty($outDateTime)){
+ $outDateArr = explode(" ",$outDateTime);
+ $outDate = $outDateArr[0];
+ }
+
+ $note = $req->note;
+
+ //check if dates are differnet
+ if(!empty($outDate) && $inDate != $outDate){
+ return new IceResponse(IceResponse::ERROR,"Attendance entry should be within a single day");
+ }
+
+ //compare dates
+ if(!empty($outDateTime) && strtotime($outDateTime) <= strtotime($inDateTime)){
+ return new IceResponse(IceResponse::ERROR,"Punch-in time should be lesser than Punch-out time");
+ }
+
+
+ //Find all punches for the day
+ $attendance = new Attendance();
+ $attendanceList = $attendance->Find("employee = ? and DATE_FORMAT( in_time, '%Y-%m-%d' ) = ?",array($employee->id,$inDate));
+
+ foreach($attendanceList as $attendance){
+ if(!empty($req->id) && $req->id == $attendance->id){
+ continue;
+ }
+ if(empty($attendance->out_time) || $attendance->out_time == "0000-00-00 00:00:00"){
+ return new IceResponse(IceResponse::ERROR,"There is a non closed attendance entry for today. Please mark punch-out time of the open entry before adding a new one");
+ }else if(!empty($outDateTime)){
+ if(strtotime($attendance->out_time) >= strtotime($outDateTime) && strtotime($attendance->in_time) <= strtotime($outDateTime)){
+ //-1---0---1---0 || ---0--1---1---0
+ return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one");
+ }else if(strtotime($attendance->out_time) >= strtotime($inDateTime) && strtotime($attendance->in_time) <= strtotime($inDateTime)){
+ //---0---1---0---1 || ---0--1---1---0
+ return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one");
+ }else if(strtotime($attendance->out_time) <= strtotime($outDateTime) && strtotime($attendance->in_time) >= strtotime($inDateTime)){
+ //--1--0---0--1--
+ return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one");
+ }
+ }else{
+ if(strtotime($attendance->out_time) >= strtotime($inDateTime) && strtotime($attendance->in_time) <= strtotime($inDateTime)){
+ //---0---1---0
+ return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one");
+ }
+ }
+ }
+
+ $attendance = new Attendance();
+ if(!empty($req->id)){
+ $attendance->Load("id = ?",array($req->id));
+ }
+ $attendance->in_time = $inDateTime;
+ if(empty($outDateTime)){
+ $attendance->out_time = "0000-00-00 00:00:00";
+ }else{
+ $attendance->out_time = $outDateTime;
+ }
+
+ $attendance->employee = $req->employee;
+ $attendance->note = $note;
+ $ok = $attendance->Save();
+ if(!$ok){
+ LogManager::getInstance()->info($attendance->ErrorMsg());
+ return new IceResponse(IceResponse::ERROR,"Error occured while saving attendance");
+ }
+ return new IceResponse(IceResponse::SUCCESS,$attendance);
+
+ }
+
+
+}
\ No newline at end of file
diff --git a/ext/admin/attendance/api/AttendanceAdminManager.php b/ext/admin/attendance/api/AttendanceAdminManager.php
new file mode 100644
index 00000000..2ff20ff2
--- /dev/null
+++ b/ext/admin/attendance/api/AttendanceAdminManager.php
@@ -0,0 +1,176 @@
+addModelClass('Attendance');
+ }
+
+ }
+}
+
+
+//Model Classes
+
+if (!class_exists('Attendance')) {
+ class Attendance extends ICEHRM_Record {
+ var $_table = 'Attendance';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+}
+
+
+
+if (!class_exists('AttendanceStatus')) {
+ class AttendanceStatus extends ICEHRM_Record {
+ var $_table = 'Attendance';
+
+
+ public function getRecentAttendanceEntries($limit){
+ $shift = intval(SettingsManager::getInstance()->getSetting("Attendance: Shift (Minutes)"));
+ $attendance = new Attendance();
+ $attendanceToday = $attendance->Find("1 = 1 order by in_time desc limit ".$limit,array());
+ $attendanceData = array();
+ $employees = array();
+ foreach($attendanceToday as $atEntry){
+ $entry = new stdClass();
+ $entry->id = $atEntry->employee;
+ $dayArr = explode(" ",$atEntry->in_time);
+ $day = $dayArr[0];
+ if($atEntry->out_time == "0000-00-00 00:00:00" || empty($atEntry->out_time)){
+ if(strtotime($atEntry->in_time) < (time() + $shift * 60) && $day == date("Y-m-d")){
+ $entry->status = "Clocked In";
+ $entry->statusId = 0;
+ $entry->color = 'green';
+
+ $employee = new Employee();
+ $employee->Load("id = ?",array($entry->id));
+ $entry->employee = $employee->first_name." ".$employee->last_name;
+ $employees[$entry->id] = $entry;
+ }
+ }
+
+ if(!isset($employees[$entry->id])){
+ $employee = new Employee();
+ $employee->Load("id = ?",array($entry->id));
+ if($day == date("Y-m-d")){
+ $entry->status = "Clocked Out";
+ $entry->statusId = 1;
+ $entry->color = 'yellow';
+ }else{
+ $entry->status = "Not Clocked In";
+ $entry->statusId = 2;
+ $entry->color = 'gray';
+ }
+ $entry->employee = $employee->first_name." ".$employee->last_name;
+ $employees[$entry->id] = $entry;
+ }
+
+ }
+
+ return array_values($employees);
+ }
+
+ public function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
+ $shift = intval(SettingsManager::getInstance()->getSetting("Attendance: Shift (Minutes)"));
+ $employee = new Employee();
+ $data = array();
+ $employees = $employee->Find("1=1");
+
+ $attendance = new Attendance();
+ $attendanceToday = $attendance->Find("date(in_time) = ?",array(date("Y-m-d")));
+ $attendanceData = array();
+ //Group by employee
+ foreach($attendanceToday as $attendance){
+ if(isset($attendanceData[$attendance->employee])){
+ $attendanceData[$attendance->employee][] = $attendance;
+ }else{
+ $attendanceData[$attendance->employee] = array($attendance);
+ }
+ }
+
+
+ foreach($employees as $employee){
+
+ $entry = new stdClass();
+ $entry->id = $employee->id;
+ $entry->employee = $employee->id;
+
+
+
+ if(isset($attendanceData[$employee->id])){
+ $attendanceEntries = $attendanceData[$employee->id];
+ foreach($attendanceEntries as $atEntry){
+ if($atEntry->out_time == "0000-00-00 00:00:00" || empty($atEntry->out_time)){
+ if(strtotime($atEntry->in_time) < time() + $shift * 60){
+ $entry->status = "Clocked In";
+ $entry->statusId = 0;
+ }
+ }
+ }
+
+ if(empty($entry->status)){
+ $entry->status = "Clocked Out";
+ $entry->statusId = 1;
+ }
+ }else{
+ $entry->status = "Not Clocked In";
+ $entry->statusId = 2;
+ }
+
+ $data[] = $entry;
+ }
+
+ function cmp($a, $b) {
+ return $a->statusId - $b->statusId;
+ }
+ usort($data, "cmp");
+
+ return $data;
+ }
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/attendance/index.php b/ext/admin/attendance/index.php
new file mode 100644
index 00000000..4301f9c0
--- /dev/null
+++ b/ext/admin/attendance/index.php
@@ -0,0 +1,82 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'attendance_monitor';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/admin/attendance/lib.js b/ext/admin/attendance/lib.js
new file mode 100644
index 00000000..5fc641b7
--- /dev/null
+++ b/ext/admin/attendance/lib.js
@@ -0,0 +1,218 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function AttendanceAdapter(endPoint,tab,filter,orderBy) {
+ this.initAdapter(endPoint,tab,filter,orderBy);
+}
+
+AttendanceAdapter.inherits(AdapterBase);
+
+
+
+AttendanceAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "employee",
+ "in_time",
+ "out_time",
+ "note"
+ ];
+});
+
+AttendanceAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Employee" },
+ { "sTitle": "Time-In" },
+ { "sTitle": "Time-Out"},
+ { "sTitle": "Note"}
+ ];
+});
+
+AttendanceAdapter.method('getFormFields', function() {
+ return [
+ [ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "in_time", {"label":"Time-In","type":"datetime"}],
+ [ "out_time", {"label":"Time-Out","type":"datetime", "validation":"none"}],
+ [ "note", {"label":"Note","type":"textarea","validation":"none"}]
+ ];
+});
+
+AttendanceAdapter.method('getFilters', function() {
+ return [
+ [ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}]
+
+ ];
+});
+
+
+AttendanceAdapter.method('getCustomTableParams', function() {
+ var that = this;
+ var dataTableParams = {
+ "aoColumnDefs": [
+ {
+ "fnRender": function(data, cell){
+ return that.preProcessRemoteTableData(data, cell, 2)
+ } ,
+ "aTargets": [2]
+ },
+ {
+ "fnRender": function(data, cell){
+ return that.preProcessRemoteTableData(data, cell, 3)
+ } ,
+ "aTargets": [3]
+ },
+ {
+ "fnRender": function(data, cell){
+ return that.preProcessRemoteTableData(data, cell, 4)
+ } ,
+ "aTargets": [4]
+ },
+ {
+ "fnRender": that.getActionButtons,
+ "aTargets": [that.getDataMapping().length]
+ }
+ ]
+ };
+ return dataTableParams;
+});
+
+AttendanceAdapter.method('preProcessRemoteTableData', function(data, cell, id) {
+ if(id == 2){
+ if(cell == '0000-00-00 00:00:00' || cell == "" || cell == undefined || cell == null){
+ return "";
+ }
+ return Date.parse(cell).toString('yyyy MMM d HH:mm ');
+ }else if(id == 3){
+ if(cell == '0000-00-00 00:00:00' || cell == "" || cell == undefined || cell == null){
+ return "";
+ }
+ return Date.parse(cell).toString('MMM d HH:mm ');
+ }else if(id == 4){
+ if(cell != undefined && cell != null){
+ if(cell.length > 10){
+ return cell.substring(0,10)+"..";
+ }
+ }
+ return cell;
+ }
+
+});
+
+
+
+AttendanceAdapter.method('save', function() {
+ var validator = new FormValidation(this.getTableName()+"_submit",true,{'ShowPopup':false,"LabelErrorClass":"error"});
+ if(validator.checkValues()){
+ var params = validator.getFormParameters();
+
+ var msg = this.doCustomValidation(params);
+ if(msg == null){
+ var id = $('#'+this.getTableName()+"_submit #id").val();
+ if(id != null && id != undefined && id != ""){
+ $(params).attr('id',id);
+ }
+
+ var reqJson = JSON.stringify(params);
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'saveSuccessCallback';
+ callBackData['callBackFail'] = 'saveFailCallback';
+
+ this.customAction('savePunch','admin=attendance',reqJson,callBackData);
+ }else{
+ $("#"+this.getTableName()+'Form .label').html(msg);
+ $("#"+this.getTableName()+'Form .label').show();
+ }
+
+ }
+});
+
+
+AttendanceAdapter.method('saveSuccessCallback', function(callBackData) {
+ this.get(callBackData);
+});
+
+
+AttendanceAdapter.method('saveFailCallback', function(callBackData) {
+ this.showMessage("Error saving attendance entry", callBackData);
+});
+
+
+
+/*
+ Attendance Status
+ */
+
+
+function AttendanceStatusAdapter(endPoint,tab,filter,orderBy) {
+ this.initAdapter(endPoint,tab,filter,orderBy);
+}
+
+AttendanceStatusAdapter.inherits(AdapterBase);
+
+
+
+AttendanceStatusAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "employee",
+ "status"
+ ];
+});
+
+AttendanceStatusAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Employee" },
+ { "sTitle": "Clocked In Status" }
+ ];
+});
+
+AttendanceStatusAdapter.method('getFormFields', function() {
+ return [
+
+ ];
+});
+
+AttendanceStatusAdapter.method('getFilters', function() {
+ return [
+ [ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}]
+
+ ];
+});
+
+AttendanceStatusAdapter.method('getActionButtonsHtml', function(id,data) {
+
+
+ html = '
';
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ if(data[2] == "Not Clocked In"){
+ html = html.replace(/_COLOR_/g,'gray');
+ }else if(data[2] == "Clocked Out"){
+ html = html.replace(/_COLOR_/g,'yellow');
+ }else if(data[2] == "Clocked In"){
+ html = html.replace(/_COLOR_/g,'green');
+ }
+ return html;
+});
\ No newline at end of file
diff --git a/ext/admin/attendance/meta.json b/ext/admin/attendance/meta.json
new file mode 100644
index 00000000..c41a9c98
--- /dev/null
+++ b/ext/admin/attendance/meta.json
@@ -0,0 +1,10 @@
+{
+"label":"Monitor Attendance",
+"menu":"Employees",
+"order":"8",
+"icon":"fa-clock-o",
+"user_levels":["Admin"],
+
+"permissions":
+ {}
+}
\ No newline at end of file
diff --git a/ext/admin/company_structure/api/Company_structureAdminManager.php b/ext/admin/company_structure/api/Company_structureAdminManager.php
new file mode 100644
index 00000000..5a1aba9b
--- /dev/null
+++ b/ext/admin/company_structure/api/Company_structureAdminManager.php
@@ -0,0 +1,52 @@
+addDatabaseErrorMapping("CONSTRAINT `Fk_Employee_CompanyStructures` FOREIGN KEY (`department`) REFERENCES `CompanyStructures` (`id`)", "Can not delete a company structure while employees are assigned to it");
+ $this->addDatabaseErrorMapping("CONSTRAINT `Fk_CompanyStructures_Own` FOREIGN KEY (`parent`) REFERENCES ", "Can not delete a parent structure");
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ $this->addModelClass('CompanyStructure');
+ }
+
+ }
+}
+
+
+if (!class_exists('CompanyStructure')) {
+ class CompanyStructure extends ICEHRM_Record {
+ var $_table = 'CompanyStructures';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get","element");
+ }
+
+ public function validateSave($obj){
+ if($obj->id == $obj->parent && !empty($obj->parent)){
+ return new IceResponse(IceResponse::ERROR,"A Company structure unit can not be the parent of the same unit");
+ }
+
+ return new IceResponse(IceResponse::SUCCESS,"");
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/company_structure/index.php b/ext/admin/company_structure/index.php
new file mode 100644
index 00000000..4e629453
--- /dev/null
+++ b/ext/admin/company_structure/index.php
@@ -0,0 +1,96 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'company_structure';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ext/admin/company_structure/lib.js b/ext/admin/company_structure/lib.js
new file mode 100644
index 00000000..7c0330f2
--- /dev/null
+++ b/ext/admin/company_structure/lib.js
@@ -0,0 +1,306 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+function CompanyStructureAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+CompanyStructureAdapter.inherits(AdapterBase);
+
+
+
+CompanyStructureAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "title",
+ "address",
+ "type",
+ "country",
+ "parent"
+ ];
+});
+
+CompanyStructureAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID","bVisible":false },
+ { "sTitle": "Name" },
+ { "sTitle": "Address","bSortable":false},
+ { "sTitle": "Type"},
+ { "sTitle": "Country", "sClass": "center" },
+ { "sTitle": "Parent Structure"}
+ ];
+});
+
+CompanyStructureAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden","validation":""}],
+ [ "title", {"label":"Name","type":"text","validation":""}],
+ [ "description", {"label":"Details","type":"textarea","validation":""}],
+ [ "address", {"label":"Address","type":"textarea","validation":"none"}],
+ [ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],
+ [ "country", {"label":"Country","type":"select","remote-source":["Country","code","name"]}],
+ [ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}]
+ ];
+});
+
+
+/*
+ * Company Graph
+ */
+
+
+function CompanyGraphAdapter(endPoint) {
+ this.initAdapter(endPoint);
+ this.nodeIdCounter = 0;
+}
+
+CompanyGraphAdapter.inherits(CompanyStructureAdapter);
+
+
+CompanyGraphAdapter.method('convertToTree', function(data) {
+ var ice = {};
+ ice['id'] = -1;
+ ice['title'] = '';
+ ice['name'] = '';
+ ice['children'] = [];
+
+ var parent = null;
+
+ var added = {};
+
+
+ for(var i=0;i ";
+ obj.parent = null;
+ break;
+ }
+ parentIdArr[parent.id] = 1;
+ curObj = parent;
+ }
+ }
+
+ if(errorMsg != ""){
+ this.showMessage("Company Structure is having a cyclic dependency","We found a cyclic dependency due to following reasons: "+errorMsg);
+ return false;
+ }
+
+ return true;
+
+});
+
+CompanyGraphAdapter.method('getHelpLink', function () {
+ return 'http://blog.icehrm.com/?page_id=61';
+});
+
+
+
+
diff --git a/ext/admin/company_structure/meta.json b/ext/admin/company_structure/meta.json
new file mode 100644
index 00000000..7d226ff1
--- /dev/null
+++ b/ext/admin/company_structure/meta.json
@@ -0,0 +1,16 @@
+{
+"label":"Company Structure",
+"menu":"Admin",
+"order":"2",
+"icon":"fa-building-o",
+"user_levels":["Admin","Manager"],
+
+"permissions":
+ {
+ "Manager":{
+ "Add Company Structure":"No",
+ "Edit Company Structure":"No",
+ "Delete Company Structure":"No"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/dashboard/api/DashboardActionManager.php b/ext/admin/dashboard/api/DashboardActionManager.php
new file mode 100644
index 00000000..ea0f1946
--- /dev/null
+++ b/ext/admin/dashboard/api/DashboardActionManager.php
@@ -0,0 +1,55 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+*/
+
+
+class DashboardActionManager extends SubActionManager{
+
+ public function getInitData($req){
+ $data = array();
+ $employees = new Employee();
+ $data['numberOfEmployees'] = $employees->Count("1 = 1");
+
+ $company = new CompanyStructure();
+ $data['numberOfCompanyStuctures'] = $company->Count("1 = 1");
+
+ $user = new User();
+ $data['numberOfUsers'] = $user->Count("1 = 1");
+
+ $project = new Project();
+ $data['numberOfProjects'] = $project->Count("status = 'Active'");
+
+ $attendance = new Attendance();
+ $data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
+
+ $empLeave = new EmployeeLeave();
+ $data['numberOfLeaves'] = $empLeave->Count("date_start > '".date("Y-m-d")."'");
+
+ $timeEntry = new EmployeeTimeEntry();
+ $data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
+
+
+ return new IceResponse(IceResponse::SUCCESS,$data);
+
+ }
+
+}
\ No newline at end of file
diff --git a/ext/admin/dashboard/api/DashboardAdminManager.php b/ext/admin/dashboard/api/DashboardAdminManager.php
new file mode 100644
index 00000000..5d3b871a
--- /dev/null
+++ b/ext/admin/dashboard/api/DashboardAdminManager.php
@@ -0,0 +1,22 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'dashboard';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
+
Why not upgrade to IceHrm Pro Version
+
+ IceHrm Pro is the feature rich upgrade to IceHrm open source version. It comes with improved modules for
+ employee management, leave management, LDAP support and number of other features over open source version.
+ Hit this link to do a full one to one comparison.
+
+ Also you can learn more about IceHrm Pro here
+
+
+ Buy IceHrm Pro
+
+
+
+
+
+
+
+
+
+
+ People
+
+
+ .. Employees
+
+
+
+
+
+
+
+
+
+
+
+
+
..
+
+ Company Structures
+
+
+
+
+
+
+
+
+
+
+
+
+
+
..
+
+ Active Projects
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Attendance
+
+
+ .. Entries Last Week
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Reports
+
+ View / Download Reports
+
+
+
+
+
+
+
+
+
+
+
+
+
Settings
+
+ Configure IceHrm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ext/admin/dashboard/lib.js b/ext/admin/dashboard/lib.js
new file mode 100644
index 00000000..dedc9f53
--- /dev/null
+++ b/ext/admin/dashboard/lib.js
@@ -0,0 +1,76 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function DashboardAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+DashboardAdapter.inherits(AdapterBase);
+
+
+
+DashboardAdapter.method('getDataMapping', function() {
+ return [];
+});
+
+DashboardAdapter.method('getHeaders', function() {
+ return [];
+});
+
+DashboardAdapter.method('getFormFields', function() {
+ return [];
+});
+
+
+DashboardAdapter.method('get', function(callBackData) {
+});
+
+
+DashboardAdapter.method('getInitData', function() {
+ var that = this;
+ var object = {};
+ var reqJson = JSON.stringify(object);
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'getInitDataSuccessCallBack';
+ callBackData['callBackFail'] = 'getInitDataFailCallBack';
+
+ this.customAction('getInitData','admin=dashboard',reqJson,callBackData);
+});
+
+
+
+DashboardAdapter.method('getInitDataSuccessCallBack', function(data) {
+
+ $("#numberOfEmployees").html(data['numberOfEmployees']+" Employees");
+ $("#numberOfCompanyStuctures").html(data['numberOfCompanyStuctures']);
+ $("#numberOfUsers").html(data['numberOfUsers']+" Users");
+ $("#numberOfProjects").html(data['numberOfProjects']);
+ $("#numberOfAttendanceLastWeek").html(data['numberOfAttendanceLastWeek']+" Entries Last Week");
+ $("#numberOfLeaves").html(data['numberOfLeaves']);
+ $("#numberOfTimeEntries").html(data['numberOfTimeEntries']);
+
+});
+
+DashboardAdapter.method('getInitDataFailCallBack', function(callBackData) {
+
+});
diff --git a/ext/admin/dashboard/meta.json b/ext/admin/dashboard/meta.json
new file mode 100644
index 00000000..1383aecd
--- /dev/null
+++ b/ext/admin/dashboard/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Dashboard",
+"menu":"Admin",
+"order":"1",
+"icon":"fa-desktop",
+"user_levels":["Admin"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/documents/api/DocumentsAdminManager.php b/ext/admin/documents/api/DocumentsAdminManager.php
new file mode 100644
index 00000000..31cfaee3
--- /dev/null
+++ b/ext/admin/documents/api/DocumentsAdminManager.php
@@ -0,0 +1,69 @@
+addFileFieldMapping('EmployeeDocument', 'attachment', 'name');
+ }
+
+ public function initializeDatabaseErrorMappings(){
+ $this->addDatabaseErrorMapping('CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY','Can not delete Document Type, users have already uploaded these types of documents');
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ $this->addModelClass('Document');
+ $this->addModelClass('EmployeeDocument');
+ }
+
+ }
+}
+
+
+if (!class_exists('Document')) {
+ class Document extends ICEHRM_Record {
+ var $_table = 'Documents';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+
+ public function getUserAccess(){
+ return array();
+ }
+ }
+}
+
+if (!class_exists('EmployeeDocument')) {
+ class EmployeeDocument extends ICEHRM_Record {
+ var $_table = 'EmployeeDocuments';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+
+ public function Insert(){
+ if(empty($this->date_added)){
+ $this->date_added = date("Y-m-d H:i:s");
+ }
+ return parent::Insert();
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/documents/index.php b/ext/admin/documents/index.php
new file mode 100644
index 00000000..2d317fee
--- /dev/null
+++ b/ext/admin/documents/index.php
@@ -0,0 +1,64 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'documents';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/admin/documents/lib.js b/ext/admin/documents/lib.js
new file mode 100644
index 00000000..f2fb7200
--- /dev/null
+++ b/ext/admin/documents/lib.js
@@ -0,0 +1,107 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+
+/**
+ * DocumentAdapter
+ */
+
+function DocumentAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+DocumentAdapter.inherits(AdapterBase);
+
+
+
+DocumentAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "details"
+ ];
+});
+
+DocumentAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Details"}
+ ];
+});
+
+DocumentAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text","validation":""}],
+ [ "details", {"label":"Details","type":"textarea","validation":"none"}]
+ ];
+});
+
+DocumentAdapter.method('getHelpLink', function () {
+ return 'http://blog.icehrm.com/?page_id=88';
+});
+
+
+function EmployeeDocumentAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeDocumentAdapter.inherits(AdapterBase);
+
+
+
+EmployeeDocumentAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "employee",
+ "document",
+ "details",
+ "date_added",
+ "status",
+ "attachment"
+ ];
+});
+
+EmployeeDocumentAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Employee" },
+ { "sTitle": "Document" },
+ { "sTitle": "Details" },
+ { "sTitle": "Date Added"},
+ { "sTitle": "Status"},
+ { "sTitle": "Attachment","bVisible":false}
+ ];
+});
+
+EmployeeDocumentAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}],
+ [ "document", {"label":"Document","type":"select2","remote-source":["Document","id","name"]}],
+ [ "date_added", {"label":"Date Added","type":"date","validation":""}],
+ [ "valid_until", {"label":"Valid Until","type":"date","validation":"none"}],
+ [ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"],["Draft","Draft"]]}],
+ [ "details", {"label":"Details","type":"textarea","validation":"none"}],
+ [ "attachment", {"label":"Attachment","type":"fileupload","validation":"none"}]
+ ];
+});
+
+
+EmployeeDocumentAdapter.method('getFilters', function() {
+ return [
+ [ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}]
+
+ ];
+});
+
+
+EmployeeDocumentAdapter.method('getActionButtonsHtml', function(id,data) {
+ var html = '';
+ html = html.replace(/_id_/g,id);
+ html = html.replace(/_attachment_/g,data[6]);
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ return html;
+});
diff --git a/ext/admin/documents/meta.json b/ext/admin/documents/meta.json
new file mode 100644
index 00000000..ddba8cdc
--- /dev/null
+++ b/ext/admin/documents/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Document Management",
+"menu":"Employees",
+"order":"2",
+"icon":"fa-files-o",
+"user_levels":["Admin"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/employees/api/EmployeesAdminManager.php b/ext/admin/employees/api/EmployeesAdminManager.php
new file mode 100644
index 00000000..219156b2
--- /dev/null
+++ b/ext/admin/employees/api/EmployeesAdminManager.php
@@ -0,0 +1,71 @@
+addDatabaseErrorMapping('CONSTRAINT `Fk_User_Employee` FOREIGN KEY',"Can not delete Employee, please delete the User for this employee first.");
+ $this->addDatabaseErrorMapping("Duplicate entry|for key 'employee'","A duplicate entry found");
+ }
+
+ public function setupModuleClassDefinitions(){
+ $this->addModelClass('Employee');
+ $this->addModelClass('EmploymentStatus');
+ }
+
+ }
+}
+
+if (!class_exists('Employee')) {
+ class Employee extends ICEHRM_Record {
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save");
+ }
+
+ public function getUserOnlyMeAccessField(){
+ return "id";
+ }
+
+ var $_table = 'Employees';
+ }
+}
+
+if (!class_exists('EmploymentStatus')) {
+ class EmploymentStatus extends ICEHRM_Record {
+
+ var $_table = 'EmploymentStatus';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+ }
+}
+
diff --git a/ext/admin/employees/index.php b/ext/admin/employees/index.php
new file mode 100644
index 00000000..0765d325
--- /dev/null
+++ b/ext/admin/employees/index.php
@@ -0,0 +1,34 @@
+
+
+
diff --git a/ext/admin/employees/lib.js b/ext/admin/employees/lib.js
new file mode 100644
index 00000000..133bf7f7
--- /dev/null
+++ b/ext/admin/employees/lib.js
@@ -0,0 +1,96 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+function EmployeeAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeAdapter.inherits(AdapterBase);
+
+
+
+EmployeeAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "employee_id",
+ "first_name",
+ "last_name",
+ "mobile_phone",
+ "department",
+ "gender",
+ "supervisor"
+ ];
+});
+
+EmployeeAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" },
+ { "sTitle": "Employee Number" },
+ { "sTitle": "First Name" },
+ { "sTitle": "Last Name"},
+ { "sTitle": "Mobile"},
+ { "sTitle": "Department"},
+ { "sTitle": "Gender"},
+ { "sTitle": "Supervisor"}
+ ];
+});
+
+EmployeeAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden","validation":""}],
+ [ "employee_id", {"label":"Employee Number","type":"text","validation":""}],
+ [ "first_name", {"label":"First Name","type":"text","validation":""}],
+ [ "middle_name", {"label":"Middle Name","type":"text","validation":"none"}],
+ [ "last_name", {"label":"Last Name","type":"text","validation":""}],
+ [ "nationality", {"label":"Nationality","type":"select2","remote-source":["Nationality","id","name"]}],
+ [ "birthday", {"label":"Date of Birth","type":"date","validation":""}],
+ [ "gender", {"label":"Gender","type":"select","source":[["Male","Male"],["Female","Female"]]}],
+ [ "marital_status", {"label":"Marital Status","type":"select","source":[["Married","Married"],["Single","Single"],["Divorced","Divorced"],["Widowed","Widowed"],["Other","Other"]]}],
+ [ "ssn_num", {"label":"SSN/NRIC","type":"text","validation":"none"}],
+ [ "nic_num", {"label":"NIC","type":"text","validation":"none"}],
+ [ "other_id", {"label":"Other ID","type":"text","validation":"none"}],
+ [ "driving_license", {"label":"Driving License No","type":"text","validation":"none"}],
+ /*[ "driving_license_exp_date", {"label":"License Exp Date","type":"date","validation":"none"}],*/
+ [ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"]}],
+ [ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"]}],
+ [ "pay_grade", {"label":"Pay Grade","type":"select2","allow-null":true,"remote-source":["PayGrade","id","name"]}],
+ [ "work_station_id", {"label":"Work Station Id","type":"text","validation":"none"}],
+ [ "address1", {"label":"Address Line 1","type":"text","validation":"none"}],
+ [ "address2", {"label":"Address Line 2","type":"text","validation":"none"}],
+ [ "city", {"label":"City","type":"text","validation":"none"}],
+ [ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}],
+ [ "province", {"label":"Province","type":"select2","allow-null":true,"remote-source":["Province","id","name"]}],
+ [ "postal_code", {"label":"Postal/Zip Code","type":"text","validation":"none"}],
+ [ "home_phone", {"label":"Home Phone","type":"text","validation":"none"}],
+ [ "mobile_phone", {"label":"Mobile Phone","type":"text","validation":"none"}],
+ [ "work_phone", {"label":"Work Phone","type":"text","validation":"none"}],
+ [ "work_email", {"label":"Work Email","type":"text","validation":"emailOrEmpty"}],
+ [ "private_email", {"label":"Private Email","type":"text","validation":"emailOrEmpty"}],
+ [ "joined_date", {"label":"Joined Date","type":"date","validation":""}],
+ [ "confirmation_date", {"label":"Confirmation Date","type":"date","validation":"none"}],
+ [ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"]}],
+ [ "supervisor", {"label":"Supervisor","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}]
+ ];
+});
+
+EmployeeAdapter.method('getFilters', function() {
+ return [
+ [ "job_title", {"label":"Job Title","type":"select2","allow-null":true,"null-label":"All Job Titles","remote-source":["JobTitle","id","name"]}],
+ [ "department", {"label":"Department","type":"select2","allow-null":true,"null-label":"All Departments","remote-source":["CompanyStructure","id","title"]}],
+ [ "supervisor", {"label":"Supervisor","type":"select2","allow-null":true,"null-label":"Anyone","remote-source":["Employee","id","first_name+last_name"]}]
+ ];
+});
+
+EmployeeAdapter.method('getActionButtonsHtml', function(id) {
+ var html = '';
+ html = html.replace(/_id_/g,id);
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ return html;
+});
+
+EmployeeAdapter.method('getHelpLink', function () {
+ return 'http://blog.icehrm.com/?page_id=69';
+});
+
+
diff --git a/ext/admin/employees/meta.json b/ext/admin/employees/meta.json
new file mode 100644
index 00000000..ac5d18ed
--- /dev/null
+++ b/ext/admin/employees/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Employees",
+"menu":"Employees",
+"order":"1",
+"icon":"fa-users",
+"user_levels":["Admin"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/jobs/api/JobsAdminManager.php b/ext/admin/jobs/api/JobsAdminManager.php
new file mode 100644
index 00000000..ce9b177f
--- /dev/null
+++ b/ext/admin/jobs/api/JobsAdminManager.php
@@ -0,0 +1,54 @@
+addModelClass('JobTitle');
+ $this->addModelClass('PayGrade');
+
+ }
+
+ }
+}
+
+
+if (!class_exists('JobTitle')) {
+ class JobTitle extends ICEHRM_Record {
+ var $_table = 'JobTitles';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+ }
+}
+
+if (!class_exists('PayGrade')) {
+ class PayGrade extends ICEHRM_Record {
+ var $_table = 'PayGrades';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/jobs/index.php b/ext/admin/jobs/index.php
new file mode 100644
index 00000000..b3744499
--- /dev/null
+++ b/ext/admin/jobs/index.php
@@ -0,0 +1,74 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'jobs';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/admin/jobs/lib.js b/ext/admin/jobs/lib.js
new file mode 100644
index 00000000..36142741
--- /dev/null
+++ b/ext/admin/jobs/lib.js
@@ -0,0 +1,139 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+
+/**
+ * JobTitleAdapter
+ */
+
+function JobTitleAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+JobTitleAdapter.inherits(AdapterBase);
+
+
+
+JobTitleAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "code",
+ "name"
+ ];
+});
+
+JobTitleAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Code" },
+ { "sTitle": "Name" }
+ ];
+});
+
+JobTitleAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "code", {"label":"Job Title Code","type":"text"}],
+ [ "name", {"label":"Job Title","type":"text"}],
+ [ "description", {"label":"Description","type":"textarea"}],
+ [ "specification", {"label":"Specification","type":"textarea"}]
+ ];
+});
+
+JobTitleAdapter.method('getHelpLink', function () {
+ return 'http://blog.icehrm.com/?page_id=80';
+});
+
+
+/**
+ * PayGradeAdapter
+ */
+
+function PayGradeAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+PayGradeAdapter.inherits(AdapterBase);
+
+
+
+PayGradeAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "currency",
+ "min_salary",
+ "max_salary"
+ ];
+});
+
+PayGradeAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Currency"},
+ { "sTitle": "Min Salary" },
+ { "sTitle": "Max Salary"}
+ ];
+});
+
+PayGradeAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Pay Grade Name","type":"text"}],
+ [ "currency", {"label":"Currency","type":"select2","remote-source":["CurrencyType","code","name"]}],
+ [ "min_salary", {"label":"Min Salary","type":"text","validation":"float"}],
+ [ "max_salary", {"label":"Max Salary","type":"text","validation":"float"}]
+ ];
+});
+
+PayGradeAdapter.method('doCustomValidation', function(params) {
+ try{
+ if(parseFloat(params.min_salary)>parseFloat(params.max_salary)){
+ return "Min Salary should be smaller than Max Salary";
+ }
+ }catch(e){
+
+ }
+ return null;
+});
+
+
+
+/**
+ * EmploymentStatusAdapter
+ */
+
+function EmploymentStatusAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmploymentStatusAdapter.inherits(AdapterBase);
+
+
+
+EmploymentStatusAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "description"
+ ];
+});
+
+EmploymentStatusAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" },
+ { "sTitle": "Name" },
+ { "sTitle": "Description"}
+ ];
+});
+
+EmploymentStatusAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Employment Status","type":"text"}],
+ [ "description", {"label":"Description","type":"textarea","validation":""}]
+ ];
+});
+
diff --git a/ext/admin/jobs/meta.json b/ext/admin/jobs/meta.json
new file mode 100644
index 00000000..8e8ade44
--- /dev/null
+++ b/ext/admin/jobs/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Job Details Setup",
+"menu":"Admin",
+"order":"3",
+"icon":"fa-columns",
+"user_levels":["Admin"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/loans/api/LoansAdminManager.php b/ext/admin/loans/api/LoansAdminManager.php
new file mode 100644
index 00000000..022aa360
--- /dev/null
+++ b/ext/admin/loans/api/LoansAdminManager.php
@@ -0,0 +1,37 @@
+addModelClass('CompanyLoan');
+ }
+
+ }
+}
+
+if (!class_exists('CompanyLoan')) {
+ class CompanyLoan extends ICEHRM_Record {
+ var $_table = 'CompanyLoans';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/loans/index.php b/ext/admin/loans/index.php
new file mode 100644
index 00000000..c00e9b7c
--- /dev/null
+++ b/ext/admin/loans/index.php
@@ -0,0 +1,64 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'CompanyLoans';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/admin/loans/lib.js b/ext/admin/loans/lib.js
new file mode 100644
index 00000000..fcd72542
--- /dev/null
+++ b/ext/admin/loans/lib.js
@@ -0,0 +1,102 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+
+/**
+ * CompanyLoanAdapter
+ */
+
+function CompanyLoanAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+CompanyLoanAdapter.inherits(AdapterBase);
+
+
+
+CompanyLoanAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "details"
+ ];
+});
+
+CompanyLoanAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Details"}
+ ];
+});
+
+CompanyLoanAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text","validation":""}],
+ [ "details", {"label":"Details","type":"textarea","validation":"none"}]
+ ];
+});
+
+/*
+ * EmployeeCompanyLoanAdapter
+ */
+
+function EmployeeCompanyLoanAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeCompanyLoanAdapter.inherits(AdapterBase);
+
+
+
+EmployeeCompanyLoanAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "employee",
+ "loan",
+ "start_date",
+ "period_months",
+ "currency",
+ "amount",
+ "status"
+ ];
+});
+
+EmployeeCompanyLoanAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Employee" },
+ { "sTitle": "Loan Type" },
+ { "sTitle": "Loan Start Date"},
+ { "sTitle": "Loan Period (Months)"},
+ { "sTitle": "Currency"},
+ { "sTitle": "Amount"},
+ { "sTitle": "Status"}
+ ];
+});
+
+EmployeeCompanyLoanAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}],
+ [ "loan", {"label":"Loan Type","type":"select","remote-source":["CompanyLoan","id","name"]}],
+ [ "start_date", {"label":"Loan Start Date","type":"date","validation":""}],
+ [ "last_installment_date", {"label":"Last Installment Date","type":"date","validation":"none"}],
+ [ "period_months", {"label":"Loan Period (Months)","type":"text","validation":"number"}],
+ [ "currency", {"label":"Currency","type":"select2","remote-source":["CurrencyType","id","name"]}],
+ [ "amount", {"label":"Loan Amount","type":"text","validation":"float"}],
+ [ "monthly_installment", {"label":"Monthly Installment","type":"text","validation":"float"}],
+ [ "status", {"label":"Status","type":"select","source":[["Approved","Approved"],["Paid","Paid"],["Suspended","Suspended"]]}],
+ [ "details", {"label":"Details","type":"textarea","validation":"none"}]
+ ];
+});
+
+EmployeeCompanyLoanAdapter.method('getFilters', function() {
+ return [
+ [ "employee", {"label":"Employee","type":"select2","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],
+ [ "loan", {"label":"Loan Type","type":"select","allow-null":true,"null-label":"All Loan Types","remote-source":["CompanyLoan","id","name"]}],
+
+ ];
+});
diff --git a/ext/admin/loans/meta.json b/ext/admin/loans/meta.json
new file mode 100644
index 00000000..b05e249e
--- /dev/null
+++ b/ext/admin/loans/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Company Loans",
+"menu":"Admin",
+"order":"7",
+"icon":"fa-shield",
+"user_levels":["Admin"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/meta.json b/ext/admin/meta.json
new file mode 100644
index 00000000..97a79006
--- /dev/null
+++ b/ext/admin/meta.json
@@ -0,0 +1,7 @@
+{
+"Admin":"fa-cubes",
+"Employees":"fa-users",
+"Reports":"fa-file-text",
+"System":"fa-cogs",
+"Salary Details":"fa-money"
+}
diff --git a/ext/admin/metadata/api/MetadataAdminManager.php b/ext/admin/metadata/api/MetadataAdminManager.php
new file mode 100644
index 00000000..de42a1b5
--- /dev/null
+++ b/ext/admin/metadata/api/MetadataAdminManager.php
@@ -0,0 +1,144 @@
+addModelClass('Country');
+ $this->addModelClass('Province');
+ $this->addModelClass('CurrencyType');
+ $this->addModelClass('Nationality');
+ $this->addModelClass('ImmigrationStatus');
+ $this->addModelClass('Ethnicity');
+ }
+
+ }
+}
+
+if (!class_exists('Country')) {
+ class Country extends ICEHRM_Record {
+ var $_table = 'Country';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+
+ public function getAnonymousAccess(){
+ return array("get","element");
+ }
+ }
+}
+
+if (!class_exists('Province')) {
+ class Province extends ICEHRM_Record {
+ var $_table = 'Province';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+
+ public function getAnonymousAccess(){
+ return array("get","element");
+ }
+ }
+}
+
+
+if (!class_exists('CurrencyType')) {
+ class CurrencyType extends ICEHRM_Record {
+ var $_table = 'CurrencyTypes';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+
+ public function getAnonymousAccess(){
+ return array("get","element");
+ }
+ }
+}
+
+
+if (!class_exists('Nationality')) {
+ class Nationality extends ICEHRM_Record {
+ var $_table = 'Nationality';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+
+ public function getAnonymousAccess(){
+ return array("get","element");
+ }
+ }
+}
+
+
+if (!class_exists('ImmigrationStatus')) {
+ class ImmigrationStatus extends ICEHRM_Record {
+ var $_table = 'ImmigrationStatus';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+
+ public function getAnonymousAccess(){
+ return array("get","element");
+ }
+ }
+}
+
+
+if (!class_exists('Ethnicity')) {
+ class Ethnicity extends ICEHRM_Record {
+ var $_table = 'Ethnicity';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+
+ public function getAnonymousAccess(){
+ return array("get","element");
+ }
+ }
+}
+
+
+
+
diff --git a/ext/admin/metadata/index.php b/ext/admin/metadata/index.php
new file mode 100644
index 00000000..8001d10c
--- /dev/null
+++ b/ext/admin/metadata/index.php
@@ -0,0 +1,42 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'metadata';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+
+$moduleBuilder = new ModuleBuilder();
+
+$moduleBuilder->addModuleOrGroup(new ModuleTab('Country','Country','Countries','CountryAdapter','','',true));
+$moduleBuilder->addModuleOrGroup(new ModuleTab('Province','Province','Provinces','ProvinceAdapter','',''));
+$moduleBuilder->addModuleOrGroup(new ModuleTab('CurrencyType','CurrencyType','Currency Types','CurrencyTypeAdapter','',''));
+$moduleBuilder->addModuleOrGroup(new ModuleTab('Nationality','Nationality','Nationality','NationalityAdapter','',''));
+$moduleBuilder->addModuleOrGroup(new ModuleTab('Nationality','Nationality','Nationality','NationalityAdapter','',''));
+$moduleBuilder->addModuleOrGroup(new ModuleTab('Ethnicity','Ethnicity','Ethnicity','EthnicityAdapter','',''));
+$moduleBuilder->addModuleOrGroup(new ModuleTab('ImmigrationStatus','ImmigrationStatus','Immigration Status','ImmigrationStatusAdapter','',''));
+
+
+echo UIManager::getInstance()->renderModule($moduleBuilder);
+
+include APP_BASE_PATH.'footer.php';
\ No newline at end of file
diff --git a/ext/admin/metadata/lib.js b/ext/admin/metadata/lib.js
new file mode 100644
index 00000000..c7d66274
--- /dev/null
+++ b/ext/admin/metadata/lib.js
@@ -0,0 +1,158 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+
+/**
+ * CountryAdapter
+ */
+
+function CountryAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+CountryAdapter.inherits(AdapterBase);
+
+
+
+CountryAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "code",
+ "name"
+ ];
+});
+
+CountryAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Code" },
+ { "sTitle": "Name"}
+ ];
+});
+
+CountryAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "code", {"label":"Code","type":"text","validation":""}],
+ [ "name", {"label":"Name","type":"text","validation":""}]
+ ];
+});
+
+
+/**
+ * ProvinceAdapter
+ */
+
+function ProvinceAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+ProvinceAdapter.inherits(AdapterBase);
+
+
+
+ProvinceAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "code",
+ "name",
+ "country"
+ ];
+});
+
+ProvinceAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Code" },
+ { "sTitle": "Name"},
+ { "sTitle": "Country"},
+ ];
+});
+
+ProvinceAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "code", {"label":"Code","type":"text","validation":""}],
+ [ "name", {"label":"Name","type":"text","validation":""}],
+ [ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}]
+ ];
+});
+
+ProvinceAdapter.method('getFilters', function() {
+ return [
+ [ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}]
+
+ ];
+});
+
+
+/**
+ * CurrencyTypeAdapter
+ */
+
+function CurrencyTypeAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+CurrencyTypeAdapter.inherits(AdapterBase);
+
+
+
+CurrencyTypeAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "code",
+ "name"
+ ];
+});
+
+CurrencyTypeAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Code" },
+ { "sTitle": "Name"}
+ ];
+});
+
+CurrencyTypeAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "code", {"label":"Code","type":"text","validation":""}],
+ [ "name", {"label":"Name","type":"text","validation":""}]
+ ];
+});
+
+/**
+ * NationalityAdapter
+ */
+
+function NationalityAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+NationalityAdapter.inherits(IdNameAdapter);
+
+/**
+ * ImmigrationStatusAdapter
+ */
+
+function ImmigrationStatusAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+ImmigrationStatusAdapter.inherits(IdNameAdapter);
+
+
+/**
+ * EthnicityAdapter
+ */
+
+function EthnicityAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EthnicityAdapter.inherits(IdNameAdapter);
+
+
+
diff --git a/ext/admin/metadata/meta.json b/ext/admin/metadata/meta.json
new file mode 100644
index 00000000..ff24da01
--- /dev/null
+++ b/ext/admin/metadata/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Manage Metadata",
+"menu":"System",
+"order":"6",
+"icon":"fa-sort-alpha-asc",
+"user_levels":["Admin"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/modules/api/ModulesAdminManager.php b/ext/admin/modules/api/ModulesAdminManager.php
new file mode 100644
index 00000000..208f3190
--- /dev/null
+++ b/ext/admin/modules/api/ModulesAdminManager.php
@@ -0,0 +1,35 @@
+addModelClass('Module');
+ }
+
+ }
+}
+
+if (!class_exists('Module')) {
+ class Module extends ICEHRM_Record {
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+ var $_table = 'Modules';
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/modules/index.php b/ext/admin/modules/index.php
new file mode 100644
index 00000000..51aa4602
--- /dev/null
+++ b/ext/admin/modules/index.php
@@ -0,0 +1,54 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'Modules';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/admin/modules/lib.js b/ext/admin/modules/lib.js
new file mode 100644
index 00000000..ba70d1e8
--- /dev/null
+++ b/ext/admin/modules/lib.js
@@ -0,0 +1,78 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+
+/**
+ * ModuleAdapter
+ */
+
+function ModuleAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+ModuleAdapter.inherits(AdapterBase);
+
+
+
+ModuleAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "label",
+ "menu",
+ "mod_group",
+ "mod_order",
+ "status",
+ "version",
+ "update_path"
+ ];
+});
+
+ModuleAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Menu" ,"bVisible":false},
+ { "sTitle": "Group"},
+ { "sTitle": "Order"},
+ { "sTitle": "Status"},
+ { "sTitle": "Version","bVisible":false},
+ { "sTitle": "Path" ,"bVisible":false}
+ ];
+});
+
+ModuleAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "label", {"label":"Label","type":"text","validation":""}],
+ [ "status", {"label":"Status","type":"select","source":[["Enabled","Enabled"],["Disabled","Disabled"]]}],
+ [ "user_levels", {"label":"User Levels","type":"select2multi","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}]
+ ];
+});
+
+
+ModuleAdapter.method('getActionButtonsHtml', function(id,data) {
+
+
+ var nonEditableFields = {};
+ nonEditableFields["admin_Company Structure"] = 1;
+ nonEditableFields["admin_Employees"] = 1;
+ nonEditableFields["admin_Jobs"] = 1;
+ nonEditableFields["admin_Leaves"] = 1;
+ nonEditableFields["admin_Manage Modules"] = 1;
+ nonEditableFields["admin_Projects"] = 1;
+ nonEditableFields["admin_Qualifications"] = 1;
+ nonEditableFields["admin_Settings"] = 1;
+ nonEditableFields["admin_Users"] = 1;
+ nonEditableFields["admin_Upgrade"] = 1;
+
+ nonEditableFields["user_Basic Information"] = 1;
+
+ if(nonEditableFields[data[3]+"_"+data[1]] == 1){
+ return "";
+ }
+ var html = ' ';
+ html = html.replace(/_id_/g,id);
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ return html;
+});
diff --git a/ext/admin/modules/meta.json b/ext/admin/modules/meta.json
new file mode 100644
index 00000000..517e2109
--- /dev/null
+++ b/ext/admin/modules/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Manage Modules",
+"menu":"System",
+"order":"3",
+"icon":"fa-folder-open",
+"user_levels":["Admin"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/permissions/api/PermissionsAdminManager.php b/ext/admin/permissions/api/PermissionsAdminManager.php
new file mode 100644
index 00000000..09f664bb
--- /dev/null
+++ b/ext/admin/permissions/api/PermissionsAdminManager.php
@@ -0,0 +1,37 @@
+addModelClass('Permission');
+ }
+
+ }
+}
+
+if (!class_exists('Permission')) {
+ class Permission extends ICEHRM_Record {
+ var $_table = 'Permissions';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/permissions/index.php b/ext/admin/permissions/index.php
new file mode 100644
index 00000000..f960f4c3
--- /dev/null
+++ b/ext/admin/permissions/index.php
@@ -0,0 +1,54 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'Permissions';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/admin/permissions/lib.js b/ext/admin/permissions/lib.js
new file mode 100644
index 00000000..52b8c048
--- /dev/null
+++ b/ext/admin/permissions/lib.js
@@ -0,0 +1,73 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+
+/**
+ * PermissionAdapter
+ */
+
+function PermissionAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+PermissionAdapter.inherits(AdapterBase);
+
+
+
+PermissionAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "user_level",
+ "module_id",
+ "permission",
+ "value"
+ ];
+});
+
+PermissionAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "User Level" },
+ { "sTitle": "Module"},
+ { "sTitle": "Permission"},
+ { "sTitle": "Value"}
+ ];
+});
+
+PermissionAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "user_level", {"label":"User Level","type":"placeholder","validation":"none"}],
+ [ "module_id", {"label":"Module","type":"placeholder","remote-source":["Module","id","menu+name"]}],
+ [ "permission", {"label":"Permission","type":"placeholder","validation":"none"}],
+ [ "value", {"label":"Value","type":"text","validation":"none"}]
+ ];
+});
+
+PermissionAdapter.method('getFilters', function() {
+ return [
+ [ "module_id", {"label":"Module","type":"select2","allow-null":true,"null-label":"All Modules","remote-source":["Module","id","menu+name"]}]
+ ];
+});
+
+PermissionAdapter.method('getActionButtonsHtml', function(id,data) {
+ var html = ' ';
+ html = html.replace(/_id_/g,id);
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ return html;
+});
+
+
+PermissionAdapter.method('getMetaFieldForRendering', function(fieldName) {
+ if(fieldName == "value"){
+ return "meta";
+ }
+ return "";
+});
+
+
+PermissionAdapter.method('fillForm', function(object) {
+ this.uber('fillForm',object);
+ $("#helptext").html(object.description);
+});
diff --git a/ext/admin/permissions/meta.json b/ext/admin/permissions/meta.json
new file mode 100644
index 00000000..a33dca1c
--- /dev/null
+++ b/ext/admin/permissions/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Manage Permissions",
+"menu":"System",
+"order":"4",
+"icon":"fa-unlock",
+"user_levels":["Admin"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/projects/api/ProjectsAdminManager.php b/ext/admin/projects/api/ProjectsAdminManager.php
new file mode 100644
index 00000000..72dad203
--- /dev/null
+++ b/ext/admin/projects/api/ProjectsAdminManager.php
@@ -0,0 +1,60 @@
+addDatabaseErrorMapping("key 'EmployeeProjectsKey'", "Employee already added to this project");
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ $this->addModelClass('Client');
+ $this->addModelClass('Project');
+
+ }
+
+ }
+}
+
+
+if (!class_exists('Client')) {
+ class Client extends ICEHRM_Record {
+ var $_table = 'Clients';
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+ }
+}
+
+if (!class_exists('Project')) {
+ class Project extends ICEHRM_Record {
+ var $_table = 'Projects';
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get","element");
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/projects/index.php b/ext/admin/projects/index.php
new file mode 100644
index 00000000..9d7db1d5
--- /dev/null
+++ b/ext/admin/projects/index.php
@@ -0,0 +1,113 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'projects';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/admin/projects/lib.js b/ext/admin/projects/lib.js
new file mode 100644
index 00000000..fd6ae476
--- /dev/null
+++ b/ext/admin/projects/lib.js
@@ -0,0 +1,177 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+/**
+ * ClientAdapter
+ */
+
+function ClientAdapter(endPoint,tab,filter,orderBy) {
+ this.initAdapter(endPoint,tab,filter,orderBy);
+}
+
+ClientAdapter.inherits(AdapterBase);
+
+
+
+ClientAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "details",
+ "address",
+ "contact_number"
+ ];
+});
+
+ClientAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID","bVisible":false },
+ { "sTitle": "Name" },
+ { "sTitle": "Details"},
+ { "sTitle": "Address"},
+ { "sTitle": "Contact Number"}
+ ];
+});
+
+ClientAdapter.method('getFormFields', function() {
+ if(this.showSave){
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text"}],
+ [ "details", {"label":"Details","type":"textarea","validation":"none"}],
+ [ "address", {"label":"Address","type":"textarea","validation":"none"}],
+ [ "contact_number", {"label":"Contact Number","type":"text","validation":"none"}],
+ [ "contact_email", {"label":"Contact Email","type":"text","validation":"none"}],
+ [ "company_url", {"label":"Company Url","type":"text","validation":"none"}],
+ [ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"]]}],
+ [ "first_contact_date", {"label":"First Contact Date","type":"date","validation":"none"}]
+ ];
+ }else{
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"placeholder"}],
+ [ "details", {"label":"Details","type":"placeholder","validation":"none"}],
+ [ "address", {"label":"Address","type":"placeholder","validation":"none"}],
+ [ "contact_number", {"label":"Contact Number","type":"placeholder","validation":"none"}],
+ [ "contact_email", {"label":"Contact Email","type":"placeholder","validation":"none"}],
+ [ "company_url", {"label":"Company Url","type":"placeholder","validation":"none"}],
+ [ "status", {"label":"Status","type":"placeholder","source":[["Active","Active"],["Inactive","Inactive"]]}],
+ [ "first_contact_date", {"label":"First Contact Date","type":"placeholder","validation":"none"}]
+ ];
+ }
+});
+
+ClientAdapter.method('getHelpLink', function () {
+ return 'http://blog.icehrm.com/?page_id=85';
+});
+
+/**
+ * ProjectAdapter
+ */
+
+function ProjectAdapter(endPoint,tab,filter,orderBy) {
+ this.initAdapter(endPoint,tab,filter,orderBy);
+}
+
+ProjectAdapter.inherits(AdapterBase);
+
+
+
+ProjectAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "client"
+ ];
+});
+
+ProjectAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID","bVisible":false },
+ { "sTitle": "Name" },
+ { "sTitle": "Client"},
+ ];
+});
+
+ProjectAdapter.method('getFormFields', function() {
+ if(this.showSave){
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text"}],
+ [ "client", {"label":"Client","type":"select2","allow-null":true,"remote-source":["Client","id","name"]}],
+ [ "details", {"label":"Details","type":"textarea","validation":"none"}],
+ [ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"]]}]
+ ];
+ }else{
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"placeholder"}],
+ [ "client", {"label":"Client","type":"placeholder","allow-null":true,"remote-source":["Client","id","name"]}],
+ [ "details", {"label":"Details","type":"placeholder","validation":"none"}],
+ [ "status", {"label":"Status","type":"placeholder","source":[["Active","Active"],["Inactive","Inactive"]]}]
+ ];
+ }
+
+});
+
+ProjectAdapter.method('getHelpLink', function () {
+ return 'http://blog.icehrm.com/?page_id=85';
+});
+
+
+/*
+ * EmployeeProjectAdapter
+ */
+
+
+function EmployeeProjectAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeProjectAdapter.inherits(AdapterBase);
+
+
+
+EmployeeProjectAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "employee",
+ "project",
+ "status"
+ ];
+});
+
+EmployeeProjectAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Employee" },
+ { "sTitle": "Project" },
+ /*{ "sTitle": "Start Date"},*/
+ { "sTitle": "Status"}
+ ];
+});
+
+EmployeeProjectAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}],
+ [ "project", {"label":"Project","type":"select2","remote-source":["Project","id","name"]}],
+ /*[ "date_start", {"label":"Start Date","type":"date","validation":""}],
+ [ "date_end", {"label":"End Date","type":"date","validation":"none"}],*/
+ [ "status", {"label":"Status","type":"select","source":[["Current","Current"],["Inactive","Inactive"],["Completed","Completed"]]}],
+ [ "details", {"label":"Details","type":"textarea","validation":"none"}]
+ ];
+});
+
+EmployeeProjectAdapter.method('getFilters', function() {
+ return [
+ [ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}]
+
+ ];
+});
+
+EmployeeProjectAdapter.method('getHelpLink', function () {
+ return 'http://blog.icehrm.com/?page_id=85';
+});
+
diff --git a/ext/admin/projects/meta.json b/ext/admin/projects/meta.json
new file mode 100644
index 00000000..3a566411
--- /dev/null
+++ b/ext/admin/projects/meta.json
@@ -0,0 +1,19 @@
+{
+"label":"Projects/Client Setup",
+"menu":"Admin",
+"order":"5",
+"icon":"fa-list-alt",
+"user_levels":["Admin","Manager"],
+
+"permissions":
+ {
+ "Manager":{
+ "Add Projects":"Yes",
+ "Edit Projects":"Yes",
+ "Delete Projects":"No",
+ "Add Clients":"Yes",
+ "Edit Clients":"Yes",
+ "Delete Clients":"No"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/qualifications/api/QualificationsAdminManager.php b/ext/admin/qualifications/api/QualificationsAdminManager.php
new file mode 100644
index 00000000..f141a999
--- /dev/null
+++ b/ext/admin/qualifications/api/QualificationsAdminManager.php
@@ -0,0 +1,95 @@
+addModelClass('Skill');
+ $this->addModelClass('Education');
+ $this->addModelClass('Certification');
+ $this->addModelClass('Language');
+
+
+ }
+ }
+}
+
+
+if (!class_exists('Skill')) {
+ class Skill extends ICEHRM_Record {
+ var $_table = 'Skills';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+ }
+
+ class Education extends ICEHRM_Record {
+ var $_table = 'Educations';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+ }
+
+ class Certification extends ICEHRM_Record {
+ var $_table = 'Certifications';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+ }
+
+ class Language extends ICEHRM_Record {
+ var $_table = 'Languages';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+ }
+
+}
diff --git a/ext/admin/qualifications/index.php b/ext/admin/qualifications/index.php
new file mode 100644
index 00000000..5bdc338f
--- /dev/null
+++ b/ext/admin/qualifications/index.php
@@ -0,0 +1,127 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'company_structure';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/admin/qualifications/lib.js b/ext/admin/qualifications/lib.js
new file mode 100644
index 00000000..7e0ef265
--- /dev/null
+++ b/ext/admin/qualifications/lib.js
@@ -0,0 +1,161 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+
+/**
+ * SkillAdapter
+ */
+
+function SkillAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+SkillAdapter.inherits(AdapterBase);
+
+
+
+SkillAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "description"
+ ];
+});
+
+SkillAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID","bVisible":false },
+ { "sTitle": "Name" },
+ { "sTitle": "Description"}
+ ];
+});
+
+SkillAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text"}],
+ [ "description", {"label":"Description","type":"textarea","validation":""}]
+ ];
+});
+
+SkillAdapter.method('getHelpLink', function () {
+ return 'http://blog.icehrm.com/?page_id=83';
+});
+
+
+
+/**
+ * EducationAdapter
+ */
+
+function EducationAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EducationAdapter.inherits(AdapterBase);
+
+
+
+EducationAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "description"
+ ];
+});
+
+EducationAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID","bVisible":false },
+ { "sTitle": "Name" },
+ { "sTitle": "Description"}
+ ];
+});
+
+EducationAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text"}],
+ [ "description", {"label":"Description","type":"textarea","validation":""}]
+ ];
+});
+
+
+
+
+
+/**
+ * CertificationAdapter
+ */
+
+function CertificationAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+CertificationAdapter.inherits(AdapterBase);
+
+
+
+CertificationAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "description"
+ ];
+});
+
+CertificationAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Description"}
+ ];
+});
+
+CertificationAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text"}],
+ [ "description", {"label":"Description","type":"textarea","validation":""}]
+ ];
+});
+
+
+
+/**
+ * LanguageAdapter
+ */
+
+function LanguageAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+LanguageAdapter.inherits(AdapterBase);
+
+
+
+LanguageAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "description"
+ ];
+});
+
+LanguageAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Description"}
+ ];
+});
+
+LanguageAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text"}],
+ [ "description", {"label":"Description","type":"textarea","validation":""}]
+ ];
+});
+
diff --git a/ext/admin/qualifications/meta.json b/ext/admin/qualifications/meta.json
new file mode 100644
index 00000000..47ef334e
--- /dev/null
+++ b/ext/admin/qualifications/meta.json
@@ -0,0 +1,26 @@
+{
+"label":"Qualifications Setup",
+"menu":"Admin",
+"order":"4",
+"icon":"fa-check-square-o",
+
+"user_levels":["Admin","Manager"],
+
+"permissions":
+ {
+ "Manager":{
+ "Add Skills":"Yes",
+ "Edit Skills":"Yes",
+ "Delete Skills":"No",
+ "Add Education":"Yes",
+ "Edit Education":"Yes",
+ "Delete Education":"No",
+ "Add Certifications":"Yes",
+ "Edit Certifications":"Yes",
+ "Delete Certifications":"No",
+ "Add Languages":"Yes",
+ "Edit Languages":"Yes",
+ "Delete Languages":"No"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/reports/api/ReportsAdminManager.php b/ext/admin/reports/api/ReportsAdminManager.php
new file mode 100644
index 00000000..35d6a98a
--- /dev/null
+++ b/ext/admin/reports/api/ReportsAdminManager.php
@@ -0,0 +1,23 @@
+
+
+
\ No newline at end of file
diff --git a/ext/admin/reports/lib.js b/ext/admin/reports/lib.js
new file mode 100644
index 00000000..94ac4ec5
--- /dev/null
+++ b/ext/admin/reports/lib.js
@@ -0,0 +1,167 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+
+/**
+ * ReportAdapter
+ */
+
+function ReportAdapter(endPoint) {
+ this.initAdapter(endPoint);
+ this._formFileds = [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"label","validation":""}],
+ [ "parameters", {"label":"Parameters","type":"fieldset","validation":"none"}]
+ ];
+}
+
+ReportAdapter.inherits(AdapterBase);
+
+ReportAdapter.method('_initLocalFormFields', function() {
+ this._formFileds = [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"label","validation":""}],
+ [ "parameters", {"label":"Parameters","type":"fieldset","validation":"none"}]
+ ];
+});
+
+ReportAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "details",
+ "parameters"
+ ];
+});
+
+ReportAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Details"},
+ { "sTitle": "Parameters","bVisible":false},
+ ];
+});
+
+ReportAdapter.method('getFormFields', function() {
+ return this._formFileds;
+});
+
+ReportAdapter.method('processFormFieldsWithObject', function(object) {
+ var that = this;
+ this._initLocalFormFields();
+ var len = this._formFileds.length;
+ var fieldIDsToDelete = [];
+ var fieldsToDelete = [];
+ for(var i=0;iDownload Report ';
+ //this.showMessage("Download Report",link);
+
+ var fileName = serverData[0];
+ var link;
+
+ if(fileName.indexOf("https:") == 0){
+ link = 'Download Report ';
+ }else{
+ link = 'Download Report ';
+ }
+ link = link.replace(/_BASE_/g,this.baseUrl);
+
+ var tableHtml = link+' ';
+
+ //Delete existing temp report table
+ $("#tempReportTable").remove();
+
+ //this.showMessage("Report",tableHtml);
+
+ $("#Report").html(tableHtml);
+ $("#Report").show();
+ $("#ReportForm").hide();
+
+ //Prepare headers
+ var headers = [];
+ for(title in serverData[1]){
+ headers.push({ "sTitle": serverData[1][title]});
+ }
+
+ var data = serverData[2];
+
+
+ var dataTableParams = {
+ "oLanguage": {
+ "sLengthMenu": "_MENU_ records per page"
+ },
+ "aaData": data,
+ "aoColumns": headers,
+ "bSort": false,
+ "iDisplayLength": 15,
+ "iDisplayStart": 0
+ };
+
+ $("#tempReportTable").dataTable( dataTableParams );
+
+ $(".dataTables_paginate ul").addClass("pagination");
+ $(".dataTables_length").hide();
+ $(".dataTables_filter input").addClass("form-control");
+ $(".dataTables_filter input").attr("placeholder","Search");
+ $(".dataTables_filter label").contents().filter(function(){
+ return (this.nodeType == 3);
+ }).remove();
+ $('.tableActionButton').tooltip();
+});
+
+
+ReportAdapter.method('fillForm', function(object) {
+ var fields = this.getFormFields();
+ for(var i=0;i NOW() and joined_date < NOW())";
+ }else{
+ $depts = $this->getChildCompanyStuctures($request['department']);
+ $query = "where department in (".implode(",",$depts).") and (((termination_date = '0001-01-01 00:00:00' or termination_date = '0000-00-00 00:00:00') and joined_date < NOW()) or (termination_date > NOW() and joined_date < NOW()))";
+ }
+
+
+ return array($query, $params);
+ }
+
+ public function getChildCompanyStuctures($companyStructId){
+ $childIds = array();
+ $childIds[] = $companyStructId;
+ $nodeIdsAtLastLevel = $childIds;
+ $count = 0;
+ do{
+ $count++;
+ $companyStructTemp = new CompanyStructure();
+ if(empty($nodeIdsAtLastLevel) || empty($childIds)){
+ break;
+ }
+ $idQuery = "parent in (".implode(",",$nodeIdsAtLastLevel).") and id not in(".implode(",",$childIds).")";
+ LogManager::getInstance()->debug($idQuery);
+ $list = $companyStructTemp->Find($idQuery, array());
+ if(!$list){
+ LogManager::getInstance()->debug($companyStructTemp->ErrorMsg());
+ }
+ $nodeIdsAtLastLevel = array();
+ foreach($list as $item){
+ $childIds[] = $item->id;
+ $nodeIdsAtLastLevel[] = $item->id;
+ }
+ }while(count($list) > 0 && $count < 10);
+
+ return $childIds;
+ }
+
+
+
+}
\ No newline at end of file
diff --git a/ext/admin/reports/reportClasses/EmployeeAttendanceReport.php b/ext/admin/reports/reportClasses/EmployeeAttendanceReport.php
new file mode 100644
index 00000000..df69c214
--- /dev/null
+++ b/ext/admin/reports/reportClasses/EmployeeAttendanceReport.php
@@ -0,0 +1,50 @@
+= ? and out_time <= ? order by in_time desc;";
+ $params = array(
+ $request['date_start']." 00:00:00",
+ $request['date_end']." 23:59:59",
+ );
+ }else{
+ $query = "where in_time >= ? and out_time <= ? order by in_time desc;";
+ $params = array(
+ $request['date_start']." 00:00:00",
+ $request['date_end']." 23:59:59",
+ );
+ }
+
+ LogManager::getInstance()->info("Query:".$query);
+ LogManager::getInstance()->info("Params:".json_encode($params));
+
+ return array($query, $params);
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/reports/reportClasses/EmployeeLeavesReport.php b/ext/admin/reports/reportClasses/EmployeeLeavesReport.php
new file mode 100644
index 00000000..fa33924b
--- /dev/null
+++ b/ext/admin/reports/reportClasses/EmployeeLeavesReport.php
@@ -0,0 +1,70 @@
+= ? and date_end <= ? and status = ?;";
+ $params = array(
+ $request['date_start'],
+ $request['date_end'],
+ $request['status']
+ );
+ }else if(!empty($employeeList)){
+ $query = "where employee in (".implode(",", $employeeList).") and date_start >= ? and date_end <= ?;";
+ $params = array(
+ $request['date_start'],
+ $request['date_end']
+ );
+ }else if(($request['status'] != "NULL" && !empty($request['status']))){
+ $query = "where status = ? and date_start >= ? and date_end <= ?;";
+ $params = array(
+ $request['status'],
+ $request['date_start'],
+ $request['date_end']
+ );
+ }else{
+ $query = "where date_start >= ? and date_end <= ?;";
+ $params = array(
+ $request['date_start'],
+ $request['date_end']
+ );
+ }
+
+ LogManager::getInstance()->info("Query:".$query);
+ LogManager::getInstance()->info("Params:".json_encode($params));
+
+ return array($query, $params);
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/reports/reportClasses/EmployeeTimeTrackReport.php b/ext/admin/reports/reportClasses/EmployeeTimeTrackReport.php
new file mode 100644
index 00000000..07b9785f
--- /dev/null
+++ b/ext/admin/reports/reportClasses/EmployeeTimeTrackReport.php
@@ -0,0 +1,104 @@
+info(json_encode($report));
+ LogManager::getInstance()->info(json_encode($req));
+
+ $employeeTimeEntry = new EmployeeTimeEntry();
+
+ $timeEntryList = $employeeTimeEntry->Find("employee = ? and date(date_start) >= ? and date(date_end) <= ?",array($req['employee'], $req['date_start'], $req['date_end']));
+
+
+ $seconds = 0;
+ $graphTimeArray = array();
+ foreach($timeEntryList as $entry){
+ $seconds = (strtotime($entry->date_end) - strtotime($entry->date_start));
+ $key = date("Y-m-d",strtotime($entry->date_end));
+ if(isset($graphTimeArray[$key])){
+ $graphTimeArray[$key] += $seconds;
+ }else{
+ $graphTimeArray[$key] = $seconds;
+ }
+ }
+
+ //$minutes = (int)($seconds/60);
+
+
+ //Find Attendance Entries
+
+ $attendance = new Attendance();
+ $atteandanceList = $attendance->Find("employee = ? and date(in_time) >= ? and date(out_time) <= ? and in_time < out_time",array($req['employee'], $req['date_start'], $req['date_end']));
+
+ $seconds = 0;
+ $graphAttendanceArray = array();
+ $firstTimeInArray = array();
+ $lastTimeOutArray = array();
+ foreach($atteandanceList as $entry){
+ $seconds = (strtotime($entry->out_time) - strtotime($entry->in_time));
+ $key = date("Y-m-d",strtotime($entry->in_time));
+ if(isset($graphAttendanceArray[$key])){
+ $graphAttendanceArray[$key] += $seconds;
+ $lastTimeOutArray[$key] = $entry->out_time;
+ }else{
+ $graphAttendanceArray[$key] = $seconds;
+ $firstTimeInArray[$key] = $entry->in_time;
+ $lastTimeOutArray[$key] = $entry->out_time;
+ }
+ }
+
+
+ /////////////////////////////////////////
+
+ $employeeObject = new Employee();
+ $employeeObject->Load("id = ?",array($req['employee']));
+
+
+ $reportData = array();
+ //$reportData[] = array($employeeObject->first_name." ".$employeeObject->last_name,"","","","");
+ $reportData[] = array("Date","First Punch-In Time","Last Punch-Out Time","Time in Office","Time in Timesheets");
+
+
+ //Iterate date range
+
+ $interval = DateInterval::createFromDateString('1 day');
+ $period = new DatePeriod(new DateTime($req['date_start']), $interval, new DateTime($req['date_end']));
+
+ foreach ( $period as $dt ){
+ $dataRow = array();
+ $key = $dt->format("Y-m-d");
+
+ $dataRow[] = $key;
+
+ if(isset($firstTimeInArray[$key])){
+ $dataRow[] = $firstTimeInArray[$key];
+ }else{
+ $dataRow[] = "Not Found";
+ }
+
+ if(isset($lastTimeOutArray[$key])){
+ $dataRow[] = $lastTimeOutArray[$key];
+ }else{
+ $dataRow[] = "Not Found";
+ }
+
+ if(isset($graphAttendanceArray[$key])){
+ $dataRow[] = round(($graphAttendanceArray[$key]/3600),2);
+ }else{
+ $dataRow[] = 0;
+ }
+
+ if(isset($graphTimeArray[$key])){
+ $dataRow[] = round(($graphTimeArray[$key]/3600),2);
+ }else{
+ $dataRow[] = 0;
+ }
+
+ $reportData[] = $dataRow;
+ }
+ return $reportData;
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/reports/reportClasses/EmployeeTimesheetReport.php b/ext/admin/reports/reportClasses/EmployeeTimesheetReport.php
new file mode 100644
index 00000000..40751a4e
--- /dev/null
+++ b/ext/admin/reports/reportClasses/EmployeeTimesheetReport.php
@@ -0,0 +1,66 @@
+= ? and date_end <= ? and project = ?;";
+ $params = array(
+ $request['date_start'],
+ $request['date_end'],
+ $request['project']
+ );
+ }else if(!empty($employeeList)){
+ $query = "where employee in (".implode(",", $employeeList).") and date_start >= ? and date_end <= ?;";
+ $params = array(
+ $request['date_start'],
+ $request['date_end']
+ );
+ }else if(($request['project'] != "NULL" && !empty($request['project']))){
+ $query = "where project = ? and date_start >= ? and date_end <= ?;";
+ $params = array(
+ $request['project'],
+ $request['date_start'],
+ $request['date_end']
+ );
+ }else{
+ $query = "where date_start >= ? and date_end <= ?;";
+ $params = array(
+ $request['date_start'],
+ $request['date_end']
+ );
+ }
+
+ LogManager::getInstance()->info("Query:".$query);
+ LogManager::getInstance()->info("Params:".json_encode($params));
+
+ return array($query, $params);
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/reports/reportClasses/NewHiresEmployeeReport.php b/ext/admin/reports/reportClasses/NewHiresEmployeeReport.php
new file mode 100644
index 00000000..57dab491
--- /dev/null
+++ b/ext/admin/reports/reportClasses/NewHiresEmployeeReport.php
@@ -0,0 +1,34 @@
+getChildCompanyStuctures($request['department']);
+ $query.="department in(".implode(",",$depts).") and ";
+ }
+
+ if(empty($request['date_start']) || $request['date_start'] == "NULL"){
+ $request['date_start'] = date("Y-m-d 00:00:00");
+ }
+
+ if(empty($request['date_end']) || $request['date_end'] == "NULL"){
+ $request['date_end'] = date("Y-m-d 23:59:59");
+ }
+
+ $query.="joined_date >= ? ";
+ $params[] = $request['date_start']." 00:00:00";
+
+
+
+ $query.="and joined_date <= ? ";
+ $params[] = $request['date_end']." 23:59:59";
+
+ return array($query, $params);
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/reports/reportClasses/ReportBuilder.php b/ext/admin/reports/reportClasses/ReportBuilder.php
new file mode 100644
index 00000000..47292867
--- /dev/null
+++ b/ext/admin/reports/reportClasses/ReportBuilder.php
@@ -0,0 +1,57 @@
+getMainQuery();
+ $where = $this->getWhereQuery($request);
+ $query.=" ".$where[0];
+ return $this->execute($report, $query, $where[1]);
+ }
+
+ protected function execute($report, $query, $parameters){
+ $report->DB()->SetFetchMode(ADODB_FETCH_ASSOC);
+ LogManager::getInstance()->debug("Query: ".$query);
+ LogManager::getInstance()->debug("Parameters: ".json_encode($parameters));
+ $rs = $report->DB()->Execute($query,$parameters);
+ if(!$rs){
+ LogManager::getInstance()->info($report->DB()->ErrorMsg());
+ return array("ERROR","Error generating report");
+ }
+
+ $reportNamesFilled = false;
+ $columnNames = array();
+ $reportData = array();
+ foreach ($rs as $rowId => $row) {
+ $reportData[] = array();
+ if(!$reportNamesFilled){
+ $countIt = 0;
+ foreach ($row as $name=> $value){
+ $countIt++;
+ $columnNames[$countIt] = $name;
+ $reportData[count($reportData)-1][] = $value;
+ }
+ $reportNamesFilled = true;
+ }else{
+ foreach ($row as $name=> $value){
+ $reportData[count($reportData)-1][] = $this->transformData($name, $value);
+ }
+ }
+ }
+
+
+ array_unshift($reportData,$columnNames);
+
+ return $reportData;
+ }
+
+ abstract public function getWhereQuery($request);
+
+ abstract public function getMainQuery();
+
+ public function transformData($name, $value){
+ return $value;
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/reports/reportClasses/ReportBuilderInterface.php b/ext/admin/reports/reportClasses/ReportBuilderInterface.php
new file mode 100644
index 00000000..474469a1
--- /dev/null
+++ b/ext/admin/reports/reportClasses/ReportBuilderInterface.php
@@ -0,0 +1,4 @@
+getChildCompanyStuctures($request['department']);
+ $query.="department in(".implode(",",$depts).") and ";
+ }
+
+ if(empty($request['date_start']) || $request['date_start'] == "NULL"){
+ $request['date_start'] = date("Y-m-d 00:00:00");
+ }
+
+ if(empty($request['date_end']) || $request['date_end'] == "NULL"){
+ $request['date_end'] = date("Y-m-d 23:59:59");
+ }
+
+ $query.="termination_date >= ? ";
+ $params[] = $request['date_start']." 00:00:00";
+
+
+
+ $query.="and termination_date <= ? ";
+ $params[] = $request['date_end']." 23:59:59";
+
+ return array($query, $params);
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/reports/scripts/reports.sql b/ext/admin/reports/scripts/reports.sql
new file mode 100644
index 00000000..579c62ed
--- /dev/null
+++ b/ext/admin/reports/scripts/reports.sql
@@ -0,0 +1,18 @@
+INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES
+('Active Employee Report', 'This report list employees who are currently active based on joined date and termination date ',
+'[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}]\r\n]',
+ 'ActiveEmployeeReport',
+ '["department"]', 'Class');
+
+
+INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES
+('New Hires Employee Report', 'This report list employees who are joined between given two dates ',
+'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
+ 'NewHiresEmployeeReport',
+ '["department","date_start","date_end"]', 'Class');
+
+INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES
+('Terminated Employee Report', 'This report list employees who are terminated between given two dates ',
+'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
+ 'TerminatedEmployeeReport',
+ '["department","date_start","date_end"]', 'Class');
\ No newline at end of file
diff --git a/ext/admin/reports/templates/fields/label.html b/ext/admin/reports/templates/fields/label.html
new file mode 100644
index 00000000..1b7a7480
--- /dev/null
+++ b/ext/admin/reports/templates/fields/label.html
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/ext/admin/reports/templates/form_template.html b/ext/admin/reports/templates/form_template.html
new file mode 100644
index 00000000..5896e827
--- /dev/null
+++ b/ext/admin/reports/templates/form_template.html
@@ -0,0 +1,14 @@
+
\ No newline at end of file
diff --git a/ext/admin/settings/api/SettingsAdminManager.php b/ext/admin/settings/api/SettingsAdminManager.php
new file mode 100644
index 00000000..4d16ac85
--- /dev/null
+++ b/ext/admin/settings/api/SettingsAdminManager.php
@@ -0,0 +1,23 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+class SettingsInitialize extends AbstractInitialize{
+
+ public function init(){
+ if(SettingsManager::getInstance()->getSetting("Api: REST Api Enabled") == "1"){
+ $user = BaseService::getInstance()->getCurrentUser();
+ $dbUser = new User();
+ $dbUser->Load("id = ?",array($user->id));
+ $resp = RestApiManager::getInstance()->getAccessTokenForUser($dbUser);
+ if($resp->getStatus() != IceResponse::SUCCESS){
+ LogManager::getInstance()->error("Error occured while creating REST Api acces token for ".$user->username);
+ }
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ext/admin/settings/index.php b/ext/admin/settings/index.php
new file mode 100644
index 00000000..85fea88e
--- /dev/null
+++ b/ext/admin/settings/index.php
@@ -0,0 +1,55 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'settings';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/admin/settings/lib.js b/ext/admin/settings/lib.js
new file mode 100644
index 00000000..0098525a
--- /dev/null
+++ b/ext/admin/settings/lib.js
@@ -0,0 +1,67 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+
+/**
+ * SettingAdapter
+ */
+
+function SettingAdapter(endPoint,tab,filter,orderBy) {
+ this.initAdapter(endPoint,tab,filter,orderBy);
+}
+
+SettingAdapter.inherits(AdapterBase);
+
+
+
+SettingAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "value",
+ "description"
+ ];
+});
+
+SettingAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Value"},
+ { "sTitle": "Details"}
+ ];
+});
+
+SettingAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "value", {"label":"Value","type":"text","validation":"none"}]
+ ];
+});
+
+SettingAdapter.method('getActionButtonsHtml', function(id,data) {
+ var html = '';
+ html = html.replace(/_id_/g,id);
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ return html;
+});
+
+
+SettingAdapter.method('getMetaFieldForRendering', function(fieldName) {
+ if(fieldName == "value"){
+ return "meta";
+ }
+ return "";
+});
+
+
+SettingAdapter.method('fillForm', function(object) {
+ this.uber('fillForm',object);
+ $("#helptext").html(object.description);
+});
+
+
+SettingAdapter.method('getHelpLink', function () {
+ return 'http://blog.icehrm.com/?page_id=126';
+});
\ No newline at end of file
diff --git a/ext/admin/settings/meta.json b/ext/admin/settings/meta.json
new file mode 100644
index 00000000..1cb09f75
--- /dev/null
+++ b/ext/admin/settings/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Settings",
+"menu":"System",
+"order":"1",
+"icon":"fa-cogs",
+"user_levels":["Admin"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/settings/templates/form_template.html b/ext/admin/settings/templates/form_template.html
new file mode 100644
index 00000000..f1a029df
--- /dev/null
+++ b/ext/admin/settings/templates/form_template.html
@@ -0,0 +1,16 @@
+
\ No newline at end of file
diff --git a/ext/admin/users/api/UsersActionManager.php b/ext/admin/users/api/UsersActionManager.php
new file mode 100644
index 00000000..18123bb1
--- /dev/null
+++ b/ext/admin/users/api/UsersActionManager.php
@@ -0,0 +1,100 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+class UsersActionManager extends SubActionManager{
+ public function changePassword($req){
+ if($this->user->user_level == 'Admin' || $this->user->id == $req->id){
+ $user = $this->baseService->getElement('User',$req->id);
+ if(empty($user->id)){
+ return new IceResponse(IceResponse::ERROR,"Please save the user first");
+ }
+ $user->password = md5($req->pwd);
+ $ok = $user->Save();
+ if(!$ok){
+ return new IceResponse(IceResponse::ERROR,$user->ErrorMsg());
+ }
+ return new IceResponse(IceResponse::SUCCESS,$user);
+ }
+ return new IceResponse(IceResponse::ERROR);
+ }
+
+ public function saveUser($req){
+ if($this->user->user_level == 'Admin'){
+
+ $user = new User();
+ $user->Load("email = ?",array($req->email));
+
+ if($user->email == $req->email){
+ return new IceResponse(IceResponse::ERROR,"User with same email already exists");
+ }
+
+ $user->Load("username = ?",array($req->username));
+
+ if($user->username == $req->username){
+ return new IceResponse(IceResponse::ERROR,"User with same username already exists");
+ }
+
+ $user = new User();
+ $user->email = $req->email;
+ $user->username = $req->username;
+ $password = $this->generateRandomString(6);
+ $user->password = md5($password);
+ $user->employee = (empty($req->employee) || $req->employee == "NULL" )?NULL:$req->employee;
+ $user->user_level = $req->user_level;
+ $user->last_login = date("Y-m-d H:i:s");
+ $user->last_update = date("Y-m-d H:i:s");
+ $user->created = date("Y-m-d H:i:s");
+
+ $employee = null;
+ if(!empty($user->employee)){
+ $employee = $this->baseService->getElement('Employee',$user->employee,null,true);
+ }
+
+ $ok = $user->Save();
+ if(!$ok){
+ LogManager::getInstance()->info($user->ErrorMsg()."|".json_encode($user));
+ return new IceResponse(IceResponse::ERROR,"Error occured while saving the user");
+ }
+ $user->password = "";
+ $user = $this->baseService->cleanUpAdoDB($user);
+
+ if(!empty($this->emailSender)){
+ $usersEmailSender = new UsersEmailSender($this->emailSender, $this);
+ $usersEmailSender->sendWelcomeUserEmail($user, $password, $employee);
+ }
+ return new IceResponse(IceResponse::SUCCESS,$user);
+ }
+ return new IceResponse(IceResponse::ERROR, "Not Allowed");
+ }
+
+
+ private function generateRandomString($length = 10) {
+ $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ $charactersLength = strlen($characters);
+ $randomString = '';
+ for ($i = 0; $i < $length; $i++) {
+ $randomString .= $characters[rand(0, $charactersLength - 1)];
+ }
+ return $randomString;
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/users/api/UsersAdminManager.php b/ext/admin/users/api/UsersAdminManager.php
new file mode 100644
index 00000000..768df568
--- /dev/null
+++ b/ext/admin/users/api/UsersAdminManager.php
@@ -0,0 +1,56 @@
+addModelClass('User');
+ }
+
+ }
+}
+
+if (!class_exists('User')) {
+ class User extends ICEHRM_Record {
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array();
+ }
+
+
+ public function validateSave($obj){
+ $userTemp = new User();
+
+ if(empty($obj->id)){
+ $users = $userTemp->Find("email = ?",array($obj->email));
+ if(count($users) > 0){
+ return new IceResponse(IceResponse::ERROR,"A user with same authentication email already exist");
+ }
+ }else{
+ $users = $userTemp->Find("email = ? and id <> ?",array($obj->email, $obj->id));
+ if(count($users) > 0){
+ return new IceResponse(IceResponse::ERROR,"A user with same authentication email already exist");
+ }
+ }
+
+ return new IceResponse(IceResponse::SUCCESS,"");
+ }
+
+ var $_table = 'Users';
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/users/api/UsersEmailSender.php b/ext/admin/users/api/UsersEmailSender.php
new file mode 100644
index 00000000..9c932acf
--- /dev/null
+++ b/ext/admin/users/api/UsersEmailSender.php
@@ -0,0 +1,46 @@
+emailSender = $emailSender;
+ $this->subActionManager = $subActionManager;
+ }
+
+ public function sendWelcomeUserEmail($user, $password, $employee = NULL){
+
+ $params = array();
+ if(!empty($employee)){
+ $params['name'] = $employee->first_name." ".$employee->last_name;
+ }else{
+ $params['name'] = $user->username;
+ }
+ $params['url'] = CLIENT_BASE_URL;
+ $params['password'] = $password;
+ $params['email'] = $user->email;
+ $params['username'] = $user->username;
+
+ $email = $this->subActionManager->getEmailTemplate('welcomeUser.html');
+
+
+ $emailTo = null;
+ if(!empty($user)){
+ $emailTo = $user->email;
+ }
+
+
+
+ if(!empty($emailTo)){
+ if(!empty($this->emailSender)){
+ LogManager::getInstance()->info("[sendWelcomeUserEmail] sending email to $emailTo : ".$email);
+ $this->emailSender->sendEmail("Your IceHrm account is ready",$emailTo,$email,$params);
+ }
+ }else{
+ LogManager::getInstance()->info("[sendWelcomeUserEmail] email is empty");
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/ext/admin/users/emailTemplates/welcomeUser.html b/ext/admin/users/emailTemplates/welcomeUser.html
new file mode 100644
index 00000000..d67217b9
--- /dev/null
+++ b/ext/admin/users/emailTemplates/welcomeUser.html
@@ -0,0 +1,17 @@
+Dear #_name_#,
+Your account in IceHrm has been created on #_url_#
+
+Please find your account information below:
+Username: #_username_#
+Email: #_email_# (You can use, username or email to login)
+Password: #_password_# (Strongly advised to change this password once logged in)
+
+
+
+To get started, follow this link: #_url_#
+
+
+THIS IS AN AUTOMATED EMAIL - REPLIES WILL BE SENT TO #_adminEmail_#
+
+
+
\ No newline at end of file
diff --git a/ext/admin/users/index.php b/ext/admin/users/index.php
new file mode 100644
index 00000000..3f6d57bf
--- /dev/null
+++ b/ext/admin/users/index.php
@@ -0,0 +1,57 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'users';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+
+?>
+
+
\ No newline at end of file
diff --git a/ext/admin/users/lib.js b/ext/admin/users/lib.js
new file mode 100644
index 00000000..aaa08749
--- /dev/null
+++ b/ext/admin/users/lib.js
@@ -0,0 +1,162 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+function UserAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+UserAdapter.inherits(AdapterBase);
+
+
+UserAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "username",
+ "email",
+ "employee",
+ "user_level"
+ ];
+});
+
+UserAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" },
+ { "sTitle": "User Name" },
+ { "sTitle": "Authentication Email" },
+ { "sTitle": "Employee"},
+ { "sTitle": "User Level"}
+ ];
+});
+
+UserAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden","validation":""}],
+ [ "username", {"label":"User Name","type":"text","validation":"username"}],
+ [ "email", {"label":"Email","type":"text","validation":"email"}],
+ [ "employee", {"label":"Employee","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
+ [ "user_level", {"label":"User Level","type":"select","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"]]}]
+ ];
+});
+
+UserAdapter.method('postRenderForm', function(object, $tempDomObj) {
+ if(object == null || object == undefined){
+ $tempDomObj.find("#changePasswordBtn").remove();
+ }
+});
+
+UserAdapter.method('changePassword', function() {
+ $('#adminUsersModel').modal('show');
+ $('#adminUsersChangePwd #newpwd').val('');
+ $('#adminUsersChangePwd #conpwd').val('');
+});
+
+UserAdapter.method('saveUserSuccessCallBack', function(callBackData,serverData) {
+ this.showMessage("Create User","An email has been sent to "+callBackData['email']+" with a temporary password to login to IceHrm.");
+ this.get([]);
+});
+
+UserAdapter.method('saveUserFailCallBack', function(callBackData,serverData) {
+ this.showMessage("Error",callBackData);
+});
+
+UserAdapter.method('doCustomValidation', function(params) {
+ var msg = null;
+ if(params['user_level'] != "Admin" && params['employee'] == "NULL"){
+ msg = "For non Admin users, you have to assign an employee when adding or editing the user. ";
+ msg += " You may create a new employee through 'Admin'->'Employees' menu";
+ }
+ return msg;
+});
+
+UserAdapter.method('save', function() {
+ var validator = new FormValidation(this.getTableName()+"_submit",true,{'ShowPopup':false,"LabelErrorClass":"error"});
+ if(validator.checkValues()){
+ var params = validator.getFormParameters();
+
+ var msg = this.doCustomValidation(params);
+ if(msg == null){
+ var id = $('#'+this.getTableName()+"_submit #id").val();
+ if(id != null && id != undefined && id != ""){
+ $(params).attr('id',id);
+ this.add(params,[]);
+ }else{
+
+ var reqJson = JSON.stringify(params);
+
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'saveUserSuccessCallBack';
+ callBackData['callBackFail'] = 'saveUserFailCallBack';
+
+ this.customAction('saveUser','admin=users',reqJson,callBackData);
+ }
+
+ }else{
+ //$("#"+this.getTableName()+'Form .label').html(msg);
+ //$("#"+this.getTableName()+'Form .label').show();
+ this.showMessage("Error Saving User",msg);
+ }
+
+
+
+ }
+});
+
+
+UserAdapter.method('changePasswordConfirm', function() {
+ $('#adminUsersChangePwd_error').hide();
+
+ var passwordValidation = function (str) {
+ var val = /^[a-zA-Z0-9]\w{6,}$/;
+ return str != null && val.test(str);
+ };
+
+ var password = $('#adminUsersChangePwd #newpwd').val();
+
+ if(!passwordValidation(password)){
+ $('#adminUsersChangePwd_error').html("Password may contain only letters, numbers and should be longer than 6 characters");
+ $('#adminUsersChangePwd_error').show();
+ return;
+ }
+
+ var conPassword = $('#adminUsersChangePwd #conpwd').val();
+
+ if(conPassword != password){
+ $('#adminUsersChangePwd_error').html("Passwords don't match");
+ $('#adminUsersChangePwd_error').show();
+ return;
+ }
+
+ var req = {"id":this.currentId,"pwd":conPassword};
+ var reqJson = JSON.stringify(req);
+
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'changePasswordSuccessCallBack';
+ callBackData['callBackFail'] = 'changePasswordFailCallBack';
+
+ this.customAction('changePassword','admin=users',reqJson,callBackData);
+
+});
+
+UserAdapter.method('closeChangePassword', function() {
+ $('#adminUsersModel').modal('hide');
+});
+
+UserAdapter.method('changePasswordSuccessCallBack', function(callBackData,serverData) {
+ this.closeChangePassword();
+ this.showMessage("Password Change","Password changed successfully");
+});
+
+UserAdapter.method('changePasswordFailCallBack', function(callBackData,serverData) {
+ this.closeChangePassword();
+ this.showMessage("Error",callBackData);
+});
+
+UserAdapter.method('getHelpLink', function () {
+ return 'http://blog.icehrm.com/?page_id=132';
+});
+
+
+
diff --git a/ext/admin/users/meta.json b/ext/admin/users/meta.json
new file mode 100644
index 00000000..9d1a901f
--- /dev/null
+++ b/ext/admin/users/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Users",
+"menu":"System",
+"order":"2",
+"icon":"fa-user",
+"user_levels":["Admin"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/admin/users/templates/form_template.html b/ext/admin/users/templates/form_template.html
new file mode 100644
index 00000000..a07f7354
--- /dev/null
+++ b/ext/admin/users/templates/form_template.html
@@ -0,0 +1,55 @@
+
+
+
+
+
diff --git a/ext/modules/attendance/api/AttendanceActionManager.php b/ext/modules/attendance/api/AttendanceActionManager.php
new file mode 100644
index 00000000..91fe67bb
--- /dev/null
+++ b/ext/modules/attendance/api/AttendanceActionManager.php
@@ -0,0 +1,137 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+*/
+
+class AttendanceActionManager extends SubActionManager{
+
+ public function getPunch($req){
+ $date = $req->date;
+ $arr = explode(" ",$date);
+ $date = $arr[0];
+
+ $employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
+
+ //Find any open punch
+ $attendance = new Attendance();
+ $attendance->Load("employee = ? and DATE_FORMAT( in_time, '%Y-%m-%d' ) = ? and (out_time is NULL or out_time = '0000-00-00 00:00:00')",array($employee->id,$date));
+
+ if($attendance->employee == $employee->id){
+ //found an open punch
+ return new IceResponse(IceResponse::SUCCESS,$attendance);
+ }else{
+ return new IceResponse(IceResponse::SUCCESS,null);
+ }
+
+
+ }
+
+
+ public function savePunch($req){
+ $req->date = $req->time;
+
+ /*
+ if(strtotime($req->date) > strtotime($req->cdate)){
+ return new IceResponse(IceResponse::ERROR,"You are not allowed to punch a future time");
+ }
+ */
+
+ //check if there is an open punch
+ $openPunch = $this->getPunch($req)->getData();
+
+ if(empty($openPunch)){
+ $openPunch = new Attendance();
+ }
+
+ $dateTime = $req->date;
+ $arr = explode(" ",$dateTime);
+ $date = $arr[0];
+
+ $currentDateTime = $req->cdate;
+ $arr = explode(" ",$currentDateTime);
+ $currentDate = $arr[0];
+
+ if($currentDate != $date){
+ return new IceResponse(IceResponse::ERROR,"You are not allowed to punch time for a previous date");
+ }
+
+ $employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
+
+ //check if dates are differnet
+ $arr = explode(" ",$openPunch->in_time);
+ $inDate = $arr[0];
+ if(!empty($openPunch->in_time) && $inDate != $date){
+ return new IceResponse(IceResponse::ERROR,"Attendance entry should be within a single day");
+ }
+
+ //compare dates
+ if(!empty($openPunch->in_time) && strtotime($dateTime) <= strtotime($openPunch->in_time)){
+ return new IceResponse(IceResponse::ERROR,"Punch-in time should be lesser than Punch-out time");
+ }
+
+ //Find all punches for the day
+ $attendance = new Attendance();
+ $attendanceList = $attendance->Find("employee = ? and DATE_FORMAT( in_time, '%Y-%m-%d' ) = ?",array($employee->id,$date));
+
+ foreach($attendanceList as $attendance){
+ if(!empty($openPunch->in_time)){
+ if($openPunch->id == $attendance->id){
+ continue;
+ }
+ if(strtotime($attendance->out_time) >= strtotime($dateTime) && strtotime($attendance->in_time) <= strtotime($dateTime)){
+ //-1---0---1---0 || ---0--1---1---0
+ return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one 1");
+ }else if(strtotime($attendance->out_time) >= strtotime($openPunch->in_time) && strtotime($attendance->in_time) <= strtotime($openPunch->in_time)){
+ //---0---1---0---1 || ---0--1---1---0
+ return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one 2");
+ }else if(strtotime($attendance->out_time) <= strtotime($dateTime) && strtotime($attendance->in_time) >= strtotime($openPunch->in_time)){
+ //--1--0---0--1--
+ return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one 3 ".$attendance->id);
+ }
+ }else{
+ if(strtotime($attendance->out_time) >= strtotime($dateTime) && strtotime($attendance->in_time) <= strtotime($dateTime)){
+ //---0---1---0
+ return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one 4");
+ }
+ }
+ }
+ if(!empty($openPunch->in_time)){
+ $openPunch->out_time = $dateTime;
+ $openPunch->note = $req->note;
+ $this->baseService->audit(IceConstants::AUDIT_ACTION, "Punch Out \ time:".$openPunch->out_time);
+ }else{
+ $openPunch->in_time = $dateTime;
+ $openPunch->out_time = '0000-00-00 00:00:00';
+ $openPunch->note = $req->note;
+ $openPunch->employee = $employee->id;
+ $this->baseService->audit(IceConstants::AUDIT_ACTION, "Punch In \ time:".$openPunch->in_time);
+ }
+ $ok = $openPunch->Save();
+
+ if(!$ok){
+ LogManager::getInstance()->info($openPunch->ErrorMsg());
+ return new IceResponse(IceResponse::ERROR,"Error occured while saving attendance");
+ }
+ return new IceResponse(IceResponse::SUCCESS,$openPunch);
+
+ }
+
+}
\ No newline at end of file
diff --git a/ext/modules/attendance/api/AttendanceModulesManager.php b/ext/modules/attendance/api/AttendanceModulesManager.php
new file mode 100644
index 00000000..1f00b20f
--- /dev/null
+++ b/ext/modules/attendance/api/AttendanceModulesManager.php
@@ -0,0 +1,24 @@
+addUserClass("Attendance");
+ }
+ }
+
+ public function initializeFieldMappings(){
+
+ }
+
+ public function initializeDatabaseErrorMappings(){
+
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/attendance/index.php b/ext/modules/attendance/index.php
new file mode 100644
index 00000000..c873bcac
--- /dev/null
+++ b/ext/modules/attendance/index.php
@@ -0,0 +1,70 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'attendance';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
+
+
\ No newline at end of file
diff --git a/ext/modules/attendance/lib.js b/ext/modules/attendance/lib.js
new file mode 100644
index 00000000..fcf7b7e2
--- /dev/null
+++ b/ext/modules/attendance/lib.js
@@ -0,0 +1,236 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function AttendanceAdapter(endPoint,tab,filter,orderBy) {
+ this.initAdapter(endPoint,tab,filter,orderBy);
+ this.punch = null;
+}
+
+AttendanceAdapter.inherits(AdapterBase);
+
+AttendanceAdapter.method('updatePunchButton', function() {
+ this.getPunch('changePunchButtonSuccessCallBack');
+});
+
+
+AttendanceAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "in_time",
+ "out_time",
+ "note"
+ ];
+});
+
+AttendanceAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Time-In" },
+ { "sTitle": "Time-Out"},
+ { "sTitle": "Note"}
+ ];
+});
+
+AttendanceAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "time", {"label":"Time","type":"datetime"}],
+ [ "note", {"label":"Note","type":"textarea","validation":"none"}]
+ ];
+});
+
+
+AttendanceAdapter.method('getCustomTableParams', function() {
+ var that = this;
+ var dataTableParams = {
+ "aoColumnDefs": [
+ {
+ "fnRender": function(data, cell){
+ return that.preProcessRemoteTableData(data, cell, 1)
+ } ,
+ "aTargets": [1]
+ },
+ {
+ "fnRender": function(data, cell){
+ return that.preProcessRemoteTableData(data, cell, 2)
+ } ,
+ "aTargets": [2]
+ },
+ {
+ "fnRender": function(data, cell){
+ return that.preProcessRemoteTableData(data, cell, 3)
+ } ,
+ "aTargets": [3]
+ },
+ {
+ "fnRender": that.getActionButtons,
+ "aTargets": [that.getDataMapping().length]
+ }
+ ]
+ };
+ return dataTableParams;
+});
+
+AttendanceAdapter.method('preProcessRemoteTableData', function(data, cell, id) {
+ if(id == 1){
+ if(cell == '0000-00-00 00:00:00' || cell == "" || cell == undefined || cell == null){
+ return "";
+ }
+ return Date.parse(cell).toString('yyyy MMM d HH:mm ');
+ }else if(id == 2){
+ if(cell == '0000-00-00 00:00:00' || cell == "" || cell == undefined || cell == null){
+ return "";
+ }
+ return Date.parse(cell).toString('MMM d HH:mm ');
+ }else if(id == 3){
+ if(cell != undefined && cell != null){
+ if(cell.length > 20){
+ return cell.substring(0,20)+"..";
+ }
+ }
+ return cell;
+ }
+
+});
+
+
+AttendanceAdapter.method('getActionButtonsHtml', function(id,data) {
+ /*
+ var html = '';
+ html = html.replace(/_id_/g,id);
+ html = html.replace(/_attachment_/g,data[5]);
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ return html;
+ */
+ return "";
+});
+
+AttendanceAdapter.method('getTableTopButtonHtml', function() {
+ if(this.punch == null || this.punch == undefined){
+ return 'Punch-in ';
+ }else{
+ return 'Punch-out ';
+ }
+
+});
+
+
+AttendanceAdapter.method('save', function() {
+ var that = this;
+ var validator = new FormValidation(this.getTableName()+"_submit",true,{'ShowPopup':false,"LabelErrorClass":"error"});
+ if(validator.checkValues()){
+ var params = validator.getFormParameters();
+ params['cdate'] = this.getClientDate(new Date()).toISOString().slice(0, 19).replace('T', ' ');
+ var reqJson = JSON.stringify(params);
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'saveSuccessCallback';
+ callBackData['callBackFail'] = 'getPunchFailCallBack';
+
+ this.customAction('savePunch','modules=attendance',reqJson,callBackData);
+ }
+});
+
+AttendanceAdapter.method('saveSuccessCallback', function(callBackData) {
+ this.punch = callBackData;
+ this.getPunch('changePunchButtonSuccessCallBack');
+ $('#PunchModel').modal('hide');
+ this.get([]);
+});
+
+
+AttendanceAdapter.method('cancel', function() {
+ $('#PunchModel').modal('hide');
+});
+
+AttendanceAdapter.method('showPunchDialog', function() {
+ this.getPunch('showPunchDialogShowPunchSuccessCallBack');
+});
+
+AttendanceAdapter.method('getPunch', function(successCallBack) {
+ var that = this;
+ var object = {};
+
+ object['date'] = this.getClientDate(new Date()).toISOString().slice(0, 19).replace('T', ' ');
+ object['offset'] = this.getClientGMTOffset();
+ var reqJson = JSON.stringify(object);
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = successCallBack;
+ callBackData['callBackFail'] = 'getPunchFailCallBack';
+
+ this.customAction('getPunch','modules=attendance',reqJson,callBackData);
+});
+
+AttendanceAdapter.method('postRenderForm', function(object, $tempDomObj) {
+ $("#Attendance").show();
+});
+
+
+
+AttendanceAdapter.method('showPunchDialogShowPunchSuccessCallBack', function(callBackData) {
+ this.punch = callBackData;
+ $('#PunchModel').modal('show');
+ if(this.punch == null){
+ $('#PunchModel').find("h3").html("Punch Time-in");
+ modJs.renderForm();
+ }else{
+ $('#PunchModel').find("h3").html("Punch Time-out");
+ modJs.renderForm(this.punch);
+ }
+
+ var picker = $('#time_datetime').data('datetimepicker');
+ picker.setLocalDate(new Date());
+});
+
+AttendanceAdapter.method('changePunchButtonSuccessCallBack', function(callBackData) {
+ this.punch = callBackData;
+ if(this.punch == null){
+ $("#punchButton").html('Punch-in ');
+ }else{
+ $("#punchButton").html('Punch-out ');
+ }
+});
+
+AttendanceAdapter.method('getPunchFailCallBack', function(callBackData) {
+ this.showMessage("Error Occured while Time Punch", callBackData);
+});
+
+AttendanceAdapter.method('getClientDate', function (date) {
+
+ var offset = this.getClientGMTOffset();
+ var tzDate = date.addMinutes(offset*60);
+ return tzDate;
+
+});
+
+AttendanceAdapter.method('getClientGMTOffset', function () {
+
+ var rightNow = new Date();
+ var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
+ var temp = jan1.toGMTString();
+ var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
+ var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
+
+ return std_time_offset;
+
+});
diff --git a/ext/modules/attendance/meta.json b/ext/modules/attendance/meta.json
new file mode 100644
index 00000000..4f663c67
--- /dev/null
+++ b/ext/modules/attendance/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Attendance",
+"menu":"Time Management",
+"order":"2",
+"icon":"fa-clock-o",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/dashboard/api/DashboardActionManager.php b/ext/modules/dashboard/api/DashboardActionManager.php
new file mode 100644
index 00000000..c57257e1
--- /dev/null
+++ b/ext/modules/dashboard/api/DashboardActionManager.php
@@ -0,0 +1,76 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+*/
+
+include (APP_BASE_PATH."modules/leaves/api/LeavesActionManager.php");
+
+class DashboardActionManager extends SubActionManager{
+
+ public function getPendingLeaves($req){
+
+ $lam = new LeavesActionManager();
+ $leavePeriod = $lam->getCurrentLeavePeriod(date("Y-m-d H:i:s"), date("Y-m-d H:i:s"));
+
+ $leave = new EmployeeLeave();
+ $pendingLeaves = $leave->Find("status = ? and employee = ?",array("Pending", $this->getCurrentProfileId()));
+
+ return new IceResponse(IceResponse::SUCCESS,count($pendingLeaves));
+
+ }
+
+ public function getLastTimeSheetHours($req){
+ $timeSheet = new EmployeeTimeSheet();
+ $timeSheet->Load("employee = ? order by date_end desc limit 1",array($this->getCurrentProfileId()));
+
+ if(empty($timeSheet->employee)){
+ return new IceResponse(IceResponse::SUCCESS,"0:00");
+ }
+
+ $timeSheetEntry = new EmployeeTimeEntry();
+ $list = $timeSheetEntry->Find("timesheet = ?",array($timeSheet->id));
+
+ $seconds = 0;
+ foreach($list as $entry){
+ $seconds += (strtotime($entry->date_end) - strtotime($entry->date_start));
+ }
+
+ $minutes = (int)($seconds/60);
+ $rem = $minutes % 60;
+ $hours = ($minutes - $rem)/60;
+ if($rem < 10){
+ $rem ="0".$rem;
+ }
+ return new IceResponse(IceResponse::SUCCESS,$hours.":".$rem);
+
+ }
+
+ public function getEmployeeActiveProjects($req){
+ $project = new EmployeeProject();
+ $projects = $project->Find("employee = ? and status =?",array($this->getCurrentProfileId(),'Current'));
+
+
+ return new IceResponse(IceResponse::SUCCESS,count($projects));
+
+ }
+
+
+}
\ No newline at end of file
diff --git a/ext/modules/dashboard/api/DashboardModulesManager.php b/ext/modules/dashboard/api/DashboardModulesManager.php
new file mode 100644
index 00000000..2136d94f
--- /dev/null
+++ b/ext/modules/dashboard/api/DashboardModulesManager.php
@@ -0,0 +1,22 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'dashboard';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
+
+
+
+
+
+
..
+
+ Pending Leaves
+
+
+
+
+
+
+
+
+
+
+
+
+
..
+
+ Hours worked Last Week
+
+
+
+
+
+
+
+
+
+
+
+
+
..
+
+ Active Projects
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ext/modules/dashboard/lib.js b/ext/modules/dashboard/lib.js
new file mode 100644
index 00000000..a14c72d0
--- /dev/null
+++ b/ext/modules/dashboard/lib.js
@@ -0,0 +1,173 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function DashboardAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+DashboardAdapter.inherits(AdapterBase);
+
+
+
+DashboardAdapter.method('getDataMapping', function() {
+ return [];
+});
+
+DashboardAdapter.method('getHeaders', function() {
+ return [];
+});
+
+DashboardAdapter.method('getFormFields', function() {
+ return [];
+});
+
+
+DashboardAdapter.method('get', function(callBackData) {
+});
+
+
+DashboardAdapter.method('getPunch', function() {
+ var that = this;
+ var object = {};
+
+ object['date'] = this.getClientDate(new Date()).toISOString().slice(0, 19).replace('T', ' ');
+ object['offset'] = this.getClientGMTOffset();
+ var reqJson = JSON.stringify(object);
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'getPunchSuccessCallBack';
+ callBackData['callBackFail'] = 'getPunchFailCallBack';
+
+ this.customAction('getPunch','modules=attendance',reqJson,callBackData);
+});
+
+
+
+DashboardAdapter.method('getPunchSuccessCallBack', function(callBackData) {
+ var punch = callBackData;
+ if(punch == null){
+ $("#lastPunchTime").html("Not");
+ $("#punchTimeText").html("Punched In");
+ }else{
+ $("#lastPunchTime").html(Date.parse(punch.in_time).toString('h:mm tt'));
+ $("#punchTimeText").html("Punched In");
+ }
+});
+
+DashboardAdapter.method('getPunchFailCallBack', function(callBackData) {
+
+});
+
+
+DashboardAdapter.method('getPendingLeaves', function() {
+ var that = this;
+ var object = {};
+
+ var reqJson = JSON.stringify(object);
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'getPendingLeavesSuccessCallBack';
+ callBackData['callBackFail'] = 'getPendingLeavesFailCallBack';
+
+ this.customAction('getPendingLeaves','modules=dashboard',reqJson,callBackData);
+});
+
+
+
+DashboardAdapter.method('getPendingLeavesSuccessCallBack', function(callBackData) {
+ var leaveCount = callBackData;
+ $("#pendingLeaveCount").html(leaveCount);
+});
+
+DashboardAdapter.method('getPendingLeavesFailCallBack', function(callBackData) {
+
+});
+
+DashboardAdapter.method('getLastTimeSheetHours', function() {
+ var that = this;
+ var object = {};
+
+ var reqJson = JSON.stringify(object);
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'getLastTimeSheetHoursSuccessCallBack';
+ callBackData['callBackFail'] = 'getLastTimeSheetHoursFailCallBack';
+
+ this.customAction('getLastTimeSheetHours','modules=dashboard',reqJson,callBackData);
+});
+
+
+
+DashboardAdapter.method('getLastTimeSheetHoursSuccessCallBack', function(callBackData) {
+ var hours = callBackData;
+ $("#timeSheetHoursWorked").html(hours);
+});
+
+DashboardAdapter.method('getLastTimeSheetHoursFailCallBack', function(callBackData) {
+
+});
+
+
+
+DashboardAdapter.method('getEmployeeActiveProjects', function() {
+ var that = this;
+ var object = {};
+
+ var reqJson = JSON.stringify(object);
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'getEmployeeActiveProjectsSuccessCallBack';
+ callBackData['callBackFail'] = 'getEmployeeActiveProjectsFailCallBack';
+
+ this.customAction('getEmployeeActiveProjects','modules=dashboard',reqJson,callBackData);
+});
+
+
+
+DashboardAdapter.method('getEmployeeActiveProjectsSuccessCallBack', function(callBackData) {
+ var hours = callBackData;
+ $("#numberOfProjects").html(hours);
+});
+
+DashboardAdapter.method('getEmployeeActiveProjectsFailCallBack', function(callBackData) {
+
+});
+
+DashboardAdapter.method('getClientDate', function (date) {
+
+ var offset = this.getClientGMTOffset();
+ var tzDate = date.addMinutes(offset*60);
+ return tzDate;
+
+});
+
+DashboardAdapter.method('getClientGMTOffset', function () {
+
+ var rightNow = new Date();
+ var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
+ var temp = jan1.toGMTString();
+ var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
+ var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
+
+ return std_time_offset;
+
+});
diff --git a/ext/modules/dashboard/meta.json b/ext/modules/dashboard/meta.json
new file mode 100644
index 00000000..70a5f4a1
--- /dev/null
+++ b/ext/modules/dashboard/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Dashboard",
+"menu":"Personal Information",
+"order":"1",
+"icon":"fa-desktop",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/dependents/api/DependentsModulesManager.php b/ext/modules/dependents/api/DependentsModulesManager.php
new file mode 100644
index 00000000..fd22081d
--- /dev/null
+++ b/ext/modules/dependents/api/DependentsModulesManager.php
@@ -0,0 +1,51 @@
+addUserClass("EmployeeDependent");
+ }
+ }
+
+ public function initializeFieldMappings(){
+
+ }
+
+ public function initializeDatabaseErrorMappings(){
+
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ $this->addModelClass('EmployeeDependent');
+
+ }
+
+ }
+}
+
+
+if (!class_exists('EmployeeDependent')) {
+
+ class EmployeeDependent extends ICEHRM_Record {
+ var $_table = 'EmployeeDependents';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/dependents/index.php b/ext/modules/dependents/index.php
new file mode 100644
index 00000000..080ed763
--- /dev/null
+++ b/ext/modules/dependents/index.php
@@ -0,0 +1,63 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'emergency_contact';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/modules/dependents/lib.js b/ext/modules/dependents/lib.js
new file mode 100644
index 00000000..937b600a
--- /dev/null
+++ b/ext/modules/dependents/lib.js
@@ -0,0 +1,64 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+
+/**
+ * EmployeeDependentAdapter
+ */
+
+function EmployeeDependentAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeDependentAdapter.inherits(AdapterBase);
+
+
+
+EmployeeDependentAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "relationship",
+ "dob",
+ "id_number"
+ ];
+});
+
+EmployeeDependentAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Relationship"},
+ { "sTitle": "Date of Birth"},
+ { "sTitle": "Id Number"}
+ ];
+});
+
+EmployeeDependentAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text","validation":""}],
+ [ "relationship", {"label":"Relationship","type":"select","source":[["Child","Child"],["Spouse","Spouse"],["Parent","Parent"],["Other","Other"]]}],
+ [ "dob", {"label":"Date of Birth","type":"date","validation":""}],
+ [ "id_number", {"label":"Id Number","type":"text","validation":"none"}]
+ ];
+});
diff --git a/ext/modules/dependents/meta.json b/ext/modules/dependents/meta.json
new file mode 100644
index 00000000..959dd3b5
--- /dev/null
+++ b/ext/modules/dependents/meta.json
@@ -0,0 +1,22 @@
+{
+"label":"Dependents",
+"menu":"Personal Information",
+"order":"5",
+"icon":"fa-sliders",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ "Manager":{
+ "Add Dependents":"Yes",
+ "Edit Dependents":"Yes",
+ "Delete Dependents":"Yes"
+ },
+
+ "Employee":{
+ "Add Dependents":"Yes",
+ "Edit Dependents":"Yes",
+ "Delete Dependents":"Yes"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/documents/api/DocumentsModulesManager.php b/ext/modules/documents/api/DocumentsModulesManager.php
new file mode 100644
index 00000000..4848434b
--- /dev/null
+++ b/ext/modules/documents/api/DocumentsModulesManager.php
@@ -0,0 +1,25 @@
+addUserClass("EmployeeDocument");
+ }
+ }
+
+ public function initializeFieldMappings(){
+
+ }
+
+ public function initializeDatabaseErrorMappings(){
+
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/documents/index.php b/ext/modules/documents/index.php
new file mode 100644
index 00000000..80d0e0d4
--- /dev/null
+++ b/ext/modules/documents/index.php
@@ -0,0 +1,64 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'documents';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/modules/documents/lib.js b/ext/modules/documents/lib.js
new file mode 100644
index 00000000..a09d2017
--- /dev/null
+++ b/ext/modules/documents/lib.js
@@ -0,0 +1,90 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function EmployeeDocumentAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeDocumentAdapter.inherits(AdapterBase);
+
+
+
+EmployeeDocumentAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "document",
+ "details",
+ "date_added",
+ "status",
+ "attachment"
+ ];
+});
+
+EmployeeDocumentAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Document" },
+ { "sTitle": "Details" },
+ { "sTitle": "Date Added"},
+ { "sTitle": "Status"},
+ { "sTitle": "Attachment","bVisible":false}
+ ];
+});
+
+EmployeeDocumentAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "document", {"label":"Document","type":"select2","remote-source":["Document","id","name"]}],
+ //[ "date_added", {"label":"Date Added","type":"date","validation":""}],
+ [ "valid_until", {"label":"Valid Until","type":"date","validation":"none"}],
+ [ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"],["Draft","Draft"]]}],
+ [ "details", {"label":"Details","type":"textarea","validation":"none"}],
+ [ "attachment", {"label":"Attachment","type":"fileupload","validation":"none"}]
+ ];
+});
+
+
+EmployeeDocumentAdapter.method('getActionButtonsHtml', function(id,data) {
+ var downloadButton = ' ';
+ var editButton = ' ';
+ var deleteButton = ' ';
+ var html = '_edit__download__delete_
';
+
+ html = html.replace('_download_',downloadButton);
+
+ if(this.showDelete){
+ html = html.replace('_delete_',deleteButton);
+ }else{
+ html = html.replace('_delete_','');
+ }
+
+ if(this.showEdit){
+ html = html.replace('_edit_',editButton);
+ }else{
+ html = html.replace('_edit_','');
+ }
+
+ html = html.replace(/_id_/g,id);
+ html = html.replace(/_attachment_/g,data[5]);
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ return html;
+});
diff --git a/ext/modules/documents/meta.json b/ext/modules/documents/meta.json
new file mode 100644
index 00000000..864b9993
--- /dev/null
+++ b/ext/modules/documents/meta.json
@@ -0,0 +1,22 @@
+{
+"label":"My Documents",
+"menu":"Documents",
+"order":"1",
+"icon":"fa-files-o",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ "Manager":{
+ "Add Documents":"Yes",
+ "Edit Documents":"Yes",
+ "Delete Documents":"Yes"
+ },
+
+ "Employee":{
+ "Add Documents":"Yes",
+ "Edit Documents":"Yes",
+ "Delete Documents":"Yes"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/emergency_contact/api/Emergency_contactModulesManager.php b/ext/modules/emergency_contact/api/Emergency_contactModulesManager.php
new file mode 100644
index 00000000..de097b79
--- /dev/null
+++ b/ext/modules/emergency_contact/api/Emergency_contactModulesManager.php
@@ -0,0 +1,49 @@
+addUserClass("EmergencyContact");
+ }
+ }
+
+ public function initializeFieldMappings(){
+
+ }
+
+ public function initializeDatabaseErrorMappings(){
+
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ $this->addModelClass('EmergencyContact');
+
+ }
+
+ }
+}
+
+if (!class_exists('EmergencyContact')) {
+ class EmergencyContact extends ICEHRM_Record {
+ var $_table = 'EmergencyContacts';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/emergency_contact/index.php b/ext/modules/emergency_contact/index.php
new file mode 100644
index 00000000..afabbd22
--- /dev/null
+++ b/ext/modules/emergency_contact/index.php
@@ -0,0 +1,64 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'emergency_contact';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/modules/emergency_contact/lib.js b/ext/modules/emergency_contact/lib.js
new file mode 100644
index 00000000..3d485d93
--- /dev/null
+++ b/ext/modules/emergency_contact/lib.js
@@ -0,0 +1,63 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+
+function EmergencyContactAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmergencyContactAdapter.inherits(AdapterBase);
+
+
+
+EmergencyContactAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "relationship",
+ "home_phone",
+ "work_phone",
+ "mobile_phone"
+ ];
+});
+
+EmergencyContactAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Relationship"},
+ { "sTitle": "Home Phone"},
+ { "sTitle": "Work Phone"},
+ { "sTitle": "Mobile Phone"}
+ ];
+});
+
+EmergencyContactAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text","validation":""}],
+ [ "relationship", {"label":"Relationship","type":"text","validation":"none"}],
+ [ "home_phone", {"label":"Home Phone","type":"text","validation":"none"}],
+ [ "work_phone", {"label":"Work Phone","type":"text","validation":"none"}],
+ [ "mobile_phone", {"label":"Mobile Phone","type":"text","validation":"none"}]
+ ];
+});
diff --git a/ext/modules/emergency_contact/meta.json b/ext/modules/emergency_contact/meta.json
new file mode 100644
index 00000000..d281fd9d
--- /dev/null
+++ b/ext/modules/emergency_contact/meta.json
@@ -0,0 +1,22 @@
+{
+"label":"Emergency Contacts",
+"menu":"Personal Information",
+"order":"6",
+"icon":"fa-phone-square",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ "Manager":{
+ "Add Emergency Contacts":"Yes",
+ "Edit Emergency Contacts":"Yes",
+ "Delete Emergency Contacts":"Yes"
+ },
+
+ "Employee":{
+ "Add Emergency Contacts":"Yes",
+ "Edit Emergency Contacts":"Yes",
+ "Delete Emergency Contacts":"Yes"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/employees/api/EmployeesActionManager.php b/ext/modules/employees/api/EmployeesActionManager.php
new file mode 100644
index 00000000..b1ef0129
--- /dev/null
+++ b/ext/modules/employees/api/EmployeesActionManager.php
@@ -0,0 +1,80 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+class EmployeesActionManager extends SubActionManager{
+ public function get($req){
+
+ $employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),$req->map,true);
+
+ $subordinate = new Employee();
+ $subordinates = $subordinate->Find("supervisor = ?",array($employee->id));
+ $employee->subordinates = $subordinates;
+
+ $fs = FileService::getInstance();
+ $employee = $fs->updateProfileImage($employee);
+
+ if(!empty($employee->birthday)){
+ $employee->birthday = date("F jS, Y",strtotime($employee->birthday));
+ }
+
+ if(!empty($employee->driving_license_exp_date)){
+ $employee->driving_license_exp_date = date("F jS, Y",strtotime($employee->driving_license_exp_date));
+ }
+
+ if(!empty($employee->joined_date)){
+ $employee->joined_date = date("F jS, Y",strtotime($employee->joined_date));
+ }
+
+
+ if(empty($employee->id)){
+ return new IceResponse(IceResponse::ERROR,$employee);
+ }
+ return new IceResponse(IceResponse::SUCCESS,array($employee,$this->getCurrentProfileId(),$this->user->employee));
+ }
+
+ public function deleteProfileImage($req){
+ if($this->user->user_level == 'Admin' || $this->user->employee == $req->id){
+ $fs = FileService::getInstance();
+ $res = $fs->deleteProfileImage($req->id);
+ return new IceResponse(IceResponse::SUCCESS,$res);
+ }
+ }
+
+ public function changePassword($req){
+
+ if($this->getCurrentProfileId() != $this->user->employee || empty($this->user->employee)){
+ return new IceResponse(IceResponse::ERROR,"You are not allowed to change passwords of other employees");
+ }
+
+ $user = $this->baseService->getElement('User',$this->user->id);
+ if(empty($user->id)){
+ return new IceResponse(IceResponse::ERROR,"Error occured while changing password");
+ }
+ $user->password = md5($req->pwd);
+ $ok = $user->Save();
+ if(!$ok){
+ return new IceResponse(IceResponse::ERROR,$user->ErrorMsg());
+ }
+ return new IceResponse(IceResponse::SUCCESS,$user);
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/employees/api/EmployeesModulesManager.php b/ext/modules/employees/api/EmployeesModulesManager.php
new file mode 100644
index 00000000..b5093ecb
--- /dev/null
+++ b/ext/modules/employees/api/EmployeesModulesManager.php
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Edit Info
+ Upload Profile Image
+ Delete Profile Image
+ Change Password
+
+
+
+
+
+ Employee Id
+
+
+
+ NIC Number
+
+
+
+ EPF/CPF No
+
+
+
+
+
+
+
+
+
+
Personal Information
+
+
+ Driver's License Number
+
+
+
+ Other Id
+
+
+
+ Birth Day
+
+
+
+ Gender
+
+
+
+
+
+
+
+ Nationality
+
+
+
+ Marital Status
+
+
+
+ Joined Date
+
+
+
+
+
+
+
+
+
+
Contact Information
+
+
+ Address 1
+
+
+
+ Address 2
+
+
+
+ City
+
+
+
+ Country
+
+
+
+
+
+
+ Postal Code
+
+
+
+ Home Phone
+
+
+
+ Mobile Phone
+
+
+
+ Work Phone
+
+
+
+
+
+
+ Work Email
+
+
+
+ Private Email
+
+
+
+
+
+
+
+
+
+
Job Details
+
+
+ Job Title
+
+
+
+ Employment Status
+
+
+
+ Supervisor
+
+
+
+ Subordinates
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ext/modules/employees/index.php b/ext/modules/employees/index.php
new file mode 100644
index 00000000..061ebdbf
--- /dev/null
+++ b/ext/modules/employees/index.php
@@ -0,0 +1,66 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'employees';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
+
+
+
\ No newline at end of file
diff --git a/ext/modules/employees/lib.js b/ext/modules/employees/lib.js
new file mode 100644
index 00000000..f0f8d1d5
--- /dev/null
+++ b/ext/modules/employees/lib.js
@@ -0,0 +1,385 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function EmployeeAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeAdapter.inherits(AdapterBase);
+
+this.currentUserId = null;
+
+EmployeeAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "employee_id",
+ "first_name",
+ "last_name",
+ "mobile_phone",
+ "department",
+ "gender",
+ "supervisor"
+ ];
+});
+
+EmployeeAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" },
+ { "sTitle": "Employee Number" },
+ { "sTitle": "First Name" },
+ { "sTitle": "Last Name"},
+ { "sTitle": "Mobile"},
+ { "sTitle": "Department"},
+ { "sTitle": "Gender"},
+ { "sTitle": "Supervisor"}
+ ];
+});
+
+EmployeeAdapter.method('getFormFields', function() {
+
+ var employee_id, ssn_num, employment_status, job_title, pay_grade, joined_date, department, work_email, country;
+
+ if(this.checkPermission("Edit Employee Number") == "Yes"){
+ employee_id = [ "employee_id", {"label":"Employee Number","type":"text","validation":""}];
+ }else{
+ employee_id = [ "employee_id", {"label":"Employee Number","type":"placeholder","validation":""}];
+ }
+
+ if(this.checkPermission("Edit EPF/CPF Number") == "Yes"){
+ ssn_num = [ "ssn_num", {"label":"EPF/CPF/SS No","type":"text","validation":"none"}];
+ }else{
+ ssn_num = [ "ssn_num", {"label":"EPF/CPF/SS No","type":"placeholder","validation":"none"}];
+ }
+
+ if(this.checkPermission("Edit Employment Status") == "Yes"){
+ employment_status = [ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"]}];
+ }else{
+ employment_status = [ "employment_status", {"label":"Employment Status","type":"placeholder","remote-source":["EmploymentStatus","id","name"]}];
+ }
+
+ if(this.checkPermission("Edit Job Title") == "Yes"){
+ job_title = [ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"]}];
+ }else{
+ job_title = [ "job_title", {"label":"Job Title","type":"placeholder","remote-source":["JobTitle","id","name"]}];
+ }
+
+ if(this.checkPermission("Edit Pay Grade") == "Yes"){
+ pay_grade = [ "pay_grade", {"label":"Pay Grade","type":"select2","allow-null":true,"remote-source":["PayGrade","id","name"]}];
+ }else{
+ pay_grade = [ "pay_grade", {"label":"Pay Grade","type":"placeholder","allow-null":true,"remote-source":["PayGrade","id","name"]}];
+ }
+
+ if(this.checkPermission("Edit Joined Date") == "Yes"){
+ joined_date = [ "joined_date", {"label":"Joined Date","type":"date","validation":""}];
+ }else{
+ joined_date = [ "joined_date", {"label":"Joined Date","type":"placeholder","validation":""}];
+ }
+
+ if(this.checkPermission("Edit Department") == "Yes"){
+ department = [ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"]}];
+ }else{
+ department = [ "department", {"label":"Department","type":"placeholder","remote-source":["CompanyStructure","id","title"]}];
+ }
+
+ if(this.checkPermission("Edit Work Email") == "Yes"){
+ work_email = [ "work_email", {"label":"Work Email","type":"text","validation":"email"}];
+ }else{
+ work_email = [ "work_email", {"label":"Work Email","type":"placeholder","validation":"emailOrEmpty"}];
+ }
+
+ if(this.checkPermission("Edit Country") == "Yes"){
+ country = [ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}];
+ }else{
+ country = [ "country", {"label":"Country","type":"placeholder","remote-source":["Country","code","name"]}];
+ }
+
+ return [
+ [ "id", {"label":"ID","type":"hidden","validation":""}],
+ employee_id,
+ [ "first_name", {"label":"First Name","type":"text","validation":""}],
+ [ "middle_name", {"label":"Middle Name","type":"text","validation":"none"}],
+ [ "last_name", {"label":"Last Name","type":"text","validation":""}],
+ [ "nationality", {"label":"Nationality","type":"select2","remote-source":["Nationality","id","name"]}],
+ [ "birthday", {"label":"Date of Birth","type":"date","validation":""}],
+ [ "gender", {"label":"Gender","type":"select","source":[["Male","Male"],["Female","Female"]]}],
+ [ "marital_status", {"label":"Marital Status","type":"select","source":[["Married","Married"],["Single","Single"],["Divorced","Divorced"],["Widowed","Widowed"],["Other","Other"]]}],
+ ssn_num,
+ [ "nic_num", {"label":"NIC","type":"text","validation":"none"}],
+ [ "other_id", {"label":"Other ID","type":"text","validation":"none"}],
+ [ "driving_license", {"label":"Driving License No","type":"text","validation":"none"}],
+ employment_status,
+ job_title,
+ pay_grade,
+ [ "work_station_id", {"label":"Work Station Id","type":"text","validation":"none"}],
+ [ "address1", {"label":"Address Line 1","type":"text","validation":"none"}],
+ [ "address2", {"label":"Address Line 2","type":"text","validation":"none"}],
+ [ "city", {"label":"City","type":"text","validation":"none"}],
+ country,
+ [ "province", {"label":"Province","type":"select2","allow-null":true,"remote-source":["Province","id","name"]}],
+ [ "postal_code", {"label":"Postal/Zip Code","type":"text","validation":"none"}],
+ [ "home_phone", {"label":"Home Phone","type":"text","validation":"none"}],
+ [ "mobile_phone", {"label":"Mobile Phone","type":"text","validation":"none"}],
+ [ "work_phone", {"label":"Work Phone","type":"text","validation":"none"}],
+ work_email,
+ [ "private_email", {"label":"Private Email","type":"text","validation":"emailOrEmpty"}],
+ joined_date,
+ department
+ ];
+});
+
+EmployeeAdapter.method('getSourceMapping' , function() {
+ var k = this.sourceMapping ;
+ k['supervisor'] = ["Employee","id","first_name+last_name"];
+ return k;
+});
+
+
+EmployeeAdapter.method('get', function() {
+ var that = this;
+ var sourceMappingJson = JSON.stringify(this.getSourceMapping());
+
+ var req = {"map":sourceMappingJson};
+ var reqJson = JSON.stringify(req);
+
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'modEmployeeGetSuccessCallBack';
+ callBackData['callBackFail'] = 'modEmployeeGetFailCallBack';
+
+ this.customAction('get','modules=employees',reqJson,callBackData);
+});
+
+EmployeeAdapter.method('deleteProfileImage', function(empId) {
+ var that = this;
+
+ var req = {"id":empId};
+ var reqJson = JSON.stringify(req);
+
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'modEmployeeDeleteProfileImageCallBack';
+ callBackData['callBackFail'] = 'modEmployeeDeleteProfileImageCallBack';
+
+ this.customAction('deleteProfileImage','modules=employees',reqJson,callBackData);
+});
+
+EmployeeAdapter.method('modEmployeeDeleteProfileImageCallBack', function(data) {
+ top.location.href = top.location.href;
+});
+
+EmployeeAdapter.method('modEmployeeGetSuccessCallBack' , function(data) {
+ var currentEmpId = data[1];
+ var userEmpId = data[2];
+ data = data[0];
+ var html = this.getCustomTemplate('myDetails.html');
+
+ html = html.replace(/_id_/g,data.id);
+
+ $("#"+this.getTableName()).html(html);
+ var fields = this.getFormFields();
+ for(var i=0;i ";
+ }
+
+ $("#"+this.getTableName()+" #subordinates").html(subordinates);
+
+ $("#"+this.getTableName()+" #nationality_Name").html(data.nationality_Name);
+ $("#"+this.getTableName()+" #employment_status_Name").html(data.employment_status_Name);
+ $("#"+this.getTableName()+" #job_title_Name").html(data.job_title_Name);
+ $("#"+this.getTableName()+" #country_Name").html(data.country_Name);
+ $("#"+this.getTableName()+" #province_Name").html(data.province_Name);
+ $("#"+this.getTableName()+" #supervisor_Name").html(data.supervisor_Name);
+ $("#"+this.getTableName()+" #department_Name").html(data.department_Name);
+
+ $("#"+this.getTableName()+" #name").html(data.first_name + " " + data.last_name);
+ this.currentUserId = data.id;
+
+ $("#"+this.getTableName()+" #profile_image_"+data.id).attr('src',data.image);
+
+ if(this.checkPermission("Upload/Delete Profile Image") == "No"){
+ $("#employeeUploadProfileImage").remove();
+ $("#employeeDeleteProfileImage").remove();
+ }
+
+ if(this.checkPermission("Edit Employee Details") == "No"){
+ $("#employeeProfileEditInfo").remove();
+ }
+
+ if(currentEmpId != userEmpId){
+ $("#employeeUpdatePassword").remove();
+ }
+
+ this.cancel();
+});
+
+EmployeeAdapter.method('modEmployeeGetFailCallBack' , function(data) {
+
+});
+
+EmployeeAdapter.method('editEmployee' , function() {
+ this.edit(this.currentUserId);
+});
+
+EmployeeAdapter.method('changePassword', function() {
+ $('#adminUsersModel').modal('show');
+ $('#adminUsersChangePwd #newpwd').val('');
+ $('#adminUsersChangePwd #conpwd').val('');
+});
+
+EmployeeAdapter.method('changePasswordConfirm', function() {
+ $('#adminUsersChangePwd_error').hide();
+
+ var passwordValidation = function (str) {
+ var val = /^[a-zA-Z0-9]\w{6,}$/;
+ return str != null && val.test(str);
+ };
+
+ var password = $('#adminUsersChangePwd #newpwd').val();
+
+ if(!passwordValidation(password)){
+ $('#adminUsersChangePwd_error').html("Password may contain only letters, numbers and should be longer than 6 characters");
+ $('#adminUsersChangePwd_error').show();
+ return;
+ }
+
+ var conPassword = $('#adminUsersChangePwd #conpwd').val();
+
+ if(conPassword != password){
+ $('#adminUsersChangePwd_error').html("Passwords don't match");
+ $('#adminUsersChangePwd_error').show();
+ return;
+ }
+
+ var req = {"pwd":conPassword};
+ var reqJson = JSON.stringify(req);
+
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'changePasswordSuccessCallBack';
+ callBackData['callBackFail'] = 'changePasswordFailCallBack';
+
+ this.customAction('changePassword','modules=employees',reqJson,callBackData);
+
+});
+
+EmployeeAdapter.method('closeChangePassword', function() {
+ $('#adminUsersModel').modal('hide');
+});
+
+EmployeeAdapter.method('changePasswordSuccessCallBack', function(callBackData,serverData) {
+ this.closeChangePassword();
+ this.showMessage("Password Change","Password changed successfully");
+});
+
+EmployeeAdapter.method('changePasswordFailCallBack', function(callBackData,serverData) {
+ this.closeChangePassword();
+ this.showMessage("Error",callBackData);
+});
+
+
+
+
+/*
+ * Company Graph
+ */
+
+
+function CompanyGraphAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+CompanyGraphAdapter.inherits(AdapterBase);
+
+
+
+CompanyGraphAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "title",
+ "address",
+ "type",
+ "country",
+ "parent"
+ ];
+});
+
+CompanyGraphAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID","bVisible":false },
+ { "sTitle": "Name" },
+ { "sTitle": "Address"},
+ { "sTitle": "Type"},
+ { "sTitle": "Country", "sClass": "center" },
+ { "sTitle": "Parent Structure"}
+ ];
+});
+
+CompanyGraphAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden","validation":""}],
+ [ "title", {"label":"Name","type":"text","validation":""}],
+ [ "description", {"label":"Details","type":"textarea","validation":""}],
+ [ "address", {"label":"Address","type":"textarea","validation":"none"}],
+ [ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],
+ [ "country", {"label":"Country","type":"select","remote-source":["Country","code","name"]}],
+ [ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}]
+ ];
+});
+
+CompanyGraphAdapter.method('createTable', function(elementId) {
+
+ var sourceData = this.sourceData;
+
+ if(modJs['r'] == undefined || modJs['r'] == null){
+ modJs['r'] = Raphael("CompanyGraph", 800, 1000);
+ }else{
+ return;
+ }
+
+ var r = modJs['r'];
+
+ for(var i=0; i< sourceData.length; i++){
+ sourceData[i].parent = sourceData[i]._original[6];
+ }
+
+ var hierarchy = new HierarchyJs();
+ var nodes = hierarchy.createNodes(sourceData);
+ hierarchy.createHierarchy(nodes, r);
+
+
+});
diff --git a/ext/modules/employees/meta.json b/ext/modules/employees/meta.json
new file mode 100644
index 00000000..bb7e24a7
--- /dev/null
+++ b/ext/modules/employees/meta.json
@@ -0,0 +1,38 @@
+{
+"label":"Basic Information",
+"menu":"Personal Information",
+"order":"2",
+"icon":"fa-user",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ "Manager":{
+ "Edit Employee Number":"No",
+ "Edit EPF/CPF Number":"Yes",
+ "Edit Employment Status":"No",
+ "Edit Job Title":"Yes",
+ "Edit Pay Grade":"Yes",
+ "Edit Joined Date":"Yes",
+ "Edit Department":"Yes",
+ "Edit Work Email":"Yes",
+ "Edit Country":"Yes",
+ "Upload/Delete Profile Image":"Yes",
+ "Edit Employee Details":"Yes"
+ },
+
+ "Employee":{
+ "Edit Employee Number":"No",
+ "Edit EPF/CPF Number":"Yes",
+ "Edit Employment Status":"No",
+ "Edit Job Title":"No",
+ "Edit Pay Grade":"No",
+ "Edit Joined Date":"No",
+ "Edit Department":"No",
+ "Edit Work Email":"No",
+ "Edit Country":"No",
+ "Upload/Delete Profile Image":"Yes",
+ "Edit Employee Details":"Yes"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/loans/api/LoansModulesManager.php b/ext/modules/loans/api/LoansModulesManager.php
new file mode 100644
index 00000000..ecbce81d
--- /dev/null
+++ b/ext/modules/loans/api/LoansModulesManager.php
@@ -0,0 +1,51 @@
+addUserClass("EmployeeCompanyLoan");
+ }
+ }
+
+ public function initializeFieldMappings(){
+
+ }
+
+ public function initializeDatabaseErrorMappings(){
+
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ $this->addModelClass('EmployeeCompanyLoan');
+
+ }
+
+ }
+}
+
+
+if (!class_exists('EmployeeCompanyLoan')) {
+
+ class EmployeeCompanyLoan extends ICEHRM_Record {
+ var $_table = 'EmployeeCompanyLoans';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("get","element");
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/loans/index.php b/ext/modules/loans/index.php
new file mode 100644
index 00000000..4b1b6163
--- /dev/null
+++ b/ext/modules/loans/index.php
@@ -0,0 +1,58 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'loans';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/modules/loans/lib.js b/ext/modules/loans/lib.js
new file mode 100644
index 00000000..148449f3
--- /dev/null
+++ b/ext/modules/loans/lib.js
@@ -0,0 +1,91 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function EmployeeCompanyLoanAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeCompanyLoanAdapter.inherits(AdapterBase);
+
+
+
+EmployeeCompanyLoanAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "loan",
+ "start_date",
+ "period_months",
+ "currency",
+ "amount",
+ "status"
+ ];
+});
+
+EmployeeCompanyLoanAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Loan Type" },
+ { "sTitle": "Loan Start Date"},
+ { "sTitle": "Loan Period (Months)"},
+ { "sTitle": "Currency"},
+ { "sTitle": "Amount"},
+ { "sTitle": "Status"}
+ ];
+});
+
+EmployeeCompanyLoanAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "loan", {"label":"Loan Type","type":"placeholder","remote-source":["CompanyLoan","id","name"]}],
+ [ "start_date", {"label":"Loan Start Date","type":"placeholder","validation":""}],
+ [ "last_installment_date", {"label":"Last Installment Date","type":"placeholder","validation":"none"}],
+ [ "period_months", {"label":"Loan Period (Months)","type":"placeholder","validation":"number"}],
+ [ "currency", {"label":"Currency","type":"placeholder","remote-source":["CurrencyType","id","name"]}],
+ [ "amount", {"label":"Loan Amount","type":"placeholder","validation":"float"}],
+ [ "monthly_installment", {"label":"Monthly Installment","type":"placeholder","validation":"float"}],
+ [ "status", {"label":"Status","type":"placeholder","source":[["Approved","Approved"],["Paid","Paid"],["Suspended","Suspended"]]}],
+ [ "details", {"label":"Details","type":"placeholder","validation":"none"}]
+ ];
+});
+
+
+EmployeeCompanyLoanAdapter.method('getActionButtonsHtml', function(id,data) {
+ var editButton = ' ';
+ var deleteButton = ' ';
+ var html = '_edit__delete_
';
+
+ if(this.showDelete){
+ html = html.replace('_delete_',deleteButton);
+ }else{
+ html = html.replace('_delete_','');
+ }
+
+ if(this.showEdit){
+ html = html.replace('_edit_',editButton);
+ }else{
+ html = html.replace('_edit_','');
+ }
+
+ html = html.replace(/_id_/g,id);
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ return html;
+});
diff --git a/ext/modules/loans/meta.json b/ext/modules/loans/meta.json
new file mode 100644
index 00000000..a80215bb
--- /dev/null
+++ b/ext/modules/loans/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Loans",
+"menu":"Loans",
+"order":"1",
+"icon":"fa-shield",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/meta.json b/ext/modules/meta.json
new file mode 100644
index 00000000..d63106fc
--- /dev/null
+++ b/ext/modules/meta.json
@@ -0,0 +1,9 @@
+{
+"Personal Information":"fa-male",
+"Subordinates":"fa-user",
+"Leaves":"fa-calendar-o",
+"Time Management":"fa-clock-o",
+"Documents":"fa-files-o",
+"Training":"fa-briefcase",
+"Loans":"fa-list-alt"
+}
\ No newline at end of file
diff --git a/ext/modules/projects/api/ProjectsModulesManager.php b/ext/modules/projects/api/ProjectsModulesManager.php
new file mode 100644
index 00000000..97551827
--- /dev/null
+++ b/ext/modules/projects/api/ProjectsModulesManager.php
@@ -0,0 +1,51 @@
+addUserClass("EmployeeProject");
+ }
+ }
+
+ public function initializeFieldMappings(){
+
+ }
+
+ public function initializeDatabaseErrorMappings(){
+
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ $this->addModelClass('EmployeeProject');
+
+ }
+
+ }
+}
+
+
+if (!class_exists('EmployeeProject')) {
+
+ class EmployeeProject extends ICEHRM_Record {
+ var $_table = 'EmployeeProjects';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/projects/index.php b/ext/modules/projects/index.php
new file mode 100644
index 00000000..b403a467
--- /dev/null
+++ b/ext/modules/projects/index.php
@@ -0,0 +1,64 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'projects';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/modules/projects/lib.js b/ext/modules/projects/lib.js
new file mode 100644
index 00000000..63818b15
--- /dev/null
+++ b/ext/modules/projects/lib.js
@@ -0,0 +1,54 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function EmployeeProjectAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeProjectAdapter.inherits(AdapterBase);
+
+
+
+EmployeeProjectAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "project",
+ "status"
+ ];
+});
+
+EmployeeProjectAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Project" },
+ { "sTitle": "Status"}
+ ];
+});
+
+EmployeeProjectAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "project", {"label":"Project","type":"select2","remote-source":["Project","id","name"]}],
+ [ "status", {"label":"Status","type":"select","source":[["Current","Current"],["Inactive","Inactive"],["Completed","Completed"]]}],
+ [ "details", {"label":"Details","type":"textarea","validation":"none"}]
+ ];
+});
diff --git a/ext/modules/projects/meta.json b/ext/modules/projects/meta.json
new file mode 100644
index 00000000..1bc57478
--- /dev/null
+++ b/ext/modules/projects/meta.json
@@ -0,0 +1,22 @@
+{
+"label":"Projects",
+"menu":"Time Management",
+"order":"1",
+"icon":"fa-pencil-square",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ "Manager":{
+ "Add Projects":"Yes",
+ "Edit Projects":"Yes",
+ "Delete Projects":"Yes"
+ },
+
+ "Employee":{
+ "Add Projects":"No",
+ "Edit Projects":"No",
+ "Delete Projects":"No"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/qualifications/api/QualificationsModulesManager.php b/ext/modules/qualifications/api/QualificationsModulesManager.php
new file mode 100644
index 00000000..f39a841c
--- /dev/null
+++ b/ext/modules/qualifications/api/QualificationsModulesManager.php
@@ -0,0 +1,119 @@
+addUserClass("EmployeeSkill");
+ $this->addUserClass("EmployeeEducation");
+ $this->addUserClass("EmployeeCertification");
+ $this->addUserClass("EmployeeLanguage");
+ }
+
+ }
+
+ public function initializeFieldMappings(){
+
+ }
+
+ public function initializeDatabaseErrorMappings(){
+
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ $this->addModelClass('EmployeeSkill');
+ $this->addModelClass('EmployeeEducation');
+ $this->addModelClass('EmployeeCertification');
+ $this->addModelClass('EmployeeLanguage');
+
+
+ }
+
+ }
+}
+
+
+if (!class_exists('EmployeeSkill')) {
+
+ class EmployeeSkill extends ICEHRM_Record {
+ var $_table = 'EmployeeSkills';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+
+ class EmployeeEducation extends ICEHRM_Record {
+ var $_table = 'EmployeeEducations';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+
+ class EmployeeCertification extends ICEHRM_Record {
+ var $_table = 'EmployeeCertifications';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+
+ class EmployeeLanguage extends ICEHRM_Record {
+ var $_table = 'EmployeeLanguages';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/qualifications/index.php b/ext/modules/qualifications/index.php
new file mode 100644
index 00000000..58fc3902
--- /dev/null
+++ b/ext/modules/qualifications/index.php
@@ -0,0 +1,84 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'qualifications';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/modules/qualifications/lib.js b/ext/modules/qualifications/lib.js
new file mode 100644
index 00000000..4b7de574
--- /dev/null
+++ b/ext/modules/qualifications/lib.js
@@ -0,0 +1,200 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function EmployeeSkillAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeSkillAdapter.inherits(AdapterBase);
+
+
+
+EmployeeSkillAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "skill_id",
+ "details"
+ ];
+});
+
+EmployeeSkillAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Skill" },
+ { "sTitle": "Details"}
+ ];
+});
+
+EmployeeSkillAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "skill_id", {"label":"Skill","type":"select2","allow-null":true,"remote-source":["Skill","id","name"]}],
+ [ "details", {"label":"Details","type":"textarea","validation":""}]
+ ];
+});
+
+
+
+
+
+/**
+ * EmployeeEducationAdapter
+ */
+
+function EmployeeEducationAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeEducationAdapter.inherits(AdapterBase);
+
+
+
+EmployeeEducationAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "education_id",
+ "institute",
+ "date_start",
+ "date_end"
+ ];
+});
+
+EmployeeEducationAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID", "bVisible":false},
+ { "sTitle": "Qualification" },
+ { "sTitle": "Institute"},
+ { "sTitle": "Start Date"},
+ { "sTitle": "Completed On"},
+ ];
+});
+
+EmployeeEducationAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "education_id", {"label":"Qualification","type":"select2","allow-null":false,"remote-source":["Education","id","name"]}],
+ [ "institute", {"label":"Institute","type":"text","validation":""}],
+ [ "date_start", {"label":"Start Date","type":"date","validation":"none"}],
+ [ "date_end", {"label":"Completed On","type":"date","validation":"none"}]
+ ];
+});
+
+
+
+
+
+/**
+ * EmployeeCertificationAdapter
+ */
+
+function EmployeeCertificationAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeCertificationAdapter.inherits(AdapterBase);
+
+
+
+EmployeeCertificationAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "certification_id",
+ "institute",
+ "date_start",
+ "date_start"
+ ];
+});
+
+EmployeeCertificationAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID","bVisible":false},
+ { "sTitle": "Certification" },
+ { "sTitle": "Institute"},
+ { "sTitle": "Granted On"},
+ { "sTitle": "Valid Thru"},
+ ];
+});
+
+EmployeeCertificationAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "certification_id", {"label":"Certification","type":"select2","allow-null":false,"remote-source":["Certification","id","name"]}],
+ [ "institute", {"label":"Institute","type":"text","validation":""}],
+ [ "date_start", {"label":"Granted On","type":"date","validation":"none"}],
+ [ "date_end", {"label":"Valid Thru","type":"date","validation":"none"}]
+ ];
+});
+
+
+
+/**
+ * EmployeeLanguageAdapter
+ */
+
+function EmployeeLanguageAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeLanguageAdapter.inherits(AdapterBase);
+
+
+
+EmployeeLanguageAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "language_id",
+ "reading",
+ "speaking",
+ "writing",
+ "understanding"
+ ];
+});
+
+EmployeeLanguageAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID", "bVisible":false },
+ { "sTitle": "Language" },
+ { "sTitle": "Reading"},
+ { "sTitle": "Speaking"},
+ { "sTitle": "Writing"},
+ { "sTitle": "Understanding"}
+ ];
+});
+
+EmployeeLanguageAdapter.method('getFormFields', function() {
+
+ var compArray = [["Elementary Proficiency","Elementary Proficiency"],
+ ["Limited Working Proficiency","Limited Working Proficiency"],
+ ["Professional Working Proficiency","Professional Working Proficiency"],
+ ["Full Professional Proficiency","Full Professional Proficiency"],
+ ["Native or Bilingual Proficiency","Native or Bilingual Proficiency"]];
+
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "language_id", {"label":"Language","type":"select2","allow-null":false,"remote-source":["Language","id","name"]}],
+ [ "reading", {"label":"Reading","type":"select","source":compArray}],
+ [ "speaking", {"label":"Speaking","type":"select","source":compArray}],
+ [ "writing", {"label":"Writing","type":"select","source":compArray}],
+ [ "understanding", {"label":"Understanding","type":"select","source":compArray}]
+ ];
+});
+
diff --git a/ext/modules/qualifications/meta.json b/ext/modules/qualifications/meta.json
new file mode 100644
index 00000000..f3b5c479
--- /dev/null
+++ b/ext/modules/qualifications/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Qualifications",
+"menu":"Personal Information",
+"order":"3",
+"icon":"fa-graduation-cap",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/salary/api/SalaryModulesManager.php b/ext/modules/salary/api/SalaryModulesManager.php
new file mode 100644
index 00000000..511bd876
--- /dev/null
+++ b/ext/modules/salary/api/SalaryModulesManager.php
@@ -0,0 +1,51 @@
+addUserClass("EmployeeSalary");
+ }
+ }
+
+ public function initializeFieldMappings(){
+
+ }
+
+ public function initializeDatabaseErrorMappings(){
+
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ $this->addModelClass('EmployeeSalary');
+
+ }
+
+ }
+}
+
+
+if (!class_exists('EmployeeSalary')) {
+
+ class EmployeeSalary extends ICEHRM_Record {
+ var $_table = 'EmployeeSalary';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/salary/index.php b/ext/modules/salary/index.php
new file mode 100644
index 00000000..4ba94220
--- /dev/null
+++ b/ext/modules/salary/index.php
@@ -0,0 +1,64 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'salary';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/modules/salary/lib.js b/ext/modules/salary/lib.js
new file mode 100644
index 00000000..cae57723
--- /dev/null
+++ b/ext/modules/salary/lib.js
@@ -0,0 +1,62 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function EmployeeSalaryAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+EmployeeSalaryAdapter.inherits(AdapterBase);
+
+
+
+EmployeeSalaryAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "component",
+ "pay_frequency",
+ "currency",
+ "amount",
+ "details"
+ ];
+});
+
+EmployeeSalaryAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Salary Component" },
+ { "sTitle": "Pay Frequency"},
+ { "sTitle": "Currency"},
+ { "sTitle": "Amount"},
+ { "sTitle": "Details"}
+ ];
+});
+
+EmployeeSalaryAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "component", {"label":"Salary Component","type":"select2","remote-source":["SalaryComponent","id","name"]}],
+ [ "pay_frequency", {"label":"Pay Frequency","type":"select","source":[["Hourly","Hourly"],["Daily","Daily"],["Bi Weekly","Bi Weekly"],["Weekly","Weekly"],["Semi Monthly","Semi Monthly"],["Monthly","Monthly"]]}],
+ [ "currency", {"label":"Currency","type":"select","remote-source":["CurrencyType","id","name"]}],
+ [ "amount", {"label":"Amount","type":"text","validation":"float"}],
+ [ "details", {"label":"Details","type":"textarea","validation":"none"}]
+ ];
+});
diff --git a/ext/modules/salary/meta.json b/ext/modules/salary/meta.json
new file mode 100644
index 00000000..1cce4a78
--- /dev/null
+++ b/ext/modules/salary/meta.json
@@ -0,0 +1,22 @@
+{
+"label":"Salary",
+"menu":"Personal Information",
+"order":"4",
+"icon":"fa-calculator",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ "Manager":{
+ "Add Salary":"No",
+ "Edit Salary":"No",
+ "Delete Salary":"No"
+ },
+
+ "Employee":{
+ "Add Salary":"No",
+ "Edit Salary":"No",
+ "Delete Salary":"No"
+ }
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/subordinates/api/SubordinatesModulesManager.php b/ext/modules/subordinates/api/SubordinatesModulesManager.php
new file mode 100644
index 00000000..00c58f9c
--- /dev/null
+++ b/ext/modules/subordinates/api/SubordinatesModulesManager.php
@@ -0,0 +1,23 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'subordinates';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+?>
+
+
\ No newline at end of file
diff --git a/ext/modules/subordinates/lib.js b/ext/modules/subordinates/lib.js
new file mode 100644
index 00000000..c5225e7f
--- /dev/null
+++ b/ext/modules/subordinates/lib.js
@@ -0,0 +1,83 @@
+/**
+ * Author: Thilina Hasantha
+ */
+
+function SubordinateAdapter(endPoint,tab,filter,orderBy) {
+ this.initAdapter(endPoint,tab,filter,orderBy);
+}
+
+SubordinateAdapter.inherits(AdapterBase);
+
+
+
+SubordinateAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "employee_id",
+ "first_name",
+ "last_name",
+ "mobile_phone",
+ "department",
+ "gender",
+ "supervisor"
+ ];
+});
+
+SubordinateAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" },
+ { "sTitle": "Employee Number" },
+ { "sTitle": "First Name" },
+ { "sTitle": "Last Name"},
+ { "sTitle": "Mobile"},
+ { "sTitle": "Department"},
+ { "sTitle": "Gender"},
+ { "sTitle": "Supervisor"}
+ ];
+});
+
+SubordinateAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden","validation":""}],
+ [ "employee_id", {"label":"Employee Number","type":"text","validation":""}],
+ [ "first_name", {"label":"First Name","type":"text","validation":""}],
+ [ "middle_name", {"label":"Middle Name","type":"text","validation":"none"}],
+ [ "last_name", {"label":"Last Name","type":"text","validation":""}],
+ [ "nationality", {"label":"Nationality","type":"select2","remote-source":["Nationality","id","name"]}],
+ [ "birthday", {"label":"Date of Birth","type":"date","validation":""}],
+ [ "gender", {"label":"Gender","type":"select","source":[["Male","Male"],["Female","Female"]]}],
+ [ "marital_status", {"label":"Marital Status","type":"select","source":[["Married","Married"],["Single","Single"],["Divorced","Divorced"],["Widowed","Widowed"],["Other","Other"]]}],
+ [ "ssn_num", {"label":"SSN/NRIC","type":"text","validation":"none"}],
+ [ "nic_num", {"label":"NIC","type":"text","validation":"none"}],
+ [ "other_id", {"label":"Other ID","type":"text","validation":"none"}],
+ [ "driving_license", {"label":"Driving License No","type":"text","validation":"none"}],
+ /*[ "driving_license_exp_date", {"label":"License Exp Date","type":"date","validation":"none"}],*/
+ [ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"]}],
+ [ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"]}],
+ [ "pay_grade", {"label":"Pay Grade","type":"select2","allow-null":true,"remote-source":["PayGrade","id","name"]}],
+ [ "work_station_id", {"label":"Work Station Id","type":"text","validation":"none"}],
+ [ "address1", {"label":"Address Line 1","type":"text","validation":"none"}],
+ [ "address2", {"label":"Address Line 2","type":"text","validation":"none"}],
+ [ "city", {"label":"City","type":"text","validation":"none"}],
+ [ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}],
+ [ "province", {"label":"Province","type":"select2","allow-null":true,"remote-source":["Province","id","name"]}],
+ [ "postal_code", {"label":"Postal/Zip Code","type":"text","validation":"none"}],
+ [ "home_phone", {"label":"Home Phone","type":"text","validation":"none"}],
+ [ "mobile_phone", {"label":"Mobile Phone","type":"text","validation":"none"}],
+ [ "work_phone", {"label":"Work Phone","type":"text","validation":"none"}],
+ [ "work_email", {"label":"Work Email","type":"text","validation":"email"}],
+ [ "private_email", {"label":"Private Email","type":"text","validation":"email"}],
+ [ "joined_date", {"label":"Joined Date","type":"date","validation":"none"}],
+ [ "confirmation_date", {"label":"Confirmation Date","type":"date","validation":"none"}],
+ [ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"]}],
+ [ "supervisor", {"label":"Supervisor","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}]
+ ];
+});
+
+SubordinateAdapter.method('getActionButtonsHtml', function(id) {
+ var html = '';
+ html = html.replace(/_id_/g,id);
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ return html;
+});
+
diff --git a/ext/modules/subordinates/meta.json b/ext/modules/subordinates/meta.json
new file mode 100644
index 00000000..7711b282
--- /dev/null
+++ b/ext/modules/subordinates/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Subordinates",
+"menu":"Subordinates",
+"order":"1",
+"icon":"fa-users",
+"user_levels":["Admin","Manager"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/time_sheets/api/Time_sheetsActionManager.php b/ext/modules/time_sheets/api/Time_sheetsActionManager.php
new file mode 100644
index 00000000..ff66e214
--- /dev/null
+++ b/ext/modules/time_sheets/api/Time_sheetsActionManager.php
@@ -0,0 +1,165 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+class Time_sheetsActionManager extends SubActionManager{
+ public function getTimeEntries($req){
+ $employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
+ $timeSheetEntry = new EmployeeTimeEntry();
+ $list = $timeSheetEntry->Find("timesheet = ? order by date_start",array($req->id));
+ $mappingStr = $req->sm;
+ $map = json_decode($mappingStr);
+ if(!$list){
+ LogManager::getInstance()->info($timeSheetEntry->ErrorMsg());
+ }
+
+ if(!empty($mappingStr)){
+ $list = $this->baseService->populateMapping($list,$map);
+ }
+ return new IceResponse(IceResponse::SUCCESS,$list);
+ }
+
+ public function changeTimeSheetStatus($req){
+ $employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
+
+ $subordinate = new Employee();
+ $subordinates = $subordinate->Find("supervisor = ?",array($employee->id));
+
+ $subordinatesIds = array();
+ foreach($subordinates as $sub){
+ $subordinatesIds[] = $sub->id;
+ }
+
+
+ $timeSheet = new EmployeeTimeSheet();
+ $timeSheet->Load("id = ?",array($req->id));
+ if($timeSheet->id != $req->id){
+ return new IceResponse(IceResponse::ERROR,"Timesheet not found");
+ }
+
+ if($req->status == 'Submitted' && $employee->id == $timeSheet->employee){
+
+ }else if(!in_array($timeSheet->employee, $subordinatesIds) && $this->user->user_level != 'Admin'){
+ return new IceResponse(IceResponse::ERROR,"This Timesheet does not belong to any of your subordinates");
+ }
+
+ $oldStatus = $timeSheet->status;
+ $timeSheet->status = $req->status;
+
+ if($oldStatus == $req->status){
+ return new IceResponse(IceResponse::SUCCESS,"");
+ }
+
+ $ok = $timeSheet->Save();
+ if(!$ok){
+ LogManager::getInstance()->info($timeSheet->ErrorMsg());
+ }
+
+
+ $timeSheetEmployee = $this->baseService->getElement('Employee',$timeSheet->employee,null,true);
+
+
+ $this->baseService->audit(IceConstants::AUDIT_ACTION, "Timesheet [".$timeSheetEmployee->first_name." ".$timeSheetEmployee->last_name." - ".date("M d, Y (l)",strtotime($timeSheet->date_start))." to ".date("M d, Y (l)",strtotime($timeSheet->date_end))."] status changed from:".$oldStatus." to:".$req->status);
+
+ if($timeSheet->status == "Submitted" && $employee->id == $timeSheet->employee){
+ $notificationMsg = $employee->first_name." ".$employee->last_name." submitted timesheet from ".date("M d, Y (l)",strtotime($timeSheet->date_start))." to ".date("M d, Y (l)",strtotime($timeSheet->date_end));
+ $this->baseService->notificationManager->addNotification($employee->supervisor,$notificationMsg,'{"type":"url","url":"g=modules&n=time_sheets&m=module_Time_Management#tabSubEmployeeTimeSheetAll"}',IceConstants::NOTIFICATION_TIMESHEET);
+
+ }else if($timeSheet->status == "Approved" || $timeSheet->status == "Rejected"){
+ $notificationMsg = $employee->first_name." ".$employee->last_name." ".$timeSheet->status." timesheet from ".date("M d, Y (l)",strtotime($timeSheet->date_start))." to ".date("M d, Y (l)",strtotime($timeSheet->date_end));
+ $this->baseService->notificationManager->addNotification($timeSheet->employee,$notificationMsg,'{"type":"url","url":"g=modules&n=time_sheets&m=module_Time_Management#tabEmployeeTimeSheetApproved"}',IceConstants::NOTIFICATION_TIMESHEET);
+ }
+
+
+ return new IceResponse(IceResponse::SUCCESS,"");
+ }
+
+ public function createPreviousTimesheet($req){
+ $employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
+
+
+
+ $timeSheet = new EmployeeTimeSheet();
+ $timeSheet->Load("id = ?",array($req->id));
+ if($timeSheet->id != $req->id){
+ return new IceResponse(IceResponse::ERROR,"Timesheet not found");
+ }
+
+ if($timeSheet->employee != $employee->id){
+ return new IceResponse(IceResponse::ERROR,"You don't have permissions to add this Timesheet");
+ }
+
+ $end = date("Y-m-d", strtotime("last Saturday", strtotime($timeSheet->date_start)));
+ $start = date("Y-m-d", strtotime("last Sunday", strtotime($end)));
+
+ $tempTimeSheet = new EmployeeTimeSheet();
+ $tempTimeSheet->Load("employee = ? and date_start = ?",array($employee->id, $start));
+ if($employee->id == $tempTimeSheet->employee){
+ return new IceResponse(IceResponse::ERROR,"Timesheet already exists");
+ }
+
+ $newTimeSheet = new EmployeeTimeSheet();
+ $newTimeSheet->employee = $employee->id;
+ $newTimeSheet->date_start = $start;
+ $newTimeSheet->date_end = $end;
+ $newTimeSheet->status = "Pending";
+ $ok = $newTimeSheet->Save();
+ if(!$ok){
+ LogManager::getInstance()->info("Error creating time sheet : ".$newTimeSheet->ErrorMsg());
+ return new IceResponse(IceResponse::ERROR,"Error creating Timesheet");
+ }
+
+
+ return new IceResponse(IceResponse::SUCCESS,"");
+ }
+
+ public function getSubEmployeeTimeSheets($req){
+
+ $employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
+
+ $subordinate = new Employee();
+ $subordinates = $subordinate->Find("supervisor = ?",array($employee->id));
+
+ $subordinatesIds = "";
+ foreach($subordinates as $sub){
+ if($subordinatesIds != ""){
+ $subordinatesIds.=",";
+ }
+ $subordinatesIds.=$sub->id;
+ }
+ $subordinatesIds.="";
+
+
+ $mappingStr = $req->sm;
+ $map = json_decode($mappingStr);
+ $timeSheet = new EmployeeTimeSheet();
+ $list = $timeSheet->Find("employee in (".$subordinatesIds.")",array());
+ if(!$list){
+ LogManager::getInstance()->info($timeSheet->ErrorMsg());
+ }
+ if(!empty($mappingStr)){
+ $list = $this->baseService->populateMapping($list,$map);
+ }
+
+ return new IceResponse(IceResponse::SUCCESS,$list);
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/time_sheets/api/Time_sheetsInitialize.php b/ext/modules/time_sheets/api/Time_sheetsInitialize.php
new file mode 100644
index 00000000..5e3157c7
--- /dev/null
+++ b/ext/modules/time_sheets/api/Time_sheetsInitialize.php
@@ -0,0 +1,67 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+class Time_sheetsInitialize extends AbstractInitialize{
+
+ public function init(){
+ //Add Employee time sheets if it is not already created for current week
+ $empId = $this->getCurrentProfileId();
+ if(date('w', strtotime("now")) == 0) {
+ $start = date("Y-m-d", strtotime("now"));
+ }else{
+ $start = date("Y-m-d", strtotime("last Sunday"));
+ }
+
+ if(date('w', strtotime("now")) == 6) {
+ $end = date("Y-m-d", strtotime("now"));
+ }else{
+ $end = date("Y-m-d", strtotime("next Saturday"));
+ }
+
+
+
+ $timeSheet = new EmployeeTimeSheet();
+ $timeSheet->Load("employee = ? and date_start = ? and date_end = ?",array($empId,$start,$end));
+ if($timeSheet->date_start == $start && $timeSheet->employee == $empId){
+
+ }else{
+ if(!empty($empId)){
+ $timeSheet->employee = $empId;
+ $timeSheet->date_start = $start;
+ $timeSheet->date_end = $end;
+ $timeSheet->status = "Pending";
+ $ok = $timeSheet->Save();
+ if(!$ok){
+ LogManager::getInstance()->info("Error creating time sheet : ".$timeSheet->ErrorMsg());
+ }
+ }
+
+ }
+
+
+ //Generate missing timesheets
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/ext/modules/time_sheets/api/Time_sheetsModulesManager.php b/ext/modules/time_sheets/api/Time_sheetsModulesManager.php
new file mode 100644
index 00000000..df57ae83
--- /dev/null
+++ b/ext/modules/time_sheets/api/Time_sheetsModulesManager.php
@@ -0,0 +1,82 @@
+addUserClass("EmployeeTimeSheet");
+ $this->addUserClass("EmployeeTimeEntry");
+ }
+
+ public function initializeFieldMappings(){
+
+ }
+
+ public function initializeDatabaseErrorMappings(){
+
+ }
+
+ public function setupModuleClassDefinitions(){
+
+ $this->addModelClass('EmployeeTimeSheet');
+ $this->addModelClass('EmployeeTimeEntry');
+
+ }
+
+ }
+}
+
+if (!class_exists('EmployeeTimeSheet')) {
+
+ class EmployeeTimeSheet extends ICEHRM_Record {
+ var $_table = 'EmployeeTimeSheets';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get","element");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+ }
+
+ class EmployeeTimeEntry extends ICEHRM_Record {
+ var $_table = 'EmployeeTimeEntry';
+
+ public function getAdminAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getManagerAccess(){
+ return array("get","element","save","delete");
+ }
+
+ public function getUserAccess(){
+ return array("get");
+ }
+
+ public function getUserOnlyMeAccess(){
+ return array("element","save","delete");
+ }
+
+ public function validateSave($obj){
+ if(SettingsManager::getInstance()->getSetting("Attendance: Time-sheet Cross Check") == "1"){
+ $attendance = new Attendance();
+ $list = $attendance->Find("employee = ? and in_time <= ? and out_time >= ?",array($obj->employee,$obj->date_start,$obj->date_end));
+ if(empty($list) || count($list) == 0){
+ return new IceResponse(IceResponse::ERROR,"The time entry can not be added since you have not marked attendance for selected period");
+ }
+ }
+ return new IceResponse(IceResponse::SUCCESS,"");
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/ext/modules/time_sheets/customTemplates/time_entry_form.html b/ext/modules/time_sheets/customTemplates/time_entry_form.html
new file mode 100644
index 00000000..78468dc5
--- /dev/null
+++ b/ext/modules/time_sheets/customTemplates/time_entry_form.html
@@ -0,0 +1,19 @@
+
+
diff --git a/ext/modules/time_sheets/index.php b/ext/modules/time_sheets/index.php
new file mode 100644
index 00000000..4739fe82
--- /dev/null
+++ b/ext/modules/time_sheets/index.php
@@ -0,0 +1,163 @@
+.
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+$moduleName = 'employee_TimeSheet';
+define('MODULE_PATH',dirname(__FILE__));
+include APP_BASE_PATH.'header.php';
+include APP_BASE_PATH.'modulejslibs.inc.php';
+
+
+//custom code
+$employeeProjects = array();
+$allowAllProjects = $settingsManager->getSetting("Projects: Make All Projects Available to Employees");
+if($allowAllProjects == 0){
+ $employeeProjects = array();
+ $employeeProjectsTemp = $baseService->get("EmployeeProject");
+ foreach($employeeProjectsTemp as $p){
+ $project = new Project();
+ $project->Load("id = ?",$p->project);
+ $p->name = $project->name;
+ $employeeProjects[] = $p;
+ }
+}else{
+ $employeeProjects = $baseService->get("Project");
+}
+
+
+?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ext/modules/time_sheets/lib.js b/ext/modules/time_sheets/lib.js
new file mode 100644
index 00000000..efae5e5d
--- /dev/null
+++ b/ext/modules/time_sheets/lib.js
@@ -0,0 +1,696 @@
+/*
+This file is part of iCE Hrm.
+
+iCE Hrm is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+iCE Hrm is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with iCE Hrm. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+function EmployeeTimeSheetAdapter(endPoint,tab,filter,orderBy) {
+ this.initAdapter(endPoint,tab,filter,orderBy);
+}
+
+EmployeeTimeSheetAdapter.inherits(AdapterBase);
+
+this.currentTimesheetId = null;
+this.currentTimesheet = null;
+
+EmployeeTimeSheetAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "date_start",
+ "date_end",
+ "status"
+ ];
+});
+
+EmployeeTimeSheetAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Start Date"},
+ { "sTitle": "End Date"},
+ { "sTitle": "Status"}
+ ];
+});
+
+EmployeeTimeSheetAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "date_start", {"label":"TimeSheet Start Date","type":"date","validation":""}],
+ [ "date_end", {"label":"TimeSheet End Date","type":"date","validation":""}],
+ [ "details", {"label":"Reason","type":"textarea","validation":"none"}]
+ ];
+});
+
+EmployeeTimeSheetAdapter.method('preProcessTableData', function(row) {
+ row[1] = Date.parse(row[1]).toString('MMM d, yyyy (dddd)');
+ row[2] = Date.parse(row[2]).toString('MMM d, yyyy (dddd)');
+ return row;
+});
+
+EmployeeTimeSheetAdapter.method('renderForm', function(object) {
+ var formHtml = this.templates['formTemplate'];
+ var html = "";
+
+ $("#"+this.getTableName()+'Form').html(formHtml);
+ $("#"+this.getTableName()+'Form').show();
+ $("#"+this.getTableName()).hide();
+
+ $('#timesheet_start').html(Date.parse(object.date_start).toString('MMM d, yyyy (dddd)'));
+ $('#timesheet_end').html(Date.parse(object.date_end).toString('MMM d, yyyy (dddd)'));
+
+ this.currentTimesheet = object;
+
+ this.getTimeEntries();
+
+});
+
+
+EmployeeTimeSheetAdapter.method('openTimeEntryDialog', function() {
+ this.currentTimesheetId = this.currentId;
+ var obj = modJsList['tabEmployeeTimeEntry'];
+ $('#TimeEntryModel').modal({
+ backdrop: 'static',
+ keyboard: false
+ });
+ obj.currentTimesheet = this.currentTimesheet;
+ obj.renderForm();
+ obj.timesheetId = this.currentId;
+
+});
+
+EmployeeTimeSheetAdapter.method('closeTimeEntryDialog', function() {
+ $('#TimeEntryModel').modal('hide');
+});
+
+
+EmployeeTimeSheetAdapter.method('getTimeEntries', function() {
+ timesheetId = this.currentId;
+ var sourceMappingJson = JSON.stringify(modJsList['tabEmployeeTimeEntry'].getSourceMapping());
+ object = {"id":timesheetId,"sm":sourceMappingJson};
+
+ var reqJson = JSON.stringify(object);
+
+ var callBackData = [];
+ callBackData['callBackData'] = [];
+ callBackData['callBackSuccess'] = 'getTimeEntriesSuccessCallBack';
+ callBackData['callBackFail'] = 'getTimeEntriesFailCallBack';
+
+ this.customAction('getTimeEntries','modules=time_sheets',reqJson,callBackData);
+});
+
+EmployeeTimeSheetAdapter.method('getTimeEntriesSuccessCallBack', function(callBackData) {
+ var entries = callBackData;
+ var html = "";
+ var temp = '_start_ _end_ _duration_ _project_ _details_ ';
+
+ for(var i=0;i';
+
+
+ html = html.replace(/_id_/g,id);
+ html = html.replace(/_BASE_/g,this.baseUrl);
+ html = html.replace(/_status_/g,data[3]);
+ return html;
+});
+
+
+SubEmployeeTimeSheetAdapter.method('getCustomTableParams', function() {
+ var that = this;
+ var dataTableParams = {
+ "aoColumnDefs": [
+ {
+ "fnRender": function(data, cell){
+ return that.preProcessRemoteTableData(data, cell, 2)
+ } ,
+ "aTargets": [2]
+ },
+ {
+ "fnRender": function(data, cell){
+ return that.preProcessRemoteTableData(data, cell, 3)
+ } ,
+ "aTargets": [3]
+ },
+ {
+ "fnRender": that.getActionButtons,
+ "aTargets": [that.getDataMapping().length]
+ }
+ ]
+ };
+ return dataTableParams;
+});
+
+
+/**
+ * EmployeeTimeEntryAdapter
+ */
+
+function EmployeeTimeEntryAdapter(endPoint,tab,filter,orderBy) {
+ this.initAdapter(endPoint,tab,filter,orderBy);
+}
+
+EmployeeTimeEntryAdapter.inherits(AdapterBase);
+
+this.timesheetId = null;
+this.currentTimesheet = null;
+this.allProjectsAllowed = 1;
+this.employeeProjects = [];
+
+EmployeeTimeEntryAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "project",
+ "date_start",
+ "time_start",
+ "date_end",
+ "time_end",
+ "details"
+ ];
+});
+
+EmployeeTimeEntryAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Project"},
+ { "sTitle": "Start Date"},
+ { "sTitle": "Start Time"},
+ { "sTitle": "End Date"},
+ { "sTitle": "End Time"},
+ { "sTitle": "Details"}
+ ];
+});
+
+EmployeeTimeEntryAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "project", {"label":"Project","type":"select2","allow-null":true,"remote-source":["Project","id","name"]}],
+ //[ "project", {"label":"Project","type":"select","source":[]}],
+ [ "date_select", {"label":"Date","type":"select","source":[]}],
+ [ "date_start", {"label":"Start Time","type":"time","validation":""}],
+ /*[ "time_start", {"label":"Start Time","type":"time"}],*/
+ [ "date_end", {"label":"End Time","type":"time","validation":""}],
+ /*[ "time_end", {"label":"End Time","type":"time"}],*/
+ [ "details", {"label":"Details","type":"textarea","validation":""}]
+ ];
+});
+
+/*
+EmployeeTimeEntryAdapter.method('renderForm', function(object) {
+ var formHtml = this.templates['orig_formTemplate'];
+ formHtml = formHtml.replace(/modJs/g,"modJsList['tabEmployeeTimeEntry']");
+ var html = "";
+ var fields = this.getFormFields();
+ for(var i=0;i'+datesArray[i].toString("d-MMM-yyyy")+'';
+ }
+
+
+
+ formHtml = formHtml.replace(/_id_/g,this.getTableName()+"_submit");
+ formHtml = formHtml.replace(/_fields_/g,html);
+ $("#"+this.getTableName()+'Form').html(formHtml);
+ $("#"+this.getTableName()+'Form').show();
+ $("#"+this.getTableName()).hide();
+
+ $("#"+this.getTableName()+'Form .datefield').datepicker({'viewMode':2});
+ $("#"+this.getTableName()+'Form .datetimefield').datetimepicker({
+ language: 'en'
+ });
+ $("#"+this.getTableName()+'Form .timefield').datetimepicker({
+ language: 'en',
+ pickDate: false
+ });
+
+ $("#"+this.getTableName()+'Form .select2Field').select2();
+
+ $("#date_select").html(optionList);
+
+ var projectOptionList = "";
+ projectOptionList += 'None ';
+ if(this.allProjectsAllowed == 0){
+ for(var i=0;i'+this.employeeProjects[i].name+'';
+ }
+ }else{
+ for(var i=0;i'+this.employeeProjects[i].name+'';
+ }
+ }
+
+ $("#project").html(projectOptionList);
+
+ if(object != undefined && object != null){
+ this.fillForm(object);
+ }
+});
+
+
+EmployeeTimeEntryAdapter.method('cancel', function() {
+ $('#TimeEntryModel').modal('hide');
+});
+
+EmployeeTimeEntryAdapter.method('setAllProjectsAllowed', function(allProjectsAllowed) {
+ this.allProjectsAllowed = allProjectsAllowed;
+});
+
+EmployeeTimeEntryAdapter.method('setEmployeeProjects', function(employeeProjects) {
+ this.employeeProjects = employeeProjects;
+});
+
+/*
+EmployeeTimeEntryAdapter.method('save', function() {
+ var validator = new FormValidation(this.getTableName()+"_submit",true,{'ShowPopup':false,"LabelErrorClass":"error"});
+
+ if(validator.checkValues()){
+ var params = validator.getFormParameters();
+ params.date_end = params.date_start;
+ $(params).attr('timesheet',this.timesheetId);
+
+ if(params.time_start.indexOf("am") != -1 && params.time_start.indexOf("12:") != -1){
+ params.time_start = params.time_start.replace("12:","00:");
+ }
+
+ if(params.time_end.indexOf("am") != -1 && params.time_end.indexOf("12:") != -1){
+ params.time_end = params.time_end.replace("12:","00:");
+ }
+
+ params.date_start = Date.parse(params.date_start+" "+params.time_start.replace('am',' AM').replace('pm',' PM')).toString("yyyy-MM-dd HH:mm:ss");
+ params.date_end = Date.parse(params.date_end+" "+params.time_end.replace('am',' AM').replace('pm',' PM')).toString("yyyy-MM-dd HH:mm:ss");
+ var msg = this.doCustomValidation(params);
+
+ if(msg == null){
+ var id = $('#'+this.getTableName()+"_submit #id").val();
+ if(id != null && id != undefined && id != ""){
+ $(params).attr('id',id);
+ }
+ this.add(params,[]);
+ this.cancel();
+ }else{
+ $("#"+this.getTableName()+'Form .label').html(msg);
+ $("#"+this.getTableName()+'Form .label').show();
+ }
+
+ }
+});
+*/
+
+EmployeeTimeEntryAdapter.method('save', function() {
+ var validator = new FormValidation(this.getTableName()+"_submit",true,{'ShowPopup':false,"LabelErrorClass":"error"});
+
+ if(validator.checkValues()){
+ var params = validator.getFormParameters();
+ $(params).attr('timesheet',this.timesheetId);
+
+ params.time_start = params.date_start;
+ params.time_end = params.date_end;
+
+ params.date_start = params.date_select+" "+params.date_start;
+ params.date_end = params.date_select+" "+params.date_end;
+
+
+ var msg = this.doCustomValidation(params);
+
+ if(msg == null){
+ var id = $('#'+this.getTableName()+"_submit #id").val();
+ if(id != null && id != undefined && id != ""){
+ $(params).attr('id',id);
+ }
+ this.add(params,[]);
+ this.cancel();
+ }else{
+ $("#"+this.getTableName()+'Form .label').html(msg);
+ $("#"+this.getTableName()+'Form .label').show();
+ }
+
+ }
+});
+
+EmployeeTimeEntryAdapter.method('doCustomValidation', function(params) {
+ var st = Date.parse(params.date_start.replace(" ","T"));
+ var et = Date.parse(params.date_end.replace(" ","T"));
+ if(st.compareTo(et) != -1){
+ return "Start time should be less than End time";
+ }
+ /*
+ var sd = Date.parse(this.currentTimesheet.date_start);
+ var ed = Date.parse(this.currentTimesheet.date_end).addDays(1);
+
+ if(sd.compareTo(et) != -1 || sd.compareTo(st) > 0 || st.compareTo(ed) != -1 || et.compareTo(ed) != -1){
+ return "Start time and end time shoud be with in " + sd.toString('MMM d, yyyy (dddd)') + " and " + ed.toString('MMM d, yyyy (dddd)');
+ }
+ */
+ return null;
+});
+
+EmployeeTimeEntryAdapter.method('addSuccessCallBack', function(callBackData,serverData) {
+ this.get(callBackData);
+ modJs.getTimeEntries();
+});
+
+EmployeeTimeEntryAdapter.method('deleteRow', function(id) {
+ this.deleteObj(id,[]);
+
+});
+
+EmployeeTimeEntryAdapter.method('deleteSuccessCallBack', function(callBackData,serverData) {
+ modJs.getTimeEntries();
+});
\ No newline at end of file
diff --git a/ext/modules/time_sheets/meta.json b/ext/modules/time_sheets/meta.json
new file mode 100644
index 00000000..e0149e17
--- /dev/null
+++ b/ext/modules/time_sheets/meta.json
@@ -0,0 +1,11 @@
+{
+"label":"Time Sheets",
+"menu":"Time Management",
+"order":"3",
+"icon":"fa-check-circle-o",
+"user_levels":["Admin","Manager","Employee"],
+
+"permissions":
+ {
+ }
+}
\ No newline at end of file
diff --git a/ext/modules/time_sheets/templates/form_template.html b/ext/modules/time_sheets/templates/form_template.html
new file mode 100644
index 00000000..d979b513
--- /dev/null
+++ b/ext/modules/time_sheets/templates/form_template.html
@@ -0,0 +1,23 @@
+
\ No newline at end of file
diff --git a/lib/Mail.php b/lib/Mail.php
new file mode 100644
index 00000000..4347dc5f
--- /dev/null
+++ b/lib/Mail.php
@@ -0,0 +1,270 @@
+
+ * @copyright 1997-2010 Chuck Hagenbuch
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version CVS: $Id: Mail.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @link http://pear.php.net/package/Mail/
+ */
+
+//require_once 'PEAR.php';
+
+/**
+ * PEAR's Mail:: interface. Defines the interface for implementing
+ * mailers under the PEAR hierarchy, and provides supporting functions
+ * useful in multiple mailer backends.
+ *
+ * @access public
+ * @version $Revision: 294747 $
+ * @package Mail
+ */
+class Mail
+{
+ /**
+ * Line terminator used for separating header lines.
+ * @var string
+ */
+ var $sep = "\r\n";
+
+ /**
+ * Provides an interface for generating Mail:: objects of various
+ * types
+ *
+ * @param string $driver The kind of Mail:: object to instantiate.
+ * @param array $params The parameters to pass to the Mail:: object.
+ * @return object Mail a instance of the driver class or if fails a PEAR Error
+ * @access public
+ */
+ function &factory($driver, $params = array())
+ {
+ $driver = strtolower($driver);
+ @include_once 'Mail/' . $driver . '.php';
+ $class = 'Mail_' . $driver;
+ if (class_exists($class)) {
+ $mailer = new $class($params);
+ return $mailer;
+ } else {
+ return PEAR::raiseError('Unable to find class for driver ' . $driver);
+ }
+ }
+
+ /**
+ * Implements Mail::send() function using php's built-in mail()
+ * command.
+ *
+ * @param mixed $recipients Either a comma-seperated list of recipients
+ * (RFC822 compliant), or an array of recipients,
+ * each RFC822 valid. This may contain recipients not
+ * specified in the headers, for Bcc:, resending
+ * messages, etc.
+ *
+ * @param array $headers The array of headers to send with the mail, in an
+ * associative array, where the array key is the
+ * header name (ie, 'Subject'), and the array value
+ * is the header value (ie, 'test'). The header
+ * produced from those values would be 'Subject:
+ * test'.
+ *
+ * @param string $body The full text of the message body, including any
+ * Mime parts, etc.
+ *
+ * @return mixed Returns true on success, or a PEAR_Error
+ * containing a descriptive error message on
+ * failure.
+ *
+ * @access public
+ * @deprecated use Mail_mail::send instead
+ */
+ function send($recipients, $headers, $body)
+ {
+ if (!is_array($headers)) {
+ return PEAR::raiseError('$headers must be an array');
+ }
+
+ $result = $this->_sanitizeHeaders($headers);
+ if (is_a($result, 'PEAR_Error')) {
+ return $result;
+ }
+
+ // if we're passed an array of recipients, implode it.
+ if (is_array($recipients)) {
+ $recipients = implode(', ', $recipients);
+ }
+
+ // get the Subject out of the headers array so that we can
+ // pass it as a seperate argument to mail().
+ $subject = '';
+ if (isset($headers['Subject'])) {
+ $subject = $headers['Subject'];
+ unset($headers['Subject']);
+ }
+
+ // flatten the headers out.
+ list(, $text_headers) = Mail::prepareHeaders($headers);
+
+ return mail($recipients, $subject, $body, $text_headers);
+ }
+
+ /**
+ * Sanitize an array of mail headers by removing any additional header
+ * strings present in a legitimate header's value. The goal of this
+ * filter is to prevent mail injection attacks.
+ *
+ * @param array $headers The associative array of headers to sanitize.
+ *
+ * @access private
+ */
+ function _sanitizeHeaders(&$headers)
+ {
+ foreach ($headers as $key => $value) {
+ $headers[$key] =
+ preg_replace('=((||0x0A/%0A|0x0D/%0D|\\n|\\r)\S).*=i',
+ null, $value);
+ }
+ }
+
+ /**
+ * Take an array of mail headers and return a string containing
+ * text usable in sending a message.
+ *
+ * @param array $headers The array of headers to prepare, in an associative
+ * array, where the array key is the header name (ie,
+ * 'Subject'), and the array value is the header
+ * value (ie, 'test'). The header produced from those
+ * values would be 'Subject: test'.
+ *
+ * @return mixed Returns false if it encounters a bad address,
+ * otherwise returns an array containing two
+ * elements: Any From: address found in the headers,
+ * and the plain text version of the headers.
+ * @access private
+ */
+ function prepareHeaders($headers)
+ {
+ $lines = array();
+ $from = null;
+
+ foreach ($headers as $key => $value) {
+ if (strcasecmp($key, 'From') === 0) {
+ include_once 'Mail/RFC822.php';
+ $parser = new Mail_RFC822();
+ $addresses = $parser->parseAddressList($value, 'localhost', false);
+ if (is_a($addresses, 'PEAR_Error')) {
+ return $addresses;
+ }
+
+ $from = $addresses[0]->mailbox . '@' . $addresses[0]->host;
+
+ // Reject envelope From: addresses with spaces.
+ if (strstr($from, ' ')) {
+ return false;
+ }
+
+ $lines[] = $key . ': ' . $value;
+ } elseif (strcasecmp($key, 'Received') === 0) {
+ $received = array();
+ if (is_array($value)) {
+ foreach ($value as $line) {
+ $received[] = $key . ': ' . $line;
+ }
+ }
+ else {
+ $received[] = $key . ': ' . $value;
+ }
+ // Put Received: headers at the top. Spam detectors often
+ // flag messages with Received: headers after the Subject:
+ // as spam.
+ $lines = array_merge($received, $lines);
+ } else {
+ // If $value is an array (i.e., a list of addresses), convert
+ // it to a comma-delimited string of its elements (addresses).
+ if (is_array($value)) {
+ $value = implode(', ', $value);
+ }
+ $lines[] = $key . ': ' . $value;
+ }
+ }
+
+ return array($from, join($this->sep, $lines));
+ }
+
+ /**
+ * Take a set of recipients and parse them, returning an array of
+ * bare addresses (forward paths) that can be passed to sendmail
+ * or an smtp server with the rcpt to: command.
+ *
+ * @param mixed Either a comma-seperated list of recipients
+ * (RFC822 compliant), or an array of recipients,
+ * each RFC822 valid.
+ *
+ * @return mixed An array of forward paths (bare addresses) or a PEAR_Error
+ * object if the address list could not be parsed.
+ * @access private
+ */
+ function parseRecipients($recipients)
+ {
+ include_once 'Mail/RFC822.php';
+
+ // if we're passed an array, assume addresses are valid and
+ // implode them before parsing.
+ if (is_array($recipients)) {
+ $recipients = implode(', ', $recipients);
+ }
+
+ // Parse recipients, leaving out all personal info. This is
+ // for smtp recipients, etc. All relevant personal information
+ // should already be in the headers.
+ $addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false);
+
+ // If parseAddressList() returned a PEAR_Error object, just return it.
+ if (is_a($addresses, 'PEAR_Error')) {
+ return $addresses;
+ }
+
+ $recipients = array();
+ if (is_array($addresses)) {
+ foreach ($addresses as $ob) {
+ $recipients[] = $ob->mailbox . '@' . $ob->host;
+ }
+ }
+
+ return $recipients;
+ }
+
+}
diff --git a/lib/Mail/RFC822.php b/lib/Mail/RFC822.php
new file mode 100644
index 00000000..58d36465
--- /dev/null
+++ b/lib/Mail/RFC822.php
@@ -0,0 +1,951 @@
+
+ * @author Chuck Hagenbuch (A comment), ted@example.com (Ted Bloggs), Barney;';
+ * $structure = Mail_RFC822::parseAddressList($address_string, 'example.com', true)
+ * print_r($structure);
+ *
+ * @author Richard Heyes
+ * @author Chuck Hagenbuch
+ * @version $Revision: 294749 $
+ * @license BSD
+ * @package Mail
+ */
+class Mail_RFC822 {
+
+ /**
+ * The address being parsed by the RFC822 object.
+ * @var string $address
+ */
+ var $address = '';
+
+ /**
+ * The default domain to use for unqualified addresses.
+ * @var string $default_domain
+ */
+ var $default_domain = 'localhost';
+
+ /**
+ * Should we return a nested array showing groups, or flatten everything?
+ * @var boolean $nestGroups
+ */
+ var $nestGroups = true;
+
+ /**
+ * Whether or not to validate atoms for non-ascii characters.
+ * @var boolean $validate
+ */
+ var $validate = true;
+
+ /**
+ * The array of raw addresses built up as we parse.
+ * @var array $addresses
+ */
+ var $addresses = array();
+
+ /**
+ * The final array of parsed address information that we build up.
+ * @var array $structure
+ */
+ var $structure = array();
+
+ /**
+ * The current error message, if any.
+ * @var string $error
+ */
+ var $error = null;
+
+ /**
+ * An internal counter/pointer.
+ * @var integer $index
+ */
+ var $index = null;
+
+ /**
+ * The number of groups that have been found in the address list.
+ * @var integer $num_groups
+ * @access public
+ */
+ var $num_groups = 0;
+
+ /**
+ * A variable so that we can tell whether or not we're inside a
+ * Mail_RFC822 object.
+ * @var boolean $mailRFC822
+ */
+ var $mailRFC822 = true;
+
+ /**
+ * A limit after which processing stops
+ * @var int $limit
+ */
+ var $limit = null;
+
+ /**
+ * Sets up the object. The address must either be set here or when
+ * calling parseAddressList(). One or the other.
+ *
+ * @access public
+ * @param string $address The address(es) to validate.
+ * @param string $default_domain Default domain/host etc. If not supplied, will be set to localhost.
+ * @param boolean $nest_groups Whether to return the structure with groups nested for easier viewing.
+ * @param boolean $validate Whether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance.
+ *
+ * @return object Mail_RFC822 A new Mail_RFC822 object.
+ */
+ function Mail_RFC822($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null)
+ {
+ if (isset($address)) $this->address = $address;
+ if (isset($default_domain)) $this->default_domain = $default_domain;
+ if (isset($nest_groups)) $this->nestGroups = $nest_groups;
+ if (isset($validate)) $this->validate = $validate;
+ if (isset($limit)) $this->limit = $limit;
+ }
+
+ /**
+ * Starts the whole process. The address must either be set here
+ * or when creating the object. One or the other.
+ *
+ * @access public
+ * @param string $address The address(es) to validate.
+ * @param string $default_domain Default domain/host etc.
+ * @param boolean $nest_groups Whether to return the structure with groups nested for easier viewing.
+ * @param boolean $validate Whether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance.
+ *
+ * @return array A structured array of addresses.
+ */
+ function parseAddressList($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null)
+ {
+ if (!isset($this) || !isset($this->mailRFC822)) {
+ $obj = new Mail_RFC822($address, $default_domain, $nest_groups, $validate, $limit);
+ return $obj->parseAddressList();
+ }
+
+ if (isset($address)) $this->address = $address;
+ if (isset($default_domain)) $this->default_domain = $default_domain;
+ if (isset($nest_groups)) $this->nestGroups = $nest_groups;
+ if (isset($validate)) $this->validate = $validate;
+ if (isset($limit)) $this->limit = $limit;
+
+ $this->structure = array();
+ $this->addresses = array();
+ $this->error = null;
+ $this->index = null;
+
+ // Unfold any long lines in $this->address.
+ $this->address = preg_replace('/\r?\n/', "\r\n", $this->address);
+ $this->address = preg_replace('/\r\n(\t| )+/', ' ', $this->address);
+
+ while ($this->address = $this->_splitAddresses($this->address));
+
+ if ($this->address === false || isset($this->error)) {
+ require_once 'PEAR.php';
+ return PEAR::raiseError($this->error);
+ }
+
+ // Validate each address individually. If we encounter an invalid
+ // address, stop iterating and return an error immediately.
+ foreach ($this->addresses as $address) {
+ $valid = $this->_validateAddress($address);
+
+ if ($valid === false || isset($this->error)) {
+ require_once 'PEAR.php';
+ return PEAR::raiseError($this->error);
+ }
+
+ if (!$this->nestGroups) {
+ $this->structure = array_merge($this->structure, $valid);
+ } else {
+ $this->structure[] = $valid;
+ }
+ }
+
+ return $this->structure;
+ }
+
+ /**
+ * Splits an address into separate addresses.
+ *
+ * @access private
+ * @param string $address The addresses to split.
+ * @return boolean Success or failure.
+ */
+ function _splitAddresses($address)
+ {
+ if (!empty($this->limit) && count($this->addresses) == $this->limit) {
+ return '';
+ }
+
+ if ($this->_isGroup($address) && !isset($this->error)) {
+ $split_char = ';';
+ $is_group = true;
+ } elseif (!isset($this->error)) {
+ $split_char = ',';
+ $is_group = false;
+ } elseif (isset($this->error)) {
+ return false;
+ }
+
+ // Split the string based on the above ten or so lines.
+ $parts = explode($split_char, $address);
+ $string = $this->_splitCheck($parts, $split_char);
+
+ // If a group...
+ if ($is_group) {
+ // If $string does not contain a colon outside of
+ // brackets/quotes etc then something's fubar.
+
+ // First check there's a colon at all:
+ if (strpos($string, ':') === false) {
+ $this->error = 'Invalid address: ' . $string;
+ return false;
+ }
+
+ // Now check it's outside of brackets/quotes:
+ if (!$this->_splitCheck(explode(':', $string), ':')) {
+ return false;
+ }
+
+ // We must have a group at this point, so increase the counter:
+ $this->num_groups++;
+ }
+
+ // $string now contains the first full address/group.
+ // Add to the addresses array.
+ $this->addresses[] = array(
+ 'address' => trim($string),
+ 'group' => $is_group
+ );
+
+ // Remove the now stored address from the initial line, the +1
+ // is to account for the explode character.
+ $address = trim(substr($address, strlen($string) + 1));
+
+ // If the next char is a comma and this was a group, then
+ // there are more addresses, otherwise, if there are any more
+ // chars, then there is another address.
+ if ($is_group && substr($address, 0, 1) == ','){
+ $address = trim(substr($address, 1));
+ return $address;
+
+ } elseif (strlen($address) > 0) {
+ return $address;
+
+ } else {
+ return '';
+ }
+
+ // If you got here then something's off
+ return false;
+ }
+
+ /**
+ * Checks for a group at the start of the string.
+ *
+ * @access private
+ * @param string $address The address to check.
+ * @return boolean Whether or not there is a group at the start of the string.
+ */
+ function _isGroup($address)
+ {
+ // First comma not in quotes, angles or escaped:
+ $parts = explode(',', $address);
+ $string = $this->_splitCheck($parts, ',');
+
+ // Now we have the first address, we can reliably check for a
+ // group by searching for a colon that's not escaped or in
+ // quotes or angle brackets.
+ if (count($parts = explode(':', $string)) > 1) {
+ $string2 = $this->_splitCheck($parts, ':');
+ return ($string2 !== $string);
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * A common function that will check an exploded string.
+ *
+ * @access private
+ * @param array $parts The exloded string.
+ * @param string $char The char that was exploded on.
+ * @return mixed False if the string contains unclosed quotes/brackets, or the string on success.
+ */
+ function _splitCheck($parts, $char)
+ {
+ $string = $parts[0];
+
+ for ($i = 0; $i < count($parts); $i++) {
+ if ($this->_hasUnclosedQuotes($string)
+ || $this->_hasUnclosedBrackets($string, '<>')
+ || $this->_hasUnclosedBrackets($string, '[]')
+ || $this->_hasUnclosedBrackets($string, '()')
+ || substr($string, -1) == '\\') {
+ if (isset($parts[$i + 1])) {
+ $string = $string . $char . $parts[$i + 1];
+ } else {
+ $this->error = 'Invalid address spec. Unclosed bracket or quotes';
+ return false;
+ }
+ } else {
+ $this->index = $i;
+ break;
+ }
+ }
+
+ return $string;
+ }
+
+ /**
+ * Checks if a string has unclosed quotes or not.
+ *
+ * @access private
+ * @param string $string The string to check.
+ * @return boolean True if there are unclosed quotes inside the string,
+ * false otherwise.
+ */
+ function _hasUnclosedQuotes($string)
+ {
+ $string = trim($string);
+ $iMax = strlen($string);
+ $in_quote = false;
+ $i = $slashes = 0;
+
+ for (; $i < $iMax; ++$i) {
+ switch ($string[$i]) {
+ case '\\':
+ ++$slashes;
+ break;
+
+ case '"':
+ if ($slashes % 2 == 0) {
+ $in_quote = !$in_quote;
+ }
+ // Fall through to default action below.
+
+ default:
+ $slashes = 0;
+ break;
+ }
+ }
+
+ return $in_quote;
+ }
+
+ /**
+ * Checks if a string has an unclosed brackets or not. IMPORTANT:
+ * This function handles both angle brackets and square brackets;
+ *
+ * @access private
+ * @param string $string The string to check.
+ * @param string $chars The characters to check for.
+ * @return boolean True if there are unclosed brackets inside the string, false otherwise.
+ */
+ function _hasUnclosedBrackets($string, $chars)
+ {
+ $num_angle_start = substr_count($string, $chars[0]);
+ $num_angle_end = substr_count($string, $chars[1]);
+
+ $this->_hasUnclosedBracketsSub($string, $num_angle_start, $chars[0]);
+ $this->_hasUnclosedBracketsSub($string, $num_angle_end, $chars[1]);
+
+ if ($num_angle_start < $num_angle_end) {
+ $this->error = 'Invalid address spec. Unmatched quote or bracket (' . $chars . ')';
+ return false;
+ } else {
+ return ($num_angle_start > $num_angle_end);
+ }
+ }
+
+ /**
+ * Sub function that is used only by hasUnclosedBrackets().
+ *
+ * @access private
+ * @param string $string The string to check.
+ * @param integer &$num The number of occurences.
+ * @param string $char The character to count.
+ * @return integer The number of occurences of $char in $string, adjusted for backslashes.
+ */
+ function _hasUnclosedBracketsSub($string, &$num, $char)
+ {
+ $parts = explode($char, $string);
+ for ($i = 0; $i < count($parts); $i++){
+ if (substr($parts[$i], -1) == '\\' || $this->_hasUnclosedQuotes($parts[$i]))
+ $num--;
+ if (isset($parts[$i + 1]))
+ $parts[$i + 1] = $parts[$i] . $char . $parts[$i + 1];
+ }
+
+ return $num;
+ }
+
+ /**
+ * Function to begin checking the address.
+ *
+ * @access private
+ * @param string $address The address to validate.
+ * @return mixed False on failure, or a structured array of address information on success.
+ */
+ function _validateAddress($address)
+ {
+ $is_group = false;
+ $addresses = array();
+
+ if ($address['group']) {
+ $is_group = true;
+
+ // Get the group part of the name
+ $parts = explode(':', $address['address']);
+ $groupname = $this->_splitCheck($parts, ':');
+ $structure = array();
+
+ // And validate the group part of the name.
+ if (!$this->_validatePhrase($groupname)){
+ $this->error = 'Group name did not validate.';
+ return false;
+ } else {
+ // Don't include groups if we are not nesting
+ // them. This avoids returning invalid addresses.
+ if ($this->nestGroups) {
+ $structure = new stdClass;
+ $structure->groupname = $groupname;
+ }
+ }
+
+ $address['address'] = ltrim(substr($address['address'], strlen($groupname . ':')));
+ }
+
+ // If a group then split on comma and put into an array.
+ // Otherwise, Just put the whole address in an array.
+ if ($is_group) {
+ while (strlen($address['address']) > 0) {
+ $parts = explode(',', $address['address']);
+ $addresses[] = $this->_splitCheck($parts, ',');
+ $address['address'] = trim(substr($address['address'], strlen(end($addresses) . ',')));
+ }
+ } else {
+ $addresses[] = $address['address'];
+ }
+
+ // Check that $addresses is set, if address like this:
+ // Groupname:;
+ // Then errors were appearing.
+ if (!count($addresses)){
+ $this->error = 'Empty group.';
+ return false;
+ }
+
+ // Trim the whitespace from all of the address strings.
+ array_map('trim', $addresses);
+
+ // Validate each mailbox.
+ // Format could be one of: name
+ // geezer@domain.com
+ // geezer
+ // ... or any other format valid by RFC 822.
+ for ($i = 0; $i < count($addresses); $i++) {
+ if (!$this->validateMailbox($addresses[$i])) {
+ if (empty($this->error)) {
+ $this->error = 'Validation failed for: ' . $addresses[$i];
+ }
+ return false;
+ }
+ }
+
+ // Nested format
+ if ($this->nestGroups) {
+ if ($is_group) {
+ $structure->addresses = $addresses;
+ } else {
+ $structure = $addresses[0];
+ }
+
+ // Flat format
+ } else {
+ if ($is_group) {
+ $structure = array_merge($structure, $addresses);
+ } else {
+ $structure = $addresses;
+ }
+ }
+
+ return $structure;
+ }
+
+ /**
+ * Function to validate a phrase.
+ *
+ * @access private
+ * @param string $phrase The phrase to check.
+ * @return boolean Success or failure.
+ */
+ function _validatePhrase($phrase)
+ {
+ // Splits on one or more Tab or space.
+ $parts = preg_split('/[ \\x09]+/', $phrase, -1, PREG_SPLIT_NO_EMPTY);
+
+ $phrase_parts = array();
+ while (count($parts) > 0){
+ $phrase_parts[] = $this->_splitCheck($parts, ' ');
+ for ($i = 0; $i < $this->index + 1; $i++)
+ array_shift($parts);
+ }
+
+ foreach ($phrase_parts as $part) {
+ // If quoted string:
+ if (substr($part, 0, 1) == '"') {
+ if (!$this->_validateQuotedString($part)) {
+ return false;
+ }
+ continue;
+ }
+
+ // Otherwise it's an atom:
+ if (!$this->_validateAtom($part)) return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Function to validate an atom which from rfc822 is:
+ * atom = 1*
+ *
+ * If validation ($this->validate) has been turned off, then
+ * validateAtom() doesn't actually check anything. This is so that you
+ * can split a list of addresses up before encoding personal names
+ * (umlauts, etc.), for example.
+ *
+ * @access private
+ * @param string $atom The string to check.
+ * @return boolean Success or failure.
+ */
+ function _validateAtom($atom)
+ {
+ if (!$this->validate) {
+ // Validation has been turned off; assume the atom is okay.
+ return true;
+ }
+
+ // Check for any char from ASCII 0 - ASCII 127
+ if (!preg_match('/^[\\x00-\\x7E]+$/i', $atom, $matches)) {
+ return false;
+ }
+
+ // Check for specials:
+ if (preg_match('/[][()<>@,;\\:". ]/', $atom)) {
+ return false;
+ }
+
+ // Check for control characters (ASCII 0-31):
+ if (preg_match('/[\\x00-\\x1F]+/', $atom)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Function to validate quoted string, which is:
+ * quoted-string = <"> *(qtext/quoted-pair) <">
+ *
+ * @access private
+ * @param string $qstring The string to check
+ * @return boolean Success or failure.
+ */
+ function _validateQuotedString($qstring)
+ {
+ // Leading and trailing "
+ $qstring = substr($qstring, 1, -1);
+
+ // Perform check, removing quoted characters first.
+ return !preg_match('/[\x0D\\\\"]/', preg_replace('/\\\\./', '', $qstring));
+ }
+
+ /**
+ * Function to validate a mailbox, which is:
+ * mailbox = addr-spec ; simple address
+ * / phrase route-addr ; name and route-addr
+ *
+ * @access public
+ * @param string &$mailbox The string to check.
+ * @return boolean Success or failure.
+ */
+ function validateMailbox(&$mailbox)
+ {
+ // A couple of defaults.
+ $phrase = '';
+ $comment = '';
+ $comments = array();
+
+ // Catch any RFC822 comments and store them separately.
+ $_mailbox = $mailbox;
+ while (strlen(trim($_mailbox)) > 0) {
+ $parts = explode('(', $_mailbox);
+ $before_comment = $this->_splitCheck($parts, '(');
+ if ($before_comment != $_mailbox) {
+ // First char should be a (.
+ $comment = substr(str_replace($before_comment, '', $_mailbox), 1);
+ $parts = explode(')', $comment);
+ $comment = $this->_splitCheck($parts, ')');
+ $comments[] = $comment;
+
+ // +2 is for the brackets
+ $_mailbox = substr($_mailbox, strpos($_mailbox, '('.$comment)+strlen($comment)+2);
+ } else {
+ break;
+ }
+ }
+
+ foreach ($comments as $comment) {
+ $mailbox = str_replace("($comment)", '', $mailbox);
+ }
+
+ $mailbox = trim($mailbox);
+
+ // Check for name + route-addr
+ if (substr($mailbox, -1) == '>' && substr($mailbox, 0, 1) != '<') {
+ $parts = explode('<', $mailbox);
+ $name = $this->_splitCheck($parts, '<');
+
+ $phrase = trim($name);
+ $route_addr = trim(substr($mailbox, strlen($name.'<'), -1));
+
+ if ($this->_validatePhrase($phrase) === false || ($route_addr = $this->_validateRouteAddr($route_addr)) === false) {
+ return false;
+ }
+
+ // Only got addr-spec
+ } else {
+ // First snip angle brackets if present.
+ if (substr($mailbox, 0, 1) == '<' && substr($mailbox, -1) == '>') {
+ $addr_spec = substr($mailbox, 1, -1);
+ } else {
+ $addr_spec = $mailbox;
+ }
+
+ if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {
+ return false;
+ }
+ }
+
+ // Construct the object that will be returned.
+ $mbox = new stdClass();
+
+ // Add the phrase (even if empty) and comments
+ $mbox->personal = $phrase;
+ $mbox->comment = isset($comments) ? $comments : array();
+
+ if (isset($route_addr)) {
+ $mbox->mailbox = $route_addr['local_part'];
+ $mbox->host = $route_addr['domain'];
+ $route_addr['adl'] !== '' ? $mbox->adl = $route_addr['adl'] : '';
+ } else {
+ $mbox->mailbox = $addr_spec['local_part'];
+ $mbox->host = $addr_spec['domain'];
+ }
+
+ $mailbox = $mbox;
+ return true;
+ }
+
+ /**
+ * This function validates a route-addr which is:
+ * route-addr = "<" [route] addr-spec ">"
+ *
+ * Angle brackets have already been removed at the point of
+ * getting to this function.
+ *
+ * @access private
+ * @param string $route_addr The string to check.
+ * @return mixed False on failure, or an array containing validated address/route information on success.
+ */
+ function _validateRouteAddr($route_addr)
+ {
+ // Check for colon.
+ if (strpos($route_addr, ':') !== false) {
+ $parts = explode(':', $route_addr);
+ $route = $this->_splitCheck($parts, ':');
+ } else {
+ $route = $route_addr;
+ }
+
+ // If $route is same as $route_addr then the colon was in
+ // quotes or brackets or, of course, non existent.
+ if ($route === $route_addr){
+ unset($route);
+ $addr_spec = $route_addr;
+ if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {
+ return false;
+ }
+ } else {
+ // Validate route part.
+ if (($route = $this->_validateRoute($route)) === false) {
+ return false;
+ }
+
+ $addr_spec = substr($route_addr, strlen($route . ':'));
+
+ // Validate addr-spec part.
+ if (($addr_spec = $this->_validateAddrSpec($addr_spec)) === false) {
+ return false;
+ }
+ }
+
+ if (isset($route)) {
+ $return['adl'] = $route;
+ } else {
+ $return['adl'] = '';
+ }
+
+ $return = array_merge($return, $addr_spec);
+ return $return;
+ }
+
+ /**
+ * Function to validate a route, which is:
+ * route = 1#("@" domain) ":"
+ *
+ * @access private
+ * @param string $route The string to check.
+ * @return mixed False on failure, or the validated $route on success.
+ */
+ function _validateRoute($route)
+ {
+ // Split on comma.
+ $domains = explode(',', trim($route));
+
+ foreach ($domains as $domain) {
+ $domain = str_replace('@', '', trim($domain));
+ if (!$this->_validateDomain($domain)) return false;
+ }
+
+ return $route;
+ }
+
+ /**
+ * Function to validate a domain, though this is not quite what
+ * you expect of a strict internet domain.
+ *
+ * domain = sub-domain *("." sub-domain)
+ *
+ * @access private
+ * @param string $domain The string to check.
+ * @return mixed False on failure, or the validated domain on success.
+ */
+ function _validateDomain($domain)
+ {
+ // Note the different use of $subdomains and $sub_domains
+ $subdomains = explode('.', $domain);
+
+ while (count($subdomains) > 0) {
+ $sub_domains[] = $this->_splitCheck($subdomains, '.');
+ for ($i = 0; $i < $this->index + 1; $i++)
+ array_shift($subdomains);
+ }
+
+ foreach ($sub_domains as $sub_domain) {
+ if (!$this->_validateSubdomain(trim($sub_domain)))
+ return false;
+ }
+
+ // Managed to get here, so return input.
+ return $domain;
+ }
+
+ /**
+ * Function to validate a subdomain:
+ * subdomain = domain-ref / domain-literal
+ *
+ * @access private
+ * @param string $subdomain The string to check.
+ * @return boolean Success or failure.
+ */
+ function _validateSubdomain($subdomain)
+ {
+ if (preg_match('|^\[(.*)]$|', $subdomain, $arr)){
+ if (!$this->_validateDliteral($arr[1])) return false;
+ } else {
+ if (!$this->_validateAtom($subdomain)) return false;
+ }
+
+ // Got here, so return successful.
+ return true;
+ }
+
+ /**
+ * Function to validate a domain literal:
+ * domain-literal = "[" *(dtext / quoted-pair) "]"
+ *
+ * @access private
+ * @param string $dliteral The string to check.
+ * @return boolean Success or failure.
+ */
+ function _validateDliteral($dliteral)
+ {
+ return !preg_match('/(.)[][\x0D\\\\]/', $dliteral, $matches) && $matches[1] != '\\';
+ }
+
+ /**
+ * Function to validate an addr-spec.
+ *
+ * addr-spec = local-part "@" domain
+ *
+ * @access private
+ * @param string $addr_spec The string to check.
+ * @return mixed False on failure, or the validated addr-spec on success.
+ */
+ function _validateAddrSpec($addr_spec)
+ {
+ $addr_spec = trim($addr_spec);
+
+ // Split on @ sign if there is one.
+ if (strpos($addr_spec, '@') !== false) {
+ $parts = explode('@', $addr_spec);
+ $local_part = $this->_splitCheck($parts, '@');
+ $domain = substr($addr_spec, strlen($local_part . '@'));
+
+ // No @ sign so assume the default domain.
+ } else {
+ $local_part = $addr_spec;
+ $domain = $this->default_domain;
+ }
+
+ if (($local_part = $this->_validateLocalPart($local_part)) === false) return false;
+ if (($domain = $this->_validateDomain($domain)) === false) return false;
+
+ // Got here so return successful.
+ return array('local_part' => $local_part, 'domain' => $domain);
+ }
+
+ /**
+ * Function to validate the local part of an address:
+ * local-part = word *("." word)
+ *
+ * @access private
+ * @param string $local_part
+ * @return mixed False on failure, or the validated local part on success.
+ */
+ function _validateLocalPart($local_part)
+ {
+ $parts = explode('.', $local_part);
+ $words = array();
+
+ // Split the local_part into words.
+ while (count($parts) > 0){
+ $words[] = $this->_splitCheck($parts, '.');
+ for ($i = 0; $i < $this->index + 1; $i++) {
+ array_shift($parts);
+ }
+ }
+
+ // Validate each word.
+ foreach ($words as $word) {
+ // If this word contains an unquoted space, it is invalid. (6.2.4)
+ if (strpos($word, ' ') && $word[0] !== '"')
+ {
+ return false;
+ }
+
+ if ($this->_validatePhrase(trim($word)) === false) return false;
+ }
+
+ // Managed to get here, so return the input.
+ return $local_part;
+ }
+
+ /**
+ * Returns an approximate count of how many addresses are in the
+ * given string. This is APPROXIMATE as it only splits based on a
+ * comma which has no preceding backslash. Could be useful as
+ * large amounts of addresses will end up producing *large*
+ * structures when used with parseAddressList().
+ *
+ * @param string $data Addresses to count
+ * @return int Approximate count
+ */
+ function approximateCount($data)
+ {
+ return count(preg_split('/(?@. This can be sufficient for most
+ * people. Optional stricter mode can be utilised which restricts
+ * mailbox characters allowed to alphanumeric, full stop, hyphen
+ * and underscore.
+ *
+ * @param string $data Address to check
+ * @param boolean $strict Optional stricter mode
+ * @return mixed False if it fails, an indexed array
+ * username/domain if it matches
+ */
+ function isValidInetAddress($data, $strict = false)
+ {
+ $regex = $strict ? '/^([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i' : '/^([*+!.$|\'\\%\/0-9a-z^_`{}=?~:-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})$/i';
+ if (preg_match($regex, trim($data), $matches)) {
+ return array($matches[1], $matches[2]);
+ } else {
+ return false;
+ }
+ }
+
+}
diff --git a/lib/Mail/mail.php b/lib/Mail/mail.php
new file mode 100644
index 00000000..a8b4b5db
--- /dev/null
+++ b/lib/Mail/mail.php
@@ -0,0 +1,168 @@
+
+ * @copyright 2010 Chuck Hagenbuch
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version CVS: $Id: mail.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @link http://pear.php.net/package/Mail/
+ */
+
+/**
+ * internal PHP-mail() implementation of the PEAR Mail:: interface.
+ * @package Mail
+ * @version $Revision: 294747 $
+ */
+class Mail_mail extends Mail {
+
+ /**
+ * Any arguments to pass to the mail() function.
+ * @var string
+ */
+ var $_params = '';
+
+ /**
+ * Constructor.
+ *
+ * Instantiates a new Mail_mail:: object based on the parameters
+ * passed in.
+ *
+ * @param array $params Extra arguments for the mail() function.
+ */
+ function Mail_mail($params = null)
+ {
+ // The other mail implementations accept parameters as arrays.
+ // In the interest of being consistent, explode an array into
+ // a string of parameter arguments.
+ if (is_array($params)) {
+ $this->_params = join(' ', $params);
+ } else {
+ $this->_params = $params;
+ }
+
+ /* Because the mail() function may pass headers as command
+ * line arguments, we can't guarantee the use of the standard
+ * "\r\n" separator. Instead, we use the system's native line
+ * separator. */
+ if (defined('PHP_EOL')) {
+ $this->sep = PHP_EOL;
+ } else {
+ $this->sep = (strpos(PHP_OS, 'WIN') === false) ? "\n" : "\r\n";
+ }
+ }
+
+ /**
+ * Implements Mail_mail::send() function using php's built-in mail()
+ * command.
+ *
+ * @param mixed $recipients Either a comma-seperated list of recipients
+ * (RFC822 compliant), or an array of recipients,
+ * each RFC822 valid. This may contain recipients not
+ * specified in the headers, for Bcc:, resending
+ * messages, etc.
+ *
+ * @param array $headers The array of headers to send with the mail, in an
+ * associative array, where the array key is the
+ * header name (ie, 'Subject'), and the array value
+ * is the header value (ie, 'test'). The header
+ * produced from those values would be 'Subject:
+ * test'.
+ *
+ * @param string $body The full text of the message body, including any
+ * Mime parts, etc.
+ *
+ * @return mixed Returns true on success, or a PEAR_Error
+ * containing a descriptive error message on
+ * failure.
+ *
+ * @access public
+ */
+ function send($recipients, $headers, $body)
+ {
+ if (!is_array($headers)) {
+ return PEAR::raiseError('$headers must be an array');
+ }
+
+ $result = $this->_sanitizeHeaders($headers);
+ if (is_a($result, 'PEAR_Error')) {
+ return $result;
+ }
+
+ // If we're passed an array of recipients, implode it.
+ if (is_array($recipients)) {
+ $recipients = implode(', ', $recipients);
+ }
+
+ // Get the Subject out of the headers array so that we can
+ // pass it as a seperate argument to mail().
+ $subject = '';
+ if (isset($headers['Subject'])) {
+ $subject = $headers['Subject'];
+ unset($headers['Subject']);
+ }
+
+ // Also remove the To: header. The mail() function will add its own
+ // To: header based on the contents of $recipients.
+ unset($headers['To']);
+
+ // Flatten the headers out.
+ $headerElements = $this->prepareHeaders($headers);
+ if (is_a($headerElements, 'PEAR_Error')) {
+ return $headerElements;
+ }
+ list(, $text_headers) = $headerElements;
+
+ // We only use mail()'s optional fifth parameter if the additional
+ // parameters have been provided and we're not running in safe mode.
+ if (empty($this->_params) || ini_get('safe_mode')) {
+ $result = mail($recipients, $subject, $body, $text_headers);
+ } else {
+ $result = mail($recipients, $subject, $body, $text_headers,
+ $this->_params);
+ }
+
+ // If the mail() function returned failure, we need to create a
+ // PEAR_Error object and return it instead of the boolean result.
+ if ($result === false) {
+ $result = PEAR::raiseError('mail() returned failure');
+ }
+
+ return $result;
+ }
+
+}
diff --git a/lib/Mail/mock.php b/lib/Mail/mock.php
new file mode 100644
index 00000000..61570ba4
--- /dev/null
+++ b/lib/Mail/mock.php
@@ -0,0 +1,143 @@
+
+ * @copyright 2010 Chuck Hagenbuch
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version CVS: $Id: mock.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @link http://pear.php.net/package/Mail/
+ */
+
+/**
+ * Mock implementation of the PEAR Mail:: interface for testing.
+ * @access public
+ * @package Mail
+ * @version $Revision: 294747 $
+ */
+class Mail_mock extends Mail {
+
+ /**
+ * Array of messages that have been sent with the mock.
+ *
+ * @var array
+ * @access public
+ */
+ var $sentMessages = array();
+
+ /**
+ * Callback before sending mail.
+ *
+ * @var callback
+ */
+ var $_preSendCallback;
+
+ /**
+ * Callback after sending mai.
+ *
+ * @var callback
+ */
+ var $_postSendCallback;
+
+ /**
+ * Constructor.
+ *
+ * Instantiates a new Mail_mock:: object based on the parameters
+ * passed in. It looks for the following parameters, both optional:
+ * preSendCallback Called before an email would be sent.
+ * postSendCallback Called after an email would have been sent.
+ *
+ * @param array Hash containing any parameters.
+ * @access public
+ */
+ function Mail_mock($params)
+ {
+ if (isset($params['preSendCallback']) &&
+ is_callable($params['preSendCallback'])) {
+ $this->_preSendCallback = $params['preSendCallback'];
+ }
+
+ if (isset($params['postSendCallback']) &&
+ is_callable($params['postSendCallback'])) {
+ $this->_postSendCallback = $params['postSendCallback'];
+ }
+ }
+
+ /**
+ * Implements Mail_mock::send() function. Silently discards all
+ * mail.
+ *
+ * @param mixed $recipients Either a comma-seperated list of recipients
+ * (RFC822 compliant), or an array of recipients,
+ * each RFC822 valid. This may contain recipients not
+ * specified in the headers, for Bcc:, resending
+ * messages, etc.
+ *
+ * @param array $headers The array of headers to send with the mail, in an
+ * associative array, where the array key is the
+ * header name (ie, 'Subject'), and the array value
+ * is the header value (ie, 'test'). The header
+ * produced from those values would be 'Subject:
+ * test'.
+ *
+ * @param string $body The full text of the message body, including any
+ * Mime parts, etc.
+ *
+ * @return mixed Returns true on success, or a PEAR_Error
+ * containing a descriptive error message on
+ * failure.
+ * @access public
+ */
+ function send($recipients, $headers, $body)
+ {
+ if ($this->_preSendCallback) {
+ call_user_func_array($this->_preSendCallback,
+ array(&$this, $recipients, $headers, $body));
+ }
+
+ $entry = array('recipients' => $recipients, 'headers' => $headers, 'body' => $body);
+ $this->sentMessages[] = $entry;
+
+ if ($this->_postSendCallback) {
+ call_user_func_array($this->_postSendCallback,
+ array(&$this, $recipients, $headers, $body));
+ }
+
+ return true;
+ }
+
+}
diff --git a/lib/Mail/null.php b/lib/Mail/null.php
new file mode 100644
index 00000000..f8d58272
--- /dev/null
+++ b/lib/Mail/null.php
@@ -0,0 +1,84 @@
+
+ * @copyright 2010 Phil Kernick
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version CVS: $Id: null.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @link http://pear.php.net/package/Mail/
+ */
+
+/**
+ * Null implementation of the PEAR Mail:: interface.
+ * @access public
+ * @package Mail
+ * @version $Revision: 294747 $
+ */
+class Mail_null extends Mail {
+
+ /**
+ * Implements Mail_null::send() function. Silently discards all
+ * mail.
+ *
+ * @param mixed $recipients Either a comma-seperated list of recipients
+ * (RFC822 compliant), or an array of recipients,
+ * each RFC822 valid. This may contain recipients not
+ * specified in the headers, for Bcc:, resending
+ * messages, etc.
+ *
+ * @param array $headers The array of headers to send with the mail, in an
+ * associative array, where the array key is the
+ * header name (ie, 'Subject'), and the array value
+ * is the header value (ie, 'test'). The header
+ * produced from those values would be 'Subject:
+ * test'.
+ *
+ * @param string $body The full text of the message body, including any
+ * Mime parts, etc.
+ *
+ * @return mixed Returns true on success, or a PEAR_Error
+ * containing a descriptive error message on
+ * failure.
+ * @access public
+ */
+ function send($recipients, $headers, $body)
+ {
+ return true;
+ }
+
+}
diff --git a/lib/Mail/sendmail.php b/lib/Mail/sendmail.php
new file mode 100644
index 00000000..b056575e
--- /dev/null
+++ b/lib/Mail/sendmail.php
@@ -0,0 +1,171 @@
+ |
+// +----------------------------------------------------------------------+
+
+/**
+ * Sendmail implementation of the PEAR Mail:: interface.
+ * @access public
+ * @package Mail
+ * @version $Revision: 294744 $
+ */
+class Mail_sendmail extends Mail {
+
+ /**
+ * The location of the sendmail or sendmail wrapper binary on the
+ * filesystem.
+ * @var string
+ */
+ var $sendmail_path = '/usr/sbin/sendmail';
+
+ /**
+ * Any extra command-line parameters to pass to the sendmail or
+ * sendmail wrapper binary.
+ * @var string
+ */
+ var $sendmail_args = '-i';
+
+ /**
+ * Constructor.
+ *
+ * Instantiates a new Mail_sendmail:: object based on the parameters
+ * passed in. It looks for the following parameters:
+ * sendmail_path The location of the sendmail binary on the
+ * filesystem. Defaults to '/usr/sbin/sendmail'.
+ *
+ * sendmail_args Any extra parameters to pass to the sendmail
+ * or sendmail wrapper binary.
+ *
+ * If a parameter is present in the $params array, it replaces the
+ * default.
+ *
+ * @param array $params Hash containing any parameters different from the
+ * defaults.
+ * @access public
+ */
+ function Mail_sendmail($params)
+ {
+ if (isset($params['sendmail_path'])) {
+ $this->sendmail_path = $params['sendmail_path'];
+ }
+ if (isset($params['sendmail_args'])) {
+ $this->sendmail_args = $params['sendmail_args'];
+ }
+
+ /*
+ * Because we need to pass message headers to the sendmail program on
+ * the commandline, we can't guarantee the use of the standard "\r\n"
+ * separator. Instead, we use the system's native line separator.
+ */
+ if (defined('PHP_EOL')) {
+ $this->sep = PHP_EOL;
+ } else {
+ $this->sep = (strpos(PHP_OS, 'WIN') === false) ? "\n" : "\r\n";
+ }
+ }
+
+ /**
+ * Implements Mail::send() function using the sendmail
+ * command-line binary.
+ *
+ * @param mixed $recipients Either a comma-seperated list of recipients
+ * (RFC822 compliant), or an array of recipients,
+ * each RFC822 valid. This may contain recipients not
+ * specified in the headers, for Bcc:, resending
+ * messages, etc.
+ *
+ * @param array $headers The array of headers to send with the mail, in an
+ * associative array, where the array key is the
+ * header name (ie, 'Subject'), and the array value
+ * is the header value (ie, 'test'). The header
+ * produced from those values would be 'Subject:
+ * test'.
+ *
+ * @param string $body The full text of the message body, including any
+ * Mime parts, etc.
+ *
+ * @return mixed Returns true on success, or a PEAR_Error
+ * containing a descriptive error message on
+ * failure.
+ * @access public
+ */
+ function send($recipients, $headers, $body)
+ {
+ if (!is_array($headers)) {
+ return PEAR::raiseError('$headers must be an array');
+ }
+
+ $result = $this->_sanitizeHeaders($headers);
+ if (is_a($result, 'PEAR_Error')) {
+ return $result;
+ }
+
+ $recipients = $this->parseRecipients($recipients);
+ if (is_a($recipients, 'PEAR_Error')) {
+ return $recipients;
+ }
+ $recipients = implode(' ', array_map('escapeshellarg', $recipients));
+
+ $headerElements = $this->prepareHeaders($headers);
+ if (is_a($headerElements, 'PEAR_Error')) {
+ return $headerElements;
+ }
+ list($from, $text_headers) = $headerElements;
+
+ /* Since few MTAs are going to allow this header to be forged
+ * unless it's in the MAIL FROM: exchange, we'll use
+ * Return-Path instead of From: if it's set. */
+ if (!empty($headers['Return-Path'])) {
+ $from = $headers['Return-Path'];
+ }
+
+ if (!isset($from)) {
+ return PEAR::raiseError('No from address given.');
+ } elseif (strpos($from, ' ') !== false ||
+ strpos($from, ';') !== false ||
+ strpos($from, '&') !== false ||
+ strpos($from, '`') !== false) {
+ return PEAR::raiseError('From address specified with dangerous characters.');
+ }
+
+ $from = escapeshellarg($from); // Security bug #16200
+
+ $mail = @popen($this->sendmail_path . (!empty($this->sendmail_args) ? ' ' . $this->sendmail_args : '') . " -f$from -- $recipients", 'w');
+ if (!$mail) {
+ return PEAR::raiseError('Failed to open sendmail [' . $this->sendmail_path . '] for execution.');
+ }
+
+ // Write the headers following by two newlines: one to end the headers
+ // section and a second to separate the headers block from the body.
+ fputs($mail, $text_headers . $this->sep . $this->sep);
+
+ fputs($mail, $body);
+ $result = pclose($mail);
+ if (version_compare(phpversion(), '4.2.3') == -1) {
+ // With older php versions, we need to shift the pclose
+ // result to get the exit code.
+ $result = $result >> 8 & 0xFF;
+ }
+
+ if ($result != 0) {
+ return PEAR::raiseError('sendmail returned error code ' . $result,
+ $result);
+ }
+
+ return true;
+ }
+
+}
diff --git a/lib/Mail/smtp.php b/lib/Mail/smtp.php
new file mode 100644
index 00000000..52ea6020
--- /dev/null
+++ b/lib/Mail/smtp.php
@@ -0,0 +1,444 @@
+
+ * @author Chuck Hagenbuch
+ * @copyright 2010 Chuck Hagenbuch
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version CVS: $Id: smtp.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @link http://pear.php.net/package/Mail/
+ */
+
+/** Error: Failed to create a Net_SMTP object */
+define('PEAR_MAIL_SMTP_ERROR_CREATE', 10000);
+
+/** Error: Failed to connect to SMTP server */
+define('PEAR_MAIL_SMTP_ERROR_CONNECT', 10001);
+
+/** Error: SMTP authentication failure */
+define('PEAR_MAIL_SMTP_ERROR_AUTH', 10002);
+
+/** Error: No From: address has been provided */
+define('PEAR_MAIL_SMTP_ERROR_FROM', 10003);
+
+/** Error: Failed to set sender */
+define('PEAR_MAIL_SMTP_ERROR_SENDER', 10004);
+
+/** Error: Failed to add recipient */
+define('PEAR_MAIL_SMTP_ERROR_RECIPIENT', 10005);
+
+/** Error: Failed to send data */
+define('PEAR_MAIL_SMTP_ERROR_DATA', 10006);
+
+/**
+ * SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.
+ * @access public
+ * @package Mail
+ * @version $Revision: 294747 $
+ */
+class Mail_smtp extends Mail {
+
+ /**
+ * SMTP connection object.
+ *
+ * @var object
+ * @access private
+ */
+ var $_smtp = null;
+
+ /**
+ * The list of service extension parameters to pass to the Net_SMTP
+ * mailFrom() command.
+ * @var array
+ */
+ var $_extparams = array();
+
+ /**
+ * The SMTP host to connect to.
+ * @var string
+ */
+ var $host = 'localhost';
+
+ /**
+ * The port the SMTP server is on.
+ * @var integer
+ */
+ var $port = 25;
+
+ /**
+ * Should SMTP authentication be used?
+ *
+ * This value may be set to true, false or the name of a specific
+ * authentication method.
+ *
+ * If the value is set to true, the Net_SMTP package will attempt to use
+ * the best authentication method advertised by the remote SMTP server.
+ *
+ * @var mixed
+ */
+ var $auth = false;
+
+ /**
+ * The username to use if the SMTP server requires authentication.
+ * @var string
+ */
+ var $username = '';
+
+ /**
+ * The password to use if the SMTP server requires authentication.
+ * @var string
+ */
+ var $password = '';
+
+ /**
+ * Hostname or domain that will be sent to the remote SMTP server in the
+ * HELO / EHLO message.
+ *
+ * @var string
+ */
+ var $localhost = 'localhost';
+
+ /**
+ * SMTP connection timeout value. NULL indicates no timeout.
+ *
+ * @var integer
+ */
+ var $timeout = null;
+
+ /**
+ * Turn on Net_SMTP debugging?
+ *
+ * @var boolean $debug
+ */
+ var $debug = false;
+
+ /**
+ * Indicates whether or not the SMTP connection should persist over
+ * multiple calls to the send() method.
+ *
+ * @var boolean
+ */
+ var $persist = false;
+
+ /**
+ * Use SMTP command pipelining (specified in RFC 2920) if the SMTP server
+ * supports it. This speeds up delivery over high-latency connections. By
+ * default, use the default value supplied by Net_SMTP.
+ * @var bool
+ */
+ var $pipelining;
+
+ /**
+ * Constructor.
+ *
+ * Instantiates a new Mail_smtp:: object based on the parameters
+ * passed in. It looks for the following parameters:
+ * host The server to connect to. Defaults to localhost.
+ * port The port to connect to. Defaults to 25.
+ * auth SMTP authentication. Defaults to none.
+ * username The username to use for SMTP auth. No default.
+ * password The password to use for SMTP auth. No default.
+ * localhost The local hostname / domain. Defaults to localhost.
+ * timeout The SMTP connection timeout. Defaults to none.
+ * verp Whether to use VERP or not. Defaults to false.
+ * DEPRECATED as of 1.2.0 (use setMailParams()).
+ * debug Activate SMTP debug mode? Defaults to false.
+ * persist Should the SMTP connection persist?
+ * pipelining Use SMTP command pipelining
+ *
+ * If a parameter is present in the $params array, it replaces the
+ * default.
+ *
+ * @param array Hash containing any parameters different from the
+ * defaults.
+ * @access public
+ */
+ function Mail_smtp($params)
+ {
+ if (isset($params['host'])) $this->host = $params['host'];
+ if (isset($params['port'])) $this->port = $params['port'];
+ if (isset($params['auth'])) $this->auth = $params['auth'];
+ if (isset($params['username'])) $this->username = $params['username'];
+ if (isset($params['password'])) $this->password = $params['password'];
+ if (isset($params['localhost'])) $this->localhost = $params['localhost'];
+ if (isset($params['timeout'])) $this->timeout = $params['timeout'];
+ if (isset($params['debug'])) $this->debug = (bool)$params['debug'];
+ if (isset($params['persist'])) $this->persist = (bool)$params['persist'];
+ if (isset($params['pipelining'])) $this->pipelining = (bool)$params['pipelining'];
+
+ // Deprecated options
+ if (isset($params['verp'])) {
+ $this->addServiceExtensionParameter('XVERP', is_bool($params['verp']) ? null : $params['verp']);
+ }
+
+ register_shutdown_function(array(&$this, '_Mail_smtp'));
+ }
+
+ /**
+ * Destructor implementation to ensure that we disconnect from any
+ * potentially-alive persistent SMTP connections.
+ */
+ function _Mail_smtp()
+ {
+ $this->disconnect();
+ }
+
+ /**
+ * Implements Mail::send() function using SMTP.
+ *
+ * @param mixed $recipients Either a comma-seperated list of recipients
+ * (RFC822 compliant), or an array of recipients,
+ * each RFC822 valid. This may contain recipients not
+ * specified in the headers, for Bcc:, resending
+ * messages, etc.
+ *
+ * @param array $headers The array of headers to send with the mail, in an
+ * associative array, where the array key is the
+ * header name (e.g., 'Subject'), and the array value
+ * is the header value (e.g., 'test'). The header
+ * produced from those values would be 'Subject:
+ * test'.
+ *
+ * @param string $body The full text of the message body, including any
+ * MIME parts, etc.
+ *
+ * @return mixed Returns true on success, or a PEAR_Error
+ * containing a descriptive error message on
+ * failure.
+ * @access public
+ */
+ function send($recipients, $headers, $body)
+ {
+ /* If we don't already have an SMTP object, create one. */
+ $result = &$this->getSMTPObject();
+ if (PEAR::isError($result)) {
+ return $result;
+ }
+
+ if (!is_array($headers)) {
+ return PEAR::raiseError('$headers must be an array');
+ }
+
+ $this->_sanitizeHeaders($headers);
+
+ $headerElements = $this->prepareHeaders($headers);
+ if (is_a($headerElements, 'PEAR_Error')) {
+ $this->_smtp->rset();
+ return $headerElements;
+ }
+ list($from, $textHeaders) = $headerElements;
+
+ /* Since few MTAs are going to allow this header to be forged
+ * unless it's in the MAIL FROM: exchange, we'll use
+ * Return-Path instead of From: if it's set. */
+ if (!empty($headers['Return-Path'])) {
+ $from = $headers['Return-Path'];
+ }
+
+ if (!isset($from)) {
+ $this->_smtp->rset();
+ return PEAR::raiseError('No From: address has been provided',
+ PEAR_MAIL_SMTP_ERROR_FROM);
+ }
+
+ $params = null;
+ if (!empty($this->_extparams)) {
+ foreach ($this->_extparams as $key => $val) {
+ $params .= ' ' . $key . (is_null($val) ? '' : '=' . $val);
+ }
+ }
+ if (PEAR::isError($res = $this->_smtp->mailFrom($from, ltrim($params)))) {
+ $error = $this->_error("Failed to set sender: $from", $res);
+ $this->_smtp->rset();
+ return PEAR::raiseError($error, PEAR_MAIL_SMTP_ERROR_SENDER);
+ }
+
+ $recipients = $this->parseRecipients($recipients);
+ if (is_a($recipients, 'PEAR_Error')) {
+ $this->_smtp->rset();
+ return $recipients;
+ }
+
+ foreach ($recipients as $recipient) {
+ $res = $this->_smtp->rcptTo($recipient);
+ if (is_a($res, 'PEAR_Error')) {
+ $error = $this->_error("Failed to add recipient: $recipient", $res);
+ $this->_smtp->rset();
+ return PEAR::raiseError($error, PEAR_MAIL_SMTP_ERROR_RECIPIENT);
+ }
+ }
+
+ /* Send the message's headers and the body as SMTP data. */
+ $res = $this->_smtp->data($textHeaders . "\r\n\r\n" . $body);
+ list(,$args) = $this->_smtp->getResponse();
+
+ if (preg_match("/Ok: queued as (.*)/", $args, $queued)) {
+ $this->queued_as = $queued[1];
+ }
+
+ /* we need the greeting; from it we can extract the authorative name of the mail server we've really connected to.
+ * ideal if we're connecting to a round-robin of relay servers and need to track which exact one took the email */
+ $this->greeting = $this->_smtp->getGreeting();
+
+ if (is_a($res, 'PEAR_Error')) {
+ $error = $this->_error('Failed to send data', $res);
+ $this->_smtp->rset();
+ return PEAR::raiseError($error, PEAR_MAIL_SMTP_ERROR_DATA);
+ }
+
+ /* If persistent connections are disabled, destroy our SMTP object. */
+ if ($this->persist === false) {
+ $this->disconnect();
+ }
+
+ return true;
+ }
+
+ /**
+ * Connect to the SMTP server by instantiating a Net_SMTP object.
+ *
+ * @return mixed Returns a reference to the Net_SMTP object on success, or
+ * a PEAR_Error containing a descriptive error message on
+ * failure.
+ *
+ * @since 1.2.0
+ * @access public
+ */
+ function &getSMTPObject()
+ {
+ if (is_object($this->_smtp) !== false) {
+ return $this->_smtp;
+ }
+
+ include_once 'Net/SMTP.php';
+ $this->_smtp = &new Net_SMTP($this->host,
+ $this->port,
+ $this->localhost);
+
+ /* If we still don't have an SMTP object at this point, fail. */
+ if (is_object($this->_smtp) === false) {
+ return PEAR::raiseError('Failed to create a Net_SMTP object',
+ PEAR_MAIL_SMTP_ERROR_CREATE);
+ }
+
+ /* Configure the SMTP connection. */
+ if ($this->debug) {
+ $this->_smtp->setDebug(true);
+ }
+
+ /* Attempt to connect to the configured SMTP server. */
+ if (PEAR::isError($res = $this->_smtp->connect($this->timeout))) {
+ $error = $this->_error('Failed to connect to ' .
+ $this->host . ':' . $this->port,
+ $res);
+ return PEAR::raiseError($error, PEAR_MAIL_SMTP_ERROR_CONNECT);
+ }
+
+ /* Attempt to authenticate if authentication has been enabled. */
+ if ($this->auth) {
+ $method = is_string($this->auth) ? $this->auth : '';
+
+ if (PEAR::isError($res = $this->_smtp->auth($this->username,
+ $this->password,
+ $method))) {
+ $error = $this->_error("$method authentication failure",
+ $res);
+ $this->_smtp->rset();
+ return PEAR::raiseError($error, PEAR_MAIL_SMTP_ERROR_AUTH);
+ }
+ }
+
+ return $this->_smtp;
+ }
+
+ /**
+ * Add parameter associated with a SMTP service extension.
+ *
+ * @param string Extension keyword.
+ * @param string Any value the keyword needs.
+ *
+ * @since 1.2.0
+ * @access public
+ */
+ function addServiceExtensionParameter($keyword, $value = null)
+ {
+ $this->_extparams[$keyword] = $value;
+ }
+
+ /**
+ * Disconnect and destroy the current SMTP connection.
+ *
+ * @return boolean True if the SMTP connection no longer exists.
+ *
+ * @since 1.1.9
+ * @access public
+ */
+ function disconnect()
+ {
+ /* If we have an SMTP object, disconnect and destroy it. */
+ if (is_object($this->_smtp) && $this->_smtp->disconnect()) {
+ $this->_smtp = null;
+ }
+
+ /* We are disconnected if we no longer have an SMTP object. */
+ return ($this->_smtp === null);
+ }
+
+ /**
+ * Build a standardized string describing the current SMTP error.
+ *
+ * @param string $text Custom string describing the error context.
+ * @param object $error Reference to the current PEAR_Error object.
+ *
+ * @return string A string describing the current SMTP error.
+ *
+ * @since 1.1.7
+ * @access private
+ */
+ function _error($text, &$error)
+ {
+ /* Split the SMTP response into a code and a response string. */
+ list($code, $response) = $this->_smtp->getResponse();
+
+ /* Build our standardized error string. */
+ return $text
+ . ' [SMTP: ' . $error->getMessage()
+ . " (code: $code, response: $response)]";
+ }
+
+}
diff --git a/lib/Mail/smtpmx.php b/lib/Mail/smtpmx.php
new file mode 100644
index 00000000..f0b69408
--- /dev/null
+++ b/lib/Mail/smtpmx.php
@@ -0,0 +1,502 @@
+
+ * @copyright 2010 gERD Schaufelberger
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
+ * @version CVS: $Id: smtpmx.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @link http://pear.php.net/package/Mail/
+ */
+
+require_once 'Net/SMTP.php';
+
+/**
+ * SMTP MX implementation of the PEAR Mail interface. Requires the Net_SMTP class.
+ *
+ *
+ * @access public
+ * @author gERD Schaufelberger
+ * @package Mail
+ * @version $Revision: 294747 $
+ */
+class Mail_smtpmx extends Mail {
+
+ /**
+ * SMTP connection object.
+ *
+ * @var object
+ * @access private
+ */
+ var $_smtp = null;
+
+ /**
+ * The port the SMTP server is on.
+ * @var integer
+ * @see getservicebyname()
+ */
+ var $port = 25;
+
+ /**
+ * Hostname or domain that will be sent to the remote SMTP server in the
+ * HELO / EHLO message.
+ *
+ * @var string
+ * @see posix_uname()
+ */
+ var $mailname = 'localhost';
+
+ /**
+ * SMTP connection timeout value. NULL indicates no timeout.
+ *
+ * @var integer
+ */
+ var $timeout = 10;
+
+ /**
+ * use either PEAR:Net_DNS or getmxrr
+ *
+ * @var boolean
+ */
+ var $withNetDns = true;
+
+ /**
+ * PEAR:Net_DNS_Resolver
+ *
+ * @var object
+ */
+ var $resolver;
+
+ /**
+ * Whether to use VERP or not. If not a boolean, the string value
+ * will be used as the VERP separators.
+ *
+ * @var mixed boolean or string
+ */
+ var $verp = false;
+
+ /**
+ * Whether to use VRFY or not.
+ *
+ * @var boolean $vrfy
+ */
+ var $vrfy = false;
+
+ /**
+ * Switch to test mode - don't send emails for real
+ *
+ * @var boolean $debug
+ */
+ var $test = false;
+
+ /**
+ * Turn on Net_SMTP debugging?
+ *
+ * @var boolean $peardebug
+ */
+ var $debug = false;
+
+ /**
+ * internal error codes
+ *
+ * translate internal error identifier to PEAR-Error codes and human
+ * readable messages.
+ *
+ * @var boolean $debug
+ * @todo as I need unique error-codes to identify what exactly went wrond
+ * I did not use intergers as it should be. Instead I added a "namespace"
+ * for each code. This avoids conflicts with error codes from different
+ * classes. How can I use unique error codes and stay conform with PEAR?
+ */
+ var $errorCode = array(
+ 'not_connected' => array(
+ 'code' => 1,
+ 'msg' => 'Could not connect to any mail server ({HOST}) at port {PORT} to send mail to {RCPT}.'
+ ),
+ 'failed_vrfy_rcpt' => array(
+ 'code' => 2,
+ 'msg' => 'Recipient "{RCPT}" could not be veryfied.'
+ ),
+ 'failed_set_from' => array(
+ 'code' => 3,
+ 'msg' => 'Failed to set sender: {FROM}.'
+ ),
+ 'failed_set_rcpt' => array(
+ 'code' => 4,
+ 'msg' => 'Failed to set recipient: {RCPT}.'
+ ),
+ 'failed_send_data' => array(
+ 'code' => 5,
+ 'msg' => 'Failed to send mail to: {RCPT}.'
+ ),
+ 'no_from' => array(
+ 'code' => 5,
+ 'msg' => 'No from address has be provided.'
+ ),
+ 'send_data' => array(
+ 'code' => 7,
+ 'msg' => 'Failed to create Net_SMTP object.'
+ ),
+ 'no_mx' => array(
+ 'code' => 8,
+ 'msg' => 'No MX-record for {RCPT} found.'
+ ),
+ 'no_resolver' => array(
+ 'code' => 9,
+ 'msg' => 'Could not start resolver! Install PEAR:Net_DNS or switch off "netdns"'
+ ),
+ 'failed_rset' => array(
+ 'code' => 10,
+ 'msg' => 'RSET command failed, SMTP-connection corrupt.'
+ ),
+ );
+
+ /**
+ * Constructor.
+ *
+ * Instantiates a new Mail_smtp:: object based on the parameters
+ * passed in. It looks for the following parameters:
+ * mailname The name of the local mail system (a valid hostname which matches the reverse lookup)
+ * port smtp-port - the default comes from getservicebyname() and should work fine
+ * timeout The SMTP connection timeout. Defaults to 30 seconds.
+ * vrfy Whether to use VRFY or not. Defaults to false.
+ * verp Whether to use VERP or not. Defaults to false.
+ * test Activate test mode? Defaults to false.
+ * debug Activate SMTP and Net_DNS debug mode? Defaults to false.
+ * netdns whether to use PEAR:Net_DNS or the PHP build in function getmxrr, default is true
+ *
+ * If a parameter is present in the $params array, it replaces the
+ * default.
+ *
+ * @access public
+ * @param array Hash containing any parameters different from the
+ * defaults.
+ * @see _Mail_smtpmx()
+ */
+ function __construct($params)
+ {
+ if (isset($params['mailname'])) {
+ $this->mailname = $params['mailname'];
+ } else {
+ // try to find a valid mailname
+ if (function_exists('posix_uname')) {
+ $uname = posix_uname();
+ $this->mailname = $uname['nodename'];
+ }
+ }
+
+ // port number
+ if (isset($params['port'])) {
+ $this->_port = $params['port'];
+ } else {
+ $this->_port = getservbyname('smtp', 'tcp');
+ }
+
+ if (isset($params['timeout'])) $this->timeout = $params['timeout'];
+ if (isset($params['verp'])) $this->verp = $params['verp'];
+ if (isset($params['test'])) $this->test = $params['test'];
+ if (isset($params['peardebug'])) $this->test = $params['peardebug'];
+ if (isset($params['netdns'])) $this->withNetDns = $params['netdns'];
+ }
+
+ /**
+ * Constructor wrapper for PHP4
+ *
+ * @access public
+ * @param array Hash containing any parameters different from the defaults
+ * @see __construct()
+ */
+ function Mail_smtpmx($params)
+ {
+ $this->__construct($params);
+ register_shutdown_function(array(&$this, '__destruct'));
+ }
+
+ /**
+ * Destructor implementation to ensure that we disconnect from any
+ * potentially-alive persistent SMTP connections.
+ */
+ function __destruct()
+ {
+ if (is_object($this->_smtp)) {
+ $this->_smtp->disconnect();
+ $this->_smtp = null;
+ }
+ }
+
+ /**
+ * Implements Mail::send() function using SMTP direct delivery
+ *
+ * @access public
+ * @param mixed $recipients in RFC822 style or array
+ * @param array $headers The array of headers to send with the mail.
+ * @param string $body The full text of the message body,
+ * @return mixed Returns true on success, or a PEAR_Error
+ */
+ function send($recipients, $headers, $body)
+ {
+ if (!is_array($headers)) {
+ return PEAR::raiseError('$headers must be an array');
+ }
+
+ $result = $this->_sanitizeHeaders($headers);
+ if (is_a($result, 'PEAR_Error')) {
+ return $result;
+ }
+
+ // Prepare headers
+ $headerElements = $this->prepareHeaders($headers);
+ if (is_a($headerElements, 'PEAR_Error')) {
+ return $headerElements;
+ }
+ list($from, $textHeaders) = $headerElements;
+
+ // use 'Return-Path' if possible
+ if (!empty($headers['Return-Path'])) {
+ $from = $headers['Return-Path'];
+ }
+ if (!isset($from)) {
+ return $this->_raiseError('no_from');
+ }
+
+ // Prepare recipients
+ $recipients = $this->parseRecipients($recipients);
+ if (is_a($recipients, 'PEAR_Error')) {
+ return $recipients;
+ }
+
+ foreach ($recipients as $rcpt) {
+ list($user, $host) = explode('@', $rcpt);
+
+ $mx = $this->_getMx($host);
+ if (is_a($mx, 'PEAR_Error')) {
+ return $mx;
+ }
+
+ if (empty($mx)) {
+ $info = array('rcpt' => $rcpt);
+ return $this->_raiseError('no_mx', $info);
+ }
+
+ $connected = false;
+ foreach ($mx as $mserver => $mpriority) {
+ $this->_smtp = new Net_SMTP($mserver, $this->port, $this->mailname);
+
+ // configure the SMTP connection.
+ if ($this->debug) {
+ $this->_smtp->setDebug(true);
+ }
+
+ // attempt to connect to the configured SMTP server.
+ $res = $this->_smtp->connect($this->timeout);
+ if (is_a($res, 'PEAR_Error')) {
+ $this->_smtp = null;
+ continue;
+ }
+
+ // connection established
+ if ($res) {
+ $connected = true;
+ break;
+ }
+ }
+
+ if (!$connected) {
+ $info = array(
+ 'host' => implode(', ', array_keys($mx)),
+ 'port' => $this->port,
+ 'rcpt' => $rcpt,
+ );
+ return $this->_raiseError('not_connected', $info);
+ }
+
+ // Verify recipient
+ if ($this->vrfy) {
+ $res = $this->_smtp->vrfy($rcpt);
+ if (is_a($res, 'PEAR_Error')) {
+ $info = array('rcpt' => $rcpt);
+ return $this->_raiseError('failed_vrfy_rcpt', $info);
+ }
+ }
+
+ // mail from:
+ $args['verp'] = $this->verp;
+ $res = $this->_smtp->mailFrom($from, $args);
+ if (is_a($res, 'PEAR_Error')) {
+ $info = array('from' => $from);
+ return $this->_raiseError('failed_set_from', $info);
+ }
+
+ // rcpt to:
+ $res = $this->_smtp->rcptTo($rcpt);
+ if (is_a($res, 'PEAR_Error')) {
+ $info = array('rcpt' => $rcpt);
+ return $this->_raiseError('failed_set_rcpt', $info);
+ }
+
+ // Don't send anything in test mode
+ if ($this->test) {
+ $result = $this->_smtp->rset();
+ $res = $this->_smtp->rset();
+ if (is_a($res, 'PEAR_Error')) {
+ return $this->_raiseError('failed_rset');
+ }
+
+ $this->_smtp->disconnect();
+ $this->_smtp = null;
+ return true;
+ }
+
+ // Send data
+ $res = $this->_smtp->data("$textHeaders\r\n$body");
+ if (is_a($res, 'PEAR_Error')) {
+ $info = array('rcpt' => $rcpt);
+ return $this->_raiseError('failed_send_data', $info);
+ }
+
+ $this->_smtp->disconnect();
+ $this->_smtp = null;
+ }
+
+ return true;
+ }
+
+ /**
+ * Recieve mx rexords for a spciefied host
+ *
+ * The MX records
+ *
+ * @access private
+ * @param string $host mail host
+ * @return mixed sorted
+ */
+ function _getMx($host)
+ {
+ $mx = array();
+
+ if ($this->withNetDns) {
+ $res = $this->_loadNetDns();
+ if (is_a($res, 'PEAR_Error')) {
+ return $res;
+ }
+
+ $response = $this->resolver->query($host, 'MX');
+ if (!$response) {
+ return false;
+ }
+
+ foreach ($response->answer as $rr) {
+ if ($rr->type == 'MX') {
+ $mx[$rr->exchange] = $rr->preference;
+ }
+ }
+ } else {
+ $mxHost = array();
+ $mxWeight = array();
+
+ if (!getmxrr($host, $mxHost, $mxWeight)) {
+ return false;
+ }
+ for ($i = 0; $i < count($mxHost); ++$i) {
+ $mx[$mxHost[$i]] = $mxWeight[$i];
+ }
+ }
+
+ asort($mx);
+ return $mx;
+ }
+
+ /**
+ * initialize PEAR:Net_DNS_Resolver
+ *
+ * @access private
+ * @return boolean true on success
+ */
+ function _loadNetDns()
+ {
+ if (is_object($this->resolver)) {
+ return true;
+ }
+
+ if (!include_once 'Net/DNS.php') {
+ return $this->_raiseError('no_resolver');
+ }
+
+ $this->resolver = new Net_DNS_Resolver();
+ if ($this->debug) {
+ $this->resolver->test = 1;
+ }
+
+ return true;
+ }
+
+ /**
+ * raise standardized error
+ *
+ * include additional information in error message
+ *
+ * @access private
+ * @param string $id maps error ids to codes and message
+ * @param array $info optional information in associative array
+ * @see _errorCode
+ */
+ function _raiseError($id, $info = array())
+ {
+ $code = $this->errorCode[$id]['code'];
+ $msg = $this->errorCode[$id]['msg'];
+
+ // include info to messages
+ if (!empty($info)) {
+ $search = array();
+ $replace = array();
+
+ foreach ($info as $key => $value) {
+ array_push($search, '{' . strtoupper($key) . '}');
+ array_push($replace, $value);
+ }
+
+ $msg = str_replace($search, $replace, $msg);
+ }
+
+ return PEAR::raiseError($msg, $code);
+ }
+
+}
diff --git a/lib/aws.phar b/lib/aws.phar
new file mode 100644
index 00000000..036aa8f9
Binary files /dev/null and b/lib/aws.phar differ
diff --git a/phpdox.xml b/phpdox.xml
new file mode 100644
index 00000000..67ece022
--- /dev/null
+++ b/phpdox.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/phpunit.xml b/phpunit.xml
new file mode 100644
index 00000000..3f2a8b71
--- /dev/null
+++ b/phpunit.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+ ./test/admin
+
+
+
+
+
+
+
+
+
+
+
+
+ src
+
+ ./src/composer
+ ./src/lib
+ ./src/lib/Mail
+ ./src/adodb512
+ ./src/classes/crypt
+ ./test/bootstrap.php
+ ./test/test.config.php
+ ./test/test.includes.php
+
+
+
+
diff --git a/readme.md b/readme.md
new file mode 100644
index 00000000..29b61090
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,247 @@
+IceHrm
+===========
+
+Installation
+------------
+Download the latest release https://github.com/thilinah/icehrm/releases/latest
+
+Copy the downloaded file to the path you want to install iCE Hrm in your server and extract.
+
+Create a mysql DB for and user. Grant all on iCE Hrm DB to new DB user.
+
+Visit iCE Hrm installation path in your browser.
+
+During the installation form, fill in details appropriately.
+
+Once the application is installed use the username = admin and password = admin to login to your system.
+
+Note: Please rename or delete the install folder (/app/install) since it could pose a security threat to your iCE Hrm instance.
+
+Release note v12.6
+-----------------
+
+### Features
+ * Charts module
+ * Code level security improvements
+
+### Fixes
+ * Employee switching issue fixed
+
+Release note v10.2
+-----------------
+
+### Fixes
+ * Improvements to date time pickers
+ * Fixing fatal error due to non writable log file
+ * Latest changes from ice-framework v2.0
+
+
+Release note v10.1
+-----------------
+### Features
+ * Integration with ice-framework (http://github.com/thilinah/ice-framework)
+ * Travel module
+ * Meta data module
+ * Option for only allow users to add an entry to a timesheet only if they have marked atteandance for the selected period
+ * Restricting availability of leave types to employees using leave groups
+
+### Fixes
+ * Add missing S3FileSystem class
+ * Fix issue: passing result of a method call directly into empty method is not supported in php v5.3
+
+
+Release note v9.1
+-----------------
+### Fixes
+ * Add missing S3FileSystem class
+ * Fix issue: passing result of a method call directly into empty method is not supported in php v5.3
+
+
+Release note v9.0
+-----------------
+### Features
+ * New user interface
+ * Decimal leave counts supported
+
+Update icehrm v8.4 to v9.0
+--------------------------
+ * Make a backup of your icehrm db
+ * Run db script "icehrmdb_update_v8.4_to_v9.0.sql" which can be found inside script folder of icehrm_v9.0
+ * remove all folders except app folder in icehrm root folder
+ * copy all folders except app folder from new installation to icehrm root folder
+
+
+Release note v8.4
+-----------------
+### Fixes
+ * Fix leave carry forward rounding issues
+ * Fix issue: select2 default value not getting set for select2
+ * Fix issue: email not sent when admin changing leave status
+
+Release note v8.3
+-----------------
+### Fixes
+* Fix user table issue on windows, this will resolve errors such as: (Note that this fix has no effect on unix based installations)
+ * Admin not able to view user uploaded documents
+ * Admin not able to upload documants for users
+ * Admin can not view employee attendance records
+ * Employee projects can not be added
+
+
+Update icehrm v8.2 to v8.3
+--------------------------
+
+Copy server.includes.inc.php from v8.3 to your icehrm folder
+
+Update icehrm v7.x to v8.0
+--------------------------
+Delete all folders except /app directory
+
+Copy contents of icehrm_v8.0.zip to existing icehrm directory except app directory
+
+Execute 'icehrmdb_os_update_v7.x_to_v8.0.sql' on your icehrm database
+
+Update icehrm v7.1 to v7.2
+--------------------------
+Download update from https://bitbucket.org/thilina/icehrm-opensource/downloads/icehrm_update_from_7.1_to_7.2.zip
+
+Unzip icehrm_update_from_7.1_to_7.2.zip inside your icehrm installation
+
+Update icehrm v6.1 to v7.1
+--------------------------
+Delete all folders except /app directory
+
+Copy contents of icehrm_v7.1.zip to existing icehrm directory except app directory
+
+Execute 'icehrmdb_os_update_v6.1_to_v7.1.sql' on your icehrm database
+
+Release note v8.2
+-----------------
+### Features
+*Instance verification added
+
+Release note v8.1
+-----------------
+### Fixes
+*Fixed bug that caused a fatal error in php v5.4
+*aws2.7.11 phar file replaced by a aws2.7.11 extracted files
+*old aws sdk removed
+
+Release note v8.0
+-----------------
+### Features
+*Admin dashbord module
+*If the employee joined in current leave period, his leave entitlement is calculated proportional to joined date
+*Improvements to reporting module
+*Adding new employee time tracking report
+*Join date for employees made mandatory
+*Sending welcome email when a user is added
+*Let users directly reply to admin user from any email sent out from icehrm
+*All the users who are not admins must have an employee object attached
+*Upgrade aws sdk to v2.7.11
+*Allow employees to change password
+*Use only the email address defined under user for sending mails
+*Making work_email and private_email fields optional
+
+
+### Fixes
+*Upload dialog close button issue fixed
+
+Release note v7.2
+-----------------
+*Fixes
+*Some critical vulnerabilities are fixed as recommend by http://zeroscience.mk/en/
+
+Release note v7.1
+-----------------
+*Features
+*Improved company structure graph
+*Leave notes implementation � Supervisor can add a note when approving or rejecting leaves
+*Filtering support
+*Select boxes with long lists are now searchable
+*Add/Edit/Delete company structure permissions added for managers
+*Add ability to disable employee information editing
+
+*Fixes
+*Make loans editable only by admin
+*Fix: permissions not getting applied to employee documents
+*Fix error adding employee documents when no user assigned to the admin
+
+*Code Quality
+*Moving all module related code and data into module folders
+
+Release note v6.1
+-----------------
+Leave carry forwared related isue fixed
+
+Release note v6.0
+-----------------
+* Features
+* Notifications for leaves and timesheets
+* Leave module accrue and leave carry forward
+* Employee leave entitlement sub module
+* Ability to put system on debug mode
+* Allow admins to see documents of all the employees at one place
+* Backup data when deleting an employee
+* Employee attendance report added
+* Changes to time entry form in timesheet module to make time entry process faster
+* Admin can make all projects available to employees or just the set of prjects assigned to them using Setting "Projects: Make All Projects Available to Employees"
+* Employee document, date added field can not be changed by the employee anymore
+* About dialog added for admins
+
+* Fixes
+* Fix default employee delete issue (when the default employee is deleted the admin user attached to it also get deleted)
+* Fix user duplicate email issue
+* Fix manager can not logout from switched employee
+* Remove admin guide from non admin users
+
+Release note v5.3
+-----------------
+* Fixes
+* Fix missing employee name in employee details report
+
+Release note v5.2
+-----------------
+* Fixes
+* Remove unwanted error logs
+* Fix attendance module employee permission issue
+* Resolve warnings
+* Remove add new button from subordinates module
+* Adding administrators' guide
+
+Release note v5.1
+-----------------
+* Fixes
+* Fixing for non updating null fields
+* https://bitbucket.org/thilina/icehrm-opensource/commits/df57308b53484a2e43ef5c72967ed1cd0dc756cc
+
+Release note v5.0
+-----------------
+* Features
+* New user permission implementation
+* Adding new user level - Manager
+
+* Fixes
+* Fixing remote table loading issue
+
+Release note v4.2
+-----------------
+* Fixes
+* https://bitbucket.org/thilina/icehrm-opensource/issue/23/subordinate-leaves-pagination-not-working
+* https://bitbucket.org/thilina/icehrm-opensource/issue/20/error-occured-while-time-punch
+
+
+Release note v4.1
+-----------------
+* Features
+* Better email format for notifications
+* Convert upload dialog to a bootstrp model
+
+* Fixes
+* Fix error sending emails with amazon SES
+* Fix errors related to XAMPP and WAMPP servers
+* Fix php warnings and notifications
+* Fix company structure graph issues
+* Allow icehrm client to work without an internet connection
+* Fix installer incorrect base url issue
+* Fix empty user creation issue
diff --git a/src/api/AdapterBase.js b/src/api/AdapterBase.js
new file mode 100644
index 00000000..08da122c
--- /dev/null
+++ b/src/api/AdapterBase.js
@@ -0,0 +1,556 @@
+/*
+This file is part of Ice Framework.
+
+Ice Framework is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Ice Framework is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Ice Framework. If not, see .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+
+function AdapterBase(endPoint) {
+
+}
+
+this.moduleRelativeURL = null;
+this.tableData = new Array();
+this.sourceData = new Array();
+this.filter = null;
+this.origFilter = null;
+this.orderBy = null;
+this.currentElement = null;
+
+AdapterBase.inherits(IceHRMBase);
+
+AdapterBase.method('initAdapter' , function(endPoint,tab,filter,orderBy) {
+ this.moduleRelativeURL = baseUrl;
+ this.table = endPoint;
+ if(tab == undefined || tab == null){
+ this.tab = endPoint;
+ }else{
+ this.tab = tab;
+ }
+
+ if(filter == undefined || filter == null){
+ this.filter = null;
+ }else{
+ this.filter = filter;
+ }
+
+ this.origFilter = this.filter;
+
+ if(orderBy == undefined || orderBy == null){
+ this.orderBy = null;
+ }else{
+ this.orderBy = orderBy;
+ }
+
+ this.trackEvent("initAdapter",tab);
+
+ this.requestCache = new RequestCache();
+
+});
+
+AdapterBase.method('setFilter', function(filter) {
+ this.filter = filter;
+});
+
+AdapterBase.method('getFilter', function() {
+ return this.filter;
+});
+
+AdapterBase.method('setOrderBy', function(orderBy) {
+ this.orderBy = orderBy;
+});
+
+AdapterBase.method('getOrderBy', function() {
+ return this.orderBy;
+});
+
+/**
+ * @method add
+ * @param object {Array} object data to be added to database
+ * @param getFunctionCallBackData {Array} once a success is returned call get() function for this module with these parameters
+ * @param callGetFunction {Boolean} if false the get function of the module will not be called (default: true)
+ * @param successCallback {Function} this will get called after success response
+ */
+
+AdapterBase.method('add', function(object,getFunctionCallBackData,callGetFunction,successCallback) {
+ var that = this;
+ if(callGetFunction == undefined || callGetFunction == null){
+ callGetFunction = true;
+ }
+ $(object).attr('a','add');
+ $(object).attr('t',this.table);
+ $.post(this.moduleRelativeURL, object, function(data) {
+ if(data.status == "SUCCESS"){
+ that.addSuccessCallBack(getFunctionCallBackData,data.object, callGetFunction, successCallback, that);
+ }else{
+ that.addFailCallBack(getFunctionCallBackData,data.object);
+ }
+ },"json");
+ this.trackEvent("add",this.tab,this.table);
+});
+
+AdapterBase.method('addSuccessCallBack', function(callBackData,serverData, callGetFunction, successCallback, thisObject) {
+ if(callGetFunction){
+ this.get(callBackData);
+ }
+ this.initFieldMasterData();
+ if(successCallback != undefined && successCallback != null){
+ successCallback.apply(thisObject,[serverData]);
+ }
+ this.trackEvent("addSuccess",this.tab,this.table);
+});
+
+AdapterBase.method('addFailCallBack', function(callBackData,serverData) {
+ this.showMessage("Error saving",serverData);
+ this.trackEvent("addFailed",this.tab,this.table);
+});
+
+AdapterBase.method('deleteObj', function(id,callBackData) {
+ var that = this;
+ $.post(this.moduleRelativeURL, {'t':this.table,'a':'delete','id':id}, function(data) {
+ if(data.status == "SUCCESS"){
+ that.deleteSuccessCallBack(callBackData,data.object);
+ }else{
+ that.deleteFailCallBack(callBackData,data.object);
+ }
+ },"json");
+ this.trackEvent("delete",this.tab,this.table);
+});
+
+AdapterBase.method('deleteSuccessCallBack', function(callBackData,serverData) {
+ this.get(callBackData);
+ this.clearDeleteParams();
+});
+
+AdapterBase.method('deleteFailCallBack', function(callBackData,serverData) {
+ this.clearDeleteParams();
+ this.showMessage("Error Occurred while Deleting Item",serverData);
+});
+
+AdapterBase.method('get', function(callBackData) {
+ var that = this;
+
+ if(this.getRemoteTable()){
+ this.createTableServer(this.getTableName());
+ $("#"+this.getTableName()+'Form').hide();
+ $("#"+this.getTableName()).show();
+ return;
+ }
+
+ var sourceMappingJson = JSON.stringify(this.getSourceMapping());
+
+ var filterJson = "";
+ if(this.getFilter() != null){
+ filterJson = JSON.stringify(this.getFilter());
+ }
+
+ var orderBy = "";
+ if(this.getOrderBy() != null){
+ orderBy = this.getOrderBy();
+ }
+
+ sourceMappingJson = this.fixJSON(sourceMappingJson);
+ filterJson = this.fixJSON(filterJson);
+
+ $.post(this.moduleRelativeURL, {'t':this.table,'a':'get','sm':sourceMappingJson,'ft':filterJson,'ob':orderBy}, function(data) {
+ if(data.status == "SUCCESS"){
+ that.getSuccessCallBack(callBackData,data.object);
+ }else{
+ that.getFailCallBack(callBackData,data.object);
+ }
+ },"json");
+
+ that.initFieldMasterData();
+
+ this.trackEvent("get",this.tab,this.table);
+ //var url = this.getDataUrl();
+ //console.log(url);
+});
+
+
+AdapterBase.method('getDataUrl', function(columns) {
+ var that = this;
+ var sourceMappingJson = JSON.stringify(this.getSourceMapping());
+
+ var columns = JSON.stringify(columns);
+
+ var filterJson = "";
+ if(this.getFilter() != null){
+ filterJson = JSON.stringify(this.getFilter());
+ }
+
+ var orderBy = "";
+ if(this.getOrderBy() != null){
+ orderBy = this.getOrderBy();
+ }
+
+ var url = this.moduleRelativeURL.replace("service.php","data.php");
+ url = url+"?"+"t="+this.table;
+ url = url+"&"+"sm="+this.fixJSON(sourceMappingJson);
+ url = url+"&"+"cl="+this.fixJSON(columns);
+ url = url+"&"+"ft="+this.fixJSON(filterJson);
+ url = url+"&"+"ob="+orderBy;
+
+ if(this.isSubProfileTable()){
+ url = url+"&"+"type=sub";
+ }
+
+ if(this.remoteTableSkipProfileRestriction()){
+ url = url+"&"+"skip=1";
+ }
+
+ return url;
+});
+
+AdapterBase.method('isSubProfileTable', function() {
+ return false;
+});
+
+AdapterBase.method('remoteTableSkipProfileRestriction', function() {
+ return false;
+});
+
+AdapterBase.method('preProcessTableData', function(row) {
+ return row;
+});
+
+AdapterBase.method('getSuccessCallBack', function(callBackData,serverData) {
+ var data = [];
+ var mapping = this.getDataMapping();
+ for(var i=0;i ';
+ var editButton = ' ';
+
+ var table = $('
');
+
+ //add Header
+ var header = this.getSubHeader();
+ table.append(header);
+ if(data.length == 0){
+ table.append(''+this.getNoDataMessage()+' ');
+ }else{
+ for(var i=0;i'+this.getSubHeaderTitle()+' ');
+ return header;
+});
+
+
+
+/**
+ * IdNameAdapter
+ */
+
+function IdNameAdapter(endPoint) {
+ this.initAdapter(endPoint);
+}
+
+IdNameAdapter.inherits(AdapterBase);
+
+
+
+IdNameAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name"
+ ];
+});
+
+IdNameAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name"}
+ ];
+});
+
+IdNameAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "name", {"label":"Name","type":"text","validation":""}]
+ ];
+});
+
+
+
+/**
+ * RequestCache
+ */
+
+function RequestCache() {
+
+}
+
+RequestCache.method('getKey', function(url,params) {
+ var key = url+"|";
+ for(index in params){
+ key += index+"="+params[index]+"|";
+ }
+ return key;
+});
+
+RequestCache.method('getData', function(key) {
+ var data;
+ if (typeof(Storage) == "undefined") {
+ return null;
+ }
+
+ var strData = localStorage.getItem(key);
+ if(strData != undefined && strData != null && strData != ""){
+ return JSON.parse(strData);
+ }
+
+ return null;
+});
+
+RequestCache.method('setData', function(key, data) {
+
+ if (typeof(Storage) == "undefined") {
+ return null;
+ }
+
+ var strData = JSON.stringify(data);
+ var strData = localStorage.setItem(key,strData);
+ return strData;
+});
diff --git a/src/api/AesCrypt.js b/src/api/AesCrypt.js
new file mode 100644
index 00000000..d5204009
--- /dev/null
+++ b/src/api/AesCrypt.js
@@ -0,0 +1,503 @@
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+/* AES implementation in JavaScript (c) Chris Veness 2005-2014 / MIT Licence */
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+/* jshint node:true *//* global define */
+'use strict';
+
+
+/**
+ * AES (Rijndael cipher) encryption routines,
+ *
+ * Reference implementation of FIPS-197 http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf.
+ *
+ * @namespace
+ */
+var Aes = {};
+
+
+/**
+ * AES Cipher function: encrypt 'input' state with Rijndael algorithm [§5.1];
+ * applies Nr rounds (10/12/14) using key schedule w for 'add round key' stage.
+ *
+ * @param {number[]} input - 16-byte (128-bit) input state array.
+ * @param {number[][]} w - Key schedule as 2D byte-array (Nr+1 x Nb bytes).
+ * @returns {number[]} Encrypted output state array.
+ */
+Aes.cipher = function(input, w) {
+ var Nb = 4; // block size (in words): no of columns in state (fixed at 4 for AES)
+ var Nr = w.length/Nb - 1; // no of rounds: 10/12/14 for 128/192/256-bit keys
+
+ var state = [[],[],[],[]]; // initialise 4xNb byte-array 'state' with input [§3.4]
+ for (var i=0; i<4*Nb; i++) state[i%4][Math.floor(i/4)] = input[i];
+
+ state = Aes.addRoundKey(state, w, 0, Nb);
+
+ for (var round=1; round 6 && i%Nk == 4) {
+ temp = Aes.subWord(temp);
+ }
+ // xor w[i] with w[i-1] and w[i-Nk]
+ for (var t=0; t<4; t++) w[i][t] = w[i-Nk][t] ^ temp[t];
+ }
+
+ return w;
+};
+
+
+/**
+ * Apply SBox to state S [§5.1.1]
+ * @private
+ */
+Aes.subBytes = function(s, Nb) {
+ for (var r=0; r<4; r++) {
+ for (var c=0; c>> i*8) & 0xff;
+ for (var i=0; i<2; i++) counterBlock[i+2] = (nonceRnd >>> i*8) & 0xff;
+ for (var i=0; i<4; i++) counterBlock[i+4] = (nonceSec >>> i*8) & 0xff;
+
+ // and convert it to a string to go on the front of the ciphertext
+ var ctrTxt = '';
+ for (var i=0; i<8; i++) ctrTxt += String.fromCharCode(counterBlock[i]);
+
+ // generate key schedule - an expansion of the key into distinct Key Rounds for each round
+ var keySchedule = Aes.keyExpansion(key);
+
+ var blockCount = Math.ceil(plaintext.length/blockSize);
+ var ciphertxt = new Array(blockCount); // ciphertext as array of strings
+
+ for (var b=0; b>> c*8) & 0xff;
+ for (var c=0; c<4; c++) counterBlock[15-c-4] = (b/0x100000000 >>> c*8);
+
+ var cipherCntr = Aes.cipher(counterBlock, keySchedule); // -- encrypt counter block --
+
+ // block size is reduced on final block
+ var blockLength = b>> c*8) & 0xff;
+ for (var c=0; c<4; c++) counterBlock[15-c-4] = (((b+1)/0x100000000-1) >>> c*8) & 0xff;
+
+ var cipherCntr = Aes.cipher(counterBlock, keySchedule); // encrypt counter block
+
+ var plaintxtByte = new Array(ciphertext[b].length);
+ for (var i=0; i .
+
+------------------------------------------------------------------
+
+Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
+Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
+ */
+
+
+
+/**
+ * The base class for providing core functions to all module classes.
+ * @class Base.js
+ */
+function IceHRMBase() {
+ this.deleteParams = {};
+ this.createRemoteTable = false;
+ this.instanceId = "None";
+ this.ga = [];
+ this.showEdit = true;
+ this.showDelete = true;
+ this.showSave = true;
+ this.showCancel = true;
+ this.showFormOnPopup = false;
+ this.filtersAlreadySet = false;
+ this.currentFilterString = "";
+ this.sorting = 0;
+}
+
+this.fieldTemplates = null;
+this.templates = null;
+this.customTemplates = null;
+this.emailTemplates = null;
+this.fieldMasterData = null;
+this.fieldMasterDataKeys = null;
+this.fieldMasterDataCallback = null;
+this.sourceMapping = null;
+this.currentId = null;
+this.user = null;
+this.currentProfile = null;
+this.permissions = {};
+
+
+
+this.baseUrl = null;
+
+IceHRMBase.method('init' , function(appName, currentView, dataUrl, permissions) {
+
+});
+
+/**
+ * Some browsers do not support sending JSON in get parameters. Set this to true to avoid sending JSON
+ * @method setNoJSONRequests
+ * @param val {Boolean}
+ */
+IceHRMBase.method('setNoJSONRequests' , function(val) {
+ this.noJSONRequests = val;
+});
+
+
+IceHRMBase.method('setPermissions' , function(permissions) {
+ this.permissions = permissions;
+});
+
+IceHRMBase.method('sortingStarted' , function(val) {
+ this.sorting = val;
+});
+
+/**
+ * Check if the current user has a permission
+ * @method checkPermission
+ * @param permission {String}
+ * @example
+ * this.checkPermission("Upload/Delete Profile Image")
+ */
+IceHRMBase.method('checkPermission' , function(permission) {
+ if(this.permissions[permission] == undefined || this.permissions[permission] == null || this.permissions[permission] == "Yes"){
+ return "Yes";
+ }else{
+ return this.permissions[permission];
+ }
+});
+
+IceHRMBase.method('setBaseUrl' , function(url) {
+ this.baseUrl = url;
+});
+
+IceHRMBase.method('setUser' , function(user) {
+ this.user = user;
+});
+
+IceHRMBase.method('getUser' , function() {
+ return this.user;
+});
+
+IceHRMBase.method('setInstanceId' , function(id) {
+ this.instanceId = id;
+});
+
+IceHRMBase.method('setGoogleAnalytics' , function(ga) {
+ this.ga = ga;
+});
+
+/**
+ * If this method returned false the action buttons in data table for modules will not be displayed.
+ * Override this method in module lib.js to hide action buttons
+ * @method showActionButtons
+ * @param permission {String}
+ * @example
+ * EmployeeLeaveEntitlementAdapter.method('showActionButtons' , function() {
+ * return false;
+ * });
+ */
+IceHRMBase.method('showActionButtons' , function() {
+ return true;
+});
+
+IceHRMBase.method('trackEvent' , function(action, label, value) {
+ try{
+ if(label == undefined || label == null){
+ this.ga.push(['_trackEvent', this.instanceId, action]);
+ }else if(value == undefined || value == null){
+ this.ga.push(['_trackEvent', this.instanceId, action, label]);
+ }else{
+ this.ga.push(['_trackEvent', this.instanceId, action, label, value]);
+ }
+ }catch(e){
+
+ }
+
+
+});
+
+
+IceHRMBase.method('setCurrentProfile' , function(currentProfile) {
+ this.currentProfile = currentProfile;
+});
+
+/**
+ * Get the current profile
+ * @method getCurrentProfile
+ * @returns Profile of the current user if the profile is not switched if not switched profile
+ */
+
+IceHRMBase.method('getCurrentProfile' , function() {
+ return this.currentProfile;
+});
+
+/**
+ * Retrive data required to create select boxes for add new /edit forms for a given module. This is called when loading the module
+ * @method initFieldMasterData
+ * @param callback {Function} call this once loading completed
+ * @param callback {Function} call this once all field loading completed. This indicate that the form can be displayed saftly
+ * @example
+ * ReportAdapter.method('renderForm', function(object) {
+ * var that = this;
+ * this.processFormFieldsWithObject(object);
+ * var cb = function(){
+ * that.uber('renderForm',object);
+ * };
+ * this.initFieldMasterData(cb);
+ * });
+ */
+IceHRMBase.method('initFieldMasterData' , function(callback, loadAllCallback, loadAllCallbackData) {
+ var values;
+ if(this.showAddNew == undefined || this.showAddNew == null){
+ this.showAddNew = true;
+ }
+ this.fieldMasterData = {};
+ this.fieldMasterDataKeys = {};
+ this.fieldMasterDataCallback = loadAllCallback;
+ this.fieldMasterDataCallbackData = loadAllCallbackData;
+ this.sourceMapping = {};
+ var fields = this.getFormFields();
+ var filterFields = this.getFilters();
+
+ if(filterFields != null){
+ for(var j=0;j';
+ }
+
+ if(this.getFilters() != null){
+ if(html != ""){
+ html += " ";
+ }
+ html+='Fillter ';
+ html += " ";
+ if(this.filtersAlreadySet){
+ html+='__filterString__ ';
+ }else{
+ html+='__filterString__ ';
+ }
+
+ }
+
+ html = html.replace(/__id__/g, this.getTableName());
+
+ if(this.currentFilterString != "" && this.currentFilterString != null){
+ html = html.replace(/__filterString__/g, this.currentFilterString);
+ }else{
+ html = html.replace(/__filterString__/g, 'Reset Filters');
+ }
+
+ if(html != ""){
+ html = '';
+ }
+
+ return html;
+});
+
+
+IceHRMBase.method('getActionButtonHeader', function() {
+ return { "sTitle": "", "sClass": "center" };
+});
+
+IceHRMBase.method('getTableHTMLTemplate', function() {
+ return '';
+});
+
+/**
+ * Create the data table on provided element id
+ * @method createTable
+ * @param val {Boolean}
+ */
+
+IceHRMBase.method('createTable', function(elementId) {
+
+ if(this.getRemoteTable()){
+ this.createTableServer(elementId);
+ return;
+ }
+
+
+ var headers = this.getHeaders();
+ var data = this.getTableData();
+
+ if(this.showActionButtons()){
+ headers.push(this.getActionButtonHeader());
+ }
+
+
+ if(this.showActionButtons()){
+ for(var i=0;i';
+ }else{
+ html = '';
+ }
+ */
+ //Find current page
+ var activePage = $('#'+elementId +" .dataTables_paginate .active a").html();
+ var start = 0;
+ if(activePage != undefined && activePage != null){
+ start = parseInt(activePage, 10)*15 - 15;
+ }
+
+ $('#'+elementId).html(html);
+
+ var dataTableParams = {
+ "oLanguage": {
+ "sLengthMenu": "_MENU_ records per page"
+ },
+ "aaData": data,
+ "aoColumns": headers,
+ "bSort": true,
+ "iDisplayLength": 15,
+ "iDisplayStart": start
+ };
+
+
+ var customTableParams = this.getCustomTableParams();
+
+ $.extend(dataTableParams, customTableParams);
+
+ $('#'+elementId+' #grid').dataTable( dataTableParams );
+
+ $(".dataTables_paginate ul").addClass("pagination");
+ $(".dataTables_length").hide();
+ $(".dataTables_filter input").addClass("form-control");
+ $(".dataTables_filter input").attr("placeholder","Search");
+ $(".dataTables_filter label").contents().filter(function(){
+ return (this.nodeType == 3);
+ }).remove();
+ $('.tableActionButton').tooltip();
+});
+
+/**
+ * Create a data table on provided element id which loads data page by page
+ * @method createTableServer
+ * @param val {Boolean}
+ */
+
+IceHRMBase.method('createTableServer', function(elementId) {
+ var that = this;
+ var headers = this.getHeaders();
+
+ headers.push({ "sTitle": "", "sClass": "center" });
+
+ var html = "";
+ html = this.getTableTopButtonHtml() + this.getTableHTMLTemplate();
+ /*
+ if(this.getShowAddNew()){
+ html = this.getTableTopButtonHtml()+'';
+ }else{
+ html = '';
+ }
+ */
+
+ //Find current page
+ var activePage = $('#'+elementId +" .dataTables_paginate .active a").html();
+ var start = 0;
+ if(activePage != undefined && activePage != null){
+ start = parseInt(activePage, 10)*15 - 15;
+ }
+
+
+ $('#'+elementId).html(html);
+
+ var dataTableParams = {
+ "oLanguage": {
+ "sLengthMenu": "_MENU_ records per page"
+ },
+ "bProcessing": true,
+ "bServerSide": true,
+ "sAjaxSource": that.getDataUrl(that.getDataMapping()),
+ "aoColumns": headers,
+ "bSort": true,
+ "parent":that,
+ "iDisplayLength": 15,
+ "iDisplayStart": start
+ };
+
+ if(this.showActionButtons()){
+ dataTableParams["aoColumnDefs"] = [
+ {
+ "fnRender": that.getActionButtons,
+ "aTargets": [that.getDataMapping().length]
+ }
+ ];
+ }
+
+ var customTableParams = this.getCustomTableParams();
+
+ $.extend(dataTableParams, customTableParams);
+
+ $('#'+elementId+' #grid').dataTable( dataTableParams );
+
+ $(".dataTables_paginate ul").addClass("pagination");
+ $(".dataTables_length").hide();
+ $(".dataTables_filter input").addClass("form-control");
+ $(".dataTables_filter input").attr("placeholder","Search");
+ $(".dataTables_filter label").contents().filter(function(){
+ return (this.nodeType == 3);
+ }).remove();
+
+ $('.tableActionButton').tooltip();
+});
+
+/**
+ * This should be overridden in module lib.js classes to return module headers which are used to create the data table.
+ * @method getHeaders
+ * @example
+ SettingAdapter.method('getHeaders', function() {
+ return [
+ { "sTitle": "ID" ,"bVisible":false},
+ { "sTitle": "Name" },
+ { "sTitle": "Value"},
+ { "sTitle": "Details"}
+ ];
+ });
+ */
+IceHRMBase.method('getHeaders', function() {
+
+});
+
+
+/**
+ * This should be overridden in module lib.js classes to return module field values which are used to create the data table.
+ * @method getDataMapping
+ * @example
+ SettingAdapter.method('getDataMapping', function() {
+ return [
+ "id",
+ "name",
+ "value",
+ "description"
+ ];
+ });
+ */
+
+IceHRMBase.method('getDataMapping', function() {
+
+});
+
+/**
+ * This should be overridden in module lib.js classes to return module from fields which are used to create the add/edit form and also used for initializing select box values in form.
+ * @method getFormFields
+ * @example
+ SettingAdapter.method('getFormFields', function() {
+ return [
+ [ "id", {"label":"ID","type":"hidden"}],
+ [ "value", {"label":"Value","type":"text","validation":"none"}]
+ ];
+ });
+ */
+IceHRMBase.method('getFormFields', function() {
+
+});
+
+IceHRMBase.method('getTableData', function() {
+
+});
+
+/**
+ * This can be overridden in module lib.js classes inorder to show a filter form
+ * @method getFilters
+ * @example
+ EmployeeAdapter.method('getFilters', function() {
+ return [
+ [ "job_title", {"label":"Job Title","type":"select2","allow-null":true,"null-label":"All Job Titles","remote-source":["JobTitle","id","name"]}],
+ [ "department", {"label":"Department","type":"select2","allow-null":true,"null-label":"All Departments","remote-source":["CompanyStructure","id","title"]}],
+ [ "supervisor", {"label":"Supervisor","type":"select2","allow-null":true,"null-label":"Anyone","remote-source":["Employee","id","first_name+last_name"]}]
+ ];
+ });
+ */
+IceHRMBase.method('getFilters', function() {
+ return null;
+});
+
+/**
+ * Show the edit form for an item
+ * @method edit
+ * @param id {int} id of the item to edit
+ */
+IceHRMBase.method('edit', function(id) {
+ this.currentId = id;
+ this.getElement(id,[]);
+});
+
+IceHRMBase.method('renderModel', function(id,header,body) {
+ $('#'+id+'ModelBody').html("");
+
+ if(body == undefined || body == null){
+ body = "";
+ }
+
+ $('#'+id+'ModelLabel').html(header);
+ $('#'+id+'ModelBody').html(body);
+});
+
+IceHRMBase.method('renderModelFromDom', function(id,header,element) {
+ $('#'+id+'ModelBody').html("");
+
+ if(element == undefined || element == null){
+ element = $("
");
+ }
+
+ $('#'+id+'ModelLabel').html(header);
+ $('#'+id+'ModelBody').html("");
+ $('#'+id+'ModelBody').append(element);
+});
+
+/**
+ * Delete an item
+ * @method deleteRow
+ * @param id {int} id of the item to edit
+ */
+
+IceHRMBase.method('deleteRow', function(id) {
+ this.deleteParams['id'] = id;
+ this.renderModel('delete',"Confirm Deletion","Are you sure you want to delete this item ?");
+ $('#deleteModel').modal('show');
+
+});
+
+/**
+ * Show a popup with message
+ * @method showMessage
+ * @param title {String} title of the message box
+ * @param message {String} message
+ * @param closeCallback {Function} this will be called once the dialog is closed (optional)
+ * @param closeCallback {Function} data to pass to close callback (optional)
+ * @param isPlain {Boolean} if true buttons are not shown (optional / default = true)
+ * @example
+ * this.showMessage("Error Occured while Applying Leave", callBackData);
+ */
+IceHRMBase.method('showMessage', function(title,message,closeCallback,closeCallbackData, isPlain) {
+ var that = this;
+ var modelId = "";
+ if(isPlain){
+ modelId = "#plainMessageModel";
+ this.renderModel('plainMessage',title,message);
+ }else{
+ modelId = "#messageModel";
+ this.renderModel('message',title,message);
+ }
+
+ $(modelId).unbind('hide');
+ if(closeCallback != null && closeCallback != undefined){
+ $(modelId).on('hidden.bs.modal',function(){
+ closeCallback.apply(that,closeCallbackData);
+ $(modelId).unbind('hidden.bs.modal');
+ });
+ }
+ $(modelId).modal({
+ backdrop: 'static'
+ });
+});
+
+IceHRMBase.method('showDomElement', function(title,element,closeCallback,closeCallbackData, isPlain) {
+ var that = this;
+ var modelId = "";
+ if(isPlain){
+ modelId = "#plainMessageModel";
+ this.renderModelFromDom('plainMessage',title,element);
+ }else{
+ modelId = "#messageModel";
+ this.renderModelFromDom('message',title,element);
+ }
+
+ $(modelId).unbind('hide');
+ if(closeCallback != null && closeCallback != undefined){
+ $(modelId).on('hidden.bs.modal',function(){
+ closeCallback.apply(that,closeCallbackData);
+ $(modelId).unbind('hidden.bs.modal');
+ });
+ }
+ $(modelId).modal({
+ backdrop: 'static'
+ });
+});
+
+IceHRMBase.method('confirmDelete', function() {
+ if(this.deleteParams['id'] != undefined || this.deleteParams['id'] != null){
+ this.deleteObj(this.deleteParams['id'],[]);
+ }
+ $('#deleteModel').modal('hide');
+});
+
+IceHRMBase.method('cancelDelete', function() {
+ $('#deleteModel').modal('hide');
+ this.deleteParams['id'] = null;
+});
+
+IceHRMBase.method('closeMessage', function() {
+ $('#messageModel').modal('hide');
+});
+
+IceHRMBase.method('closePlainMessage', function() {
+ $('#plainMessageModel').modal('hide');
+});
+
+
+/**
+ * Create or edit an element
+ * @method save
+ * @param getFunctionCallBackData {Array} once a success is returned call get() function for this module with these parameters
+ * @param successCallback {Function} this will get called after success response
+ */
+
+IceHRMBase.method('save', function(callGetFunction, successCallback) {
+ var validator = new FormValidation(this.getTableName()+"_submit",true,{'ShowPopup':false,"LabelErrorClass":"error"});
+ if(validator.checkValues()){
+ var params = validator.getFormParameters();
+ params = this.forceInjectValuesBeforeSave(params);
+ var msg = this.doCustomValidation(params);
+ if(msg == null){
+ var id = $('#'+this.getTableName()+"_submit #id").val();
+ if(id != null && id != undefined && id != ""){
+ $(params).attr('id',id);
+ }
+ this.add(params,[],callGetFunction, successCallback);
+ }else{
+ $("#"+this.getTableName()+'Form .label').html(msg);
+ $("#"+this.getTableName()+'Form .label').show();
+ }
+
+ }
+});
+
+/**
+ * Override this method to inject attitional parameters or modify existing parameters retrived from add/edit form before sending to the server
+ * @method forceInjectValuesBeforeSave
+ * @param params {Array} keys and values in form
+ * @returns {Array} modified parameters
+ */
+IceHRMBase.method('forceInjectValuesBeforeSave', function(params) {
+ return params;
+});
+
+/**
+ * Override this method to do custom validations at client side
+ * @method doCustomValidation
+ * @param params {Array} keys and values in form
+ * @returns {Null or String} return null if validation success, returns error message if unsuccessful
+ * @example
+ EmployeeLeaveAdapter.method('doCustomValidation', function(params) {
+ try{
+ if(params['date_start'] != params['date_end']){
+ var ds = new Date(params['date_start']);
+ var de = new Date(params['date_end']);
+ if(de < ds){
+ return "Start date should be earlier than end date of the leave period";
+ }
+ }
+ }catch(e){
+
+ }
+ return null;
+});
+ */
+IceHRMBase.method('doCustomValidation', function(params) {
+ return null;
+});
+
+IceHRMBase.method('filterQuery', function() {
+
+ var validator = new FormValidation(this.getTableName()+"_filter",true,{'ShowPopup':false,"LabelErrorClass":"error"});
+ if(validator.checkValues()){
+ var params = validator.getFormParameters();
+ if(this.doCustomFilterValidation(params)){
+
+ //remove null params
+ for (var prop in params) {
+ if(params.hasOwnProperty(prop)){
+ if(params[prop] == "NULL"){
+ delete(params[prop]);
+ }
+ }
+ }
+
+ this.setFilter(params);
+ this.filtersAlreadySet = true;
+ $("#"+this.getTableName()+"_resetFilters").show();
+ this.currentFilterString = this.getFilterString(params);
+
+ this.get([]);
+ this.closePlainMessage();
+ }
+
+ }
+});
+
+
+IceHRMBase.method('getFilterString', function(filters) {
+
+ var str = '';
+ var rmf, source, values, select2MVal, value, valueOrig;
+
+ var filterFields = this.getFilters();
+
+
+ if(values == null){
+ values = [];
+ }
+
+ for (var prop in filters) {
+ if(filters.hasOwnProperty(prop)){
+ values = this.getMetaFieldValues(prop,filterFields);
+ value = "";
+ valueOrig = null;
+
+ if((values['type'] == 'select' || values['type'] == 'select2')){
+
+ if(values['remote-source']!= undefined && values['remote-source']!= null){
+ rmf = values['remote-source'];
+ if(filters[prop] == "NULL"){
+ if(values['null-label'] != undefined && values['null-label'] != null){
+ value = values['null-label'];
+ }else{
+ value = "Not Selected";
+ }
+ }else{
+ value = this.fieldMasterData[rmf[0]+"_"+rmf[1]+"_"+rmf[2]][filters[prop]];
+ valueOrig = value;
+ }
+
+
+ }else{
+ source = values['source'][0];
+ if(filters[prop] == "NULL"){
+ if(values['null-label'] != undefined && values['null-label'] != null){
+ value = values['null-label'];
+ }else{
+ value = "Not Selected";
+ }
+ }else{
+ for(var i=0; i