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
Sarun Mungthanya
SpnPatch-Laravel
Commits
b5ee13fe
Commit
b5ee13fe
authored
Jul 23, 2024
by
Thidaporn Laisan
Browse files
update upload exchange rate
parent
15453852
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Livewire/Pages/Exchangerate/ExchangerateIndex.php
View file @
b5ee13fe
...
@@ -10,6 +10,7 @@ use App\Models\CenterConfExchangerateExport;
...
@@ -10,6 +10,7 @@ use App\Models\CenterConfExchangerateExport;
class
ExchangerateIndex
extends
Component
class
ExchangerateIndex
extends
Component
{
{
use
WithPagination
;
use
WithPagination
;
public
$action
=
'list'
;
public
$action
=
'list'
;
public
$searchBy
,
$searchByPage
,
$editCurrency
,
$editExdate
,
$deleteCurrency
,
$deleteExdate
,
$message
,
$keyword
,
$perPage
=
20
,
$searchSelected
=
'center_conf_exchangerate.currency'
;
public
$searchBy
,
$searchByPage
,
$editCurrency
,
$editExdate
,
$deleteCurrency
,
$deleteExdate
,
$message
,
$keyword
,
$perPage
=
20
,
$searchSelected
=
'center_conf_exchangerate.currency'
;
public
$selectedExchangerates
=
[];
public
$selectedExchangerates
=
[];
...
@@ -102,7 +103,7 @@ class ExchangerateIndex extends Component
...
@@ -102,7 +103,7 @@ class ExchangerateIndex extends Component
public
function
deleteSelectedExchangerates
()
public
function
deleteSelectedExchangerates
()
{
{
foreach
(
$this
->
selectedExchangerates
as
$exchangerate
)
{
foreach
(
$this
->
selectedExchangerates
as
$exchangerate
)
{
$parts
=
explode
(
','
,
$exchangerate
);
// แยกค่า currency และ exdate
$parts
=
explode
(
','
,
$exchangerate
);
CenterConfExchangerate
::
where
(
'currency'
,
$parts
[
0
])
CenterConfExchangerate
::
where
(
'currency'
,
$parts
[
0
])
->
where
(
'exdate'
,
$parts
[
1
])
->
where
(
'exdate'
,
$parts
[
1
])
->
delete
();
->
delete
();
...
@@ -131,3 +132,4 @@ class ExchangerateIndex extends Component
...
@@ -131,3 +132,4 @@ class ExchangerateIndex extends Component
$this
->
action
=
$page
;
$this
->
action
=
$page
;
}
}
}
}
?>
resources/views/livewire/pages/exchangerate/exchangerate-index.blade.php
View file @
b5ee13fe
...
@@ -55,20 +55,7 @@
...
@@ -55,20 +55,7 @@
<button
type=
"button"
class=
"py-2 px-3 bg-stone-700 rounded-lg text-white"
<button
type=
"button"
class=
"py-2 px-3 bg-stone-700 rounded-lg text-white"
onclick=
"confirmDeleteSelected()"
>
Delete
</button>
onclick=
"confirmDeleteSelected()"
>
Delete
</button>
<!-- File Upload Form -->
<!-- File Upload Form -->
<form
wire:submit.prevent=
"upload"
class=
"form-upload"
>
@livewire('pages.exchangerate.exchangerate-upload')
<input
type=
"file"
wire:model=
"file"
>
@error('file')
<span
class=
"error"
>
{{ $message }}
</span>
@enderror
<label>
<input
type=
"checkbox"
wire:model=
"createPatch"
>
<b>
Create Patch
</b>
</label>
<label>
<input
type=
"checkbox"
wire:model=
"updatepatch"
>
<b>
Update Patch
</b>
</label>
<label>
<input
type=
"checkbox"
wire:model=
"sendToEec"
>
<b>
Send To EEC
</b>
</label>
<button
type=
"submit"
class=
"py-2 px-3 bg-stone-700 rounded-lg text-white"
>
Upload
</button>
</form>
</div>
</div>
<div
class=
"inline-flex flex-initial"
>
<div
class=
"inline-flex flex-initial"
>
<div
x-data=
"{ isInputActive: true }"
>
<div
x-data=
"{ isInputActive: true }"
>
...
...
resources/views/livewire/pages/exchangerate/exchangerate-upload.blade.php
0 → 100644
View file @
b5ee13fe
<form
wire:submit.prevent=
"upload"
class=
"form-upload"
>
<input
type=
"file"
wire:model=
"file"
>
@error('file')
<span
class=
"error"
>
{{ $message }}
</span>
@enderror
<label>
<input
type=
"checkbox"
wire:model=
"createPatch"
>
<b>
Create Patch
</b>
</label>
<label>
<input
type=
"checkbox"
wire:model=
"updatePatch"
>
<b>
Update Patch
</b>
</label>
<label>
<input
type=
"checkbox"
wire:model=
"sendToEec"
>
<b>
Send To EEC
</b>
</label>
<button
type=
"submit"
class=
"py-2 px-3 bg-stone-700 rounded-lg text-white"
>
Upload
</button>
</form>
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