Skip to content

Commit

Permalink
Update rilis versi 7.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
masadi committed Jun 11, 2024
1 parent e9f51e0 commit a202b45
Show file tree
Hide file tree
Showing 27 changed files with 237 additions and 37 deletions.
23 changes: 12 additions & 11 deletions app/Console/Commands/KirimErapor.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,26 @@ private function kirim_data($user_id, $table, $data, $sekolah_id, $tahun_ajaran_
'table' => $table,
'json' => prepare_send(json_encode($data)),
];
$url = 'http://app.erapor-smk.net/api/sinkronisasi/kirim-data';
$response = Http::withOptions([
'verify' => false,
])->withHeaders([
'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36',
'accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
])->post($url, $data_sync);
if($response->status() == 200){
$response = http_dashboard('sinkronisasi/kirim-data', $data_sync);
# $url = 'http://app.erapor-smk.net/api/sinkronisasi/kirim-data';
# $response = Http::withOptions([
# 'verify' => false,
# ])->withHeaders([
# 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36',
# 'accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
# ])->post($url, $data_sync);
if($response->status){
if($this->argument('akses')){
$this->call('respon:artisan', ['status' => 'info', 'title' => 'Berhasil', 'respon' => count($data).' data '.nama_table($table).' berhasil dikirim']);
}
$this->info(count($data).' data '.nama_table($table). ' berhasil dikirim');
//$this->update_last_sync($user_id, $table, $data, $sekolah_id);
$this->update_last_sync($user_id, $table, $data, $sekolah_id);
} else {
if($this->argument('akses')){
$this->call('respon:artisan', ['status' => 'error', 'title' => 'Gagal', 'respon' => 'Proses pengiriman data '.nama_table($table).' gagal. Server tidak merespon. Status Server: '.$response->status()]);
$this->call('respon:artisan', ['status' => 'error', 'title' => 'Gagal', 'respon' => 'Proses pengiriman data '.nama_table($table).' gagal. Server tidak merespon. Status Server: '.$response->message]);
}
$this->proses_sync('', 'Proses pengiriman data '.nama_table($table).' gagal. Server tidak merespon', 0, 0, 0);
$this->error('Proses pengiriman data '.nama_table($table).' gagal. Server tidak merespon. Status Server: '.$response->status());
$this->error('Proses pengiriman data '.nama_table($table).' gagal. Server tidak merespon. Status Server: '.$response->message);
}
}
private function update_last_sync($user_id, $table, $data, $sekolah_id){
Expand Down
3 changes: 2 additions & 1 deletion app/Console/Commands/SinkronErapor.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ private function get_table($table){
}
private function ambil_data($satuan, $data_sync){
try {
$response = Http::post('http://app.erapor-smk.net/api/sinkronisasi/'.$satuan, $data_sync);
$response = http_dashboard('sinkronisasi/'.$satuan, $data_sync);
//$response = Http::post('http://app.erapor-smk.net/api/sinkronisasi/'.$satuan, $data_sync);
if($response->status() == 200){
return $response->object();
} else {
Expand Down
56 changes: 56 additions & 0 deletions app/Exports/LeggerNilaiPilihanExport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

namespace App\Exports;

use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use App\Models\Peserta_didik;
use App\Models\Pembelajaran;
use App\Models\Rombongan_belajar;
use App\Models\Semester;

class LeggerNilaiPilihanExport implements FromView, ShouldAutoSize
{
use Exportable;
public function query(array $data)
{
$this->rombongan_belajar = $data['rombongan_belajar'];
$this->rombongan_belajar_id = $data['rombongan_belajar_id'];
$this->merdeka = $data['merdeka'];
$this->sekolah_id = $data['sekolah_id'];
$this->semester_id = $data['semester_id'];

return $this;
}
public function view(): View
{
$data_siswa = Peserta_didik::whereHas('anggota_rombel', function($query){
$query->where('rombongan_belajar_id', $this->rombongan_belajar_id);
})->with([
'anggota_rombel' => function($query){
$query->where('rombongan_belajar_id', $this->rombongan_belajar_id);
$query->with(['absensi']);
},
'anggota_pilihan' => function($query){
$query->where('semester_id', $this->semester_id);
}
])->orderBy('nama')->get();
$all_pembelajaran = Pembelajaran::with(['rombongan_belajar'])->where(function($query){
$query->where('rombongan_belajar_id', $this->rombongan_belajar_id);
$query->whereNotNull('kelompok_id');
$query->whereNotNull('no_urut');
$query->whereNull('induk_pembelajaran_id');
})->orderBy('kelompok_id', 'asc')->orderBy('no_urut', 'asc')->get();
$semester = Semester::find($this->semester_id);
$params = array(
'data_siswa' => $data_siswa,
'all_pembelajaran' => $all_pembelajaran,
'rombongan_belajar' => Rombongan_belajar::with(['sekolah'])->find($this->rombongan_belajar_id),
'merdeka' => $this->merdeka,
'tahun_ajaran' => $semester->nama,
);
return view('laporan.legger_nilai_pilihan', $params);
}
}
7 changes: 7 additions & 0 deletions app/Helpers/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,13 @@ function http_client($satuan, $data_sync){
])->retry(3, 100)->post(config('erapor.api_url').$satuan, $data_sync);
return $response->object();
}
function http_dashboard($satuan, $data_sync){
$response = Http::withOptions([
'verify' => false,
//'debug' => config('app.debug') ? fopen('php://stderr', 'w') : FALSE,
])->retry(3, 100)->post(config('erapor.dashboard_url').$satuan, $data_sync);
return $response;
}
function merdeka($nama_kurikulum){
return Str::contains($nama_kurikulum, 'Merdeka');
}
Expand Down
16 changes: 16 additions & 0 deletions app/Http/Controllers/DownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use App\Exports\TemplateNilaiTp;
use App\Exports\TemplateTp;
use App\Exports\LeggerNilaiKurmerExport;
use App\Exports\LeggerNilaiPilihanExport;
use App\Exports\TemplateNilaiPts;
use App\Exports\TemplateSumatifLingkupMateri;
use App\Exports\TemplateSumatifAkhirSemester;
Expand Down Expand Up @@ -55,6 +56,21 @@ public function unduh_leger_nilai_kurmer(){
'sekolah_id' => request()->route('sekolah_id'),
'semester_id' => request()->route('semester_id'),
])->download($nama_file);
}
public function unduh_leger_nilai_pilihan(){
$rombongan_belajar = Rombongan_belajar::find(request()->route('rombongan_belajar_id'));
$merdeka = merdeka($rombongan_belajar->kurikulum->nama_kurikulum);
$nama_file = 'Leger Nilai Akhir Kelas ' . $rombongan_belajar->nama;
$nama_file = clean($nama_file);
$nama_file = $nama_file . '.xlsx';
$data = [
'rombongan_belajar' => $rombongan_belajar,
'rombongan_belajar_id' => request()->route('rombongan_belajar_id'),
'merdeka' => $merdeka,
'sekolah_id' => request()->route('sekolah_id'),
'semester_id' => request()->route('semester_id'),
];
return (new LeggerNilaiPilihanExport)->query($data)->download($nama_file);
}
public function unduh_leger_nilai_rapor(){
$rombongan_belajar = Rombongan_belajar::find(request()->route('rombongan_belajar_id'));
Expand Down
2 changes: 1 addition & 1 deletion app_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.4
7.0.5
2 changes: 2 additions & 0 deletions config/erapor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
return [
'api_url' => 'http://sync.erapor-smk.net/api/v7/dapodik/',
//'api_url' => 'http://sync-erapor.test/api/v7/dapodik/',
'dashboard_url' => 'http://app.erapor-smk.net/api/',
//'dashboard_url' => 'http://app-erapor.test/api/',
'rapor_pts' => env('APP_PTS', FALSE),
'bentuk_pendidikan' => explode(',', env('APP_JENJANG', 15)),
];
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions public/js/chunks/15.05e48177c89bf7a56231.js

This file was deleted.

2 changes: 2 additions & 0 deletions public/js/chunks/15.df977a3b07247ccf7711.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions public/js/chunks/17.08bc38d26d5055a744dc.js

This file was deleted.

2 changes: 2 additions & 0 deletions public/js/chunks/17.73dad9ab9b852740f832.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/chunks/66.9db627d8667c31949331.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a202b45

Please sign in to comment.