Skip to content

Commit

Permalink
update 3.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony committed Aug 27, 2020
1 parent 455916d commit 3d752ac
Show file tree
Hide file tree
Showing 8,910 changed files with 2,057 additions and 521 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file modified .DS_Store
Binary file not shown.
Empty file modified .vscode/sftp.json
100644 → 100755
Empty file.
Empty file modified =
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion app/Aktivis.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function pendidikans(){
}

public function pendidikan_tertinggi(){
return $this->hasOne('App\AktivisPendidikan','id_aktivis','id')->oldest();
return $this->hasOne('App\AktivisPendidikan','id_aktivis','id')->latest('mulai');
}

public function pekerjaan(){
Expand Down
2 changes: 1 addition & 1 deletion app/AnggotaProdukCuTransaksi.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function boot()
];

protected $orderable = [
'anggota_produk_cu_id','saldo','tanggal'
'anggota_produk_cu_id','saldo','tanggal','created_at'
];

public static function initialize()
Expand Down
Empty file modified app/BaseEloquent.php
100644 → 100755
Empty file.
Empty file modified app/Download.php
100644 → 100755
Empty file.
Empty file modified app/ErrorLog.php
100644 → 100755
Empty file.
176 changes: 64 additions & 112 deletions app/Http/Controllers/AnggotaCuController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function indexMeninggal()

