diff --git a/.gitignore b/.gitignore index 7ea0e6e..75dd9c0 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,4 @@ HELP.md /nbdist/ /.nb-gradle/ /build/ -C:\Users\user\Downloads\attendance-project\target\classes\com\project\attendanceproject -C:/Users/user/Downloads/attendance-project/target/classes/com/project/attendanceproject \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9f0b137 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ + +# Updated : + ListController (used to view By UserName records) + +# EndPoints : + + https://localhost:3000/secured/list diff --git a/src/main/java/com/project/attendanceproject/controller/AttendanceController.java b/src/main/java/com/project/attendanceproject/controller/AttendanceController.java index 466afc6..b75fd07 100644 --- a/src/main/java/com/project/attendanceproject/controller/AttendanceController.java +++ b/src/main/java/com/project/attendanceproject/controller/AttendanceController.java @@ -324,27 +324,33 @@ public String SignOutOnSubmit(@ModelAttribute("attendanceSignOut")AttendanceDTO boolean halfDayPresent = false; //update - if(diffInHours <=8 && diffInHours >= 4 ) + if(diffInHours == 4 && (!( diffInHours<=8))) { - - fullDayPresent = true; - halfDayPresent = false; + log.info("HalfDay Present"); + fullDayPresent = false; + halfDayPresent = true; unlock = true; + dto.setFullDayPresent(fullDayPresent); + dto.setHalfDayPresent(halfDayPresent); + dto.setUnlock(unlock); } - else if(diffInHours >= 4 &&(!( diffInHours>=8) )) + else if(diffInHours >= 4 &&(!( diffInHours<=8) )) { - fullDayPresent = false; - halfDayPresent = true; + log.info("FullDay Present"); + fullDayPresent = true; + halfDayPresent = false; + dto.setFullDayPresent(fullDayPresent); + dto.setHalfDayPresent(halfDayPresent); + dto.setUnlock(unlock); } else { unlock = false; + dto.setUnlock(unlock); } - dto.setFullDayPresent(fullDayPresent); - dto.setHalfDayPresent(halfDayPresent); - dto.setUnlock(unlock); + attendanceRepo.save(dto); diff --git a/src/main/java/com/project/attendanceproject/controller/ListController.java b/src/main/java/com/project/attendanceproject/controller/ListController.java index 5605438..24d8b8b 100644 --- a/src/main/java/com/project/attendanceproject/controller/ListController.java +++ b/src/main/java/com/project/attendanceproject/controller/ListController.java @@ -1,15 +1,51 @@ package com.project.attendanceproject.controller; -import org.springframework.stereotype.Controller; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; -//@Controller +import com.project.attendanceproject.dto.AttendanceDTO; +import com.project.attendanceproject.interfaces.AttendanceRepository; + +@RestController public class ListController { + + + @Autowired + AttendanceRepository attendanceRepo; + + + //logger + private static final Log logger = LogFactory.getLog(ListController.class); + /** + * + * @return + */ + //@GetMapping("/secured/list") + public List listFormBackingObject() + { + logger.info("listFormBackingObject"); + return attendanceRepo.findAll(); + } + + @GetMapping("/secured/list") - public String listFormBackingObject() + public List findById(HttpServletRequest request) { - - }*/ + logger.info(request.getRemoteUser()); + return attendanceRepo.findByUserName(request.getRemoteUser()); + } + + + + + } diff --git a/src/main/resources/static/js/custom.js b/src/main/resources/static/js/custom.js index c8f0a76..3e066a3 100644 --- a/src/main/resources/static/js/custom.js +++ b/src/main/resources/static/js/custom.js @@ -8,60 +8,9 @@ * while blur of confirmPassword the */ +console.log(window); - -function pr_checkPassword() -{ - console.log('checkPassword') - - alert('checkPassword') - - if((document.getElementById('confirmPassword').value)===(document.getElementById('password').value) && (!document.getElementById('confirmPassword').value)==(document.getElementById('password').value)) - { - - } - - else - { - alert('password not match ') - - - } -} - - - - -function co_isEmailAddress(elem) -{ - - var x= pr_checkPassword(); - - - alert(x); -} - - - -function myFunction() -{ - - - console.log('myFn'); - alert('page is loaded'); -} - -function pr_username() -{ - - console.log('un') - alert('username is loaded'); -} - - - -function myfn() +function hi() { - - alert('myfn'); + alert('hi'); } \ No newline at end of file diff --git a/src/main/resources/templates/attendanceSignIn.html b/src/main/resources/templates/attendanceSignIn.html index 2f9a0b4..ce277c4 100644 --- a/src/main/resources/templates/attendanceSignIn.html +++ b/src/main/resources/templates/attendanceSignIn.html @@ -2,6 +2,7 @@ AttendanceSignIn + diff --git a/src/main/resources/templates/attendanceSignOut.html b/src/main/resources/templates/attendanceSignOut.html index 4882186..e554564 100644 --- a/src/main/resources/templates/attendanceSignOut.html +++ b/src/main/resources/templates/attendanceSignOut.html @@ -2,6 +2,7 @@ AttendanceSignOut + diff --git a/src/main/resources/templates/mainMenu.html b/src/main/resources/templates/mainMenu.html index 080e7e2..4b9cacd 100644 Binary files a/src/main/resources/templates/mainMenu.html and b/src/main/resources/templates/mainMenu.html differ diff --git a/src/main/resources/templates/register.html b/src/main/resources/templates/register.html index 58d3f38..890a1f5 100644 --- a/src/main/resources/templates/register.html +++ b/src/main/resources/templates/register.html @@ -5,7 +5,8 @@ - + + @@ -15,14 +16,13 @@

User Register

@@ -72,7 +72,7 @@

Register Form

- +
diff --git a/src/main/resources/templates/register2.html b/src/main/resources/templates/register2.html new file mode 100644 index 0000000..f11122b --- /dev/null +++ b/src/main/resources/templates/register2.html @@ -0,0 +1,104 @@ + + + + User Register + + + + + + + + + + + + + + +

User Register

+
+

Register Form

+

Greetings, it is now,

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:Name Error
User Name:User Name Error
Email:Email Error
Password:Password Error
Confirm Password:ConfirmPassword Error
Role:Role
+ +
+ +
+
+
+ + + +
+ + +
+ + + + + + + + + + + + + + \ No newline at end of file