Take a look at my code sample

DEVELOPMENT MAKES SUCCESS, HAPPY CODING

<?  PHP ?>

public function hook()
        {
            global $wp_version;
            if (version_compare($wp_version, '5.3', '>=')) {
                add_action('wp_generate_attachment_metadata', [$this, 'updateAttachmentMeta'], $this::$configs->default_order, 2);
            } else {
                add_action('wp_update_attachment_metadata', [$this, 'updateAttachmentMeta'], $this::$configs->default_order, 2);
            }
        }

        public function userEndHook()
        {
            add_action('wp_get_attachment_url', [$this, 'getAttachmentUrl'], $this::$configs->default_order, 2);
            add_filter('wp_calculate_image_srcset', [$this, 'calculateImageSrcset'], $this::$configs->default_order, 5);
            add_filter('ucm_storage_media_url_rewrite', [$this, 'applyCloudStorageUrl'], $this::$configs->default_order, 3);
            add_filter('ucm_storage_media_url_correct_uri', [$this, 'correctDoubleSplashUri'], $this::$configs->default_order);

            /**
             * If option remove Cloud Media is set TRUE
             * then remove the cloud media as well when local media data get removed
            */
            if (get_option(self::$configs->plugin_db_prefix .'advanced_delete_cloud_file')) {
                add_action('delete_attachment', [$this, 'deleteAttachment'], $this::$configs->default_order, 1);
            }
        }

        public static function getAttachmentUrl($url, $post_id)
        {
            $attachment_storage = get_post_meta($post_id, '_ucm_storage_adapter', true);
            if ($attachment_storage) {
                $storage_metadata = get_post_meta($post_id, '_ucm_storage_metadata', true);
                $url = apply_filters('ucm_storage_media_url_rewrite', $url, $attachment_storage, unserialize($storage_metadata));
            }

            return $url;
        }

        /**
         * WordPress Responsive Images
         *
         * @param $sources
         * @param $size_array
         * @param $image_src
         * @param $image_meta
         * @param $post_id
         * @return mixed
         */
        public static function calculateImageSrcset($sources, $size_array, $image_src, $image_meta, $post_id)
        {
            $attachment_storage = get_post_meta($post_id, '_ucm_storage_adapter', true);
            if ($attachment_storage) {
                $storage_metadata = get_post_meta($post_id, '_ucm_storage_metadata', true);
                $storage_metadata = unserialize($storage_metadata);
                foreach ($sources as $size => $source) {
                    $sources[$size]['url'] = apply_filters('ucm_storage_media_url_rewrite', $source['url'], $attachment_storage, $storage_metadata);
                }
            }

            return $sources;
        }

        /**
         * Hook when update attachment metadata
         *
         * @param $data
         * @param $post_id
         * @return mixed
         */
        public function updateAttachmentMeta($data, $post_id)
        {
            if (!self::$hook_service) {
                return $data;
            }
            $option_post_types = get_option(self::$configs->plugin_db_prefix .'post_types');
            $option_post_types = $option_post_types ? explode(',', $option_post_types) : '';

            $option_file_types = get_option(self::$configs->plugin_db_prefix .'file_types');
            $option_file_types = $option_file_types ? explode(',', $option_file_types) : '';

            if ($this->activeAdapter && class_exists($this->activeAdapter['addon_class'])) {
                /**
                 * Check if post type filter is enabled
                 * Ignore if requested post type is not in the filters
                **/
                if ($option_post_types && $this->getCurrentPagePostType() && !in_array($this->getCurrentPagePostType(), $option_post_types, false)) {
                    return $data;
                }

                if ($option_file_types && !in_array($this->_parseFileExtension($data['file']), $option_file_types, false)) {
                    return $data;
                }

                $cloud_account_config = unserialize($this->activeAdapter['value']);
                if ($this->activeAdapter['storage_adapter']) {
                    $result = apply_filters("ucm_{$this->activeAdapter['storage_adapter']}_upload_media", $data);
                } else {
                    $result = new WP_Error('exception', __('Invalid cloud storage account configuration', 'ultimate-media-on-the-cloud'));
                }

                if (is_wp_error($result)) {
                    wp_delete_attachment($post_id, true);
                    /**@var WP_Error $result*/
                    wp_send_json_error(['message' => $this->WpErrorsToHTML($result)]);
                    wp_die();
                }

                $cloud_storage_data = [
                    'account_id' => $this->activeAdapter['id'],
                    'path' => $cloud_account_config['cloud_path'],
                    'bucket' => $cloud_account_config['bucket'],
                    'region' => $cloud_account_config['region']
                ];
                update_post_meta($post_id, '_ucm_storage_adapter', $this->activeAdapter['storage_adapter']);
                update_post_meta($post_id, '_ucm_storage_metadata', serialize($cloud_storage_data));
            }

            return $data;
        }

  ANGULAR


