delete tagihan done

pull/1/head
Aji Kamaludin 5 years ago
parent d2f13f3b19
commit 37d4d86c64
No known key found for this signature in database
GPG Key ID: 23E2BDC458317AF8

@ -57,4 +57,7 @@ class HomeController extends Controller
'msg' => 'Pengaturan diubah' 'msg' => 'Pengaturan diubah'
]); ]);
} }
//TODO: dump sql all data
//TODO: reset all data
} }

@ -157,8 +157,20 @@ class TagihanController extends Controller
* @param int $id * @param int $id
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function destroy($id) public function destroy(Tagihan $tagihan)
{ {
//TODO: work on this if transaksi and keuangan done if($tagihan->transaksi->count() != 0){
return redirect()->route('tagihan.index')->with([
'type' => 'danger',
'msg' => 'tidak dapat menghapus tagihan yang masih memiliki transaksi'
]);
}
$tagihan->siswa()->detach();
if($tagihan->delete()){
return redirect()->route('tagihan.index')->with([
'type' => 'success',
'msg' => 'tagihan telah dihapus'
]);
}
} }
} }

@ -1,7 +1,6 @@
@extends('layouts.app') @extends('layouts.app')
@section('site-name','Sistem Informasi SPP') @section('page-name','Dashboard')
@section('page-name','PAUD')
@section('content') @section('content')
<div class="page-header"> <div class="page-header">
@ -53,7 +52,12 @@
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">Laporan Harian : 20-20-2020</h3> <h3 class="card-title">Laporan Harian : {{ now()->format('d-m-Y') }}</h3>
<div class="card-options">
<input class="form-control mr-2" type="text" name="dates" style="max-width: 200px" data-toggle="datepicker" autocomplete="off" value="{{ now()->format('d-m-Y') }}">
<button id="btn-cetak-spp" class="btn btn-primary mr-1" value="#">Cetak</button>
<a href="#!" target="_blank" class="btn btn-primary">Export</a>
</div>
</div> </div>
<div class="card-body"> <div class="card-body">
report harian report harian
@ -62,3 +66,14 @@
</div> </div>
</div> </div>
@endsection @endsection
@section('js')
<script>
require(['jquery', 'selectize','datepicker'], function ($, selectize) {
$(document).ready(function () {
$('[data-toggle="datepicker"]').datepicker({
format: 'dd-MM-yyyy'
});
});
});
</script>
@endsection

@ -31,6 +31,10 @@
<p>Nama Aplikasi : <b>{{ $pengaturan->nama }}</b></p> <p>Nama Aplikasi : <b>{{ $pengaturan->nama }}</b></p>
<p>Logo : </p> <p>Logo : </p>
<img src="{{ asset("img/logo.jpg") }}" alt="Logo Sistem" height="250px"> <img src="{{ asset("img/logo.jpg") }}" alt="Logo Sistem" height="250px">
<div class="mt-8">
<button class="btn btn-primary btn-sm">Backup Data</button>
<button class="btn btn-danger btn-sm">Reset Data</button>
</div>
</div> </div>
</div> </div>
</div> </div>

@ -30,7 +30,8 @@
<div class="card-header"> <div class="card-header">
<h3 class="card-title">Tabungan</h3> <h3 class="card-title">Tabungan</h3>
<div class="card-options"> <div class="card-options">
<a href="{{ route('tabungan.cetak', $siswa->id) }}" target="_blank" class="btn btn-primary">Cetak</a> <a href="{{ route('tabungan.cetak', $siswa->id) }}" target="_blank" class="btn btn-primary mr-1">Cetak</a>
<a href="#!" target="_blank" class="btn btn-primary">Export</a>
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
@ -73,8 +74,9 @@
<h3 class="card-title">Tagihan SPP</h3> <h3 class="card-title">Tagihan SPP</h3>
@if(!$siswa->is_yatim) @if(!$siswa->is_yatim)
<div class="card-options"> <div class="card-options">
<input class="form-control mr-4" type="text" name="dates" style="max-width: 200px" id="daterange" value="{{ now()->subDay(7)->format('m-d-Y')." - ".now()->format('m-d-Y') }}"> <input class="form-control mr-2" type="text" name="dates" style="max-width: 200px" id="daterange" value="{{ now()->subDay(7)->format('m-d-Y')." - ".now()->format('m-d-Y') }}">
<button id="btn-cetak-spp" class="btn btn-primary" value="{{ $siswa->id }}">Cetak</button> <button id="btn-cetak-spp" class="btn btn-primary mr-1" value="{{ $siswa->id }}">Cetak</button>
<a href="#!" target="_blank" class="btn btn-primary">Export</a>
</div> </div>
@endif @endif
</div> </div>

@ -67,6 +67,7 @@ Route::middleware(['auth:web'])->group(function(){
Route::post('menabung', 'TabunganController@menabung')->name('tabungan.store'); Route::post('menabung', 'TabunganController@menabung')->name('tabungan.store');
Route::get('export-mutasi', 'TabunganController@export')->name('tabungan.export'); Route::get('export-mutasi', 'TabunganController@export')->name('tabungan.export');
Route::get('cetak-tabungan/{siswa}', 'TabunganController@cetak')->name('tabungan.cetak'); Route::get('cetak-tabungan/{siswa}', 'TabunganController@cetak')->name('tabungan.cetak');
Route::get('export-tabungan/{siswa}', 'TabunganController@cetak')->name('tabungan.siswa.export'); //TODO: export tabungan siswa
//Keuangan //Keuangan
Route::get('keuangan', 'KeuanganController@index')->name('keuangan.index'); Route::get('keuangan', 'KeuanganController@index')->name('keuangan.index');
@ -76,6 +77,7 @@ Route::middleware(['auth:web'])->group(function(){
//Pembayaran SPP //Pembayaran SPP
Route::get('transaksi-spp','TransaksiController@index')->name('spp.index'); Route::get('transaksi-spp','TransaksiController@index')->name('spp.index');
Route::post('print-spp/{siswa?}','TransaksiController@print')->name('spp.print'); Route::post('print-spp/{siswa?}','TransaksiController@print')->name('spp.print');
Route::post('export-spp/{siswa?}','TransaksiController@print')->name('spp.export');// TODO: export spp
}); });

Loading…
Cancel
Save