private function hasAllRequiredDoucments()
 {
     $userID = $this->getCurrentProfileId();
     $allRequiredDoucments = new Document();
     $allRequiredDoucments = $allRequiredDoucments->Find('required = ?', array('Yes'));
     foreach ($allRequiredDoucments as $requiredDoucment) {
         $employeeDocument = new EmployeeDocument();
         $hasDoucment = $employeeDocument->count('employee = ? AND document=? AND status = "Active"', array($userID, $requiredDoucment->id));
         if ($hasDoucment == 0) {
             return false;
         }
     }
     return true;
 }
 public function hasAllRequiredDoucments()
 {
     $userID = $this->getCurrentProfileId();
     $allRequiredDoucments = new Document();
     $allRequiredDoucments = $allRequiredDoucments->Find('required = ?', array('Yes'));
     foreach ($allRequiredDoucments as $requiredDoucment) {
         $employeeDocument = new EmployeeDocument();
         $hasDoucment = $employeeDocument->count('employee = ? AND document=? AND status = "Active"', array($userID, $requiredDoucment->id));
         if ($hasDoucment == 0) {
             return new IceResponse(IceResponse::ERROR, 0);
         }
     }
     return new IceResponse(IceResponse::SUCCESS, 1);
 }
    public function getDoucments($req)
    {
        $userID = $_REQUEST['req'];
        $documents = new Document();
        $documents = $documents->Find();
        $html = "";
        $userID = $this->getCurrentProfileId();
        $allRequiredDoucments = new Document();
        $allRequiredDoucments = $allRequiredDoucments->Find('');
        foreach ($allRequiredDoucments as $requiredDoucment) {
            $employeeDocument = new EmployeeDocument();
            $hasDoucment = $employeeDocument->count('employee = ? AND document=? AND status = "Active"', array($userID, $requiredDoucment->id));
            if ($hasDoucment == 0) {
                $html .= '<div style="font-size:16px;" class="col-xs-6 col-md-3">
							<label style="font-size:13px;" class="control-label col-xs-12">Required Documents</label>
							<label id="emergency_contact_name" style="font-size:13px;font-weight: bold;color:red" class="control-label col-xs-12 iceLabel">' . $requiredDoucment->name . '</label>
						</div>
                        ';
            } else {
                $html .= '<div style="font-size:16px;" class="col-xs-6 col-md-3">
							<label style="font-size:13px;" class="control-label col-xs-12">Required Documents</label>
							<label id="emergency_contact_name" style="font-size:13px;font-weight: bold;" class="control-label col-xs-12 iceLabel">' . $requiredDoucment->name . '</label>
						</div>
                        ';
            }
        }
        print_r($html);
        exit;
    }
EmployeeSalary::SetDatabaseAdapter($dbLocal);
LeaveType::SetDatabaseAdapter($dbLocal);
LeavePeriod::SetDatabaseAdapter($dbLocal);
WorkDay::SetDatabaseAdapter($dbLocal);
HoliDay::SetDatabaseAdapter($dbLocal);
LeaveRule::SetDatabaseAdapter($dbLocal);
EmployeeLeave::SetDatabaseAdapter($dbLocal);
EmployeeLeaveDay::SetDatabaseAdapter($dbLocal);
File::SetDatabaseAdapter($dbLocal);
Client::SetDatabaseAdapter($dbLocal);
Project::SetDatabaseAdapter($dbLocal);
EmployeeTimeSheet::SetDatabaseAdapter($dbLocal);
EmployeeTimeEntry::SetDatabaseAdapter($dbLocal);
EmployeeProject::SetDatabaseAdapter($dbLocal);
Document::SetDatabaseAdapter($dbLocal);
EmployeeDocument::SetDatabaseAdapter($dbLocal);
CompanyLoan::SetDatabaseAdapter($dbLocal);
EmployeeCompanyLoan::SetDatabaseAdapter($dbLocal);
Setting::SetDatabaseAdapter($dbLocal);
ChiNhanh::SetDatabaseAdapter($dbLocal);
Ca::SetDatabaseAdapter($dbLocal);
BoPhan::SetDatabaseAdapter($dbLocal);
Nguon::SetDatabaseAdapter($dbLocal);
LoaiNgay::SetDatabaseAdapter($dbLocal);
NVState::SetDatabaseAdapter($dbLocal);
NhanVien::SetDatabaseAdapter($dbLocal);
NhuCauTuyenDung::SetDatabaseAdapter($dbLocal);
$baseService = new BaseService();
$baseService->setNonDeletables("User", "id", 1);
$baseService->setCurrentUser($user);
$baseService->setDB($dbLocal);