v1.5.21 - Added edit feature to multiple events
Updated events Fixed (maybe) htaccess
This commit is contained in:
@@ -37,22 +37,23 @@
|
||||
<form method="post" action="{{ route("multiple-events.store") }}" enctype="multipart/form-data">
|
||||
<!--datetime-local-->
|
||||
@csrf
|
||||
<input type="text" name="week" placeholder="Uge" maxlength="2">
|
||||
<input type="number" name="week" placeholder="Uge" maxlength="2" max="53" required>
|
||||
<label id="fileuploadee"for="fileuploade">Baggrundsbillede til nyheden (Valgfri)</label>
|
||||
<input id="fileuploade" type="file" name="resource" accept="image/*">
|
||||
<table class="asd">
|
||||
<table id="table">
|
||||
<tr>
|
||||
<th>Aktivitets navn</th>
|
||||
<th>Aktivitets beskrivelse</th>
|
||||
<th>Tovholder</th>
|
||||
<th>Tidsrum (Start)</th>
|
||||
<th><button type="button" class="btn btn-inline btn-sde-blue" id="add2">Tilføj Række</button></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="name[]" maxlength="255"></td>
|
||||
<td><input type="text" name="description[]"></td>
|
||||
<td><input type="text" name="accountable[]" maxlength="255"></td>
|
||||
<td><input type="datetime-local" name="date[]"></td>
|
||||
<td><button type="button" class="btn btn-inline btn-sde-blue" id="add2">Tilføj en kolonne</button></td>
|
||||
<td><button type="button" onclick="removeRow(this)" class="btn btn-inline btn-sde-blue">Fjern Række</button></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -102,41 +103,59 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('#name').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('events.nameCheck')}}',
|
||||
data: {'nameCheck':$value},
|
||||
success:function (data) {
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
$('#name').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('events.nameCheck')}}',
|
||||
data: {'nameCheck':$value},
|
||||
success:function (data) {
|
||||
if(data){
|
||||
$("#error").show(100);
|
||||
$("#error").css('color', 'red');
|
||||
$("#disable").prop('disabled', true);
|
||||
$('#disable').css('cursor','not-allowed');
|
||||
}else{
|
||||
$("#error").hide();
|
||||
$("#disable").prop('disabled', false);
|
||||
$('#disable').css('cursor','pointer');
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$(document).ready(function (){
|
||||
$("#add2").click(function(){
|
||||
$( ".asd" ).append( "<tr><td><input type='text' name='name[]'></td><td><input type='text' name='description[]'></td><td><input type='text' name='accountable[]'></td><td><input type='datetime-local' name='date[]'><td/></tr>" );
|
||||
$( "#table" ).append( "<tr>" +
|
||||
"<td><input type='text' name='name[]'></td>" +
|
||||
"<td><input type='text' name='description[]'></td>" +
|
||||
"<td><input type='text' name='accountable[]'></td>" +
|
||||
"<td><input type='datetime-local' name='date[]'></td>" +
|
||||
"<td><button type='button' onclick='removeRow(this)' class='btn btn-inline btn-sde-blue'>Fjern Række</button></td>" +
|
||||
"</tr>" );
|
||||
console.log("1");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function removeRow(el) {
|
||||
Swal.fire({
|
||||
title: 'Er du sikker?',
|
||||
text: "Dette kan ikke blive ændret tilbage!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Fjern Række',
|
||||
cancelButtonText: 'Annuller'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$(el).parent().parent().remove();
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user