Compare commits

..
1 Commits
Author SHA1 Message Date
gitea 6b0ee8ee4b test 2026-09-05 20:45:26 +07:00
9377 changed files with 1 additions and 2014611 deletions
-18
View File
@@ -1,18 +0,0 @@
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
-76
View File
@@ -1,76 +0,0 @@
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}"
-5
View File
@@ -1,5 +0,0 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
-51
View File
@@ -1,51 +0,0 @@
name: CI/CD Pipeline to Rancher - SIDATA
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
# Login ke Registry Gitea Lokal
- name: Log in to Gitea Container Registry
uses: docker/login-action@v2
with:
registry: 10.15.39.187:3000
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
# Build & Push Image Aplikasi SIDATA ke Registry
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
10.15.39.187:3000/${{ secrets.REGISTRY_USER }}/sidata:latest
10.15.39.187:3000/${{ secrets.REGISTRY_USER }}/sidata:${{ gitea.sha }}
# Deploy & Update Workload di Cluster Local Rancher BPKD
- name: Deploy to Rancher Cluster
run: |
# Download binary kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
# Set Kubeconfig menggunakan API Rancher BPKD
./kubectl config set-cluster rancher-cluster --server=${{ secrets.RANCHER_URL }}/k8s/clusters/${{ secrets.RANCHER_CLUSTER_ID }} --insecure-skip-tls-verify=true
./kubectl config set-credentials rancher-user --token=${{ secrets.RANCHER_TOKEN }}
./kubectl config set-context rancher-context --cluster=rancher-cluster --user=rancher-user
./kubectl config use-context rancher-context
# Update Container Image untuk Workload sidata
# Sesuaikan 'sidata-deployment', 'sidata-container', dan namespace jika berbeda di Rancher
./kubectl set image deployment/sidata-deployment sidata-container=10.15.39.187:3000/${{ secrets.REGISTRY_USER }}/sidata:${{ gitea.sha }} -n sidataprod
# Pantau Status Rollout hingga Sukses
./kubectl rollout status deployment/sidata-deployment -n sidataprod
-16
View File
@@ -1,16 +0,0 @@
/node_modules
/public/hot
/public/storage
/public/uploadFiles
/public/downloadFiles
/storage/*.key
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode
-16
View File
@@ -1,16 +0,0 @@
/node_modules
/public/hot
/public/storage
/public/uploadFiles
/public/downloadFiles
/storage/*.key
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode
-151
View File
@@ -1,151 +0,0 @@
stages:
- build
- deploy
variables:
GIT_STRATEGY: none
IMAGE: 10.15.39.186:8083/eosbpkd/sidata
TAG: $CI_COMMIT_SHORT_SHA
KUBE_NAMESPACE: sidata-prod
HELM_RELEASE: sidata
BUILDAH_ISOLATION: "chroot"
STORAGE_DRIVER: "vfs"
http_proxy: "http://10.15.3.20:80"
https_proxy: "http://10.15.3.20:80"
HTTP_PROXY: "http://10.15.3.20:80"
HTTPS_PROXY: "http://10.15.3.20:80"
no_proxy: "127.0.0.1,localhost,10.15.39.168,10.15.39.186,10.15.39.0/24,10.42.0.0/16,10.43.0.0/16,.jakarta.go.id"
NO_PROXY: "127.0.0.1,localhost,10.15.39.168,10.15.39.186,10.15.39.0/24,10.42.0.0/16,10.43.0.0/16,.jakarta.go.id"
# =========================================================
# BUILD IMAGE VIA BUILDAH
# =========================================================
build:
stage: build
image: 10.15.39.186:8083/buildah:stable
tags:
- skpp
before_script:
- echo '0. FETCHING CODE MANUALLY VIA HTTP WITH CI_JOB_TOKEN'
- git config --global http.sslVerify false
- git clone http://gitlab-ci-token:${CI_JOB_TOKEN}@10.15.39.187/izuddin/sidata.git . || git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.dashboard-bpkd.drc-bpkd.data-center.id/izuddin/sidata.git .
- git checkout $CI_COMMIT_SHA
script:
- echo '1. MENERAPKAN PENGATURAN REGISTRY'
- mkdir -p ~/.config/containers
- |
cat <<EOF > ~/.config/containers/registries.conf
unqualified-search-registries = ["docker.io", "10.15.39.186:8084"]
[[registry]]
location = "10.15.39.186:8083"
insecure = true
[[registry]]
location = "10.15.39.186:8084"
insecure = true
[[registry]]
location = "docker.io"
insecure = false
EOF
- echo '2. LOGIN TO NEXUS REGISTRY'
- echo "$NEXUS_PASSWORD" | buildah login --tls-verify=false -u "$NEXUS_USERNAME" --password-stdin 10.15.39.186:8083
- echo '3. STARTING BUILDAH BUILD'
- buildah bud --tls-verify=false --storage-driver=vfs --isolation=chroot --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy -t $IMAGE:$TAG -t $IMAGE:latest .
- echo '4. PUSHING TO NEXUS'
- buildah push --tls-verify=false --storage-driver=vfs $IMAGE:$TAG
- buildah push --tls-verify=false --storage-driver=vfs $IMAGE:latest
# =========================================================
# DEPLOY VIA HELM & KUBECTL
# =========================================================
deploy:
stage: deploy
image:
name: alpine/k8s:1.29.1
entrypoint: [""]
tags:
- skpp
before_script:
- echo '0. FETCHING CODE MANUALLY VIA HTTP WITH CI_JOB_TOKEN'
- git config --global http.sslVerify false
- git clone http://gitlab-ci-token:${CI_JOB_TOKEN}@10.15.39.187/izuddin/sidata.git . || git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.dashboard-bpkd.drc-bpkd.data-center.id/izuddin/sidata.git .
- git checkout $CI_COMMIT_SHA
script:
- echo '1. SETUP KUBECONFIG LOKAL & BYPASS PROXY'
- unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
- export NO_PROXY="*"
- export no_proxy="*"
- mkdir -p ./kubeconfig-dir
- echo "$KUBECONFIG_B64" | base64 -d > ./kubeconfig-dir/config
- sed -i 's|127.0.0.1|10.15.39.168|g' ./kubeconfig-dir/config
- chmod 600 ./kubeconfig-dir/config
- export KUBECONFIG=$(pwd)/kubeconfig-dir/config
- echo '2. TEST CONNECTION TO RKE2'
- kubectl version --client --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true
- kubectl get nodes --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true
- kubectl create namespace $KUBE_NAMESPACE --dry-run=client -o yaml | kubectl apply -f - --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true
- echo '3. VALIDASI TEMPLATE HELM (DEBUG)'
- helm template $HELM_RELEASE ./helm/sidata --namespace $KUBE_NAMESPACE --debug
- echo '3.5. CLEAN UNMANAGED SERVICE JIKA BENTROK'
- kubectl delete service sidata-service -n $KUBE_NAMESPACE --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true || true
- echo '4. DEPLOYING APPS VIA HELM'
- |
helm upgrade --install $HELM_RELEASE ./helm/sidata \
--kube-apiserver https://10.15.39.168:6443 \
--kube-insecure-skip-tls-verify \
--namespace $KUBE_NAMESPACE \
--force \
--set image.repository=$IMAGE \
--set image.tag=$TAG \
--set-string podAnnotations.rolloutTimestamp="$(date +%s)" \
--set service.type=NodePort \
--set service.nodePort=32185 \
--set service.name=sidata-service \
--set-string extraEnv.APP_ENV="production" \
--set-string extraEnv.APP_DEBUG="false" \
--set-string extraEnv.FORCE_HTTPS="true" \
--set-string extraEnv.APP_KEY="base64:HiyJqrnWz8zB6WUCXTVb6lZsC3EraX/vFIn66Hx/dVM=" \
--set-string extraEnv.APP_URL="https://sidata.dashboard-bpkd.drc-bpkd.data-center.id" \
--set-string extraEnv.ASSET_URL="https://sidata.dashboard-bpkd.drc-bpkd.data-center.id" \
--set-string extraEnv.SESSION_DRIVER="file" \
--set-string extraEnv.SESSION_SECURE_COOKIE="true"
- echo '5. CHECK REAL NODEPORT STATUS'
- kubectl get svc -n $KUBE_NAMESPACE --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true
- echo '6. CHECK STATUS ROLLOUT'
- kubectl rollout status deployment/$HELM_RELEASE -n $KUBE_NAMESPACE --timeout=180s --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true || kubectl rollout status deployment/$HELM_RELEASE-sidata -n $KUBE_NAMESPACE --timeout=180s --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true
- echo '7. AUTO CLEAR LARAVEL CACHE ON POD'
- |
sleep 5
POD_NAME=$(kubectl get pods -n $KUBE_NAMESPACE -l app=$HELM_RELEASE --field-selector=status.phase=Running --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true)
if [ -z "$POD_NAME" ]; then
POD_NAME=$(kubectl get pods -n $KUBE_NAMESPACE -l app.kubernetes.io/instance=$HELM_RELEASE --field-selector=status.phase=Running --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true)
fi
if [ -n "$POD_NAME" ]; then
echo "Executing Artisan Clear Cache on Pod: $POD_NAME"
kubectl exec -n $KUBE_NAMESPACE $POD_NAME --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -- php artisan config:clear || true
kubectl exec -n $KUBE_NAMESPACE $POD_NAME --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -- php artisan route:clear || true
kubectl exec -n $KUBE_NAMESPACE $POD_NAME --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -- php artisan cache:clear || true
kubectl exec -n $KUBE_NAMESPACE $POD_NAME --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -- php artisan view:clear || true
kubectl exec -n $KUBE_NAMESPACE $POD_NAME --server=https://10.15.39.168:6443 --insecure-skip-tls-verify=true -- php artisan view:cache || true
else
echo "Warning: No running pod found for Artisan commands execution, skipping."
fi
after_script:
- echo "Cleaning up sensitive temporary files..."
- rm -rf ./kubeconfig-dir
-45
View File
@@ -1,45 +0,0 @@
stages:
- build
- deploy
variables:
NEXUS_PUSH_REGISTRY: "10.15.39.186:8082"
IMAGE_NAME: "eosbpkd/sidata"
build_image:
stage: build
image:
name: 10.15.39.186:8082/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- mkdir -p /kaniko/.docker
- AUTH=$(echo -n "$NEXUS_USERNAME:$NEXUS_PASSWORD" | base64 | tr -d '\n')
- echo "{\"auths\":{\"http://$NEXUS_PUSH_REGISTRY\":{\"auth\":\"$AUTH\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--destination $NEXUS_PUSH_REGISTRY/$IMAGE_NAME:$CI_COMMIT_SHA
--destination $NEXUS_PUSH_REGISTRY/$IMAGE_NAME:latest
--insecure
--skip-tls-verify
only:
- main
- master
- fix/sidata-path
deploy_rancher:
stage: deploy
image: 10.15.39.186:8082/library/alpine/helm:3.12.0
script:
- mkdir -p ~/.kube
- echo "$KUBECONFIG_B64" | base64 -d > ~/.kube/config
- chmod 600 ~/.kube/config
- helm upgrade --install sidata ./helm/sidata
--namespace sidata-prod
--set image.repository=$NEXUS_PUSH_REGISTRY/$IMAGE_NAME
--set image.tag=$CI_COMMIT_SHA
only:
- main
- master
- fix/sidata-path
-3
View File
@@ -1,3 +0,0 @@
[submodule "public/gentelella"]
path = public/gentelella
url = https://github.com/ColorlibHQ/gentelella.git
-14
View File
@@ -1,14 +0,0 @@
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
-81
View File
@@ -1,81 +0,0 @@
FROM 10.15.39.186:8083/php74-fpm-oci8-lengkap:1.0
ARG http_proxy
ARG https_proxy
ENV http_proxy=${http_proxy}
ENV https_proxy=${https_proxy}
ENV HTTP_PROXY=${http_proxy}
ENV HTTPS_PROXY=${https_proxy}
# =========================================================
# System dependencies & Extensions
# =========================================================
RUN echo "deb [trusted=yes] http://10.15.39.186:8081/repository/debian-proxy/ bullseye main" > /etc/apt/sources.list \
&& echo "deb [trusted=yes] http://10.15.39.186:8081/repository/debian-proxy/ bullseye-updates main" >> /etc/apt/sources.list \
&& rm -rf /etc/apt/sources.list.d/* \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
nginx \
redis-server \
procps \
vim \
wget \
curl \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libaio1 \
libaio-dev \
unzip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo pdo_mysql zip \
&& curl --noproxy "*" -fsSL http://10.15.39.186:8081/repository/raw-assets/storage/app/uploads/redis-5.3.7.tgz -o redis.tgz \
&& pecl install redis.tgz \
&& docker-php-ext-enable redis \
&& rm -f redis.tgz \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/html
# Salin source code aplikasi
COPY . /var/www/html
# Buat file .env dari .env.example jika .env belum ada di repositori
RUN if [ ! -f .env ]; then \
if [ -f .env.example ]; then \
cp .env.example .env; \
else \
echo "APP_NAME=Sidata\nAPP_ENV=production\nAPP_KEY=\nAPP_DEBUG=true\nAPP_URL=https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" > .env; \
fi \
fi
# Atur hak akses folder web, storage, dan cache Laravel
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 775 /var/www/html/storage \
&& chmod -R 775 /var/www/html/bootstrap/cache
# Konfigurasi Nginx Standar Laravel (Merespons di Root /)
RUN echo 'server { \
listen 80; \
index index.php index.html; \
root /var/www/html/public; \
\
location / { \
try_files $uri $uri/ /index.php?$query_string; \
} \
\
location ~ \.php$ { \
fastcgi_pass 127.0.0.1:9000; \
fastcgi_index index.php; \
include fastcgi_params; \
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; \
} \
}' > /etc/nginx/sites-available/default
EXPOSE 80
# Script startup: Buat .env dari variabel environment Helm, lalu jalankan service
CMD ["sh", "-c", "env | grep -E '^(APP_|DB_|MYSQL_|ORA_|REDIS_|MAIL_|SESSION_|SOA_)' > /var/www/html/.env && redis-server --daemonize yes && php-fpm -D && exec nginx -g 'daemon off;'"]
-151
View File
@@ -1,151 +0,0 @@
# =========================================================
# APPLICATION STAGE
# Laravel + PHP 7.4 + OCI8 + Nginx
# =========================================================
FROM 10.15.39.186:8083/php74-fpm-oci8-lengkap:1.0
# =========================================================
# Proxy
# =========================================================
ARG http_proxy
ARG https_proxy
ENV http_proxy=${http_proxy}
ENV https_proxy=${https_proxy}
ENV HTTP_PROXY=${http_proxy}
ENV HTTPS_PROXY=${https_proxy}
# =========================================================
# System dependencies & Extensions
# =========================================================
RUN echo "deb [trusted=yes] http://10.15.39.186:8081/repository/debian-proxy/ bullseye main" > /etc/apt/sources.list \
&& echo "deb [trusted=yes] http://10.15.39.186:8081/repository/debian-proxy/ bullseye-updates main" >> /etc/apt/sources.list \
&& rm -rf /etc/apt/sources.list.d/* \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
nginx \
vim \
wget \
curl \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
libaio1 \
libaio-dev \
unzip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo pdo_mysql zip \
&& curl --noproxy "*" -fsSL http://10.15.39.186:8081/repository/raw-assets/storage/app/uploads/redis-5.3.7.tgz -o redis.tgz \
&& pecl install redis.tgz \
&& docker-php-ext-enable redis \
&& rm -f redis.tgz \
&& rm -rf /var/lib/apt/lists/*
# =========================================================
# PEAR Proxy (jika diperlukan)
# =========================================================
RUN pear config-set http_proxy "http://10.15.3.20:80" || true
# =========================================================
# Composer setup & Caching Layer
# =========================================================
WORKDIR /var/www
# Copy composer files terlebih dahulu agar Docker Caching layer aktif
COPY composer.json composer.lock ./
RUN composer install \
--no-dev \
--prefer-dist \
--no-interaction \
--no-scripts \
--optimize-autoloader
# Copy seluruh source code project
COPY --chown=www-data:www-data . .
# =========================================================
# Laravel directories & permission
# =========================================================
RUN mkdir -p \
/var/www/storage/framework/sessions \
/var/www/storage/framework/views \
/var/www/storage/framework/cache \
/var/www/storage/logs \
/var/www/bootstrap/cache \
&& touch /var/www/storage/logs/laravel.log \
&& chown -R www-data:www-data /var/www \
&& chmod -R 775 /var/www/storage \
&& chmod -R 775 /var/www/bootstrap/cache
# =========================================================
# Laravel cache cleanup
# =========================================================
RUN php artisan config:clear || true \
&& php artisan cache:clear || true \
&& php artisan view:clear || true
# =========================================================
# Nginx configuration
# =========================================================
RUN rm -f /etc/nginx/sites-enabled/default \
&& rm -f /etc/nginx/sites-available/default
RUN printf '%s\n' \
'server {' \
' listen 80;' \
' server_name _;' \
'' \
' root /var/www/public;' \
' index index.php index.html;' \
'' \
' access_log /var/log/nginx/access.log;' \
' error_log /var/log/nginx/error.log;' \
'' \
' location / {' \
' try_files $uri $uri/ /index.php?$query_string;' \
' }' \
'' \
' location ~ \.php$ {' \
' try_files $uri =404;' \
' include fastcgi_params;' \
' fastcgi_pass 127.0.0.1:9000;' \
' fastcgi_index index.php;' \
' fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' \
' fastcgi_param PATH_INFO $fastcgi_path_info;' \
' }' \
'' \
' location ~ /\.ht {' \
' deny all;' \
' }' \
'}' \
> /etc/nginx/sites-available/default
RUN ln -sf /etc/nginx/sites-available/default \
/etc/nginx/sites-enabled/default
# =========================================================
# Clear Proxy Environment Variables from Runtime
# =========================================================
ENV http_proxy=""
ENV https_proxy=""
ENV HTTP_PROXY=""
ENV HTTPS_PROXY=""
# =========================================================
# Execution
# =========================================================
EXPOSE 80
CMD ["sh", "-c", "php-fpm -D && exec nginx -g 'daemon off;'"]
-1
View File
@@ -1 +0,0 @@
# SIDATA Project
-41
View File
@@ -1,41 +0,0 @@
<?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');
}
}
-41
View File
@@ -1,41 +0,0 @@
<?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) {
//
});
}
}
-137
View File
@@ -1,137 +0,0 @@
<?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 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",
];
}
}
-114
View File
@@ -1,114 +0,0 @@
<?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",
];
}
}
@@ -1,127 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Models\MappingDbhSkpd;
use App\Models\Sps_pendapatan;
use App\Models\AkbPendapatan;
use App\Models\VwRekeningPendapatan;
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_rekening' => 'required',
// 'tahun' => 'required',
'kode_rekening' => 'required',
//'txt_id_skpd'=>'required'
]);
$req = $request->all();
MappingDbhSkpd::where("kode_rekening", $req["kode_rekening"])->delete();
if (isset($req["txt_id_skpd"])){
foreach($req["txt_id_skpd"] as $row_req)
{
$data["id_rekening"] = $req["id_rekening"];
// $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 = VwRekeningPendapatan::where("id",$MappingDbhSkpd)->firstorNew();
$mappingSKPD = DB::select(DB::raw("SELECT x.*,y.N_OPD FROM MAPPING_DBH_SKPD x
LEFT JOIN NEWSIPKD.TROPD y ON x.KODE_SKPD = y.C_OPD WHERE x.id_rekening = $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 = VwRekeningPendapatan::select($select);
$sqlstr->whereRaw("TAHUN_BERLAKU<=".getTA()." AND TAHUN_BERAKHIR>=".getTA());
$dataTotal = $sqlstr->count();
$data = $sqlstr->orderBy("KODE_REKENING");
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()
]);
}
}
@@ -1,108 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\MstDauRinci;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
class MstDauRinciController extends Controller
{
public function __construct(){
$this->siteTitle = "Master DAU Rinci";
parent::__construct();
}
public function index()
{
$data = null;
// $data = User::where('role_name', "<>", "superadmin")->latest()->paginate(10);
return view('admin.mst_dau_rinci.index',compact('data'))
->with('i', (request()->input('page', 1) - 1) * 10);
}
public function create()
{
$this->setSubtitle("Tambah Data");
return view('admin.mst_dau_rinci.create');
}
public function store(Request $request)
{
$request->validate([
'name' => 'required',
'grup' => 'required',
'satuan' => 'required',
]);
$req = $request->all();
MstDauRinci::where("name", $req["name"])->delete();
$data["name"] = $req["name"];
$data["grup"] = $req["grup"];
$data["satuan"] = $req["satuan"];
MstDauRinci::create($data);
return redirect("/admin/MstDauRinci")->with('success','Data Perincian DAU berhasil dibuat.');
}
public function show(MstDauRinci $MstDauRinci)
{
$this->setSubtitle("Detail DAU Rinci");
return view('admin.mst_dau_rinci.show',compact('MstDauRinci'));
}
public function edit(MstDauRinci $MstDauRinci)
{
$this->setSubtitle("Ubah Data");
return view('admin.mst_dau_rinci.edit',compact('MstDauRinci'));
}
public function update(Request $request, MstDauRinci $MstDauRinci)
{
$request->validate([
'grup' => 'required',
'name' => 'required',
'satuan' => 'required',
]);
$req = $request->all();
$data["grup"] = $req["grup"];
$data["name"] = $req["name"];
$data["satuan"] = $req["satuan"];
$MstDauRinci->update($req);
return redirect()->route('MstDauRinci.index')
->with('success','Data Perincian DAU berhasil diubah!');
}
public function destroy(MstDauRinci $MstDauRinci)
{
$MstDauRinci->delete();
return redirect()->route('MstDauRinci.index')
->with('success','Data Perincian DAU 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,SATUAN");
$sqlstr = MstDauRinci::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()
]);
}
}
@@ -1,114 +0,0 @@
<?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()
]);
}
}
@@ -1,105 +0,0 @@
<?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("ID","ASC");
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()
]);
}
}
@@ -1,276 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Models\User;
use App\Models\Role;
use App\Models\Pengaturan;
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;
use illuminate\Support\Facades\DB;
use PhpParser\Node\Expr\Exit_;
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);
$pengaturan = Pengaturan::where("id", 1)->first();
return view('admin.mst_pengguna.index', compact('data', 'pengaturan'))
->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"];
// $requestAll["wilayah"] = $requestAll["wilayah"];
$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");
$baseUrl = url('/admin/users');
return view('admin.mst_pengguna.edit', compact('user'));
}
public function update(Request $request, User $user)
{
$request->validate([
'name' => 'required',
'opt_role' => 'required',
// 'wilayah' => 'required',
]);
$requestAll = $request->all();
$requestAll["role_name"] = $requestAll["opt_role"];
$requestAll["wilayah"] = $requestAll["wilayah"];
//$sqlStr = " WHERE tahun_anggaran = " . getTA();
$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 lockTambahData($userId = "", $reset = 0, $check = 0, Request $req)
{
$updateValue = [
"lock_tambah_data" => $reset == 0 ? 1 : 0,
"lock_upload_by" => Auth::user()->id
];
if (empty($userId)) {
if ($check == 2) {
$updateValue = [
"lock_tambah_data" => 0,
];
Pengaturan::where("id", 1)->update(["check_all_tambah" => 0]);
} else {
Pengaturan::where("id", 1)->update(["check_all_tambah" => 1]);
}
User::query()->update($updateValue);
} else {
User::where(["id" => $userId])->update($updateValue);
}
return redirect()->route('users.index')
->with('success', 'Lock Tambah data sudah diubah!');
}
public function lockUbahData($userId = "", $reset = 0, $check = 0, Request $req)
{
$updateValue = [
"lock_ubah_data" => $reset == 0 ? 1 : 0,
"lock_upload_by" => Auth::user()->id
];
if (empty($userId)) {
if ($check == 2) {
$updateValue = [
"lock_ubah_data" => 0,
];
Pengaturan::where("id", 1)->update(["check_all_ubah" => 0]);
} else {
Pengaturan::where("id", 1)->update(["check_all_ubah" => 1]);
}
User::query()->update($updateValue);
} else {
User::where(["id" => $userId])->update($updateValue);
}
return redirect()->route('users.index')
->with('success', 'Lock Ubah data sudah diubah!');
}
public function lockHapusData($userId = "", $reset = 0, $check = 0, Request $req)
{
$updateValue = [
"lock_hapus_data" => $reset == 0 ? 1 : 0,
"lock_upload_by" => Auth::user()->id
];
if (empty($userId)) {
if ($check == 2) {
$updateValue = [
"lock_hapus_data" => 0,
];
Pengaturan::where("id", 1)->update(["check_all_hapus" => 0]);
} else {
Pengaturan::where("id", 1)->update(["check_all_hapus" => 1]);
}
User::query()->update($updateValue);
} else {
User::where(["id" => $userId])->update($updateValue);
}
return redirect()->route('users.index')
->with('success', 'Lock Hapus 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!');
}
}
@@ -1,100 +0,0 @@
<?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()
]);
}
}
@@ -1,107 +0,0 @@
<?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()
]);
}
}
@@ -1,141 +0,0 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Session;
use App\Models\Tropd;
use App\Models\User;
use Hash;
use Illuminate\Support\Facades\DB;
use App\Models\AkbSpb23;
use App\Models\AkbPendapatan;
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::statement(
"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::statement("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!"
]);
}
}
public function adjustAKBPendapatan()
{
try{
DB::beginTransaction();
$dataAKBPendapatan = AkbSpb23::getAkbPendapatan();
foreach($dataAKBPendapatan as $rowAKBPendapatan){
AkbPendapatan::updateOrCreate([
"tahun"=>getTA(),
"skpd_id"=>$rowAKBPendapatan->unitkerja_id,
"kode_rekening"=>$rowAKBPendapatan->rek_kode
],[
"nama_rekening"=>$rowAKBPendapatan->rek_nama,
"pagu"=>$rowAKBPendapatan->nilai,
"bulan1"=>$rowAKBPendapatan->bulan1,
"bulan2"=>$rowAKBPendapatan->bulan2,
"bulan3"=>$rowAKBPendapatan->bulan3,
"bulan4"=>$rowAKBPendapatan->bulan4,
"bulan5"=>$rowAKBPendapatan->bulan5,
"bulan6"=>$rowAKBPendapatan->bulan6,
"bulan7"=>$rowAKBPendapatan->bulan7,
"bulan8"=>$rowAKBPendapatan->bulan8,
"bulan9"=>$rowAKBPendapatan->bulan9,
"bulan10"=>$rowAKBPendapatan->bulan10,
"bulan11"=>$rowAKBPendapatan->bulan11,
"bulan12"=>$rowAKBPendapatan->bulan12
]);
}
DB::commit();
return response()->json([
"success" => true,
"message" => "Data AKB berhasil disesuaikan!"
]);
}catch(Throwable $e){
DB::rollBack();
return response()->json([
"success" => false,
"message" => "Data AKB gagal disesuaikan!"
]);
}
}
public function updateuser()
{
try{
DB::beginTransaction();
$SKPD = Tropd::where("c_tahun_berakhir",">=",getTA())->orderBy('I_ID','ASC')->get();
foreach($SKPD as $rowSKPD){
$user = User::where("nrk",$rowSKPD["c_opd"])->count();
if ($user == 0 ){
// var_dump($rowSKPD["c_opd"]);
// exit;
$user = new User;
$user->name = $rowSKPD["n_opd"];
$user->nrk = $rowSKPD["c_opd"];
$user->password = Hash::make($rowSKPD["c_opd"]);
$user->role_name = "skpd";
$user->save();
$user->assignRole('skpd');
}
}
DB::commit();
return response()->json([
"success" => true,
"message" => "Data User berhasil disesuaikan!"
]);
}catch(Throwable $e){
DB::rollBack();
return response()->json([
"success" => false,
"message" => "Data User gagal disesuaikan!"
]);
}
}
}
@@ -1,74 +0,0 @@
<?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!');
}
}
@@ -1,100 +0,0 @@
<?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")->orderBy("id")->paginate(15);
return view('admin.mst_role.index',compact('data'))
->with('i', (request()->input('page', 1) - 1) * 15);
}
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!');
}
}
-139
View File
@@ -1,139 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Session;
use App\Models\User;
use App\Models\RoleUser;
class AuthController extends Controller
{
public function showFormLogin()
{
if (Auth::check()) {
// Jika sudah login, langsung alihkan ke home
return redirect()->intended(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());
}
$credentials = [
'nrk' => $request->input('nrk'),
'password' => $request->input('password'),
];
if (Auth::attempt($credentials)) {
// Cek jika akun terkunci
if (Auth::user()->status_lock == 1) {
Auth::logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
Session::flash('error', 'Data Terkunci Silahkan Hubungi Admin');
return redirect()->route('login');
}
// Regenerasi session ID untuk keamanan (mencegah Session Fixation)
$request->session()->regenerate();
// Set List Tahun Anggaran ke Session
$taValue = [];
for ($i = 2022; $i <= date("Y"); $i++) {
$taValue[] = $i;
}
Session::put('listTA', $taValue);
// Alihkan ke URL yang dituju atau ke route home bawaan
return redirect()->intended(route('home'));
} else {
// Login Gagal
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);
$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(Request $request)
{
Auth::logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return redirect()->route('login');
}
}
-64
View File
@@ -1,64 +0,0 @@
<?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]);
}
}
@@ -1,217 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Auth;
use Maatwebsite\Excel\Facades\Excel;
use App\Models\DataUploadBosOmspan;
use App\Models\DataBosOmspan;
use App\Models\UploadData;
use App\Imports\ImportDataBos;
use Illuminate\Support\Facades\URL;
class DataBosOmspanController extends Controller
{
public function __construct(){
parent::__construct();
$this->setIconTitle("fa fa-graduation-cap");
}
public function index(Request $request)
{
$method = $request->method();
$this->setTitle("Data BOS Omspan");
$this->setIconTitle("fa fa-graduation-cap");
$this->siteTitle = "Daftar";
return view('data_omspan.index');
}
public function upload(Request $request)
{
$method = $request->method();
$this->setTitle("Data BOS Omspan");
$this->setSubtitle("Upload File");
$this->setIconTitle("fas fa-upload");
if ($request->isMethod('post')) {
$req = $request->all();
try{
$this->validate($request, [
'file' => 'required|mimes:xls,xlsx',
]);
$file = $request->file('file');
$subJenisDana = $request->optJenisDana;
$ta = $request->ta;
$tujuan_upload = 'uploadFiles';
$file->move($tujuan_upload,$file->getClientOriginalName());
DB::beginTransaction();
// DataUploadBosOmspan::truncate();
Excel::import(new ImportDataBos($ta), $tujuan_upload."/".$file->getClientOriginalName());
DB::commit();
return redirect(URL::to("/data-omspan/upload/"))->with('success','Data berhasil diupload, Silahkan validasi data terlebih dahulu!');
}
catch(\Exception $e)
{
// throw new \Exception($e->getMessage());
DB::rollBack();
abort(500, $e->getMessage());
// return redirect(URL::to("/upload-data/".$typeDana))->with('error',$e->getMessage());
}
}
$this->siteTitle = "Upload Data";
return view('data_omspan.upload');
}
public function datatable(Request $request)
{
$post = $request->all();
$offset = $post["start"];
$limit = $post["length"];
$src = isset($post["search"])?$post["search"]["value"]:"";
$dataFilter=0;
$data = DataBosOmspan::orderBy("created_at","ASC");
if (!empty($src)){
$data->whereRaw("(
LOWER(kanwil) LIKE '%".strtolower($src)."%'
OR LOWER(kppn) LIKE '%".strtolower($src)."%'
OR LOWER(lokasi_kewenangan) LIKE '%".strtolower($src)."%'
OR LOWER(jenis_bos) LIKE '%".strtolower($src)."%'
OR LOWER(no_rekening_nama_rekening) LIKE '%".strtolower($src)."%'
OR LOWER(npsn) LIKE '%".strtolower($src)."%'
OR LOWER(no_tgl_sp2d_detail) LIKE '%".strtolower($src)."%'
OR LOWER(status_sekolah) LIKE '%".strtolower($src)."%'
)");
}
$dataFilter = $data->count();
$dataTotal = DataBosOmspan::count();
return response()->json([
"recordsTotal" => $dataTotal,
"recordsFiltered" => $dataFilter,
"data"=> $data->skip($offset)->take($limit)->get()
]);
}
public function uploadDatatable(Request $request)
{
$post = $request->all();
$offset = $post["start"];
$limit = $post["length"];
$src = isset($post["search"])?$post["search"]["value"]:"";
$dataFilter=0;
$data = DataUploadBosOmspan::orderBy("created_at","ASC");
if (!empty($src)){
$data->whereRaw("(
LOWER(kanwil) LIKE '%".strtolower($src)."%'
OR LOWER(kppn) LIKE '%".strtolower($src)."%'
OR LOWER(lokasi_kewenangan) LIKE '%".strtolower($src)."%'
OR LOWER(jenis_bos) LIKE '%".strtolower($src)."%'
OR LOWER(no_rekening_nama_rekening) LIKE '%".strtolower($src)."%'
OR LOWER(npsn) LIKE '%".strtolower($src)."%'
OR LOWER(no_tgl_sp2d_detail) LIKE '%".strtolower($src)."%'
OR LOWER(status_sekolah) LIKE '%".strtolower($src)."%'
)");
}
$dataFilter = $data->count();
$dataTotal = DataUploadBosOmspan::count();
return response()->json([
"recordsTotal" => $dataTotal,
"recordsFiltered" => $dataFilter,
"data"=> $data->skip($offset)->take($limit)->get()
]);
}
public function uploadValidate(Request $request)
{
try{
DB::beginTransaction();
DB::statement("DELETE FROM DATA_BOS_OMSPAN
WHERE EXISTS(
SELECT *
FROM DATA_UPLOAD_BOS_OMSPAN
WHERE (tahun = ".getTA()." AND DATA_BOS_OMSPAN.no_tgl_sp2d_detail = DATA_UPLOAD_BOS_OMSPAN.no_tgl_sp2d_detail)
)");
DB::statement("INSERT INTO DATA_BOS_OMSPAN(
tahun,
kanwil,
kppn,
lokasi_kewenangan,
lokasi_sekolah,
no_tgl_sk,
jenis_bos,
tahap,
gelombang,
npsn_nama_sekolah,
jenis_satuan_pendidikan,
status_sekolah,
bank,
no_rekening_nama_rekening,
npsn,
rekening,
nama,
jenjang_sekolah,
no_tgl_sp2d_detail,
no_sp2d,
tgl_sp2d,
status,
nilai,
pagu,
jmlh_siswa,
ket_retur,
created_at
)
SELECT
tahun,
kanwil,
kppn,
lokasi_kewenangan,
lokasi_sekolah,
no_tgl_sk,
jenis_bos,
tahap,
gelombang,
npsn_nama_sekolah,
jenis_satuan_pendidikan,
status_sekolah,
bank,
no_rekening_nama_rekening,
npsn,
rekening,
nama,
jenjang_sekolah,
no_tgl_sp2d_detail,
no_sp2d,
tgl_sp2d,
status,
nilai,
pagu,
jmlh_siswa,
ket_retur,
CURRENT_TIMESTAMP
FROM DATA_UPLOAD_BOS_OMSPAN");
DataUploadBosOmspan::truncate();
DB::commit();
return redirect(URL::to("/data-omspan/upload"))->with('success','Data Omspan berhasil diupload.');
}catch(\Exception $e){
throw new \Exception($e->getMessage());
DB::rollBack();
return redirect(URL::to("/data-omspan/upload"))->with('error',$e->getMessage());
}
}
}
-71
View File
@@ -1,71 +0,0 @@
<?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
}
}
@@ -1,360 +0,0 @@
<?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\MstDauRinci;
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 App\Models\VwRekeningPendapatan;
use App\Models\MappingDauRinci;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Session;
use App\Models\PendapatanRealisasiSts;
use App\Models\AkunTamsilTpg;
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 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;
} elseif (getRole() == "walikota" || getRole() == "induk skpd") {
$id = Tropd::where("C_OPD", Auth::user()->nrk)->first()["i_id"];
$sqlStr .= " AND x.KODE_SKPD IN (SELECT C_OPD FROM NEWSIPKD.TROPD WHERE I_IDINDUK=" . $id . ")";
}
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") {
$filter = "";
if (isset($jenis)) {
$typeDana = strtoupper($jenis);
$kodeRekening = "'" . implode("','", getKodeRekInduk($typeDana)) . "'";
$filter = " AND SUBSTR(x.KODE_REKENING,1,12) IN ($kodeRekening) ";
}
$sps = DB::select(DB::raw("SELECT x.KODE_REKENING as IDX,x.KODE_REKENING||' | '||z.NAMA_REKENING as name
FROM MAPPING_DBH_SKPD x
LEFT JOIN VW_REKENING_PENDAPATAN z ON x.ID_REKENING = z.ID
WHERE x.kode_skpd='" . Auth::user()->nrk . "' AND (TAHUN_BERLAKU<=" . getTA() . " AND TAHUN_BERAKHIR>=" . getTA() . ") $filter"));
} else {
$select = DB::raw("KODE_REKENING AS IDX,KODE_REKENING||' | '||NAMA_REKENING as name");
$sps = VwRekeningPendapatan::select($select);
$sps->whereRaw("TAHUN_BERLAKU<=" . getTA() . " AND TAHUN_BERAKHIR>=" . getTA());
if (!empty($search)) {
$sps->whereRaw(" (LOWER(KODE_REKENING) LIKE '%$search%' OR LOWER(NAMA_REKENING) LIKE '%$search%') ");
}
if (isset($jenis)) {
$typeDana = strtoupper($jenis);
$kodeRekening = "'" . implode("','", getKodeRekInduk($typeDana)) . "'";
$sps->whereRaw(" SUBSTR(KODE_REKENING,1,12) IN ($kodeRekening)");
}
$sps->orderby("KODE_REKENING");
$sps = $sps->get();
}
return response()->json($sps);
}
public function sts(Request $request)
{
$sts = array();
$no_skprd = $request->no_skprd;
$kode_akun = $request->kode_akun;
//$arrTPG = ['4.2.01.01.04.0004', '4.2.01.01.04.0005', '4.2.01.09.02.0004', '4.2.01.09.02.0005'];
$arrTPG = getAkunTamsilTpg();
if (in_array($kode_akun, $arrTPG)) {
$cek = PendapatanRealisasiSts::where("rkud_no_sts", $no_skprd)
->where("rkud_kode_akun", $kode_akun)
->count();
if ($cek > 0) {
$urlAPIDev = "http://10.15.34.90:8820/api/tpg-tamsil/cek-sp2t";
$userDev = "sidata_tpgtamsil_dev";
$passDev = "sidataAp!TpgT4ms1lD3v";
$urlAPI = "https://simpad.jakarta.go.id/api/tpg-tamsil/cek-sp2t'";
$user = "sidata_tpgtamsil";
$pass = "sidataAp!TpgT4ms1l";
$httpSTS = Http::withHeaders([
'Accept' => 'application/json',
])->withBasicAuth($user, $pass)
->post($urlAPI, [
"no_sp2t" => $no_skprd,
"kode_rekening" => $kode_akun
]);
if (isset($httpSTS["data"])) {
$sts["no_skprd"] = $httpSTS["data"]["no_sp2t"];
$sts["tgl_validasi"] = date("Y-m-d", strtotime($httpSTS["data"]["tanggal_pengesahan"]));
$sts["kode_bas"] = $httpSTS["data"]["kode_rekening"];
$sts["n_akun"] = $httpSTS["data"]["nam_rekening"];
$sts["nilai_bayar"] = separateNumberIndo($httpSTS["data"]["jumlah"]);
}
}
} else {
$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)
->where("SI_ESET_PEMBAYARAN.KODE_BAS", $kode_akun)
->whereRaw("C_TAHUN_BERLAKU<=" . getTA() . " AND C_TAHUN_BERAKHIR>=" . getTA())
->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%' OR C_AKUN LIKE '4.2.01.09%') 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);
}
public function dau_rinci(Request $request)
{
$sk = [];
$select = DB::raw("id, name");
if ($request->has('q')) {
$search = $request->q;
$sk = MstDauRinci::select($select)
->where('name', 'LIKE', "%$search%")
->get();
} else {
$sk = MstDauRinci::select($select)->get();
}
return response()->json($sk);
}
public function dau_rinci_detail(Request $request)
{
// $search = $request->id;
// $sk = MstDauRinci::where('id', $search)->first();
// return response()->json($sk);
$subJenisDana = $request->sub_jenis_dana;
$tahun = Session::get('Tahun_Anggaran');
$kodeSkpd = Auth::user()->kode_skpd;
if (!$subJenisDana || !$tahun || !$kodeSkpd) {
return response()->json([]);
}
$idDauRinciList = MappingDauRinci::where('ID_JENIS_DANA', $subJenisDana)
->where('TAHUN', $tahun)
->where('KODE_SKPD', $kodeSkpd)
->pluck('ID_DAU_RINCI');
$outputs = MstDauRinci::whereIn('id', $idDauRinciList)->get();
return response()->json($outputs);
}
}
@@ -1,331 +0,0 @@
<?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 App\Models\Tropd;
use App\Models\BelanjaRealisasi;
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');
}
*/
protected function filterJadwalSalur($request)
{
$ta = getTA();
$post = $request->all();
$typeDana = isset($post["jenis_dana"]) ? strtoupper($post["jenis_dana"]) : "";
$idSPS = isset($post["id_sps"]) ? $post["id_sps"] : "";
$sqlstr = Sps_pendapatan::queryJadwalSalurDana($ta);
if (!empty($idSPS)) {
$sqlstr .= " AND x.KODE_REKENING='$idSPS'";
}
if (!empty($typeDana)) {
$kodeRekening = "'" . implode("','", getKodeRekInduk($typeDana)) . "'";
$sqlstr .= " AND SUBSTR(x.kode_rekening,1,12) IN ($kodeRekening)";
}
return $sqlstr;
}
protected function filterBelanja($request, $typeDana)
{
$ta = getTA();
$post = $request->all();
$src = isset($post["src"]) ? $post["src"] : "";
$idSPS = isset($post["id_sps"]) ? $post["id_sps"] : "";
$skpd = isset($post["skpd"]) ? $post["skpd"] : "";
$where = "";
if (!empty($typeDana)) {
$where = $typeDana == "cht" ? " AND x.jenis_dana = 'DBH' AND lower(x.NAMA_SUBJENIS_DANA) = 'cht' " : " AND x.jenis_dana = '$typeDana'";
}
$where .= !empty($idSPS) ? " AND x.kode_rekening='$idSPS' " : "";
$sqlstr = 'SELECT x.kode_skpd, x.nama_skpd, x.kode_rsk, x.nama_rsk, x.kode_rekening, x.nama_rekening, x.jumlah_anggaran, y.*
FROM VW_BELANJA_REALISASI x
LEFT JOIN 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 . '\'' . $where;
if (getRole() == "skpd") {
$sqlstr .= " AND KODE_SKPD='" . Auth::user()->nrk . "'";
} elseif (getRole() == "walikota" || getRole() == "induk skpd") {
$id = Tropd::where("C_OPD", Auth::user()->nrk)->first()["i_id"];
$sqlstr .= " AND KODE_SKPD IN (SELECT C_OPD FROM NEWSIPKD.TROPD WHERE I_IDINDUK=" . $id . ")";
} else {
if ($skpd) {
$sqlstr .= " AND KODE_SKPD='$skpd'";
}
}
return $sqlstr;
}
public function datatableSalur(Request $request)
{
$post = $request->all();
$offset = $post["start"];
$limit = $post["length"];
$sqlstr = $this->filterJadwalSalur($request);
$dataTotal = count(DB::select(DB::raw($sqlstr)));
$sqlLimit = $limit > 0 ? " OFFSET " . $offset . " ROWS FETCH NEXT " . $limit . " ROWS ONLY " : "";
$data = DB::select(DB::raw($sqlstr . 'ORDER BY x.kode_rekening ' . $sqlLimit));
$dataFilter = count(DB::select(DB::raw($sqlstr)));
return response()->json([
"recordsTotal" => $dataTotal,
"recordsFiltered" => $dataFilter,
"data" => $data
]);
}
public function index()
{
return view("jadwal_salurdana.index");
}
public function datatableBelanja(Request $request)
{
$post = $request->all();
$offset = $post["start"];
$limit = $post["length"];
$typeDana = $post["jenis_dana"];
$sqlstr = $this->filterBelanja($request, $typeDana);
$sqlLimit = $limit > 0 ? " OFFSET " . $offset . " ROWS FETCH NEXT " . $limit . " ROWS ONLY " : "";
$data = DB::select(DB::raw($sqlstr . ' ORDER BY x.kode_skpd,x.kode_rsk ' . $sqlLimit));
$dataTotal = count(DB::select(DB::raw($sqlstr)));
$dataFilter = count(DB::select(DB::raw($sqlstr)));
return response()->json([
"recordsTotal" => $dataTotal,
"recordsFiltered" => $dataFilter,
"data" => $data
]);
}
protected function exportJadwalSalur($request)
{
$sqlstr = $this->filterJadwalSalur($request);
$sqlstr .= " ORDER BY x.kode_rekening";
$data = DB::select(DB::raw($sqlstr));
$data = json_decode(json_encode($data), true);
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setTitle('Jadwal Salur');
$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)");
}
return $spreadsheet;
}
public function download(Request $request)
{
$spreadsheet = $this->exportJadwalSalur($request);
$fileName = 'Jadwal-salur-dana.xlsx';
$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);
}
public function downloadAll(Request $request)
{
$post = $request->all();
$fileName = 'Jadwal-salur-belanja-' . date("Ymd") . '.xlsx';
$spreadsheet = $this->exportJadwalSalur($request);
$spreadsheet->createSheet();
$spreadsheet->setActiveSheetIndex(1);
$sheet = $spreadsheet->getActiveSheet();
$sheet->setTitle('Akb dan Realisasi');
$sheet->setCellValue('A1', 'KODE SKPD');
$sheet->setCellValue('B1', 'NAMA SKPD');
$sheet->setCellValue('C1', 'KODE RSK');
$sheet->setCellValue('D1', 'NAMA RSK');
$sheet->setCellValue('E1', 'KODE REKENING');
$sheet->setCellValue('F1', 'NAMA REKENING');
$alpha = range("A", "Z");
$jmlAlpha = count($alpha);
for ($i = 0; $i < $jmlAlpha; $i++) {
$alpha[] = "A" . $alpha[$i];
}
$colIndex = 6;
// 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');
$sheet->mergeCells('C1:C2');
$sheet->mergeCells('D1:D2');
$sheet->mergeCells('E1:E2');
$sheet->mergeCells('F1:F2');
$colIndex++;
// Nama Kolom Jadwal dan Realisasi
$colName = "Realisasi";
for ($i = 2; $i <= $colIndex; $i++) {
$colName = $colName == "AKB" ? "Realisasi" : "AKB";
$sheet->setCellValue(getAlphabetCell($i) . '2', $colName);
}
$sqlstr = $this->filterBelanja($request, $post["jenis_dana"]);
$data = DB::select(DB::raw($sqlstr));
$data = json_decode(json_encode($data), true);
// Data Kolom Bulan dan Realisasi
$rows = 3;
foreach ($data as $val) {
$currIndex = 0;
$sheet->setCellValue(getAlphabetCell($currIndex) . $rows, $val["kode_skpd"]);
$currIndex++;
$sheet->setCellValue(getAlphabetCell($currIndex) . $rows, $val["nama_skpd"]);
$currIndex++;
$sheet->setCellValue(getAlphabetCell($currIndex) . $rows, $val["kode_rsk"]);
$currIndex++;
$sheet->setCellValue(getAlphabetCell($currIndex) . $rows, $val["nama_rsk"]);
$currIndex++;
$sheet->setCellValue(getAlphabetCell($currIndex) . $rows, $val["kode_rekening"]);
$currIndex++;
$sheet->setCellValue(getAlphabetCell($currIndex) . $rows, $val["nama_rekening"]);
$currIndex++;
$totalJadwalSalur = 0;
$totalRealisasi = 0;
for ($i = 1; $i <= 12; $i++) {
$sheet->setCellValue(getAlphabetCell($currIndex) . $rows, $val["v_akb_" . substr("00" . $i, -2)]);
$totalJadwalSalur += $val["v_akb_" . substr("00" . $i, -2)];
$currIndex++;
$sheet->setCellValue(getAlphabetCell($currIndex) . $rows, $val["v_bku_" . substr("00" . $i, -2)]);
$totalRealisasi += $val["v_bku_" . substr("00" . $i, -2)];
$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)");
}
$spreadsheet->setActiveSheetIndex(0);
$writer = new Xlsx($spreadsheet);
$writer->save(public_path("downloadFiles/" . $fileName));
$headers = [
'Content-Type' => 'application/vnd.ms-excel',
'Content-Disposition' => 'attachment;filename=' . $fileName
];
return response()->download("downloadFiles/" . $fileName, $fileName, $headers);
}
}
@@ -1,231 +0,0 @@
<?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\MappingDbhSkpd;
use App\Models\User;
use App\Models\Tropd;
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,xlsx,xls,png,gif,jpg,jpeg',
]);
$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!');
}
$this->validate($request, [
'file' => 'required|mimes:pdf,xlsx,xls,png,gif,jpg,jpeg',
]);
$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->whereIn("kode_skpd", [Auth::user()->nrk, 'anggaran']);
$data->where(function ($subquery) {
$subquery->whereIn("kode_rekening", MappingDbhSkpd::whereIn("kode_skpd", [Auth::user()->nrk])->pluck("kode_rekening"));
});
} elseif (getRole() == "sbpk") {
$data->whereIn("kode_skpd", function ($query) {
$query->select('C_OPD')
->from('NEWSIPKD.TROPD')
->where('C_WIL_SP2DPROSES', Auth::user()->wilayah);
});
$data->where(function ($subquery) {
$subquery->whereIn("kode_rekening", MappingDbhSkpd::whereIn("kode_skpd", [Auth::user()->nrk])->pluck("kode_rekening"));
});
} elseif (getRole() == "walikota" || getRole() == "induk skpd") {
$id = Tropd::where("C_OPD", Auth::user()->nrk)->first()["i_id"];
$data->whereIn("kode_skpd", function ($query) use ($id) {
$query->select('C_OPD')
->from('NEWSIPKD.TROPD')
->where('I_IDINDUK', $id);
});
$data->where(function ($subquery) {
$subquery->whereIn("kode_rekening", MappingDbhSkpd::whereIn("kode_skpd", [Auth::user()->nrk])->pluck("kode_rekening"));
});
}
// var_dump(MappingDbhSkpd::whereIn("kode_skpd",[Auth::user()->nrk])->pluck("kode_rekening")); exit;
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!";
}
}
}
@@ -1,65 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\MappingDauRinci;
use Illuminate\Http\Request;
class MappingDauRinciController extends Controller
{
public function index()
{
$items = MappingDauRinci::paginate(15);
return response()->json($items);
}
public function create()
{
return response()->json(['message' => 'Display form for creating resource']);
}
public function store(Request $request)
{
$data = $request->validate([
'field1' => 'required|string|max:255',
'field2' => 'nullable|string',
'field3' => 'nullable|numeric',
]);
$item = MappingDauRinci::create($data);
return response()->json($item, 201);
}
public function show(MappingDauRinci $mappingDauRinci)
{
return response()->json($mappingDauRinci);
}
public function edit(MappingDauRinci $mappingDauRinci)
{
return response()->json($mappingDauRinci);
}
public function update(Request $request, MappingDauRinci $mappingDauRinci)
{
$data = $request->validate([
'field1' => 'sometimes|required|string|max:255',
'field2' => 'nullable|string',
'field3' => 'nullable|numeric',
]);
$mappingDauRinci->update($data);
return response()->json($mappingDauRinci);
}
public function destroy(MappingDauRinci $mappingDauRinci)
{
$mappingDauRinci->delete();
return response()->json(null, 204);
}
}
@@ -1,97 +0,0 @@
<?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
@@ -1,376 +0,0 @@
<?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\PendapatanRealisasiSts;
use App\Models\Sps_pendapatan;
use App\Models\VwJadwalSalur;
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"] = trim($txt_rek_sps[0]);
$data["nama_rekening_sps"] = trim($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"]);
$data["tw"] = $req["tw"];
$data["gelombang"] = $req["gelombang"];
$data["bulan"] = $req["bulan"];
$data["tahapan"] = $req["tahapan"];
$data["potongan_pph"] = replaceMoney($req["potongan_pph"]);
$data["potongan_jkn"] = replaceMoney($req["potongan_jkn"]);
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;
// var_dump($data); exit;
$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;
// var_dump($data); exit;
$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 = VwJadwalSalur::select($select)->where("TAHUN",getTA())->where("KODE_REKENING",$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::with("listSts")->where("tahun",$ta)->orderBy("SIMTRAD4_TGL_SP2D_BUN","DESC");
if (!empty($sps))
{
$data->where("kode_rekening_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();
// BUG FIX 20 FEB 2024
$uploadDir = config('constants.upload_path_sts').getTA();
if (File::exists($uploadDir.$realisasi_pendapatan->file_sts)){
File::delete($uploadDir.$realisasi_pendapatan->file_sts);
}
$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");
// var_dump($realisasi_pendapatan->hasSts); exit;
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();
$dataRealisasi = PendapatanRealisasi::where(['id' => $realisasiId])->first();
$arrTPG = getAkunTamsilTpg();
$sisa = 0;
if (in_array($req["rkud_kode_akun"],$arrTPG)){
$totalSts = PendapatanRealisasiSts::where(["id_pendapatan_realisasi" => $realisasiId])->get()->sum("rkud_jumlah");
$totalSts += replaceMoney($req["rkud_jumlah"]);
if (replaceMoney($req["rkud_jumlah"]) > $dataRealisasi["simtrad4_bersih"]){
return redirect(URL::to("/realisasi-pendapatan/".$realisasiId))->with('error', "Jumlah STS harus sama atau lebih kecil dengan Rencana !");
}
$sisa = $dataRealisasi["simtrad4_bersih"] - replaceMoney($totalSts);
}else{
if ($dataRealisasi["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"]);
$data["sisa_sts"] = $sisa;
$file = $request->file('file_sts');
if ($file){
$fileName = str_replace([" ","/"],["_","_"],$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;
}
PendapatanRealisasiSts::updateOrCreate([
"id_pendapatan_realisasi"=>$realisasiId,
"rkud_no_sts"=>$req["rkud_no_sts"]
],$data);
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/".$realisasiId))->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::with("listSts")->where("tahun", $ta)->orderBy("created_at","ASC");
if (!empty($sps)){
$data->where("kode_rekening_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', 'TW');
$sheet->setCellValue(getAlphabetCell(13).'1', 'Gelombang');
$sheet->setCellValue(getAlphabetCell(14).'1', 'Potongan PPH');
$sheet->setCellValue(getAlphabetCell(15).'1', 'Potongan JKN');
$sheet->setCellValue(getAlphabetCell(16).'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["listSts"]?$val["listSts"]["rkud_tgls"]:"");
$sheet->setCellValue(getAlphabetCell(9) . $rows, $val["listSts"]?$val["listSts"]["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["tw"]);
$sheet->setCellValue(getAlphabetCell(13) . $rows, $val["gelombang"]);
$sheet->setCellValue(getAlphabetCell(14) . $rows, $val["potongan_pph"]);
$sheet->setCellValue(getAlphabetCell(15) . $rows, $val["potongan_jkn"]);
$sheet->setCellValue(getAlphabetCell(16) . $rows, $val["listSts"]?$val["listSts"]["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)
{
$sts = PendapatanRealisasiSts::where("id_pendapatan_realisasi",$realisasi->id)->first();
$headers = [
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment;filename='.$sts->file_sts
];
return response()->download(config('constants.upload_path_sts').getTA()."/".$sts->file_sts, $sts->file_sts, $headers);
}
public function deleteSts(PendapatanRealisasiSts $stsId)
{
try{
DB::beginTransaction();
$uploadDir = config('constants.upload_path_sts').getTA();
if (File::exists($uploadDir.$stsId->file_sts)){
File::delete($uploadDir.$stsId->file_sts);
}
$stsId->delete();
DB::commit();
return redirect(URL::to("/realisasi-pendapatan/".$stsId->id_pendapatan_realisasi))->with('success','Data STS Pendapatan berhasil dihapus!');
}catch(Throwable $e){
DB::rollBack();
return redirect(URL::to("/realisasi-pendapatan/".$stsId->id_pendapatan_realisasi))->with('error','Data STS Pendapatan gagal dihapus.');
}
}
}
@@ -1,157 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\Models\SisaSalurDana;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Contracts\Session\Session;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\URL;
class SisaSalurDanaController extends Controller
{
public function __construct()
{
$this->siteTitle = "Data Sisa Tahun Anggaran Sebelumnya";
parent::__construct();
}
public function index()
{
$data = null;
return view('sisa_salur_dana.index',compact('data'))
->with('i', (request()->input('page', 1) - 1) * 10);
}
public function create()
{
$this->setSubtitle("Tambah Data");
return view('sisa_salur_dana.create');
}
public function show(SisaSalurDana $SisaSalurDana)
{
SisaSalurDana::where("id",$SisaSalurDana->id)->get();
$this->setSubtitle("Detail Data Sisa Tahun Anggaran Sebelumnya ");
return view('sisa_salur_dana.show',compact('SisaSalurDana'));
}
public function store(Request $request)
{
$request->validate([
'tahun' => 'required',
'kode_rekening' => 'required',
'jumlah' => 'required',
]);
$req = $request->all();
$this->validate($request, [
'file' => 'required|mimes:pdf,xlsx,xls,png,gif,jpg,jpeg',
]);
$data["tahun"] = $req["tahun"];
$data["kode_rekening"] = $req["kode_rekening"];
$data["jumlah"] = replaceMoney($req["jumlah"]);
$file = $request->file('file');
if ($file){
$ext = $file->getClientOriginalExtension();
$NewFileName = $data["tahun"].$data["kode_rekening"].".".$ext;
$tujuan_upload = 'uploadFiles/sisa_salur_dana';
File::isDirectory($tujuan_upload) or File::makeDirectory($tujuan_upload, 0777, true, true);
$file->move($tujuan_upload, $NewFileName);
$data["dokumen"] = $NewFileName;
// var_dump($NewFileName);
// exit;
}
if ($request->isMethod('post')){
$SisaSalurDana = SisaSalurDana::where("tahun",getTA())->where("kode_rekening",$req["kode_rekening"])->first();
if ($SisaSalurDana){
return redirect(URL::to("/SisaSalurDana/"))->with('error','Data Sisa Tahun Anggaran Sebelumnya gagal diTambah! No Rekening : '.$req["kode_rekening"].' sudah ada!');
}
else{
//var_dump($data); exit;
$SisaSalurDana = SisaSalurDana::create($data);
return redirect(URL::to("/SisaSalurDana/".$SisaSalurDana->id))->with('success','Data Sisa Tahun Anggaran Sebelumnya berhasil diTambah');
}
}
}
public function edit(SisaSalurDana $SisaSalurDana)
{
$this->setSubtitle("Ubah Data");
return view('sisa_salur_dana.edit',compact('SisaSalurDana'));
}
public function download($id)
{
$SisaSalurDana = SisaSalurDana::where("id",$id)->first();
$headers = [
'Content-Disposition' => 'attachment;filename='.$SisaSalurDana->dokumen
];
$path = config('constants.upload_path')."sisa_salur_dana/".$SisaSalurDana->dokumen;
return response()->file($path, $headers);
}
public function update(Request $request, SisaSalurDana $SisaSalurDana )
{
$request->validate([
'tahun' => 'required',
'kode_rekening' => 'required',
'jumlah' => 'required',
]);
$req = $request->all();
$data["tahun"] = $req["tahun"];
$data["kode_rekening"] = $req["kode_rekening"];
$data["jumlah"] = replaceMoney($req["jumlah"]);
$file = $request->file('file');
if ($file){
$ext = $file->getClientOriginalExtension();
$NewFileName = $data["tahun"].$data["kode_rekening"].".".$ext;
$tujuan_upload = 'uploadFiles/sisa_salur_dana';
File::isDirectory($tujuan_upload) or File::makeDirectory($tujuan_upload, 0777, true, true);
$file->move($tujuan_upload, $NewFileName);
$data["dokumen"] = $NewFileName;
}
$SisaSalurDana->update($req);
return redirect()->route('SisaSalurDana.index')
->with('success','Data Sisa Tahun Anggaran Sebelumnya berhasil diubah!');
}
public function destroy(SisaSalurDana $SisaSalurDana)
{
SisaSalurDana::where("id",$SisaSalurDana->id)->delete();
$SisaSalurDana->delete();
return redirect()->route('SisaSalurDana.index')
->with('success','Data Sisa Tahun Anggaran Sebelumnya 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,TAHUN,KODE_REKENING,JUMLAH");
$sqltr = SisaSalurDana::select($select);
$dataTotal = $sqltr->count();
$data = $sqltr->orderBy("ID");
if (!empty($src)){
$data->whereRaw(" ( lower(KODE_REKENING) like '%$src% OR lower(JUMLAH) like '%$src%') ");
}
$dataFilter = $data->count();
return response()->json([
"recordsTotal" => $dataTotal,
"recordsFiltered" => $dataFilter,
"data"=> $data->skip($offset)->take($limit)->get()
]);
}
}
-34
View File
@@ -1,34 +0,0 @@
<?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);
}
}
-71
View File
@@ -1,71 +0,0 @@
<?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,
];
}
-22
View File
@@ -1,22 +0,0 @@
<?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()) {
// Paksa redirect membawa prefix /sidata agar tidak terlempar ke root domain
return url('/sidata/login');
}
}
}
-32
View File
@@ -1,32 +0,0 @@
<?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);
}
}
-17
View File
@@ -1,17 +0,0 @@
<?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 = [
//
];
}
@@ -1,17 +0,0 @@
<?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 = [
//
];
}
@@ -1,32 +0,0 @@
<?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);
}
}
-19
View File
@@ -1,19 +0,0 @@
<?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',
];
}
-20
View File
@@ -1,20 +0,0 @@
<?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(),
];
}
}
-23
View File
@@ -1,23 +0,0 @@
<?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_ALL;
}
-17
View File
@@ -1,17 +0,0 @@
<?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 = [
//
];
}
-71
View File
@@ -1,71 +0,0 @@
<?php
namespace App\Imports;
use App\Models\DataUploadBosOmspan;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\Importable;
use Maatwebsite\Excel\Concerns\WithStartRow;
use Maatwebsite\Excel\Concerns\WithSkipDuplicates;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
use Illuminate\Support\Facades\Auth;
class ImportDataBos implements WithColumnFormatting, ToModel, WithStartRow
{
use Importable;
protected $ta;
public function __construct($ta){
$this->ta = $ta;
}
public function startRow(): int
{
return 2;
}
protected function replaceIni($str)
{
return str_replace(["'"],"",$str);
}
public function model(array $row)
{
$data = [
"tahun"=>getTA(),
"no"=>$this->replaceIni($row[0]),
"kanwil"=>$this->replaceIni($row[1]),
"kppn"=>$this->replaceIni($row[2]),
"lokasi_kewenangan"=>$this->replaceIni($row[3]),
"lokasi_sekolah"=>$this->replaceIni($row[4]),
"no_tgl_sk"=>$this->replaceIni($row[5]),
"jenis_bos"=>$this->replaceIni($row[6]),
"tahap"=>$this->replaceIni($row[7]),
"gelombang"=>$this->replaceIni($row[8]),
"npsn_nama_sekolah"=>$this->replaceIni($row[9]),
"jenis_satuan_pendidikan"=>$this->replaceIni($row[10]),
"status_sekolah"=>$this->replaceIni($row[11]),
"bank"=>$this->replaceIni($row[12]),
"no_rekening_nama_rekening"=>$this->replaceIni($row[13]),
"npsn"=>$this->replaceIni($row[14]),
"rekening"=>$this->replaceIni($row[15]),
"nama"=>$this->replaceIni($row[16]),
"jenjang_sekolah"=>$this->replaceIni($row[17]),
"no_tgl_sp2d_detail"=>$this->replaceIni($row[18]),
"no_sp2d"=>$this->replaceIni($row[19]),
"tgl_sp2d"=>is_numeric($row[20])?convertSerialDate($row[20]):$row[20],
"status"=>$this->replaceIni($row[21]),
"nilai"=>$this->replaceIni($row[22]),
"pagu"=>$this->replaceIni($row[23]),
"jmlh_siswa"=>$this->replaceIni($row[24]),
"ket_retur"=>$this->replaceIni($row[25])
];
return new DataUploadBosOmspan($data);
}
public function columnFormats(): array
{
return [
'Tgl' => NumberFormat::FORMAT_DATE_DDMMYYYY,
];
}
}
-53
View File
@@ -1,53 +0,0 @@
<?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);
}
}
-57
View File
@@ -1,57 +0,0 @@
<?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);
}
}
-17
View File
@@ -1,17 +0,0 @@
<?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 AkbPendapatan extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'AKB_PENDAPATAN';
protected $guarded = [];
public $timestamps = false;
}
-108
View File
@@ -1,108 +0,0 @@
<?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\DB;
class AkbSpb23 extends Eloquent
{
use HasFactory;
protected $connection = 'mysql';
// public function getAkbPendapatan()
// {
// $sqlstr = "select
// D.tahun,
// D.unitkerja_id,
// D.komisi as unitkerja_komisi,
// D.kode_wilayah as unitkerja_wilayah,
// D.kode as Unitkerja_Kode,
// D.kode_permen as Unitkerja_kodepermen,
// D.nama as Unitkerja_nama,
// C.rekening_id as rek_id,
// C.kode as rek_kode,
// C.nama as rek_nama,
// B.nilai,
// coalesce(A.bulan1, 0) as bulan1,
// coalesce(A.bulan2, 0) as bulan2,
// coalesce(A.bulan3, 0) as bulan3,
// coalesce(A.bulan4, 0) as bulan4,
// coalesce(A.bulan5, 0) as bulan5,
// coalesce(A.bulan6, 0) as bulan6,
// coalesce(A.bulan7, 0) as bulan7,
// coalesce(A.bulan8, 0) as bulan8,
// coalesce(A.bulan9, 0) as bulan9,
// coalesce(A.bulan10, 0) as bulan10,
// coalesce(A.bulan11, 0) as bulan11,
// coalesce(A.bulan12, 0) as bulan12
// from next_pendapatan B
// left join next_pendapatan_proyeksi A on A.pendapatan_id = B.pendapatan_id
// join hist2_rekening C on B.rekening_id = C.rekening_id and C.tahun = ".getTA()."
// join hist_unitkerja D on B.unitkerja_id = D.unitkerja_id and D.tahun = ".getTA()."
// ORDER BY C.kode";
// return DB::connection("mysql")->select(DB::raw($sqlstr));
// }
public function getAkbPendapatan()
{
// UNTUK 2024
// $sqlstr = "SELECT
// I_IDOPD unitkerja_id,
// y.N_AKUN rek_nama,
// y.C_AKUN rek_kode,
// V_ANGG_TAPD nilai,
// V_SPS_BULAN01 bulan1,
// V_SPS_BULAN02 bulan2,
// V_SPS_BULAN03 bulan3,
// V_SPS_BULAN04 bulan4,
// V_SPS_BULAN05 bulan5,
// V_SPS_BULAN06 bulan6,
// V_SPS_BULAN07 bulan7,
// V_SPS_BULAN08 bulan8,
// V_SPS_BULAN09 bulan9,
// V_SPS_BULAN10 bulan10,
// V_SPS_BULAN11 bulan11,
// V_SPS_BULAN12 bulan12
// FROM NEWSIPKD.TMDPADPT x
// LEFT JOIN NEWSIPKD.TRBAS y ON x.I_IDBAS = y.I_ID
// WHERE C_ANGG_TAHUN = ".getTA()."";
// $sqlstr = "SELECT
// unitkerja_id,
// NAMA_REKENING rek_nama,
// KODE_REKENING rek_kode,
// REK_ANGGARAN nilai,
// BULAN1,
// BULAN2,
// BULAN3,
// BULAN4,
// BULAN5,
// BULAN6,
// BULAN7,
// BULAN8,
// BULAN9,
// BULAN10,
// BULAN11,
// BULAN12
// FROM SYNCHRO.P_SPB_PENDAPATANAKB
// WHERE TAHUN= ".getTA()."";
$sqlstr = "SELECT C_ANGG_TAHUN TAHUN,
I_IDSKPD UNITKERJA_ID,
C_AKUN rek_kode,
N_AKUN rek_nama,
BULAN1+BULAN2+BULAN3+BULAN4+BULAN5+BULAN6+BULAN7+BULAN8+
BULAN9+BULAN10+BULAN11+BULAN12 nilai,
BULAN1,BULAN2,BULAN3,BULAN4,
BULAN5,BULAN6,BULAN7,BULAN8,
BULAN9,BULAN10,BULAN11,BULAN12
FROM NEWSIPKD.P_PENDAPATAN_RINCIAKB
WHERE C_ANGG_TAHUN = ".getTA();
return DB::connection("oracle")->select(DB::raw($sqlstr));
}
}
-14
View File
@@ -1,14 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
class AkunTamsilTpg extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'akun_tamsil_tpg';
}
-192
View File
@@ -1,192 +0,0 @@
<?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 = '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, a1.D_SPD_CETAK as TGL, b.JML as jumlah
FROM NEWSIPKD.TMSPD a
LEFT JOIN NEWSIPKD.TMSPDCETAK a1 ON a.I_ID=a1.I_ID
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,
a2.semester1,a2.semester2,a2.satuan_sms1,a2.satuan_sms2,
volume_satuan_realisasi_1,volume_satuan_realisasi_2,volume_satuan_realisasi_3,volume_satuan_realisasi_4,volume_satuan_realisasi_5,volume_satuan_realisasi_6,volume_satuan_realisasi_7,
volume_satuan_realisasi_8,volume_satuan_realisasi_9,volume_satuan_realisasi_10,volume_satuan_realisasi_11,volume_satuan_realisasi_12,
jumlah_realisasi_1,jumlah_realisasi_2,jumlah_realisasi_3,jumlah_realisasi_4,jumlah_realisasi_5,jumlah_realisasi_6,jumlah_realisasi_7,
jumlah_realisasi_8,jumlah_realisasi_9,jumlah_realisasi_10,jumlah_realisasi_11,jumlah_realisasi_12
FROM VW_BELANJA_REALISASI a
LEFT JOIN BELANJA_REALISASI_RINCI a1
ON a.id=a1.belanja_realisasi_id
LEFT JOIN (
SELECT BELANJA_REALISASI_ID,SUM(SEMESTER1) SEMESTER1,SUM(SEMESTER2) SEMESTER2,
SUM(SATUAN_SMS1) SATUAN_SMS1,SUM(SATUAN_SMS2) SATUAN_SMS2
FROM ( SELECT BELANJA_REALISASI_ID,JUMLAH_REALISASI AS SEMESTER1, 0 AS SEMESTER2,
VOLUME_SATUAN_REALISASI AS SATUAN_SMS1, 0 AS SATUAN_SMS2
FROM BELANJA_REALISASI_DETAIL WHERE SEMESTER = 1
UNION ALL SELECT BELANJA_REALISASI_ID,0 AS SEMESTER1, JUMLAH_REALISASI AS SEMESTER2,
0 AS SATUAN_SMS2, VOLUME_SATUAN_REALISASI AS SATUAN_SMS2
FROM BELANJA_REALISASI_DETAIL WHERE SEMESTER = 2
) GROUP BY BELANJA_REALISASI_ID
) a2 ON a.id = a2.BELANJA_REALISASI_ID
LEFT JOIN (
SELECT I_IDRSK,SUM(REALISASI) AS jml
FROM MV_ANGGARAN_REALISASI_RSK
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 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;
}
public function tableDataReport($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,
a2.semester1,a2.semester2,a2.satuan_sms1,a2.satuan_sms2,
volume_satuan_realisasi_1,volume_satuan_realisasi_2,volume_satuan_realisasi_3,volume_satuan_realisasi_4,volume_satuan_realisasi_5,volume_satuan_realisasi_6,volume_satuan_realisasi_7,
volume_satuan_realisasi_8,volume_satuan_realisasi_9,volume_satuan_realisasi_10,volume_satuan_realisasi_11,volume_satuan_realisasi_12,
jumlah_realisasi_1,jumlah_realisasi_2,jumlah_realisasi_3,jumlah_realisasi_4,jumlah_realisasi_5,jumlah_realisasi_6,jumlah_realisasi_7,
jumlah_realisasi_8,jumlah_realisasi_9,jumlah_realisasi_10,jumlah_realisasi_11,jumlah_realisasi_12
FROM VW_BELANJA_REALISASI_REPORT a
LEFT JOIN BELANJA_REALISASI_RINCI a1
ON a.id=a1.belanja_realisasi_id
LEFT JOIN (
SELECT BELANJA_REALISASI_ID,SUM(SEMESTER1) SEMESTER1,SUM(SEMESTER2) SEMESTER2,
SUM(SATUAN_SMS1) SATUAN_SMS1,SUM(SATUAN_SMS2) SATUAN_SMS2
FROM ( SELECT BELANJA_REALISASI_ID,JUMLAH_REALISASI AS SEMESTER1, 0 AS SEMESTER2,
VOLUME_SATUAN_REALISASI AS SATUAN_SMS1, 0 AS SATUAN_SMS2
FROM BELANJA_REALISASI_DETAIL WHERE SEMESTER = 1
UNION ALL SELECT BELANJA_REALISASI_ID,0 AS SEMESTER1, JUMLAH_REALISASI AS SEMESTER2,
0 AS SATUAN_SMS2, VOLUME_SATUAN_REALISASI AS SATUAN_SMS2
FROM BELANJA_REALISASI_DETAIL WHERE SEMESTER = 2
) GROUP BY BELANJA_REALISASI_ID
) a2 ON a.id = a2.BELANJA_REALISASI_ID
LEFT JOIN (
SELECT I_IDRSK,SUM(REALISASI) AS jml
FROM MV_ANGGARAN_REALISASI_RSK
WHERE C_ANGG_TAHUN = $ta
GROUP BY I_IDRSK
) b ON a.kode_rsk = b.I_IDRSK
LEFT JOIN (
SELECT id_rsk,SUM(jumlah) as jml_spd
FROM 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;
}
public function akbRealisasi()
{
$ta = getTA();
$sqlstr = "SELECT * FROM MV_ASYNC_AKB_REALISASI WHERE TAHUN = $ta";
return $sqlstr;
}
}
-22
View File
@@ -1,22 +0,0 @@
<?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 = 'belanja_realisasi_bast';
protected $fillable = [
"id_kontrak",
"nomor_bast",
"tgl_bast",
"nominal_bast",
"file_bast",
"created_by"
];
}
-23
View File
@@ -1,23 +0,0 @@
<?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 = 'belanja_realisasi_detail';
protected $fillable = [
"belanja_realisasi_id",
"jumlah_realisasi",
"alokasi_realisasi",
"volume_satuan_realisasi",
"unit_satuan_realisasi",
"semester",
"created_by"
];
}
-23
View File
@@ -1,23 +0,0 @@
<?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 = 'belanja_realisasi_kontrak';
protected $fillable = [
"belanja_realisasi_id",
"nomor_kontrak",
"tgl_kontrak",
"nominal_kontrak",
"file_kontrak",
"nomor_bast",
"created_by"
];
}
-42
View File
@@ -1,42 +0,0 @@
<?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 = '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"
];
}
-24
View File
@@ -1,24 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
class BelanjaRealisasiRinciDau extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'belanja_realisasi_rinci_dau';
protected $fillable = [
"belanja_realisasi_id",
"id_rinci_dau",
"deskripsi",
"jml_anggaran",
"volume_satuan",
"unit_satuan",
"jml_realisasi",
"volume_satuan_realisasi",
"unit_satuan_realisasi",
"periode_anggaran"
];
}
-20
View File
@@ -1,20 +0,0 @@
<?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 = 'belanja_realisasi_spd';
protected $fillable = [
"id_rsk",
"no_spd",
"tgl",
"jumlah"
];
}
-16
View File
@@ -1,16 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
use Illuminate\Support\Facades\Auth;
class DataBosOmspan extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'SAMASA.DATA_BOS_OMSPAN';
protected $guarded = [];
}
-16
View File
@@ -1,16 +0,0 @@
<?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 DataUploadBosOmspan extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'SAMASA.DATA_UPLOAD_BOS_OMSPAN';
protected $guarded = [];
}
-14
View File
@@ -1,14 +0,0 @@
<?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';
}
-24
View File
@@ -1,24 +0,0 @@
<?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 = 'laporan_file';
protected $fillable = [
"tahun",
"tgl_upload",
"kode_rekening",
"kode_skpd",
"nama_skpd",
"nama_laporan",
"nama_file",
];
}
-20
View File
@@ -1,20 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
class MappingDauRinci extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'mapping_dau_rinci';
protected $fillable = [
"id_dau_rinci",
"id_jenis_dana",
"tahun",
"kode_skpd"
];
}
-21
View File
@@ -1,21 +0,0 @@
<?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 = 'mapping_dbh_skpd';
protected $fillable = [
"id_sps",
"tahun",
"kode_rekening",
"kode_skpd",
"id_rekening"
];
}
-19
View File
@@ -1,19 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
class MstDauRinci extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'MST_DAU_RINCI';
protected $fillable = [
"name",
"grup",
"satuan"
];
}
-20
View File
@@ -1,20 +0,0 @@
<?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 = 'MST_JENIS_BELANJA';
protected $fillable = [
"kode",
"name",
"description",
"grup"
];
}
-18
View File
@@ -1,18 +0,0 @@
<?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 = 'MST_JENIS_DANA';
protected $fillable = [
"name",
"grup",
];
}
-20
View File
@@ -1,20 +0,0 @@
<?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 = 'MST_SUB_JENIS_BELANJA';
protected $fillable = [
"kode",
"id_jenis_belanja",
"name",
"description",
];
}
-25
View File
@@ -1,25 +0,0 @@
<?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 = 'notifikasi';
protected $fillable = [
"role_from",
"role_to",
"userid",
"message",
"url",
"is_read",
"jenis",
"id_unik"
];
}
-29
View File
@@ -1,29 +0,0 @@
<?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 = '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','tw','gelombang','potongan_pph','potongan_jkn','bulan'
];
public function hasSts() {
return $this->hasMany('App\Models\PendapatanRealisasiSts','id_pendapatan_realisasi','id');
}
public function listSts(){
return $this->hasOne('App\Models\VwRekapPendapatanSts','id_pendapatan_realisasi','id');
}
}
-15
View File
@@ -1,15 +0,0 @@
<?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 PendapatanRealisasiSts extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'pendapatan_realisasi_sts';
protected $guarded = [];
}
-18
View File
@@ -1,18 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Permission\Traits\HasPermissions;
class Pengaturan extends Model
{
use HasFactory, HasPermissions;
protected $table = 'pengaturan';
protected $fillable = [
'check_all_tambah',
'check_all_hapus',
'check_all_ubah'
];
}
-15
View File
@@ -1,15 +0,0 @@
<?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'
];
}
-14
View File
@@ -1,14 +0,0 @@
<?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';
}
-11
View File
@@ -1,11 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Role extends Model
{
use HasFactory;
}
-25
View File
@@ -1,25 +0,0 @@
<?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');
}
}
-26
View File
@@ -1,26 +0,0 @@
<?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');
}
}
-16
View File
@@ -1,16 +0,0 @@
<?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'
];
}
-14
View File
@@ -1,14 +0,0 @@
<?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';
}
-17
View File
@@ -1,17 +0,0 @@
<?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 = [];
}
-21
View File
@@ -1,21 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
class SisaSalurDana extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'MST_SISA_SALUR';
protected $fillable = [
"tahun",
"kode_rekening",
"jumlah",
"dokumen",
];
}
-14
View File
@@ -1,14 +0,0 @@
<?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';
}
-35
View File
@@ -1,35 +0,0 @@
<?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 x.*,y.JUMLAH as SISA FROM VW_JADWAL_SALUR x
LEFT JOIN MST_SISA_SALUR y ON x.TAHUN = y.TAHUN AND x.KODE_REKENING = y.KODE_REKENING';
if (getRole() == "skpd") {
$sqlstr .= ' WHERE x.kode_rekening IN (SELECT kode_rekening FROM MAPPING_DBH_SKPD WHERE KODE_SKPD=\'' . Auth::user()->nrk . '\') ';
} elseif (getRole() == "sbpk") {
$sqlstr .= ' WHERE x.kode_rekening IN (SELECT kode_rekening FROM MAPPING_DBH_SKPD WHERE KODE_SKPD IN (SELECT C_OPD FROM NEWSIPKD.TROPD WHERE C_WIL_SP2DPROSES=' . Auth::user()->wilayah . '))';
} elseif (getRole() == "walikota" || getRole() == "induk skpd") {
$sqlstr .= ' WHERE x.kode_rekening IN (SELECT kode_rekening FROM MAPPING_DBH_SKPD WHERE KODE_SKPD IN (SELECT C_OPD FROM NEWSIPKD.TROPD WHERE I_IDINDUK = (SELECT I_ID FROM NEWSIPKD.TROPD WHERE C_OPD=\'' . Auth::user()->nrk . '\')))';
} else {
$sqlstr .= " WHERE 1=1 ";
}
$sqlstr .= ' AND x.TAHUN = ' . $ta . ' AND SUBSTR(x.KODE_REKENING,1,3)=\'4.2\'';
return $sqlstr;
}
}
-14
View File
@@ -1,14 +0,0 @@
<?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';
}
-38
View File
@@ -1,38 +0,0 @@
<?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 = '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"
];
}
-14
View File
@@ -1,14 +0,0 @@
<?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';
}
-14
View File
@@ -1,14 +0,0 @@
<?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';
}
-16
View File
@@ -1,16 +0,0 @@
<?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'
];
}
-106
View File
@@ -1,106 +0,0 @@
<?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_tambah_data',
'lock_ubah_data',
'lock_hapus_data',
'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;
// }
// }
}
-14
View File
@@ -1,14 +0,0 @@
<?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';
}
-16
View File
@@ -1,16 +0,0 @@
<?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 = 'VW_BELANJA_REALISASI';
}
-14
View File
@@ -1,14 +0,0 @@
<?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 = 'VW_DPA_RSK';
}
-14
View File
@@ -1,14 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
class VwJadwalSalur extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'VW_JADWAL_SALUR';
}
-14
View File
@@ -1,14 +0,0 @@
<?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 = 'VW_JENIS_BELANJA';
}
-16
View File
@@ -1,16 +0,0 @@
<?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 VwRekapPendapatanSts extends Eloquent
{
use HasFactory;
protected $connection = 'Samasa';
protected $table = 'vw_rekap_pendapatan_sts';
}

Some files were not shown because too many files have changed in this diff Show More