Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# Updated :
ListController (used to view By UserName records)

# EndPoints :

https://localhost:3000/secured/list
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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<AttendanceDTO> listFormBackingObject()
{
logger.info("listFormBackingObject");
return attendanceRepo.findAll();
}


@GetMapping("/secured/list")
public String listFormBackingObject()
public List<AttendanceDTO> findById(HttpServletRequest request)
{

}*/
logger.info(request.getRemoteUser());
return attendanceRepo.findByUserName(request.getRemoteUser());
}





}
57 changes: 3 additions & 54 deletions src/main/resources/static/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
1 change: 1 addition & 0 deletions src/main/resources/templates/attendanceSignIn.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<head>
<meta charset="ISO-8859-1">
<title>AttendanceSignIn</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" th:href="@{/assets/css/mainMenu.css}"></link>
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/templates/attendanceSignOut.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<head>
<meta charset="ISO-8859-1">
<title>AttendanceSignOut</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" th:href="@{/assets/css/mainMenu.css}"></link>
</head>
<body>
Expand Down
Binary file modified src/main/resources/templates/mainMenu.html
Binary file not shown.
16 changes: 8 additions & 8 deletions src/main/resources/templates/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" th:href="@{/assets/css/styles.css}"></link>

<script type="text/javascript" th:src="@{/js/custom.js}"></script>



</head>

Expand All @@ -15,14 +16,13 @@
<body>
<script th:inline ="javascript">
alert('hello');


function myfn()
{
console.log('myfn')
}



function myfn()
{
alert('hi')
}
</script>

<h1> User Register </h1>
Expand Down Expand Up @@ -72,7 +72,7 @@ <h1> Register Form</h1>
</table>

<div class="row" align="center">
<button type="submit">Submit</button>
<button type="submit" class="btn">Submit</button>
</div>
</form>
</div>
Expand Down
104 changes: 104 additions & 0 deletions src/main/resources/templates/register2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<html xmlns:th="http://www.thymeleaf.org">

<head>
<title>User Register</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" th:href="@{/assets/css/styles.css}"></link>




</head>




<body>
<script th:inline ="javascript">
alert('hello');



function hi()
{
alert('i');
}

</script>

<h1> User Register </h1>
<div id="wrapper">
<h1> Register Form</h1>
<p>Greetings, it is now, <i th:text="${headerMsg}"></i> </p>
<form action="#" th:action="@{/registerForm}" th:object="${user}" method="post" autocomplete="off">

<table id="table_id">
<tr>
<th>Name:</th>
<td><input type="text" th:field="*{name}" /></td>
<td th:if="${#fields.hasErrors('name')}" th:errors="*{name}" id="name" required onclick="hi()">Name Error</td>
</tr>

<tr>
<th>User Name:</th>
<td><input type="text" th:field="*{username}" /></td>
<td th:if="${#fields.hasErrors('username')}" th:errors="*{username}" id="username" onclick="pr_username()" >User Name Error</td>
</tr>


<tr>
<th>Email:</th>
<td><input type="text" th:field="*{email}" /></td>
<td th:if="${#fields.hasErrors('email')}" th:errors="*{email}" id="email" required >Email Error</td>
</tr>

<tr>
<th>Password:</th>
<td><input type="password" th:field="*{password}" /></td>
<td th:if="${#fields.hasErrors('password')}" th:errors="*{password}" id="password" required >Password Error</td>
</tr>

<tr>
<th>Confirm Password:</th>
<td><input type="password" th:field="*{confirmPassword}" /></td>
<td th:if="${#fields.hasErrors('confirmPassword')}" th:errors="*{confirmPassword}" id="confirmPassword" required >ConfirmPassword Error</td>
</tr>

<tr>
<th>Role:</th>
<td><input type="text" th:field="*{role}" /></td>
<td th:if="${#fields.hasErrors('role')}" th:errors="*{role}" id="role" required >Role</td>
</tr>

</table>

<div class="row" align="center">
<button type="submit" class="btn">Submit</button>
</div>
</form>
</div>

<div class="footer" >


<p>&copy; Copyright 2019 create by Emmanuel</p>
</div>

<div th:include="footer :: copy">


</div>







</body>





</html>