CHANGE: added personaldaten db and auto logout function

This commit is contained in:
2024-09-21 14:38:04 +02:00
parent 45a19a2728
commit 3f5f82a304
5 changed files with 190 additions and 52 deletions

View File

@@ -25,9 +25,9 @@ type Booking struct {
var DB *sql.DB
func (b Booking) New(card_id string, geraet_id int16, check_in_out int16) Booking {
func (b *Booking) New(card_uid string, geraet_id int16, check_in_out int16) Booking {
return Booking{
CardUID: card_id,
CardUID: card_uid,
GeraetID: geraet_id,
CheckInOut: check_in_out,
}
@@ -89,6 +89,7 @@ func (b *Booking) GetBookingsByCardID(card_id string) ([]Booking, error) {
if err != nil {
return nil, err
}
defer qStr.Close()
var bookings []Booking
rows, err := qStr.Query(card_id)
if err == sql.ErrNoRows {