diff --git a/main.go b/main.go index 0358a48..9fade92 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,8 @@ import ( "log" "net/http" + //"time" + _ "github.com/mattn/go-sqlite3" ) @@ -20,9 +22,10 @@ func opisStołówkaZPM(w http.ResponseWriter, r *http.Request) { } func panel(w http.ResponseWriter, r *http.Request) { - fmt.Println("method:", r.Method) - t, _ := template.ParseFiles("panel.gtpl") - t.Execute(w, nil) + //time.Sleep(3 * time.Second) + //fmt.Println("method:", r.Method) + //t, _ := template.ParseFiles("panel.gtpl") + //t.Execute(w, nil) //*************************************************************************** db, err := sql.Open("sqlite3", "stolowkaZPM.db") @@ -35,16 +38,12 @@ func panel(w http.ResponseWriter, r *http.Request) { var Password string var PIN int var RFID int - + fmt.Fprintf(w, "Lista użytkowników:\n") for rows.Next() { err = rows.Scan(&IDusers, &User, &Password, &PIN, &RFID) checkErr(err) fmt.Printf("%d. %s, %s, %d, %d \n", IDusers, User, Password, PIN, RFID) - fmt.Fprint(w, IDusers) - fmt.Fprint(w, ". ") - fmt.Fprint(w, User) - fmt.Fprint(w, " \n") - + fmt.Fprintf(w, "%d. %s \n", IDusers, User) } rows.Close() db.Close() @@ -97,7 +96,7 @@ func login(w http.ResponseWriter, r *http.Request) { if Password == passwordFROMsite { fmt.Fprintln(w, zaloguj) fmt.Fprintln(w, usernameFROMsite) - fmt.Fprintln(w, passwordFROMsite) + //panel(w, r) break } }