added print files view and delete

This commit is contained in:
franknstayn
2020-03-14 20:41:41 +08:00
parent 8685f93b29
commit 5f05c34167
6 changed files with 173 additions and 9 deletions

View File

@@ -34,7 +34,7 @@ scratch. This page gets rid of all links and provides the needed markup only.
<!-- bootstrap-toggle -->
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<!-- ekko-lightbox -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.css" rel="stylesheet">
<!-- bootstrap-tagsinput -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tagsinput/0.8.0/bootstrap-tagsinput.css">
<!-- select2 -->
@@ -134,7 +134,8 @@ scratch. This page gets rid of all links and provides the needed markup only.
height: 100px;
padding: 5px;
}
</style>
</style>
</head>
<!--
BODY TAG OPTIONS:
@@ -1336,6 +1337,38 @@ desired effect
});
$(".btn-delete-print-file").click(function(e){
e.preventDefault();
var r = confirm("Do you really want to delete this Print File? This process cannot be undone.");
if (r == true) {
var id = $(this).data('id');
$.ajax({
type : 'POST',
url : "{{ url('admin/print-files/delete') }}",
data : {
id: id
},
beforeSend: function(xhr){
var token = $('meta[name="csrf_token"]').attr('content');
if (token) {
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
}
},
success : function(response){
if(response.success){
alert(response.message);
location.reload();
}
}
});
}
return false;
});
}); // end document ready

View File

@@ -35,9 +35,16 @@
<div class="box-footer">
<div class="row">
<div class="col-sm-12">
<div class="text-center">
</div>
<ul class="list-group">
@foreach ($selectPrintFiles as $template)
<li class="list-group-item">
<a href="{{ url('admin/print-files') . '/' . $template->TemplateCode }}"><b>{{ $template->TemplateName }}</b></a>
<div>
<small>{{ $template->TemplateCode . ' / ' . $template->SportsName . ' / ' . $template->Category }} </small>
</div>
</li>
@endforeach
</ul>
</div>
</div>
</div>

View File

@@ -0,0 +1,70 @@
@extends('admin.main')
@section('content')
<style>
.additional-info{
display:none;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
{{ $selectPrintFiles[0]->TemplateName }} Print Files
<!-- <small>Optional description</small> -->
</h1>
<ol class="breadcrumb">
<li><a href="{{ url ('admin') }}"><i class="fa fa-dashboard"></i> Dashboard</a></li>
<li><a href="{{ url ('admin/print-files') }}"><i class="fa fa-paint-brush"></i> Print Files</a></li>
<li class="active">{{ $selectPrintFiles[0]->TemplateName }} Print Files</li>
</ol>
</section>
<!-- Main content -->
<section class="content container-fluid">
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h4 class="box-title">Print File</h4>
</div>
<div class="box-body">
<div class="row">
<div class="col-md-12">
<table class="table table-bordered table-condensed">
<tr>
<th class="col-sm-1 text-center">#</th>
<th class="col-sm-3 text-center">Print File</th>
<th class="text-center">Type</th>
<th class="text-center">Size</th>
<th class="text-center">Action</th>
</tr>
@foreach ($selectPrintFiles as $key => $printfile)
<tr>
<td class="col-sm-1 text-center">{{ ++$key }}</div>
</div>
<td class="col-sm-3 text-center">
<div class='print-file-holder' style="border: none;">
<img class="svg-print-file-preview" src="{{ config('site_config.images_directory') . $printfile->Path }}" style="height: 100%;" />
</div>
</td>
<td class="text-center">{{ $printfile->Type }}</td>
<td class="text-center">{{ $printfile->Size }}</td>
<td class="text-center">
<button class="btn btn-danger btn-delete-print-file" data-id="{{ $printfile->Id }}"><i class="fa fa-trash"></i> Delete</button>
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
<div class="box-footer">
</div>
</div>
</div>
</div>
</section>
<!-- /.content -->
</div>
@endsection