Commit 898912f8 by Violinna

Penambahan tahun ajaran dan hasil ujian

parent 68197953
......@@ -9,6 +9,8 @@ use Input as Input;
use Illuminate\Support\Facades\Auth;
use App\Models\Pendaftar;
use App\Models\Tahunajaran;
use App\Models\AsalSekolah;
use App\User;
......@@ -16,13 +18,21 @@ class PendaftarController extends Controller
{
public function index()
{
return view('calonsiswa.dashboard');
}
public function hasilujian()
{
$this->data['title'] = 'Hasil Ujian';
$this->data['pendaftar'] = Pendaftar::all();
$this->data['asalsekolah'] = AsalSekolah::all();
return view('calonsiswa.hasilujian.index',$this->data);
}
public function create()
{
$this->data['title'] = 'Lengkapi Form Data Pribadi';
$this->data['tahunajaran'] = Tahunajaran::all();
return view('calonsiswa.pendaftar.create',$this->data);
}
......@@ -38,11 +48,13 @@ class PendaftarController extends Controller
'alamat'=>'required',
'kebutuhan_khusus'=>'required',
'no_tlp_rumah'=>'required',
'thnajaran_id'=>'required'
]);
$input['user_id'] = $request->user()->id;
$input['no_pendaftar'] = $request->input('no_pendaftar');
$input['nama'] = $request->input('nama');
$input['jeniskelamin'] = $request->input('jeniskelamin');
......@@ -52,10 +64,13 @@ class PendaftarController extends Controller
$input['alamat'] = $request->input('alamat');
$input['kebutuhan_khusus'] = $request->input('kebutuhan_khusus');
$input['no_tlp_rumah'] = $request->input('no_tlp_rumah');
$id = $request->input('id');
$id=Pendaftar::find('user_id');
if($id !== $request->user()->user_id){
return redirect()->route('pendaftar.index')->with('info','Sudah terdaftar');
}
......
......@@ -6,5 +6,5 @@ use Illuminate\Http\Request;
class T_ajarController extends Controller
{
//
}
......@@ -15,10 +15,21 @@ use DB;
class UploadsController extends Controller
{
public function index() {
public function indexsoal() {
$this->data['title'] = 'Contoh - Contoh Tahun Lalu';
$this->data['pengumuman'] = Uploads::all();
$this->data['pengumuman'] = Uploads::where('jenis','Soal')->get();
return view('calonsiswa.download.index',$this->data);
}
public function indexpeng() {
$this->data['title'] = 'Pengumuman';
$this->data['pengumuman'] = Uploads::where('jenis','Syarat')->get();
return view('calonsiswa.download.index',$this->data);
}
......
......@@ -9,28 +9,16 @@ use App\Models\AsalSekolah;
use Session;
use Input as Input;
class DaftarCtrl extends Controller
{
public function index()
{
$this->data['title'] = 'Data Pendaftar';
$this->data['pendaftar'] = Pendaftar::orderBy('id')->paginate(15);
$this->data['asalsekolah'] = AsalSekolah::all();
return view('tatausaha.Daftar.index',$this->data);
}
$pendaftar = Pendaftar::all();
return view('tatausaha.Daftar.index',['pendaftar'=>$pendaftar]);
public function search()
{
$search =\Request::get('search');
$pen = Pendaftar::where('nama','like','%'.'$search'.'%')->orderBy('id')->paginate(5);
return view('tatausaha.Daftar.index',['pen'=>$pen]);
}
public function editItem(Request $req)
{
$this->validate($req,[
......
......@@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Response;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Tahunajaran;
use Validator;
use Session;
use Input as Input;
......@@ -13,10 +14,41 @@ class T_ajarController extends Controller
{
public function index()
{
$tahunajaran = Tahunajaran::all();
$this->data['title'] = 'Data Tahun Ajaran';
$this->data['tahunajaran'] = Tahunajaran::orderBy('id')->paginate(15);
return view('tatausaha.tahunajaran.index',['tahunajaran'=>$tahunajaran]);
}
public function store(Request $request)
{
$this->validate($request,['kode'=> 'required','keterangan'=>'required']);
$tahunajaran = new Tahunajaran();
$tahunajaran->kode = $request->kode;
$tahunajaran->keterangan = $request->keterangan;
$tahunajaran->save();
return response()->json( $tahunajaran );
}
return view('tatausaha.tahunajaran.index',$this->data);
public function update(Request $request)
{
$this->validate($request,[
'kode'=>'required',
'keterangan' => 'required'
]);
$tahunajaran = Tahunajaran::findOrFail($request->id);
$tahunajaran-> kode = $request->kode;
$tahunajaran-> keterangan = $request->keterangan;
$tahunajaran->save();
return response()->json($tahunajaran);
}
public function destroy(Request $request)
{
$tahunajaran = Tahunajaran::find($request->id);
$tahunajaran->delete();
return response()->json($tahunajaran);
}
}
......@@ -40,12 +40,16 @@ class UploadsController extends Controller
$upload = new pengumuman;
$upload->nama = $request->nama;
$upload->jenis = $request->jenis;
$upload->keterangan = $request->keterangan;
$upload->save();
return redirect()->route('upload.index')->with('alert-success','Data Has been Saved');
}
public function multiple_upload() {
public function multiple_upload(Request $request) {
$this->validate($request,['images'=> 'required',]);
// getting all of the post data
$files = Input::file('images');
// Making counting of uploaded images
......@@ -56,6 +60,7 @@ class UploadsController extends Controller
foreach ($files as $file) {
$rules = array('file' => 'required'); //'required|mimes:png,gif,jpeg,txt,pdf,doc'
$validator = Validator::make(array('file'=> $file), $rules);
if($validator->passes()){
$destinationPath = 'pengumuman'; // upload folder in public directory
$filename = $file->getClientOriginalName();
......@@ -68,6 +73,8 @@ class UploadsController extends Controller
$entry->mime = $file->getClientMimeType();
$entry->original_filename = $filename;
$entry->filename = $file->getFilename().'.'.$extension;
$entry->jenis = $request->jenis;
$entry->keterangan = $request->keterangan;
$entry->save();
}
}
......
......@@ -36,5 +36,8 @@ class Pendaftar extends Model
public function prestasis(){
return $this->hasMany('App\Models\Prestasis', 'id_pendaftar');
}
public function tahunajaran(){
return $this->belongsTo('App\Models\Tahunajaran', 'thnajaran_id');
}
}
......@@ -7,4 +7,11 @@ use Illuminate\Database\Eloquent\Model;
class Tahunajaran extends Model
{
protected $table = 't_tahunajaran';
protected $fillable = ['kode','nama','keterangan'];
protected $primaryKey = 'id';
public function pendaftar(){
return $this->hasMany('App\Models\Pendaftar', 'id_pendaftar');
}
}
......@@ -36,10 +36,4 @@ class User extends Authenticatable
public function pendaftar(){
return $this->belongsTo('App\Models\Pendaftar','id','user_id');
}
public function periodik(){
return $this->hasOne('App\Models\Periodik','id_pendaftar');
}
public function prestasi(){
return $this->belongsTo('App\Models\Periodik','id_pendaftar');
}
}
......@@ -381,6 +381,26 @@ fieldset[disabled] .btn-primary.active {
background-color: #128f76;
border-color: #11866f;
}
.btn-file {
position: relative;
overflow: hidden;
}
.btn-file input[type=file] {
position: absolute;
top: 0;
right: 0;
min-width: 100%;
min-height: 100%;
font-size: 100px;
text-align: right;
filter: alpha(opacity=0);
opacity: 0;
outline: none;
background: white;
cursor: inherit;
display: block;
}
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
......
......@@ -12,6 +12,7 @@
<thead>
<th>No </th>
<th>File name</th>
<th>Keterangan</th>
<th></th>
</thead>
{{csrf_field()}}
......@@ -22,6 +23,7 @@
<tr>
<td>{{$no++}}</td>
<td>{{$upload->original_filename}}</td>
<td>{{$upload->keterangan}}</td>
<td><a href="uploads/{{$upload->original_filename}}" download="{{$upload->filename}}">
......
@extends('layouts.Layout')
@section('content')
<div class="col-md-12">
<div class="card">
<div class="header">
<h4>{{$title}}</h4>
</div>
<div class="content table-responsive table-full-width" id="table">
<table class="table table-borderless">
<tr>
<th>No Pendaftar</th>
<th>Nama</th>
<th>Asal Sekolah</th>
<th>Status</th>
<th></th>
</tr>
<tr>
@foreach($pendaftar as $pen)
<td>{{$pen->no_pendaftar}}</td>
<td>{{$pen->nama}}</td>
@foreach($asalsekolah as $as)
<td>{{$as->nama_sekolah}}</td>
@endforeach
<td>{{$pen->status}}</td>
@endforeach
</tr>
</table>
</div>
</div>
</div>
@endsection
\ No newline at end of file
......@@ -97,6 +97,18 @@
</div>
</div>
</div>
<div class="row">
<div class="col-md-10">
<div class="form-group @if($errors->has('thnajaran_id')) has-error @endif">
<label>Tahun ajaran</label>
<select class="form-control input-sm" name="thnajaran_id" id="thnajaran_id">
@foreach($tahunajaran as $tahun)
<option value="{{$tahun->id}}" id="thnajaran_id" >{{$tahun->kode}}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
......
......@@ -13,14 +13,14 @@
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="ti-settings"></i>
<i class="glyphicon glyphicon-cog"></i>
<p>Settings</p>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="{{route(Auth::user()->role.'.resetpass')}}">Ubah Password</a></li>
<li><a href="{{route('logout')}}">Log Out</a></li>
<li><a href="{{route(Auth::user()->role.'.resetpass')}}"><i class="glyphicon glyphicon-user"></i> Ubah Password</a></li>
<li><a href="{{route('logout')}}"><i class="glyphicon glyphicon-off"></i> Log Out</a></li>
</ul>
</li>
</ul>
......
......@@ -100,6 +100,10 @@
<script src="{{asset('js/app.js')}}"></script>
@show
<script type="text/javascript">
$(document).on('click','.edit-modal',function(){
......@@ -132,8 +136,92 @@
}
});
});
</script>
</script>
<script type="text/javascript">
$(document).on('click', '.update-modal', function() {
$('#id-edit').val($(this).data('id'));
$('#kode-edit').val($(this).data('kode'));
$('#keterangan-edit').val($(this).data('keterangan'));
$('.bs-example-modal-sm2').modal('show');
});
$(document).on('click', '.delete-modal', function() {
$('#id-delete').val($(this).data('id'));
$('.bs-example-modal-sm3').modal('show');
});
$("#add").click(function() {
$.ajax({
type: 'post',
url: 'tahunajaran/store',
data: {
'_token': $('input[name=_token]').val(),
'kode': $('input[name=kode]').val(),
'keterangan': $('input[name=keterangan]').val()
},
success: function(data) {
if ((data.errors)){
$('.error').removeClass('hidden');
$('.error').text(data.errors.name);
}
else {
$('.error').remove();
$('#table').append("<tr class='item" + data.id + "'><td>" + data.id + "</td><td>" + data.kode + "</td><td>" + data.keterangan + "</td><td><button class='edit-modal btn btn-info btn-sm' data-id='" + data.id + "' data-kode='" + data.kode + "' data-keterangan='" + data.keterangan + "'><span class='glyphicon glyphicon-edit'></span>Edit</button> <button class='delete-modal btn btn-danger btn-sm' data-id='" + data.id + "' data-kode='" + data.kode + "'><span class='glyphicon glyphicon-trash'></span>Delete</button></td></tr>");
toastr.success("Data Berhasil Disimpan.");
}
},
});
$('#kode').val('');
$('#keterangan').val('');
});
$("#Ubah").click(function() {
$.ajax({
type: 'post',
url: 'tahunajaran/update',
data: {
'_token': $('input[name=_token]').val(),
'id' : $('input[name=id]').val(),
'kode': $('input[name=kode-edit]').val(),
'keterangan': $('input[name=keterangan-edit]').val()
},
success: function(data) {
$('.item' + data.id).replaceWith("<tr class='item" + data.id + "'><td>" + data.id + "</td><td>" + data.kode + "</td><td>" + data.keterangan + "</td><td><button class='edit-modal btn btn-info btn-sm' data-id='" + data.id + "' data-kode='" + data.kode + "' data-keterangan='" + data.keterangan + "'><span class='glyphicon glyphicon-edit'></span>Edit</button> <button class='delete-modal btn btn-danger btn-sm' data-id='" + data.id + "' data-kode='" + data.kode + "'><span class='glyphicon glyphicon-trash'></span>Delete</button></td></tr>");
toastr.success("Data Berhasil Diubah.");
},
});
});
$("#delete").click(function() {
$.ajax({
type: 'post',
url: 'tahunajaran/destroy',
data: {
'_token': $('input[name=_token]').val(),
'id' : $('input[name=id-delete]').val()
},
success: function(data) {
$('.item' + data.id).remove();
toastr.success("Data Berhasil Dihapus.");
}
});
});
</script>
</html>
{!! Form::open(['method'=>'GET','url'=>$url,'class'=>'navbar-form navbar-left','role'=>'search']) !!}
<a href="{{ url($link.'/create') }}" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-plus"></span> Add</a>
<div class="input-group custom-search-form">
<input type="text" class="form-control" name="search" placeholder="Search...">
<span class="input-group-btn">
<button class="btn btn-default-sm" type="submit">
<i class="fa fa-search"></i>
</button>
</span>
</div>
{!! Form::close() !!}
\ No newline at end of file
......@@ -5,6 +5,7 @@
@if(Auth::user()->role == 'tatausaha')
<div class="logo">
<a href="{{route('tatausaha')}}" class="simple-text">
<i class="glyphicon glyphicon-home"></i>
Selamat Datang {{Auth::user()->username}}
</a>
</div>
......@@ -12,27 +13,27 @@
<ul class="nav">
<li class="{{Request::segment(2) == '' ? 'active' : ''}}">
<a href="{{route('tatausaha')}}">
<i class="ti-panel"></i>
<i class="glyphicon glyphicon-th-list"></i>
<p>Dashboard</p>
</a>
</li>
<li class="{{Request::segment(2) == 'upload' ? 'active' : ''}}">
<a href="{{route('upload.index')}}">
<i class="ti-view-list-alt"></i>
<i class="glyphicon glyphicon-list-alt"></i>
<p>Pengumuman</p>
</a>
</li>
<li class="{{Request::segment(2) == 'Daftar' ? 'active' : ''}}">
<a href="{{route('Daftar.index')}}">
<i class="ti-view-list-alt"></i>
<i class="glyphicon glyphicon-user"></i>
<p>Pendaftar</p>
</a>
</li>
<li class="{{Request::segment(2) == 'tahunajaran' ? 'active' : ''}}">
<a href="{{route('tahunajaran.index')}}">
<i class="ti-view-list-alt"></i>
<i class="glyphicon glyphicon-book"></i>
<p>Tahun Ajaran</p>
</a>
......@@ -42,20 +43,21 @@
@elseif(Auth::user()->role == 'calonsiswa')
<div class="logo">
<a href="http://www.creative-tim.com" class="simple-text">
<i class="glyphicon glyphicon-home"></i>
Selamat Datang {{Auth::user()->username}}
</a>
</div>
<ul class="nav">
<li class="{{Request::segment(2) == '' ? 'active' : ''}}">
<a href="{{route('calonsiswa')}}">
<i class="ti-panel"></i>
<i class="glyphicon glyphicon-th-list"></i>
<p>Dashboard</p>
</a>
</li>
<li class="{{Request::segment(1) == ''?'active' : ''}}">
<a href="url(/Dashboard)" class="dropdown-toggle" data-toggle="dropdown">
<i class="ti-settings"></i>
<i class="glyphicon glyphicon-pencil"></i>
<p>Daftar Online</p>
</a>
<ul class="dropdown-menu">
......@@ -69,12 +71,32 @@
</ul>
</a>
</li>
<li class="{{Request::segment(2) == 'download' ? 'active' : ''}}">
<a href="{{route('download.index')}}">
<i class="ti-view-list-alt"></i>
<li class="{{Request::segment(2) == 'downloadpeng' ? 'active' : ''}}">
<a href="{{route('downloadpeng.index')}}">
<i class="glyphicon glyphicon-list-alt"></i>
<p>Pengumuman</p>
</a>
</li>
<li class="{{Request::segment(2) == 'downloadsoal' ? 'active' : ''}}">
<a href="{{route('downloadsoal.index')}}">
<i class="glyphicon glyphicon-download-alt"></i>
<p>Download Contoh Soal</p>
</a>
</li>
<li class="{{Request::segment(2) == 'download' ? 'active' : ''}}">
<a href="">
<i class="glyphicon glyphicon-credit-card"></i>
<p>Kartu Ujian</p>
</a>
</li>
<li class="{{Request::segment(2) == 'hasilujian' ? 'active' : ''}}">
<a href="{{route('hasilujian.index')}}">
<i class="glyphicon glyphicon-book"></i>
<p>Hasil Ujian</p>
</a>
</li>
@else
<div class="logo">
<a href="http://www.creative-tim.com" class="simple-text">
......
......@@ -5,22 +5,16 @@
<div class="card">
<div class="header">
<h4>Data Pendaftar</h4>
<p class="category"></p>
</div>
<div class="content table-responsive table-full-width">
<div class="col-md-6">
{!! Form:: open(['method'=>'GET','url'=>'Daftar','class'=>'navbar-form navbar-left','role'=>'search']) !!}
<div class="input-group custom-search-form">
<input type="text" name="search" class="form-control" placeholder="search...">
<span class="input-group-btn">
<button type="submit" class="btn btn-default-sm">
<i class="fa fa-search"></i>
<form method="get" action="{{url('tatausaha/Daftar')}}">
<input type="text" name="search" class="form-control" placeholder="Search...">
<button type="search" class="btn btn-default-sm">
<span class="glyphicon glyphicon-search"> </span>
</button>
</span>
</div>
</form>
</div>
{!! Form::close()!!}
<div class="content table-responsive table-full-width" id="table">
<table class="table table-borderless">
<thead>
<th></th>
......@@ -81,7 +75,14 @@
<div class="form-group">
<label class="control-label col-sm-2" for="status">Status :</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="status" >
<select id="status" type="text" class="form-control border-input" value="{{old('status')}}" name="status">
<option></option>
<option>Lulus</option>
<option>Tidak Lulus</option>
<option>Request</option>
</select>
<span id="helpBlock2" class="help-block">{{$errors->first('status')}}</span>
</div>
</div>
</form>
......
@extends('layouts.Layout')
@section('content')
<div class="col-md-12">
<div class="col-md-12">
<div class="card">
<div class="header">
<h4 class="title">{{$title}}</h4>
<p class="category"></p>
<h3>Tahun ajaran</h3>
</div>
<div class="panel-body">
@if(Session::has('alert-success'))
<div class="alert alert-success">
{{ Session::get('alert-success') }}
</div>
@endif
{{-- <a href="{{route('tahunajaran.create')}}" class="btn btn-info pull-right">Tambah Data</a><br><br> --}}
<!-- Small modal -->
<div class="content table-responsive table-full-width" >
<button type="button" class="btn btn-info pull-right btn-sm" data-toggle="modal" data-target=".bs-example-modal-sm1">Tambah Data</button><br><br>
<table class="table table-striped" id="table">
<tr>
<th>ID</th>
<th>Kode</th>
<th>Keterangan</th>
<th>Action</th>
</tr>
@foreach($tahunajaran as $thn)
<tr class="item{{$thn->id}}">
<td>{{$thn->id}}</td>
<td>{{$thn->kode}}</td>
<td>{{$thn->keterangan}}</td>
<td>
<button class="update-modal btn btn-info btn-sm" data-id="{{$thn->id}}" data-kode="{{$thn->kode}}" data-keterangan="{{$thn->keterangan}}"><span class="glyphicon glyphicon-edit"></span> Edit</button>
<button class="delete-modal btn btn-danger btn-sm" data-id="{{$thn->id}}"><span class="glyphicon glyphicon-trash"></span> Delete</button>
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
</div>
<div class="content">
<form action="{{route('tahunajaran.store')}}" method="POST">
@endsection
<!-- Edit modal -->
<div class="modal fade bs-example-modal-sm2" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Ubah Data</h4>
</div>
<div class="modal-body">
<div class="form-group">
{{ csrf_field() }}
<div class="row">
<div class="col-md-10">
<div class="form-group @if($errors->has('kode')) has-error @endif">
<label>Kode Tahun</label>
<input type="text" class="form-control border-input" value="{{old('kode')}}" name="kode">
<span id="helpBlock2" class="help-block">{{$errors->first('kode')}}</span>
<input type="hidden" name="id" id="id-edit">
<input type="text" name="kode-edit" id="kode-edit" class="form-control" placeholder="Kode">
</div>
<div class="form-group">
<input type="text" name="keterangan-edit" id="keterangan-edit" class="form-control" placeholder="Keterangan">
</div>
<div class="form-group" align="right">
<button type="button" id="Ubah" class="btn btn-primary" data-dismiss="modal">Ubah</button>
</div>
</div>
<div class="row">
<div class="col-md-10">
<div class="form-group @if($errors->has('keterangan')) has-error @endif">
<label>Keterangan`</label>
<input type="text" class="form-control border-input" value="{{old('keterangan')}}" name="keterangan">
<span id="helpBlock2" class="help-block">{{$errors->first('keterangan')}}</span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<input type="submit" class="btn btn-default">
<!-- Delete modal -->
<div class="modal fade bs-example-modal-sm3" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Delete Data</h4>
</div>
<div class="modal-body">
<div class="form-group">
{{ csrf_field() }}
<input type="hidden" name="id-delete" id="id-delete">
<p>Yakin Ingin Menghapus Data? </p>
</div>
<div class="form-group" align="right">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" id="delete" class="btn btn-danger" data-dismiss="modal">Delete</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade bs-example-modal-sm1" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Tambah Data</h4>
</div>
<div class="modal-body">
<div class="form-group">
{{ csrf_field() }}
<input type="text" name="kode" id="kode" class="form-control" placeholder="Kode">
</div>
<div class="form-group">
<input type="text" name="keterangan" id="keterangan" class="form-control" placeholder="Keterangan">
</div>
<div class="form-group" align="right">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" id="add" class="btn btn-primary" data-dismiss="modal">Simpan</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
\ No newline at end of file
@extends('layouts.Layout')
@section('content')
<div class="container">
@if(Session::has('success'))
<div class="alert-box success">
<h2>{!! Session::get('success') !!}</h2>
<div class="col-md-12">
<div class="card">
<div class="header">
<h4> Upload Pengumuman</h4>
<p class="category"></p>
</div>
@endif
<div class="form-group">
<h2>Soal-soal Tahun Lalu</h2>
<div class="content table-responsive table-full-width" id="table">
<div class="col-md-6">
{!!Form::open(array('route'=>'upload.create','method'=>'POST', 'files'=>true )) !!}
{!!Form::file('images[]', array('multiple'=>true, 'class'=>'btn btn-info')) !!}
{!!Form::file('images[]', array('multiple'=>true , 'class'=> 'btn btn-default btn-file' , 'hidden')) !!}
<p>{!!$errors->first('images')!!}</p>
@if(Session::has('error'))
<p>{!! Session::get('error') !!}</p>
@endif
{!! Form::submit('Submit', array('class'=>'btn btn-lg btn-primary col-md-1')) !!}
{!! Form::close() !!}
<div class="row">
<div class="col-md-5">
<div class="form-group @if($errors->has('jenis')) has-error @endif">
<label>Jenis</label>
<select type="text" class="form-control border-input" value="{{old('jenis')}}" name="jenis">
<option>Syarat</option>
<option>Soal</option>
</select>
<span id="helpBlock2" class="help-block">{{$errors->first('jenis')}}</span>
</div>
</div>
<div class="col-md-5">
<div class="form-group @if($errors->has('keterangan')) has-error @endif">
<label>Keterangan</label>
<input type="textarea" class="form-control border-input" value="{{old('keterangan')}}" name="keterangan">
<span id="helpBlock2" class="help-block">{{$errors->first('keterangan')}}</span>
</div>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-info"><span class="glyphicon glyphicon-upload"></span>Upload</button>
</div>
{!! Form::close() !!}
</div>
<br><br><br>
<a href="{{route('tatausaha')}}">Back</a><br>
<table class="table table-striped">
<tr>
<th>No.</th>
<th>Original FileName</th>
<th>Jenis</th>
<th>File</th>
<th>Keterangan</th>
<th>Actions</th>
</tr>
<?php $no=1; ?>
@foreach($pengumuman as $upload)
<tr>
<td>{{$no++}}</td>
<td>{{$upload->jenis}}</td>
<td>{{$upload->original_filename}}</td>
<td>{{$upload->keterangan}}</td>
<td>
<form class="" action="{{route('upload.destroy', $upload->id)}}" method="post">
<input class="w3-btn" type="hidden" name="_method" value="delete">
<input class="w3-btn" type="hidden" name="_token" value="{{ csrf_token() }}">
<a href="uploads/{{$upload->original_filename}}" download="{{$upload->filename}}">
<button type="button" class="btn btn-primary"><i class="glyphicon glyphicon-download">
Download
</i></button>
<button type="button" class="btn btn-primary"><i class="glyphicon glyphicon-download">Download</i></button>
</a>
<button class="delete-modal btn btn-danger" onclick="return confirm('Are you sure to delete this data');" ><span class="glyphicon glyphicon-trash"></span>Delete</button>
</form>
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
</div>
@endsection
......@@ -59,13 +59,19 @@ Route::group(['namespace' => 'tatausaha','prefix' => 'tatausaha','middleware' =>
Route::resource('upload','UploadsController');
Route::post('upload/create', 'UploadsController@multiple_upload');
Route::resource('tahunajaran','T_ajarController');
Route::resource('tahunajaran','T_ajarController@index');
Route::post('tahunajaran/store', 'T_ajarController@store');
Route::post('tahunajaran/update', 'T_ajarController@update');
Route::post('tahunajaran/destroy', 'T_ajarController@destroy');
});
//route untuk calonsiswa
Route::group(['namespace' => 'calonsiswa','prefix' => 'calonsiswa','middleware' => 'calonsiswa'], function() {
Route::get('/', function () {
......@@ -74,12 +80,16 @@ Route::group(['namespace' => 'calonsiswa','prefix' => 'calonsiswa','middleware'
Route::resource('pendaftar','PendaftarController');
Route::resource('Data','PendaftarController');
Route::resource('hasilujian','PendaftarController@hasilujian');
Route::resource('orangtua','OrangTuaController');
Route::resource('prestasi','PrestasiController');
Route::resource('periodik','PeriodikController');
Route::resource('asalsekolah','AsalsekolahCtrl');
Route::resource('download','UploadsController');
Route::resource('downloadpeng','UploadsController@indexpeng');
Route::resource('downloadsoal','UploadsController@indexsoal');
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment