Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ridwan Hidayat
go-wisata
Commits
3f7c3f59
Commit
3f7c3f59
authored
2 years ago
by
dindarestika
Browse files
Options
Download
Email Patches
Plain Diff
tambah grafik
parent
00028576
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
app/Http/Controllers/Auth/RegisterController.php
+1
-1
app/Http/Controllers/Auth/RegisterController.php
app/Http/Controllers/BookingEventController.php
+2
-1
app/Http/Controllers/BookingEventController.php
app/Http/Controllers/DashboardController.php
+52
-6
app/Http/Controllers/DashboardController.php
app/Http/Controllers/EventController.php
+153
-3
app/Http/Controllers/EventController.php
app/Http/Controllers/FrontendController.php
+1
-40
app/Http/Controllers/FrontendController.php
app/Http/Controllers/ProfileController.php
+3
-3
app/Http/Controllers/ProfileController.php
app/Http/Controllers/TempatSewaController.php
+17
-4
app/Http/Controllers/TempatSewaController.php
app/Http/Controllers/TiketController.php
+0
-93
app/Http/Controllers/TiketController.php
app/Http/Controllers/TodayController.php
+0
-1
app/Http/Controllers/TodayController.php
public/images/8dJFMe3Z3zO47VxKNanqmDYzhWIl2Es2zgkNglfr.jpg
+0
-0
public/images/8dJFMe3Z3zO47VxKNanqmDYzhWIl2Es2zgkNglfr.jpg
public/images/BbU1gw8ni7AWQdi1SgynaftLmo7OZifJUVY2nl5d.jpg
+0
-0
public/images/BbU1gw8ni7AWQdi1SgynaftLmo7OZifJUVY2nl5d.jpg
public/images/LERx46TTqlM7PWqUSd8aZepMUQfWouqdJF7FCrlg.png
+0
-0
public/images/LERx46TTqlM7PWqUSd8aZepMUQfWouqdJF7FCrlg.png
public/images/W9sDGdk9AxSFYYz5JFawyKeC8AnhwAz1JgopiLQC.png
+0
-0
public/images/W9sDGdk9AxSFYYz5JFawyKeC8AnhwAz1JgopiLQC.png
public/images/dVWmAdOSUqyrIEWil1LBE3gYLbNN2nyEbhmshlJP.png
+0
-0
public/images/dVWmAdOSUqyrIEWil1LBE3gYLbNN2nyEbhmshlJP.png
public/images/i1PGppJrRE2eXhcUXsaeuM84uDjI9Uygl4AkkSag.png
+0
-0
public/images/i1PGppJrRE2eXhcUXsaeuM84uDjI9Uygl4AkkSag.png
public/images/p9T1Js5d1nGglTtLS2dFDJD0XQ6vfot1zKljEdCq.jpg
+0
-0
public/images/p9T1Js5d1nGglTtLS2dFDJD0XQ6vfot1zKljEdCq.jpg
public/images/sH6WyiL2nd3YiTXcQX477i7LoSPHKcbbGJKIqv0t.png
+0
-0
public/images/sH6WyiL2nd3YiTXcQX477i7LoSPHKcbbGJKIqv0t.png
public/images/vpaANuz7me4sBqoiF3H2fb6plMVhvBQ8YOFazhwu.jpg
+0
-0
public/images/vpaANuz7me4sBqoiF3H2fb6plMVhvBQ8YOFazhwu.jpg
public/images/vt1ttjt45lnobMQfd7dWyndFbDnQpnLcugggdxwb.png
+0
-0
public/images/vt1ttjt45lnobMQfd7dWyndFbDnQpnLcugggdxwb.png
public/images/xPEnNdhFuMG5CuhfCwlSfQgbxRRIwM0xZcUHHp1X.png
+0
-0
public/images/xPEnNdhFuMG5CuhfCwlSfQgbxRRIwM0xZcUHHp1X.png
with
229 additions
and
152 deletions
+229
-152
app/Http/Controllers/Auth/RegisterController.php
View file @
3f7c3f59
...
...
@@ -53,7 +53,7 @@ class RegisterController extends Controller
return
Validator
::
make
(
$data
,
[
'name'
=>
[
'required'
,
'string'
,
'max:255'
],
'email'
=>
[
'required'
,
'string'
,
'email'
,
'max:255'
,
'unique:users'
],
'password'
=>
[
'required'
,
'string'
,
'min:
8
'
,
'confirmed'
],
'password'
=>
[
'required'
,
'string'
,
'min:
6
'
,
'confirmed'
],
'telp'
=>
[
'required'
,
'numeric'
,
'min:10'
],
]);
...
...
This diff is collapsed.
Click to expand it.
app/Http/Controllers/BookingEventController.php
View file @
3f7c3f59
...
...
@@ -29,6 +29,7 @@ class BookingEventController extends Controller
public
function
index
()
{
$event
=
Event
::
all
();
$ue
=
Event
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
get
();
$bookingevent
=
BookingEvent
::
orderby
(
'id'
,
'desc'
)
->
get
();
$total_order
=
BookingEvent
::
count
();
$sudah_dibayar
=
0
;
...
...
@@ -49,7 +50,7 @@ class BookingEventController extends Controller
$selesai
+=
1
;
}
}
return
view
(
'admin.booking.halaman_bookingevent'
,
compact
(
'bookingevent'
,
'event'
,
'total_order'
,
'sudah_dibayar'
,
'belum_dibayar'
,
'selesai'
));
return
view
(
'admin.booking.halaman_bookingevent'
,
compact
(
'bookingevent'
,
'event'
,
'total_order'
,
'sudah_dibayar'
,
'belum_dibayar'
,
'selesai'
,
'ue'
));
}
/**
...
...
This diff is collapsed.
Click to expand it.
app/Http/Controllers/DashboardController.php
View file @
3f7c3f59
...
...
@@ -9,6 +9,8 @@ use App\Models\TempatSewa;
use
Illuminate\Http\Request
;
use
App\Models\Tiket
;
use
Auth
;
use
Carbon\Carbon
;
class
DashboardController
extends
Controller
{
...
...
@@ -170,6 +172,8 @@ class DashboardController extends Controller
$tempattt
=
Tempat
::
where
(
'id'
,
$induk_id
)
->
where
(
'status'
,
'1'
)
->
first
();
$event
=
Event
::
count
();
$tempat_sewa
=
TempatSewa
::
count
();
//count pemesanan perhari
$users
=
Detail_transaksi
::
select
(
\
DB
::
raw
(
"COUNT(*) as count"
))
->
where
(
'tempat_id'
,
$tempatt
->
id
)
->
whereYear
(
'tanggal_a'
,
date
(
'Y'
))
...
...
@@ -185,17 +189,59 @@ class DashboardController extends Controller
->
groupBy
(
'tanggal_a'
)
->
pluck
(
'tanggal_a'
);
return
view
(
'admin.dashboard.event_sewatempat'
,
compact
(
'tempattt'
,
'tempatt'
,
'tempat'
,
'event'
,
'tempat_sewa'
,
'users'
,
'datee'
));
//count grafik chart pertahun
$thn_sekarang
=
Carbon
::
now
()
->
isoFormat
(
'YYYY'
);
$total_jan
=
0
;
$total_feb
=
0
;
$total_mar
=
0
;
$total_apr
=
0
;
$total_mei
=
0
;
$total_jun
=
0
;
$total_juli
=
0
;
$total_agus
=
0
;
$total_sept
=
0
;
$total_okto
=
0
;
$total_nove
=
0
;
$total_dese
=
0
;
foreach
(
Detail_transaksi
::
where
(
'tempat_id'
,
$tempatt
->
id
)
->
get
()
as
$ff
)
{
$k
=
date
(
'm'
,
strtotime
(
$ff
->
tanggal_a
));
$y
=
date
(
'Y'
,
strtotime
(
$ff
->
tanggal_a
));
if
(
$y
==
$thn_sekarang
)
{
if
(
$k
==
'07'
)
{
$total_juli
+=
1
;
}
elseif
(
$k
==
'01'
)
{
$total_jan
+=
1
;
}
elseif
(
$k
==
'02'
)
{
$total_feb
+=
1
;
}
elseif
(
$k
==
'03'
)
{
$total_mar
+=
1
;
}
elseif
(
$k
==
'04'
)
{
$total_apr
+=
1
;
}
elseif
(
$k
==
'05'
)
{
$total_mei
+=
1
;
}
elseif
(
$k
==
'06'
)
{
$total_jun
+=
1
;
}
elseif
(
$k
==
'08'
)
{
$total_agus
+=
1
;
}
elseif
(
$k
==
'09'
)
{
$total_sept
+=
1
;
}
elseif
(
$k
==
'10'
)
{
$total_okto
+=
1
;
}
elseif
(
$k
==
'11'
)
{
$total_nove
+=
1
;
}
elseif
(
$k
==
'12'
)
{
$total_dese
+=
1
;
}
}
}
return
view
(
'admin.dashboard.event_sewatempat'
,
compact
(
'tempattt'
,
'tempatt'
,
'tempat'
,
'event'
,
'tempat_sewa'
,
'users'
,
'datee'
,
'thn_sekarang'
,
'total_juli'
,
'total_agus'
,
'total_sept'
,
'total_okto'
,
'total_nove'
,
'total_dese'
,
'total_jan'
,
'total_feb'
,
'total_mar'
,
'total_apr'
,
'total_mei'
,
'total_jun'
));
}
if
(
Auth
::
user
()
->
role
->
name
==
'pelanggan'
)
{
return
redirect
(
'/'
);
}
}
return
view
(
'error'
);
// return view('admin');
}
}
This diff is collapsed.
Click to expand it.
app/Http/Controllers/EventController.php
View file @
3f7c3f59
...
...
@@ -9,8 +9,14 @@ use App\Models\KategoriEvent;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Str
;
use
Carbon\Carbon
;
use
App\Models\Setting
;
use
App\Models\User
;
use
App\Models\Tempat
;
use
App\Models\Tiket
;
use
App\Models\BookingEvent
;
use
App\Models\PesertaEvent
;
use
App\Models\Detail_transaksi
;
use
App\Models\Pay
;
use
Illuminate\Support\Facades\Auth
;
...
...
@@ -55,7 +61,7 @@ class EventController extends Controller
}
public
function
index_event
()
{
$event
=
Event
::
orderby
(
'id'
,
'desc'
)
->
get
();
$event
=
Event
::
orderby
(
'id'
,
'desc'
)
->
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
get
();
$kategorievent
=
KategoriEvent
::
all
();
return
view
(
'admin.event.halaman_event'
,
[
'event'
=>
$event
,
...
...
@@ -177,4 +183,148 @@ class EventController extends Controller
$data
=
Event
::
where
(
'id'
,
$id
)
->
first
();
return
view
(
'admin.event.print_pesertaevent'
,
compact
(
'data'
));
}
public
function
explore_event_detail
(
Request
$request
,
$id
,
$nama
,
$harga
,
$tgl_buka
,
$tgl_tutup
,
$kapasitas_akhir
,
$kapasitas_awal
)
{
$setting
=
Setting
::
first
();
if
(
$request
->
has
(
'cari'
))
{
$event
=
Event
::
where
(
'nama'
,
'LIKE'
,
'%'
.
$request
->
cari
.
'%'
)
->
where
(
'status'
,
1
)
->
orderby
(
'tgl_buka'
,
'DESC'
)
->
paginate
(
5
);
}
else
{
$event
=
Event
::
where
(
'status'
,
1
)
->
orderby
(
'tgl_buka'
,
'DESC'
)
->
paginate
(
5
);
}
if
(
$kapasitas_akhir
+
$request
->
jml_orang
>
$kapasitas_awal
)
{
Toastr
::
warning
(
'Tiket tinggal sisa untuk '
.
$kapasitas_awal
-
$kapasitas_akhir
.
' orang'
,
'Warning'
);
return
redirect
(
'/explore-event'
);
}
else
{
$data
[
'jml_orang'
]
=
$request
->
jml_orang
;
return
view
(
'explore/halaman_explore_event_detail'
,
[
"title"
=>
"Explore"
,
"setting"
=>
$setting
,
"jml_orang"
=>
$data
[
'jml_orang'
],
"id"
=>
$id
,
"harga"
=>
$harga
,
"nama_event"
=>
$nama
,
"tgl_buka"
=>
$tgl_buka
,
"tgl_tutup"
=>
$tgl_tutup
,
]);
}
}
public
function
pesantiketevent
(
Request
$request
,
$jml_orang
,
$id
,
$harga
,
$nama_event
,
$tgl_buka
,
$tgl_tutup
)
{
$jamsekarang
=
Carbon
::
now
();
$user_event
=
Event
::
where
(
'id'
,
$id
)
->
first
();
$user_eventt
=
$user_event
->
user_id
;
$users
=
User
::
where
(
'id'
,
$user_eventt
)
->
first
();
$dt
=
Tempat
::
where
(
'user_id'
,
$users
->
petugas_id
)
->
first
();
$tempat_id
=
$dt
->
id
;
$totalbiaya
=
$jml_orang
*
$harga
;
$nama
=
auth
()
->
user
()
->
name
;
$user_id
=
auth
()
->
user
()
->
id
;
$datatiket
=
Tiket
::
max
(
'id'
);
$urutantiket
=
(
int
)(
$datatiket
);
$urutantiket
++
;
$huruftiket
=
"LT-"
;
$checkout_kode
=
$huruftiket
.
$urutantiket
.
uniqid
();
$kode_booking
=
$request
->
kode_booking
;
BookingEvent
::
create
([
'kode_tiket'
=>
$checkout_kode
,
'kode_booking'
=>
$kode_booking
,
'nama'
=>
$nama
,
'jml_orang'
=>
$jml_orang
,
'biaya'
=>
$totalbiaya
,
'user_id'
=>
$user_id
,
'event_id'
=>
$id
,
'status'
=>
'1'
,
]);
$kode_peserta
=
array
();
$nama_peserta
=
array
();
$email
=
array
();
$telp
=
array
();
foreach
(
$request
->
kode_peserta
as
$k
)
{
array_push
(
$kode_peserta
,
$k
);
}
foreach
(
$request
->
nama_peserta
as
$n
)
{
array_push
(
$nama_peserta
,
$n
);
}
foreach
(
$request
->
email
as
$e
)
{
array_push
(
$email
,
$e
);
}
foreach
(
$request
->
telp
as
$t
)
{
array_push
(
$telp
,
$t
);
}
for
(
$i
=
0
;
$i
<
$jml_orang
;
$i
++
)
{
$peserta
=
new
PesertaEvent
();
$peserta
->
kode_peserta
=
$kode_peserta
[
$i
];
$peserta
->
kode_booking
=
$kode_booking
;
$peserta
->
nama_peserta
=
$nama_peserta
[
$i
];
$peserta
->
email
=
$email
[
$i
];
$peserta
->
telp
=
$telp
[
$i
];
$peserta
->
event_id
=
$id
;
$peserta
->
user_id
=
$user_id
;
$peserta
->
save
();
}
$formatted_dt1
=
Carbon
::
parse
(
$tgl_buka
);
$formatted_dt2
=
Carbon
::
parse
(
$tgl_tutup
);
$durasi
=
$formatted_dt1
->
diffInDays
(
$formatted_dt2
);
Detail_transaksi
::
create
([
"name"
=>
"Event
$nama_event
"
,
"durasi"
=>
$durasi
+
1
,
"tanggal_a"
=>
$tgl_buka
,
"tanggal_b"
=>
$tgl_tutup
,
"user_id"
=>
Auth
::
user
()
->
id
,
"kode_tiket"
=>
$checkout_kode
,
"id_produk"
=>
$id
,
"booking_id"
=>
$kode_booking
,
"jumlah"
=>
$jml_orang
,
"harga"
=>
$totalbiaya
,
"kategori"
=>
"events"
,
"tempat_id"
=>
$tempat_id
,
]);
if
(
$totalbiaya
<=
0
)
{
Tiket
::
create
([
'kode'
=>
$checkout_kode
,
'user_id'
=>
Auth
::
user
()
->
id
,
'check'
=>
'settlement'
,
'name'
=>
Auth
::
user
()
->
name
,
'email'
=>
Auth
::
user
()
->
email
,
'telp'
=>
Auth
::
user
()
->
telp
,
'harga'
=>
$totalbiaya
,
'status'
=>
1
,
"tempat_id"
=>
$tempat_id
,
]);
Pay
::
create
([
'id'
=>
$checkout_kode
,
'status_message'
=>
'settlement'
,
'order_id'
=>
$checkout_kode
,
'payment_type'
=>
'gratis'
,
'transaction_time'
=>
$jamsekarang
,
'transaction_status'
=>
'settlement'
,
'va_bank'
=>
null
,
'va_number'
=>
null
,
'kodeku'
=>
$checkout_kode
,
]);
$review
=
new
ReviewEvent
();
$review
->
kode_tiket
=
$checkout_kode
;
$review
->
save
();
Toastr
::
success
(
'Berhasil pesan, gratis bisa langsung cetak invoice :) '
,
'Success'
);
}
else
{
Tiket
::
create
([
'kode'
=>
$checkout_kode
,
'user_id'
=>
Auth
::
user
()
->
id
,
'name'
=>
Auth
::
user
()
->
name
,
'email'
=>
Auth
::
user
()
->
email
,
'telp'
=>
Auth
::
user
()
->
telp
,
'harga'
=>
$totalbiaya
,
"tempat_id"
=>
$tempat_id
,
]);
Toastr
::
success
(
'Berhasil pesan, silahkan cek detail pesanan dan lakukan pembayaran :) '
,
'Success'
);
}
return
redirect
(
"pesananku"
);
}
}
This diff is collapsed.
Click to expand it.
app/Http/Controllers/FrontendController.php
View file @
3f7c3f59
...
...
@@ -108,31 +108,7 @@ class FrontendController extends Controller
'avg'
=>
$avg
,
]);
}
public
function
explore_event_detail
(
Request
$request
,
$id
,
$nama
,
$harga
,
$tgl_buka
,
$tgl_tutup
,
$kapasitas_akhir
,
$kapasitas_awal
)
{
$setting
=
Setting
::
first
();
if
(
$request
->
has
(
'cari'
))
{
$event
=
Event
::
where
(
'nama'
,
'LIKE'
,
'%'
.
$request
->
cari
.
'%'
)
->
where
(
'status'
,
1
)
->
orderby
(
'tgl_buka'
,
'DESC'
)
->
paginate
(
5
);
}
else
{
$event
=
Event
::
where
(
'status'
,
1
)
->
orderby
(
'tgl_buka'
,
'DESC'
)
->
paginate
(
5
);
}
if
(
$kapasitas_akhir
+
$request
->
jml_orang
>
$kapasitas_awal
)
{
Toastr
::
warning
(
'Tiket tinggal sisa untuk '
.
$kapasitas_awal
-
$kapasitas_akhir
.
' orang'
,
'Warning'
);
return
redirect
(
'/explore-event'
);
}
else
{
$data
[
'jml_orang'
]
=
$request
->
jml_orang
;
return
view
(
'explore/halaman_explore_event_detail'
,
[
"title"
=>
"Explore"
,
"setting"
=>
$setting
,
"jml_orang"
=>
$data
[
'jml_orang'
],
"id"
=>
$id
,
"harga"
=>
$harga
,
"nama_event"
=>
$nama
,
"tgl_buka"
=>
$tgl_buka
,
"tgl_tutup"
=>
$tgl_tutup
,
]);
}
}
public
function
event
()
...
...
@@ -909,19 +885,4 @@ class FrontendController extends Controller
"durasi"
=>
$durasi
,
]);
}
public
function
booking_tempatsewa
(
Request
$request
,
$checkin
,
$checkout
,
$id
)
{
// $tempatsewa_id = $id;
$tempatsewa
=
TempatSewa
::
find
(
$id
);
$formatted_dt1
=
Carbon
::
parse
(
$checkin
);
$formatted_dt2
=
Carbon
::
parse
(
$checkout
);
$durasi
=
$formatted_dt1
->
diffInDays
(
$formatted_dt2
);
return
view
(
'explore/halaman_tempatsewa_formpesan'
,
[
"title"
=>
"Explore"
,
"tempatsewa"
=>
$tempatsewa
,
"checkin"
=>
$checkin
,
"checkout"
=>
$checkout
,
"durasi"
=>
$durasi
,
]);
}
}
This diff is collapsed.
Click to expand it.
app/Http/Controllers/ProfileController.php
View file @
3f7c3f59
...
...
@@ -126,12 +126,11 @@ class ProfileController extends Controller
*/
public
function
update
(
Request
$request
,
$id
)
{
//
// dd($request);
$data
=
$request
->
all
();
$admin
=
User
::
where
(
'id'
,
$id
)
->
first
();
$user
=
User
::
find
(
$id
);
$request
->
validate
([
'email'
=>
[
'required'
,
'string'
,
'email'
,
'max:255'
,
'unique:users'
],
'image'
=>
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
]);
$userPassword
=
$user
->
password
;
...
...
@@ -163,6 +162,7 @@ class ProfileController extends Controller
$data
=
$request
->
all
();
$request
->
validate
([
'email'
=>
[
'required'
,
'string'
,
'email'
,
'max:255'
,
'unique:users'
],
'image'
=>
'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
,
]);
...
...
@@ -189,7 +189,7 @@ class ProfileController extends Controller
$data
[
'password'
]
=
bcrypt
(
$request
->
password
);
$request
->
validate
([
'current_password'
=>
[
'required'
,
new
MatchOldPassword
],
'new_password'
=>
[
'required'
],
'new_password'
=>
[
'required'
|
'min:6'
],
'new_confirm_password'
=>
[
'same:new_password'
],
]);
...
...
This diff is collapsed.
Click to expand it.
app/Http/Controllers/TempatSewaController.php
View file @
3f7c3f59
...
...
@@ -14,8 +14,7 @@ use App\Models\BookingTempatSewa;
use
App\Models\ReviewTempatSewa
;
use
App\Models\Tiket
;
use
App\Models\User
;
use
App\Models\ReviewEvent
;
class
TempatSewaController
extends
Controller
...
...
@@ -27,7 +26,7 @@ class TempatSewaController extends Controller
*/
public
function
index
()
{
$tempatsewa
=
TempatSewa
::
orderby
(
'id'
,
'desc'
)
->
get
();
$tempatsewa
=
TempatSewa
::
orderby
(
'id'
,
'desc'
)
->
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
get
();
return
view
(
'admin.tempatsewa.halaman_tempatsewa'
,
[
'tempatsewa'
=>
$tempatsewa
]);
...
...
@@ -240,7 +239,7 @@ class TempatSewaController extends Controller
"kategori"
=>
"tempat sewa"
,
"tempat_id"
=>
$tempat_id
,
]);
Toastr
::
success
(
'Berhasil pesan, silahkan cek detail pesanan dan lakukan pembayaran :) '
,
'Success'
);
return
redirect
(
"pesananku"
);
}
public
function
review_index
()
...
...
@@ -257,4 +256,18 @@ class TempatSewaController extends Controller
Toastr
::
success
(
' Berhasil menghapus data:)'
,
'Success'
);
return
redirect
()
->
back
();
}
public
function
booking_tempatsewa
(
Request
$request
,
$checkin
,
$checkout
,
$id
)
{
$tempatsewa
=
TempatSewa
::
find
(
$id
);
$formatted_dt1
=
Carbon
::
parse
(
$checkin
);
$formatted_dt2
=
Carbon
::
parse
(
$checkout
);
$durasi
=
$formatted_dt1
->
diffInDays
(
$formatted_dt2
);
return
view
(
'explore/halaman_tempatsewa_formpesan'
,
[
"title"
=>
"Explore"
,
"tempatsewa"
=>
$tempatsewa
,
"checkin"
=>
$checkin
,
"checkout"
=>
$checkout
,
"durasi"
=>
$durasi
,
]);
}
}
This diff is collapsed.
Click to expand it.
app/Http/Controllers/TiketController.php
View file @
3f7c3f59
...
...
@@ -1358,97 +1358,4 @@ class TiketController extends Controller
'telp'
=>
'required'
,
]);
}
public
function
pesantiketevent
(
Request
$request
,
$jml_orang
,
$id
,
$harga
,
$nama_event
,
$tgl_buka
,
$tgl_tutup
)
{
// $dt = Tempat::where('user_id', 'D007')->first();
// $tempat_id = $dt->id;
$user_event
=
Event
::
where
(
'id'
,
$id
)
->
first
();
$user_eventt
=
$user_event
->
user_id
;
$users
=
User
::
where
(
'id'
,
$user_eventt
)
->
first
();
$dt
=
Tempat
::
where
(
'user_id'
,
$users
->
petugas_id
)
->
first
();
$tempat_id
=
$dt
->
id
;
$totalbiaya
=
$jml_orang
*
$harga
;
$nama
=
auth
()
->
user
()
->
name
;
$user_id
=
auth
()
->
user
()
->
id
;
$datatiket
=
Tiket
::
max
(
'id'
);
$urutantiket
=
(
int
)(
$datatiket
);
$urutantiket
++
;
$huruftiket
=
"LT-"
;
$checkout_kode
=
$huruftiket
.
$urutantiket
.
uniqid
();
$kode_booking
=
$request
->
kode_booking
;
// dd($kode_booking);
BookingEvent
::
create
([
'kode_tiket'
=>
$checkout_kode
,
'kode_booking'
=>
$kode_booking
,
'nama'
=>
$nama
,
'jml_orang'
=>
$jml_orang
,
'biaya'
=>
$totalbiaya
,
'user_id'
=>
$user_id
,
'event_id'
=>
$id
,
'status'
=>
'1'
,
]);
$kode_peserta
=
array
();
$nama_peserta
=
array
();
$email
=
array
();
$telp
=
array
();
foreach
(
$request
->
kode_peserta
as
$k
)
{
array_push
(
$kode_peserta
,
$k
);
}
foreach
(
$request
->
nama_peserta
as
$n
)
{
array_push
(
$nama_peserta
,
$n
);
}
foreach
(
$request
->
email
as
$e
)
{
array_push
(
$email
,
$e
);
}
foreach
(
$request
->
telp
as
$t
)
{
array_push
(
$telp
,
$t
);
}
for
(
$i
=
0
;
$i
<
$jml_orang
;
$i
++
)
{
$peserta
=
new
PesertaEvent
();
$peserta
->
kode_peserta
=
$kode_peserta
[
$i
];
$peserta
->
kode_booking
=
$kode_booking
;
$peserta
->
nama_peserta
=
$nama_peserta
[
$i
];
$peserta
->
email
=
$email
[
$i
];
$peserta
->
telp
=
$telp
[
$i
];
$peserta
->
event_id
=
$id
;
$peserta
->
user_id
=
$user_id
;
$peserta
->
save
();
}
Tiket
::
create
([
'kode'
=>
$checkout_kode
,
'user_id'
=>
Auth
::
user
()
->
id
,
'name'
=>
Auth
::
user
()
->
name
,
'email'
=>
Auth
::
user
()
->
email
,
'telp'
=>
Auth
::
user
()
->
telp
,
'harga'
=>
$totalbiaya
,
"tempat_id"
=>
$tempat_id
,
]);
$formatted_dt1
=
Carbon
::
parse
(
$tgl_buka
);
$formatted_dt2
=
Carbon
::
parse
(
$tgl_tutup
);
$durasi
=
$formatted_dt1
->
diffInDays
(
$formatted_dt2
);
Detail_transaksi
::
create
([
"name"
=>
"Event
$nama_event
"
,
"durasi"
=>
$durasi
+
1
,
"tanggal_a"
=>
$tgl_buka
,
"tanggal_b"
=>
$tgl_tutup
,
"user_id"
=>
Auth
::
user
()
->
id
,
"kode_tiket"
=>
$checkout_kode
,
"id_produk"
=>
$id
,
"booking_id"
=>
$kode_booking
,
"jumlah"
=>
$jml_orang
,
"harga"
=>
$totalbiaya
,
"kategori"
=>
"events"
,
"tempat_id"
=>
$tempat_id
,
]);
Toastr
::
success
(
'Berhasil pesan, silahkan cek detail pesanan dan lakukan pembayaran :) '
,
'Success'
);
return
redirect
(
"pesananku"
);
}
}
This diff is collapsed.
Click to expand it.
app/Http/Controllers/TodayController.php
View file @
3f7c3f59
...
...
@@ -129,7 +129,6 @@ class TodayController extends Controller
date_default_timezone_set
(
'Asia/Jakarta'
);
$today
=
Carbon\Carbon
::
now
()
->
format
(
'Y-m-d'
);
$tempat
=
Tempat
::
where
(
'user_id'
,
Auth
::
user
()
->
petugas_id
)
->
where
(
'status'
,
'1'
)
->
first
();
$data
=
Detail_transaksi
::
where
(
'tanggal_a'
,
$today
)
->
where
(
'kategori'
,
'events'
)
->
where
(
'tempat_id'
,
$tempat
->
id
)
->
orderBy
(
'created_at'
,
'ASC'
)
->
get
();
$data2
=
Detail_transaksi
::
where
(
'tanggal_a'
,
$today
)
->
where
(
'kategori'
,
'events'
)
->
where
(
'tempat_id'
,
$tempat
->
id
)
->
where
(
'status'
,
3
)
->
get
();
...
...
This diff is collapsed.
Click to expand it.
public/images/8dJFMe3Z3zO47VxKNanqmDYzhWIl2Es2zgkNglfr.jpg
0 → 100644
View file @
3f7c3f59
2.51 MB
This diff is collapsed.
Click to expand it.
public/images/BbU1gw8ni7AWQdi1SgynaftLmo7OZifJUVY2nl5d.jpg
0 → 100644
View file @
3f7c3f59
960 KB
This diff is collapsed.
Click to expand it.
public/images/LERx46TTqlM7PWqUSd8aZepMUQfWouqdJF7FCrlg.png
0 → 100644
View file @
3f7c3f59
2.94 MB
This diff is collapsed.
Click to expand it.
public/images/W9sDGdk9AxSFYYz5JFawyKeC8AnhwAz1JgopiLQC.png
0 → 100644
View file @
3f7c3f59
2.94 MB
This diff is collapsed.
Click to expand it.
public/images/dVWmAdOSUqyrIEWil1LBE3gYLbNN2nyEbhmshlJP.png
0 → 100644
View file @
3f7c3f59
2.4 MB
This diff is collapsed.
Click to expand it.
public/images/i1PGppJrRE2eXhcUXsaeuM84uDjI9Uygl4AkkSag.png
0 → 100644
View file @
3f7c3f59
1.28 MB
This diff is collapsed.
Click to expand it.
public/images/p9T1Js5d1nGglTtLS2dFDJD0XQ6vfot1zKljEdCq.jpg
0 → 100644
View file @
3f7c3f59
2.12 MB
This diff is collapsed.
Click to expand it.
public/images/sH6WyiL2nd3YiTXcQX477i7LoSPHKcbbGJKIqv0t.png
0 → 100644
View file @
3f7c3f59
2.94 MB
This diff is collapsed.
Click to expand it.
public/images/vpaANuz7me4sBqoiF3H2fb6plMVhvBQ8YOFazhwu.jpg
0 → 100644
View file @
3f7c3f59
1.28 MB
This diff is collapsed.
Click to expand it.
public/images/vt1ttjt45lnobMQfd7dWyndFbDnQpnLcugggdxwb.png
0 → 100644
View file @
3f7c3f59
316 KB
This diff is collapsed.
Click to expand it.
public/images/xPEnNdhFuMG5CuhfCwlSfQgbxRRIwM0xZcUHHp1X.png
0 → 100644
View file @
3f7c3f59
2.94 MB
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