<?php

class package {

    public static function getpacks(): array
    {
        return self::$packages;
    }

    public static function getPackId($price): array
    {
        foreach (self::$packages as $value) {
            if ($value['price'] == $price) {
                return $value;
            }
        }

        return [];
    }

    public static function getCashs($id): int
    {
        foreach (self::$packages as $value) {
            if ($value['id'] == $id) {
                return $value['cash'];
            }
        }

        return -1;
    }

    public static function getpack($id): array
    {
        foreach (self::$packages as $value) {
            if ($value['id'] == $id) {
                return $value;
            }
        }

        return [];
    }

    private static $packages = [
        [
            'id'          => 1,
            'name'        => '100 THB',
            'price'       => 100,
            'description' => '1,000 Cash',
            'cash'        => 1000,
            'img'         => 'https://divine-pride.net/img/items/item/iRO/23460',
            'items'       => [
                [
                    'item_id'       => 75000,
                    'item_name'     => 'Nihon Lucky Egg',
                    'item_quantity' => 2,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/17693.png',
                    'item_data'     => '^00FFFFมีโอกาสได้รับ item ต่างๆมากมาย',
                ],
                // [
                //     'item_id'       => 33007,
                //     'item_name'     => 'Nihon Costume Garment Box',
                //     'item_quantity' => 1,
                //     'item_refine'   => 0,
                //     'item_pic'      => 'https://static.divine-pride.net/images/items/item/22541.png',
                //     'item_data'     => '^00FFFFมี Costume Garment มากมายอยู่ภายใน',
                // ],
                [
                    'item_id'       => 33005,
                    'item_name'     => 'Nihon Costume Top/Mid/Low Box',
                    'item_quantity' => 1,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/17760.png',
                    'item_data'     => '^00FFFFมี Costume Top/Mid/Low มากมายอยู่ภายใน',
                ],
                [
                    'item_id'       => 12412,
                    'item_name'     => 'HE Bubble Gum',
                    'item_quantity' => 1,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/12412.png',
                    'item_data'     => '^00FFFFHE Bubble Gum Drop+200%',
                ]
            ],
            'recommended' => true
        ],
        [
            'id'          => 2,
            'name'        => '300 THB',
            'price'       => 300,
            'description' => '3,300 Cash',
            'cash'        => 3300,
            'img'         => 'https://divine-pride.net/img/items/item/iRO/7871',
            'items'       => [
                [
                    'item_id'       => 75000,
                    'item_name'     => 'Nihon Lucky Egg',
                    'item_quantity' => 6,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/17693.png',
                    'item_data'     => '^00FFFFมีโอกาสได้รับ item ต่างๆมากมาย',
                ],
                [
                    'item_id'       => 33007,
                    'item_name'     => 'Nihon Costume Garment Box',
                    'item_quantity' => 1,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/22541.png',
                    'item_data'     => '^00FFFFมี Costume Garment มากมายอยู่ภายใน',
                ],
                [
                    'item_id'       => 33005,
                    'item_name'     => 'Nihon Costume Top/Mid/Low Box',
                    'item_quantity' => 3,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/17760.png',
                    'item_data'     => '^00FFFFมี Costume Top/Mid/Low มากมายอยู่ภายใน',
                ],
                [
                    'item_id'       => 12412,
                    'item_name'     => 'HE Bubble Gum',
                    'item_quantity' => 4,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/12412.png',
                    'item_data'     => '^00FFFFHE Bubble Gum Drop+200%',
                ]
            ],
            'recommended' => true
        ],
        [
            'id'          => 3,
            'name'        => '500 THB',
            'price'       => 500,
            'description' => '6,100 Cash',
            'cash'        => 6100,
            'img'         => 'https://divine-pride.net/img/items/item/iRO/22538',
            'items'       => [
                [
                    'item_id'       => 75000,
                    'item_name'     => 'Nihon Lucky Egg',
                    'item_quantity' => 10,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/17693.png',
                    'item_data'     => '^00FFFFมีโอกาสได้รับ item ต่างๆมากมาย',
                ],
                [
                    'item_id'       => 33007,
                    'item_name'     => 'Nihon Costume Garment Box',
                    'item_quantity' => 2,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/22541.png',
                    'item_data'     => '^00FFFFมี Costume Garment มากมายอยู่ภายใน',
                ],
                [
                    'item_id'       => 33005,
                    'item_name'     => 'Nihon Costume Top/Mid/Low Box',
                    'item_quantity' => 5,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/17760.png',
                    'item_data'     => '^00FFFFมี Costume Top/Mid/Low มากมายอยู่ภายใน',
                ],
                [
                    'item_id'       => 12412,
                    'item_name'     => 'HE Bubble Gum',
                    'item_quantity' => 7,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/12412.png',
                    'item_data'     => '^00FFFFHE Bubble Gum Drop+200%',
                ]
            ],
            'recommended' => true
        ],
        [
            'id'          => 4,
            'name'        => '1,000 THB',
            'price'       => 1000,
            'description' => '13,500 Cash',
            'cash'        => 13500,
            'img'         => 'https://divine-pride.net/img/items/item/iRO/20844',
            'items'       => [
                [
                    'item_id'       => 75000,
                    'item_name'     => 'Nihon Lucky Egg',
                    'item_quantity' => 20,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/17693.png',
                    'item_data'     => '^00FFFFมีโอกาสได้รับ item ต่างๆมากมาย',
                ],
                [
                    'item_id'       => 33007,
                    'item_name'     => 'Nihon Costume Garment Box',
                    'item_quantity' => 5,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/22541.png',
                    'item_data'     => '^00FFFFมี Costume Garment มากมายอยู่ภายใน',
                ],
                [
                    'item_id'       => 33005,
                    'item_name'     => 'Nihon Costume Top/Mid/Low Box',
                    'item_quantity' => 10,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/17760.png',
                    'item_data'     => '^00FFFFมี Costume Top/Mid/Low มากมายอยู่ภายใน',
                ],
                [
                    'item_id'       => 12412,
                    'item_name'     => 'HE Bubble Gum',
                    'item_quantity' => 15,
                    'item_refine'   => 0,
                    'item_pic'      => 'https://static.divine-pride.net/images/items/item/12412.png',
                    'item_data'     => '^00FFFFHE Bubble Gum Drop+200%',
                ]
            ],
            'recommended' => true
        ],
    ];
}

?>