Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
K
kiaisoft_training
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TTS Tran Viet Anh
kiaisoft_training
Commits
c1c82bd2
Commit
c1c82bd2
authored
Oct 30, 2022
by
TTS Tran Viet Anh
Browse files
Options
Browse Files
Download
Plain Diff
validate fix
parents
146a5d29
ef54552e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
71 deletions
+21
-71
layout.blade.php
resources/views/layout.blade.php
+2
-1
upload-form.blade.php
resources/views/upload-form.blade.php
+17
-68
web.php
routes/web.php
+2
-2
No files found.
resources/views/layout.blade.php
View file @
c1c82bd2
...
...
@@ -20,11 +20,12 @@
href=
"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tagsinput/0.8.0/bootstrap-tagsinput.css"
>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tagsinput/0.8.0/bootstrap-tagsinput.min.js"
></script>
{{-- jquery --}}
<script
src=
"//code.jquery.com/jquery-1.11.3.min.js"
></script>
<script
type=
"text/javascript"
src=
"http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"
>
</script>
<title>
Document
</title>
</head>
...
...
resources/views/upload-form.blade.php
View file @
c1c82bd2
...
...
@@ -7,15 +7,13 @@
</
div
>
</
nav
>
<
div
class
=
"container"
>
<
form
action
=
"{{ route('upload') }}"
method
=
"post"
enctype
=
"multipart/form"
id
=
"uploadForm"
>
@
csrf
<
form
action
=
""
>
<
div
class
=
"row"
>
<
div
class
=
"col-2"
>
<
label
for
=
""
>
Danh
mục
:</
label
>
</
div
>
<
div
class
=
"col-10"
>
<
select
name
=
"category"
class
=
"form-control @error('category') is-invalid @enderror"
required
>
<
option
value
=
""
>--
Chọn
danh
mục
--</
option
>
<
select
name
=
"category"
class
=
"form-control"
>
<
option
value
=
"1"
>
danh
mục
1
</
option
>
<
option
value
=
"2"
>
danh
mục
2
</
option
>
<
option
value
=
"3"
>
danh
mục
3
</
option
>
...
...
@@ -23,11 +21,6 @@
<
option
value
=
"5"
>
danh
mục
5
</
option
>
</
select
>
</
div
>
@
error
(
'category'
)
<
div
class
=
"alert alert-danger"
role
=
"alert"
>
{{
$message
}}
</
div
>
@
enderror
</
div
>
<
div
class
=
"row"
>
...
...
@@ -36,34 +29,22 @@
</
div
>
<
div
class
=
"col-2"
>
<
label
class
=
"file"
for
=
"question"
>
Chọn
file
</
label
>
<
input
type
=
"file"
name
=
"question"
class
=
"@error('question') is-invalid @enderror"
id
=
"question"
hidden
/>
<
input
type
=
"file"
name
=
"question"
id
=
"question"
hidden
/>
</
div
>
<
div
class
=
"col-8"
>
<
p
class
=
"file"
>
(
Chỉ
chọn
file
PDF
)
</
p
>
</
div
>
@
error
(
'question'
)
<
div
class
=
"alert alert-danger"
role
=
"alert"
>
{{
$message
}}
</
div
>
@
enderror
<
div
class
=
"col-2"
>
<
label
for
=
""
>
Tệp
lời
giải
:</
label
>
</
div
>
<
div
class
=
"col-2"
>
<
label
class
=
"file"
for
=
"answer"
>
Chọn
file
</
label
>
<
input
type
=
"file"
name
=
"answer"
class
=
"@error('answer') is-invalid @enderror"
id
=
"answer"
hidden
/>
<
input
type
=
"file"
name
=
"answer"
id
=
"answer"
hidden
/>
</
div
>
<
div
class
=
"col-8"
>
<
p
class
=
"file"
>
(
Chỉ
chọn
file
PDF
)
</
p
>
</
div
>
@
error
(
'answer'
)
<
div
class
=
"alert alert-danger"
role
=
"alert"
>
{{
$message
}}
</
div
>
@
enderror
</
div
>
<
div
class
=
"row"
>
...
...
@@ -71,20 +52,14 @@
<
label
for
=
""
>
Tên
đề
thi
:</
label
>
</
div
>
<
div
class
=
"col-10"
>
<
input
type
=
"text"
id
=
"name"
name
=
"name"
value
=
"{{ old('name') }}"
class
=
"form-control @error('name') is-invalid @enderror"
required
/>
</
div
>
@
error
(
'name'
)
<
div
class
=
"alert alert-danger"
role
=
"alert"
>
{{
$message
}}
</
div
>
@
enderror
<
input
type
=
"text"
id
=
"name"
name
=
"name"
class
=
"form-control"
/>
</
div
>
<
div
class
=
"col-2"
>
<
label
for
=
""
>
Giới
thiệu
:</
label
>
</
div
>
<
div
class
=
"col-10"
>
<
textarea
style
=
"height:100px ;"
name
=
"introduction"
class
=
"form-control"
value
=
"{{ old('introduction') }}"
></
textarea
>
<
textarea
style
=
"height:100px ;"
name
=
"introduction"
class
=
"form-control"
></
textarea
>
</
div
>
<
div
class
=
"col-2"
>
...
...
@@ -92,7 +67,7 @@ class="form-control @error('name') is-invalid @enderror" required />
</
div
>
<
div
class
=
"col-10"
>
<
input
type
=
"text"
name
=
"keyWord"
class
=
"form-control"
data
-
role
=
"tagsinput"
value
=
"{{ old('keyWord') }}"
placeholder
=
"+ Thêm từ khóa"
/>
placeholder
=
"+ Thêm từ khóa"
/>
</
div
>
</
div
>
...
...
@@ -101,59 +76,34 @@ class="form-control @error('name') is-invalid @enderror" required />
<
label
for
=
""
>
Phí
thi
:</
label
>
</
div
>
<
div
class
=
"col-10"
>
<
input
type
=
"text"
id
=
"fee"
name
=
"fee"
value
=
"{{ old('fee') }}"
class
=
"form-control @error('fee') is-invalid @enderror"
placeholder
=
"đ"
required
/>
</
div
>
@
error
(
'fee'
)
<
div
class
=
"alert alert-danger"
role
=
"alert"
>
{{
$message
}}
</
div
>
@
enderror
<
input
type
=
"text"
id
=
"fee"
name
=
"fee"
class
=
"form-control"
placeholder
=
"đ"
/>
</
div
>
<
div
class
=
"col-2"
>
<
label
for
=
""
>
Mức
độ
:</
label
>
</
div
>
<
div
class
=
"col-10"
>
<
select
name
=
"level"
id
=
"level"
class
=
"form-control @error('level') is-invalid @enderror"
required
>
<
option
value
=
""
>--
Chọn
mức
độ
--</
option
>
<
select
name
=
"level"
id
=
"level"
class
=
"form-control"
>
<
option
value
=
"0"
>--
Chọn
mức
độ
--</
option
>
<
option
value
=
"1"
>
Dễ
</
option
>
<
option
value
=
"2"
>
Khó
</
option
>
</
select
>
</
div
>
@
error
(
'level'
)
<
div
class
=
"alert alert-danger"
role
=
"alert"
>
{{
$message
}}
</
div
>
@
enderror
<
div
class
=
"col-2"
>
<
label
for
=
""
>
Thời
gian
thi
:</
label
>
</
div
>
<
div
class
=
"col-10"
>
<
input
type
=
"number"
min
=
"0"
id
=
"time"
name
=
"time"
value
=
"{{ old('time') }}"
class
=
"form-control @error('time') is-invalid @enderror"
placeholder
=
"phút"
required
/>
</
div
>
@
error
(
'time'
)
<
div
class
=
"alert alert-danger"
role
=
"alert"
>
{{
$message
}}
</
div
>
@
enderror
<
input
type
=
"number"
id
=
"time"
name
=
"time"
class
=
"form-control"
placeholder
=
"phút"
/>
</
div
>
<
div
class
=
"col-2"
>
<
label
for
=
""
>
Số
câu
hỏi
:</
label
>
</
div
>
<
div
class
=
"col-10"
>
<
input
type
=
"number"
min
=
"0"
name
=
"numberOfQuestion"
id
=
"numberOfQuestion"
value
=
"{{ old('numberOfQuestion') }}"
class
=
"form-control @error('numberOfQuestion') is-invalid @enderror"
placeholder
=
"câu"
required
/>
</
div
>
@
error
(
'numberOfQuestion'
)
<
div
class
=
"alert alert-danger"
role
=
"alert"
>
{{
$message
}}
</
div
>
@
enderror
<
input
type
=
"number"
name
=
"numberOfQuestion"
id
=
"numberOfQuestion"
class
=
"form-control"
placeholder
=
"câu"
/>
</
div
>
</
div
>
<
div
class
=
"row"
id
=
"questionForm"
name
=
"questionForm"
>
...
...
@@ -197,7 +147,6 @@ class="form-control @error('numberOfQuestion') is-invalid @enderror" placeholder
alert
(
"Chỉ có thể chọn file "
+
fileExtension
.
join
(
', '
));
}
});
})
</
script
>
@
endsection
routes/web.php
View file @
c1c82bd2
...
...
@@ -14,8 +14,8 @@
|
*/
Route
::
get
(
'/'
,[
FormController
::
class
,
'create'
])
->
name
(
'uploadForm'
);
Route
::
get
(
'/'
,
[
FormController
::
class
,
'create'
])
->
name
(
'uploadForm'
);
Route
::
get
(
'/questionForm'
,
[
FormController
::
class
,
'showQuestionForm'
])
->
name
(
'questionForm'
);
Route
::
post
(
'/upload'
,
[
FormController
::
class
,
'store'
])
->
name
(
'upload'
);
Route
::
post
(
'/upload'
,
[
FormController
::
class
,
'store'
])
->
name
(
'upload'
);
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