⚝
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
/
themes
/
Mytravel
/
Template
/
Blocks
/
View File Name :
FormSearchAllService.php
<?php namespace Themes\Mytravel\Template\Blocks; use Modules\Flight\Models\SeatType; use Modules\Template\Blocks\BaseBlock; use Modules\Location\Models\Location; use Modules\Media\Helpers\FileHelper; use Modules\Tour\Models\TourCategory; class FormSearchAllService extends BaseBlock { 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' => __("Tab button Pills") ], [ 'value' => 'style_2', 'name' => __("Tab button Boxed") ], [ 'value' => 'style_3', 'name' => __("Tab button Shadow") ], [ 'value' => 'style_slider', 'name' => __("Slider Carousel") ], ] ]; $arg[] = [ 'id' => 'bg_image', 'type' => 'uploader', 'label' => __('- Style 1: Background Image Uploader') ]; $arg[] = [ 'id' => 'list_slider', 'type' => 'listItem', 'label' => __('- Layout Slider: List Item(s)'), 'title_field' => 'title', 'settings' => [ [ 'id' => 'title', 'type' => 'input', 'inputType' => 'text', 'label' => __('Title') ], [ 'id' => 'desc', 'type' => 'input', 'inputType' => 'text', 'label' => __('Desc') ], [ 'id' => 'bg_image', 'type' => 'uploader', 'label' => __('Background Image Uploader') ] ] ]; $arg[] = [ 'type'=> "checkbox", 'label'=>__("Hide form search service?"), 'id'=> "hide_form_search", 'default'=>false ]; $arg[] = [ 'type'=> "checkbox", 'label'=>__("single form search"), 'id'=> "single_form_search", 'default'=>false ]; return ([ 'settings' => $arg, 'category'=>__("Other Block") ]); } public function getName() { return __('Form Search All Service'); } 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'] = !empty($model['style']) ? $model['style'] : "style_1"; $model['list_slider'] = $model['list_slider'] ?? ""; $model['modelBlock'] = $model; $model['seatType'] = SeatType::get(); return $this->view('Template::frontend.blocks.form-search-all-service.'.$model['style'], $model); } public function contentAPI($model = []){ if (!empty($model['bg_image'])) { $model['bg_image_url'] = FileHelper::url($model['bg_image'], 'full'); } return $model; } }