Component({
    selector: 'app-admin-booking',
    templateUrl: './admin-booking.component.html',
    styleUrls: ['./admin-booking.component.scss'],
    animations: [
        trigger('changeDivSize', [
            state('initial', style({
                height: 'auto'
            })),
            state('final', style({
                height: '{{height}}'
            }), {params: {height: '0'}}),
            transition('initial=>final', animate('300ms')),
            transition('final=>initial', animate('300ms'))
        ]),

        trigger('changeTriggerPosition', [
            state('initial', style({
                bottom: 'auto',
            })),
            state('final', style({
                bottom: '30px',
            }), ),
            transition('initial=>final', animate('300ms')),
            transition('final=>initial', animate('300ms'))
        ]),
    ],

    providers: [DatePipe,
        {provide: DateAdapter, useClass: AppDateAdapter},
        {provide: MAT_DATE_FORMATS, useValue: APP_DATE_FORMATS}
    ]
})

export class AdminBookingComponent implements OnInit {
    admin: any;
    maxDOB: any;
    /*Today Time*/
    today: any;
    public scrollbarOptions = { axis: 'y', theme: '3d-thick-dark'};

    /* Default configuration */
    bookingDefaultConfigs = {
        /* Guest Adult default memberType Id */
        userCrmDefaultMemberTypeId: '',
        userCrmDefaultMemberTypeName: '',
        dateFormat: 'dd/M/yyyy',
        guest: {
            noEmail: 'guest[RANDOM_NO]@email.com',
            noFullName: 'Guest'
        },
        AddonTypes: [
            {name: 'F&B List', identifier: 'AddonsFAndB'},
            {name: 'Disposables List', identifier: 'AddonsDisposables'},
            {name: 'Inventory List', identifier: 'AddonsInventory'},
            {name: 'Activity', identifier: 'Activity'},
            {name: 'Additional Pax', identifier: 'AdditionPax'},
        ],
        bookingPeriod: {
            minDate: null,
            maxDate: null
        },
        enableTermAndCondition: false,
        offPeakFacilities: [],
        swimmingPoolFacilities: [],
    };

    // Check if membership price at backend for membership is not set and fall back to default system membership id
    isDefaultMembershipFallback = false;

    /*GST and Coupon */
    couponAndGST = {
        discount: 0,
        code: '',
        errorCoupon: '',
        gst: 1.07
    };

    guestCheckMode: string;
    /* Form Objects */
    chooseUserForm: FormGroup;
    addGuestForm: FormGroup;
    chooseFacilityForm: FormGroup;
    mainGuestForm: FormGroup;
    checkAttendeeForm: FormControl;
    filterForm: FormGroup;
    attendeeDetailsForm: FormGroup;
    prePaymentForm: FormGroup;
    tPlayBookingPaymentForm: FormGroup;

    /*Handle the Booking routing*/
    appBookingRoute = {
        currentNavigateSlug: '',
        navigationHint: '',
        navigateConstant: [],
        navigateStack: []
    };

    /*Main booking guest*/
    mainGuest: any;

