diff --git a/app/Cms.php b/app/Cms.php index 9ee46c2..e15bf91 100644 --- a/app/Cms.php +++ b/app/Cms.php @@ -8,4 +8,19 @@ use Illuminate\Database\Eloquent\Model; class Cms extends Model { use HasFactory; + + + protected $table = "cms"; + + protected $fillable = ['id','judul','konten']; + + public function katartikel() + { + return $this->belongsTo('App\Katartikel'); + } + + public function user() + { + return $this->belongsTo('App\User'); + } } diff --git a/app/Http/Controllers/Backend/artikelCmsController.php b/app/Http/Controllers/Backend/artikelCmsController.php new file mode 100644 index 0000000..c197b6e --- /dev/null +++ b/app/Http/Controllers/Backend/artikelCmsController.php @@ -0,0 +1,55 @@ +request->add(['user_id' => auth()->user()->id]); + return view('backend.art-cms.tambah'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + + public function store(Request $request) + { + $validator = Validator::make($request->all(), [ + + + 'judul' => 'required', + 'konten' => 'required', + + + + ]); + if ($validator->fails()) { + $respon = array('status'=>false, 'pesan' => $validator->messages()); + } else { + if (Cms::create($request->all())) { + $respon = array('status'=>true, 'pesan' => ['msg' => 'Data berhasil disimpan']); + } else { + $respon = array('status'=>false, 'pesan' => ['msg' => 'Data gagal disimpan']); + } + } + return response()->json($respon); + } +} diff --git a/app/Http/Controllers/Backend/artikelEofficeController.php b/app/Http/Controllers/Backend/artikelEofficeController.php index 3e697d1..38ca93c 100644 --- a/app/Http/Controllers/Backend/artikelEofficeController.php +++ b/app/Http/Controllers/Backend/artikelEofficeController.php @@ -7,7 +7,7 @@ use Illuminate\Http\Request; use Illuminate\Database\Eloquent\Collection; use App\Eoffice; use App\User; -use Validator; +use Illuminate\Support\Facades\Validator; class artikelEofficeController extends Controller diff --git a/app/Http/Controllers/Backend/artikelFwController.php b/app/Http/Controllers/Backend/artikelFwController.php new file mode 100644 index 0000000..8a5648d --- /dev/null +++ b/app/Http/Controllers/Backend/artikelFwController.php @@ -0,0 +1,54 @@ +request->add(['user_id' => auth()->user()->id]); + return view('backend.art-fw.tambah'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + + public function store(Request $request) + { + $validator = Validator::make($request->all(), [ + + + 'judul' => 'required', + 'konten' => 'required', + + ]); + if ($validator->fails()) { + $respon = array('status'=>false, 'pesan' => $validator->messages()); + } else { + if (Framework::create($request->all())) { + $respon = array('status'=>true, 'pesan' => ['msg' => 'Data berhasil disimpan']); + } else { + $respon = array('status'=>false, 'pesan' => ['msg' => 'Data gagal disimpan']); + } + } + return response()->json($respon); + } + +} diff --git a/app/Http/Controllers/Backend/artikelJsController.php b/app/Http/Controllers/Backend/artikelJsController.php new file mode 100644 index 0000000..c6f0c28 --- /dev/null +++ b/app/Http/Controllers/Backend/artikelJsController.php @@ -0,0 +1,56 @@ +request->add(['user_id' => auth()->user()->id]); + return view('backend.art-js.tambah'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + + public function store(Request $request) + { + $validator = Validator::make($request->all(), [ + + + 'judul' => 'required', + 'konten' => 'required', + + ]); + if ($validator->fails()) { + $respon = array('status'=>false, 'pesan' => $validator->messages()); + } else { + if (Javascript::create($request->all())) { + $respon = array('status'=>true, 'pesan' => ['msg' => 'Data berhasil disimpan']); + } else { + $respon = array('status'=>false, 'pesan' => ['msg' => 'Data gagal disimpan']); + } + } + return response()->json($respon); + } + + + +} diff --git a/app/Http/Controllers/Backend/artikelOsController.php b/app/Http/Controllers/Backend/artikelOsController.php new file mode 100644 index 0000000..60d7bfb --- /dev/null +++ b/app/Http/Controllers/Backend/artikelOsController.php @@ -0,0 +1,54 @@ +request->add(['user_id' => auth()->user()->id]); + return view('backend.art-os.tambah'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + + public function store(Request $request) + { + $validator = Validator::make($request->all(), [ + + + 'judul' => 'required', + 'konten' => 'required', + + ]); + if ($validator->fails()) { + $respon = array('status'=>false, 'pesan' => $validator->messages()); + } else { + if (Os::create($request->all())) { + $respon = array('status'=>true, 'pesan' => ['msg' => 'Data berhasil disimpan']); + } else { + $respon = array('status'=>false, 'pesan' => ['msg' => 'Data gagal disimpan']); + } + } + return response()->json($respon); + } + +} diff --git a/app/Http/Controllers/Backend/artikelSopController.php b/app/Http/Controllers/Backend/artikelSopController.php new file mode 100644 index 0000000..06e8a21 --- /dev/null +++ b/app/Http/Controllers/Backend/artikelSopController.php @@ -0,0 +1,57 @@ +request->add(['user_id' => auth()->user()->id]); + return view('backend.art-sop.tambah'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + + public function store(Request $request) + { + $validator = Validator::make($request->all(), [ + + + 'judul' => 'required', + 'konten' => 'required', + + + + ]); + if ($validator->fails()) { + $respon = array('status'=>false, 'pesan' => $validator->messages()); + } else { + if (Sop::create($request->all())) { + $respon = array('status'=>true, 'pesan' => ['msg' => 'Data berhasil disimpan']); + } else { + $respon = array('status'=>false, 'pesan' => ['msg' => 'Data gagal disimpan']); + } + } + return response()->json($respon); + } + +} diff --git a/app/Http/Controllers/Backend/cmsController.php b/app/Http/Controllers/Backend/cmsController.php index 59cdced..2e91bc3 100644 --- a/app/Http/Controllers/Backend/cmsController.php +++ b/app/Http/Controllers/Backend/cmsController.php @@ -4,8 +4,151 @@ namespace App\Http\Controllers\Backend; use App\Http\Controllers\Controller; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Validator; +use App\Cms; +use App\User; +use Yajra\DataTables\Facades\DataTables; class cmsController extends Controller { - // + public function index() + { + $cms = Cms::all(); + return view('backend.cms.index', compact('cms')); + } + + public function data(Request $request) + { + if ($request->ajax()) { + $cms = Cms::orderBy('id', 'desc'); + return Datatables::of($cms) + ->addIndexColumn() + // ->addColumn('lampiran', function($cms){ + // return 'Download'; + // }) + ->addColumn( + 'action', + '
{!! $cmsall->judul !!}
+{!! Str::limit($cmsall->konten, 100,'') !!} + + @if (strlen($cmsall->konten) > 100) + ... + {!! substr($cmsall->konten, 100)!!} + @endif +
+ + ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + +
{!! $fwall->judul !!}
+{!! Str::limit($fwall->konten, 100,'') !!} + + @if (strlen($fwall->konten) > 100) + ... + {!! substr($fwall->konten, 100)!!} + @endif +
+ + ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + +
{!! $jsall->judul !!}
+{!! Str::limit($jsall->konten, 100,'') !!} + + @if (strlen($jsall->konten) > 100) + ... + {!! substr($jsfall->konten, 100)!!} + @endif +
+ + ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + +
{!! $osall->judul !!}
+{!! Str::limit($osall->konten, 100,'') !!} + + @if (strlen($osall->konten) > 100) + ... + {!! substr($osall->konten, 100)!!} + @endif +
+ + ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + +
{!! $sopall->judul !!}
+{!! Str::limit($sopall->konten, 100,'') !!} + + @if (strlen($sopall->konten) > 100) + ... + {!! substr($sopall->konten, 100)!!} + @endif +
+ + ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + +| Nama | +Username | +
|---|
+ +
+| Judul | +Konten | +Aksi | +
|---|
+ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} + {!! Form::text('judul', $cms->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-6 control-label')) !!} + {!! Form::textarea('konten', $cms->konten, array('id' => 'konten', 'class' => 'form-control', 'placeholder' => 'Tulis')) !!} +
+ +| Nama | -Username | -
|---|
- -
-| Judul | -Konten | - -Aksi | -
|---|
- {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} - {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} -
-- {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} - {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} -
- - - {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} -- {!! Form::label('Kategori', 'Kategori', array('class' => 'col-md-6 control-label')) !!} - {!! Form::text('katartikel_id', $eoffice->katartikel_id, array('id' => 'katartikel_id', 'class' => 'form-control')) !!} -
-- {!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} - {!! Form::text('judul', $eoffice->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} -
-- {!! Form::label('Konten', 'Konten', array('class' => 'col-md-6 control-label')) !!} - {!! Form::textarea('konten', $eoffice->konten, array('id' => 'konten', 'class' => 'form-control', 'placeholder' => 'Konten')) !!} -
- - -| Nama | +Username | +
|---|
+ +
+| Judul | +Konten | +Aksi | +
|---|
+ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} + {!! Form::text('judul', $framework->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-6 control-label')) !!} + {!! Form::textarea('konten', $framework->konten, array('id' => 'konten', 'class' => 'form-control', 'placeholder' => 'Tulis')) !!} +
+ +| Nama | +Username | +
|---|
+ +
+| Judul | +Konten | + +Aksi | +
|---|
+ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} + {!! Form::text('judul', $frontendp->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-6 control-label')) !!} + {!! Form::textarea('konten', $frontendp->konten, array('id' => 'konten', 'class' => 'form-control', 'placeholder' => 'Konten')) !!} +
+ + +| Nama | +Username | +
|---|
+ +
+| Judul | +Konten | +Aksi | +
|---|
+ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} + {!! Form::text('judul', $javascript->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-6 control-label')) !!} + {!! Form::textarea('konten', $javascript->konten, array('id' => 'konten', 'class' => 'form-control', 'placeholder' => 'Tulis')) !!} +
+ +- {!! Form::label('Kategori Id', 'Kategori Id', array('class' => 'col-md-6 control-label')) !!} - {!! Form::text('kategori_id', $laravel->katartikel_id, array('id' => 'kategori_id', 'class' => 'form-control', 'placeholder' => 'Kategori Artikel')) !!} -
+{!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} {!! Form::text('judul', $laravel->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} @@ -14,10 +11,7 @@ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-6 control-label')) !!} {!! Form::textarea('konten', $laravel->konten, array('id' => 'konten', 'class' => 'form-control', 'placeholder' => 'Tulis')) !!}
- +| Nama | +Username | +
|---|
+ +
+| Judul | +Konten | +Aksi | +
|---|
+ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} + {!! Form::text('judul', $os->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-6 control-label')) !!} + {!! Form::textarea('konten', $os->konten, array('id' => 'konten', 'class' => 'form-control', 'placeholder' => 'Tulis')) !!} +
+ +| Nama | +Username | +
|---|
+ +
+| Judul | +Konten | +Aksi | +
|---|
+ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-12 control-label')) !!} + {!! Form::text('judul', NULL, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul Artikel')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-12 control-label')) !!} + {!! Form::textarea('konten', NULL, array('id' => 'konten', 'class' => 'form-control', 'rows' => '30' , 'placeholder' => 'Konten')) !!} +
+ + + {!! Form::hidden('table-list', 'datatable', array('id' => 'table-list')) !!} ++ {!! Form::label('Judul', 'Judul', array('class' => 'col-md-6 control-label')) !!} + {!! Form::text('judul', $sop->judul, array('id' => 'judul', 'class' => 'form-control', 'placeholder' => 'Judul')) !!} +
++ {!! Form::label('Konten', 'Konten', array('class' => 'col-md-6 control-label')) !!} + {!! Form::textarea('konten', $sop->konten, array('id' => 'konten', 'class' => 'form-control', 'placeholder' => 'Tulis')) !!} +
+ +