2019-12-20 01:11:51 +01:00
@ extends ( 'layouts.app' )
2019-12-07 19:49:42 +01:00
@ section ( 'title' ) Wybór miejsca @ endsection
2019-12-20 01:11:51 +01:00
@ section ( 'additional_meta' )
< link rel = " stylesheet " type = " text/css " href = " { { asset('css/map/jquery.seat-charts.css') }} " >
2019-12-07 19:49:42 +01:00
@ endsection
2019-12-20 01:11:51 +01:00
@ section ( 'content' )
< div class = " wrapper " >
< div class = " map-buttons " >
< a href = " { { route('user_classes') }} " class = " checkout-button end-button " > Zakończ zapisy </ a >
2020-01-13 17:17:17 +01:00
< button type = " button " class = " checkout-button end-button add-mn-btn " > Dodaj studenta ręcznie </ button >
2019-12-20 01:11:51 +01:00
</ div >
< div id = " refresh " ></ div >
2020-03-10 15:37:05 +01:00
< div class = " classes-code-div code-p " id = " classes-code-div " >
< p class = " m-0 " id = " classes-code " >< b > Kod weryfikacyjny :</ b ></ p >
< input type = " text " id = " classes_code_input " value = " { { $classes_code }} " >
< button type = " button " id = " copy-btn " class = " btn btn-primary " title = " Kopiuj do schowka " >< i class = " fa fa-clone " ></ i > Kopiuj < span id = " copy-counter " > ( 30 ) & raquo ; </ span > </ button >
</ div >
2020-03-09 23:24:21 +01:00
< div class = " code-p " > Stan połączenia z serwerem legitymacji : < span id = " status " style = " color:green " > połączony </ span ></ div >
2019-12-20 01:11:51 +01:00
< h1 class = " main-text main-seat-text " > Przyłóż legitymację do czytnika </ h1 >
2020-03-01 23:30:37 +01:00
@ if ( $errors -> any ())
< div class = " alert alert-danger invalid-feedback-alert " >
< ul >
@ foreach ( $errors -> all () as $error )
< li > {{ $error }} </ li >
@ endforeach
</ ul >
</ div >
@ endif
2019-12-20 01:11:51 +01:00
< div class = " card-reader " >
< form method = " POST " action = " { { route('user_start_classes_verified') }} " class = " card-reader-form " >
< div >
2020-01-17 17:39:29 +01:00
< input type = " hidden " name = " classes_code " id = " classes_code " value = " { { $classes_code }} " required >
2019-12-20 01:11:51 +01:00
</ div >
< div >
< label for = " student_id_number " > Nr indeksu : </ label >
< input type = " number " name = " student_id_number " id = " student_id_number " required >
</ div >
< div >
< label for = " student_name " > Imię : </ label >
< input type = " text " name = " student_name " id = " student_name " required >
</ div >
< div >
< label for = " student_surname " > Nazwisko : </ label >
< input type = " text " name = " student_surname " id = " student_surname " required >
</ div >
2020-01-17 17:39:29 +01:00
< button type = " submit " id = " submit " class = " checkout-button " > Dodaj studenta </ button >
2019-12-20 01:11:51 +01:00
</ form >
</ div >
2020-01-17 23:29:28 +01:00
2020-01-13 17:17:17 +01:00
< script >
2020-03-10 15:37:05 +01:00
var classes_code_input = $ ( '#classes_code_input' ) . val ();
2020-03-08 22:30:14 +01:00
const client = new WebSocket ( 'wss://atcheck.projektstudencki.pl/wss' , classes_code_input );
2020-03-09 23:19:21 +01:00
2020-03-09 23:11:50 +01:00
client . onclose = function ( event ) {
2020-03-09 23:21:41 +01:00
$ ( '#status' ) . text ( " rozłączony " );
2020-03-09 23:19:21 +01:00
$ ( '#status' ) . css ( " color " , " red " );
2020-03-09 23:11:50 +01:00
};
2020-03-09 23:19:21 +01:00
2020-01-13 17:17:17 +01:00
client . onmessage = function onmessage1 ( message ) {
message = JSON . parse ( message . data );
if ( message . type = " data " ) {
$ ( '#student_id_number' ) . val ( message [ 'id' ]);
$ ( '#student_name' ) . val ( message [ 'name' ]);
$ ( '#student_surname' ) . val ( message [ 'surname' ]);
$ ( '#classes_code' ) . val ( message [ 'classes_code' ]);
$ ( '#submit' ) . click ();
}
}
2020-03-10 15:37:05 +01:00
var counter = 30 ;
setInterval ( function () {
counter -- ;
$ ( '#copy-counter' ) . html ( '(' + counter + ') »' );
}, 1000 );
2020-01-13 17:17:17 +01:00
</ script >
2019-12-20 01:11:51 +01:00
</ div >
2019-12-07 19:49:42 +01:00
@ endsection