Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Naufal Khoirun Nafi
SBPDAM
Commits
53108ba8
Commit
53108ba8
authored
1 year ago
by
Naufal Khoirun Nafi
Browse files
Options
Download
Email Patches
Plain Diff
ok
parent
7be1cc16
main
No related merge requests found
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
app/Http/Controllers/AdminController.php
+4
-3
app/Http/Controllers/AdminController.php
app/Http/Controllers/LoginController.php
+15
-6
app/Http/Controllers/LoginController.php
app/Http/Controllers/PayController.php
+82
-0
app/Http/Controllers/PayController.php
app/Http/Controllers/UserController.php
+80
-44
app/Http/Controllers/UserController.php
app/Models/DesKec.php
+2
-2
app/Models/DesKec.php
app/Models/Transaksi.php
+5
-5
app/Models/Transaksi.php
app/Models/Units.php
+22
-0
app/Models/Units.php
app/Models/User.php
+2
-1
app/Models/User.php
app/Providers/AppServiceProvider.php
+16
-1
app/Providers/AppServiceProvider.php
config/midtrans.php
+8
-0
config/midtrans.php
database/migrations/0001_01_01_000000_create_munit_table.php
+27
-0
database/migrations/0001_01_01_000000_create_munit_table.php
database/migrations/0001_01_01_000000_create_users_table.php
+6
-10
database/migrations/0001_01_01_000000_create_users_table.php
database/migrations/2024_03_26_073848_create_pelanggans_table.php
+1
-0
.../migrations/2024_03_26_073848_create_pelanggans_table.php
database/migrations/2024_04_25_102629_create_transaksi_table.php
+7
-7
...e/migrations/2024_04_25_102629_create_transaksi_table.php
database/seeders/RoleSeeder.php
+1
-1
database/seeders/RoleSeeder.php
database/seeders/UnitSeeder.php
+23
-16
database/seeders/UnitSeeder.php
database/seeders/UserSeeder.php
+8
-4
database/seeders/UserSeeder.php
public/css/style.css
+19
-9
public/css/style.css
public/img/IMG_9494.JPG
+0
-0
public/img/IMG_9494.JPG
public/img/toeic-4.jpg
+0
-0
public/img/toeic-4.jpg
with
328 additions
and
109 deletions
+328
-109
app/Http/Controllers/AdminController.php
View file @
53108ba8
...
...
@@ -17,8 +17,9 @@ class AdminController extends Controller
public
function
dashboard
()
{
$jlmh_pelanggan
=
Pelanggan
::
all
()
->
count
();
$nama
=
User
::
all
()
->
first
()
->
username
;
$nama
=
Auth
::
user
()
->
username
;
$pelanggan
=
Pelanggan
::
all
();
// dd($nama);
return
view
(
'admin.dashboard'
,
[
'nama'
=>
$nama
,
...
...
@@ -33,13 +34,13 @@ public function daftarManual()
$dukuhList
=
Dukuh
::
all
();
$desaList
=
Desa
::
all
();
$kecamatanList
=
Kecamatan
::
all
();
$unitList
=
UnitCoba
::
all
();
//
$unitList = UnitCoba::all();
return
view
(
'admin.form-daftar'
,
[
'nama'
=>
$nama
,
'dukuhList'
=>
$dukuhList
,
'desaList'
=>
$desaList
,
'kecamatanList'
=>
$kecamatanList
,
'unitList'
=>
$unitList
,
//
'unitList' => $unitList,
]);
}
...
...
This diff is collapsed.
Click to expand it.
app/Http/Controllers/LoginController.php
View file @
53108ba8
...
...
@@ -23,18 +23,25 @@ public function index()
public
function
prosesLogin
(
Request
$request
)
{
$credentials
=
$request
->
validate
([
'email'
=>
'required|email'
,
'password'
=>
'required'
,
]);
$loginField
=
$request
->
input
(
'login_field'
);
// Input field yang mungkin berisi email atau username
$password
=
$request
->
input
(
'password'
);
// Anda dapat memeriksa apakah input adalah email atau username
$fieldType
=
filter_var
(
$loginField
,
FILTER_VALIDATE_EMAIL
)
?
'email'
:
'username'
;
$credentials
=
[
$fieldType
=>
$loginField
,
'password'
=>
$password
,
];
if
(
Auth
::
attempt
(
$credentials
))
{
if
(
Auth
::
user
()
->
role
->
nama
==
"user"
||
Auth
::
user
()
->
role
->
nama
==
"pelanggan"
){
return
redirect
(
'/beranda'
);
// return redirect('/dashboard');
}
else
{
}
else
if
(
Auth
::
user
()
->
role
->
nama
==
"superadmin"
){
return
redirect
(
'/dashboard'
);
}
elseif
(
Auth
::
user
()
->
role
->
nama
==
"adminunit"
){
return
redirect
(
'/unit'
);
}
}
else
{
return
back
()
->
with
(
'Login gagal, silahkan coba lagi!'
);
...
...
@@ -52,12 +59,14 @@ public function prosesDaftar(Request $request)
{
$request
->
validate
([
'username'
=>
'required'
,
'nama'
=>
'required'
,
'email'
=>
'required|email'
,
'password'
=>
'required'
,
]);
$user
=
new
User
;
$user
->
username
=
$request
->
username
;
$user
->
nama
=
$request
->
nama
;
$user
->
email
=
$request
->
email
;
$user
->
password
=
bcrypt
(
$request
->
password
);
$user
->
save
();
...
...
This diff is collapsed.
Click to expand it.
app/Http/Controllers/PayController.php
0 → 100644
View file @
53108ba8
<?php
namespace
App\Http\Controllers
;
use
App\Models\Pelanggan
;
use
App\Models\Transaksi
;
use
Illuminate\Http\Request
;
use
Illuminate\Routing\Controller
;
class
PayController
extends
Controller
{
public
function
bayar
(
Request
$request
)
{
$pelanggan
=
Pelanggan
::
where
(
'user_id'
,
auth
()
->
id
())
->
first
();
$transaksi
=
Transaksi
::
create
([
'pelanggan_id'
=>
$pelanggan
->
id
,
'total_bayar'
=>
23000
,
'status'
=>
'PENDING'
,
]);
// Set your Merchant Server Key
\
Midtrans\Config
::
$serverKey
=
config
(
'midtrans.server_key'
);
// Set to Development/Sandbox Environment (default). Set to true for Production Environment (accept real transaction).
\
Midtrans\Config
::
$isProduction
=
false
;
// Set sanitization on (default)
\
Midtrans\Config
::
$isSanitized
=
true
;
// Set 3DS transaction for credit card to true
\
Midtrans\Config
::
$is3ds
=
true
;
$params
=
[
'transaction_details'
=>
[
'order_id'
=>
$transaksi
->
id
,
'gross_amount'
=>
23000
,
],
'customer_details'
=>
[
'first_name'
=>
$pelanggan
->
nama
,
'email'
=>
$pelanggan
->
user
->
email
,
'phone'
=>
$pelanggan
->
no_hp
,
],
];
$snapToken
=
\
Midtrans\Snap
::
getSnapToken
(
$params
);
$transaksi
->
snap_token
=
$snapToken
;
$transaksi
->
save
();
return
redirect
()
->
route
(
'berhasil'
,
$transaksi
->
id
);
}
public
function
berhasil
(
$id
)
{
$bayar
=
Transaksi
::
where
(
'id'
,
$id
)
->
first
();
// dd($bayar);
return
view
(
'user.berhasil'
,
compact
(
'bayar'
));
}
public
function
tagihan
(
Transaksi
$transaksi
)
{
return
view
(
'user.tagihan'
,
compact
(
'transaksi'
));
}
public
function
callback
(
Request
$request
)
{
$serverKey
=
config
(
'midtrans.server_key'
);
$our_key
=
hash
(
"sha512"
,
$request
->
order_id
.
$request
->
status_code
.
$request
->
gross_amount
.
$serverKey
);
if
(
$our_key
==
$request
->
signature_key
)
{
if
(
$request
->
transaction_status
==
'capture'
or
$request
->
transaction_status
==
'settlement'
)
{
$transaksi
=
Transaksi
::
where
(
'id'
,
$request
->
order_id
)
->
first
();
$transaksi
->
status
=
'SUCCESS'
;
$transaksi
->
save
();
}
else
if
(
$request
->
transaction_status
==
'cancel'
or
$request
->
transaction_status
==
'deny'
or
$request
->
transaction_status
==
'expire'
or
$request
->
transaction_status
==
'failure='
)
{
$transaksi
=
Transaksi
::
where
(
'id'
,
$request
->
order_id
)
->
first
();
$transaksi
->
status
=
'FAILED'
;
$transaksi
->
save
();
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/Http/Controllers/UserController.php
View file @
53108ba8
...
...
@@ -2,10 +2,12 @@
namespace
App\Http\Controllers
;
use
App\Models\DesKec
;
use
App\Models\User
;
use
App\Models\Desa
;
use
App\Models\Dukuh
;
use
App\Models\Kecamatan
;
use
App\Models\Units
;
use
App\Models\Pelanggan
;
use
Dotenv\Exception\ValidationException
;
use
Illuminate\Http\Request
;
...
...
@@ -42,7 +44,7 @@ public function bantuan()
// public function profil()
// {
// // try {
// // // Memeriksa apakah ada relasi antara pengguna aktif dan tabel Pelanggan
// // if (auth()->user()->pelanggan()->exists()) {
...
...
@@ -68,16 +70,17 @@ public function bantuan()
// // }
// }
public
function
profil
()
{
public
function
profil
()
{
// ini lebih mudah dipahami harusnya
$pelanggan
=
Pelanggan
::
where
(
'user_id'
,
auth
()
->
user
()
->
id
)
->
first
();
if
(
$pelanggan
)
{
if
(
$pelanggan
)
{
return
view
(
'user.profil'
,
[
'nama'
=>
auth
()
->
user
()
->
username
,
'pelanggan'
=>
$pelanggan
,
]);
}
elseif
(
!
$pelanggan
)
{
}
elseif
(
!
$pelanggan
)
{
return
view
(
'user.profil'
,
[
'nama'
=>
auth
()
->
user
()
->
username
,
]);
...
...
@@ -86,56 +89,88 @@ public function profil() {
}
}
public
function
updateProfil
(
$id
,
Request
$request
){
try
{
$request
->
validate
([
'username'
=>
'required|string|max:255|unique:users,username,'
.
auth
()
->
user
()
->
id
,
'foto'
=>
'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
]);
$user
=
Auth
::
user
();
$user
->
username
=
$request
->
username
;
// Perbarui foto pengguna jika ada
if
(
$request
->
hasFile
(
'foto'
))
{
$file
=
$request
->
file
(
'foto'
);
// Pastikan file foto telah berhasil diunggah
if
(
$file
->
isValid
())
{
// Pindahkan file ke direktori yang diinginkan
$fileName
=
$file
->
getClientOriginalName
();
$file
->
move
(
public_path
(
'img'
),
$fileName
);
// Simpan nama file foto ke atribut $foto pada model pengguna
$user
->
foto
=
$fileName
;
}
else
{
// Jika file foto tidak valid, kembalikan dengan pesan error
return
redirect
()
->
back
()
->
with
(
'error'
,
'File foto tidak valid.'
);
}
public
function
updateProfil
(
$id
,
Request
$request
)
{
try
{
$user
=
Auth
::
user
();
$rules
=
[
'email'
=>
'required|string|email|max:255|unique:users,email,'
.
$user
->
id
,
'username'
=>
'required|string|max:255|unique:users,username,'
.
$user
->
id
,
'nama'
=>
'required|string|max:255'
,
'tanggal_lahir'
=>
'nullable|date'
,
'jenis_kelamin'
=>
'nullable|in:L,P'
,
'foto'
=>
'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
];
// Perbarui aturan validasi jika password baru dimasukkan
if
(
$request
->
filled
(
'new_password'
))
{
$rules
[
'current_password'
]
=
'required|string'
;
$rules
[
'new_password'
]
=
'min:8|confirmed'
;
}
$request
->
validate
(
$rules
);
// Periksa apakah kata sandi saat ini sesuai dengan yang ada di database
if
(
$request
->
filled
(
'current_password'
))
{
if
(
!
\
Hash
::
check
(
$request
->
current_password
,
$user
->
password
))
{
return
redirect
()
->
back
()
->
with
(
'error'
,
'Kata sandi saat ini tidak sesuai.'
);
}
$user
->
save
();
return
redirect
()
->
back
()
->
with
(
'success'
,
'Profil berhasil diperbarui.'
);
}
catch
(
ValidationException
$e
)
{
throw
$e
;
}
catch
(
\
Exception
$e
)
{
return
redirect
()
->
back
()
->
with
(
'error'
,
'Gagal memperbarui profil. Silakan coba lagi.'
);
}
$user
->
email
=
$request
->
email
;
$user
->
username
=
$request
->
username
;
$user
->
tanggal_lahir
=
$request
->
tanggal_lahir
;
$user
->
jenis_kelamin
=
$request
->
jenis_kelamin
;
$user
->
nama
=
$request
->
nama
;
// Perbarui kata sandi jika ada
if
(
$request
->
filled
(
'new_password'
))
{
$user
->
password
=
\
Hash
::
make
(
$request
->
new_password
);
}
// Perbarui foto pengguna jika ada
if
(
$request
->
hasFile
(
'foto'
))
{
$file
=
$request
->
file
(
'foto'
);
// Pastikan file foto telah berhasil diunggah
if
(
$file
->
isValid
())
{
// Pindahkan file ke direktori yang diinginkan
$fileName
=
$file
->
getClientOriginalName
();
$file
->
move
(
public_path
(
'img'
),
$fileName
);
// Simpan nama file foto ke atribut $foto pada model pengguna
$user
->
foto
=
$fileName
;
}
else
{
// Jika file foto tidak valid, kembalikan dengan pesan error
return
redirect
()
->
back
()
->
with
(
'error'
,
'File foto tidak valid.'
);
}
}
$user
->
save
();
return
redirect
()
->
back
()
->
with
(
'success'
,
'Profil berhasil diperbarui.'
);
}
catch
(
\
Exception
$e
)
{
return
redirect
()
->
back
()
->
with
(
'error'
,
'Gagal memperbarui profil. Silakan coba lagi.'
);
}
}
public
function
sambungan
()
{
$user
=
Auth
::
user
();
$dukuhList
=
Dukuh
::
all
();
$desaList
=
Desa
::
all
();
$kecamatanList
=
Kecamatan
::
all
();
// dd($dukuhList->all());
$unitList
=
Units
::
all
();
// $desaList = Desa::all();
// $kecamatanList = Kecamatan::all();
$deskec
=
DesKec
::
all
();
// dd($deskec->all());
return
view
(
'user.form-sambungan'
,
[
'user'
=>
$user
,
'nama'
=>
auth
::
user
()
->
username
,
'dukuhList'
=>
$dukuhList
,
'desaList'
=>
$desaList
,
'kecamatanList'
=>
$kecamatanList
,
'deskec'
=>
$deskec
,
'unitList'
=>
$unitList
,
// 'desaList' => $desaList,
// 'kecamatanList' => $kecamatanList,
]);
}
...
...
@@ -160,7 +195,8 @@ public function prosesDaftar(Request $request)
'nama_jalan'
=>
'required'
,
'jmlh_penghuni'
=>
'required'
,
'foto_rumah'
=>
'required'
,
// 'unit' => 'nullable'
'keterangan'
=>
'required'
,
'unit'
=>
'nullable'
]);
if
(
$request
->
hasFile
(
'foto_rumah'
))
{
// Periksa apakah file telah diunggah
...
...
@@ -172,7 +208,7 @@ public function prosesDaftar(Request $request)
$validatedData
[
'foto_rumah'
]
=
$name
;
}
$validatedData
[
'user_id'
]
=
$user
->
id
;
$validatedData
[
'user_id'
]
=
$user
->
id
;
// Menambahkan data ke tabel Pelanggan
$storePelanggan
=
Pelanggan
::
create
(
$validatedData
);
...
...
This diff is collapsed.
Click to expand it.
app/Models/
UnitCoba
.php
→
app/Models/
DesKec
.php
View file @
53108ba8
...
...
@@ -5,10 +5,10 @@
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
class
UnitCoba
extends
Model
class
DesKec
extends
Model
{
use
HasFactory
;
protected
$table
=
'
munit
'
;
protected
$table
=
'
deskec
'
;
public
function
users
()
{
...
...
This diff is collapsed.
Click to expand it.
app/Models/
Unit
.php
→
app/Models/
Transaksi
.php
View file @
53108ba8
...
...
@@ -5,14 +5,14 @@
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
class
Unit
extends
Model
class
Transaksi
extends
Model
{
use
HasFactory
;
protected
$table
=
'units'
;
protected
$guarded
=
[
'id'
];
public
function
users
()
protected
$table
=
'transaksi'
;
protected
$guarded
=
[
'id'
];
public
function
user
()
{
return
$this
->
hasMany
(
User
::
class
);
return
$this
->
belongsTo
(
Pelanggan
::
class
);
}
}
This diff is collapsed.
Click to expand it.
app/Models/Units.php
0 → 100644
View file @
53108ba8
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
class
Units
extends
Model
{
use
HasFactory
;
protected
$table
=
'munit'
;
protected
$fillable
=
[
'kd_unit'
,
'nm_unit'
,
];
public
function
users
()
{
return
$this
->
belongsTo
(
User
::
class
);
}
}
This diff is collapsed.
Click to expand it.
app/Models/User.php
View file @
53108ba8
...
...
@@ -54,10 +54,11 @@ public function role()
}
public
function
unit
()
{
return
$this
->
belongsTo
(
Unit
::
class
);
return
$this
->
belongsTo
(
Unit
s
::
class
);
}
public
function
pelanggan
()
{
return
$this
->
hasOne
(
Pelanggan
::
class
);
}
}
This diff is collapsed.
Click to expand it.
app/Providers/AppServiceProvider.php
View file @
53108ba8
...
...
@@ -2,6 +2,10 @@
namespace
App\Providers
;
use
App\Models\User
;
use
Carbon\Carbon
;
use
Illuminate\Support\Facades\App
;
use
Illuminate\Support\Facades\Gate
;
use
Illuminate\Support\ServiceProvider
;
class
AppServiceProvider
extends
ServiceProvider
...
...
@@ -19,6 +23,17 @@ public function register(): void
*/
public
function
boot
():
void
{
//
App
::
setLocale
(
'id'
);
Carbon
::
setLocale
(
'id'
);
Gate
::
define
(
'unit'
,
function
(
User
$user
)
{
return
auth
()
->
user
()
->
role
->
nama
===
'adminunit'
;
});
Gate
::
define
(
'superadmin'
,
function
(
User
$user
)
{
return
auth
()
->
user
()
->
role
->
nama
===
'superadmin'
;
});
}
}
This diff is collapsed.
Click to expand it.
config/midtrans.php
0 → 100644
View file @
53108ba8
<?php
return
[
'server_key'
=>
env
(
'MIDTRANS_SERVER_KEY'
,
''
),
'isProduction'
=>
env
(
'MIDTRANS_IS_PRODUCTION'
),
'isSanitized'
=>
env
(
'MIDTRANS_IS_SANITIZED'
),
'is3ds'
=>
env
(
'MIDTRANS_IS_3DS'
),
];
\ No newline at end of file
This diff is collapsed.
Click to expand it.
database/migrations/0001_01_01_000000_create_munit_table.php
0 → 100644
View file @
53108ba8
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*/
public
function
up
():
void
{
Schema
::
create
(
'munit'
,
function
(
Blueprint
$table
)
{
$table
->
id
(
'kd_unit'
);
$table
->
string
(
'nm_unit'
);
});
}
/**
* Reverse the migrations.
*/
public
function
down
():
void
{
Schema
::
dropIfExists
(
'munit'
);
}
};
This diff is collapsed.
Click to expand it.
database/migrations/0001_01_01_000000_create_users_table.php
View file @
53108ba8
...
...
@@ -14,27 +14,24 @@ public function up(): void
Schema
::
create
(
'users'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
string
(
'username'
);
$table
->
string
(
'nama'
);
$table
->
enum
(
'jenis_kelamin'
,
[
'L'
,
'P'
])
->
default
(
'L'
);
$table
->
date
(
'tanggal_lahir'
)
->
nullable
();
$table
->
string
(
'email'
)
->
unique
();
$table
->
timestamp
(
'email_verified_at'
)
->
nullable
();
$table
->
string
(
'password'
);
$table
->
string
(
'foto'
)
->
default
(
'default.png'
);
$table
->
unsignedBigInteger
(
'role_id'
)
->
default
(
5
);
$table
->
unsignedBigInteger
(
'unit
_id
'
)
->
nullable
();
$table
->
unsignedBigInteger
(
'
kd_
unit'
)
->
nullable
();
$table
->
foreign
(
'role_id'
)
->
references
(
'id'
)
->
on
(
'roles'
);
$table
->
foreign
(
'unit
_id
'
)
->
references
(
'
id
'
)
->
on
(
'unit
s
'
);
$table
->
foreign
(
'
kd_
unit'
)
->
references
(
'
kd_unit
'
)
->
on
(
'
m
unit'
);
$table
->
rememberToken
();
$table
->
timestamps
();
});
// Schema::create('password_reset_tokens', function (Blueprint $table) {
// $table->string('email')->primary();
// $table->string('token');
// $table->timestamp('created_at')->nullable();
// });
Schema
::
create
(
'sessions'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'id'
)
->
primary
();
$table
->
foreignId
(
'user_id'
)
->
nullable
()
->
index
();
...
...
@@ -51,7 +48,6 @@ public function up(): void
public
function
down
():
void
{
Schema
::
dropIfExists
(
'users'
);
// Schema::dropIfExists('password_reset_tokens');
Schema
::
dropIfExists
(
'sessions'
);
}
};
This diff is collapsed.
Click to expand it.
database/migrations/2024_03_26_073848_create_pelanggans_table.php
View file @
53108ba8
...
...
@@ -32,6 +32,7 @@ public function up(): void
$table
->
integer
(
'jmlh_penghuni'
);
$table
->
string
(
'unit'
)
->
nullable
();
$table
->
string
(
'foto_rumah'
)
->
nullable
();
$table
->
text
(
'keterangan'
)
->
nullable
();
$table
->
timestamps
();
});
}
...
...
This diff is collapsed.
Click to expand it.
database/migrations/
0001_01_01_000000_create_units
_table.php
→
database/migrations/
2024_04_25_102629_create_transaksi
_table.php
View file @
53108ba8
...
...
@@ -11,13 +11,13 @@
*/
public
function
up
():
void
{
Schema
::
create
(
'
units
'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'
transaksi
'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
integer
(
'kode_unit'
);
$table
->
string
(
'nama_unit
'
);
$table
->
text
(
'alamat'
)
->
nullable
(
);
$table
->
string
(
'
nomor_telepo
n'
)
->
nullable
();
$table
->
text
(
'wilayah
'
);
$table
->
foreignId
(
'pelanggan_id'
)
->
constrained
(
'pelanggans'
);
$table
->
bigInteger
(
'total_bayar
'
);
$table
->
enum
(
'status'
,
[
'PENDING'
,
'SUCCESS'
,
'FAILED'
]
);
$table
->
string
(
'
snap_toke
n'
)
->
nullable
();
//
$table->
date('tanggal_pembayaran
');
$table
->
timestamps
();
});
}
...
...
@@ -27,6 +27,6 @@ public function up(): void
*/
public
function
down
():
void
{
Schema
::
dropIfExists
(
'
units
'
);
Schema
::
dropIfExists
(
'
transaksi
'
);
}
};
This diff is collapsed.
Click to expand it.
database/seeders/RoleSeeder.php
View file @
53108ba8
...
...
@@ -17,7 +17,7 @@ public function run(): void
'nama'
=>
'superadmin'
,
]);
Role
::
create
([
'nama'
=>
'
admin
unit'
,
'nama'
=>
'unit'
,
]);
Role
::
create
([
'nama'
=>
'pegawai'
,
...
...
This diff is collapsed.
Click to expand it.
database/seeders/UnitSeeder.php
View file @
53108ba8
...
...
@@ -2,7 +2,7 @@
namespace
Database\Seeders
;
use
App\Models\Unit
;
use
App\Models\Unit
s
;
use
Illuminate\Database\Console\Seeds\WithoutModelEvents
;
use
Illuminate\Database\Seeder
;
...
...
@@ -13,20 +13,27 @@ class UnitSeeder extends Seeder
*/
public
function
run
():
void
{
Unit
::
create
([
'kode_unit'
=>
'001'
,
'nama_unit'
=>
'Unit 1'
,
'alamat'
=>
'Jl. Jendral Sudirman No. 1'
,
'nomor_telepon'
=>
'021-1234567'
,
'wilayah'
=>
'gondang, sambungmacan, tangen'
]);
Unit
::
create
([
'kode_unit'
=>
'002'
,
'nama_unit'
=>
'Unit 2'
,
'alamat'
=>
'Jl. Jendral Aha No. 1'
,
'nomor_telepon'
=>
'021-1234500'
,
'wilayah'
=>
'Bulak Asri, Plumbungan'
]);
Units
::
insert
([
'kd_unit'
=>
00
,
'nm_unit'
=>
'Sragen'
]);
Units
::
insert
([
'kd_unit'
=>
01
,
'nm_unit'
=>
'Sukodono'
]);
Units
::
insert
([
'kd_unit'
=>
02
,
'nm_unit'
=>
'Gemolong'
]);
Units
::
insert
([
'kd_unit'
=>
03
,
'nm_unit'
=>
'Masaran'
]);
Units
::
insert
([
'kd_unit'
=>
04
,
'nm_unit'
=>
'Tanon'
]);
Units
::
insert
([
'kd_unit'
=>
05
,
'nm_unit'
=>
'Sidoharjo'
]);
Units
::
insert
([
'kd_unit'
=>
06
,
'nm_unit'
=>
'Sumberlawang'
]);
Units
::
insert
([
'kd_unit'
=>
07
,
'nm_unit'
=>
'Mojokerto'
]);
// Units::insert(['kd_unit' => 08 , 'nm_unit' => 'Sambirejo']);
Units
::
insert
([
'kd_unit'
=>
'08'
,
'nm_unit'
=>
'Sambirejo'
]);
Units
::
insert
([
'kd_unit'
=>
'09'
,
'nm_unit'
=>
'Gondang'
]);
Units
::
insert
([
'kd_unit'
=>
10
,
'nm_unit'
=>
'Pengkok'
]);
Units
::
insert
([
'kd_unit'
=>
11
,
'nm_unit'
=>
'Sambungmacan'
]);
Units
::
insert
([
'kd_unit'
=>
12
,
'nm_unit'
=>
'Kalijambe'
]);
Units
::
insert
([
'kd_unit'
=>
99
,
'nm_unit'
=>
'Gabungan'
]);
Units
::
insert
([
'kd_unit'
=>
13
,
'nm_unit'
=>
'Ngrampal'
]);
Units
::
insert
([
'kd_unit'
=>
14
,
'nm_unit'
=>
'Plupuh'
]);
Units
::
insert
([
'kd_unit'
=>
15
,
'nm_unit'
=>
'Jirapan'
]);
Units
::
insert
([
'kd_unit'
=>
88
,
'nm_unit'
=>
'AirTangki'
]);
Units
::
insert
([
'kd_unit'
=>
16
,
'nm_unit'
=>
'Mondokan'
]);
Units
::
insert
([
'kd_unit'
=>
17
,
'nm_unit'
=>
'Jenar'
]);
}
}
This diff is collapsed.
Click to expand it.
database/seeders/UserSeeder.php
View file @
53108ba8
...
...
@@ -16,29 +16,33 @@ public function run(): void
// super Admin
User
::
create
([
'username'
=>
'superadmin'
,
'nama'
=>
'Super Admin'
,
'email'
=>
'superadmin@gmail.com'
,
'password'
=>
bcrypt
(
'123'
),
'role_id'
=>
1
,
]);
// Admin Unit
User
::
create
([
'username'
=>
'unit1'
,
'email'
=>
'unit1@gmail.com'
,
'username'
=>
'sragen'
,
'nama'
=>
'sragen'
,
'email'
=>
'sragen@gmail.com'
,
'password'
=>
bcrypt
(
'123'
),
'role_id'
=>
2
,
'unit
_id
'
=>
1
,
'
kd_
unit'
=>
00
,
]);
// Pegawai Unit
User
::
create
([
'username'
=>
'Asep'
,
'nama'
=>
'Asep Sutisna'
,
'email'
=>
'asep@gmail.com'
,
'password'
=>
bcrypt
(
'123'
),
'role_id'
=>
3
,
'unit
_id
'
=>
1
,
'
kd_
unit'
=>
00
,
]);
// Pelanggan
User
::
create
([
'username'
=>
'Budi'
,
'nama'
=>
'Budi Santoso'
,
'email'
=>
'budi@gmail.com'
,
'password'
=>
bcrypt
(
'123'
),
'role_id'
=>
5
,
...
...
This diff is collapsed.
Click to expand it.
public/css/style.css
View file @
53108ba8
...
...
@@ -51,13 +51,22 @@ select {
margin-top
:
2px
;
width
:
100%
;
box-sizing
:
border-box
;
font-family
:
montserrat
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
color
:
#2c3e50
;
background-color
:
#eceff1
;
font-size
:
16px
;
letter-spacing
:
1px
;
}
.title
{
display
:
flex
;
width
:
100%
;
justify-content
:
center
;
font-size
:
35px
;
margin-bottom
:
20px
;
font-weight
:
bold
;
}
.form-card
{
text-align
:
left
;
}
...
...
@@ -68,14 +77,15 @@ .msform fieldset:not(:first-of-type) {
.msform
input
,
.msform
textarea
{
padding
:
8px
15px
8px
15px
;
border
:
1px
solid
#ccc
;
border-radius
:
0px
;
border-radius
:
1
0px
;
margin-bottom
:
25px
;
margin-top
:
2px
;
width
:
100%
;
box-sizing
:
border-box
;
font-family
:
montserrat
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
color
:
#2c3e50
;
background-color
:
#eceff1
;
font-size
:
16px
;
...
...
@@ -97,7 +107,7 @@ .msform .action-button {
font-weight
:
bold
;
color
:
white
;
border
:
0
none
;
border-radius
:
0
px
;
border-radius
:
7
px
;
cursor
:
pointer
;
padding
:
10px
5px
;
margin
:
10px
0px
10px
5px
;
...
...
@@ -115,7 +125,7 @@ .msform .action-button-previous {
font-weight
:
bold
;
color
:
white
;
border
:
0
none
;
border-radius
:
0
px
;
border-radius
:
7
px
;
cursor
:
pointer
;
padding
:
10px
5px
;
margin
:
10px
5px
10px
0px
;
...
...
@@ -212,22 +222,22 @@ #progressbar li {
}
#progressbar
#account
:before
{
font-family
:
FontAwesome
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
content
:
"\f13e"
;
}
#progressbar
#personal
:before
{
font-family
:
FontAwesome
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
content
:
"\f007"
;
}
#progressbar
#payment
:before
{
font-family
:
FontAwesome
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
content
:
"\f030"
;
}
#progressbar
#confirm
:before
{
font-family
:
FontAwesome
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
content
:
"\f00c"
;
}
...
...
This diff is collapsed.
Click to expand it.
public/img/IMG_9494.JPG
0 → 100644
View file @
53108ba8
303 KB
This diff is collapsed.
Click to expand it.
public/img/toeic-4.jpg
0 → 100644
View file @
53108ba8
35.3 KB
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help