app deployed with Heroku

This commit is contained in:
s416422 2019-12-08 00:00:52 +01:00
parent 81a03268a7
commit 581429d99f
14 changed files with 52 additions and 24 deletions

1
Procfile Normal file
View File

@ -0,0 +1 @@
web: vendor/bin/heroku-php-apache2 public/

View File

@ -8,10 +8,8 @@ use Illuminate\Http\Request;
use App\Subject; use App\Subject;
use App\Classes; use App\Classes;
use App\Room;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
class UserClassesController extends Controller class UserClassesController extends Controller
{ {
@ -40,11 +38,10 @@ class UserClassesController extends Controller
{ {
$subject_id = $request->input('subject_id'); $subject_id = $request->input('subject_id');
$date = $request->input('date'); $date = $request->input('date');
Classes::create([ $classes_id = Classes::create([
'subject_id' => $subject_id, 'subject_id' => $subject_id,
'date' => $date 'date' => $date
]); ])->id;
$classes_id = Classes::orderBy('created_at', 'desc')->first()->id;
return redirect(route('user_start_classes', ['classes_id' => $classes_id])); return redirect(route('user_start_classes', ['classes_id' => $classes_id]));
} }

View File

@ -21,11 +21,13 @@ body {
font-size: 22px; font-size: 22px;
} }
#selected-seats { #sel-seat {
font-size: 30px; font-size: 30px;
text-shadow: 1px 1px 1px rgb(160, 160, 160); text-shadow: 1px 1px 1px rgb(160, 160, 160);
margin-top: -15px; margin-top: -15px;
margin-bottom: 100px; margin-bottom: 100px;
padding: 0;
} }
button { button {

View File

@ -15,7 +15,7 @@
<h2>Anna Kowalska</h2> <h2>Anna Kowalska</h2>
<h3>wybrane miejsce:</h3> <h3>wybrane miejsce:</h3>
<h3 id="selected-seats">rząd 2 miejsce 3</h3> <ul id="sel-seat"></ul>
<button class="gotomain-button" onclick="doStronyGlownej()">Przejdź do strony głównej &raquo;</button> <button class="gotomain-button" onclick="doStronyGlownej()">Przejdź do strony głównej &raquo;</button>
</div> </div>
@ -24,7 +24,11 @@
<script> <script>
function doStronyGlownej() { function doStronyGlownej() {
window.location = "przylozlegitke.html"; window.location = "przylozlegitke.html";
} }
//alert(localStorage.getItem('myElement')); //Przykładowa wartość
$( document ).ready(function() {
$("#sel-seat").text(localStorage.getItem('myElement'));
});
</script> </script>
</html> </html>

View File

@ -24,7 +24,7 @@
<div id="legend"> <div id="legend">
</div> </div>
<div class="booking-details"> <div class="booking-details">
<h2>Anna Kowalska</h2> <h2 id="studentName">Anna Kowalska</h2>
<h3>Wybrane miejsce:</h3> <h3>Wybrane miejsce:</h3>
<ul id="selected-seats"></ul> <ul id="selected-seats"></ul>
@ -35,7 +35,6 @@
</div> </div>
</body> </body>
<script> <script>
function goToKoncowa() { function goToKoncowa() {
window.location = "koncowastrona.html"; window.location = "koncowastrona.html";
} }

View File

@ -2,7 +2,10 @@ var firstSeatLabel = 1;
$(document).ready(function() { $(document).ready(function() {
var $cart = $('#selected-seats'), var $cart = $('#selected-seats'),
seatNumber = '',
$placeNumber = ('#sel-seat'),
$counter = $('#counter'), $counter = $('#counter'),
$name = $('#studentName'),
$total = $('#total'), $total = $('#total'),
sc = $('#seat-map').seatCharts({ sc = $('#seat-map').seatCharts({
map: [ map: [
@ -46,6 +49,9 @@ var firstSeatLabel = 1;
.data('seatId', this.settings.id) .data('seatId', this.settings.id)
.appendTo($cart); .appendTo($cart);
seatNumber = 'rząd: ' + this.settings.row + ' miejsce: ' + this.settings.label;
localStorage.setItem('myElement', seatNumber);
/* /*
* Lets update the counter and total * Lets update the counter and total
* *
@ -64,6 +70,7 @@ var firstSeatLabel = 1;
//remove the item from our cart //remove the item from our cart
$('#cart-item-'+this.settings.id).remove(); $('#cart-item-'+this.settings.id).remove();
$('#item-'+this.settings.id).remove();
//seat has been vacated //seat has been vacated
return 'available'; return 'available';
@ -76,6 +83,7 @@ var firstSeatLabel = 1;
} }
}); });
//this will handle "[cancel]" link clicks //this will handle "[cancel]" link clicks
$('#selected-seats').on('click', '.cancel-cart-item', function () { $('#selected-seats').on('click', '.cancel-cart-item', function () {
//let's just trigger Click event on the appropriate seat, so we don't have to repeat the logic here //let's just trigger Click event on the appropriate seat, so we don't have to repeat the logic here

View File

@ -21,11 +21,12 @@ body {
font-size: 22px; font-size: 22px;
} }
#selected-seats { #sel-seat {
font-size: 30px; font-size: 30px;
text-shadow: 1px 1px 1px rgb(160, 160, 160); text-shadow: 1px 1px 1px rgb(160, 160, 160);
margin-top: -15px; margin-top: -15px;
margin-bottom: 100px; margin-bottom: 100px;
padding: 0;
} }
button { button {

View File

@ -144,6 +144,10 @@ span.seatCharts-legendDescription {
box-shadow: 0 0 #b85a5b; box-shadow: 0 0 #b85a5b;
background-color: #3654ff; background-color: #3654ff;
} }
a.checkout-button {
color: black;
text-decoration: none;
}
#selected-seats { #selected-seats {
list-style-type: none; list-style-type: none;

View File

@ -8,16 +8,21 @@ function savePlaceNumber() {
} }
function toggleButtonAvailability() { function toggleButtonAvailability() {
const button = $('.checkout-button')[0]; const buttons = $('.checkout-button');
const selected_place = $('.selected')[0]; const selected_place = $('.selected')[0];
if(!selected_place){ buttons.each(function(e) {
$(button).css('pointer-events', 'none'); if(!$(this).hasClass('end-button')) {
$(button).css('cursor', 'unset'); if(!selected_place){
$(this).css('pointer-events', 'none');
$(this).css('cursor', 'unset');
} else {
$(this).css('pointer-events', 'unset');
$(this).css('cursor', 'pointer');
}
}
})
} else {
$(button).css('pointer-events', 'unset');
$(button).css('cursor', 'pointer');
}
} }
function checkForUnavailablePlaces() { function checkForUnavailablePlaces() {

View File

@ -2,7 +2,10 @@ var firstSeatLabel = 1;
$(document).ready(function() { $(document).ready(function() {
var $cart = $('#selected-seats'), var $cart = $('#selected-seats'),
seatNumber = '',
placeNumber = ('#sel-seat'),
$counter = $('#counter'), $counter = $('#counter'),
$name = $('#studentName'),
$total = $('#total'), $total = $('#total'),
sc = $('#seat-map').seatCharts({ sc = $('#seat-map').seatCharts({
map: [ map: [
@ -45,7 +48,9 @@ var firstSeatLabel = 1;
.attr('id', 'cart-item-'+this.settings.id) .attr('id', 'cart-item-'+this.settings.id)
.data('seatId', this.settings.id) .data('seatId', this.settings.id)
.appendTo($cart); .appendTo($cart);
seatNumber = 'rząd: ' + this.settings.row + ' miejsce: ' + this.settings.label;
localStorage.setItem('myElement', seatNumber);
/* /*
* Lets update the counter and total * Lets update the counter and total
* *
@ -64,6 +69,7 @@ var firstSeatLabel = 1;
//remove the item from our cart //remove the item from our cart
$('#cart-item-'+this.settings.id).remove(); $('#cart-item-'+this.settings.id).remove();
$('#item-'+this.settings.id).remove();
//seat has been vacated //seat has been vacated
return 'available'; return 'available';

View File

@ -7,6 +7,7 @@
<script src="http://code.jquery.com/qunit/qunit-1.14.0.js"></script> <script src="http://code.jquery.com/qunit/qunit-1.14.0.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="{{ asset('js/map/jquery.seat-charts.min.js') }}"></script> <script type="text/javascript" src="{{ asset('js/map/jquery.seat-charts.min.js') }}"></script>
<link rel="stylesheet" type="text/css" href="{{ asset('css/map/seatchart.css') }}">
<title> @CHECK | @yield('map_title') </title> <title> @CHECK | @yield('map_title') </title>
@yield('map_meta') @yield('map_meta')
</head> </head>
@ -14,7 +15,7 @@
<body> <body>
<div class="wrapper"> <div class="wrapper">
<a href="{{ route('user_classes') }}"> Zakończ zapisy </a> <a href="{{ route('user_classes') }}" class="checkout-button end-button"> Zakończ zapisy </a>
@yield('map_content') @yield('map_content')
</div> </div>

View File

@ -21,7 +21,7 @@
<div id="legend"> <div id="legend">
</div> </div>
<div class="booking-details"> <div class="booking-details">
<h2> <span class="student_name"> {{ $student_name }} </span><span class="student_surname"> {{ $student_surname }} </span> </h2> <h2 id="studentName"> <span class="student_name"> {{ $student_name }} </span><span class="student_surname"> {{ $student_surname }} </span> </h2>
<h3 class="student_id_number"> {{ $student_id_number }}</h3> <h3 class="student_id_number"> {{ $student_id_number }}</h3>
<h3>Wybrane miejsce: <h3>Wybrane miejsce:
<span id="selected-seats"></span> <span id="selected-seats"></span>

View File

@ -28,7 +28,7 @@
<label for="student_surname"> Nazwisko studenta: </label> <label for="student_surname"> Nazwisko studenta: </label>
<input type="text" name="student_surname" id="student_surname"> <input type="text" name="student_surname" id="student_surname">
</div> </div>
<button type="submit"> Wyślij requesta </button> <button type="submit" class="checkout-button"> Wyślij requesta </button>
</form> </form>
</div> </div>
@endsection @endsection

View File

@ -11,7 +11,7 @@
<h3>{{ $student_id_number }} </h3> <h3>{{ $student_id_number }} </h3>
<h3>wybrane miejsce:</h3> <h3>wybrane miejsce:</h3>
<h3 id="selected-seats">{{ $seat_number }}</h3> <ul id="sel-seat"> {{ $seat_number }}</ul>
<a href="{{ route('user_start_classes', [$classes_id]) }}"><button type="button" class="checkout-button">Przejdź do strony głównej &raquo;</button></a> <a href="{{ route('user_start_classes', [$classes_id]) }}"><button type="button" class="checkout-button">Przejdź do strony głównej &raquo;</button></a>
@endsection @endsection