public function indexCu($cu, $tp)
{
$table_data = AnggotaCu::with('anggota_cu_cu_not_keluar.cu','anggota_cu_cu_not_keluar.tp','Villages','Districts','Regencies','Provinces')->whereHas('anggota_cu_not_keluar', function($query) use ($cu, $tp){
$table_data = AnggotaCu::with('anggota_cu_cu_not_keluar.cu','anggota_cu_cu_not_keluar.tp','Villages','Districts','Regencies','Provinces')->whereHas('anggota_cu_cu_not_keluar', function($query) use ($cu, $tp){
if($tp != 'semua'){
$query->where('anggota_cu_cu.cu_id',$cu)->where('anggota_cu_cu.tp_id',$tp)->whereNull('anggota_cu_cu.tanggal_keluar');
}else{
Expand Down Expand Up @@ -164,22 +164,24 @@ public function formatKeluarQuery($table_data){

public function formatCuQuery($table_data, $cu, $tp){
foreach($table_data as $t){
$t->nik = $t->nik ? $t->nik . "​ " : '';
$t->npwp = $t->npwp ? $t->npwp . "​ " : '';
if($t->anggota_cu_cu_not_keluar){
foreach($t->anggota_cu_cu_not_keluar as $tt){
if($tt->cu_id == $cu){
$t->anggota_cu_cu_not_keluar[0] = $tt;
$t->nik = $t->nik ? $t->nik . "​ " : '';
$t->npwp = $t->npwp ? $t->npwp . "​ " : '';
if($t->anggota_cu_cu_not_keluar){
foreach($t->anggota_cu_cu_not_keluar as $tt){
if($tt->cu_id == $cu){
$t->anggota_cu_cu_not_keluar[0] = $tt;
}
}
}
}
if($tp != 'semua'){
$t->no_ba = $t->anggota_cu_cu_not_keluar[0]->no_ba . "​ ";
$t->tanggal_masuk = $t->anggota_cu_cu_not_keluar[0]->tanggal_masuk;
}else{
$tp_name = $t->anggota_cu_cu_not_keluar[0]->tp ? $t->anggota_cu_cu_not_keluar[0]->tp->name : '';
$t->no_ba = $tp_name . " : " . $t->anggota_cu_cu_not_keluar[0]->no_ba;
$t->tanggal_masuk = $t->anggota_cu_cu_not_keluar[0]->tanggal_masuk;
if($tp != 'semua'){
$t->no_ba = $t->anggota_cu_cu_not_keluar[0]->no_ba . "​ ";
$t->tanggal_masuk = $t->anggota_cu_cu_not_keluar[0]->tanggal_masuk;
}else{
$tp_name = $t->anggota_cu_cu_not_keluar[0]->tp ? $t->anggota_cu_cu_not_keluar[0]->tp->name : '';
$t->no_ba = $tp_name . " : " . $t->anggota_cu_cu_not_keluar[0]->no_ba;
$t->tanggal_masuk = $t->anggota_cu_cu_not_keluar[0]->tanggal_masuk;
}
}
};

Expand All @@ -188,22 +190,24 @@ public function formatCuQuery($table_data, $cu, $tp){

public function formatCuKeluarQuery($table_data, $cu, $tp){
foreach($table_data as $t){
$t->nik = $t->nik ? $t->nik . "​ " : '';
$t->npwp = $t->npwp ? $t->npwp . "​ " : '';
if($t->anggota_cu_cu_keluar){
foreach($t->anggota_cu_cu_keluar as $tt){
if($tt->cu_id == $cu){
$t->anggota_cu_cu_keluar[0] = $tt;
$t->nik = $t->nik ? $t->nik . "​ " : '';
$t->npwp = $t->npwp ? $t->npwp . "​ " : '';
if($t->anggota_cu_cu_keluar){
foreach($t->anggota_cu_cu_keluar as $tt){
if($tt->cu_id == $cu){
$t->anggota_cu_cu_keluar[0] = $tt;
}
}
}
}
if($tp != 'semua'){
$t->no_ba = $t->anggota_cu_cu_keluar[0]->no_ba . "​ ";
$t->tanggal_masuk = $t->anggota_cu_cu_keluar[0]->tanggal_masuk;
}else{
$tp_name = $t->anggota_cu_cu_keluar[0]->tp ? $t->anggota_cu_cu_keluar[0]->tp->name : '';
$t->no_ba = $tp_name . " : " . $t->anggota_cu_cu_not_keluar[0]->no_ba;
$t->tanggal_masuk = $t->anggota_cu_cu_keluar[0]->tanggal_masuk;
if($tp != 'semua'){
$t->no_ba = $t->anggota_cu_cu_keluar[0]->no_ba . "​ ";
$t->tanggal_masuk = $t->anggota_cu_cu_keluar[0]->tanggal_masuk;
}else{
$tp_name = $t->anggota_cu_cu_keluar[0]->tp ? $t->anggota_cu_cu_keluar[0]->tp->name : '';
$t->no_ba = $tp_name . " : " . $t->anggota_cu_cu_keluar[0]->no_ba;
$t->tanggal_masuk = $t->anggota_cu_cu_keluar[0]->tanggal_masuk;
}
}
};

Expand Down Expand Up @@ -331,32 +335,6 @@ public function storeCu(Request $request, $id)
]);
}

public function storeProduk(Request $request, $id)
{
$kelas = AnggotaProdukCu::create([
'anggota_cu_id' => $id,
'produk_cu_id' => $request->produk_cu['id'],
'saldo' => $request->saldo,
'no_rek' => $request->no_rek,
'tanggal' => $request->tanggal,
'tanggal_target' => $request->tanggal_target,
'lama_pinjaman' => $request->lama_pinjaman,
'tujuan' => $request->tujuan,
]);

AnggotaProdukCuTransaksi::create([
'anggota_produk_cu_id' => $kelas->id,
'saldo' => $request->saldo,
'tanggal' => $request->tanggal,
]);

return response()
->json([
'saved' => true,
'message' => 'Produk anggota CU berhasil ditambah'
]);
}

public function storeKlaim(Request $request, $id)
{
AnggotaCuKlaim::create($request->all());
Expand Down Expand Up @@ -437,6 +415,8 @@ public function updateKeluar(Request $request, $id)
'keterangan_keluar' => $request->keterangan_keluar,
]);

AnggotaCu::flushCache();

return response()
->json([
'saved' => true,
Expand All @@ -453,6 +433,8 @@ public function updateBatalKeluar($id)
'keterangan_keluar' => '',
]);

AnggotaCu::flushCache();

return response()
->json([
'saved' => true,
Expand All @@ -466,39 +448,12 @@ public function updateCu(Request $request, $id)

$kelas->update($request->all());

return response()
->json([
'saved' => true,
'message' => 'Keanggotaan CU berhasil diubah'
]);
}

public function updateProduk(Request $request, $id)
{
$kelas = AnggotaProdukCu::findOrFail($id);

$selisih_saldo = $request->saldo - $kelas->saldo;

$kelas->update([
'produk_cu_id' => $request->produk_cu['id'],
'saldo' => $request->saldo,
'no_rek' => $request->no_rek,
'tanggal' => $request->tanggal,
'tanggal_target' => $request->tanggal_target,
'lama_pinjaman' => $request->lama_pinjaman,
'tujuan' => $request->tujuan,
]);

AnggotaProdukCuTransaksi::create([
'anggota_produk_cu_id' => $kelas->id,
'saldo' => $selisih_saldo,
'tanggal' => $kelas->updated_at,
]);
AnggotaCu::flushCache();

return response()
->json([
'saved' => true,
'message' => 'Produk anggota CU berhasil diubah'
'message' => 'Keanggotaan CU berhasil diubah'
]);
}

Expand All @@ -521,6 +476,8 @@ public function updateKlaim(Request $request, $id)

$kelas->update($request->all());

AnggotaCu::flushCache();

return response()
->json([
'saved' => true,
Expand Down Expand Up @@ -600,29 +557,36 @@ public function destroy($id, $cu)
{
$kelas = AnggotaCu::findOrFail($id);
$kelasAnggotaCU = AnggotaCuCu::where('anggota_cu_id',$id)->get();

$name = $kelas->name;

if($kelasAnggotaCU->count() > 1){
AnggotaCuCu::where('anggota_cu_id', $id)->where('cu_id',$cu)->delete();
AnggotaProdukCu::with('produk_cu')->where('anggota_cu_id', $id)->whereHas('produk_cu', function($query) use ($cu){
$query->where('id_cu',$cu);
})->delete();
if($kelas->tanggal_meninggal != null || $kelas->tanggal_cacat != null || $kelasAnggotaCU->tanggal_keluar != null){
return response()
->json([
'deleted' => false,
'message' => $this->message. ' ' .$name. 'tidak berhasil dilakukan karena anggota ini antara sudah pernah mengajukan klaim JALINAN atau sudah dikeluarkan. Sehingga data anggota ini jika dihapus akan menyebabkan ketidakcocokan pada laporan.'
]);
}else{
if(!empty($kelas->gambar)){
File::delete($this->imagepath . $kelas->gambar . '.jpg');
File::delete($this->imagepath . $kelas->gambar . 'n.jpg');
if($kelasAnggotaCU->count() > 1){
AnggotaCuCu::where('anggota_cu_id', $id)->where('cu_id',$cu)->delete();
AnggotaProdukCu::with('produk_cu')->where('anggota_cu_id', $id)->whereHas('produk_cu', function($query) use ($cu){
$query->where('id_cu',$cu);
})->delete();
}else{
if(!empty($kelas->gambar)){
File::delete($this->imagepath . $kelas->gambar . '.jpg');
File::delete($this->imagepath . $kelas->gambar . 'n.jpg');
}
AnggotaCuCu::where('anggota_cu_id', $id)->delete();
AnggotaProdukCu::where('anggota_cu_id', $id)->delete();
$kelas->delete();
}
AnggotaCuCu::where('anggota_cu_id', $id)->delete();
AnggotaProdukCu::where('anggota_cu_id', $id)->delete();
$kelas->delete();
}

return response()
->json([
'deleted' => true,
'message' => $this->message. ' ' .$name. 'berhasil dihapus'
]);
return response()
->json([
'deleted' => true,
'message' => $this->message. ' ' .$name. 'berhasil dihapus'
]);
}
}

public function destroyCu($id)
Expand All @@ -637,18 +601,6 @@ public function destroyCu($id)
]);
}

public function destroyProduk($id)
{
$kelas = AnggotaProdukCu::findOrFail($id);
$kelas->delete();

return response()
->json([
'deleted' => true,
'message' => 'Produk anggota CU berhasil dihapus'
]);
}

public function destroyKlaim($id)
{
$kelas = AnggotaCuKlaim::findOrFail($id);
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/AnggotaProdukCuController.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function update(Request $request, $id)
{
$kelas = AnggotaProdukCu::findOrFail($id);

$selisih_saldo = $request->saldo - $kelas->saldo;
// $selisih_saldo = $request->saldo - $kelas->saldo;

$kelas->update([
'produk_cu_id' => $request->produk_cu['id'],
Expand All @@ -154,7 +154,7 @@ public function update(Request $request, $id)

AnggotaProdukCuTransaksi::create([
'anggota_produk_cu_id' => $kelas->id,
'saldo' => $selisih_saldo,
'saldo' => $request->saldo,
'tanggal' => $kelas->updated_at,
]);

Expand Down
49 changes: 30 additions & 19 deletions app/Http/Controllers/AssesmentAccessController.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,33 +205,44 @@ public function editPenilaian($id)

public function update(Request $request, $id)
{
$cu = \Auth::user()->id_cu;

$this->validate($request, AssesmentAccess::$rules);

$periode = $request->periode;

$kelas = AssesmentAccess::findOrFail($id);
$kelasP1 = AssesmentAccessP1::findOrFail($kelas->id_p1);
$kelasP2 = AssesmentAccessP2::findOrFail($kelas->id_p2);
$kelasP3 = AssesmentAccessP3::findOrFail($kelas->id_p3);
$kelasP4 = AssesmentAccessP4::findOrFail($kelas->id_p4);

$kelas->update($request->all());
$kelasP1->update($request->p1);
$kelasP2->update($request->p2);
$kelasP3->update($request->p3);
$kelasP4->update($request->p4);
if($kelas->status == 'BELUM SELESAI DINILAI' && $cu != 0){
return response()
->json([
'saved' => true,
'message' => $this->message. ' periode ' .$periode. ' tidak bisa diubah karena sedang dalam proses penilaian BKCU Kalimantan'
]);
}else{
$kelasP1 = AssesmentAccessP1::findOrFail($kelas->id_p1);
$kelasP2 = AssesmentAccessP2::findOrFail($kelas->id_p2);
$kelasP3 = AssesmentAccessP3::findOrFail($kelas->id_p3);
$kelasP4 = AssesmentAccessP4::findOrFail($kelas->id_p4);

$kelas->update($request->all());
$kelasP1->update($request->p1);
$kelasP2->update($request->p2);
$kelasP3->update($request->p3);
$kelasP4->update($request->p4);

if($request->status == 'BELUM DINILAI'){
NotificationHelper::self_assesment($kelas,'menambah');
}else if($request->status == 'SUDAH DINILAI'){
NotificationHelper::self_assesment($kelas,'memberikan penilaian pada');
}

if($request->status == 'BELUM DINILAI'){
NotificationHelper::self_assesment($kelas,'menambah');
}else if($request->status == 'SUDAH DINILAI'){
NotificationHelper::self_assesment($kelas,'memberikan penilaian pada');
return response()
->json([
'saved' => true,
'message' => $this->message. ' periode ' .$periode. ' berhasil diubah'
]);
}

return response()
->json([
'saved' => true,
'message' => $this->message. ' periode ' .$periode. ' berhasil diubah'
]);
}

public function destroy($id)
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function index()

$artikelsCUNew = Artikel::with('kategori','penulis','Cu')->where('id_cu','!=',0)->where('terbitkan',1)->orderBy('created_at','desc')->take(15)->get()->chunk(5);

$cus = Cu::with('Provinces')->withCount('hasTp')->inRandomOrder()->take(10)->get();
$cus = Cu::with('Provinces')->withCount('hasTp')->inRandomOrder()->take(6)->get();

// seo
SEO::setTitle('Home - Puskopdit BKCU Kalimantan');
Expand Down
Empty file modified app/Http/Middleware/PreferredDomain.php
100644 → 100755
Empty file.
Empty file modified app/Http/Requests/AktivisStoreRequest.php
100644 → 100755
Empty file.
Empty file modified app/Http/ViewComposers/AktivisCountComposer.php
100644 → 100755
Empty file.
Empty file modified app/Http/ViewComposers/ArtikelKategoriBKCUComposer.php
100644 → 100755
Empty file.
Empty file modified app/Http/ViewComposers/ArtikelKategoriCUComposer.php
100644 → 100755
Empty file.
Empty file modified app/Http/ViewComposers/CuComposer.php
100644 → 100755
Empty file.
Empty file modified app/Http/ViewComposers/CuCountComposer.php
100644 → 100755
Empty file.
Empty file modified app/Http/ViewComposers/DataGerakanComposer.php
100644 → 100755
Empty file.
Empty file modified app/Http/ViewComposers/ManajemenBKCUCountComposer.php
100644 → 100755
Empty file.
Empty file modified app/Http/ViewComposers/PengumumanBKCUComposer.php
100644 → 100755
Empty file.
Empty file modified app/Http/ViewComposers/PengumumanCUComposer.php
100644 → 100755
Empty file.
Empty file modified app/Http/ViewComposers/PeriodeDiklatComposer.php
100644 → 100755
Empty file.
Loading

0 comments on commit 3d752ac

Please sign in to comment.