    isTimeslotInLoading: boolean;
    /* Handle the application state */
    state: {
        attendeeCurrentIndex: number,
        isMainGuestFormDisplayed: boolean,
        attendeeDetailsFormDisplayed: boolean,

        /*Support for Package booking flow*/
        packageCurrentFacilitySelectionIndex: number,

        /*Payment review page*/
        paymentCompletedSuccessDisplay: boolean,
        paymentCompletedErrorDisplay: boolean,

        selectedDateByFilter: any,
        dob: {
            minDate: any,
            maxDate: any
        }
    };

    /*Store the preset data*/
    data = {
        facilityType: '',
        facilities: [],
        pricesByDate: [],
        pricesByHour: [],
        activityAttendeeAddonPrices: [],
        AddOns: []
        // AddOns: IAddOnesDisposables[]
    };

    /*Store the booking data information*/
    bookingData: {
        facility: IFacility,
        attendees: any[],
        pricesForGuests: any[],
        MemberTypeTotalPrices: any[],
        selectedDate: any,
        selectedPackageTimeSlot: any,
        selectedTimeslots: any,
        addOnsAddedItems: IAddOnesDisposables[],
        facilityBookingProgressType: string,
        swimmingPoolMemberTypePrices: {
            Adult: any,
            Child: any,
        },
        state: {
            isCompleted: boolean,
            bookingOrderId: string,
        }
    };

    constructor(
        private fb: FormBuilder,
        private router: Router,
        private datePipe: DatePipe,
        private authService: AuthService,
        private bookingService: BookingService,
        public  bookingComponent: BookingComponent,
        private notifier: NotifierService,
        public domSanitizer: DomSanitizer,
        public  appLocation: Location
    ) {
        const admin = this.authService.getAdmin();
        if (!admin || !this.authService.tokenIsValid()) {
            this.router.navigate(['/login/admin']);
        }
    }

    ngOnInit(): void {
        const today = new Date();
        this.maxDOB = new Date(today.getFullYear(), today.getMonth(), today.getDate());

        this.bookingDefaultConfigs.offPeakFacilities = [];
        this.bookingDefaultConfigs.swimmingPoolFacilities = [];

        this.bookingService.getSystemConfig().pipe().subscribe(response => {
            if (response.StatusResult) {
                this.bookingDefaultConfigs.userCrmDefaultMemberTypeId = response.Data.MemberTypeIdDefault;
                this.bookingDefaultConfigs.userCrmDefaultMemberTypeName = response.Data.MemberTypeNameDefault;

                if (response.Data.hasOwnProperty('GymFacilityId')) {
                    this.bookingDefaultConfigs.offPeakFacilities = response.Data.GymFacilityId;
                }

                if (response.Data.hasOwnProperty('SwimmingFacilityId')) {
                    this.bookingDefaultConfigs.swimmingPoolFacilities = response.Data.SwimmingFacilityId;
                }
            } else {
                Swal.fire({
                    title: 'System Crashed',
                    text: 'An error occurred while loading system config.',
                    icon: 'warning',
                    showCancelButton: false,
                    confirmButtonColor: '#3085d6',
                    confirmButtonText: 'Ok'
                }).then((result) => {
                    this.router.navigate(['/booking/main']).then();
                });
            }

            this.isDefaultMembershipFallback = false;
        });

        this.admin = this.authService.getAdmin();
        this.today = new Date();
        this.initForms();
        this.restartTheProgress();
        this.setInitAdminBookingSlugs();
        this.setCurrentNavigateSlug('booking-choose-guest');
    }

