Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
simpmw
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alfiro Pratama
simpmw
Commits
d9ce9ae5
Commit
d9ce9ae5
authored
Apr 01, 2024
by
Alfiro Pratama
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
me
parent
f07af5cd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
137 additions
and
6 deletions
+137
-6
app/Http/Controllers/Dosen/ProposalController.php
+7
-1
app/Http/Controllers/Mahasiswa/ProposalController.php
+13
-1
app/Models/ProposalUrl.php
+32
-0
resources/views/backend/mahasiswa/proposal/create.blade.php
+70
-3
resources/views/backend/mahasiswa/proposal/index.blade.php
+13
-0
resources/views/layouts/headpg.blade.php
+2
-1
No files found.
app/Http/Controllers/Dosen/ProposalController.php
View file @
d9ce9ae5
...
...
@@ -15,6 +15,7 @@ use App\Models\Jenis;
use
Session
;
use
Alert
;
use
App\Models\ProposalUrl
;
use
Auth
;
class
ProposalController
extends
Controller
...
...
@@ -68,7 +69,8 @@ class ProposalController extends Controller
public
function
lihat
(
Request
$request
)
{
$item
=
Proposal
::
where
(
'proposal_id'
,
$request
->
proposal_id
)
->
first
();
$item
[
'proposal'
]
=
Proposal
::
where
(
'proposal_id'
,
$request
->
proposal_id
)
->
first
();
$item
[
'url'
]
=
ProposalUrl
::
where
(
'proposal_id'
,
$request
->
proposal_id
)
->
all
();
$data
=
''
;
$no
=
1
;
...
...
@@ -104,6 +106,10 @@ class ProposalController extends Controller
<tr>
<td>Proposal</td>
<td>"
.
$dokumen
.
"</td>
</tr>
<tr>
<td>Video Produk</td>
<td>"
.
$item
[
'url'
]
->
url
.
"</td>
</tr>
"
;
...
...
app/Http/Controllers/Mahasiswa/ProposalController.php
View file @
d9ce9ae5
...
...
@@ -10,6 +10,7 @@ use Illuminate\Support\Facades\Storage;
use
Illuminate\Support\Str
;
use
App\Models\Proposal
;
use
App\Models\ProposalUrl
;
use
App\Models\Kelompok
;
use
App\Models\Periode
;
use
App\Models\Jenis
;
...
...
@@ -133,7 +134,7 @@ class ProposalController extends Controller
$file_nama
=
$periode
->
nama
.
'_'
.
$uuid
.
'.'
.
$proposal
[
'file'
]
->
getClientOriginalExtension
();
Storage
::
disk
(
'
static
'
)
->
put
(
'simpkm/proposal/'
.
$periode
->
nama
.
'/'
.
$file_nama
,
file_get_contents
(
$proposal
[
'file'
]
->
getRealPath
()));
Storage
::
disk
(
'
local
'
)
->
put
(
'simpkm/proposal/'
.
$periode
->
nama
.
'/'
.
$file_nama
,
file_get_contents
(
$proposal
[
'file'
]
->
getRealPath
()));
$kel
=
Proposal
::
create
([
'proposal_id'
=>
$uuid
,
...
...
@@ -146,6 +147,17 @@ class ProposalController extends Controller
'date_upload'
=>
now
(),
'created_user'
=>
Auth
::
user
()
->
id
]);
if
(
$kel
)
{
ProposalUrl
::
create
([
'id'
=>
$uuid
,
'url_name'
=>
$proposal
[
'url_name'
],
'url'
=>
$proposal
[
'url'
],
'deskripsi'
=>
$proposal
[
'deskripsi'
],
'proposal_id'
=>
$kel
->
proposal_id
,
'created_at'
=>
null
,
'updated_at'
=>
null
]);
}
return
redirect
()
->
route
(
'mahasiswa.proposal.index'
)
->
with
(
'success'
,
'Proposal Berhasil ditambahkan'
);
}
...
...
app/Models/ProposalUrl.php
0 → 100644
View file @
d9ce9ae5
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
use
App\Traits\UuidTrait
;
class
ProposalUrl
extends
Model
{
use
HasFactory
;
use
UuidTrait
;
protected
$table
=
'proposal_url'
;
protected
$primaryKey
=
'id'
;
public
$incrementing
=
false
;
protected
$fillable
=
[
'id'
,
'url'
,
'url_name'
,
'deskripsi'
,
'proposal_id'
,
'created_at'
,
'updated_at'
];
public
function
rProposal
()
{
return
$this
->
belongsTo
(
Proposal
::
class
,
'proposal_id'
,
'id'
);
}
}
resources/views/backend/mahasiswa/proposal/create.blade.php
View file @
d9ce9ae5
...
...
@@ -58,10 +58,28 @@
</div>
<div class="
row
mb
-
3
" class="
dropzone
">
<label for="
kode
" class="
col
-
sm
-
2
col
-
form
-
label
">Upload Proposal</label>
<div class="
col
-
sm
-
10
">
<div class="
col
-
sm
-
8
col
-
lg
-
8
">
@if (
$errors->has
('file')) <span class="
text
-
danger
">{{
$errors->first
('file') }}</span> @endif
<input type="
file
" name="
file
" class="
form
-
control
" id="
input
-
file
" accept="
application
/
pdf
">
<iframe id="
view
-
pdf
" width="
80
%
" height="
80
%
" frameborder="
0
" src="
{{
$proposal
?
'https://statik.unesa.ac.id/simpkm/proposal/'
.
$proposal
->
rPeriode
->
nama
.
'/'
.
$proposal
->
upload_dokumen
:
''
}}
"></iframe>
{{-- <iframe id="
view
-
pdf
" width="
80
%
" height="
80
%
" frameborder="
0
" src="
{{
$proposal
?
'https://statik.unesa.ac.id/simpkm/proposal/'
.
$proposal
->
rPeriode
->
nama
.
'/'
.
$proposal
->
upload_dokumen
:
''
}}
"></iframe> --}}
</div>
<div class="
col
-
sm
-
2
col
-
lg
-
2
">
<button type="
button
" class="
form
-
control
btn
btn
-
warning
" id="
btnPreview
">Preview</button>
</div>
</div>
<div class="
row
mb
-
3
">
<label for="
kode
" class="
col
-
sm
-
2
col
-
form
-
label
">URL Video Produk</label>
<div class="
col
-
sm
-
3
col
-
lg
-
3
">
<input class="
form
-
control
" type="
text
" id="
url_name
" name="
url_name
" value="
{{
old
(
'url_name'
)
}}
" placeholder="
Nama
Video
Produk
" required>
</div>
<div class="
col
-
sm
-
7
col
-
lg
-
7
">
<input class="
form
-
control
" type="
text
" id="
url
" name="
url
" value="
{{
old
(
'url'
)
}}
" placeholder="
URL
Video
Produk
" required>
</div>
</div>
<div class="
row
mb
-
3
">
<div class="
col
-
sm
-
2
col
-
lg
-
2
"></div>
<div class="
col
-
sm
-
10
col
-
lg
-
10
">
<textarea class="
form
-
control
" type="
text
" id="
deskripsi
" name="
deskripsi
" value="
{{
old
(
'deskripsi'
)
}}
" placeholder="
Deskripsi
...
" required></textarea>
</div>
</div>
<div class="
mb
-
0
">
...
...
@@ -78,11 +96,27 @@
</div> <!-- end col -->
</div> <!-- end row -->
<!-- Modal -->
<div class="
modal
fade
" id="
pdfModal
" tabindex="
-
1
" role="
dialog
" aria-labelledby="
pdfModalLabel
" aria-hidden="
true
">
<div class="
modal
-
dialog
modal
-
lg
" role="
document
">
<div class="
modal
-
content
">
<div class="
modal
-
header
">
<h5 class="
modal
-
title
" id="
pdfModalLabel
">Preview PDF</h5>
<button type="
button
" class="
btn
-
close
" data-bs-dismiss="
modal
" aria-label="
Close
">{{-- <span aria-hidden="
true
">×</span> --}}</button>
</div>
<div class="
modal
-
body
">
{{-- <iframe id="
pdfViewer
" width="
100
%
" height="
600
" frameborder="
0
"></iframe> --}}
<iframe id="
view
-
pdf
" width="
100
%
" height="
450
" frameborder="
0
" src="
{{
$proposal
?
'https://statik.unesa.ac.id/simpkm/proposal/'
.
$proposal
->
rPeriode
->
nama
.
'/'
.
$proposal
->
upload_dokumen
:
''
}}
"></iframe>
</div>
</div>
</div>
</div>
@endsection
@section('js')
<script>
{{--
<script>
$(function(){
$('#input-file').change(function(){
var input = this;
...
...
@@ -91,6 +125,39 @@
$('#view-pdf').attr('height','500px');
})
})
</script> --}}
{{-- <script>
$(function(){
$('#input-file').change(function(){
var input = this;
var url = window.URL.createObjectURL(this.files[0]);
$('#pdfViewer').attr('src', url);
});
// Reset iframe saat modal ditutup
$('#pdfModal').on('hidden.bs.modal', function (e) {
$('#pdfViewer').attr('src', '');
});
});
</script> --}}
<script>
$(function(){
$('#btnPreview').click(function() {
// Ambil URL dari file yang dipilih
var url = window.URL.createObjectURL($('#input-file')[0].files[0]);
// Set iframe dengan URL file
$('#view-pdf').attr('src', url);
// Munculkan modal
$('#pdfModal').modal('show');
});
// Reset iframe saat modal ditutup
$('#pdfModal').on('hidden.bs.modal', function (e) {
$('#view-pdf').attr('src', '');
});
});
</script>
@endsection
resources/views/backend/mahasiswa/proposal/index.blade.php
View file @
d9ce9ae5
...
...
@@ -154,6 +154,19 @@
@endif
</td>
</tr>
<tr>
<th>Video Produk</th>
<td>
@if(
$item->upload_dokumen
)
<a href="
https
://
statik
.
unesa
.
ac
.
id
/
simpkm
/
proposal
/
{{
$item
->
rPeriode
->
nama
}}
/
{{
$item
->
upload_dokumen
}}
" target="
_blank
" class="
btn
btn
-
success
btn
-
sm
"> <i class="
far
fa
-
eye
"></i> Lihat Proposal</a>
<iframe id="
view
-
pdf
" width="
100
%
" height="
400
px
" src="
https
://
statik
.
unesa
.
ac
.
id
/
simpkm
/
proposal
/
{{
$item
->
rPeriode
->
nama
}}
/
{{
$item
->
upload_dokumen
}}
" frameborder="
0
"></iframe>
@else
<div class="
alert
alert
-
danger
alert
-
dismissible
fade
show
mb
-
0
" role="
alert
">
<strong>Informasi!</strong> File tidak ditemukan.
</div>
@endif
</td>
</tr>
</table>
</div>
</p>
...
...
resources/views/layouts/headpg.blade.php
View file @
d9ce9ae5
...
...
@@ -21,7 +21,7 @@
<link
href=
"{{ asset('theme/libs/chartist/chartist.min.css') }}"
rel=
"stylesheet"
>
<link
href=
"https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css"
rel=
"stylesheet"
>
<!-- DataTables -->
<link
href=
"{{ asset('theme/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css') }}"
rel=
"stylesheet"
type=
"text/css"
>
...
...
@@ -50,4 +50,5 @@
<link
href=
"{{ asset('theme/libs/select2/css/select2.min.css') }}"
rel=
"stylesheet"
type=
"text/css"
>
</head>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment