IMMREX7
@extends('students.student_layout')
@section('content')
<div class="row clearfix">
<div class="col-lg-12">
<div class="card">
@foreach($positive_news as $val)
<div class="body">
<div class="row">
@if(isset($val->image))
<div class="preview col-lg-4 col-md-12">
<div class="preview-pic tab-content">
<div class="tab-pane active" id="product_1">
<img src="{{ asset('storage/schools/'.$val->idSchool.'/positivenews/'.$val->image)}}" class="img-fluid">
</div>
</div>
</div>
@endif
<div class="details col-lg-8 col-md-12">
<h3 class="product-title m-b-0">{{$val->category}}</h3>
<h6 class="price m-t-0"><span class="col-amber">DATE: {{$val->publishDate}} , SOURCE: {{$val->source}}</span></h6>
<hr>
<p class="product-description">{{$val->news}}</p>
<hr>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
@stop
@section('script')
<script>
$(document).on('click', '.select-all', function(){
var checkAll = this.checked;
if(checkAll === true){
$('.chkall').each(function () {
this.checked = checkAll;
});
}else{
$('.chkall').each(function () {
this.checked = checkAll;
});
}
});
$(document).on('click', '.js-sweetalert', function (e) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
e.preventDefault();
var id = $(this).data('id');
swal({
title: "Are you sure?",
text: "Are You sure you want to delete this Newsletter!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: true
},
function() {
// console.log('here');
$.ajax({
type: "DELETE",
url: "{{url('/teacher/positivenews/')}}" +"/"+id,
data: {id:id}
})
.done(function(data) {
swal({
title: "Deleted",
text: "Positive News has been successfully deleted",
type: "success"
},function() {
location.reload();
});
})
.error(function(data) {
swal("Oops", "We couldn't connect to the server!", "error");
});
return false;
});
});
</script>
@stop
Copyright © 2021 -