    /**
     * Restore the original progress to first step
     *  Make sure the booking progress is completely fresh and new, no trash data
     *
     * @return void
     */
    restartTheProgress() {
        if (typeof this.bookingData !== 'undefined') {
            return this.navigateToRestartProgress();
        }

        this.isDefaultMembershipFallback = false;
        this.mainGuest = null;
        this.state = {
            attendeeCurrentIndex: 0,
            isMainGuestFormDisplayed: false,
            attendeeDetailsFormDisplayed: false,
            packageCurrentFacilitySelectionIndex: 0,
            paymentCompletedSuccessDisplay: false,
            paymentCompletedErrorDisplay: false,
            selectedDateByFilter: new Date(),
            dob: {
                minDate: null,
                maxDate: null
            }
        };
        this.data = {
            facilityType: '',
            facilities: [],
            pricesByDate: [],
            pricesByHour: [],
            activityAttendeeAddonPrices: [],
            AddOns: []
        };

        this.bookingData = {
            facility: null,
            attendees: [],
            pricesForGuests: [],
            MemberTypeTotalPrices: [],
            selectedDate: new Date(),
            selectedPackageTimeSlot: null,
            selectedTimeslots: [],
            addOnsAddedItems: [],
            facilityBookingProgressType: 'normal',
            swimmingPoolMemberTypePrices: {
                Adult: [],
                Child: [],
            },
            state: {
                isCompleted: false,
                bookingOrderId: '',
            }
        };

        this.bookingDefaultConfigs.bookingPeriod.minDate = null;
        this.bookingDefaultConfigs.bookingPeriod.maxDate = null;

        this.appBookingRoute.navigateStack = [];
        this.data.AddOns = [];

        this.filterForm.reset();
        this.filterForm = this.fb.group({
            numberOfAttendees: [{value: null, disabled: false}],
            timeslot: [{value: null, disabled: false}],
            package: [{value: null, disabled: false}, []],
            subChoice: [{value: null, disabled: false}, []],
            activityList: [{value: null, disabled: false}, []],
            additionalInformation: [{value: null, disabled: false}, []],
            facilityChoices: [{value: '', disabled: false}, []],
            numberOfAdults: [{value: '', disabled: false}],
            numberOfChildren: [{value: '', disabled: false}],
        });
    }
}

  VueJS


    import DibbleJS from "../../../dibble";
    import DibbleAPI from "../../../api";
    import $ from "jquery";
    import DibbleTranslation from "../../../translation/translation";
    import VSelect from "@alfsnd/vue-bootstrap-select";

    export default {
    name: "modalEditBanner",
    props: {
        categories: Array,
    },
    components: {
        VSelect
    },
    data() {
        return {
            state: {
                isPerformingRequest: false,
            },
            translate: DibbleTranslation,
            errors: [],
            form_errors: [],
            banner: null,
            form: {
                name: '',
                description: '',
                link_category_id: '',
                is_active: true,
            },
            banner_image: null,
        }
    },
    methods: {
        loadData(data) {
            this.banner = data;
            this.form.name = data.name;
            this.form.description = data.description;
            this.form.link_category_id = this.categories.find(item => item.value === data.link_category_id);
            this.form.is_active = data.is_active;
            this.banner_image = null;
            if (data.image) {
                const image = {};
                image.name = data.image;
                image.value = '';
                this.banner_image = image;
            }
        },
        performUpdateBanner() {
            this.errors = [];
            this.form_errors = [];
            if (!this.form.name) {
                this.errors.push(this.translate.trans('banners.add.error_name'));
                this.form_errors.push('name');
            }

            if (this.errors.length) {
                DibbleJS.toastErrorMessage(this.translate.trans('global.error.form.fields'));
                return false;
            }

            const params = {
                request: DibbleAPI.api.updateBanner,
                banner_id: this.banner.banner_id,
                name: this.form.name,
                description: this.form.description,
                link_category_id: this.form.link_category_id ? this.form.link_category_id.value : '',
                is_active: this.form.is_active ? 1 : 0
            };

            const addedImageName = $('.image-name').val();
            const addedImageValue = $('.image-value').val();
            if (addedImageValue) {
                params.image_name = addedImageName;
                params.image = addedImageValue;
            }

            this.state.isPerformingRequest = true;
            DibbleJS.callApiRequest(params, this._onUpdateBannerSuccess);
        },
        readBannerImage(input) {
            if (input.target.files && input.target.files[0]) {
                this.banner_image = {};
                const reader = new FileReader();
                const file = input.target.files[0];
                const image = {};
                image.name = file.name;

                reader.onload = (e) => {
                    image.value = e.target.result;
                    this.banner_image = image;
                };

                reader.readAsDataURL(input.target.files[0]);
            }
        },
        removeBannerImage() {
            this.banner_image = null;
        },
        closeModal() {
            this.$emit('close');
        },
        _onUpdateBannerSuccess(responseData) {
            this.state.isPerformingRequest = false;
            if (DibbleAPI.isResponseSuccess(responseData)) {
                DibbleJS.toastSuccessMessage(responseData.message);
                this.$emit('bannerListener', 'reload');
            } else {
                DibbleJS.toastErrorMessage(responseData.message);
            }
        }
    }
    ,created() {
        this.$parent.$on('setEditBannerData', this.loadData);
    }
}

  React Native


