Fix conflict
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[docker-compose.yml]
|
||||
indent_size = 4
|
||||
@@ -0,0 +1,76 @@
|
||||
APP_NAME=E-SAMASA
|
||||
APP_ENV=local
|
||||
APP_KEY=base64:JWoCrp63f8mipgiOWhwpIG+YVpw1Lunn4RZf0mcBWNg=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
_DB_HOST=localhost
|
||||
_DB_PORT=3306
|
||||
_DB_DATABASE=skpp
|
||||
_DB_USERNAME=root
|
||||
_DB_PASSWORD=root
|
||||
DB_HOST=10.15.34.148
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=e_samasa
|
||||
DB_USERNAME=aplikasi
|
||||
DB_PASSWORD=pusdatin
|
||||
|
||||
ORA_CONNECTION=oracle
|
||||
ORA_HOST=10.15.34.45
|
||||
ORA_PORT=1521
|
||||
ORA_DATABASE=NEWSIPKD
|
||||
ORA_USERNAME=proksi
|
||||
ORA_PASSWORD=123456
|
||||
ORA_SERVICENAME=sipkd.localdomain
|
||||
|
||||
ORA_CONNECTION=oracle2
|
||||
ORA_HOST=10.15.34.159
|
||||
ORA_PORT=1521
|
||||
ORA_DATABASE=BAPEDA_BUDGETING
|
||||
ORA_USERNAME=dev1
|
||||
ORA_PASSWORD=dev123
|
||||
ORA_SERVICENAME=EBUDGETING
|
||||
|
||||
SOA_PEGAWAI=https://soadev.jakarta.go.id/rest/gov/dki/simpeg/ws/skpp
|
||||
SOA_PEGAWAI_USER=sipkddev
|
||||
SOA_PEGAWAI_PASSWORD=sipkddev!!
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
FILESYSTEM_DRIVER=local
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_HOST=mailhog
|
||||
MAIL_PORT=1025
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS=null
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
PUSHER_APP_ID=
|
||||
PUSHER_APP_KEY=
|
||||
PUSHER_APP_SECRET=
|
||||
PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
@@ -0,0 +1,5 @@
|
||||
* text=auto
|
||||
*.css linguist-vendored
|
||||
*.scss linguist-vendored
|
||||
*.js linguist-vendored
|
||||
CHANGELOG.md export-ignore
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/node_modules
|
||||
/public/hot
|
||||
/public/storage
|
||||
/public/uploadFiles
|
||||
/public/downloadFiles
|
||||
/storage/*.key
|
||||
/vendor
|
||||
.env
|
||||
.env.backup
|
||||
.phpunit.result.cache
|
||||
docker-compose.override.yml
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/.idea
|
||||
/.vscode
|
||||
@@ -0,0 +1,3 @@
|
||||
[submodule "public/gentelella"]
|
||||
path = public/gentelella
|
||||
url = https://github.com/ColorlibHQ/gentelella.git
|
||||
@@ -0,0 +1,14 @@
|
||||
php:
|
||||
preset: laravel
|
||||
version: 8
|
||||
disabled:
|
||||
- no_unused_imports
|
||||
finder:
|
||||
not-name:
|
||||
- index.php
|
||||
- server.php
|
||||
js:
|
||||
finder:
|
||||
not-name:
|
||||
- webpack.mix.js
|
||||
css: true
|
||||
@@ -1,92 +1,65 @@
|
||||
# E Samasa
|
||||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
|
||||
## About Laravel
|
||||
|
||||
## Getting started
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
|
||||
## Add your files
|
||||
## Learning Laravel
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin https://gitlab.com/izuddin41086/e-samasa.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
```
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
|
||||
## Integrate with your tools
|
||||
## Laravel Sponsors
|
||||
|
||||
- [ ] [Set up project integrations](https://gitlab.com/izuddin41086/e-samasa/-/settings/integrations)
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
|
||||
|
||||
## Collaborate with your team
|
||||
### Premium Partners
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
|
||||
## Test and Deploy
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
|
||||
***
|
||||
|
||||
# Editing this README
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
|
||||
## Suggestions for a good README
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
- **[Vehikl](https://vehikl.com/)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Cubet Techno Labs](https://cubettech.com)**
|
||||
- **[Cyber-Duck](https://cyber-duck.co.uk)**
|
||||
- **[Many](https://www.many.co.uk)**
|
||||
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
|
||||
- **[DevSquad](https://devsquad.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
|
||||
- **[OP.GG](https://op.gg)**
|
||||
- **[CMS Max](https://www.cmsmax.com/)**
|
||||
- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
## Code of Conduct
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
>>>>>>> 149fecc55468d8a3bdcff628c2c339b19436829b
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
// $schedule->command('inspire')->hourly();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the commands for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function commands()
|
||||
{
|
||||
$this->load(__DIR__.'/Commands');
|
||||
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* A list of the exception types that are not reported.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontReport = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* A list of the inputs that are never flashed for validation exceptions.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontFlash = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register the exception handling callbacks for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->reportable(function (Throwable $e) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\VwSkppHst;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
|
||||
class JadwalSalurExport implements FromQuery, WithMapping, WithHeadings
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
public function __construct($ta)
|
||||
{
|
||||
$this->ta = $ta;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function query()
|
||||
{
|
||||
$sqlStr = 'SELECT kode_rekening,nama_rekening,spsbulan1,spsbulan2,spsbulan3,spsbulan4,
|
||||
spsbulan5,spsbulan6,spsbulan7,spsbulan8,spsbulan9,spsbulan10,spsbulan11,spsbulan12,
|
||||
SUBSTR(KODE_REKENING,1,12) AS kodegrup,SUBSTR(KODE_REKENING,1,9) AS groupall,
|
||||
NVL("1",0) AS "REAL1",NVL("2",0) AS "REAL2",NVL("3",0) AS "REAL3",
|
||||
NVL("4",0) AS "REAL4",NVL("5",0) AS "REAL5",NVL("6",0) AS "REAL6",
|
||||
NVL("7",0) AS "REAL7",NVL("8",0) AS "REAL8",NVL("9",0) AS "REAL9",
|
||||
NVL("10",0) AS "REAL10",NVL("11",0) AS "REAL11",NVL("12",0) AS "REAL12"
|
||||
FROM PROKSI.SPS_PENDAPATAN x
|
||||
LEFT JOIN
|
||||
(
|
||||
SELECT * FROM (
|
||||
SELECT ID_SPS,extract(month from RKUD_TGL) AS BULAN,RKUD_JUMLAH
|
||||
FROM SAMASA.PENDAPATAN_REALISASI
|
||||
WHERE TAHUN=\''.$this->ta.'\'
|
||||
)
|
||||
PIVOT
|
||||
(
|
||||
SUM(RKUD_JUMLAH)
|
||||
FOR BULAN IN(1,2,3,4,5,6,7,8,9,10,11,12)
|
||||
)
|
||||
)y ON x.ID = y.ID_SPS
|
||||
WHERE x.TAHUN = '.$this->ta.' AND x.SKPD_ID=980 AND SUBSTR(x.KODE_REKENING,1,3)=\'4.2\'';
|
||||
|
||||
return $sqlStr;
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'B' => NumberFormat::FORMAT_TEXT,
|
||||
];
|
||||
}
|
||||
|
||||
public function map($skpp_hst): array
|
||||
{
|
||||
return [
|
||||
$skpp_hst->no_skpp,
|
||||
"'".$skpp_hst->nip,
|
||||
$skpp_hst->nrk,
|
||||
$skpp_hst->nama,
|
||||
$skpp_hst->nama_golongan,
|
||||
$skpp_hst->status_pegawai,
|
||||
$skpp_hst->tugas,
|
||||
$skpp_hst->dinas,
|
||||
$skpp_hst->tgl_akhir,
|
||||
$skpp_hst->nama_hak,
|
||||
$skpp_hst->nama_keputusan,
|
||||
$skpp_hst->no_pen,
|
||||
$skpp_hst->tgl_pen,
|
||||
$skpp_hst->tgl_tmt,
|
||||
$skpp_hst->ga_pok,
|
||||
$skpp_hst->t_issum,
|
||||
$skpp_hst->t_anak,
|
||||
$skpp_hst->t_lain,
|
||||
$skpp_hst->t_jab,
|
||||
$skpp_hst->t_beras,
|
||||
$skpp_hst->tpph,
|
||||
$skpp_hst->bulat,
|
||||
$skpp_hst->p_beras,
|
||||
$skpp_hst->iuran,
|
||||
$skpp_hst->ppph,
|
||||
$skpp_hst->lain_2,
|
||||
$skpp_hst->nama_kantor,
|
||||
$skpp_hst->wilayah_kantor,
|
||||
$skpp_hst->tgl_cetak,
|
||||
$skpp_hst->keterangan,
|
||||
$skpp_hst->nama_kantor1,
|
||||
$skpp_hst->nama_kantor2,
|
||||
$skpp_hst->wilayah,
|
||||
$skpp_hst->revisi_remarks,
|
||||
date("Y-m-d",strtotime($skpp_hst->created_at)),
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
"No SKPP",
|
||||
"NIP",
|
||||
"NRK",
|
||||
"Nama",
|
||||
"Golongan",
|
||||
"Status Pegawai",
|
||||
"Tugas",
|
||||
"Dinas",
|
||||
"Tgl akhir",
|
||||
"Hak",
|
||||
"Keputusan",
|
||||
"No Keputusan",
|
||||
"Tgl Keputusan",
|
||||
"Tgl TMT",
|
||||
"Gaji Pokok",
|
||||
"Tunjangan Suami Istri",
|
||||
"Tunjangan Anak",
|
||||
"Tunjangan Lain",
|
||||
"Tunjangan Jabatan",
|
||||
"Tunjangan Beras",
|
||||
"Tunjangan PPH",
|
||||
"Pembulatan",
|
||||
"Potongan Beras",
|
||||
"Iuran",
|
||||
"Potongan PPH",
|
||||
"lain - Lain",
|
||||
"Kantor",
|
||||
"Wilayah",
|
||||
"Tgl Cetak",
|
||||
"Pindah Tugas Kantor 1",
|
||||
"Pindah Tugas Kantor 2",
|
||||
"Pindah Tugas Wilayah",
|
||||
"Keterangan",
|
||||
"revisi_remarks",
|
||||
"Tgl Dibuat",
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\VwSkppHst;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
|
||||
class SkppHstExport implements FromQuery, WithMapping, WithHeadings
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
public function __construct(int $skppId)
|
||||
{
|
||||
$this->skpp_id = $skppId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function query()
|
||||
{
|
||||
return VwSkppHst::query()->where("tx_skpp_id", $this->skpp_id);
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'B' => NumberFormat::FORMAT_TEXT,
|
||||
];
|
||||
}
|
||||
|
||||
public function map($skpp_hst): array
|
||||
{
|
||||
return [
|
||||
$skpp_hst->no_skpp,
|
||||
"'".$skpp_hst->nip,
|
||||
$skpp_hst->nrk,
|
||||
$skpp_hst->nama,
|
||||
$skpp_hst->nama_golongan,
|
||||
$skpp_hst->status_pegawai,
|
||||
$skpp_hst->tugas,
|
||||
$skpp_hst->dinas,
|
||||
$skpp_hst->tgl_akhir,
|
||||
$skpp_hst->nama_hak,
|
||||
$skpp_hst->nama_keputusan,
|
||||
$skpp_hst->no_pen,
|
||||
$skpp_hst->tgl_pen,
|
||||
$skpp_hst->tgl_tmt,
|
||||
$skpp_hst->ga_pok,
|
||||
$skpp_hst->t_issum,
|
||||
$skpp_hst->t_anak,
|
||||
$skpp_hst->t_lain,
|
||||
$skpp_hst->t_jab,
|
||||
$skpp_hst->t_beras,
|
||||
$skpp_hst->tpph,
|
||||
$skpp_hst->bulat,
|
||||
$skpp_hst->p_beras,
|
||||
$skpp_hst->iuran,
|
||||
$skpp_hst->ppph,
|
||||
$skpp_hst->lain_2,
|
||||
$skpp_hst->nama_kantor,
|
||||
$skpp_hst->wilayah_kantor,
|
||||
$skpp_hst->tgl_cetak,
|
||||
$skpp_hst->keterangan,
|
||||
$skpp_hst->nama_kantor1,
|
||||
$skpp_hst->nama_kantor2,
|
||||
$skpp_hst->wilayah,
|
||||
$skpp_hst->revisi_remarks,
|
||||
date("Y-m-d",strtotime($skpp_hst->created_at)),
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
"No SKPP",
|
||||
"NIP",
|
||||
"NRK",
|
||||
"Nama",
|
||||
"Golongan",
|
||||
"Status Pegawai",
|
||||
"Tugas",
|
||||
"Dinas",
|
||||
"Tgl akhir",
|
||||
"Hak",
|
||||
"Keputusan",
|
||||
"No Keputusan",
|
||||
"Tgl Keputusan",
|
||||
"Tgl TMT",
|
||||
"Gaji Pokok",
|
||||
"Tunjangan Suami Istri",
|
||||
"Tunjangan Anak",
|
||||
"Tunjangan Lain",
|
||||
"Tunjangan Jabatan",
|
||||
"Tunjangan Beras",
|
||||
"Tunjangan PPH",
|
||||
"Pembulatan",
|
||||
"Potongan Beras",
|
||||
"Iuran",
|
||||
"Potongan PPH",
|
||||
"lain - Lain",
|
||||
"Kantor",
|
||||
"Wilayah",
|
||||
"Tgl Cetak",
|
||||
"Pindah Tugas Kantor 1",
|
||||
"Pindah Tugas Kantor 2",
|
||||
"Pindah Tugas Wilayah",
|
||||
"Keterangan",
|
||||
"revisi_remarks",
|
||||
"Tgl Dibuat",
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\MappingDbhSkpd;
|
||||
use App\Models\Sps_pendapatan;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MappingDbhSkpdController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Mapping Rekening SKPD";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = null;
|
||||
// $data = User::where('role_name', "<>", "superadmin")->latest()->paginate(10);
|
||||
return view('admin.mapping_dbh_skpd.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mapping_dbh_skpd.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'id_sps' => 'required',
|
||||
'tahun' => 'required',
|
||||
'kode_rekening' => 'required',
|
||||
'txt_id_skpd'=>'required'
|
||||
]);
|
||||
|
||||
$req = $request->all();
|
||||
MappingDbhSkpd::where("id_sps", $req["id_sps"])->delete();
|
||||
foreach($req["txt_id_skpd"] as $row_req)
|
||||
{
|
||||
$data["id_sps"] = $req["id_sps"];
|
||||
$data["tahun"] = $req["tahun"];
|
||||
$data["kode_rekening"] = $req["kode_rekening"];
|
||||
$data["kode_skpd"] = $row_req;
|
||||
|
||||
MappingDbhSkpd::create($data);
|
||||
}
|
||||
|
||||
return redirect("/admin/MappingDbhSkpd")->with('success','Mapping Rekening DBH/DAK ke SKPD berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show($MappingDbhSkpd)
|
||||
{
|
||||
$sps = sps_pendapatan::where("id",$MappingDbhSkpd)->firstorNew();
|
||||
$mappingSKPD = DB::select(DB::raw("SELECT x.*,y.N_OPD FROM SAMASA.MAPPING_DBH_SKPD x
|
||||
LEFT JOIN NEWSIPKD.TROPD y ON x.KODE_SKPD = y.C_OPD WHERE x.id_sps = $MappingDbhSkpd"));
|
||||
// MappingDbhSkpd::where("id_sps",$MappingDbhSkpd)->get();
|
||||
$this->setSubtitle("Detail Data Mapping");
|
||||
return view('admin.mapping_dbh_skpd.show',compact('mappingSKPD','sps'));
|
||||
}
|
||||
|
||||
public function edit(User $user)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mapping_dbh_skpd.edit',compact('user'));
|
||||
}
|
||||
|
||||
public function update(Request $request, User $user)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
'opt_role' => 'required'
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$requestAll["role_name"] = $requestAll["opt_role"];
|
||||
$user->update($requestAll);
|
||||
|
||||
$user->roles()->detach();
|
||||
// $user->removeRole($requestAll["opt_role"]);
|
||||
$user->assignRole($requestAll["opt_role"]);
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','Mapping berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(User $user)
|
||||
{
|
||||
$user->delete();
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','Mapping berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = isset($post["search"]["value"]) ? strtolower($post["search"]["value"]):"";
|
||||
$srcTA = $post["srcTA"];
|
||||
$select = DB::raw("ID,KODE_REKENING, NAMA_REKENING");
|
||||
$sqlstr = Sps_pendapatan::select($select)
|
||||
->whereRaw("TAHUN=$srcTA AND SKPD_ID = 980 AND KODE_REKENING LIKE '4.2%'");
|
||||
$dataTotal = $sqlstr->count();
|
||||
$data = $sqlstr->orderBy("ID");
|
||||
if (!empty($src)){
|
||||
$data->whereRaw(" ( lower(KODE_REKENING) like '%$src%' OR lower(NAMA_REKENING) like '%$src%' ) ");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\MstJenisBelanja;
|
||||
use App\Models\MstSubJenisBelanja;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MstJenisBelanjaController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Master Jenis Belanja";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = null;
|
||||
// $data = User::where('role_name', "<>", "superadmin")->latest()->paginate(10);
|
||||
return view('admin.mst_jenis_belanja.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_jenis_belanja.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'grup' => 'required',
|
||||
//'kode' => 'required',
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
$req = $request->all();
|
||||
MstJenisBelanja::where("name", $req["name"])->where("grup", $req["grup"])->delete();
|
||||
$data["grup"] = $req["grup"];
|
||||
$data["kode"] = $req["kode"];
|
||||
$data["name"] = $req["name"];
|
||||
$data["description"] = $req["description"];
|
||||
MstJenisBelanja::create($data);
|
||||
|
||||
return redirect("/admin/MstJenisBelanja")->with('success','Jenis Belanja berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(MstJenisBelanja $MstJenisBelanja)
|
||||
{
|
||||
$SubJenisBelanja = MstSubJenisBelanja::where("id_jenis_belanja",$MstJenisBelanja->id)->get();
|
||||
$this->setSubtitle("Detail Jenis Belanja");
|
||||
return view('admin.mst_jenis_belanja.show',compact('MstJenisBelanja','SubJenisBelanja'));
|
||||
}
|
||||
|
||||
public function edit(MstJenisBelanja $MstJenisBelanja)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_jenis_belanja.edit',compact('MstJenisBelanja'));
|
||||
}
|
||||
|
||||
public function update(Request $request, MstJenisBelanja $MstJenisBelanja)
|
||||
{
|
||||
$request->validate([
|
||||
'grup' => 'required',
|
||||
//'kode' => 'required',
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
$req = $request->all();
|
||||
$data["grup"] = $req["grup"];
|
||||
$data["kode"] = $req["kode"];
|
||||
$data["name"] = $req["name"];
|
||||
$data["description"] = $req["description"];
|
||||
$MstJenisBelanja->update($req);
|
||||
|
||||
return redirect()->route('MstJenisBelanja.index')
|
||||
->with('success','Data Jenis Belanja berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(MstJenisBelanja $MstJenisBelanja)
|
||||
{
|
||||
MstSubJenisBelanja::where("id_jenis_belanja",$MstJenisBelanja->id)->delete();
|
||||
$MstJenisBelanja->delete();
|
||||
return redirect()->route('MstJenisBelanja.index')
|
||||
->with('success','Data Jenis Belanja berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = isset($post["search"]["value"]) ? strtolower($post["search"]["value"]):"";
|
||||
$select = DB::raw("ID,GRUP,KODE,NAME,DESCRIPTION");
|
||||
$sqlstr = MstJenisBelanja::select($select);
|
||||
$dataTotal = $sqlstr->count();
|
||||
$data = $sqlstr->orderBy("ID");
|
||||
if (!empty($src)){
|
||||
$data->whereRaw(" ( lower(NAME) like '%$src%' OR lower(DESCRIPTION) like '%$src%' ) ");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\MstJenisDana;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MstJenisDanaController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Master Jenis Dana";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = null;
|
||||
// $data = User::where('role_name', "<>", "superadmin")->latest()->paginate(10);
|
||||
return view('admin.mst_jenis_dana.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_jenis_dana.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
'grup' => 'required',
|
||||
]);
|
||||
|
||||
$req = $request->all();
|
||||
MstJenisDana::where("name", $req["name"])->delete();
|
||||
$data["name"] = $req["name"];
|
||||
$data["grup"] = $req["grup"];
|
||||
MstJenisDana::create($data);
|
||||
|
||||
return redirect("/admin/MstJenisDana")->with('success','Jenis Belanja berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(MstJenisDana $MstJenisDana)
|
||||
{
|
||||
$SubJenisBelanja = MstSubJenisBelanja::where("id_jenis_belanja",$MstJenisDana->id)->get();
|
||||
$this->setSubtitle("Detail Jenis Belanja");
|
||||
return view('admin.mst_jenis_dana.show',compact('MstJenisDana','SubJenisBelanja'));
|
||||
}
|
||||
|
||||
public function edit(MstJenisDana $MstJenisDana)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_jenis_dana.edit',compact('MstJenisDana'));
|
||||
}
|
||||
|
||||
public function update(Request $request, MstJenisDana $MstJenisDana)
|
||||
{
|
||||
$request->validate([
|
||||
'grup' => 'required',
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
$req = $request->all();
|
||||
$data["grup"] = $req["grup"];
|
||||
$data["name"] = $req["name"];
|
||||
$MstJenisDana->update($req);
|
||||
|
||||
return redirect()->route('MstJenisDana.index')
|
||||
->with('success','Data Jenis Dana berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(MstJenisDana $MstJenisDana)
|
||||
{
|
||||
$MstJenisDana->delete();
|
||||
return redirect()->route('MstJenisDana.index')
|
||||
->with('success','Data Jenis Dana berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = isset($post["search"]["value"]) ? strtolower($post["search"]["value"]):"";
|
||||
$select = DB::raw("ID,NAME,GRUP");
|
||||
$sqlstr = MstJenisDana::select($select);
|
||||
$dataTotal = $sqlstr->count();
|
||||
$data = $sqlstr->orderBy("GRUP","DESC");
|
||||
if (!empty($src)){
|
||||
$data->whereRaw(" ( lower(NAME) like '%$src%' ) ");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Role;
|
||||
use App\Models\Roless;
|
||||
use App\Models\RoleUser;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Str;
|
||||
use Hash;
|
||||
|
||||
class MstPenggunaController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Pengguna";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = null;
|
||||
// $data = User::where('role_name', "<>", "superadmin")->latest()->paginate(10);
|
||||
return view('admin.mst_pengguna.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_pengguna.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
'nrk' => 'required',
|
||||
'password' => 'required',
|
||||
'opt_role' => 'required'
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$requestAll["password"] = \Hash::make($requestAll["password"]);
|
||||
$requestAll["role_name"] = $requestAll["opt_role"];
|
||||
$user=User::create($requestAll);
|
||||
|
||||
$user->roles()->detach();
|
||||
//$user->removeRole($requestAll["opt_role"]);
|
||||
$user->assignRole($requestAll["opt_role"]);
|
||||
app()->make(\Spatie\Permission\PermissionRegistrar::class)->forgetCachedPermissions();
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','User berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(User $user)
|
||||
{
|
||||
$user = User::with("roleUser.role")->where("id",$user->id)->first();
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('admin.mst_pengguna.show',compact('user'));
|
||||
}
|
||||
|
||||
public function edit(User $user)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_pengguna.edit',compact('user'));
|
||||
}
|
||||
|
||||
public function update(Request $request, User $user)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
'opt_role' => 'required'
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$requestAll["role_name"] = $requestAll["opt_role"];
|
||||
$user->update($requestAll);
|
||||
|
||||
$user->roles()->detach();
|
||||
// $user->removeRole($requestAll["opt_role"]);
|
||||
$user->assignRole($requestAll["opt_role"]);
|
||||
app()->make(\Spatie\Permission\PermissionRegistrar::class)->forgetCachedPermissions();
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','User berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(User $user)
|
||||
{
|
||||
$user->delete();
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','User berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function roleList()
|
||||
{
|
||||
$mstRole = Roless::where("name","<>","superadmin")->select(["name","name"])->get();
|
||||
return response()->json($mstRole);
|
||||
}
|
||||
|
||||
public function changePass()
|
||||
{
|
||||
return view('admin.mst_pengguna.change_password');
|
||||
}
|
||||
|
||||
public function changePassSubmit(Request $request, $userId)
|
||||
{
|
||||
$request->validate([
|
||||
'old_password' => 'required',
|
||||
'new_password' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$cekUser = User::find($userId);
|
||||
if (\Hash::check($requestAll["old_password"], $cekUser->password)){
|
||||
User::where("id",$userId)->update(["password"=>\Hash::make($requestAll["new_password"])]);
|
||||
|
||||
return redirect()->route('home')
|
||||
->with('success','Kata sandi pengguna berhasil diubah!');
|
||||
}else{
|
||||
return redirect()->route('home')
|
||||
->with('error','Kata sandi gagal diubah!, Kata sandi lama salah!');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = isset($post["search"]["value"]) ? strtolower($post["search"]["value"]):"";
|
||||
$sqlstr = User::where('role_name', "<>", "superadmin");
|
||||
$dataTotal = $sqlstr->count();
|
||||
$data = $sqlstr->orderBy("role_name");
|
||||
if (!empty($src)){
|
||||
$data->whereRaw(" ( lower(name) like '%$src%' OR lower(nrk) like '%$src%' ) ");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
public function lockUploadData($userId="", $reset=0, Request $req)
|
||||
{
|
||||
$updateValue = [
|
||||
"is_lock_upload"=>$reset == 0 ? 1:0,
|
||||
"lock_upload_time"=>date("Y-m-d H:i"),
|
||||
"lock_upload_by"=>Auth::user()->id
|
||||
];
|
||||
|
||||
if (empty($userId))
|
||||
{
|
||||
User::query()->update($updateValue);
|
||||
}else{
|
||||
User::where(["id"=>$userId])->update($updateValue);
|
||||
}
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','Lock upload data sudah diubah!');
|
||||
}
|
||||
|
||||
public function resetPass(User $user)
|
||||
{
|
||||
$random = Str::random(8);
|
||||
$updateValue = [
|
||||
"f_locked" => null,
|
||||
// "recovery_password" => $random,
|
||||
"password" => Hash::make($user->nrk),
|
||||
"password_changed" => null,
|
||||
"first_login" => date("Y-m-d H:i")
|
||||
];
|
||||
|
||||
$user->update($updateValue);
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','Kata sandi sudah direset!');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\UnitSatuan as MstSatuan;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MstSatuanController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Master Satuan";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = null;
|
||||
// $data = User::where('role_name', "<>", "superadmin")->latest()->paginate(10);
|
||||
return view('admin.mst_satuan.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_satuan.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
$req = $request->all();
|
||||
MstSatuan::where("nama_satuan", $req["name"])->delete();
|
||||
$data["nama_satuan"] = $req["name"];
|
||||
MstSatuan::create($data);
|
||||
|
||||
return redirect("/admin/MstSatuan")->with('success','Data Satuan berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(MstSatuan $MstSatuan)
|
||||
{
|
||||
$SubSatuanBelanja = MstSubSatuanBelanja::where("id_Satuan_belanja",$MstSatuan->id)->get();
|
||||
$this->setSubtitle("Detail Satuan");
|
||||
return view('admin.mst_satuan.show',compact('MstSatuan','SubSatuanBelanja'));
|
||||
}
|
||||
|
||||
public function edit(MstSatuan $MstSatuan)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_satuan.edit',compact('MstSatuan'));
|
||||
}
|
||||
|
||||
public function update(Request $request, MstSatuan $MstSatuan)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
$req = $request->all();
|
||||
$data["nama_satuan"] = $req["name"];
|
||||
$MstSatuan->update($req);
|
||||
|
||||
return redirect()->route('MstSatuan.index')
|
||||
->with('success','Data Satuan berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(MstSatuan $MstSatuan)
|
||||
{
|
||||
$MstSatuan->delete();
|
||||
return redirect()->route('MstSatuan.index')
|
||||
->with('success','Data Satuan berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = isset($post["search"]["value"]) ? strtolower($post["search"]["value"]):"";
|
||||
$sqlstr = MstSatuan::select();
|
||||
$dataTotal = $sqlstr->count();
|
||||
$data = $sqlstr->orderBy("nama_satuan","ASC");
|
||||
if (!empty($src)){
|
||||
$data->whereRaw(" ( lower(nama_satuan) like '%$src%' ) ");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\MstJenisBelanja;
|
||||
use App\Models\MstSubJenisBelanja;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MstSubJenisBelanjaController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Master Jenis Belanja";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = null;
|
||||
return view('admin.mst_sub_jenis_belanja.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create(MstJenisBelanja $MstJenisBelanja)
|
||||
{
|
||||
$this->setSubtitle("Tambah Data Sub Jenis Belanja [<strong>".$MstJenisBelanja->name."</strong>] ");
|
||||
return view('admin.mst_sub_jenis_belanja.create',compact("MstJenisBelanja"));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'kode' => 'required',
|
||||
'name' => 'required',
|
||||
'id_jenis_belanja' => 'required'
|
||||
]);
|
||||
|
||||
$req = $request->all();
|
||||
MstSubJenisBelanja::where("name", $req["name"])->where("id_jenis_belanja", $req["id_jenis_belanja"])->delete();
|
||||
$data["id_jenis_belanja"] = $req["id_jenis_belanja"];
|
||||
$data["kode"] = $req["kode"];
|
||||
$data["name"] = $req["name"];
|
||||
$data["description"] = $req["description"];
|
||||
MstSubJenisBelanja::create($data);
|
||||
|
||||
return redirect("/admin/MstJenisBelanja/".$data["id_jenis_belanja"])->with('success','Sub Jenis Belanja berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(MstSubJenisBelanja $MstSubJenisBelanja)
|
||||
{
|
||||
}
|
||||
|
||||
public function edit(MstSubJenisBelanja $MstSubJenisBelanja)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_sub_jenis_belanja.edit',compact('MstSubJenisBelanja'));
|
||||
}
|
||||
|
||||
public function update(Request $request, MstSubJenisBelanja $MstSubJenisBelanja)
|
||||
{
|
||||
$request->validate([
|
||||
'kode' => 'required',
|
||||
'name' => 'required',
|
||||
'id_jenis_belanja' => 'required'
|
||||
]);
|
||||
$req = $request->all();
|
||||
// var_dump($req); exit;
|
||||
$data["id_jenis_belanja"] = $req["id_jenis_belanja"];
|
||||
$data["kode"] = $req["kode"];
|
||||
$data["name"] = $req["name"];
|
||||
$data["description"] = $req["description"];
|
||||
$MstSubJenisBelanja->update($req);
|
||||
|
||||
return redirect("/admin/MstJenisBelanja/".$MstSubJenisBelanja->id_jenis_belanja)->with('success','Sub Jenis Belanja berhasil diubah');
|
||||
}
|
||||
|
||||
public function destroy(MstSubJenisBelanja $MstSubJenisBelanja)
|
||||
{
|
||||
$MstSubJenisBelanja->delete();
|
||||
return redirect("/admin/MstJenisBelanja/".$MstSubJenisBelanja->id_jenis_belanja)->with('success','Sub Jenis Belanja berhasil dihapus');
|
||||
}
|
||||
|
||||
public function datatable(Request $request, $id)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = isset($post["search"]["value"]) ? strtolower($post["search"]["value"]):"";
|
||||
$select = DB::raw("ID,KODE,NAME,DESCRIPTION");
|
||||
$sqlstr = MstSubJenisBelanja::select($select)->where("id_jenis_belanja", $id);
|
||||
$dataTotal = $sqlstr->count();
|
||||
$data = $sqlstr->orderBy("ID");
|
||||
if (!empty($src)){
|
||||
$data->whereRaw(" ( lower(NAME) like '%$src%' OR lower(DESCRIPTION) like '%$src%' ) ");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Session;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class PengaturanController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Pengaturan";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->setIconTitle("fa fa-cog");
|
||||
return view('admin.pengaturan.index');
|
||||
}
|
||||
|
||||
public function rekonAnggaran()
|
||||
{
|
||||
try{
|
||||
DB::beginTransaction();
|
||||
|
||||
DB::raw(
|
||||
"UPDATE BELANJA_REALISASI t1
|
||||
SET t1.JUMLAH_ANGGARAN = (
|
||||
SELECT V_ANGG_TAPD FROM VW_DPA_RSK t2
|
||||
WHERE t1.KODE_RSK = t2.I_ID
|
||||
) WHERE t1.TAHUN_ANGGARAN = ".getTA()
|
||||
);
|
||||
DB::raw("UPDATE BELANJA_REALISASI SET ALOKASI_ANGGARAN = JUMLAH_ANGGARAN WHERE JENIS_DANA IN ('DBH','DAK')");
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json([
|
||||
"success" => true,
|
||||
"message" => "Data anggaran berhasil disesuaikan!"
|
||||
]);
|
||||
|
||||
}catch(Throwable $e){
|
||||
|
||||
DB::rollBack();
|
||||
return response()->json([
|
||||
"success" => false,
|
||||
"message" => "Data anggaran gagal disesuaikan!"
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Permission;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PermissionsController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Permissions";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = Permission::latest()->orderby("name")->paginate(10);
|
||||
|
||||
return view('admin.mst_permission.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_permission.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required'
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$requestAll['guard_name'] = 'web';
|
||||
Permission::create($requestAll);
|
||||
|
||||
return redirect()->route('permissions.index')
|
||||
->with('success','Permission berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(Permission $permission)
|
||||
{
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('admin.mst_permission.show',compact('permission'));
|
||||
}
|
||||
|
||||
public function edit(Permission $permission)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_permission.edit',compact('permission'));
|
||||
}
|
||||
|
||||
public function update(Request $request, Permission $permission)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$permission->update($requestAll);
|
||||
|
||||
return redirect()->route('permissions.index')
|
||||
->with('success','Permission berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(Permission $permission)
|
||||
{
|
||||
$permission->delete();
|
||||
return redirect()->route('permissions.index')
|
||||
->with('success','Permission berhasil dihapus!');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Roless;
|
||||
use App\Models\RolePermission;
|
||||
use App\Models\Permission;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class RolessController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Roles";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = Roless::where("name","<>","superadmin")->latest()->paginate(10);
|
||||
|
||||
return view('admin.mst_role.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_role.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required'
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$requestAll['guard_name'] = 'web';
|
||||
Roless::create($requestAll);
|
||||
|
||||
return redirect()->route('roless.index')
|
||||
->with('success','Role berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(Roless $roless)
|
||||
{
|
||||
$this->setSubtitle("Detail Data");
|
||||
$permissions = Permission::get();
|
||||
$rolePermissions = RolePermission::where("role_id",$roless->id)->orderBy("permission_id")->get()->toArray();
|
||||
$rolePermissions = array_column($rolePermissions, 'permission_id');
|
||||
return view('admin.mst_role.show',compact('roless','permissions','rolePermissions'));
|
||||
}
|
||||
|
||||
public function edit(Roless $roless)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_role.edit',compact('roless'));
|
||||
}
|
||||
|
||||
public function update(Request $request, Roless $roless)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$roless->update($requestAll);
|
||||
|
||||
return redirect()->route('roless.index')
|
||||
->with('success','Role berhasil diubah!');
|
||||
}
|
||||
|
||||
public function permissions($roleId, Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'role_permission' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
RolePermission::where("role_id", $roleId)->delete();
|
||||
$role_permission = $requestAll["role_permission"];
|
||||
// var_dump($roleId);exit;
|
||||
foreach($role_permission as $row_permission){
|
||||
RolePermission::create([
|
||||
"permission_id"=>$row_permission,
|
||||
"role_id"=>$roleId
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()->route('roless.index')
|
||||
->with('success','Role berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(Roless $roless)
|
||||
{
|
||||
$roless->delete();
|
||||
return redirect()->route('roless.index')
|
||||
->with('success','Role berhasil dihapus!');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Validator;
|
||||
use Hash;
|
||||
use Session;
|
||||
use App\Models\User;
|
||||
use App\Models\RoleUser;
|
||||
|
||||
class AuthController extends Controller
|
||||
{
|
||||
public function showFormLogin()
|
||||
{
|
||||
if (Auth::check()) {
|
||||
// True sekalian session field di users nanti bisa dipanggil via Auth
|
||||
// Login Success
|
||||
return redirect()->route('home');
|
||||
}
|
||||
return view('login');
|
||||
}
|
||||
|
||||
public function login(Request $request)
|
||||
{
|
||||
$rules = [
|
||||
'nrk' => 'required|string',
|
||||
'password' => 'required|string'
|
||||
];
|
||||
|
||||
$messages = [
|
||||
'nrk.required' => 'NRK wajib diisi',
|
||||
'nrk.string' => 'NRK tidak valid',
|
||||
'password.required' => 'Password wajib diisi',
|
||||
'password.string' => 'Password harus berupa string'
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if($validator->fails()){
|
||||
return redirect()->back()->withErrors($validator)->withInput($request->all);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'nrk' => $request->input('nrk'),
|
||||
'password' => $request->input('password'),
|
||||
];
|
||||
|
||||
Auth::attempt($data);
|
||||
|
||||
if (Auth::check()) {
|
||||
// True sekalian session field di users nanti bisa dipanggil via Auth
|
||||
// Login Success
|
||||
$taValue = [];
|
||||
for($i=2022;$i<=date("Y");$i++){
|
||||
$taValue[] = $i;
|
||||
}
|
||||
Session::put('listTA', $taValue);
|
||||
return redirect()->route('home');
|
||||
|
||||
} else {
|
||||
// False
|
||||
// Login Fail
|
||||
Session::flash('error', 'NRK atau password salah');
|
||||
return redirect()->route('login');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function showFormRegister()
|
||||
{
|
||||
return view('register');
|
||||
}
|
||||
|
||||
public function register(Request $request)
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|min:3|max:35',
|
||||
'nrk' => 'required|min:5|unique:users,nrk',
|
||||
'password' => 'required|confirmed'
|
||||
];
|
||||
|
||||
$messages = [
|
||||
'name.required' => 'Nama Lengkap wajib diisi',
|
||||
'name.min' => 'Nama lengkap minimal 3 karakter',
|
||||
'name.max' => 'Nama lengkap maksimal 35 karakter',
|
||||
'nrk.required' => 'NRK wajib diisi',
|
||||
'nrk.min' => 'NRK tidak valid',
|
||||
'nrk.unique' => 'NRK sudah terdaftar',
|
||||
'password.required' => 'Password wajib diisi',
|
||||
'password.confirmed' => 'Password tidak sama dengan konfirmasi password'
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if($validator->fails()){
|
||||
return redirect()->back()->withErrors($validator)->withInput($request->all);
|
||||
}
|
||||
|
||||
$user = new User;
|
||||
$user->name = ucwords(strtolower($request->name));
|
||||
$user->nrk = strtolower($request->nrk);
|
||||
$user->password = Hash::make($request->password);
|
||||
// $user->email_verified_at = \Carbon\Carbon::now();
|
||||
$simpan = $user->save();
|
||||
|
||||
$roleUser = new RoleUser;
|
||||
$roleUser->role_id = 3;
|
||||
$roleUser->user_id = $user->id;
|
||||
$roleUser->save();
|
||||
|
||||
if($simpan){
|
||||
Session::flash('success', 'Register berhasil! Silahkan login untuk mengakses data');
|
||||
return redirect()->route('login');
|
||||
} else {
|
||||
Session::flash('errors', ['' => 'Register gagal! Silahkan ulangi beberapa saat lagi']);
|
||||
return redirect()->route('register');
|
||||
}
|
||||
}
|
||||
|
||||
public function logout()
|
||||
{
|
||||
Auth::logout(); // menghapus session yang aktif
|
||||
return redirect()->route('login');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use View;
|
||||
use App\Models\Notifikasi;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
public $siteTitle = "Beranda";
|
||||
public $sitesubTitle = "Data";
|
||||
public $siteBreadcumb =[["url"=>"/","label"=>"Beranda"]];
|
||||
public $IconTitle = "fa fa-table";
|
||||
|
||||
public function __construct() {
|
||||
View::share ( 'siteTitle' , $this->siteTitle );
|
||||
View::share ( 'sitesubTitle' , $this->sitesubTitle );
|
||||
View::share ( 'siteBreadcumb' , $this->siteBreadcumb );
|
||||
View::share ( 'iconTitle' , $this->IconTitle );
|
||||
View::share ( 'baseUrl', URL::to("/") );
|
||||
}
|
||||
|
||||
public function setTitle($name){
|
||||
View::share ( 'siteTitle' , $name );
|
||||
}
|
||||
|
||||
public function setIconTitle($icon){
|
||||
View::share ( 'iconTitle' , $icon );
|
||||
}
|
||||
|
||||
public function setSubtitle($name){
|
||||
View::share ( 'sitesubTitle' , $name );
|
||||
}
|
||||
|
||||
public function sendNotif($roleFrom, $roleTo, $userId=[], $message, $url, $jenis, $unik)
|
||||
{
|
||||
foreach($userId as $rowUserId){
|
||||
$notif = new Notifikasi;
|
||||
$notif["role_from"]=$roleFrom;
|
||||
$notif["role_to"]=$roleTo;
|
||||
$notif["userid"]=$rowUserId;
|
||||
$notif["message"]=$message;
|
||||
$notif["url"]=$url;
|
||||
$notif["is_read"]=0;
|
||||
$notif["jenis"]=$jenis;
|
||||
$notif["id_unik"]=$unik;
|
||||
$notif->save();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function readNotif($idUnik)
|
||||
{
|
||||
Notifikasi::query()->where(["id_unik"=>$idUnik, "userid"=>Auth::user()->id])->update(["is_read"=>1]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Session;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$this->setIconTitle("fa fa-home");
|
||||
return view('home');
|
||||
}
|
||||
|
||||
public function ta($ta)
|
||||
{
|
||||
Session::put('Tahun_Anggaran', $ta);
|
||||
return redirect()->route('home');
|
||||
}
|
||||
|
||||
public function uploadThis(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'file' => 'required',
|
||||
]);
|
||||
|
||||
$file = $request->file('file');
|
||||
$fileContent = $file->get();
|
||||
// echo 'File Name: '.$file->getClientOriginalName();
|
||||
// echo 'File Extension: '.$file->getClientOriginalExtension();
|
||||
// echo 'File Real Path: '.$file->getRealPath();
|
||||
// echo 'File Size: '.$file->getSize();
|
||||
// echo 'File Mime Type: '.$file->getMimeType();
|
||||
|
||||
// Encrypt File
|
||||
$encryptedContent = encrypt($fileContent);
|
||||
\Storage::put('file.dat', $encryptedContent);
|
||||
}
|
||||
|
||||
public function downloadThis(Request $request)
|
||||
{
|
||||
// Decrypt File
|
||||
$encryptedContent = \Storage::get('file.dat');
|
||||
$decryptedContent = decrypt($encryptedContent);
|
||||
|
||||
return response()->streamDownload(function() use ($decryptedContent) {
|
||||
echo $decryptedContent;
|
||||
}, 'file.jpg');
|
||||
}
|
||||
|
||||
public function downloadManual()
|
||||
{
|
||||
$file = "manual_aplikasi_sidata.pdf";
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'attachment;filename='.$file
|
||||
];
|
||||
return response()->download($file , $file, $headers);
|
||||
}
|
||||
|
||||
public function rekonAnggaran()
|
||||
{
|
||||
// UPDATE BELANJA_REALISASI t1
|
||||
// SET t1.JUMLAH_ANGGARAN = (
|
||||
// SELECT V_ANGG_TAPD FROM VW_DPA_RSK t2
|
||||
// WHERE t1.KODE_RSK = t2.I_ID
|
||||
// )
|
||||
// WHERE t1.TAHUN_ANGGARAN = 2022
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Tropd;
|
||||
use App\Models\Trbas;
|
||||
use App\Models\Program;
|
||||
use App\Models\Kegiatan;
|
||||
use App\Models\SubKegiatan;
|
||||
use App\Models\Rsk;
|
||||
use App\Models\Sps_pendapatan;
|
||||
use App\Models\Siesetpembayaran;
|
||||
use App\Models\Sp2d;
|
||||
use App\Models\BelanjaRealisasi;
|
||||
use App\Models\MstJenisDana;
|
||||
use App\Models\MstJenisBelanja;
|
||||
use App\Models\MstSubJenisBelanja;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ItemSearchController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function skpd(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
$ta = $request->ta;
|
||||
$search = strtoupper($request->q);
|
||||
if($request->has('realisasi-belanja')){
|
||||
$sqlStr = "SELECT DISTINCT x.KODE_SKPD AS ID,x.KODE_SKPD||' | '||x.NAMA_SKPD as name
|
||||
FROM SAMASA.BELANJA_REALISASI x
|
||||
LEFT JOIN NEWSIPKD.TROPD y ON x.KODE_SKPD = y.C_OPD
|
||||
WHERE TAHUN_ANGGARAN = $ta ";
|
||||
|
||||
if (getRole()=="sbpk"){
|
||||
$sqlStr.= " AND y.C_WIL_SP2DPROSES=".Auth::user()->wilayah;
|
||||
}
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtolower($request->q);
|
||||
$sqlStr.= " AND ( LOWER(x.NAMA_SKPD) LIKE '%$search%' OR x.KODE_SKPD LIKE '%$search%' )";
|
||||
}
|
||||
|
||||
$tropd = DB::select(DB::raw($sqlStr." ORDER BY x.KODE_SKPD "));
|
||||
}else{
|
||||
$select = DB::raw("C_OPD AS ID,C_OPD||' | '||N_OPD as name");
|
||||
$tropd = Tropd::select($select);
|
||||
if($request->has('q')){
|
||||
$search = strtolower($request->q);
|
||||
$tropd->whereRaw("LOWER(N_OPD) LIKE '%$search%'");
|
||||
}
|
||||
$tropd->orderBy("C_OPD");
|
||||
$tropd = $tropd->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
|
||||
public function prog(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$select = DB::raw("C_PROGRAM AS ID,C_PROGRAM||' | '||N_PROGRAM as name");
|
||||
$tropd = Program::select($select)
|
||||
->where('N_PROGRAM', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
|
||||
public function keg(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$select = DB::raw("C_GIAT AS ID,C_GIAT||' | '||N_GIAT as name");
|
||||
$tropd = Kegiatan::select($select)
|
||||
->where('N_GIAT', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
|
||||
public function sk(Request $request)
|
||||
{
|
||||
$sk = [];
|
||||
|
||||
if($request->has('q')){
|
||||
if($request->has('realisasi-belanja')){
|
||||
$search = $request->q;
|
||||
$select = DB::raw("DISTINCT KODE_SUB_KEGIATAN AS ID,KODE_SUB_KEGIATAN||' | '||NAMA_SUB_KEGIATAN as name");
|
||||
$ta = $request->ta;
|
||||
$sk = BelanjaRealisasi::select($select)
|
||||
->where("TAHUN_ANGGARAN", $ta)
|
||||
->where('NAMA_SUB_KEGIATAN', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}else{
|
||||
$search = strtoupper($request->q);
|
||||
$select = DB::raw("C_SUBGIAT AS ID,C_SUBGIAT||' | '||N_SUBGIAT as name");
|
||||
$sk = SubKegiatan::select($select)
|
||||
->where('N_SUBGIAT', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
}
|
||||
return response()->json($sk);
|
||||
}
|
||||
|
||||
public function rsk(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$select = DB::raw("I_ID AS ID,I_ID||' | '||N_RSK as name");
|
||||
$tropd = Rsk::select($select)
|
||||
->where('N_RSK', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
|
||||
public function sps(Request $request)
|
||||
{
|
||||
$sps = [];
|
||||
$search = strtolower($request->q);
|
||||
$ta = $request->ta;
|
||||
$jenis = $request->jenis;
|
||||
|
||||
if (getRole()=="skpd"){
|
||||
$sps = DB::select(DB::raw("SELECT x.ID_SPS as ID,x.KODE_REKENING||' | '||z.NAMA_REKENING as name
|
||||
FROM SAMASA.MAPPING_DBH_SKPD x
|
||||
LEFT JOIN PROKSI.SPS_PENDAPATAN z ON x.ID_SPS = z.ID
|
||||
WHERE x.tahun = $ta AND x.kode_skpd='".Auth::user()->nrk."'"));
|
||||
}else{
|
||||
$select = DB::raw("ID,KODE_REKENING||' | '||NAMA_REKENING as name");
|
||||
$sps = Sps_pendapatan::select($select)->whereRaw("TAHUN=$ta AND SKPD_ID = 980");
|
||||
|
||||
if (!empty($search)){
|
||||
$sps->whereRaw(" (LOWER(KODE_REKENING) LIKE '%$search%' OR LOWER(NAMA_REKENING) LIKE '%$search%') ");
|
||||
}
|
||||
|
||||
if ($jenis == "dbh"){
|
||||
$sps->whereRaw(" (SUBSTR(KODE_REKENING,1,12)='4.2.01.01.01') ");
|
||||
}else if($jenis == "dak"){
|
||||
$sps->whereRaw(" (SUBSTR(KODE_REKENING,1,12)='4.2.01.01.03' OR SUBSTR(KODE_REKENING,1,12)='4.2.01.01.04') ");
|
||||
}else{
|
||||
$sps->whereRaw(" (SUBSTR(KODE_REKENING,1,3)='4.2') ");
|
||||
}
|
||||
|
||||
$sps->orderby("KODE_REKENING");
|
||||
$sps = $sps->get();
|
||||
}
|
||||
|
||||
return response()->json($sps);
|
||||
}
|
||||
|
||||
public function sts(Request $request)
|
||||
{
|
||||
$no_skprd = $request->no_skprd;
|
||||
$select = DB::raw("NO_SKPRD,TGL_VALIDASI,KODE_BAS,NILAI_BAYAR,TRBAS.N_AKUN");
|
||||
$sts = Siesetpembayaran::select($select)
|
||||
->join("NEWSIPKD.TRBAS","SI_ESET_PEMBAYARAN.KODE_BAS","=","TRBAS.C_AKUN")
|
||||
->where("NO_SKPRD", $no_skprd)
|
||||
->first();
|
||||
if ($sts){
|
||||
$sts["tgl_validasi"] = date("Y-m-d",strtotime($sts["tgl_validasi"]));
|
||||
$sts["nilai_bayar"] = separateNumberIndo($sts["nilai_bayar"]);
|
||||
}
|
||||
return response()->json($sts);
|
||||
}
|
||||
|
||||
public function sp2d(Request $request)
|
||||
{
|
||||
$no_sp2d = $request->no_sp2d;
|
||||
$sp2d = Sp2d::where(["I_SP2DNO_DOK"=>$no_sp2d,"C_SP2D_SAH"=>1])->first();
|
||||
return response()->json($sp2d);
|
||||
}
|
||||
|
||||
public function jenisBelanja(Request $request)
|
||||
{
|
||||
$sk = [];
|
||||
$select = DB::raw("ID, NAME");
|
||||
$grup = $request->grup;
|
||||
if($request->has('q')){
|
||||
$search = $request->q;
|
||||
$sk = MstJenisBelanja::select($select)
|
||||
->where('GRUP',$grup)
|
||||
->where('NAME', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}else{
|
||||
$sk = MstJenisBelanja::select($select)->where('GRUP',$grup)->get();
|
||||
}
|
||||
return response()->json($sk);
|
||||
}
|
||||
|
||||
public function subjenisDana(Request $request)
|
||||
{
|
||||
$sk = [];
|
||||
$select = DB::raw("ID, NAME");
|
||||
$idGrup = $request->id_grup;
|
||||
if($request->has('q')){
|
||||
$search = $request->q;
|
||||
$sk = MstJenisDana::select($select)
|
||||
->where("GRUP",$idGrup)
|
||||
->where('NAME', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}else{
|
||||
$sk = MstJenisDana::select($select)
|
||||
->where("GRUP",$idGrup)
|
||||
->get();
|
||||
}
|
||||
return response()->json($sk);
|
||||
}
|
||||
|
||||
public function subjenisBelanja(Request $request)
|
||||
{
|
||||
$sk = [];
|
||||
$select = DB::raw("ID, NAME");
|
||||
$idJenis = $request->id_jenis;
|
||||
if($request->has('q')){
|
||||
$search = $request->q;
|
||||
$sk = MstSubJenisBelanja::select($select)
|
||||
->where("id_jenis_belanja",$idJenis)
|
||||
->where('NAME', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}else{
|
||||
$sk = MstSubJenisBelanja::select($select)
|
||||
->where("id_jenis_belanja",$idJenis)
|
||||
->get();
|
||||
}
|
||||
return response()->json($sk);
|
||||
}
|
||||
|
||||
public function rek_dana(Request $request)
|
||||
{
|
||||
$search = strtolower($request->q);
|
||||
$ta = $request->ta;
|
||||
|
||||
$select = DB::raw("C_AKUN AS IDX,C_AKUN||' | '||N_AKUN as NAME");
|
||||
$trbas = Trbas::select($select)->whereRaw("C_TAHUN_BERAKHIR>=$ta AND (C_AKUN LIKE '4.2.01.01%' OR C_AKUN LIKE '4.2.01.02%') AND LENGTH(C_AKUN)>=17");
|
||||
|
||||
if (!empty($search)){
|
||||
$trbas->whereRaw(" (LOWER(C_AKUN) LIKE '%$search%' OR LOWER(N_AKUN) LIKE '%$search%') ");
|
||||
}
|
||||
|
||||
$trbas->orderby("C_AKUN");
|
||||
$trbas = $trbas->get();
|
||||
|
||||
return response()->json($trbas);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
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\Sps_pendapatan;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
|
||||
class JadwalSalurdanaController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->setTitle("Jadwal Salur Dana");
|
||||
$this->setIconTitle("fa fa-calendar-alt");
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('jadwal_salurdana.index');
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = isset($post["src"]) ? $post["src"]:"";
|
||||
$ta = $post["ta"];
|
||||
$dataFilter = 0;
|
||||
$typeDana = isset($post["type_dana"])?$post["type_dana"]:"";
|
||||
$idSPS = isset($post["id_sps"])?$post["id_sps"]:"";
|
||||
$sqlstr = Sps_pendapatan::queryJadwalSalurDana($ta);
|
||||
|
||||
if (!empty($idSPS)){
|
||||
$sqlstr.=" AND x.ID=$idSPS";
|
||||
}
|
||||
|
||||
$dataTotal = count(DB::select(DB::raw($sqlstr)));
|
||||
|
||||
if (!empty($typeDana)){
|
||||
if ($typeDana == "cht"){
|
||||
$sqlstr.=" AND x.kode_rekening='4.2.01.01.01.0004'";
|
||||
}else{
|
||||
$sqlstr.=" AND SUBSTR(x.kode_rekening,1,12) IN ('4.2.01.01.03','4.2.01.01.04')";
|
||||
}
|
||||
}
|
||||
$data = DB::select(DB::raw($sqlstr.'ORDER BY x.kode_rekening OFFSET '.$offset.' ROWS FETCH NEXT '.$limit.' ROWS ONLY'));
|
||||
$dataFilter = count(DB::select(DB::raw($sqlstr)));
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data
|
||||
]);
|
||||
}
|
||||
|
||||
public function index_cht_dak(Request $request, $typeDana)
|
||||
{
|
||||
$judul = strtoupper($typeDana);
|
||||
$this->setTitle("Jadwal Salur Dana $judul");
|
||||
$filter = $typeDana == "cht" ? " AND x.jenis_dana = 'DBH' AND x.sub_jenis_dana = 2 ": " AND x.jenis_dana = 'DAK'";
|
||||
if (getRole()=="skpd"){
|
||||
$filter.=" AND x.kode_skpd='".Auth::user()->nrk."'";
|
||||
}
|
||||
$idSPS = 0;
|
||||
if ($request->has("id_sps"))
|
||||
{
|
||||
if ($request->id_sps > 0)
|
||||
{
|
||||
$filter.=" AND x.id_sps=".$request->id_sps;
|
||||
$idSPS = $request->id_sps;
|
||||
}
|
||||
}
|
||||
|
||||
$dataAkbRealisasi = DB::select(DB::raw("SELECT x.kode_skpd, x.nama_skpd, x.kode_rsk, x.nama_rsk, x.jumlah_anggaran, y.*
|
||||
FROM SAMASA.BELANJA_REALISASI x
|
||||
LEFT JOIN SAMASA.MV_ASYNC_AKB_REALISASI y
|
||||
ON x.KODE_RSK = y.I_IDRSK AND x.TAHUN_ANGGARAN = y.C_ANGG_TAHUN
|
||||
WHERE x.TAHUN_ANGGARAN = ".getTa()." $filter ORDER BY x.kode_skpd,x.nama_skpd,x.kode_rsk "));
|
||||
|
||||
|
||||
$dataAkbRealisasi = array_map(function ($value) {
|
||||
return (array)$value;
|
||||
}, $dataAkbRealisasi);
|
||||
|
||||
return view("jadwal_salurdana.index_".$typeDana, compact("dataAkbRealisasi","idSPS"));
|
||||
}
|
||||
|
||||
public function datatable_cht_dak(Request $request, $typeDana)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
// $src = $post["src"];
|
||||
$ta = $post["ta"];
|
||||
$typeDanaFilter = $typeDana == "cht" ? " AND x.jenis_dana = 'DBH' AND x.sub_jenis_dana = 'CHT' ": " AND x.jenis_dana = 'DAK'";
|
||||
$dataFilter=0;
|
||||
$sqlstr = 'SELECT x.kode_skpd, x.nama_skpd, x.kode_rsk, x.nama_rsk, x.jumlah_anggaran, y.*
|
||||
FROM SAMASA.BELANJA_REALISASI x
|
||||
LEFT JOIN SAMASA.MV_ASYNC_AKB_REALISASI y
|
||||
ON x.KODE_RSK = y.I_IDRSK AND x.TAHUN_ANGGARAN = y.C_ANGG_TAHUN
|
||||
WHERE x.TAHUN_ANGGARAN = \''.$ta.'\''.$typeDanaFilter;
|
||||
|
||||
if (getRole()=="skpd"){
|
||||
$sqlstr.=" AND KODE_SKPD='".Auth::user()->nrk."'";
|
||||
}
|
||||
$data = DB::select(DB::raw($sqlstr.' ORDER BY x.kode_skpd,x.kode_rsk OFFSET '.$offset.' ROWS FETCH NEXT '.$limit.' ROWS ONLY'));
|
||||
$dataTotal = count(DB::select(DB::raw($sqlstr)));
|
||||
// if (!empty($src)){
|
||||
//$data->whereRaw("(LOWER(NAMA_REKENING) LIKE '%".strtolower($src)."%' OR LOWER(KODE_REKENING) LIKE '%".strtolower($src)."%')");
|
||||
// }
|
||||
$dataFilter = count(DB::select(DB::raw($sqlstr)));
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data
|
||||
]);
|
||||
}
|
||||
|
||||
public function download(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$typeDana = isset($post["type_dana"])?$post["type_dana"]:"";
|
||||
$idSPS = isset($post["id_sps"])?$post["id_sps"]:"";
|
||||
$ta = $post["ta"];
|
||||
$sqlstr = Sps_pendapatan::queryJadwalSalurDana($ta);
|
||||
|
||||
if (!empty($idSPS)){
|
||||
$sqlstr.=" AND x.ID=$idSPS";
|
||||
}
|
||||
|
||||
if (!empty($typeDana)){
|
||||
if ($typeDana == "cht"){
|
||||
$sqlstr.=" AND kode_rekening='4.2.01.01.01.0004'";
|
||||
}else{
|
||||
$sqlstr.=" AND SUBSTR(kode_rekening,1,12) IN ('4.2.01.01.03','4.2.01.01.04')";
|
||||
}
|
||||
}
|
||||
|
||||
$sqlstr .= " ORDER BY kode_rekening";
|
||||
$data = DB::select(DB::raw($sqlstr));
|
||||
$data = json_decode(json_encode($data),true);
|
||||
|
||||
$fileName = 'Jadwal-salur-dana.xlsx';
|
||||
$spreadsheet = new Spreadsheet();
|
||||
$sheet = $spreadsheet->getActiveSheet();
|
||||
$sheet->setCellValue('A1', 'Kode Rekening');
|
||||
$sheet->setCellValue('B1', 'Nama Rekening');
|
||||
$alpha = range("A","Z");
|
||||
$colIndex = 2;
|
||||
// Nama Kolom bulan
|
||||
$bulans = GetBulan();
|
||||
foreach($bulans as $bulan){
|
||||
$sheet->setCellValue($alpha[$colIndex].'1', $bulan);
|
||||
$colIndex++;
|
||||
$sheet->mergeCells($alpha[$colIndex].'1'.':'.$alpha[$colIndex].'1');
|
||||
$colIndex++;
|
||||
}
|
||||
$sheet->setCellValue(getAlphabetCell($colIndex).'1', "Total");
|
||||
$sheet->mergeCells(getAlphabetCell($colIndex).'1'.':'.getAlphabetCell($colIndex+1).'1');
|
||||
$sheet->mergeCells('A1:A2');
|
||||
$sheet->mergeCells('B1:B2');
|
||||
$colIndex++;
|
||||
|
||||
// Nama Kolom Jadwal dan Realisasi
|
||||
$colName = "Realisasi";
|
||||
for($i=2;$i<=$colIndex;$i++){
|
||||
$colName = $colName == "Jadwal" ? "Realisasi":"Jadwal";
|
||||
$sheet->setCellValue(getAlphabetCell($i).'2', $colName);
|
||||
}
|
||||
|
||||
// Data Kolom Bulan dan Realisasi
|
||||
$rows = 3;
|
||||
foreach ($data as $val){
|
||||
$sheet->setCellValue('A' . $rows, $val["kode_rekening"]);
|
||||
$sheet->setCellValue('B' . $rows, $val["nama_rekening"]);
|
||||
$totalJadwalSalur = 0;
|
||||
$totalRealisasi = 0;
|
||||
$currIndex = 2;
|
||||
for($i=1;$i<=12;$i++){
|
||||
$sheet->setCellValue(getAlphabetCell($currIndex).$rows, $val["spsbulan".$i]);
|
||||
$totalJadwalSalur += $val["spsbulan".$i];
|
||||
$currIndex++;
|
||||
$sheet->setCellValue(getAlphabetCell($currIndex).$rows, $val["real".$i]);
|
||||
$totalRealisasi += $val["real".$i];
|
||||
$currIndex++;
|
||||
}
|
||||
$sheet->setCellValue(getAlphabetCell($currIndex).$rows, $totalJadwalSalur);
|
||||
$sheet->setCellValue(getAlphabetCell($currIndex+1).$rows, $totalRealisasi);
|
||||
|
||||
$rows++;
|
||||
}
|
||||
|
||||
// TOTAL BAWAH
|
||||
$sheet->setCellValue("A".$rows , "TOTAL");
|
||||
$sheet->mergeCells('A'.$rows.':'.'B'.$rows);
|
||||
for ($x=2;$x<=$colIndex;$x++){
|
||||
$strAlpha = getAlphabetCell($x);
|
||||
$SUMRANGE = $strAlpha."3:".$strAlpha.($rows-1);
|
||||
$sheet->setCellValue($strAlpha.$rows , "=SUM($SUMRANGE)");
|
||||
}
|
||||
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
$writer->save("downloadFiles/".$fileName);
|
||||
$headers = [
|
||||
'Content-Type' => 'application/vnd.ms-excel',
|
||||
'Content-Disposition' => 'attachment;filename='.$fileName
|
||||
];
|
||||
return response()->download("downloadFiles/".$fileName, $fileName, $headers);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
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\LaporanFile;
|
||||
use App\Models\User;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
class LaporanFileController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Laporan File";
|
||||
parent::__construct();
|
||||
$this->setIconTitle("fa fa-reply");
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('laporan_file.index');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('laporan_file.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
try{
|
||||
$date = date("Ymd");
|
||||
DB::beginTransaction();
|
||||
|
||||
$req = $request->all();
|
||||
$LaporanExists = LaporanFile::where("nama_laporan",$req["nama_laporan"])->count();
|
||||
if ($LaporanExists > 0)
|
||||
{
|
||||
return redirect(URL::to("/laporan-file"))
|
||||
->with('error','Data nama laporan '.$req["nama_laporan"].' sudah ada!');
|
||||
}
|
||||
|
||||
$this->validate($request, [
|
||||
'file' => 'required|mimes:pdf',
|
||||
]);
|
||||
|
||||
$data["tahun"] = $req["ta"];
|
||||
$data["kode_rekening"] = $req["opt_kode_rekening"];
|
||||
$data["kode_skpd"] = Auth::user()->nrk;
|
||||
$data["nama_skpd"] = Auth::user()->name;
|
||||
$data["nama_laporan"] = $req["nama_laporan"];
|
||||
$file = $request->file('file');
|
||||
if ($file){
|
||||
$fileName = $file->getClientOriginalName();
|
||||
$ext = $file->getClientOriginalExtension();
|
||||
$NewFileName = $req["nama_laporan"].".".$ext;
|
||||
$tujuan_upload = config('constants.upload_path_laporan');
|
||||
File::isDirectory($tujuan_upload) or File::makeDirectory($tujuan_upload, 0777, true, true);
|
||||
$file->move($tujuan_upload, $NewFileName);
|
||||
$data["nama_file"] = $NewFileName;
|
||||
}
|
||||
LaporanFile::create($data);
|
||||
|
||||
DB::commit();
|
||||
return redirect(URL::to("/laporan-file"))->with('success','Laporan berhasil dibuat!');
|
||||
}catch(\Exception $e){
|
||||
DB::rollBack();
|
||||
return redirect(URL::to("/laporan-file"))->with('error',$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function edit(LaporanFile $laporanFile)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('laporan_file.edit',compact('laporanFile'));
|
||||
}
|
||||
|
||||
public function update(Request $request, LaporanFile $laporanFile)
|
||||
{
|
||||
try{
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
$req = $request->all();
|
||||
$LaporanExists = LaporanFile::where("nama_laporan",$req["nama_laporan"])->where("id","<>",$laporanFile->id)->count();
|
||||
if ($LaporanExists > 0)
|
||||
{
|
||||
return redirect(URL::to("/laporan-file"))
|
||||
->with('error','Data nama laporan '.$req["nama_laporan"].' sudah ada!');
|
||||
}
|
||||
|
||||
$data["tahun"] = $req["ta"];
|
||||
$data["kode_rekening"] = $req["opt_kode_rekening"];
|
||||
$data["kode_skpd"] = Auth::user()->nrk;
|
||||
$data["nama_skpd"] = Auth::user()->name;
|
||||
$data["nama_laporan"] = $req["nama_laporan"];
|
||||
$file = $request->file('file');
|
||||
$tujuan_upload = config('constants.upload_path_laporan');
|
||||
if ($file){
|
||||
$fileName = $file->getClientOriginalName();
|
||||
$ext = $file->getClientOriginalExtension();
|
||||
$NewFileName = $req["nama_laporan"].".".$ext;
|
||||
File::isDirectory($tujuan_upload) or File::makeDirectory($tujuan_upload, 0777, true, true);
|
||||
$file->move($tujuan_upload, $NewFileName);
|
||||
$data["nama_file"] = $NewFileName;
|
||||
}else{
|
||||
$arrName = explode(".",$laporanFile->nama_file);
|
||||
$ext = end($arrName);
|
||||
rename($tujuan_upload.$laporanFile->nama_file, $tujuan_upload.$req["nama_laporan"].".".$ext);
|
||||
$data["nama_file"] = $req["nama_laporan"].".".$ext;
|
||||
}
|
||||
$laporanFile->update($data);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect(URL::to("/laporan-file"))->with('success','Laporan berhasil diubah.');
|
||||
}catch(Throwable $e){
|
||||
|
||||
DB::rollBack();
|
||||
return redirect(URL::to("/laporan-file"))->with('error','Laporan gagal diubah!');
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$kode_rekening = isset($post["kode_rekening"])?$post["kode_rekening"]:"";
|
||||
$ta = $post["ta"];
|
||||
$src = isset($post["search"]["value"]) ? strtolower($post["search"]["value"]):"";
|
||||
|
||||
$data = LaporanFile::where("tahun",$ta);
|
||||
if (getRole()=="skpd"){
|
||||
$data->where("kode_skpd",Auth::user()->nrk);
|
||||
}
|
||||
|
||||
if($kode_rekening){
|
||||
$data->where("kode_rekening", $kode_rekening);
|
||||
}
|
||||
|
||||
if (!empty($src))
|
||||
{
|
||||
$src = strtolower($src);
|
||||
//$data->whereRaw("( LOWER(simtrad4_uraian) like '%".$src."%' OR LOWER(simtrad4_sp2d_bun) like '%".$src."%' OR LOWER(rkud_no_sts) like '%".$src."%')");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
$dataTotal = LaporanFile::where("tahun",$ta);
|
||||
if (getRole()=="skpd"){
|
||||
$dataTotal->where("kode_skpd",Auth::user()->nrk);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal->count(),
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->orderBy("created_at","ASC")->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
public function destroy(LaporanFile $laporanFile)
|
||||
{
|
||||
try{
|
||||
DB::beginTransaction();
|
||||
$alamatFile = config('constants.upload_path_laporan').$laporanFile->nama_file;
|
||||
if (file_exists($alamatFile)){
|
||||
unlink($alamatFile);
|
||||
}
|
||||
$laporanFile->delete();
|
||||
DB::commit();
|
||||
return redirect(URL::to("/laporan-file"))->with('success','Data Laporan berhasil dihapus!');
|
||||
|
||||
}catch(Throwable $e){
|
||||
|
||||
DB::rollBack();
|
||||
return redirect(URL::to("/laporan-file"))->with('error','Data Laporan gagal dihapus.');
|
||||
}
|
||||
}
|
||||
|
||||
public function show(LaporanFile $laporanFile)
|
||||
{
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('laporan_file.show',compact("laporanFile"));
|
||||
}
|
||||
|
||||
public function download($kode)
|
||||
{
|
||||
$laporanFile = LaporanFile::where("id", $kode)->firstorNew();
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'attachment;filename='.$laporanFile->nama_file
|
||||
];
|
||||
if ($laporanFile){
|
||||
return response()->download(config('constants.upload_path_laporan').$laporanFile->nama_file);
|
||||
}else{
|
||||
echo "File tidak ditemukan!";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Notifikasi;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class NotifikasiController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->setTitle("Notifikasi");
|
||||
$this->setIconTitle("far fa-bell");
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('notifikasi.index');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
}
|
||||
|
||||
public function edit(BelanjaRealisasi $realisasi_belanja)
|
||||
{
|
||||
}
|
||||
|
||||
public function update(Request $request, BelanjaRealisasi $realisasi_belanja)
|
||||
{
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
//$src = $post["src"];
|
||||
|
||||
$dataFilter=0;
|
||||
$data = Notifikasi::where("userid",Auth::user()->id)->orderBy("created_at","DESC");
|
||||
// if (!empty($src)){
|
||||
// $data->whereRaw("(LOWER(message) LIKE '%".strtolower($src)."%')");
|
||||
// }
|
||||
$dataFilter = $data->count();
|
||||
$dataTotal = Notifikasi::where("userid",Auth::user()->id)->count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
public function destroy(BelanjaRealisasi $realisasi_belanja)
|
||||
{
|
||||
// try{
|
||||
// DB::beginTransaction();
|
||||
// $realisasi_belanja->delete();
|
||||
// DB::commit();
|
||||
// return redirect()->route('realisasi-pendapatan.index')
|
||||
// ->with('success','Data Realisasi Pendapatan berhasil dihapus!');
|
||||
|
||||
// }catch(Throwable $e){
|
||||
|
||||
// DB::rollBack();
|
||||
// return redirect()->route('realisasi-pendapatan.index')
|
||||
// ->with('error','Data Realisasi Pendapatan gagal dihapus.');
|
||||
// }
|
||||
}
|
||||
|
||||
public function show(BelanjaRealisasi $realisasi_belanja)
|
||||
{
|
||||
// if (!Auth::user()->can("Lihat SKPP")){
|
||||
// abort(403, 'Youre not allowed to visit this page!');
|
||||
// }
|
||||
// $this->setSubtitle("Detail Data");
|
||||
// return view('realisasi_belanja.show',compact("realisasi_belanja"));
|
||||
}
|
||||
|
||||
public function getNotif(Request $request)
|
||||
{
|
||||
$notif = Notifikasi::selectRaw("jenis,url,TO_CHAR(created_at,'DD/MM/YYYY HH24:MI') as chat_date,message")->where(["userid"=>Auth::user()->id,"is_read"=>0]);
|
||||
$notif = [
|
||||
"jml"=>$notif->count(),
|
||||
"data"=>$notif->orderBy("created_at","desc")->skip(0)->take(5)->get()
|
||||
];
|
||||
|
||||
return response()->json($notif);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,315 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
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\PendapatanRealisasi;
|
||||
use App\Models\Sps_pendapatan;
|
||||
use App\Models\User;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
class RealisasiPendapatanController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Realisasi Pendapatan";
|
||||
parent::__construct();
|
||||
$this->setIconTitle("fa fa-reply");
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('realisasi_pendapatan.index')
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
// if (!Auth::user()->can("Tambah SKPP")){
|
||||
// abort(403, 'Youre not allowed to visit this page!');
|
||||
// }
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('realisasi_pendapatan.create');
|
||||
}
|
||||
|
||||
protected function dataPendapatan($req= [])
|
||||
{
|
||||
$data["tahun"] = $req["txt_ta"];
|
||||
$data["id_sps"] = $req["txt_id_sps"];
|
||||
$txt_rek_sps = explode("|",$req["txt_rek_sps"]);
|
||||
$data["kode_rekening_sps"] = $txt_rek_sps[0];
|
||||
$data["nama_rekening_sps"] = $txt_rek_sps[1];
|
||||
$data["simtrad4_uraian"] = $req["txt_simtrad4_uraian"];
|
||||
$data["simtrad4_kotor"] = replaceMoney($req["txt_simtrad4_kotor"]);
|
||||
$data["simtrad4_potongan"] = replaceMoney($req["txt_simtrad4_potongan"]);
|
||||
$data["simtrad4_bersih"] = replaceMoney($req["txt_simtrad4_bersih"]);
|
||||
$data["simtrad4_tgl_sp2d_bun"] = ConvertIndoDate($req["txt_simtrad4_tgl_sp2d_bun"]);
|
||||
$data["simtrad4_sp2d_bun"] = $req["txt_simtrad4_sp2d_bun"];
|
||||
$data["retur"] = replaceMoney($req["txt_retur"]);
|
||||
$data["bersih"] = replaceMoney($req["txt_bersih"]);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
try{
|
||||
$date = date("Ymd");
|
||||
DB::beginTransaction();
|
||||
|
||||
$req = $request->all();
|
||||
$data = $this->dataPendapatan($req);
|
||||
$data["created_by"] = Auth::user()->id;
|
||||
|
||||
$PendapatanRealisasi = PendapatanRealisasi::create($data);
|
||||
|
||||
// SEND NOTIF
|
||||
$userBendahara = User::where("role_name","bendahara")->get()->toArray();
|
||||
$userBendahara = array_column($userBendahara,"id");
|
||||
$url = URL::to("/realisasi-pendapatan/".$PendapatanRealisasi->id);
|
||||
$message = "Realisasi Pendapatan telah dibuat oleh Bidang Anggaran dengan No. SP2D BUN ".$req["txt_simtrad4_sp2d_bun"];
|
||||
$this->sendNotif("anggaran", "bendahara", $userBendahara, $message, $url, "Realisasi Pendapatan", $PendapatanRealisasi->id);
|
||||
|
||||
DB::commit();
|
||||
return redirect(URL::to("/realisasi-pendapatan"))->with('success','Realisasi Pendapatan berhasil dibuat.');
|
||||
}catch(\Exception $e){
|
||||
DB::rollBack();
|
||||
return redirect(URL::to("/realisasi-pendapatan"))->with('error',$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function edit(PendapatanRealisasi $realisasi_pendapatan)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('realisasi_pendapatan.edit',compact('realisasi_pendapatan'));
|
||||
}
|
||||
|
||||
public function update(Request $request, PendapatanRealisasi $realisasi_pendapatan)
|
||||
{
|
||||
try{
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
$req = $request->all();
|
||||
$data = $this->dataPendapatan($req);
|
||||
$data["updated_by"] = Auth::user()->id;
|
||||
$realisasi_pendapatan->update($data);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect(URL::to("/realisasi-pendapatan"))->with('success','Realisasi Pendapatan berhasil diubah.');
|
||||
}catch(Throwable $e){
|
||||
|
||||
DB::rollBack();
|
||||
return redirect(URL::to("/realisasi-pendapatan"))->with('error','Realisasi Pendapatan gagal diubah!');
|
||||
}
|
||||
}
|
||||
|
||||
public function rinciDBH(Request $request)
|
||||
{
|
||||
$idSPS = $request->idSPS;
|
||||
$select = DB::raw("spsbulan1,spsbulan2,spsbulan3,spsbulan4,spsbulan5,spsbulan6,spsbulan7,spsbulan8,spsbulan9,spsbulan10,spsbulan11,spsbulan12");
|
||||
$sps = Sps_pendapatan::select($select)->where("ID",$idSPS)->firstOrNew();
|
||||
|
||||
return response()->json($sps);
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$sps = $post["sps"];
|
||||
$ta = $post["ta"];
|
||||
$src = isset($post["search"]["value"]) ? strtolower($post["search"]["value"]):"";
|
||||
|
||||
$dataFilter=0;
|
||||
$data = PendapatanRealisasi::where("tahun",$ta)->orderBy("created_at","ASC");
|
||||
if (!empty($sps))
|
||||
{
|
||||
$data->where("id_sps",$sps);
|
||||
}
|
||||
|
||||
if (!empty($src))
|
||||
{
|
||||
$src = strtolower($src);
|
||||
$data->whereRaw("( LOWER(simtrad4_uraian) like '%".$src."%' OR LOWER(simtrad4_sp2d_bun) like '%".$src."%' OR LOWER(rkud_no_sts) like '%".$src."%')");
|
||||
}
|
||||
$dataFilter = $data->count();
|
||||
$dataTotal = PendapatanRealisasi::where("tahun",$ta)->count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
public function destroy(PendapatanRealisasi $realisasi_pendapatan)
|
||||
{
|
||||
try{
|
||||
DB::beginTransaction();
|
||||
$realisasi_pendapatan->delete();
|
||||
DB::commit();
|
||||
return redirect(URL::to("/realisasi-pendapatan"))->with('success','Data Realisasi Pendapatan berhasil dihapus!');
|
||||
|
||||
}catch(Throwable $e){
|
||||
|
||||
DB::rollBack();
|
||||
return redirect(URL::to("/realisasi-pendapatan"))->with('error','Data Realisasi Pendapatan gagal dihapus.');
|
||||
}
|
||||
}
|
||||
|
||||
public function show(PendapatanRealisasi $realisasi_pendapatan)
|
||||
{
|
||||
// if (!Auth::user()->can("Lihat SKPP")){
|
||||
// abort(403, 'Youre not allowed to visit this page!');
|
||||
// }
|
||||
$this->readNotif($realisasi_pendapatan->id);
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('realisasi_pendapatan.show',compact("realisasi_pendapatan"));
|
||||
}
|
||||
|
||||
public function sts(Request $request, $realisasiId)
|
||||
{
|
||||
// $request->validate([
|
||||
// 'nama' => 'required',
|
||||
// 'nip' => 'required',
|
||||
// 'nrk' => 'required',
|
||||
// ]);
|
||||
// if (!Auth::user()->can("Tambah SKPP")){
|
||||
// abort(403, 'Youre not allowed to visit this page!');
|
||||
// }
|
||||
$req = $request->all();
|
||||
try{
|
||||
$date = date("Ymd");
|
||||
DB::beginTransaction();
|
||||
|
||||
$data = PendapatanRealisasi::firstOrNew(array('id' => $realisasiId));
|
||||
|
||||
if ($data["simtrad4_bersih"]<>replaceMoney($req["rkud_jumlah"])){
|
||||
return redirect(URL::to("/realisasi-pendapatan/".$realisasiId))->with('error', "Jumlah STS harus sama dengan Rencana !");
|
||||
}
|
||||
$data["rkud_tgl"] = $req["rkud_tgl"];
|
||||
$data["rkud_no_sts"] = $req["rkud_no_sts"];
|
||||
$data["rkud_kode_akun"] = $req["rkud_kode_akun"];
|
||||
$data["rkud_nama_akun"] = $req["rkud_nama_akun"];
|
||||
$data["rkud_jumlah"] = replaceMoney($req["rkud_jumlah"]);
|
||||
|
||||
$file = $request->file('file_sts');
|
||||
if ($file){
|
||||
$fileName = $req["rkud_no_sts"].".".$file->getClientOriginalExtension();
|
||||
$tujuan_upload = config('constants.upload_path_sts').getTA();
|
||||
File::isDirectory($tujuan_upload) or File::makeDirectory($tujuan_upload, 0777, true, true);
|
||||
$file->move($tujuan_upload, $fileName);
|
||||
$data["file_sts"] = $fileName;
|
||||
}
|
||||
$data->save();
|
||||
|
||||
DB::commit();
|
||||
|
||||
$userAnggaran = User::where("role_name","anggaran")->get()->toArray();
|
||||
$userAnggaran = array_column($userAnggaran,"id");
|
||||
$url = URL::to("/realisasi-pendapatan/".$realisasiId);
|
||||
$message = "Realisasi Pendapatan dengan No. SP2D BUN ".$data["simtrad4_sp2d_bun"]." telah divalidasi oleh Bidang Perben!";
|
||||
$this->sendNotif("bendahara", "anggaran", $userAnggaran, $message, $url, "Realisasi Pendapatan", $data->id);
|
||||
|
||||
return redirect(URL::to("/realisasi-pendapatan"))->with('success','STS berhasil diinput.');
|
||||
}catch(\Exception $e){
|
||||
|
||||
DB::rollBack();
|
||||
return redirect(URL::to("/realisasi-pendapatan/".$realisasiId))->with('error',$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function download(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
|
||||
$sps = isset($post["sps"])?$post["sps"]:"";
|
||||
$ta = $post["ta"];
|
||||
|
||||
if ($post["export-type"]=="excel")
|
||||
{
|
||||
|
||||
$data = PendapatanRealisasi::orderBy("created_at","ASC");
|
||||
if (!empty($sps)){
|
||||
$data->where("id_sps",$sps);
|
||||
}
|
||||
|
||||
$fileName = 'Realisasi-pendapatan.xlsx';
|
||||
$spreadsheet = new Spreadsheet();
|
||||
$sheet = $spreadsheet->getActiveSheet();
|
||||
$sheet->setCellValue(getAlphabetCell(0).'1', 'Uraian');
|
||||
$sheet->setCellValue(getAlphabetCell(1).'1', 'Kotor');
|
||||
$sheet->setCellValue(getAlphabetCell(2).'1', 'Potongan');
|
||||
$sheet->setCellValue(getAlphabetCell(3).'1', 'Bersih');
|
||||
$sheet->setCellValue(getAlphabetCell(4).'1', 'Retur');
|
||||
$sheet->setCellValue(getAlphabetCell(5).'1', 'Jumlah Bersih');
|
||||
$sheet->setCellValue(getAlphabetCell(6).'1', 'SP2D BUN');
|
||||
$sheet->setCellValue(getAlphabetCell(7).'1', 'TGL SP2D BUN');
|
||||
$sheet->setCellValue(getAlphabetCell(8).'1', 'TGL STS');
|
||||
$sheet->setCellValue(getAlphabetCell(9).'1', 'NO STS');
|
||||
$sheet->setCellValue(getAlphabetCell(10).'1', 'Kode Akun');
|
||||
$sheet->setCellValue(getAlphabetCell(11).'1', 'Nama Akun');
|
||||
$sheet->setCellValue(getAlphabetCell(12).'1', 'Jumlah');
|
||||
|
||||
$rows = 2;
|
||||
foreach ($data->get() as $val){
|
||||
$sheet->setCellValue(getAlphabetCell(0) . $rows, $val["simtrad4_uraian"]);
|
||||
$sheet->setCellValue(getAlphabetCell(1) . $rows, $val["simtrad4_kotor"]);
|
||||
$sheet->setCellValue(getAlphabetCell(2) . $rows, $val["simtrad4_potongan"]);
|
||||
$sheet->setCellValue(getAlphabetCell(3) . $rows, $val["simtrad4_bersih"]);
|
||||
$sheet->setCellValue(getAlphabetCell(4) . $rows, $val["retur"]);
|
||||
$sheet->setCellValue(getAlphabetCell(5) . $rows, $val["bersih"]);
|
||||
$sheet->setCellValue(getAlphabetCell(6) . $rows, $val["simtrad4_sp2d_bun"]);
|
||||
$sheet->setCellValue(getAlphabetCell(7) . $rows, $val["simtrad4_tgl_sp2d_bun"]);
|
||||
$sheet->setCellValue(getAlphabetCell(8) . $rows, $val["rkud_tgl"]);
|
||||
$sheet->setCellValue(getAlphabetCell(9) . $rows, $val["rkud_no_sts"]);
|
||||
$sheet->setCellValue(getAlphabetCell(10) . $rows, $val["kode_rekening_sps"]);
|
||||
$sheet->setCellValue(getAlphabetCell(11) . $rows, $val["nama_rekening_sps"]);
|
||||
$sheet->setCellValue(getAlphabetCell(12) . $rows, $val["rkud_jumlah"]);
|
||||
$rows++;
|
||||
}
|
||||
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
$writer->save("downloadFiles/".$fileName);
|
||||
|
||||
}else if($post["export-type"]=="all_sts"){
|
||||
$zip = new \ZipArchive();
|
||||
$fileName = "STS_ALL_".getTA().".zip";
|
||||
if ($zip->open(public_path("downloadFiles/".$fileName), \ZipArchive::CREATE)== TRUE)
|
||||
{
|
||||
$files = File::files(public_path(config('constants.upload_path_sts').getTA()));
|
||||
foreach ($files as $key => $value){
|
||||
$relativeName = basename($value);
|
||||
$zip->addFile($value, $relativeName);
|
||||
}
|
||||
$zip->close();
|
||||
}
|
||||
}
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'application/vnd.ms-excel',
|
||||
'Content-Disposition' => 'attachment;filename='.$fileName
|
||||
];
|
||||
|
||||
return response()->download("downloadFiles/".$fileName, $fileName, $headers);
|
||||
}
|
||||
|
||||
public function downloadSts(PendapatanRealisasi $realisasi)
|
||||
{
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'attachment;filename='.$realisasi->file_sts
|
||||
];
|
||||
return response()->download(config('constants.upload_path_sts').getTA()."/".$realisasi->file_sts, $realisasi->file_sts, $headers);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Tropd;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class SkpdController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function selectSearch(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$select = DB::raw("I_ID,I_ID||' | '||N_OPD as name");
|
||||
$tropd = Tropd::select($select)
|
||||
->where('N_OPD', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* These middleware are run during every request to your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
// \App\Http\Middleware\TrustHosts::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\Fruitcake\Cors\HandleCors::class,
|
||||
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware groups.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
'web' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
'throttle:api',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* These middleware may be assigned to groups or used individually.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
// 'role' => \App\Http\Middleware\CheckRole::class,
|
||||
'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
|
||||
'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class,
|
||||
'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||
|
||||
class Authenticate extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the path the user should be redirected to when they are not authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return string|null
|
||||
*/
|
||||
protected function redirectTo($request)
|
||||
{
|
||||
if (! $request->expectsJson()) {
|
||||
return route('login');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CheckRole
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next, ... $roles)
|
||||
{
|
||||
$hasRole = false;
|
||||
foreach($roles as $role){
|
||||
if ($request->user()->hasRole($role)) {
|
||||
$hasRole = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$hasRole){
|
||||
abort(403, 'This action is unauthorized.');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
|
||||
|
||||
class EncryptCookies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the cookies that should not be encrypted.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
|
||||
|
||||
class PreventRequestsDuringMaintenance extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be reachable while maintenance mode is enabled.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param string|null ...$guards
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next, ...$guards)
|
||||
{
|
||||
$guards = empty($guards) ? [null] : $guards;
|
||||
|
||||
foreach ($guards as $guard) {
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
||||
|
||||
class TrimStrings extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||
|
||||
class TrustHosts extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the host patterns that should be trusted.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function hosts()
|
||||
{
|
||||
return [
|
||||
$this->allSubdomainsOfApplicationUrl(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The trusted proxies for this application.
|
||||
*
|
||||
* @var array|string|null
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $headers =
|
||||
Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||
|
||||
class VerifyCsrfToken extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
namespace App\Imports;
|
||||
use App\Models\TempRealisasiBelanja;
|
||||
use Maatwebsite\Excel\Concerns\ToModel;
|
||||
use Maatwebsite\Excel\Concerns\Importable;
|
||||
use Maatwebsite\Excel\Concerns\WithStartRow;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RealisasiBelanjaImport implements ToModel, WithStartRow
|
||||
{
|
||||
use Importable;
|
||||
protected $ta;
|
||||
protected $jenisDana;
|
||||
protected $subjenisDana;
|
||||
|
||||
public function __construct($ta, $jenisDana, $subjenisDana){
|
||||
$this->ta = $ta;
|
||||
$this->jenisDana = $jenisDana;
|
||||
$this->subjenisDana = $subjenisDana;
|
||||
}
|
||||
|
||||
public function startRow(): int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function model(array $row)
|
||||
{
|
||||
$data = [
|
||||
"tahun_anggaran"=>$this->ta,
|
||||
"jenis_belanja"=>$row[0],
|
||||
"sub_jenis_belanja"=>$row[1],
|
||||
"kode_program"=>$row[2],
|
||||
"nama_program"=>$row[3],
|
||||
"kode_skpd"=>$row[4],
|
||||
"nama_skpd"=>$row[5],
|
||||
"kode_kegiatan"=>$row[6],
|
||||
"nama_kegiatan"=>$row[7],
|
||||
"kode_sub_kegiatan"=>$row[8],
|
||||
"nama_sub_kegiatan"=>$row[9],
|
||||
"kode_rsk"=>$row[10],
|
||||
"nama_rsk"=>$row[11],
|
||||
"jumlah_anggaran"=>$row[12],
|
||||
"volume_satuan"=>$row[13],
|
||||
"unit_satuan"=>$row[14],
|
||||
"jenis_dana"=>$this->jenisDana,
|
||||
"sub_jenis_dana"=>$this->subjenisDana,
|
||||
"userid"=>Auth::user()->id
|
||||
];
|
||||
|
||||
return new TempRealisasiBelanja($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
namespace App\Imports;
|
||||
use App\Models\TempRealisasiBelanja;
|
||||
use Maatwebsite\Excel\Concerns\ToModel;
|
||||
use Maatwebsite\Excel\Concerns\Importable;
|
||||
use Maatwebsite\Excel\Concerns\WithStartRow;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RealisasiBelanjaImportDak implements ToModel, WithStartRow
|
||||
{
|
||||
use Importable;
|
||||
protected $ta;
|
||||
protected $jenisDana;
|
||||
protected $subjenisDana;
|
||||
|
||||
public function __construct($ta, $jenisDana, $subjenisDana){
|
||||
$this->ta = $ta;
|
||||
$this->jenisDana = $jenisDana;
|
||||
$this->subjenisDana = $subjenisDana;
|
||||
}
|
||||
|
||||
public function startRow(): int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function model(array $row)
|
||||
{
|
||||
$data = [
|
||||
"tahun_anggaran"=>$this->ta,
|
||||
"jenis_belanja"=>$row[0],
|
||||
"sub_jenis_belanja"=>$row[1],
|
||||
"kode_program"=>$row[2],
|
||||
"nama_program"=>$row[3],
|
||||
"kode_skpd"=>Auth::user()->nrk,
|
||||
"nama_skpd"=>Auth::user()->name,
|
||||
"kode_kegiatan"=>$row[4],
|
||||
"nama_kegiatan"=>$row[5],
|
||||
"kode_sub_kegiatan"=>$row[6],
|
||||
"nama_sub_kegiatan"=>$row[7],
|
||||
"kode_rsk"=>$row[8],
|
||||
"nama_rsk"=>$row[9],
|
||||
"jumlah_anggaran"=>$row[10],
|
||||
"volume_satuan"=>$row[11],
|
||||
"unit_satuan"=>$row[12],
|
||||
"jenis_dana"=>$this->jenisDana,
|
||||
"sub_jenis_dana"=>$this->subjenisDana,
|
||||
"userid"=>Auth::user()->id
|
||||
];
|
||||
|
||||
if ($this->subjenisDana == "Fisik"){
|
||||
$data["jml_rencana_kontrak"] = $row[13];
|
||||
}
|
||||
|
||||
return new TempRealisasiBelanja($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Traits\Uuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class BelanjaRealisasi extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
use Uuids;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.belanja_realisasi';
|
||||
protected $fillable = [
|
||||
"tahun_anggaran",
|
||||
"jenis_belanja",
|
||||
"sub_jenis_belanja",
|
||||
"kode_program",
|
||||
"nama_program",
|
||||
"kode_skpd",
|
||||
"nama_skpd",
|
||||
"kode_kegiatan",
|
||||
"nama_kegiatan",
|
||||
"kode_sub_kegiatan",
|
||||
"nama_sub_kegiatan",
|
||||
"kode_rsk",
|
||||
"nama_rsk",
|
||||
"kode_rekening",
|
||||
"nama_rekening",
|
||||
"jumlah_anggaran",
|
||||
"alokasi_anggaran",
|
||||
"volume_satuan",
|
||||
"unit_satuan",
|
||||
"jumlah_realisasi",
|
||||
"volume_satuan_realisasi",
|
||||
"unit_satuan_realisasi",
|
||||
"no_sp2d",
|
||||
"jml_rencana_kontrak",
|
||||
"realisasi_by",
|
||||
"created_by",
|
||||
"jenis_dana",
|
||||
"sub_jenis_dana",
|
||||
"id_sps",
|
||||
"f_view_sbpk"
|
||||
];
|
||||
|
||||
public function getSPD($subgiat,$skpd)
|
||||
{
|
||||
return DB::select(DB::raw(
|
||||
"SELECT a.I_SPDNO_DOK as NO_SPD, a.D_SPDNO as TGL, b.JML as jumlah
|
||||
FROM NEWSIPKD.TMSPD a
|
||||
INNER JOIN (
|
||||
SELECT I_IDSPD, SUM(V_SPD) AS JML
|
||||
FROM NEWSIPKD.TMSPDRINCIBLJ x
|
||||
LEFT JOIN NEWSIPKD.TMDPASUBGIAT y
|
||||
ON x.I_IDSUBGIAT = y.I_ID
|
||||
WHERE y.C_SUBGIAT = '".$subgiat."'
|
||||
AND y.I_IDOPD = '".$skpd."'
|
||||
GROUP BY I_IDSPD
|
||||
) b
|
||||
ON a.I_ID = b.I_IDSPD
|
||||
WHERE a.C_ANGG_TAHUN = ".getTA()." ORDER BY a.D_SPDNO"
|
||||
));
|
||||
}
|
||||
|
||||
public function tableData($ta, $filter, $offset=0, $limit=0)
|
||||
{
|
||||
$ta = getTA();
|
||||
$sqlstr = "SELECT a.*,NVL(b.jml,0) as jml,
|
||||
CASE WHEN a.jenis_dana = 'DBH' AND a.nama_subjenis_dana<>'CHT'
|
||||
THEN NVL(d.jml_spd, 0) ELSE NVL(c.jml_spd, 0) END AS jml_spd
|
||||
FROM VW_BELANJA_REALISASI a
|
||||
LEFT JOIN (
|
||||
SELECT I_IDRSK,SUM(REALISASI_1) AS jml
|
||||
FROM MV_REALISASI_BELANJA_PERBULAN
|
||||
WHERE C_ANGG_TAHUN = $ta
|
||||
GROUP BY I_IDRSK
|
||||
) b ON a.kode_rsk = b.I_IDRSK
|
||||
LEFT JOIN (
|
||||
SELECT id_rsk,count(id_rsk) as jml_spd
|
||||
FROM SAMASA.belanja_realisasi_spd
|
||||
WHERE TO_CHAR(TGL,'YYYY') = $ta
|
||||
GROUP BY id_rsk
|
||||
) c ON a.kode_rsk = c.id_rsk
|
||||
LEFT JOIN (
|
||||
SELECT C_OPD,C_SUBGIAT,COUNT(JML) AS jml_spd
|
||||
FROM
|
||||
(
|
||||
SELECT C_OPD,C_SUBGIAT,SUM(V_SPD) AS JML
|
||||
FROM NEWSIPKD.TMSPDRINCIBLJ x
|
||||
LEFT JOIN NEWSIPKD.TMDPASUBGIAT y ON x.I_IDSUBGIAT = y.I_ID
|
||||
AND x.C_ANGG_TAHUN = $ta
|
||||
LEFT JOIN NEWSIPKD.TROPD z ON z.I_ID = y.I_IDOPD
|
||||
WHERE C_SUBGIAT IS NOT NULL
|
||||
GROUP BY C_OPD,C_SUBGIAT,I_IDSPD
|
||||
) GROUP BY C_OPD,C_SUBGIAT
|
||||
) d ON a.KODE_SUB_KEGIATAN = d.C_SUBGIAT AND a.KODE_SKPD = d.C_OPD
|
||||
".$filter."
|
||||
ORDER BY a.KODE_SKPD, a.KODE_RSK ";
|
||||
|
||||
$sqlstr.= $limit > 0?" OFFSET ".$offset." ROWS FETCH NEXT ".$limit." ROWS ONLY ":"";
|
||||
|
||||
return $sqlstr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Traits\Uuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class BelanjaRealisasiBast extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.belanja_realisasi_bast';
|
||||
protected $fillable = [
|
||||
"id_kontrak",
|
||||
"nomor_bast",
|
||||
"tgl_bast",
|
||||
"nominal_bast",
|
||||
"file_bast",
|
||||
"created_by"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Traits\Uuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class BelanjaRealisasiDetail extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.belanja_realisasi_detail';
|
||||
protected $fillable = [
|
||||
"belanja_realisasi_id",
|
||||
"jumlah_realisasi",
|
||||
"alokasi_realisasi",
|
||||
"volume_satuan_realisasi",
|
||||
"unit_satuan_realisasi",
|
||||
"semester",
|
||||
"created_by"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Traits\Uuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class BelanjaRealisasiKontrak extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.belanja_realisasi_kontrak';
|
||||
protected $fillable = [
|
||||
"belanja_realisasi_id",
|
||||
"nomor_kontrak",
|
||||
"tgl_kontrak",
|
||||
"nominal_kontrak",
|
||||
"file_kontrak",
|
||||
"nomor_bast",
|
||||
"created_by"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Traits\Uuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class BelanjaRealisasiRinci extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.belanja_realisasi_rinci';
|
||||
protected $fillable = [
|
||||
"belanja_realisasi_id",
|
||||
"jumlah_realisasi_1",
|
||||
"volume_satuan_realisasi_1",
|
||||
"jumlah_realisasi_2",
|
||||
"volume_satuan_realisasi_2",
|
||||
"jumlah_realisasi_3",
|
||||
"volume_satuan_realisasi_3",
|
||||
"jumlah_realisasi_4",
|
||||
"volume_satuan_realisasi_4",
|
||||
"jumlah_realisasi_5",
|
||||
"volume_satuan_realisasi_5",
|
||||
"jumlah_realisasi_6",
|
||||
"volume_satuan_realisasi_6",
|
||||
"jumlah_realisasi_7",
|
||||
"volume_satuan_realisasi_7",
|
||||
"jumlah_realisasi_8",
|
||||
"volume_satuan_realisasi_8",
|
||||
"jumlah_realisasi_9",
|
||||
"volume_satuan_realisasi_9",
|
||||
"jumlah_realisasi_10",
|
||||
"volume_satuan_realisasi_10",
|
||||
"jumlah_realisasi_11",
|
||||
"volume_satuan_realisasi_11",
|
||||
"jumlah_realisasi_12",
|
||||
"volume_satuan_realisasi_12",
|
||||
"created_by"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Traits\Uuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class BelanjaRealisasiSPD extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.belanja_realisasi_spd';
|
||||
protected $fillable = [
|
||||
"id_rsk",
|
||||
"no_spd",
|
||||
"tgl",
|
||||
"jumlah"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class Kegiatan extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'NEWSIPKD.TRDPAGIAT';
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Traits\Uuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class LaporanFile extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
use Uuids;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.laporan_file';
|
||||
protected $fillable = [
|
||||
"tahun",
|
||||
"tgl_upload",
|
||||
"kode_rekening",
|
||||
"kode_skpd",
|
||||
"nama_skpd",
|
||||
"nama_laporan",
|
||||
"nama_file",
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class MappingDbhSkpd extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.mapping_dbh_skpd';
|
||||
protected $fillable = [
|
||||
"id_sps",
|
||||
"tahun",
|
||||
"kode_rekening",
|
||||
"kode_skpd"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class MstJenisBelanja extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.MST_JENIS_BELANJA';
|
||||
protected $fillable = [
|
||||
"kode",
|
||||
"name",
|
||||
"description",
|
||||
"grup"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class MstJenisDana extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.MST_JENIS_DANA';
|
||||
protected $fillable = [
|
||||
"name",
|
||||
"grup",
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class MstSubJenisBelanja extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.MST_SUB_JENIS_BELANJA';
|
||||
protected $fillable = [
|
||||
"kode",
|
||||
"id_jenis_belanja",
|
||||
"name",
|
||||
"description",
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Traits\Uuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class Notifikasi extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
use Uuids;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.notifikasi';
|
||||
protected $fillable = [
|
||||
"role_from",
|
||||
"role_to",
|
||||
"userid",
|
||||
"message",
|
||||
"url",
|
||||
"is_read",
|
||||
"jenis",
|
||||
"id_unik"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Traits\Uuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class PendapatanRealisasi extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
use Uuids;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.pendapatan_realisasi';
|
||||
protected $fillable = [
|
||||
'tahun','simtrad4_uraian','simtrad4_kotor','simtrad4_potongan','simtrad4_bersih','simtrad4_tgl_sp2d_bun','simtrad4_sp2d_bun',
|
||||
'rkud_tgl','rkud_no_sts','rkud_kode_akun','rkud_nama_akun','rkud_jumlah','id_sps','kode_rekening_sps','nama_rekening_sps','file_sts',
|
||||
'retur','bersih'
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Permission extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'permissions';
|
||||
protected $fillable = [
|
||||
'name', 'guard_name'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class Program extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'NEWSIPKD.TRPROGRAM';
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Role extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RolePermission extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
public $timestamps = false;
|
||||
|
||||
protected $table = 'role_has_permissions';
|
||||
protected $fillable = [
|
||||
'permission_id','role_id'
|
||||
];
|
||||
|
||||
public function role() {
|
||||
return $this->belongsTo('App\Models\Roless','role_id','id');
|
||||
}
|
||||
|
||||
public function permission() {
|
||||
return $this->belongsTo('App\Models\Permission','permission_id','id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RoleUser extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'role_id',
|
||||
'user_id',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function role()
|
||||
{
|
||||
return $this->belongsTo(Role::class, 'role_id', 'id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Spatie\Permission\Traits\HasPermissions;
|
||||
|
||||
class Roless extends Model
|
||||
{
|
||||
use HasFactory, HasPermissions;
|
||||
protected $table = 'roless';
|
||||
protected $fillable = [
|
||||
'name','guard_name'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class Rsk extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'NEWSIPKD.TMDPARSK';
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use App\Traits\Uuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class Siesetpembayaran extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
use Uuids;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'NEWSIPKD.SI_ESET_PEMBAYARAN';
|
||||
protected $fillable = [];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class Sp2d extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'NEWSIPKD.TMSP2D';
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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 Sps_pendapatan extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'PROKSI.SPS_PENDAPATAN';
|
||||
|
||||
public function queryJadwalSalurDana($ta)
|
||||
{
|
||||
$sqlstr = 'SELECT * FROM VW_JADWAL_SALUR x ';
|
||||
|
||||
if (getRole()=="skpd"){
|
||||
$sqlstr .= ' WHERE x.id IN (SELECT id_sps FROM SAMASA.MAPPING_DBH_SKPD WHERE KODE_SKPD=\''.Auth::user()->nrk.'\') ';
|
||||
}else{
|
||||
$sqlstr .= " WHERE 1=1 ";
|
||||
}
|
||||
|
||||
$sqlstr .= ' AND x.TAHUN = '.$ta.' AND x.SKPD_ID=980 AND SUBSTR(x.KODE_REKENING,1,3)=\'4.2\'';
|
||||
|
||||
return $sqlstr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class SubKegiatan extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'NEWSIPKD.TMDPASUBGIAT';
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class TempRealisasiBelanja extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'SAMASA.TEMP_REALISASI_BELANJA';
|
||||
protected $fillable = [
|
||||
"tahun_anggaran",
|
||||
"jenis_belanja",
|
||||
"sub_jenis_belanja",
|
||||
"kode_program",
|
||||
"nama_program",
|
||||
"kode_skpd",
|
||||
"nama_skpd",
|
||||
"kode_kegiatan",
|
||||
"nama_kegiatan",
|
||||
"kode_sub_kegiatan",
|
||||
"nama_sub_kegiatan",
|
||||
"kode_rsk",
|
||||
"nama_rsk",
|
||||
"kode_rekening",
|
||||
"nama_rekening",
|
||||
"jumlah_anggaran",
|
||||
"volume_satuan",
|
||||
"unit_satuan",
|
||||
"jml_rencana_kontrak",
|
||||
"jenis_dana",
|
||||
"sub_jenis_dana",
|
||||
"userid"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class Trbas extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'NEWSIPKD.TRBAS';
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class Tropd extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'NEWSIPKD.TROPD';
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UnitSatuan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'unit_satuan';
|
||||
protected $fillable = [
|
||||
'nama_satuan'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Illuminate\Support\Str;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable, HasRoles;
|
||||
public $incrementing = false;
|
||||
protected $keyType = "string";
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'nrk',
|
||||
'password',
|
||||
'role_name',
|
||||
'is_lock_upload',
|
||||
'lock_upload_time',
|
||||
'lock_upload_by',
|
||||
'wilayah'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
//'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function roleUser()
|
||||
{
|
||||
return $this->hasOne(RoleUser::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
protected static function boot() {
|
||||
static::creating(function ($model) {
|
||||
if (!$model->id){
|
||||
$model->id = (string) Str::uuid();
|
||||
}
|
||||
});
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
public function authorizeRoles($roles)
|
||||
{
|
||||
if ($this->hasAnyRole($roles)) {
|
||||
return true;
|
||||
}
|
||||
abort(403, 'This action is unauthorized.');
|
||||
}
|
||||
|
||||
// public function hasAnyRole($roles)
|
||||
// {
|
||||
// if (is_array($roles)) {
|
||||
// foreach ($roles as $role) {
|
||||
// if ($this->hasRole($role)) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// if ($this->hasRole($roles)) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// public function hasRole($role)
|
||||
// {
|
||||
// $hasRole = $this->roleUser()->with(["role"=>function($query) use ($role){
|
||||
// $query->where("name",$role);
|
||||
// }])->first();
|
||||
|
||||
// if ($hasRole->role){
|
||||
// return true;
|
||||
// }else{
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class VwAkbSpdRealRsk extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'NEWSIPKD.VW_AKB_SPD_REALISASI_RSK';
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
class VwBelanjaRealisasi extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
public $incrementing = false;
|
||||
protected $keyType = "string";
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'Samasa.VW_BELANJA_REALISASI';
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class VwDpaRsk extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'Samasa.VW_DPA_RSK';
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class VwJenisBelanja extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'Samasa';
|
||||
protected $table = 'Samasa.VW_JENIS_BELANJA';
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Paginator::useBootstrap();
|
||||
Schema::defaultStringLength(191);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The policy mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $policies = [
|
||||
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerPolicies();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BroadcastServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Broadcast::routes();
|
||||
|
||||
require base_path('routes/channels.php');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Cache\RateLimiting\Limit;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The path to the "home" route for your application.
|
||||
*
|
||||
* This is used by Laravel authentication to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const HOME = '/home';
|
||||
|
||||
/**
|
||||
* The controller namespace for the application.
|
||||
*
|
||||
* When present, controller route declarations will automatically be prefixed with this namespace.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
// protected $namespace = 'App\\Http\\Controllers';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->configureRateLimiting();
|
||||
|
||||
$this->routes(function () {
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the rate limiters for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureRateLimiting()
|
||||
{
|
||||
RateLimiter::for('api', function (Request $request) {
|
||||
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
trait Uuids
|
||||
{
|
||||
/**
|
||||
* Boot function from Laravel.
|
||||
*/
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
static::creating(function ($model) {
|
||||
if (empty($model->{$model->getKeyName()})) {
|
||||
$model->{$model->getKeyName()} = Str::uuid()->toString();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value indicating whether the IDs are incrementing.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getIncrementing()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the auto-incrementing key type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getKeyType()
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class breadcrumb extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Closure|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.breadcrumb');
|
||||
}
|
||||
}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
|
||||
use PHPJasper\PHPJasper;
|
||||
|
||||
function GetBulan(){
|
||||
$Month_name = array("Januari","Februari","Maret",
|
||||
"April","Mei","Juni","Juli","Agustus",
|
||||
"September","Oktober","November","Desember");
|
||||
return $Month_name;
|
||||
}
|
||||
|
||||
function ConvertIndoDate($val){
|
||||
if ($val == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
$arr_date = explode("/", $val);
|
||||
return $arr_date[2] ."-".$arr_date[1]."-".$arr_date[0];
|
||||
}
|
||||
|
||||
function SetToIndoDate($val,$monthYear=false, $full=false){
|
||||
$Month_name = array("","Januari","Februari","Maret",
|
||||
"April","Mei","Juni","Juli","Agustus",
|
||||
"September","Oktober","November","Desember");
|
||||
|
||||
if ($val == null) return "";
|
||||
if ($monthYear){
|
||||
return $Month_name[intval(date("m",strtotime($val)))]." ".date("Y",strtotime($val));
|
||||
}else{
|
||||
if ($full){
|
||||
return date("d",strtotime($val))." ".$Month_name[intval(date("m",strtotime($val)))]." ".date("Y",strtotime($val));
|
||||
}else{
|
||||
return date("d-m-Y",strtotime($val));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cekData($data, $default){
|
||||
return isset($data)?$data:$default;
|
||||
}
|
||||
|
||||
function replaceMoney($val){
|
||||
return doubleval(preg_replace("/\D/","",$val));
|
||||
}
|
||||
|
||||
function separateNumberIndo($val){
|
||||
// $numberFormatter = new NumberFormatter( 'id_ID', NumberFormatter::DECIMAL );
|
||||
$numberFormatter = number_format($val);
|
||||
$numberFormatter = str_replace([","],["."],$numberFormatter);
|
||||
return $numberFormatter;
|
||||
}
|
||||
|
||||
function terbilang($val){
|
||||
switch($val){
|
||||
case $val>=1 && $val<=11:
|
||||
$arrBil = ["","Satu","Dua","Tiga","Empat","Lima","Enam","Tujuh","Delapan","Sembilan","Sepuluh","Sebelas"];
|
||||
return $arrBil[$val];
|
||||
break;
|
||||
case $val>=12 && $val<=19:
|
||||
return terbilang($val % 10)." Belas ";
|
||||
break;
|
||||
case $val>=20 && $val<=99:
|
||||
return terbilang(floor($val / 10))." Puluh ".trim(terbilang($val % 10));
|
||||
break;
|
||||
case $val>=100 && $val<=199:
|
||||
return "Seratus ".terbilang($val % 100);
|
||||
break;
|
||||
case $val>=200 && $val<=999:
|
||||
return terbilang(floor($val / 100))." Ratus ".trim(terbilang($val % 100));
|
||||
break;
|
||||
case $val>=1000 && $val<=1999:
|
||||
return "Seribu ".terbilang($val % 1000);
|
||||
break;
|
||||
case $val>=2000 && $val<=999999:
|
||||
return terbilang(floor($val / 1000))." Ribu ".trim(terbilang($val % 1000));
|
||||
break;
|
||||
case $val>=1000000 && $val<=999999999:
|
||||
return terbilang(floor($val / 1000000))." Juta ".trim(terbilang($val % 1000000));
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function reportProceed($source, $reportName, $params = []){
|
||||
$input = resource_path("views/laporan/$source.jrxml");
|
||||
$output = storage_path('app');
|
||||
$options = [
|
||||
'format' => ['pdf'],
|
||||
'params' => $params,
|
||||
'local'=>'en',
|
||||
'db_connection' => [
|
||||
'driver' => 'mysql',
|
||||
'username' => env('DB_USERNAME'),
|
||||
'password' => env('DB_PASSWORD'),
|
||||
'host' => env('DB_HOST'),
|
||||
'database' => env('DB_DATABASE'),
|
||||
'port' => env('DB_PORT')
|
||||
]
|
||||
];
|
||||
|
||||
$jasper = new PHPJasper;
|
||||
$jasper->process(
|
||||
$input,
|
||||
$output,
|
||||
$options
|
||||
)->execute();
|
||||
|
||||
return $output."/$reportName.pdf";
|
||||
}
|
||||
|
||||
function getRole()
|
||||
{
|
||||
$role = Auth::user()->getRoleNames();
|
||||
$role = $role[0];
|
||||
|
||||
return $role;
|
||||
}
|
||||
|
||||
function getAlphabetCell($idx)
|
||||
{
|
||||
$alphabet = range("A","Z");
|
||||
if ($idx > 25)
|
||||
{
|
||||
$idx -= 26;
|
||||
return $alphabet[round($idx/25)].= getAlphabetCell($idx);
|
||||
}else{
|
||||
return $alphabet[$idx];
|
||||
}
|
||||
}
|
||||
|
||||
function getTA()
|
||||
{
|
||||
return Session::get('Tahun_Anggaran')!==null?Session::get('Tahun_Anggaran'):date("Y");
|
||||
}
|
||||
|
||||
function getJenisDana()
|
||||
{
|
||||
return ["DBH","DAK","DID","DAU"];
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Auto Loader
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Composer provides a convenient, automatically generated class loader
|
||||
| for our application. We just need to utilize it! We'll require it
|
||||
| into the script here so that we do not have to worry about the
|
||||
| loading of any of our classes manually. It's great to relax.
|
||||
|
|
||||
*/
|
||||
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
|
||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Run The Artisan Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When we run the console application, the current CLI command will be
|
||||
| executed in this console and the response sent back to a terminal
|
||||
| or another output device for the developers. Here goes nothing!
|
||||
|
|
||||
*/
|
||||
|
||||
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
||||
|
||||
$status = $kernel->handle(
|
||||
$input = new Symfony\Component\Console\Input\ArgvInput,
|
||||
new Symfony\Component\Console\Output\ConsoleOutput
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Shutdown The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Once Artisan has finished running, we will fire off the shutdown events
|
||||
| so that any final work may be done by the application before we shut
|
||||
| down the process. This is the last thing to happen to the request.
|
||||
|
|
||||
*/
|
||||
|
||||
$kernel->terminate($input, $status);
|
||||
|
||||
exit($status);
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Create The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The first thing we will do is create a new Laravel application instance
|
||||
| which serves as the "glue" for all the components of Laravel, and is
|
||||
| the IoC container for the system binding all of the various parts.
|
||||
|
|
||||
*/
|
||||
|
||||
$app = new Illuminate\Foundation\Application(
|
||||
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bind Important Interfaces
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, we need to bind some important interfaces into the container so
|
||||
| we will be able to resolve them when needed. The kernels serve the
|
||||
| incoming requests to this application from both the web and CLI.
|
||||
|
|
||||
*/
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Http\Kernel::class,
|
||||
App\Http\Kernel::class
|
||||
);
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Console\Kernel::class,
|
||||
App\Console\Kernel::class
|
||||
);
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Debug\ExceptionHandler::class,
|
||||
App\Exceptions\Handler::class
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Return The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This script returns the application instance. The instance is given to
|
||||
| the calling script so we can separate the building of the instances
|
||||
| from the actual running of the application and sending responses.
|
||||
|
|
||||
*/
|
||||
|
||||
return $app;
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"name": "laravel/laravel",
|
||||
"type": "project",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^7.3|^8.0",
|
||||
"fruitcake/laravel-cors": "^2.0",
|
||||
"geekcom/phpjasper": "^3.3",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"laravel/framework": "^8.54",
|
||||
"laravel/sanctum": "^2.11",
|
||||
"laravel/tinker": "^2.5",
|
||||
"maatwebsite/excel": "^3.1",
|
||||
"phpoffice/phpspreadsheet": "^1.24",
|
||||
"spatie/laravel-permission": "^5.3",
|
||||
"yajra/laravel-oci8": "^8"
|
||||
},
|
||||
"require-dev": {
|
||||
"facade/ignition": "^2.5",
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
"laravel/sail": "^1.0.1",
|
||||
"mockery/mockery": "^1.4.4",
|
||||
"nunomaduro/collision": "^5.10",
|
||||
"phpunit/phpunit": "^9.5.8"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
},
|
||||
"files": [
|
||||
"app/helpers.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@php artisan vendor:publish --tag=laravel-assets --ansi"
|
||||
],
|
||||
"post-root-package-install": [
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"@php artisan key:generate --ansi"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"dont-discover": []
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
Generated
+8695
File diff suppressed because it is too large
Load Diff
+236
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value is the name of your application. This value is used when the
|
||||
| framework needs to place the application's name in a notification or
|
||||
| any other location as required by the application or its packages.
|
||||
|
|
||||
*/
|
||||
|
||||
'name' => env('APP_NAME', 'Laravel'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Environment
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value determines the "environment" your application is currently
|
||||
| running in. This may determine how you prefer to configure various
|
||||
| services the application utilizes. Set this in your ".env" file.
|
||||
|
|
||||
*/
|
||||
|
||||
'env' => env('APP_ENV', 'production'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => (bool) env('APP_DEBUG', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| your application so that it is used when running Artisan tasks.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => env('APP_URL', 'http://localhost'),
|
||||
|
||||
'asset_url' => env('ASSET_URL', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default timezone for your application, which
|
||||
| will be used by the PHP date and date-time functions. We have gone
|
||||
| ahead and set this to a sensible default for you out of the box.
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => 'Asia/Jakarta',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Locale Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The application locale determines the default locale that will be used
|
||||
| by the translation service provider. You are free to set this value
|
||||
| to any of the locales which will be supported by the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'locale' => 'en',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Fallback Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The fallback locale determines the locale to use when the current one
|
||||
| is not available. You may change the value to correspond to any of
|
||||
| the language folders that are provided through your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'fallback_locale' => 'en',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Faker Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This locale will be used by the Faker PHP library when generating fake
|
||||
| data for your database seeds. For example, this will be used to get
|
||||
| localized telephone numbers, street address information and more.
|
||||
|
|
||||
*/
|
||||
|
||||
'faker_locale' => 'en_US',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is used by the Illuminate encrypter service and should be set
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
*/
|
||||
|
||||
'key' => env('APP_KEY'),
|
||||
|
||||
'cipher' => 'AES-256-CBC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Autoloaded Service Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The service providers listed here will be automatically loaded on the
|
||||
| request to your application. Feel free to add your own services to
|
||||
| this array to grant expanded functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
|
||||
/*
|
||||
* Laravel Framework Service Providers...
|
||||
*/
|
||||
Illuminate\Auth\AuthServiceProvider::class,
|
||||
Illuminate\Broadcasting\BroadcastServiceProvider::class,
|
||||
Illuminate\Bus\BusServiceProvider::class,
|
||||
Illuminate\Cache\CacheServiceProvider::class,
|
||||
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
|
||||
Illuminate\Cookie\CookieServiceProvider::class,
|
||||
Illuminate\Database\DatabaseServiceProvider::class,
|
||||
Illuminate\Encryption\EncryptionServiceProvider::class,
|
||||
Illuminate\Filesystem\FilesystemServiceProvider::class,
|
||||
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
|
||||
Illuminate\Hashing\HashServiceProvider::class,
|
||||
Illuminate\Mail\MailServiceProvider::class,
|
||||
Illuminate\Notifications\NotificationServiceProvider::class,
|
||||
Illuminate\Pagination\PaginationServiceProvider::class,
|
||||
Illuminate\Pipeline\PipelineServiceProvider::class,
|
||||
Illuminate\Queue\QueueServiceProvider::class,
|
||||
Illuminate\Redis\RedisServiceProvider::class,
|
||||
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
|
||||
Illuminate\Session\SessionServiceProvider::class,
|
||||
Illuminate\Translation\TranslationServiceProvider::class,
|
||||
Illuminate\Validation\ValidationServiceProvider::class,
|
||||
Illuminate\View\ViewServiceProvider::class,
|
||||
|
||||
/*
|
||||
* Package Service Providers...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Application Service Providers...
|
||||
*/
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
Yajra\Oci8\Oci8ServiceProvider::class,
|
||||
Spatie\Permission\PermissionServiceProvider::class,
|
||||
Maatwebsite\Excel\ExcelServiceProvider::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Class Aliases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This array of class aliases will be registered when this application
|
||||
| is started. However, feel free to register as many as you wish as
|
||||
| the aliases are "lazy" loaded so they don't hinder performance.
|
||||
|
|
||||
*/
|
||||
|
||||
'aliases' => [
|
||||
|
||||
'App' => Illuminate\Support\Facades\App::class,
|
||||
'Arr' => Illuminate\Support\Arr::class,
|
||||
'Artisan' => Illuminate\Support\Facades\Artisan::class,
|
||||
'Auth' => Illuminate\Support\Facades\Auth::class,
|
||||
'Blade' => Illuminate\Support\Facades\Blade::class,
|
||||
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
|
||||
'Bus' => Illuminate\Support\Facades\Bus::class,
|
||||
'Cache' => Illuminate\Support\Facades\Cache::class,
|
||||
'Config' => Illuminate\Support\Facades\Config::class,
|
||||
'Cookie' => Illuminate\Support\Facades\Cookie::class,
|
||||
'Crypt' => Illuminate\Support\Facades\Crypt::class,
|
||||
'Date' => Illuminate\Support\Facades\Date::class,
|
||||
'DB' => Illuminate\Support\Facades\DB::class,
|
||||
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
|
||||
'Event' => Illuminate\Support\Facades\Event::class,
|
||||
'File' => Illuminate\Support\Facades\File::class,
|
||||
'Gate' => Illuminate\Support\Facades\Gate::class,
|
||||
'Hash' => Illuminate\Support\Facades\Hash::class,
|
||||
'Http' => Illuminate\Support\Facades\Http::class,
|
||||
'Lang' => Illuminate\Support\Facades\Lang::class,
|
||||
'Log' => Illuminate\Support\Facades\Log::class,
|
||||
'Mail' => Illuminate\Support\Facades\Mail::class,
|
||||
'Notification' => Illuminate\Support\Facades\Notification::class,
|
||||
'Password' => Illuminate\Support\Facades\Password::class,
|
||||
'Queue' => Illuminate\Support\Facades\Queue::class,
|
||||
'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
|
||||
'Redirect' => Illuminate\Support\Facades\Redirect::class,
|
||||
// 'Redis' => Illuminate\Support\Facades\Redis::class,
|
||||
'Request' => Illuminate\Support\Facades\Request::class,
|
||||
'Response' => Illuminate\Support\Facades\Response::class,
|
||||
'Route' => Illuminate\Support\Facades\Route::class,
|
||||
'Schema' => Illuminate\Support\Facades\Schema::class,
|
||||
'Session' => Illuminate\Support\Facades\Session::class,
|
||||
'Storage' => Illuminate\Support\Facades\Storage::class,
|
||||
'Str' => Illuminate\Support\Str::class,
|
||||
'URL' => Illuminate\Support\Facades\URL::class,
|
||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
|
||||
],
|
||||
|
||||
];
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Defaults
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default authentication "guard" and password
|
||||
| reset options for your application. You may change these defaults
|
||||
| as required, but they're a perfect start for most applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'defaults' => [
|
||||
'guard' => 'web',
|
||||
'passwords' => 'users',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Guards
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, you may define every authentication guard for your application.
|
||||
| Of course, a great default configuration has been defined for you
|
||||
| here which uses session storage and the Eloquent user provider.
|
||||
|
|
||||
| All authentication drivers have a user provider. This defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| mechanisms used by this application to persist your user's data.
|
||||
|
|
||||
| Supported: "session"
|
||||
|
|
||||
*/
|
||||
|
||||
'guards' => [
|
||||
'web' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'users',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All authentication drivers have a user provider. This defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| mechanisms used by this application to persist your user's data.
|
||||
|
|
||||
| If you have multiple user tables or models you may configure multiple
|
||||
| sources which represent each model / table. These sources may then
|
||||
| be assigned to any extra authentication guards you have defined.
|
||||
|
|
||||
| Supported: "database", "eloquent"
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
'users' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => App\Models\User::class,
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
// 'driver' => 'database',
|
||||
// 'table' => 'users',
|
||||
// ],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Resetting Passwords
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may specify multiple password reset configurations if you have more
|
||||
| than one user table or model in the application and you want to have
|
||||
| separate password reset settings based on the specific user types.
|
||||
|
|
||||
| The expire time is the number of minutes that the reset token should be
|
||||
| considered valid. This security feature keeps tokens short-lived so
|
||||
| they have less time to be guessed. You may change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'passwords' => [
|
||||
'users' => [
|
||||
'provider' => 'users',
|
||||
'table' => 'password_resets',
|
||||
'expire' => 60,
|
||||
'throttle' => 60,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Confirmation Timeout
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define the amount of seconds before a password confirmation
|
||||
| times out and the user is prompted to re-enter their password via the
|
||||
| confirmation screen. By default, the timeout lasts for three hours.
|
||||
|
|
||||
*/
|
||||
|
||||
'password_timeout' => 10800,
|
||||
|
||||
];
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Broadcaster
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default broadcaster that will be used by the
|
||||
| framework when an event needs to be broadcast. You may set this to
|
||||
| any of the connections defined in the "connections" array below.
|
||||
|
|
||||
| Supported: "pusher", "ably", "redis", "log", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('BROADCAST_DRIVER', 'null'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Broadcast Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the broadcast connections that will be used
|
||||
| to broadcast events to other systems or over websockets. Samples of
|
||||
| each available type of connection are provided inside this array.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'pusher' => [
|
||||
'driver' => 'pusher',
|
||||
'key' => env('PUSHER_APP_KEY'),
|
||||
'secret' => env('PUSHER_APP_SECRET'),
|
||||
'app_id' => env('PUSHER_APP_ID'),
|
||||
'options' => [
|
||||
'cluster' => env('PUSHER_APP_CLUSTER'),
|
||||
'useTLS' => true,
|
||||
],
|
||||
],
|
||||
|
||||
'ably' => [
|
||||
'driver' => 'ably',
|
||||
'key' => env('ABLY_KEY'),
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
],
|
||||
|
||||
'log' => [
|
||||
'driver' => 'log',
|
||||
],
|
||||
|
||||
'null' => [
|
||||
'driver' => 'null',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache connection that gets used while
|
||||
| using this caching library. This connection is used when another is
|
||||
| not explicitly specified when executing a given caching function.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('CACHE_DRIVER', 'file'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Stores
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the cache "stores" for your application as
|
||||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
| Supported drivers: "apc", "array", "database", "file",
|
||||
| "memcached", "redis", "dynamodb", "octane", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'stores' => [
|
||||
|
||||
'apc' => [
|
||||
'driver' => 'apc',
|
||||
],
|
||||
|
||||
'array' => [
|
||||
'driver' => 'array',
|
||||
'serialize' => false,
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'cache',
|
||||
'connection' => null,
|
||||
'lock_connection' => null,
|
||||
],
|
||||
|
||||
'file' => [
|
||||
'driver' => 'file',
|
||||
'path' => storage_path('framework/cache/data'),
|
||||
],
|
||||
|
||||
'memcached' => [
|
||||
'driver' => 'memcached',
|
||||
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
||||
'sasl' => [
|
||||
env('MEMCACHED_USERNAME'),
|
||||
env('MEMCACHED_PASSWORD'),
|
||||
],
|
||||
'options' => [
|
||||
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
||||
],
|
||||
'servers' => [
|
||||
[
|
||||
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
||||
'port' => env('MEMCACHED_PORT', 11211),
|
||||
'weight' => 100,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'cache',
|
||||
'lock_connection' => 'default',
|
||||
],
|
||||
|
||||
'dynamodb' => [
|
||||
'driver' => 'dynamodb',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
|
||||
'endpoint' => env('DYNAMODB_ENDPOINT'),
|
||||
],
|
||||
|
||||
'octane' => [
|
||||
'driver' => 'octane',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing a RAM based store such as APC or Memcached, there might
|
||||
| be other applications utilizing the same cache. So, we'll specify a
|
||||
| value to get prefixed to all our keys so we can avoid collisions.
|
||||
|
|
||||
*/
|
||||
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
|
||||
|
||||
];
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
return [
|
||||
'upload_path' => "uploadFiles/",
|
||||
'upload_path_kontrak' => "uploadFiles/kontrak/",
|
||||
'upload_path_sts' => "uploadFiles/sts/",
|
||||
'upload_path_laporan' => "uploadFiles/laporan/",
|
||||
'download_path' => "downloadFiles/",
|
||||
'options' => [
|
||||
'option_attachment' => '13',
|
||||
'option_email' => '14',
|
||||
'option_monetery' => '15',
|
||||
'option_ratings' => '16',
|
||||
'option_textarea' => '17',
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cross-Origin Resource Sharing (CORS) Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure your settings for cross-origin resource sharing
|
||||
| or "CORS". This determines what cross-origin operations may execute
|
||||
| in web browsers. You are free to adjust these settings as needed.
|
||||
|
|
||||
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
||||
|
|
||||
*/
|
||||
|
||||
'paths' => ['api/*', 'sanctum/csrf-cookie'],
|
||||
|
||||
'allowed_methods' => ['*'],
|
||||
|
||||
'allowed_origins' => ['*'],
|
||||
|
||||
'allowed_origins_patterns' => [],
|
||||
|
||||
'allowed_headers' => ['*'],
|
||||
|
||||
'exposed_headers' => [],
|
||||
|
||||
'max_age' => 0,
|
||||
|
||||
'supports_credentials' => false,
|
||||
|
||||
];
|
||||
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('DB_CONNECTION', 'Samasa'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||
'prefix' => '',
|
||||
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
||||
],
|
||||
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '5432'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'schema' => 'public',
|
||||
'sslmode' => 'prefer',
|
||||
],
|
||||
|
||||
'sqlsrv' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', '1433'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
],
|
||||
|
||||
'Samasa' => [
|
||||
'driver' => 'oracle',
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', '1521'),
|
||||
'database' => env('DB_DATABASE', 'xe'),
|
||||
'service_name' => env('DB_SERVICENAME', 'xe'),
|
||||
'username' => env('DB_USERNAME', 'hr'),
|
||||
'password' => env('DB_PASSWORD', 'hr'),
|
||||
'charset' => '',
|
||||
'prefix' => '',
|
||||
],
|
||||
|
||||
'oracle' => [
|
||||
'driver' => 'oracle',
|
||||
'host' => env('ORA_HOST', 'localhost'),
|
||||
'port' => env('ORA_PORT', '1521'),
|
||||
'database' => env('ORA_DATABASE', 'xe'),
|
||||
'service_name' => env('ORA_SERVICENAME', 'xe'),
|
||||
'username' => env('ORA_USERNAME', 'hr'),
|
||||
'password' => env('ORA_PASSWORD', 'hr'),
|
||||
'charset' => '',
|
||||
'prefix' => '',
|
||||
],
|
||||
|
||||
'oracle2' => [
|
||||
'driver' => 'oracle',
|
||||
'host' => env('ORA_HOST_2', 'localhost'),
|
||||
'port' => env('ORA_PORT_2', '1521'),
|
||||
'database' => env('ORA_DATABASE_2', 'xe'),
|
||||
'service_name' => env('ORA_SERVICENAME_2', 'xe'),
|
||||
'username' => env('ORA_USERNAME_2', 'hr'),
|
||||
'password' => env('ORA_PASSWORD_2', 'hr'),
|
||||
'charset' => '',
|
||||
'prefix' => '',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk haven't actually been run in the database.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer body of commands than a typical key-value system
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => [
|
||||
|
||||
'client' => env('REDIS_CLIENT', 'phpredis'),
|
||||
|
||||
'options' => [
|
||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||
],
|
||||
|
||||
'default' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'password' => env('REDIS_PASSWORD', null),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_DB', '0'),
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'password' => env('REDIS_PASSWORD', null),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_CACHE_DB', '1'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
|
||||
use Maatwebsite\Excel\Excel;
|
||||
|
||||
return [
|
||||
'exports' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Chunk size
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using FromQuery, the query is automatically chunked.
|
||||
| Here you can specify how big the chunk should be.
|
||||
|
|
||||
*/
|
||||
'chunk_size' => 1000,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Pre-calculate formulas during export
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'pre_calculate_formulas' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable strict null comparison
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When enabling strict null comparison empty cells ('') will
|
||||
| be added to the sheet.
|
||||
*/
|
||||
'strict_null_comparison' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSV Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. delimiter, enclosure and line ending for CSV exports.
|
||||
|
|
||||
*/
|
||||
'csv' => [
|
||||
'delimiter' => ',',
|
||||
'enclosure' => '"',
|
||||
'line_ending' => PHP_EOL,
|
||||
'use_bom' => false,
|
||||
'include_separator_line' => false,
|
||||
'excel_compatibility' => false,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Worksheet properties
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. default title, creator, subject,...
|
||||
|
|
||||
*/
|
||||
'properties' => [
|
||||
'creator' => '',
|
||||
'lastModifiedBy' => '',
|
||||
'title' => '',
|
||||
'description' => '',
|
||||
'subject' => '',
|
||||
'keywords' => '',
|
||||
'category' => '',
|
||||
'manager' => '',
|
||||
'company' => '',
|
||||
],
|
||||
],
|
||||
|
||||
'imports' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Read Only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with imports, you might only be interested in the
|
||||
| data that the sheet exists. By default we ignore all styles,
|
||||
| however if you want to do some logic based on style data
|
||||
| you can enable it by setting read_only to false.
|
||||
|
|
||||
*/
|
||||
'read_only' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ignore Empty
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with imports, you might be interested in ignoring
|
||||
| rows that have null values or empty strings. By default rows
|
||||
| containing empty strings or empty values are not ignored but can be
|
||||
| ignored by enabling the setting ignore_empty to true.
|
||||
|
|
||||
*/
|
||||
'ignore_empty' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Heading Row Formatter
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure the heading row formatter.
|
||||
| Available options: none|slug|custom
|
||||
|
|
||||
*/
|
||||
'heading_row' => [
|
||||
'formatter' => 'slug',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSV Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. delimiter, enclosure and line ending for CSV imports.
|
||||
|
|
||||
*/
|
||||
'csv' => [
|
||||
'delimiter' => ',',
|
||||
'enclosure' => '"',
|
||||
'escape_character' => '\\',
|
||||
'contiguous' => false,
|
||||
'input_encoding' => 'UTF-8',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Worksheet properties
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. default title, creator, subject,...
|
||||
|
|
||||
*/
|
||||
'properties' => [
|
||||
'creator' => '',
|
||||
'lastModifiedBy' => '',
|
||||
'title' => '',
|
||||
'description' => '',
|
||||
'subject' => '',
|
||||
'keywords' => '',
|
||||
'category' => '',
|
||||
'manager' => '',
|
||||
'company' => '',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extension detector
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure here which writer/reader type should be used when the package
|
||||
| needs to guess the correct type based on the extension alone.
|
||||
|
|
||||
*/
|
||||
'extension_detector' => [
|
||||
'xlsx' => Excel::XLSX,
|
||||
'xlsm' => Excel::XLSX,
|
||||
'xltx' => Excel::XLSX,
|
||||
'xltm' => Excel::XLSX,
|
||||
'xls' => Excel::XLS,
|
||||
'xlt' => Excel::XLS,
|
||||
'ods' => Excel::ODS,
|
||||
'ots' => Excel::ODS,
|
||||
'slk' => Excel::SLK,
|
||||
'xml' => Excel::XML,
|
||||
'gnumeric' => Excel::GNUMERIC,
|
||||
'htm' => Excel::HTML,
|
||||
'html' => Excel::HTML,
|
||||
'csv' => Excel::CSV,
|
||||
'tsv' => Excel::TSV,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDF Extension
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure here which Pdf driver should be used by default.
|
||||
| Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF
|
||||
|
|
||||
*/
|
||||
'pdf' => Excel::DOMPDF,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Value Binder
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| PhpSpreadsheet offers a way to hook into the process of a value being
|
||||
| written to a cell. In there some assumptions are made on how the
|
||||
| value should be formatted. If you want to change those defaults,
|
||||
| you can implement your own default value binder.
|
||||
|
|
||||
| Possible value binders:
|
||||
|
|
||||
| [x] Maatwebsite\Excel\DefaultValueBinder::class
|
||||
| [x] PhpOffice\PhpSpreadsheet\Cell\StringValueBinder::class
|
||||
| [x] PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder::class
|
||||
|
|
||||
*/
|
||||
'value_binder' => [
|
||||
'default' => Maatwebsite\Excel\DefaultValueBinder::class,
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default cell caching driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default PhpSpreadsheet keeps all cell values in memory, however when
|
||||
| dealing with large files, this might result into memory issues. If you
|
||||
| want to mitigate that, you can configure a cell caching driver here.
|
||||
| When using the illuminate driver, it will store each value in a the
|
||||
| cache store. This can slow down the process, because it needs to
|
||||
| store each value. You can use the "batch" store if you want to
|
||||
| only persist to the store when the memory limit is reached.
|
||||
|
|
||||
| Drivers: memory|illuminate|batch
|
||||
|
|
||||
*/
|
||||
'driver' => 'memory',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Batch memory caching
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with the "batch" caching driver, it will only
|
||||
| persist to the store when the memory limit is reached.
|
||||
| Here you can tweak the memory limit to your liking.
|
||||
|
|
||||
*/
|
||||
'batch' => [
|
||||
'memory_limit' => 60000,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Illuminate cache
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "illuminate" caching driver, it will automatically use
|
||||
| your default cache store. However if you prefer to have the cell
|
||||
| cache on a separate store, you can configure the store name here.
|
||||
| You can use any store defined in your cache config. When leaving
|
||||
| at "null" it will use the default store.
|
||||
|
|
||||
*/
|
||||
'illuminate' => [
|
||||
'store' => null,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Transaction Handler
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default the import is wrapped in a transaction. This is useful
|
||||
| for when an import may fail and you want to retry it. With the
|
||||
| transactions, the previous import gets rolled-back.
|
||||
|
|
||||
| You can disable the transaction handler by setting this to null.
|
||||
| Or you can choose a custom made transaction handler here.
|
||||
|
|
||||
| Supported handlers: null|db
|
||||
|
|
||||
*/
|
||||
'transactions' => [
|
||||
'handler' => 'db',
|
||||
],
|
||||
|
||||
'temporary_files' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Local Temporary Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When exporting and importing files, we use a temporary file, before
|
||||
| storing reading or downloading. Here you can customize that path.
|
||||
|
|
||||
*/
|
||||
'local_path' => storage_path('framework/cache/laravel-excel'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Remote Temporary Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with a multi server setup with queues in which you
|
||||
| cannot rely on having a shared local temporary path, you might
|
||||
| want to store the temporary file on a shared disk. During the
|
||||
| queue executing, we'll retrieve the temporary file from that
|
||||
| location instead. When left to null, it will always use
|
||||
| the local path. This setting only has effect when using
|
||||
| in conjunction with queued imports and exports.
|
||||
|
|
||||
*/
|
||||
'remote_disk' => null,
|
||||
'remote_prefix' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Force Resync
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with a multi server setup as above, it's possible
|
||||
| for the clean up that occurs after entire queue has been run to only
|
||||
| cleanup the server that the last AfterImportJob runs on. The rest of the server
|
||||
| would still have the local temporary file stored on it. In this case your
|
||||
| local storage limits can be exceeded and future imports won't be processed.
|
||||
| To mitigate this you can set this config value to be true, so that after every
|
||||
| queued chunk is processed the local temporary file is deleted on the server that
|
||||
| processed it.
|
||||
|
|
||||
*/
|
||||
'force_resync_remote' => null,
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Filesystem Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default filesystem disk that should be used
|
||||
| by the framework. The "local" disk, as well as a variety of cloud
|
||||
| based disks are available to your application. Just store away!
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('FILESYSTEM_DRIVER', 'local'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filesystem Disks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure as many filesystem "disks" as you wish, and you
|
||||
| may even configure multiple disks of the same driver. Defaults have
|
||||
| been setup for each driver as an example of the required options.
|
||||
|
|
||||
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
||||
|
|
||||
*/
|
||||
|
||||
'disks' => [
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app'),
|
||||
],
|
||||
|
||||
'public' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/public'),
|
||||
'url' => env('APP_URL').'/storage',
|
||||
'visibility' => 'public',
|
||||
],
|
||||
|
||||
's3' => [
|
||||
'driver' => 's3',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION'),
|
||||
'bucket' => env('AWS_BUCKET'),
|
||||
'url' => env('AWS_URL'),
|
||||
'endpoint' => env('AWS_ENDPOINT'),
|
||||
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Symbolic Links
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the symbolic links that will be created when the
|
||||
| `storage:link` Artisan command is executed. The array keys should be
|
||||
| the locations of the links and the values should be their targets.
|
||||
|
|
||||
*/
|
||||
|
||||
'links' => [
|
||||
public_path('storage') => storage_path('app/public'),
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Hash Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default hash driver that will be used to hash
|
||||
| passwords for your application. By default, the bcrypt algorithm is
|
||||
| used; however, you remain free to modify this option if you wish.
|
||||
|
|
||||
| Supported: "bcrypt", "argon", "argon2id"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'bcrypt',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bcrypt Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Bcrypt algorithm. This will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'bcrypt' => [
|
||||
'rounds' => env('BCRYPT_ROUNDS', 10),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Argon Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Argon algorithm. These will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'argon' => [
|
||||
'memory' => 1024,
|
||||
'threads' => 2,
|
||||
'time' => 2,
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
use Monolog\Handler\NullHandler;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Handler\SyslogUdpHandler;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option defines the default log channel that gets used when writing
|
||||
| messages to the logs. The name specified in this option should match
|
||||
| one of the channels defined in the "channels" configuration array.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'stack'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Log Channels
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the log channels for your application. Out of
|
||||
| the box, Laravel uses the Monolog PHP logging library. This gives
|
||||
| you a variety of powerful log handlers / formatters to utilize.
|
||||
|
|
||||
| Available Drivers: "single", "daily", "slack", "syslog",
|
||||
| "errorlog", "monolog",
|
||||
| "custom", "stack"
|
||||
|
|
||||
*/
|
||||
|
||||
'channels' => [
|
||||
'stack' => [
|
||||
'driver' => 'stack',
|
||||
'channels' => ['single'],
|
||||
'ignore_exceptions' => false,
|
||||
],
|
||||
|
||||
'single' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
],
|
||||
|
||||
'daily' => [
|
||||
'driver' => 'daily',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'days' => 14,
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'driver' => 'slack',
|
||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||
'username' => 'Laravel Log',
|
||||
'emoji' => ':boom:',
|
||||
'level' => env('LOG_LEVEL', 'critical'),
|
||||
],
|
||||
|
||||
'papertrail' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => SyslogUdpHandler::class,
|
||||
'handler_with' => [
|
||||
'host' => env('PAPERTRAIL_URL'),
|
||||
'port' => env('PAPERTRAIL_PORT'),
|
||||
],
|
||||
],
|
||||
|
||||
'stderr' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => StreamHandler::class,
|
||||
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||
'with' => [
|
||||
'stream' => 'php://stderr',
|
||||
],
|
||||
],
|
||||
|
||||
'syslog' => [
|
||||
'driver' => 'syslog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
],
|
||||
|
||||
'errorlog' => [
|
||||
'driver' => 'errorlog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
],
|
||||
|
||||
'null' => [
|
||||
'driver' => 'monolog',
|
||||
'handler' => NullHandler::class,
|
||||
],
|
||||
|
||||
'emergency' => [
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user