Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webprofile-jwg2024
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Siti Aisah
webprofile-jwg2024
Commits
db66a20c
Commit
db66a20c
authored
Jul 29, 2022
by
Triyah Fatmawati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validasi input menu admin
parent
136cc122
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
351 additions
and
15 deletions
+351
-15
app/Http/Controllers/Webprofile/Backend/AgendaController.php
+54
-0
app/Http/Controllers/Webprofile/Backend/CategoriesFileController.php
+16
-0
app/Http/Controllers/Webprofile/Backend/CategoryController.php
+29
-3
app/Http/Controllers/Webprofile/Backend/FileController.php
+27
-0
app/Http/Controllers/Webprofile/Backend/GalleryController.php
+23
-0
app/Http/Controllers/Webprofile/Backend/InformationController.php
+57
-3
app/Http/Controllers/Webprofile/Backend/PageController.php
+54
-1
app/Http/Controllers/Webprofile/Backend/PostController.php
+63
-3
app/Http/Controllers/Webprofile/Backend/SliderController.php
+23
-0
app/Repositories/Webprofile/AgendaRepository.php
+1
-1
app/Repositories/Webprofile/InformationRepository.php
+1
-1
resources/views/webprofile/backend/categories/edit_per_bahasa.blade.php
+1
-1
resources/views/webprofile/backend/file/create.blade.php
+1
-1
resources/views/webprofile/backend/file/edit.blade.php
+1
-1
No files found.
app/Http/Controllers/Webprofile/Backend/AgendaController.php
View file @
db66a20c
...
@@ -79,7 +79,25 @@ class AgendaController extends Controller
...
@@ -79,7 +79,25 @@ class AgendaController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
// $request['content'] = strip_tags($request->content);
$request
->
validate
([
'title'
=>
'required'
,
'content'
=>
'required|min:3'
,
'event_date'
=>
'required'
,
'keys'
=>
'max:100'
],
[
'title.required'
=>
'Judul wajib diisi'
,
// 'title.regex' => 'Judul tidak valid! Judul hanya berupa angka dan huruf',
// 'title.max' => 'Judul terlalu panjang',
'content.required'
=>
'Konten wajib diisi'
,
'content.min'
=>
'Konten terlalu singkat'
,
'event_date.required'
=>
'Tanggal posting wajib diisi'
,
// 'keys.regex' => 'Keyword tidak valid! Keyword hanya berupa angka dan huruf',
'keys.max'
=>
'Keyword terlalu panjang'
]);
$data
=
$request
->
except
(
'_token'
);
$data
=
$request
->
except
(
'_token'
);
// $data['content'] = htmlspecialchars($request->content);
array_key_exists
(
'info_status'
,
$data
)
?
$data
[
'info_status'
]
=
1
:
$data
[
'info_status'
]
=
0
;
array_key_exists
(
'info_status'
,
$data
)
?
$data
[
'info_status'
]
=
1
:
$data
[
'info_status'
]
=
0
;
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
...
@@ -230,8 +248,44 @@ class AgendaController extends Controller
...
@@ -230,8 +248,44 @@ class AgendaController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
// $request['content'] = strip_tags($request->content);
// $request['content_en'] = strip_tags($request->content_en);
// $request['content_de'] = strip_tags($request->content_de);
// $request['content_sa'] = strip_tags($request->content_sa);
// $request['content_zh'] = strip_tags($request->content_zh);
$request
->
validate
([
'title'
=>
'required'
,
'content'
=>
'required|min:3'
,
'event_date'
=>
'required'
,
'keys'
=>
'max:100'
],
[
'title.required'
=>
'Judul wajib diisi'
,
// 'title.regex' => 'Judul tidak valid! Judul hanya berupa angka dan huruf',
// 'title.max' => 'Judul terlalu panjang',
'content.required'
=>
'Konten wajib diisi'
,
'content.min'
=>
'Konten terlalu singkat'
,
'event_date.required'
=>
'Tanggal posting wajib diisi'
,
// 'keys.regex' => 'Keyword tidak valid! Keyword hanya berupa angka dan huruf',
'keys.max'
=>
'Keyword terlalu panjang'
]);
$data
=
$request
->
except
([
'_token'
,
'manual'
,
'id'
,
'title_en'
,
'content_en'
,
'title_de'
,
'content_de'
,
'title_sa'
,
'content_sa'
,
'title_zh'
,
'content_zh'
]);
$data
=
$request
->
except
([
'_token'
,
'manual'
,
'id'
,
'title_en'
,
'content_en'
,
'title_de'
,
'content_de'
,
'title_sa'
,
'content_sa'
,
'title_zh'
,
'content_zh'
]);
// $data['title'] = htmlspecialchars($request->title);
// $data['content'] = htmlspecialchars($request->content);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
// $dataEn = $request->except(['_token', 'id', 'manual', 'title_en', 'content_en', 'title_de', 'content_de', 'title_sa', 'content_sa', 'title_zh', 'content_zh']);
// $dataEn['title'] = htmlspecialchars($request->title);
// $dataEn['title_en'] = htmlspecialchars($request->title_en);
// $dataEn['title_de'] = htmlspecialchars($request->title_de);
// $dataEn['title_sa'] = htmlspecialchars($request->title_sa);
// $dataEn['title_zh'] = htmlspecialchars($request->title_zh);
// $dataEn['content'] = htmlspecialchars($request->content);
// $dataEn['content_en'] = htmlspecialchars($request->content_en);
// $dataEn['content_de'] = htmlspecialchars($request->content_de);
// $dataEn['content_sa'] = htmlspecialchars($request->content_sa);
// $dataEn['content_zh'] = htmlspecialchars($request->content_zh);
array_key_exists
(
'info_status'
,
$data
)
?
$data
[
'info_status'
]
=
1
:
$data
[
'info_status'
]
=
0
;
array_key_exists
(
'info_status'
,
$data
)
?
$data
[
'info_status'
]
=
1
:
$data
[
'info_status'
]
=
0
;
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
...
...
app/Http/Controllers/Webprofile/Backend/CategoriesFileController.php
View file @
db66a20c
...
@@ -47,6 +47,14 @@ class CategoriesFileController extends Controller
...
@@ -47,6 +47,14 @@ class CategoriesFileController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
// dd($request);
$request
->
validate
([
'name'
=>
'required'
,
],
[
'name.required'
=>
'Kategori dokumen wajib diisi'
,
// 'name.regex' => 'Kategori dokumen tidak valid! Isian hanya berupa angka dan huruf',
// 'name.max' => 'Kategori dokumen terlalu panjang'
]);
$data
=
$request
->
except
(
'_token'
);
$data
=
$request
->
except
(
'_token'
);
array_key_exists
(
'is_active'
,
$data
)
?
$data
[
'is_active'
]
=
1
:
$data
[
'is_active'
]
=
0
;
array_key_exists
(
'is_active'
,
$data
)
?
$data
[
'is_active'
]
=
1
:
$data
[
'is_active'
]
=
0
;
...
@@ -93,6 +101,14 @@ class CategoriesFileController extends Controller
...
@@ -93,6 +101,14 @@ class CategoriesFileController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
$request
->
validate
([
'name'
=>
'required'
,
],
[
'name.required'
=>
'Kategori dokumen wajib diisi'
,
// 'name.regex' => 'Kategori dokumen tidak valid! Isian hanya berupa angka dan huruf',
// 'name.max' => 'Kategori dokumen terlalu panjang',
]);
$data
=
$request
->
except
([
'_token'
,
'id'
]);
$data
=
$request
->
except
([
'_token'
,
'id'
]);
array_key_exists
(
'is_active'
,
$data
)
?
$data
[
'is_active'
]
=
1
:
$data
[
'is_active'
]
=
0
;
array_key_exists
(
'is_active'
,
$data
)
?
$data
[
'is_active'
]
=
1
:
$data
[
'is_active'
]
=
0
;
...
...
app/Http/Controllers/Webprofile/Backend/CategoryController.php
View file @
db66a20c
...
@@ -72,6 +72,15 @@ class CategoryController extends Controller
...
@@ -72,6 +72,15 @@ class CategoryController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
// dd($request);
$request
->
validate
([
'name'
=>
'required'
],
[
'name.required'
=>
'Kategori wajib diisi'
,
// 'name.regex' => 'Kategori tidak valid! Kategori hanya berupa angka dan huruf',
// 'name.max' => 'Kategori terlalu panjang'
]);
$data
=
$request
->
except
(
'_token'
);
$data
=
$request
->
except
(
'_token'
);
array_key_exists
(
'is_active'
,
$data
)
?
$data
[
'is_active'
]
=
1
:
$data
[
'is_active'
]
=
0
;
array_key_exists
(
'is_active'
,
$data
)
?
$data
[
'is_active'
]
=
1
:
$data
[
'is_active'
]
=
0
;
...
@@ -184,11 +193,25 @@ class CategoryController extends Controller
...
@@ -184,11 +193,25 @@ class CategoryController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
// dd($request);
$request
->
validate
([
'name'
=>
'required'
,
],
[
'name.required'
=>
'Kategori wajib diisi'
,
// 'name.regex' => 'Kategori tidak valid! Kategori hanya berupa angka dan huruf',
// 'name.max' => 'Kategori terlalu panjang',
]);
// dd($request);
$data
=
$request
->
except
([
'_token'
,
'manual'
,
'id'
,
'name_en'
,
'name_de'
,
'name_sa'
,
'name_zh'
]);
$data
=
$request
->
except
([
'_token'
,
'manual'
,
'id'
,
'name_en'
,
'name_de'
,
'name_sa'
,
'name_zh'
]);
// $dataEn = $request->except(['_token', 'id', 'name_de']);
//
//
$dataEn = $request->except(['_token', 'id', 'name_de']);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
// $dataDe = $request->except(['_token', 'id', 'name', 'name_en']);
// $dataEn = $request->except(['_token', 'manual', 'id', 'name_en', 'name_de', 'name_sa', 'name_zh']);
// dd($dataEn);
// $dataEn['name_en'] = htmlspecialchars($request->name_en);
// $dataEn['name_de'] = htmlspecialchars($request->name_de);
// $dataEn['name_sa'] = htmlspecialchars($request->name_sa);
// $dataEn['name_zh'] = htmlspecialchars($request->name_zh);
// // $dataDe = $request->except(['_token', 'id', 'name', 'name_en']);
// // dd($request, $dataEn);
array_key_exists
(
'is_active'
,
$data
)
?
$data
[
'is_active'
]
=
1
:
$data
[
'is_active'
]
=
0
;
array_key_exists
(
'is_active'
,
$data
)
?
$data
[
'is_active'
]
=
1
:
$data
[
'is_active'
]
=
0
;
$category
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
$category
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
...
@@ -218,6 +241,9 @@ class CategoryController extends Controller
...
@@ -218,6 +241,9 @@ class CategoryController extends Controller
// $this->repoEn->store($dataEn);
// $this->repoEn->store($dataEn);
// }
// }
// dd($data, $category, $manual);
// dd($data, $category, $manual);
// dd($data, $category, $manual);
if
(
$manual
==
1
){
if
(
$manual
==
1
){
$dataEn
[
'name'
]
=
$data
[
'name_en'
];
$dataEn
[
'name'
]
=
$data
[
'name_en'
];
}
}
...
...
app/Http/Controllers/Webprofile/Backend/FileController.php
View file @
db66a20c
...
@@ -55,6 +55,20 @@ class FileController extends Controller
...
@@ -55,6 +55,20 @@ class FileController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
// dd($request);
$request
->
validate
([
'categories_file'
=>
'required'
,
'title'
=>
'required'
,
'file'
=>
'required|mimes:jpg,jpeg,png,doc,docx,pdf,xlsx,mp3,mp4,mkv,mpeg|max : 5120'
],
[
'categories_file.required'
=>
'Kategori dokumen wajib diisi'
,
'title.required'
=>
'Nama dokumen wajib diisi'
,
// 'title.max' => 'Nama dokumen terlalu panjang',
'file.required'
=>
'File wajib diupload'
,
'file.mimes'
=>
'File yang diupload harus berupa jpg, jpeg, png, doc, docx, pdf, xlsx, mp3, mp4, mkv, atau mpeg'
,
'file.max'
=>
'Ukuran gambar maksimal 5 MB'
]);
$this
->
repo
->
store
(
$request
,
'file'
);
$this
->
repo
->
store
(
$request
,
'file'
);
return
redirect
()
->
route
(
'file.index'
);
return
redirect
()
->
route
(
'file.index'
);
...
@@ -100,6 +114,19 @@ class FileController extends Controller
...
@@ -100,6 +114,19 @@ class FileController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
$request
->
validate
([
'categories_file'
=>
'required'
,
'title'
=>
'required'
,
'file'
=>
'required|mimes:jpg,jpeg,png,doc,docx,pdf,xlsx,mp3,mp4,mkv,mpeg|max : 5120'
],
[
'categories_file.required'
=>
'Kategori dokumen wajib diisi'
,
'title.required'
=>
'Nama dokumen wajib diisi'
,
// 'title.max' => 'Nama dokumen terlalu panjang',
'file.required'
=>
'File wajib diupload'
,
'file.mimes'
=>
'File yang diupload harus berupa jpg, jpeg, png, doc, docx, pdf, xlsx, mp3, mp4, mkv, atau mpeg'
,
'file.max'
=>
'Ukuran gambar maksimal 5 MB'
]);
$gallery
=
$this
->
repo
->
findId
(
$id
);
$gallery
=
$this
->
repo
->
findId
(
$id
);
$edit
=
$this
->
repo
->
update
(
$request
,
$gallery
,
'file'
);
$edit
=
$this
->
repo
->
update
(
$request
,
$gallery
,
'file'
);
...
...
app/Http/Controllers/Webprofile/Backend/GalleryController.php
View file @
db66a20c
...
@@ -47,6 +47,18 @@ class GalleryController extends Controller
...
@@ -47,6 +47,18 @@ class GalleryController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
// dd($request);
$request
->
validate
([
'title'
=>
'required'
,
'gallery'
=>
'required|mimes:jpg,jpeg,png|max : 3072'
],
[
'title.required'
=>
'Nama gallery wajib diisi'
,
// 'title.max' => 'Nama gallery terlalu panjang',
'gallery.required'
=>
'Gambar wajib diupload'
,
'gallery.mimes'
=>
'File yang diupload harus berupa JPG, JPEG, dan PNG'
,
'gallery.max'
=>
'Ukuran gambar maksimal 3 MB'
]);
$this
->
repo
->
store
(
$request
,
'gallery'
);
$this
->
repo
->
store
(
$request
,
'gallery'
);
return
redirect
()
->
route
(
'gallery.index'
);
return
redirect
()
->
route
(
'gallery.index'
);
...
@@ -89,6 +101,17 @@ class GalleryController extends Controller
...
@@ -89,6 +101,17 @@ class GalleryController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
$request
->
validate
([
'title'
=>
'required'
,
'gallery'
=>
'required|mimes:jpg,jpeg,png|max : 3072'
],
[
'title.required'
=>
'Nama gallery wajib diisi'
,
// 'title.max' => 'Nama gallery terlalu panjang',
'gallery.required'
=>
'Gambar wajib diupload'
,
'gallery.mimes'
=>
'File yang diupload harus berupa JPG, JPEG, dan PNG'
,
'gallery.max'
=>
'Ukuran gambar maksimal 3 MB'
]);
$gallery
=
$this
->
repo
->
findId
(
$id
);
$gallery
=
$this
->
repo
->
findId
(
$id
);
$edit
=
$this
->
repo
->
update
(
$request
,
$gallery
,
'gallery'
);
$edit
=
$this
->
repo
->
update
(
$request
,
$gallery
,
'gallery'
);
...
...
app/Http/Controllers/Webprofile/Backend/InformationController.php
View file @
db66a20c
...
@@ -79,11 +79,29 @@ class InformationController extends Controller
...
@@ -79,11 +79,29 @@ class InformationController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
$request
[
'content'
]
=
strip_tags
(
$request
->
content
);
$request
->
validate
([
'title'
=>
'required'
,
'content'
=>
'required|min:3'
,
'event_date'
=>
'required'
,
'keys'
=>
'max:100'
],
[
'title.required'
=>
'Judul wajib diisi'
,
// 'title.regex' => 'Judul tidak valid! Judul hanya berupa angka dan huruf',
// 'title.max' => 'Judul terlalu panjang',
'content.required'
=>
'Konten wajib diisi'
,
'content.min'
=>
'Konten terlalu singkat'
,
'event_date.required'
=>
'Tanggal posting wajib diisi'
,
'keys.regex'
=>
'Keyword tidak valid! Keyword hanya berupa angka dan huruf'
,
// 'keys.max' => 'Keyword terlalu panjang'
]);
$data
=
$request
->
except
(
'_token'
);
$data
=
$request
->
except
(
'_token'
);
// $data['content'] = htmlspecialchars($request->content);
array_key_exists
(
'info_status'
,
$data
)
?
$data
[
'info_status'
]
=
1
:
$data
[
'info_status'
]
=
0
;
array_key_exists
(
'info_status'
,
$data
)
?
$data
[
'info_status'
]
=
1
:
$data
[
'info_status'
]
=
0
;
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
// dd($request);
$save
=
$this
->
repo
->
store
(
$data
);
$save
=
$this
->
repo
->
store
(
$data
);
if
(
webprofilesetting
()[
'auto_translate'
]
==
1
)
{
if
(
webprofilesetting
()[
'auto_translate'
]
==
1
)
{
...
@@ -228,12 +246,48 @@ class InformationController extends Controller
...
@@ -228,12 +246,48 @@ class InformationController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
// $request['content'] = strip_tags($request->content);
// $request['content_en'] = strip_tags($request->content_en);
// $request['content_de'] = strip_tags($request->content_de);
// $request['content_sa'] = strip_tags($request->content_sa);
// $request['content_zh'] = strip_tags($request->content_zh);
$request
->
validate
([
'title'
=>
'required'
,
'content'
=>
'required|min:3'
,
'event_date'
=>
'required'
,
'keys'
=>
'max:100'
],
[
'title.required'
=>
'Judul wajib diisi'
,
// 'title.regex' => 'Judul tidak valid! Judul hanya berupa angka dan huruf',
// 'title.max' => 'Judul terlalu panjang',
'content.required'
=>
'Konten wajib diisi'
,
'content.min'
=>
'Konten terlalu singkat'
,
'event_date.required'
=>
'Tanggal posting wajib diisi'
,
'keys.regex'
=>
'Keyword tidak valid! Keyword hanya berupa angka dan huruf'
,
// 'keys.max' => 'Keyword terlalu panjang'
]);
$data
=
$request
->
except
([
'_token'
,
'manual'
,
'id'
,
'title_en'
,
'content_en'
,
'title_de'
,
'content_de'
,
'title_sa'
,
'content_sa'
,
'title_zh'
,
'content_zh'
]);
$data
=
$request
->
except
([
'_token'
,
'manual'
,
'id'
,
'title_en'
,
'content_en'
,
'title_de'
,
'content_de'
,
'title_sa'
,
'content_sa'
,
'title_zh'
,
'content_zh'
]);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
// $data['title'] = htmlspecialchars($request->title);
// $data['content'] = htmlspecialchars($request->content);
// $dataEn = $request->except(['_token', 'id', 'manual', 'title_en', 'content_en', 'title_de', 'content_de', 'title_sa', 'content_sa', 'title_zh', 'content_zh']);
// $dataEn['title'] = htmlspecialchars($request->title);
// $dataEn['title_en'] = htmlspecialchars($request->title_en);
// $dataEn['title_de'] = htmlspecialchars($request->title_de);
// $dataEn['title_sa'] = htmlspecialchars($request->title_sa);
// $dataEn['title_zh'] = htmlspecialchars($request->title_zh);
// $dataEn['content'] = htmlspecialchars($request->content);
// $dataEn['content_en'] = htmlspecialchars($request->content_en);
// $dataEn['content_de'] = htmlspecialchars($request->content_de);
// $dataEn['content_sa'] = htmlspecialchars($request->content_sa);
// $dataEn['content_zh'] = htmlspecialchars($request->content_zh);
array_key_exists
(
'info_status'
,
$data
)
?
$data
[
'info_status'
]
=
1
:
$data
[
'info_status'
]
=
0
;
array_key_exists
(
'info_status'
,
$data
)
?
$data
[
'info_status'
]
=
1
:
$data
[
'info_status'
]
=
0
;
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
// dd($request, $dataEn);
$information
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
$information
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
$this
->
updateEn
(
$dataEn
,
$information
,
$request
->
manual
);
$this
->
updateEn
(
$dataEn
,
$information
,
$request
->
manual
);
...
...
app/Http/Controllers/Webprofile/Backend/PageController.php
View file @
db66a20c
...
@@ -79,7 +79,25 @@ class PageController extends Controller
...
@@ -79,7 +79,25 @@ class PageController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
// dd($request);
// $request['content'] = strip_tags($request->content);
$request
->
validate
([
'title'
=>
'required'
,
'content'
=>
'required|min:3'
,
'keys'
=>
'max:100'
],
[
'title.required'
=>
'Judul wajib diisi'
,
// 'title.regex' => 'Judul tidak valid! Judul hanya berupa angka dan huruf',
// 'title.max' => 'Judul terlalu panjang',
'content.required'
=>
'Konten wajib diisi'
,
'content.min'
=>
'Konten terlalu singkat'
,
// 'keys.regex' => 'Keyword tidak valid! Keyword hanya berupa angka dan huruf',
'keys.max'
=>
'Keyword terlalu panjang'
]);
$data
=
$request
->
except
(
'_token'
);
$data
=
$request
->
except
(
'_token'
);
// $data['content'] = htmlspecialchars($request->content);
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
$data
[
'slug'
]
=
str_slug
(
$request
->
input
(
'title'
));
$save
=
$this
->
repo
->
store
(
$data
);
$save
=
$this
->
repo
->
store
(
$data
);
...
@@ -226,9 +244,44 @@ class PageController extends Controller
...
@@ -226,9 +244,44 @@ class PageController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
// dd($request);
// $request['content'] = strip_tags($request->content);
// $request['content_en'] = strip_tags($request->content_en);
// $request['content_de'] = strip_tags($request->content_de);
// $request['content_sa'] = strip_tags($request->content_sa);
// $request['content_zh'] = strip_tags($request->content_zh);
$request
->
validate
([
'title'
=>
'required'
,
'content'
=>
'required|min:3'
,
'keys'
=>
'max:100'
],
[
'title.required'
=>
'Judul wajib diisi'
,
// 'title.regex' => 'Judul tidak valid! Judul hanya berupa angka dan huruf',
// 'title.max' => 'Judul terlalu panjang',
'content.required'
=>
'Konten wajib diisi'
,
'content.min'
=>
'Konten terlalu singkat'
,
// 'keys.regex' => 'Keyword tidak valid! Keyword hanya berupa angka dan huruf',
'keys.max'
=>
'Keyword terlalu panjang'
]);
$data
=
$request
->
except
([
'_token'
,
'id'
,
'title_en'
,
'content_en'
,
'title_de'
,
'content_de'
,
'title_sa'
,
'content_sa'
,
'title_zh'
,
'content_zh'
,
'manual'
]);
$data
=
$request
->
except
([
'_token'
,
'id'
,
'title_en'
,
'content_en'
,
'title_de'
,
'content_de'
,
'title_sa'
,
'content_sa'
,
'title_zh'
,
'content_zh'
,
'manual'
]);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
// $data['title'] = htmlspecialchars($request->title);
// $data['content'] = htmlspecialchars($request->content);
// $dataEn = $request->except(['_token', 'id', 'manual', 'title_en', 'content_en', 'title_de', 'content_de', 'title_sa', 'content_sa', 'title_zh', 'content_zh']);
// $dataEn['title'] = htmlspecialchars($request->title);
// $dataEn['title_en'] = htmlspecialchars($request->title_en);
// $dataEn['title_de'] = htmlspecialchars($request->title_de);
// $dataEn['title_sa'] = htmlspecialchars($request->title_sa);
// $dataEn['title_zh'] = htmlspecialchars($request->title_zh);
// $dataEn['content'] = htmlspecialchars($request->content);
// $dataEn['content_en'] = htmlspecialchars($request->content_en);
// $dataEn['content_de'] = htmlspecialchars($request->content_de);
// $dataEn['content_sa'] = htmlspecialchars($request->content_sa);
// $dataEn['content_zh'] = htmlspecialchars($request->content_zh);
$page
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
$page
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
// $edit = $this->repo->update($data, $page);
// $edit = $this->repo->update($data, $page);
...
...
app/Http/Controllers/Webprofile/Backend/PostController.php
View file @
db66a20c
...
@@ -88,7 +88,28 @@ class PostController extends Controller
...
@@ -88,7 +88,28 @@ class PostController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
// dd($request);
// $request['content'] = strip_tags($request->content);
$request
->
validate
([
'title'
=>
'required'
,
'categories'
=>
'required'
,
'content'
=>
'required|min:3'
,
'post_date'
=>
'required'
,
'keys'
=>
'max:100'
],
[
'title.required'
=>
'Judul wajib diisi'
,
// 'title.regex' => 'Judul tidak valid! Judul hanya berupa angka dan huruf',
// 'title.max' => 'Judul terlalu panjang',
'categories.required'
=>
'Kategori wajib diisi'
,
'content.required'
=>
'Konten wajib diisi'
,
'content.min'
=>
'Konten terlalu singkat'
,
'post_date.required'
=>
'Tanggal posting wajib diisi'
,
// 'keys.regex' => 'Keyword tidak valid! Keyword hanya berupa angka dan huruf',
'keys.max'
=>
'Keyword terlalu panjang'
]);
$data
=
$request
->
except
(
'_token'
);
$data
=
$request
->
except
(
'_token'
);
// $data['content'] = htmlspecialchars($request->content);
array_key_exists
(
'post_status'
,
$data
)
?
$data
[
'post_status'
]
=
1
:
$data
[
'post_status'
]
=
0
;
array_key_exists
(
'post_status'
,
$data
)
?
$data
[
'post_status'
]
=
1
:
$data
[
'post_status'
]
=
0
;
array_key_exists
(
'cover_status'
,
$data
)
?
$data
[
'cover_status'
]
=
1
:
$data
[
'cover_status'
]
=
0
;
array_key_exists
(
'cover_status'
,
$data
)
?
$data
[
'cover_status'
]
=
1
:
$data
[
'cover_status'
]
=
0
;
...
@@ -332,13 +353,52 @@ class PostController extends Controller
...
@@ -332,13 +353,52 @@ class PostController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
// $request['content'] = strip_tags($request->content);
// $request['content_en'] = strip_tags($request->content_en);
// $request['content_de'] = strip_tags($request->content_de);
// $request['content_sa'] = strip_tags($request->content_sa);
// $request['content_zh'] = strip_tags($request->content_zh);
$request
->
validate
([
'title'
=>
'required'
,
'categories'
=>
'required'
,
'content'
=>
'required|min:3'
,
'post_date'
=>
'required'
,
'keys'
=>
'max:100'
],
[
'title.required'
=>
'Judul wajib diisi'
,
// 'title.regex' => 'Judul tidak valid! Judul hanya berupa angka dan huruf',
// 'title.max' => 'Judul terlalu panjang',
'categories.required'
=>
'Kategori wajib diisi'
,
'content.required'
=>
'Konten wajib diisi'
,
'content.min'
=>
'Konten terlalu singkat'
,
'post_date.required'
=>
'Tanggal posting wajib diisi'
,
// 'keys.regex' => 'Keyword tidak valid! Keyword hanya berupa angka dan huruf',
'keys.max'
=>
'Keyword terlalu panjang'
]);
$data
=
$request
->
except
([
'_token'
,
'manual'
,
'id'
,
'title_en'
,
'content_en'
,
'title_de'
,
'content_de'
,
'title_sa'
,
'content_sa'
,
'title_zh'
,
'content_zh'
]);
$data
=
$request
->
except
([
'_token'
,
'manual'
,
'id'
,
'title_en'
,
'content_en'
,
'title_de'
,
'content_de'
,
'title_sa'
,
'content_sa'
,
'title_zh'
,
'content_zh'
]);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
$dataEn
=
$request
->
except
([
'_token'
,
'id'
,
'manual'
]);
// $data['title'] = htmlspecialchars($request->title);
// $data['content'] = htmlspecialchars($request->content);
// $dataEn = $request->except(['_token', 'id', 'manual', 'title_en', 'content_en','title_de', 'content_de', 'title_sa', 'content_sa', 'title_zh', 'content_zh']);
// $dataEn['title'] = htmlspecialchars($request->title);
// $dataEn['title_en'] = htmlspecialchars($request->title_en);
// $dataEn['title_de'] = htmlspecialchars($request->title_de);
// $dataEn['title_sa'] = htmlspecialchars($request->title_sa);
// $dataEn['title_zh'] = htmlspecialchars($request->title_zh);
// $dataEn['content'] = htmlspecialchars($request->content);
// $dataEn['content_en'] = htmlspecialchars($request->content_en);
// $dataEn['content_de'] = htmlspecialchars($request->content_de);
// $dataEn['content_sa'] = htmlspecialchars($request->content_sa);
// $dataEn['content_zh'] = htmlspecialchars($request->content_zh);
array_key_exists
(
'post_status'
,
$data
)
?
$data
[
'post_status'
]
=
1
:
$data
[
'post_status'
]
=
0
;
array_key_exists
(
'post_status'
,
$data
)
?
$data
[
'post_status'
]
=
1
:
$data
[
'post_status'
]
=
0
;
array_key_exists
(
'cover_status'
,
$data
)
?
$data
[
'cover_status'
]
=
1
:
$data
[
'cover_status'
]
=
0
;
array_key_exists
(
'cover_status'
,
$data
)
?
$data
[
'cover_status'
]
=
1
:
$data
[
'cover_status'
]
=
0
;
$data
[
'slug'
]
=
Str
::
slug
(
$request
->
input
(
'title'
));
$data
[
'slug'
]
=
Str
::
slug
(
$request
->
input
(
'title'
));
// dd($dataEn);
$post
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
$post
=
$this
->
repo
->
findId
(
$id
,
[
'rEn'
,
'rDe'
,
'rSa'
,
'rZh'
]);
$edit
=
$this
->
repo
->
update
(
$data
,
$post
);
$edit
=
$this
->
repo
->
update
(
$data
,
$post
);
// dd($post);
// dd($post);
...
@@ -349,7 +409,7 @@ class PostController extends Controller
...
@@ -349,7 +409,7 @@ class PostController extends Controller
$this
->
repo
->
upload
(
$img
[
$tipe
],
$request
,
$tipe
);
$this
->
repo
->
upload
(
$img
[
$tipe
],
$request
,
$tipe
);
$this
->
repo
->
update
(
$img
,
$post
);
$this
->
repo
->
update
(
$img
,
$post
);
}
}
// dd($data);
// dd($data
En
);
$this
->
updateEn
(
$dataEn
,
$post
,
$request
->
manual
);
$this
->
updateEn
(
$dataEn
,
$post
,
$request
->
manual
);
$this
->
updateDe
(
$dataEn
,
$post
,
$request
->
manual
);
$this
->
updateDe
(
$dataEn
,
$post
,
$request
->
manual
);
$this
->
updateSa
(
$dataEn
,
$post
,
$request
->
manual
);
$this
->
updateSa
(
$dataEn
,
$post
,
$request
->
manual
);
...
...
app/Http/Controllers/Webprofile/Backend/SliderController.php
View file @
db66a20c
...
@@ -48,6 +48,18 @@ class SliderController extends Controller
...
@@ -48,6 +48,18 @@ class SliderController extends Controller
*/
*/
public
function
store
(
Request
$request
)
public
function
store
(
Request
$request
)
{
{
// dd($request);
$request
->
validate
([
'title'
=>
'required'
,
'slider'
=>
'required|mimes:jpg,jpeg,png|max : 3072'
],
[
'title.required'
=>
'Nama slider wajib diisi'
,
// 'title.max' => 'Nama slider terlalu panjang',
'slider.required'
=>
'Gambar wajib diupload'
,
'slider.mimes'
=>
'File yang diupload harus JPG, JPEG, dan PNG'
,
'slider.max'
=>
'Ukuran gambar maksimal 3 MB'
]);
$this
->
repo
->
store
(
$request
,
'slider'
);
$this
->
repo
->
store
(
$request
,
'slider'
);
return
redirect
()
->
route
(
'sliders.index'
);
return
redirect
()
->
route
(
'sliders.index'
);
...
@@ -90,6 +102,17 @@ class SliderController extends Controller
...
@@ -90,6 +102,17 @@ class SliderController extends Controller
*/
*/
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
$request
->
validate
([
'title'
=>
'required'
,
'slider'
=>
'required|mimes:jpg,jpeg,png|max : 3072'
],
[
'title.required'
=>
'Nama slider wajib diisi'
,
// 'title.max' => 'Nama slider terlalu panjang',
'slider.required'
=>
'Gambar wajib diupload'
,
'slider.mimes'
=>
'File yang diupload harus berupa JPG, JPEG, dan PNG'
,
'slider.max'
=>
'Ukuran gambar maksimal 3 MB'
]);
$slider
=
$this
->
repo
->
findId
(
$id
);
$slider
=
$this
->
repo
->
findId
(
$id
);
$edit
=
$this
->
repo
->
update
(
$request
,
$slider
,
'slider'
);
$edit
=
$this
->
repo
->
update
(
$request
,
$slider
,
'slider'
);
...
...
app/Repositories/Webprofile/AgendaRepository.php
View file @
db66a20c
...
@@ -37,7 +37,7 @@ class AgendaRepository extends Repository
...
@@ -37,7 +37,7 @@ class AgendaRepository extends Repository
->
addColumn
(
'action'
,
function
(
$row
)
{
->
addColumn
(
'action'
,
function
(
$row
)
{
$btn
=
'<a href="'
.
url
(
'/webprofile/agendas/'
.
$row
->
id
.
'/edit'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.editsemuabahasa'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.editsemuabahasa'
)
.
'</a>'
;
$btn
=
'<a href="'
.
url
(
'/webprofile/agendas/'
.
$row
->
id
.
'/edit'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.editsemuabahasa'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.editsemuabahasa'
)
.
'</a>'
;
$btn
=
$btn
.
'
<a href="'
.
url
(
'/webprofile/agendas/'
.
$row
->
id
.
'/editperbahasa'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.edittiapbahasa'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.edittiapbahasa'
)
.
'</a>'
;
$btn
=
$btn
.
'
<a href="'
.
url
(
'/webprofile/agendas/'
.
$row
->
id
.
'/editperbahasa'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.edittiapbahasa'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.edittiapbahasa'
)
.
'</a>'
;
$btn
=
$btn
.
' <a href="javascript:void(0)" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.delete'
)
.
'" class="btn btn-danger btn-round btn-sm delete">'
.
trans
(
'label.delete'
)
.
'</a>'
;
$btn
=
$btn
.
' <a href="javascript:void(0)" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.delete'
)
.
'" class="btn btn-danger btn-round btn-sm delete">'
.
trans
(
'label.delete'
)
.
'</a>'
;
...
...
app/Repositories/Webprofile/InformationRepository.php
View file @
db66a20c
...
@@ -37,7 +37,7 @@ class InformationRepository extends Repository
...
@@ -37,7 +37,7 @@ class InformationRepository extends Repository
->
addColumn
(
'action'
,
function
(
$row
)
{
->
addColumn
(
'action'
,
function
(
$row
)
{
$btn
=
'<a href="'
.
url
(
'/webprofile/informations/'
.
$row
->
id
.
'/edit'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.editsemuabahasa'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.editsemuabahasa'
)
.
'</a>'
;
$btn
=
'<a href="'
.
url
(
'/webprofile/informations/'
.
$row
->
id
.
'/edit'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.editsemuabahasa'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.editsemuabahasa'
)
.
'</a>'
;
$btn
=
$btn
.
'<a href="'
.
url
(
'/webprofile/informations/'
.
$row
->
id
.
'/editperbahasa'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.edittiapbahasa'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.edittiapbahasa'
)
.
'</a>'
;
$btn
=
$btn
.
'
<a href="'
.
url
(
'/webprofile/informations/'
.
$row
->
id
.
'/editperbahasa'
)
.
'" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.edittiapbahasa'
)
.
'" class="edit btn btn-warning btn-round btn-sm edit">'
.
trans
(
'label.edittiapbahasa'
)
.
'</a>'
;
$btn
=
$btn
.
' <a href="javascript:void(0)" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.delete'
)
.
'" class="btn btn-danger btn-round btn-sm delete">'
.
trans
(
'label.delete'
)
.
'</a>'
;
$btn
=
$btn
.
' <a href="javascript:void(0)" data-toggle="tooltip" data-id="'
.
$row
->
id
.
'" data-original-title="'
.
trans
(
'label.delete'
)
.
'" class="btn btn-danger btn-round btn-sm delete">'
.
trans
(
'label.delete'
)
.
'</a>'
;
...
...
resources/views/webprofile/backend/categories/edit_per_bahasa.blade.php
View file @
db66a20c
...
@@ -133,7 +133,7 @@
...
@@ -133,7 +133,7 @@
<div style="
padding
:
10
px
10
px
10
px
10
px
;
font
-
weight
:
bold
;
font
-
size
:
14
pt
;
">
<div style="
padding
:
10
px
10
px
10
px
10
px
;
font
-
weight
:
bold
;
font
-
size
:
14
pt
;
">
Bahasa Indonesia
Bahasa Indonesia
</div>
</div>
<
<
div class="
col
-
md
-
9
">
<div class="
col
-
md
-
9
">
<div class="
form
-
group
@
if
(
$errors
->
has
(
'name'
))
has
-
error
@
endif
">
<div class="
form
-
group
@
if
(
$errors
->
has
(
'name'
))
has
-
error
@
endif
">
<label class="
col
-
md
-
2
control
-
label
">Kategori</label>
<label class="
col
-
md
-
2
control
-
label
">Kategori</label>
<div class="
col
-
md
-
10
">
<div class="
col
-
md
-
10
">
...
...
resources/views/webprofile/backend/file/create.blade.php
View file @
db66a20c
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<div class="
form
-
group
@
if
(
$errors
->
has
(
'categories_file'
))
has
-
error
@
endif
" style="
margin
-
top
:
5
px
;
">
<div class="
form
-
group
@
if
(
$errors
->
has
(
'categories_file'
))
has
-
error
@
endif
" style="
margin
-
top
:
5
px
;
">
<label class="
col
-
md
-
2
control
-
label
">@lang('feature.categoryfile')</label>
<label class="
col
-
md
-
2
control
-
label
">@lang('feature.categoryfile')</label>
<div class="
col
-
md
-
10
">
<div class="
col
-
md
-
10
">
{{ Form::select('categories_file',
$categoriesFile
, old('categories_file'), ['class' => 'form-control select2', 'style' => 'width: 100%; font-size: 1
6px; height: 4
0px;', 'id' => 'categories_file', 'placeholder' => trans('feature.categoryfile'), 'required']) }}
{{ Form::select('categories_file',
$categoriesFile
, old('categories_file'), ['class' => 'form-control select2', 'style' => 'width: 100%; font-size: 1
2px; height: 3
0px;', 'id' => 'categories_file', 'placeholder' => trans('feature.categoryfile'), 'required']) }}
@if (
$errors->has
('categories_file'))
@if (
$errors->has
('categories_file'))
<label id="
login
-
error
" class="
error
" for="
login
">
{
{$errors->first('categories_file')}
}
</label>
<label id="
login
-
error
" class="
error
" for="
login
">
{
{$errors->first('categories_file')}
}
</label>
@endif
@endif
...
...
resources/views/webprofile/backend/file/edit.blade.php
View file @
db66a20c
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<div class="
form
-
group
@
if
(
$errors
->
has
(
'categories_file'
))
has
-
error
@
endif
" style="
margin
-
top
:
5
px
;
">
<div class="
form
-
group
@
if
(
$errors
->
has
(
'categories_file'
))
has
-
error
@
endif
" style="
margin
-
top
:
5
px
;
">
<label class="
col
-
md
-
2
control
-
label
">@lang('feature.categoryfile')</label>
<label class="
col
-
md
-
2
control
-
label
">@lang('feature.categoryfile')</label>
<div class="
col
-
md
-
10
">
<div class="
col
-
md
-
10
">
{{ Form::select('categories_file',
$categoriesFile
, old('categories_file'), ['class' => 'form-control select2', 'style' => 'width: 100%; font-size: 1
6px; height: 40
px;', 'id' => 'categories_file', 'placeholder' => trans('feature.categoryfile'), 'required']) }}
{{ Form::select('categories_file',
$categoriesFile
, old('categories_file'), ['class' => 'form-control select2', 'style' => 'width: 100%; font-size: 1
2px; height: 35
px;', 'id' => 'categories_file', 'placeholder' => trans('feature.categoryfile'), 'required']) }}
@if (
$errors->has
('categories_file'))
@if (
$errors->has
('categories_file'))
<label id="
login
-
error
" class="
error
" for="
login
">
{
{$errors->first('categories_file')}
}
</label>
<label id="
login
-
error
" class="
error
" for="
login
">
{
{$errors->first('categories_file')}
}
</label>
@endif
@endif
...
...
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