Update
This commit is contained in:
@@ -1,119 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use App\Models\DataUploadBosOmspan;
|
||||
use App\Models\UploadData;
|
||||
use App\Imports\ImportDataBos;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class UploadDataController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Upload Data";
|
||||
parent::__construct();
|
||||
$this->setIconTitle("fa fa-share");
|
||||
}
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$method = $request->method();
|
||||
$this->setTitle("Upload Data");
|
||||
$this->setSubtitle("Upload File");
|
||||
$this->setIconTitle("fas fa-upload");
|
||||
if ($request->isMethod('post')) {
|
||||
$req = $request->all();
|
||||
try{
|
||||
$this->validate($request, [
|
||||
'file' => 'required|mimes:xls,xlsx',
|
||||
]);
|
||||
|
||||
$file = $request->file('file');
|
||||
$subJenisDana = $request->optJenisDana;
|
||||
$ta = $request->ta;
|
||||
$tujuan_upload = 'uploadFiles';
|
||||
$file->move($tujuan_upload,$file->getClientOriginalName());
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
// DataUploadBosOmspan::truncate();
|
||||
Excel::import(new ImportDataBos($ta), $tujuan_upload."/".$file->getClientOriginalName());
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect(URL::to("/admin/upload-data/"))->with('success','Data berhasil diupload, Silahkan validasi data terlebih dahulu!');
|
||||
}
|
||||
catch(\Exception $e)
|
||||
{
|
||||
// throw new \Exception($e->getMessage());
|
||||
DB::rollBack();
|
||||
abort(500, $e->getMessage());
|
||||
// return redirect(URL::to("/upload-data/".$typeDana))->with('error',$e->getMessage());
|
||||
}
|
||||
}
|
||||
$this->siteTitle = "Upload Data";
|
||||
return view('admin.upload_data.index');
|
||||
}
|
||||
|
||||
public function uploadDatatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = isset($post["search"])?$post["search"]["value"]:"";
|
||||
|
||||
$dataFilter=0;
|
||||
$data = DataUploadBosOmspan::orderBy("created_at","ASC");
|
||||
if (!empty($src)){
|
||||
// $data->whereRaw("(LOWER(kode_skpd) LIKE '%".strtolower($src)."%'
|
||||
// OR LOWER(nama_skpd) LIKE '%".strtolower($src)."%'
|
||||
// OR LOWER(kode_rekening) LIKE '%".strtolower($src)."%'
|
||||
// OR LOWER(nama_rekening) LIKE '%".strtolower($src)."%')");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
$dataTotal = DataUploadBosOmspan::count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
public function uploadValidate(Request $request)
|
||||
{
|
||||
try{
|
||||
DB::beginTransaction();
|
||||
|
||||
UploadData::where("tahun",getTA())->delete();
|
||||
DB::statement("INSERT INTO upload_data(tahun,kode_skpd,kode_rekening,total_lra)
|
||||
SELECT tahun,kode_skpd,kode_rekening,total_lra FROM tmp_upload_data ");
|
||||
|
||||
$skpds = DB::table('tmp_upload_data')->distinct()->select('kode_skpd')->get();
|
||||
foreach($skpds as $skpd){
|
||||
// CEK MAIN INDIKATOR
|
||||
$txIndikator = TxIndikator::firstOrCreate(["tahun"=>getTA(),"kode_skpd"=>$skpd->kode_skpd],[
|
||||
"status_approval"=>3, // Operator
|
||||
]);
|
||||
|
||||
$calculation = new CalculationIndikator($txIndikator->id);
|
||||
$calculation->rasio();
|
||||
$calculation->summary();
|
||||
}
|
||||
TempUploadData::truncate();
|
||||
DB::commit();
|
||||
return redirect(URL::to("/admin/upload-data"))->with('success','Data Realisasi belanja berhasil diupload.');
|
||||
}catch(\Exception $e){
|
||||
throw new \Exception($e->getMessage());
|
||||
DB::rollBack();
|
||||
return redirect(URL::to("/admin/upload-data"))->with('error',$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use App\Models\DataUploadBosOmspan;
|
||||
use App\Models\DataBosOmspan;
|
||||
use App\Models\UploadData;
|
||||
use App\Imports\ImportDataBos;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class DataBosOmspanController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->setIconTitle("fa fa-graduation-cap");
|
||||
}
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$method = $request->method();
|
||||
$this->setTitle("Data BOS Omspan");
|
||||
$this->setIconTitle("fa fa-graduation-cap");
|
||||
$this->siteTitle = "Daftar";
|
||||
return view('data_omspan.index');
|
||||
}
|
||||
|
||||
public function upload(Request $request)
|
||||
{
|
||||
$method = $request->method();
|
||||
$this->setTitle("Data BOS Omspan");
|
||||
$this->setSubtitle("Upload File");
|
||||
$this->setIconTitle("fas fa-upload");
|
||||
if ($request->isMethod('post')) {
|
||||
$req = $request->all();
|
||||
try{
|
||||
$this->validate($request, [
|
||||
'file' => 'required|mimes:xls,xlsx',
|
||||
]);
|
||||
|
||||
$file = $request->file('file');
|
||||
$subJenisDana = $request->optJenisDana;
|
||||
$ta = $request->ta;
|
||||
$tujuan_upload = 'uploadFiles';
|
||||
$file->move($tujuan_upload,$file->getClientOriginalName());
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
// DataUploadBosOmspan::truncate();
|
||||
Excel::import(new ImportDataBos($ta), $tujuan_upload."/".$file->getClientOriginalName());
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect(URL::to("/data-omspan/upload/"))->with('success','Data berhasil diupload, Silahkan validasi data terlebih dahulu!');
|
||||
}
|
||||
catch(\Exception $e)
|
||||
{
|
||||
// throw new \Exception($e->getMessage());
|
||||
DB::rollBack();
|
||||
abort(500, $e->getMessage());
|
||||
// return redirect(URL::to("/upload-data/".$typeDana))->with('error',$e->getMessage());
|
||||
}
|
||||
}
|
||||
$this->siteTitle = "Upload Data";
|
||||
return view('data_omspan.upload');
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = isset($post["search"])?$post["search"]["value"]:"";
|
||||
|
||||
$dataFilter=0;
|
||||
$data = DataBosOmspan::orderBy("created_at","ASC");
|
||||
if (!empty($src)){
|
||||
$data->whereRaw("(
|
||||
LOWER(kanwil) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(kppn) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(lokasi_kewenangan) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(jenis_bos) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(no_rekening_nama_rekening) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(npsn) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(no_tgl_sp2d_detail) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(status_sekolah) LIKE '%".strtolower($src)."%'
|
||||
)");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
$dataTotal = DataBosOmspan::count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
public function uploadDatatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = isset($post["search"])?$post["search"]["value"]:"";
|
||||
|
||||
$dataFilter=0;
|
||||
$data = DataUploadBosOmspan::orderBy("created_at","ASC");
|
||||
if (!empty($src)){
|
||||
$data->whereRaw("(
|
||||
LOWER(kanwil) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(kppn) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(lokasi_kewenangan) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(jenis_bos) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(no_rekening_nama_rekening) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(npsn) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(no_tgl_sp2d_detail) LIKE '%".strtolower($src)."%'
|
||||
OR LOWER(status_sekolah) LIKE '%".strtolower($src)."%'
|
||||
)");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
$dataTotal = DataUploadBosOmspan::count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
public function uploadValidate(Request $request)
|
||||
{
|
||||
try{
|
||||
DB::beginTransaction();
|
||||
DB::statement("INSERT INTO DATA_BOS_OMSPAN(
|
||||
tahun,
|
||||
kanwil,
|
||||
kppn,
|
||||
lokasi_kewenangan,
|
||||
lokasi_sekolah,
|
||||
no_tgl_sk,
|
||||
jenis_bos,
|
||||
tahap,
|
||||
gelombang,
|
||||
npsn_nama_sekolah,
|
||||
jenis_satuan_pendidikan,
|
||||
status_sekolah,
|
||||
bank,
|
||||
no_rekening_nama_rekening,
|
||||
npsn,
|
||||
rekening,
|
||||
nama,
|
||||
jenjang_sekolah,
|
||||
no_tgl_sp2d_detail,
|
||||
no_sp2d,
|
||||
tgl_sp2d,
|
||||
status,
|
||||
nilai,
|
||||
pagu,
|
||||
jmlh_siswa,
|
||||
ket_retur
|
||||
)
|
||||
SELECT
|
||||
tahun,
|
||||
kanwil,
|
||||
kppn,
|
||||
lokasi_kewenangan,
|
||||
lokasi_sekolah,
|
||||
no_tgl_sk,
|
||||
jenis_bos,
|
||||
tahap,
|
||||
gelombang,
|
||||
npsn_nama_sekolah,
|
||||
jenis_satuan_pendidikan,
|
||||
status_sekolah,
|
||||
bank,
|
||||
no_rekening_nama_rekening,
|
||||
npsn,
|
||||
rekening,
|
||||
nama,
|
||||
jenjang_sekolah,
|
||||
no_tgl_sp2d_detail,
|
||||
no_sp2d,
|
||||
tgl_sp2d,
|
||||
status,
|
||||
nilai,
|
||||
pagu,
|
||||
jmlh_siswa,
|
||||
ket_retur
|
||||
FROM DATA_UPLOAD_BOS_OMSPAN
|
||||
WHERE NOT EXISTS(
|
||||
SELECT *
|
||||
FROM DATA_BOS_OMSPAN
|
||||
WHERE (tahun ='".getTA()."' AND DATA_BOS_OMSPAN.no_tgl_sp2d_detail = DATA_UPLOAD_BOS_OMSPAN.no_tgl_sp2d_detail)
|
||||
)");
|
||||
DataUploadBosOmspan::truncate();
|
||||
DB::commit();
|
||||
return redirect(URL::to("/data-omspan/upload"))->with('success','Data Omspan berhasil diupload.');
|
||||
}catch(\Exception $e){
|
||||
throw new \Exception($e->getMessage());
|
||||
DB::rollBack();
|
||||
return redirect(URL::to("/data-omspan/upload"))->with('error',$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,39 +22,41 @@ class ImportDataBos implements WithColumnFormatting, ToModel, WithStartRow
|
||||
return 2;
|
||||
}
|
||||
|
||||
protected function replaceIni($str)
|
||||
{
|
||||
return str_replace(["'"],"",$str);
|
||||
}
|
||||
|
||||
public function model(array $row)
|
||||
{
|
||||
// if (!isset($row[0])) {
|
||||
// return null;
|
||||
// }
|
||||
var_dump($row); exit;
|
||||
$data = [
|
||||
"no"=>$row[0],
|
||||
"kanwil"=>$row[1],
|
||||
"kppn"=>$row[2],
|
||||
"lokasi_kewenangan"=>$row[3],
|
||||
"lokasi_sekolah"=>$row[4],
|
||||
"no_tgl_sk"=>$row[5],
|
||||
"jenis_bos"=>$row[6],
|
||||
"tahap"=>$row[7],
|
||||
"gelombang"=>$row[8],
|
||||
"npsn_nama_sekolah"=>$row[9],
|
||||
"jenis_satuan_pendidikan"=>$row[10],
|
||||
"status_sekolah"=>$row[11],
|
||||
"bank"=>$row[12],
|
||||
"no_rekening_nama_rekening"=>$row[13],
|
||||
"npsn"=>$row[14],
|
||||
"rekening"=>$row[15],
|
||||
"nama"=>$row[16],
|
||||
"jenjang_sekolah"=>$row[17],
|
||||
"no_tgl_sp2d_detail"=>$row[18],
|
||||
"no_sp2d"=>$row[19],
|
||||
"tgl_sp2d"=>$row[20],
|
||||
"status"=>$row[21],
|
||||
"nilai"=>$row[22],
|
||||
"pagu"=>$row[23],
|
||||
"jmlh_siswa"=>$row[24],
|
||||
"ket_retur"=>$row[25]
|
||||
"tahun"=>getTA(),
|
||||
"no"=>$this->replaceIni($row[0]),
|
||||
"kanwil"=>$this->replaceIni($row[1]),
|
||||
"kppn"=>$this->replaceIni($row[2]),
|
||||
"lokasi_kewenangan"=>$this->replaceIni($row[3]),
|
||||
"lokasi_sekolah"=>$this->replaceIni($row[4]),
|
||||
"no_tgl_sk"=>$this->replaceIni($row[5]),
|
||||
"jenis_bos"=>$this->replaceIni($row[6]),
|
||||
"tahap"=>$this->replaceIni($row[7]),
|
||||
"gelombang"=>$this->replaceIni($row[8]),
|
||||
"npsn_nama_sekolah"=>$this->replaceIni($row[9]),
|
||||
"jenis_satuan_pendidikan"=>$this->replaceIni($row[10]),
|
||||
"status_sekolah"=>$this->replaceIni($row[11]),
|
||||
"bank"=>$this->replaceIni($row[12]),
|
||||
"no_rekening_nama_rekening"=>$this->replaceIni($row[13]),
|
||||
"npsn"=>$this->replaceIni($row[14]),
|
||||
"rekening"=>$this->replaceIni($row[15]),
|
||||
"nama"=>$this->replaceIni($row[16]),
|
||||
"jenjang_sekolah"=>$this->replaceIni($row[17]),
|
||||
"no_tgl_sp2d_detail"=>$this->replaceIni($row[18]),
|
||||
"no_sp2d"=>$this->replaceIni($row[19]),
|
||||
"tgl_sp2d"=>is_numeric($row[20])?convertSerialDate($row[20]):$row[20],
|
||||
"status"=>$this->replaceIni($row[21]),
|
||||
"nilai"=>$this->replaceIni($row[22]),
|
||||
"pagu"=>$this->replaceIni($row[23]),
|
||||
"jmlh_siswa"=>$this->replaceIni($row[24]),
|
||||
"ket_retur"=>$this->replaceIni($row[25])
|
||||
];
|
||||
|
||||
return new DataUploadBosOmspan($data);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class DataBosOmspan extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.DATA_BOS_OMSPAN';
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -13,5 +13,4 @@ class DataUploadBosOmspan extends Eloquent
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.DATA_UPLOAD_BOS_OMSPAN';
|
||||
protected $guarded = [];
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
||||
@@ -156,3 +156,8 @@ function getKodeRekInduk($val)
|
||||
$kodeRek = array_combine(array_keys($conf),array_column(array_values($conf),"rekening"));
|
||||
return $kodeRek[$val];
|
||||
}
|
||||
|
||||
function convertSerialDate($date) {
|
||||
$timestamp = ($date - 25569) * 86400;
|
||||
return date("Y-m-d",$timestamp);
|
||||
}
|
||||
@@ -15,7 +15,7 @@ class CreateImportBosTable extends Migration
|
||||
{
|
||||
Schema::create('data_upload_bos_omspan', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('tahun',4);
|
||||
$table->smallInteger("no")->nullable();
|
||||
$table->string("kanwil",100);
|
||||
$table->string('kppn',50);
|
||||
@@ -26,13 +26,13 @@ class CreateImportBosTable extends Migration
|
||||
$table->smallInteger('tahap');
|
||||
$table->smallInteger('gelombang');
|
||||
$table->string('npsn_nama_sekolah',100);
|
||||
$table->string('jenis_satuan_pendidikan',10);
|
||||
$table->string('jenis_satuan_pendidikan',10)->nullable();
|
||||
$table->string('status_sekolah',30);
|
||||
$table->string('bank',30);
|
||||
$table->string('no_rekening_nama_rekening',150);
|
||||
$table->string('npsn',30);
|
||||
$table->string('rekening',30);
|
||||
$table->string('nama',10);
|
||||
$table->string('nama',100);
|
||||
$table->string('jenjang_sekolah',10);
|
||||
$table->string('no_tgl_sp2d_detail',100);
|
||||
$table->string('no_sp2d',50);
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateDataBosOmspanTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('data_bos_omspan', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('tahun',4);
|
||||
$table->smallInteger("no")->nullable();
|
||||
$table->string("kanwil",100);
|
||||
$table->string('kppn',50);
|
||||
$table->string('lokasi_kewenangan',50);
|
||||
$table->string('lokasi_sekolah',20);
|
||||
$table->string('no_tgl_sk',50);
|
||||
$table->string('jenis_bos',20);
|
||||
$table->smallInteger('tahap');
|
||||
$table->smallInteger('gelombang');
|
||||
$table->string('npsn_nama_sekolah',100);
|
||||
$table->string('jenis_satuan_pendidikan',10)->nullable();
|
||||
$table->string('status_sekolah',30);
|
||||
$table->string('bank',30);
|
||||
$table->string('no_rekening_nama_rekening',150);
|
||||
$table->string('npsn',30);
|
||||
$table->string('rekening',30);
|
||||
$table->string('nama',100);
|
||||
$table->string('jenjang_sekolah',10);
|
||||
$table->string('no_tgl_sp2d_detail',100);
|
||||
$table->string('no_sp2d',50);
|
||||
$table->date('tgl_sp2d');
|
||||
$table->string('status',50);
|
||||
$table->decimal('nilai',18,2);
|
||||
$table->decimal('pagu',18,2);
|
||||
$table->integer('jmlh_siswa',50);
|
||||
$table->string('ket_retur',100)->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('data_bos_omspan');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
@php
|
||||
$siteBreadcumb = [
|
||||
["url"=>"/realisasi-belanja","label"=>$siteTitle],
|
||||
["url"=>"/realisasi-belanja/create","label"=>$sitesubTitle]
|
||||
];
|
||||
|
||||
$jenisDana = ["All","CHT"];
|
||||
@endphp
|
||||
|
||||
@extends('layouts.empty')
|
||||
@section('styles')
|
||||
<!-- DataTables -->
|
||||
<link rel="stylesheet" href="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/css/buttons.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-fixedcolumns/css/fixedColumns.bootstrap4.min.css">
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="card card-default">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title"><i class="fa fa-th-list mr-2"></i> Daftar</h2>
|
||||
<div class="card-tools">
|
||||
<a href="{{ URL::to('/data-omspan/upload') }}" class="btn btn-tool btn-warning"><i class="fa fa-save"></i> Upload</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table id="tempUploadRealisasi" class="table table-striped jambo_table tblClickRow" style="width:100%">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th>No</th>
|
||||
<?php
|
||||
$arrCol = array(
|
||||
"Kanwil",
|
||||
"KPPN",
|
||||
"Lokasi Kewenangan",
|
||||
"Lokasi Sekolah",
|
||||
"No Tgl SK",
|
||||
"Jenis Bos",
|
||||
"Tahap",
|
||||
"Gelombang",
|
||||
"NPSN Nama Sekolah",
|
||||
"Jenis Satuan Pendidikan",
|
||||
"Status Sekolah",
|
||||
"Bank",
|
||||
"No Rekening Nama Rekening",
|
||||
"NPSN",
|
||||
"Rekening",
|
||||
"Nama",
|
||||
"Jenjang Sekolah",
|
||||
"No Tgl Sp2d Detail",
|
||||
"No Sp2d",
|
||||
"Tgl Sp2d",
|
||||
"Status",
|
||||
"Nilai",
|
||||
"Pagu",
|
||||
"Jmlh Siswa",
|
||||
"Ket Retur");
|
||||
foreach($arrCol as $rowCol){
|
||||
echo "<th>$rowCol</th>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/jszip/jszip.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/pdfmake/pdfmake.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/pdfmake/vfs_fonts.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/js/buttons.html5.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/js/buttons.print.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-fixedcolumns/js/dataTables.fixedColumns.min.js"></script>
|
||||
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-fixedcolumns/js/fixedColumns.bootstrap4.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#uploadData").on("submit",function(e){
|
||||
e.preventDefault();
|
||||
$("body").append("<div class='loading'></div>");
|
||||
return e.currentTarget.submit();
|
||||
});
|
||||
|
||||
$(document).on("click","#upload_validated",function (e){
|
||||
e.preventDefault();
|
||||
let test = Swal.fire({
|
||||
title: 'Data akan diUpload?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
$("body").append("<div class='loading'></div>");
|
||||
location.href='{{ url('/admin/upload-data/proses') }}';
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
var dtTable = $('#tempUploadRealisasi').DataTable( {
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"ajax": {
|
||||
url: "{{ $baseUrl }}/data-omspan/datatable",
|
||||
type: "POST",
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: function (d) {
|
||||
}
|
||||
},
|
||||
"columnDefs": [
|
||||
//{ className: "td-nowrap", "targets": [ 1 ] }
|
||||
],
|
||||
|
||||
"lengthMenu": [
|
||||
[ 25, 100, 200 ],
|
||||
[ "25", "100", "200" ]
|
||||
],
|
||||
"paging": true, // Table pagination
|
||||
"columns": [
|
||||
{"data":null, "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"kanwil", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"kppn", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"lokasi_kewenangan", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"lokasi_sekolah", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"no_tgl_sk", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"jenis_bos", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"tahap", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"gelombang", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"npsn_nama_sekolah"},
|
||||
{"data":"jenis_satuan_pendidikan", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"status_sekolah", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"bank", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"no_rekening_nama_rekening"},
|
||||
{"data":"npsn", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"rekening", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"nama", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"jenjang_sekolah", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"no_tgl_sp2d_detail", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"no_sp2d", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"tgl_sp2d", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"status", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"nilai", "className":"text-right", "defaultContent":"-"},
|
||||
{"data":"pagu", "className":"text-right", "defaultContent":"-"},
|
||||
{"data":"jmlh_siswa", "className":"text-center", "defaultContent":"-"},
|
||||
{"data":"ket_retur"}
|
||||
],
|
||||
"rowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull, oSettings) {
|
||||
let info = dtTable.page.info();
|
||||
let numStart = info.page;
|
||||
let index = (numStart * dtTable.page.len()) + iDisplayIndex + 1;
|
||||
|
||||
$("td:eq(0)", nRow).html(index);
|
||||
$("td:eq(22)", nRow).html(separateNumberIndo(aData["nilai"]));
|
||||
$("td:eq(23)", nRow).html(separateNumberIndo(aData["pagu"]));
|
||||
$("td:eq(24)", nRow).html(separateNumberIndo(aData["jmlh_siswa"]));
|
||||
|
||||
return nRow;
|
||||
},
|
||||
"drawCallback": function( settings ) {
|
||||
if (dtTable.page.info().recordsTotal == 0){
|
||||
$("#upload_validated").prop("disabled", true)
|
||||
}
|
||||
},
|
||||
"language": {
|
||||
"lengthMenu": "Tampil _MENU_ data per Halaman",
|
||||
"zeroRecords": "Data tidak ditemukan!",
|
||||
"info": "Halaman _PAGE_ dari _PAGES_ Halaman ( _TOTAL_ Data )",
|
||||
"infoEmpty": "Data tidak tersedia",
|
||||
"infoFiltered": "(Disaring dari _MAX_ Data)",
|
||||
"paginate": {
|
||||
"previous": "<i class='fas fa-angle-double-left'></i>",
|
||||
"next": "<i class='fas fa-angle-double-right'></i>",
|
||||
},
|
||||
"processing": "<div class='loading'></div>",
|
||||
},
|
||||
"scrollX":true,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
+63
-15
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="uploadData" action="{{ url("/admin/upload-data") }}" method="POST" autocomplete="off" enctype="multipart/form-data">
|
||||
<form id="uploadData" action="{{ URL::to("/data-omspan/upload") }}" method="POST" autocomplete="off" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<label>Tahun</label>
|
||||
@@ -37,7 +37,10 @@
|
||||
<label>File</label>
|
||||
<input class="form-control" type="file" name="file" required>
|
||||
</div>
|
||||
<div class="form-group"><button type="submit" class="btn btn-sm btn-success"><i class="fas fa-file-excel"></i> Upload File</button></div>
|
||||
<div class="form-group">
|
||||
<a href="{{ URL::to('/data-omspan') }}" class="btn btn-danger"><i class="fa fa-chevron-left"></i> Batal</a>
|
||||
<button type="submit" class="btn btn-sm btn-success"><i class="fas fa-file-excel"></i> Upload File</button>
|
||||
</div>
|
||||
<p>
|
||||
<strong>Format:xlsx | Columns:</strong>
|
||||
"no",
|
||||
@@ -85,7 +88,32 @@
|
||||
<tr class="headings">
|
||||
<th>No</th>
|
||||
<?php
|
||||
$arrCol = array("Tahun", "Kode SKPD", "Nama SKPD", "Kode Rekening","Nama Rekening", "LRA");
|
||||
$arrCol = array(
|
||||
"kanwil",
|
||||
"kppn",
|
||||
"lokasi_kewenangan",
|
||||
"lokasi_sekolah",
|
||||
"no_tgl_sk",
|
||||
"jenis_bos",
|
||||
"tahap",
|
||||
"gelombang",
|
||||
"npsn_nama_sekolah",
|
||||
"jenis_satuan_pendidikan",
|
||||
"status_sekolah",
|
||||
"bank",
|
||||
"no_rekening_nama_rekening",
|
||||
"npsn",
|
||||
"rekening",
|
||||
"nama",
|
||||
"jenjang_sekolah",
|
||||
"no_tgl_sp2d_detail",
|
||||
"no_sp2d",
|
||||
"tgl_sp2d",
|
||||
"status",
|
||||
"nilai",
|
||||
"pagu",
|
||||
"jmlh_siswa",
|
||||
"ket_retur");
|
||||
foreach($arrCol as $rowCol){
|
||||
echo "<th>$rowCol</th>";
|
||||
}
|
||||
@@ -133,7 +161,7 @@
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
$("body").append("<div class='loading'></div>");
|
||||
location.href='{{ url('/admin/upload-data/proses') }}';
|
||||
location.href='{{ url('/data-omspan/upload/proses') }}';
|
||||
}
|
||||
})
|
||||
});
|
||||
@@ -153,10 +181,8 @@
|
||||
var dtTable = $('#tempUploadRealisasi').DataTable( {
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"ordering": false,
|
||||
"autoWidth": false,
|
||||
"ajax": {
|
||||
url: "{{ $baseUrl }}/admin/upload-data/datatable",
|
||||
url: "{{ $baseUrl }}/data-omspan/upload/datatable",
|
||||
type: "POST",
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
@@ -175,12 +201,31 @@
|
||||
"paging": true, // Table pagination
|
||||
"columns": [
|
||||
{"data":null},
|
||||
{ "data": "tahun", "width": "50px" },
|
||||
{ "data": "kode_skpd", "className":"text-center", "defaultContent":"-" },
|
||||
{ "data": "nama_skpd", "className":"text-left", "defaultContent":"-" },
|
||||
{ "data": "kode_rekening", "className":"text-center", "defaultContent":"-" },
|
||||
{ "data": "nama_rekening", "className":"text-left", "defaultContent":"-" },
|
||||
{ "data": "total_lra", "className":"text-right", "defaultContent":"0" },
|
||||
{"data":"kanwil"},
|
||||
{"data":"kppn"},
|
||||
{"data":"lokasi_kewenangan"},
|
||||
{"data":"lokasi_sekolah"},
|
||||
{"data":"no_tgl_sk"},
|
||||
{"data":"jenis_bos"},
|
||||
{"data":"tahap"},
|
||||
{"data":"gelombang"},
|
||||
{"data":"npsn_nama_sekolah"},
|
||||
{"data":"jenis_satuan_pendidikan"},
|
||||
{"data":"status_sekolah"},
|
||||
{"data":"bank"},
|
||||
{"data":"no_rekening_nama_rekening"},
|
||||
{"data":"npsn"},
|
||||
{"data":"rekening"},
|
||||
{"data":"nama"},
|
||||
{"data":"jenjang_sekolah"},
|
||||
{"data":"no_tgl_sp2d_detail"},
|
||||
{"data":"no_sp2d"},
|
||||
{"data":"tgl_sp2d"},
|
||||
{"data":"status"},
|
||||
{"data":"nilai"},
|
||||
{"data":"pagu"},
|
||||
{"data":"jmlh_siswa"},
|
||||
{"data":"ket_retur"}
|
||||
],
|
||||
"rowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull, oSettings) {
|
||||
let info = dtTable.page.info();
|
||||
@@ -188,7 +233,9 @@
|
||||
let index = (numStart * dtTable.page.len()) + iDisplayIndex + 1;
|
||||
|
||||
$("td:eq(0)", nRow).html(index);
|
||||
$("td:eq(6)", nRow).html(separateNumberIndo(aData["total_lra"]));
|
||||
$("td:eq(22)", nRow).html(separateNumberIndo(aData["nilai"]));
|
||||
$("td:eq(23)", nRow).html(separateNumberIndo(aData["pagu"]));
|
||||
$("td:eq(24)", nRow).html(separateNumberIndo(aData["jmlh_siswa"]));
|
||||
|
||||
return nRow;
|
||||
},
|
||||
@@ -209,8 +256,9 @@
|
||||
},
|
||||
"processing": "<div class='loading'></div>",
|
||||
},
|
||||
scrollX:true,
|
||||
"scrollX":true,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -106,6 +106,14 @@
|
||||
<p>Laporan</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php if ($role == "anggaran"){ ?>
|
||||
<li class="nav-item">
|
||||
<a href="{{ $baseUrl }}/data-omspan" class="nav-link">
|
||||
<i class="fa fa-graduation-cap nav-icon"></i>
|
||||
<p>Data Omspan</p>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
@if ($role == "admin" || $role == "superadmin")
|
||||
<li class="nav-header">MASTER DATA</li>
|
||||
<li class="nav-item"><a href="{{ $baseUrl }}/admin/users" class="nav-link"><i class="nav-icon fas fa-th-large nav-icon"></i><p>Pengguna</p></a></li>
|
||||
|
||||
+8
-6
@@ -21,7 +21,7 @@ use App\Http\Controllers\Admin\MstJenisBelanjaController;
|
||||
use App\Http\Controllers\Admin\MstSubJenisBelanjaController;
|
||||
use App\Http\Controllers\Admin\MstSatuanController;
|
||||
use App\Http\Controllers\Admin\PengaturanController;
|
||||
use App\Http\Controllers\Admin\UploadDataController;
|
||||
use App\Http\Controllers\DataBosOmspanController;
|
||||
use App\Http\Controllers\NotifikasiController;
|
||||
|
||||
Route::get('/', [AuthController::class, 'showFormLogin']);
|
||||
@@ -74,13 +74,15 @@ Route::group(['middleware' => 'auth'], function () {
|
||||
Route::post('Pengaturan/adjust-anggaran', [PengaturanController::class,'rekonAnggaran']);
|
||||
Route::post('Pengaturan/adjust-akb-pendapatan', [PengaturanController::class,'adjustAKBPendapatan']);
|
||||
|
||||
Route::group(['prefix' => 'upload-data'], function () {
|
||||
Route::get('/', [UploadDataController::class,'index']);
|
||||
Route::post('/', [UploadDataController::class,'index']);
|
||||
Route::post('/datatable', [UploadDataController::class,'uploadDatatable']);
|
||||
Route::get('/proses', [UploadDataController::class,'uploadValidate']);
|
||||
});
|
||||
|
||||
Route::group(['prefix' => 'data-omspan'], function () {
|
||||
Route::get('/', [DataBosOmspanController::class,'index']);
|
||||
Route::get('/upload', [DataBosOmspanController::class,'upload']);
|
||||
Route::post('/upload', [DataBosOmspanController::class,'upload']);
|
||||
Route::post('/upload/datatable', [DataBosOmspanController::class,'uploadDatatable']);
|
||||
Route::post('/datatable', [DataBosOmspanController::class,'datatable']);
|
||||
Route::get('/upload/proses', [DataBosOmspanController::class,'uploadValidate']);
|
||||
});
|
||||
|
||||
Route::get('users/change-password/{userId}', [MstPenggunaController::class,'changePass'])->name("users.changepass");
|
||||
|
||||
Reference in New Issue
Block a user