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;
    }
 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);
 }