⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
work
/
modules
/
Template
/
Blocks
/
View File Name :
FormSearchAllService.php
<?php namespace Modules\Template\Blocks; use Modules\Location\Models\Location; use Modules\Media\Helpers\FileHelper; use Modules\Tour\Models\TourCategory; class FormSearchAllService extends BaseBlock { public function getName() { return __('Form Search All Service'); } public function getOptions() { $list_service = []; foreach (get_bookable_services() as $key => $service) { $list_service[] = ['value' => $key, 'name' => ucwords($key) ]; $arg[] = [ 'id' => 'title_for_'.$key, 'type' => 'input', 'inputType' => 'text', 'label' => __('Title for :service',['service'=>ucwords($key)]) ]; } $arg[] = [ 'id' => 'service_types', 'type' => 'checklist', 'listBox' => 'true', 'label' => "<strong>".__('Service Type')."</strong>", 'values' => $list_service, ]; $arg[] = [ 'id' => 'title', 'type' => 'input', 'inputType' => 'text', 'label' => __('Title') ]; $arg[] = [ 'id' => 'sub_title', 'type' => 'input', 'inputType' => 'text', 'label' => __('Sub Title') ]; $arg[] = [ 'id' => 'style', 'type' => 'radios', 'label' => __('Style Background'), 'values' => [ [ 'value' => '', 'name' => __("Normal") ], [ 'value' => 'carousel', 'name' => __("Slider Carousel") ], [ 'value' => 'carousel_v2', 'name' => __("Slider Carousel Ver 2") ], [ 'value' => 'bg_video', 'name' => __("Background Video") ], ] ]; $arg[] = [ 'id' => 'bg_image', 'type' => 'uploader', 'label' => __('- Layout Normal: Background Image Uploader') ]; $arg[] = [ 'id' => 'video_url', 'type' => 'input', 'inputType' => 'text', 'label' => __('- Layout Video: Youtube Url') ]; $arg[] = [ 'id' => 'list_slider', 'type' => 'listItem', 'label' => __('- Layout Slider: List Item(s)'), 'title_field' => 'title', 'settings' => [ [ 'id' => 'title', 'type' => 'input', 'inputType' => 'text', 'label' => __('Title (using for slider ver 2)') ], [ 'id' => 'desc', 'type' => 'input', 'inputType' => 'text', 'label' => __('Desc (using for slider ver 2)') ], [ 'id' => 'bg_image', 'type' => 'uploader', 'label' => __('Background Image Uploader') ] ] ]; $arg[] = [ 'type'=> "checkbox", 'label'=>__("Hide form search service?"), 'id'=> "hide_form_search", 'default'=>false ]; return [ 'settings' => $arg, 'category'=>__("Other Block") ]; } public function content($model = []) { $model['bg_image_url'] = FileHelper::url($model['bg_image'] ?? "", 'full') ?? ""; $model['list_location'] = $model['tour_location'] = Location::where("status", "publish")->limit(1000)->orderBy('name', 'asc')->with(['translation'])->get()->toTree(); $model['tour_category'] = TourCategory::where('status', 'publish')->with(['translation'])->get()->toTree(); $model['style'] = $model['style'] ?? ""; $model['list_slider'] = $model['list_slider'] ?? ""; $model['modelBlock'] = $model; return $this->view('Template::frontend.blocks.form-search-all-service.index', $model); } public function contentAPI($model = []){ if (!empty($model['bg_image'])) { $model['bg_image_url'] = FileHelper::url($model['bg_image'], 'full'); } return $model; } }