Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public List<Borrow> getBorrowHistory(Integer pageNo, Integer pageSize, String so
@Override
@Transactional
// @Scheduled(cron="* */1 * * * * ")
@Scheduled(cron = "0 0 12 * * ?")
@Scheduled(cron = "0 0 12 * * ?")
public void sendMails() {

Collection<Borrow> borrow = borrowRepository.findbyBorrowIdandStatus();
Expand Down
2 changes: 2 additions & 0 deletions FrontEnd/Library/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { ForgotpasswordComponent } from './forgotpassword/forgotpassword.compone
import { Sidenav2Component } from './sidenav2/sidenav2.component';
import { Navbar2Component } from './navbar2/navbar2.component';
import { AdminNavbarComponent } from './admin-navbar/admin-navbar.component';
import { HomepageComponent } from './homepage/homepage.component';
import { UserDetailviewComponent } from './user-detailview/user-detailview.component';

const routes: Routes = [
Expand Down Expand Up @@ -65,6 +66,7 @@ const routes: Routes = [
{path:'navbar2',component:Navbar2Component,canActivate: [HomeguardGuard]},
{path:'sidenav2',component:Sidenav2Component,canActivate: [HomeguardGuard]},
{path:'admin-navbar',component:AdminNavbarComponent,canActivate: [HomeguardGuard]},
{path:'homepage',component:HomepageComponent,canActivate:[HomeguardGuard]},
{path:'user-detailview',component:UserDetailviewComponent,canActivate: [HomeguardGuard]}
];

Expand Down
7 changes: 6 additions & 1 deletion FrontEnd/Library/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ import {Chart} from 'chart.js';
import { Sidenav2Component } from './sidenav2/sidenav2.component';
import { Navbar2Component } from './navbar2/navbar2.component';
import { AdminNavbarComponent } from './admin-navbar/admin-navbar.component';
import { HomepageComponent } from './homepage/homepage.component';
import { UserDetailviewComponent } from './user-detailview/user-detailview.component';
import {MatTableModule} from '@angular/material/table';


// import {MatIconModule} from '@angular/material/icon';
// import { MatToolbarModule } from '@angular/material';
Expand Down Expand Up @@ -98,6 +101,7 @@ import { UserDetailviewComponent } from './user-detailview/user-detailview.compo
Sidenav2Component,
Navbar2Component,
AdminNavbarComponent,
HomepageComponent,
UserDetailviewComponent,
// Chart

Expand All @@ -123,7 +127,8 @@ import { UserDetailviewComponent } from './user-detailview/user-detailview.compo
MatDialogModule,
MatInputModule,
MatListModule,
MatGridListModule
MatGridListModule,
MatTableModule

// Chart

Expand Down
82 changes: 59 additions & 23 deletions FrontEnd/Library/src/app/booksdisplay/booksdisplay.component.css
Original file line number Diff line number Diff line change
@@ -1,87 +1,123 @@
p{
p {
padding: 0px 0px 30px 1000px;
margin: 0px;
background-color: rgb(0, 0, 0);
/* background-image: url('../../../a.png'); */


}

.btnhome{
.btnhome {
margin-top: 20px;
margin-bottom: 10px;
padding: 7;
border-color: rgb(124, 241, 134);
background-color: rgba(83, 254, 3, 0.853);
font-size: 13px;
border-radius: 25px;

}

.text-danger1{
.text-danger1 {

width: 160%;
padding: 8px 6px;
margin: 0px;
box-sizing: border-box;
border: 1px ;
border: 1px;
background-color: #a7bdb08f;
color: rgb(0, 0, 0);
border-radius: 7px;

}

.dropbtn{
.dropbtn {
width: 160%;
padding: 8px 6px;
margin: 0px;
box-sizing: border-box;
border: 1px ;
border: 1px;
background-color: #a7bdb08f;
color: rgb(0, 0, 0);
border-radius: 7px;
}
.btn{

.btn {
width: 150%;
padding: 7px 2px;
margin: 5px ;
margin: 5px;
box-sizing: border-box;
border: 2px solid rgb(250, 97, 97);
background-color:rgba(106, 215, 56, 0.682);
background-color: rgba(106, 215, 56, 0.682);
color: rgb(0, 0, 0);
border-radius: 7px;
}
.table-bordered{

.table-bordered {
border: 1px solid;
}

th {
background-color: #232524;
color: white;
width: 15%;
text-align: center;
}
td {
}

/* td {
background-color: #a7bdb08f;
color: rgb(0, 0, 0);
width: 15%;
text-align: center;
margin-top: auto;
padding: auto;
}
} */


.btnList{
.btnList {
border: none;
padding: 1px;
background: rgb(0, 0, 0);
font-size: 13px;
font-style: italic ;
font-style: italic;
color: rgb(255, 255, 255);
border-radius: 3px;
}
.btnn2{
padding-left: 10px;padding-right: 10px;

.btnn2 {
color: white;
padding-left: 10px;
padding-right: 10px;
border-color: rgb(0, 0, 0);
background-color: rgb(64, 133, 238);
background-color: black;
font-size: 13px;
}

.grid {
border-width: 2px;
width: 50%;
}

mat-grid-tile {
border-radius: 10px;
background: lightblue;
height: 100px;
}

.table {
margin-left: 100px;
width: 300px;
height: 250px;


}

.example-card {
max-width: 400px;
}

.example-header-image {
background-image: url('https://material.angular.io/assets/img/examples/shiba1.jpg');
background-size: cover;
}
@media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}
109 changes: 51 additions & 58 deletions FrontEnd/Library/src/app/booksdisplay/booksdisplay.component.html
Original file line number Diff line number Diff line change
@@ -1,65 +1,58 @@
<app-sidenav2></app-sidenav2>
<router-outlet></router-outlet>
<!-- <p>
<br><input type="button" style = "position:absolute; left:1200px; top:20px;" class="btnhome" name="HomE" value="HomE" (click)="home()"><br><br>
</p> -->
<div class="text-center">
<form>
<div class="card-box">
<div class="row">
<div class="table-responsive"><br>
<h1 style="text-align:center ;">Books Details</h1>
<div class="text-center">
<div class="card-box">
<div class="row">
<div class="table-responsive"><br>
<div style="display: grid; place-items: center;">
<h1 style="text-align:center;color:rgb(4, 9, 31);">Books Details</h1>
<table class="table table-striped w-auto" style="margin-left: 100px; height: 250px;width: 300px;">

<thead>
<tr role="row">
<th (click)="sortfn('booksName')">Book Name
<button mat-icon-button *ngIf="this.direction==1"> <i class="material-icons"
style="color:rgb(23, 23, 26)">arrow_drop_up</i></button>
<button mat-icon-button *ngIf="this.direction==-1"> <i class="material-icons"
style="color:rgb(23, 23, 26)">arrow_drop_down</i></button>
</th>
<th (click)="sortfn('category.categoryName')">Category-Name</th>
<th (click)="sortfn('publication')">Publication</th>
<th (click)="sortfn('auther')">Auther</th>
<th (click)="sortfn('booksCopies')">Book Copies</th>
<th>Book cover</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let books of data | paginate
: {
itemsPerPage: tableSize,
currentPage: page,
totalItems: count
};

">

<table class="table table-striped" align="center" class="table-bordered" id="datatable" role="grid" >

<thead class="bg-primary text-white">
<tr role="row">

<th (click)="sortfn('booksName')">Book Name</th>
<th (click)="sortfn('category.categoryName')">Category-Name</th>
<th (click)="sortfn('publication')">Publication</th>
<th (click)="sortfn('auther')">Auther</th>
<th (click)="sortfn('booksCopies')">Book Copies</th>
<th>Book Cover</th>
<th>Action</th>
<td>{{books.booksName}}</td>
<td>{{books.category.categoryName}}</td>
<td>{{books.publication}}</td>
<td>{{books.auther}}</td>
<td>{{books.booksCopies}}</td>
<td align="right"><img src="../../assets/BooksImage/item_pics/{{books.image}}" width="70" height="100">
</td>

</tr>
</thead>
<tbody>
<tr *ngFor="let books of data | paginate
: {
itemsPerPage: tableSize,
currentPage: page,
totalItems: count
};


">
<td>

<td>{{books.booksName}}</td>
<td>{{books.category.categoryName}}</td>
<td>{{books.publication}}</td>
<td>{{books.auther}}</td>
<td>{{books.booksCopies}}</td>
<td align="right"><img src="../../assets/BooksImage/item_pics/{{books.image}}" width="70" height="100"></td>

<td>

<button type ="button" class="btnn2" (click)="requestBook(books)">Request Book</button>
<!-- <button mat-icon-button>
<i class="material-icons" style="color:rgb(18, 52, 247)" (click)="requestBook(books)">done</i>

</button> -->
</td>
</tr>
<button type="button" class="btnn2" (click)="requestBook(books)">Request</button>
</tbody>
</table></div>

<div class="d-flex justify-content-center">
<pagination-controls (pageChange)="onTableDataChange(page=$event)">
</pagination-controls>
</div>
<!-- new table -->

</tbody>
</table>
<div class="d-flex justify-content-center">
<pagination-controls (pageChange)="onTableDataChange(page=$event)">
</pagination-controls>
</div>
</div>
</div>
</div>


11 changes: 7 additions & 4 deletions FrontEnd/Library/src/app/booksdisplay/booksdisplay.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { NgToastService } from 'ng-angular-popup';
import { BooksService } from '../books.service';
import { BorrowService } from '../borrow.service';
import { CategoryService } from '../category.service';
Expand All @@ -10,7 +11,7 @@ import { CategoryService } from '../category.service';
styleUrls: ['./booksdisplay.component.css']
})
export class BooksdisplayComponent implements OnInit {

//booksdata:any;
// categoryList: any[];
categoryId:any;
Expand Down Expand Up @@ -41,7 +42,7 @@ result: any;
direction=-1;


constructor(private router:Router ,private booksservice:BooksService,private service:CategoryService,private borrowservice:BorrowService) {
constructor(private router:Router ,private booksservice:BooksService,private service:CategoryService,private borrowservice:BorrowService,private toast:NgToastService) {
// this.booksList=[];
// this.categoryList=[];
}
Expand Down Expand Up @@ -128,8 +129,10 @@ onTableDataChange(event:any) {
this.borrowservice.add(data).subscribe({
next:(res)=>{
this.booksId=res.booksId;
console.log(res);
alert("Book request successfull")
console.log(res);

// alert("Book request successfull")
this.toast.info({summary:'Booking Successfull',duration:5000});
this.router.navigate(['/borrowhistory'])
},
error:(msg)=>{}
Expand Down
4 changes: 2 additions & 2 deletions FrontEnd/Library/src/app/borrow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ handleError(err: HttpErrorResponse): any {
// user filer
filterBorrowPagination2(date1:any,date2:any,page:any,tableSize:any,sort:any){
console.log(date1)
return this.http.get(this.apiurl + "/borrow/user/"+date1+"/"+date2+"?pageNo="+page+"&pageSize="+tableSize+"&sortBy="+sort)
return this.http.get(this.apiurl + "/borrow/user/loadByIssueDate/"+date1+"/"+date2)
}

//////////////
Expand All @@ -80,7 +80,7 @@ handleError(err: HttpErrorResponse): any {

// return this.http.get(this.apiurl + `/users/fetching/${type}/${date1}/${date2}`, httpOptions)
LoadByIssueDate(date1:any,date2:any){
return this.http.get(this.apiurl + "/borrow/loadByIssueDate/"+date1+"/"+date2).pipe((catchError(err => this.handleError(err))));
return this.http.get(this.apiurl + "/borrow/loadByIssueDate/"+date1+"/"+date2);
}
//user
LoadByIssueDateUser(date1:any,date2:any){
Expand Down
2 changes: 1 addition & 1 deletion FrontEnd/Library/src/app/borrow/borrow.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h2 class="centr" style="text-align:center ;">Borrow Details</h2>
<button mat-button (click)="acceptRequest(post)" color="primary" *ngIf="post.status=='REQUESTED' " >Accept</button>
<button mat-button (click)="rejectRequest(post)" color="warn" *ngIf="post.status=='REQUESTED' " >Reject</button>
<button mat-button (click)="bookReturn(post)" color="accent" *ngIf="post.status!='RETURNED' && post.status=='APPROVED' ">Return</button>

</td>
<td>
<button mat-icon-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1 style="text-align:center ;">Borrow Details</h1>
<!-- fliter starts -->
<div><input type="button" (click)="clearFilter()" value="CLEAR FILTER"
style="position:absolute; left:915px; top:103px;"> </div>
style="position:absolute; left:915px; top:95px;"> </div>

<div>
START DATE &nbsp;&nbsp; <input type="date" formControlName="date1" value="date1"
Expand Down
Loading