export const ParkingStepTwo = observer(function ParkingStepTwo(props: IProps) {
    const navigation = useNavigation()
    const openEditAuthorizedInfo = () => navigation.navigate("authUsers", {
      onGoBack: () => {
        setProfile(MoorageOrderStore.getAuthorizedInfo)
      }
    })
    const insuranceEdit = () => navigation.navigate("insuranceEdit", {
      onGoBack: () => {
        setInsurance(MoorageOrderStore.getInsuranceInfo())
      }
    })

    const registrationEdit = () => navigation.navigate("registEdit", {
      onGoBack: () => {
        setRegistrationInfo(MoorageOrderStore.getRegistrationInfo())
      }
    })

    const [haveTrailer, setHaveTrailer] = useState (false);
    const [boats, setBoats] = React.useState([])
    const [selectedBoat, setSelectedBoat] = useState(null)
    const [showIndicator, setShowIndicator] = useState(false)

    const [profile, setProfile] = useState({
      user1_name: props.mooringInfo?.auth_user_1_full_name || '',
      user1_phone: props.mooringInfo?.auth_user_1_phone || '',
      user2_name: props.mooringInfo?.auth_user_2_full_name || '',
      user2_phone: props.mooringInfo?.auth_user_2_phone || '',
    })

    const [insurance, setInsurance] = useState({
      image: props?.mooringInfo?.driver_license_image || "",
      companyName: props?.mooringInfo?.insurance_company_name || "",
      id: props?.mooringInfo?.insurance_policy_number || "",
      exp: props?.mooringInfo?.insurance_expiration_date || ""
    })

    const [registrationInfo, setRegistrationInfo] = useState({
      registration_state: props?.mooringInfo?.registration_state || '',
      registration_number: props?.mooringInfo?.registration_number || '',
      registration_expiration_date: props?.mooringInfo?.registration_expiration_date || '',
      registration_image: props?.mooringInfo?.registration_image || null,
      has_coast_guard_doc: props?.mooringInfo?.has_coast_guard_doc || false,
      coast_guard_doc_expiration_date: props?.mooringInfo?.coast_guard_doc_expiration_date || '',
      coast_guard_doc_image: props?.mooringInfo?.coast_guard_doc_image || '',
      driver_license_image: props?.mooringInfo?.driver_license_image || '',
    })

    const setOrderAuthenticatedInfo = (data = null) => {
      if (data != null) {
        setProfile(data)
      }
      MoorageOrderStore.setAuthorizedInfo(profile)
    }

    const setInsuranceInfo = (data = null) => {
      if (data != null) {
        setInsurance(data)
      }
      MoorageOrderStore.setInsuranceInfo(insurance)
    }

    const setRegistrationInfoData = (data = null) => {
      if (data != null) {
        setRegistrationInfo(data)
      }
      MoorageOrderStore.setRegistrationInfo(registrationInfo)
    }

    useEffect(() => {
        setOrderAuthenticatedInfo()
        setInsuranceInfo()
        setRegistrationInfoData()

        const params = {
            request: Api.request.getMyAssetsBoats
        }

        setShowIndicator(true)
        ApplicationHelper.callApiRequest(params,
            ((responseData: any) => {
                setShowIndicator(false)
                if (responseData?.rc === 0) {
                    setBoats(responseData?.boats || [])
                } else {
                    ApplicationHelper.showShortToast(responseData.message)
                }
            }), ((error: any) => {
                setShowIndicator(false)
                ApplicationHelper.showShortToast("Error")
            }))

    }, [])

    const publishNewBoat = () => {
      navigation.navigate('publishBoat', {
        onGoBack: () => {
          const params = {
            request: Api.request.getMyAssetsBoats
          }

          setShowIndicator(true)
          ApplicationHelper.callApiRequest(params,
            ((responseData: any) => {
              setShowIndicator(false)
              if (responseData?.rc === 0) {
                setBoats(responseData?.boats || [])
              } else {
                ApplicationHelper.showShortToast(responseData.message)
              }
            }), ((error: any) => {
              setShowIndicator(false)
              ApplicationHelper.showShortToast("Error")
            }))
        }
      })
    }

    return (
        
            
            
            
                {boats.map((item, idx) =>
                    
                        
                            
                            
                                
                                
                            
                        
                        
                            
                                
                                
                            
                            
                                
                                
                            
                            
                                
                                
                            
                            
                                
                                
                            
                            
                                
                                
                            
                        
                        

  Android Kotlin


class MainAffiliateMember : BaseActivity(), KeyEvent.Callback, View.OnClickListener  {

    private var barcode = ""
    private var ticketIdScanned = ""
    private var isForTicketScanned = false
    private var listenForEvent = true
    private var guestRegisterList = ArrayList()

    private lateinit var mAdminComponentName: ComponentName
    private lateinit var mDevicePolicyManager: DevicePolicyManager

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main_affiliate_member)

        setImmersiveMode(true)

        mAdminComponentName = MyDeviceAdminReceiver.getComponentName(this)
        mDevicePolicyManager = getSystemService(Context.DEVICE_POLICY_SERVICE) as DevicePolicyManager

        imgFirstTimeUser.setOnClickListener(this)
        imgRegisteredUsers.setOnClickListener(this)
        startOver.setOnClickListener(this)
        imgStartOver.setOnClickListener(this)
        rlBack.setOnClickListener(this)

        hideunhidebtn.text = getString(R.string.hide)
        imgHelpImg.visibility = View.VISIBLE
        SharedPreferenceUtils.getInstance(this).setValue(Constant.ISAVTARIMAGEVISIBLE, true)

        tvVersion.text = "VERSION ${getVersionName()}"
        setKioskname(tvKioskId)
    }

    override fun onResume() {
        super.onResume()
        checkAlreadyPinEntered(imgHelpImg, hideunhidebtn)
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.imgHelpImg -> {
                getKioskHelp()
                showNeedHelpDialog(true)
            }

            R.id.hideunhidebtn -> {
                if (hideunhidebtn.text.toString().trim() == getString(R.string.hide)) {
                    hideunhidebtn.text = getString(R.string.unhide)
                    imgHelpImg.visibility = View.INVISIBLE
                    SharedPreferenceUtils.getInstance(this).setValue(Constant.ISAVTARIMAGEVISIBLE, false)
                } else if (hideunhidebtn.text.toString().trim() == getString(R.string.unhide)) {
                    hideunhidebtn.text = getString(R.string.hide)
                    imgHelpImg.visibility = View.VISIBLE
                    SharedPreferenceUtils.getInstance(this).setValue(Constant.ISAVTARIMAGEVISIBLE, true)
                }
            }

            R.id.imgFirstTimeUser -> {
                val intent = Intent(this, WebViewActivity::class.java)
                intent.putExtra("urlToLoad", Constant.NEED_QR_URL)
                intent.putExtra("showInGoogleViewer", false)
                startActivity(intent)
            }

            R.id.imgRegisteredUsers -> {
                val intent = Intent(this, WebViewActivity::class.java)
                intent.putExtra("urlToLoad", Constant.GENERATE_QR_URL)
                intent.putExtra("showInGoogleViewer", false)
                startActivity(intent)
            }

            R.id.startOver -> {
                val intent = Intent(this, MainActivity::class.java)
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
                startActivity(intent)
            }

            R.id.imgStartOver-> {
                val intent = Intent(this, MainActivity::class.java)
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
                startActivity(intent)
            }

            R.id.rlBack -> {
                finish()
            }
        }
    }

    override fun onResponse(MethodName: String, responseCode: Int, mRes: String, responseTag: String) {
        super.onResponse(MethodName, responseCode, mRes, responseTag)
        try {
            val jsonObject = JSONObject(mRes)
            when (responseTag) {
                Constant.GET_KIOSK_INFO_BY_ID -> {
                    if (jsonObject.has("Data")) {
                        val jsonObject1 = jsonObject.getJSONObject("Data")
                        if (!jsonObject1.getBoolean("Bootup")) {
                            val intent = Intent(this, SystemMaintananceAcivity::class.java)
                            startActivity(intent)
                            finish()
                            return
                        }

                        val showHelpAvatar = jsonObject1.getBoolean("ShowHelpAvatar")
                        val adminPin = jsonObject1.getInt("AdminPin")
                        val supportMobileSMS = jsonObject1.getString("SupportMobileSMS")
                        val kioskName = jsonObject1.getString("KioskName")
                        val skipCatalogPage = jsonObject1.getBoolean("SkipCatalogPage")
                        val clubHouseId = jsonObject1.getString("ClubHouseId")
                        val clubHouseName = jsonObject1.getString("ClubHouseName")
                        val facilityId = jsonObject1.getString("FacilityId")
                        val facilityName = jsonObject1.getString("FacilityName")
                        val showHelpAvatarFromHour = jsonObject1.getString("ShowHelpAvatarFromHour")
                        val showHelpAvatarToHour = jsonObject1.getString("ShowHelpAvatarToHour")
                        var screenTimeout = jsonObject1.getInt("ScreenTimeout") * 1000
                        if (screenTimeout == 10000) {
                            screenTimeout = 11000
                        }
                        Logger.print("JsonFile Data","$showHelpAvatar $adminPin $supportMobileSMS $kioskName -- $screenTimeout")
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.SHOWHELPAVATAR, showHelpAvatar)
                        checkAlreadyPinEntered(imgHelpImg, hideunhidebtn)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.ADMINPIN, adminPin)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.SupportMobileSMS, supportMobileSMS)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.KioskName, kioskName)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.SCREEN_TIMEOUT, screenTimeout)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.SKIP_CATALOGUE_PAGE, skipCatalogPage)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.FACILITYID, facilityId)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.FACILITYNAME, facilityName)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.CLUBHOUSEID, clubHouseId)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.CLUBHOUSENAME, clubHouseName)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.SHOWHELPAVATARFROMHOUR, showHelpAvatarFromHour)
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.SHOWHELPAVATARTOHOUR, showHelpAvatarToHour)
                        setKioskname(tvKioskId)
                    }
                }

                Constant.GET_BOOKING_INFO -> {
                    Logger.print(mRes)
                    if (jsonObject.getInt("StatusResult") == 1) {
                        if (isForTicketScanned) {
                            isForTicketScanned = false
                            var sessionId = SharedPreferenceUtils.getInstance(this).getIntValue(Constant.SESSION_ID, 0)
                            sessionId++
                            SharedPreferenceUtils.getInstance(this).setValue(Constant.SESSION_ID, sessionId)
                            SharedPreferenceUtils.bookingDetailsJson = jsonObject
                            val intent = Intent(this, TicketWristTagListActivity::class.java)
                            intent.putExtra(Constant.USER_TYPE, Constant.TICKET)
                            intent.putExtra("scannedTicketId", ticketIdScanned)
                            startActivity(intent)
                        } else {
                            var sessionId = SharedPreferenceUtils.getInstance(this).getIntValue(Constant.SESSION_ID, 0)
                            sessionId++
                            SharedPreferenceUtils.getInstance(this).setValue(Constant.SESSION_ID, sessionId)
                            SharedPreferenceUtils.bookingDetailsJson = jsonObject
                            val intent = Intent(this, BookingDetailUpcomingSessionActivity::class.java)
                            intent.putExtra(Constant.USER_TYPE, Constant.GUEST_USER)
                            startActivity(intent)
                        }
                    } else {
                        showAlertDialog(getString(R.string.qr_read_error))
                    }
                }

                Constant.GET_GUEST_INFORMATION_V4 -> {
                    if(jsonObject.getInt("StatusResult") == 1) {
                        val gson = Gson()
                        val memberDetailsData = gson.fromJson(jsonObject.toString(), MemberDetailsData::class.java)

                        var guestAdultMemberTypeId = ""
                        var guestChildMemberTypeId = ""
                        val userMemberType = memberDetailsData.Data.MemberTypeList[0].MemberTypeName
                        for(i in memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList.indices) {
                            if(memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeName.contains(userMemberType) &&
                                memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeName.contains("Adult")) {
                                guestAdultMemberTypeId = memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeId
                            } else if (memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeName.contains(userMemberType) &&
                                memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeName.contains("Child")) {
                                guestChildMemberTypeId = memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeId
                            }
                        }

                        if(guestAdultMemberTypeId == "" || guestChildMemberTypeId == "") {
                            val userMemberType = "Guest"
                            for(i in memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList.indices) {
                                if(memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeName.contains(userMemberType) &&
                                    memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeName.contains("Adult")) {
                                    guestAdultMemberTypeId = memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeId
                                } else if (memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeName.contains(userMemberType) &&
                                    memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeName.contains("Child")) {
                                    guestChildMemberTypeId = memberDetailsData.Data.MemberTypeListOfFacility[0].MemberTypeList[i].MemberTypeId
                                }
                            }
                        }

                        SharedPreferenceUtils.getInstance(this@MainAffiliateMember).setValue(Constant.ADULTMEMBERTYPEID, guestAdultMemberTypeId)
                        SharedPreferenceUtils.getInstance(this@MainAffiliateMember).setValue(Constant.CHILDMEMBERTYPEID, guestChildMemberTypeId)

                        val guestRegister = GuestRegister(
                            "",
                            memberDetailsData.Data.MemberTypeList[0].MemberId,
                            "",
                            "",
                            "",
                            memberDetailsData.Data.FullName,
                            memberDetailsData.Data.Email,
                            memberDetailsData.Data.Mobile,
                            memberDetailsData.Data.DateOfBirth,
                            memberDetailsData.Data.MemberTypeList,
                            memberDetailsData.Data.AgeNumber,
                            memberDetailsData.Data.GuestType,
                            ""
                        )

                        guestRegisterList.add(guestRegister)

                        setDataInSharedPref(guestRegisterList)

                        SharedPreferenceUtils.getInstance(this).setValue(Constant.ISLOGIN, true)

                        var sessionId = SharedPreferenceUtils.getInstance(this).getIntValue(Constant.SESSION_ID, 0)
                        sessionId++
                        SharedPreferenceUtils.getInstance(this).setValue(Constant.SESSION_ID, sessionId)

                        val intent = Intent(this, HomeActivity::class.java)
                        intent.putExtra(Constant.USER_TYPE, Constant.MEMBERSHIP_CARD)
                        intent.putExtra(Constant.CODE_DATA, barcode)
                        startActivity(intent)
                    } else {
                        showAlertDialog(getString(R.string.qr_read_error))
                    }
                }
        }
 }

Hire Me
For The Next
Projects

If you have a project, and would like to work with me. Please get in touch by phone / skype / email or the contact form in next section.

Phone : +84 973 066 735
Skype: Chat on Skype
Email: [email protected]

    Feel free to contact me anytime by filling the form and send over to me. You could ask for information, getting a free quote or advice. I will get back to you as soon as possible after received the content. Thanks!