Snippets Collections
import os
import time
import sys

class Player:
    def __init__(self, name, difficulty):
        self.name = name
        self.difficulty = difficulty
        self.attack = 0
        self.defense = 0
        self.dodge = 0
        self.speed = 0
        self.gold = 0
        self.diamonds = 0
        self.experience = 0
        self.level = 1
        self.exp_required = 100
        self.exp_multiplier = 0.75  # 75% increase for experience requirement per level
        self.inventory = {  # Initialize inventory
            "Weapons": [],
            "Armors": [],
            "Shields": [],
            "Footwear": [],
            "Usable Items": []  # Add Usable Items category
        }
        self.equipped_items = {  # Initialize equipped items
            "Weapons": {"name": "Broken Sword", "description": "+10 Damage", "Attack": 10},
            "Armors": {"name": "Broken Armor", "description": "+5 Defense", "Defense": 5},
            "Shields": {"name": "Broken Shield", "description": "+2 Dodge", "Dodge": 2},
            "Footwear": {"name": "Broken Footwear", "description": "+3 Speed", "Speed": 3},
            "Accessories": None,
            "Bag": None
        }
        self.base_stats = {
            "HP": 100,
            "Defense": 0,
            "Attack": 0,
            "Dodge": 0,
            "Speed": 0
        }
        self.max_inventory_slots = 30
        self.update_stats()  # Update player stats based on equipped items
        
    def visit_inventory(self):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print("Inventory:")
            print("=" * 40)
            print("1. Weapons")
            print("2. Armors")
            print("3. Shields")
            print("4. Footwear")
            print("5. Usable Items")
            print("6. Back to Player Status")
            print("\nEnter the number to select an option.")

            choice = input("")

            if choice == "1":
                self.display_items("Weapons")
            elif choice == "2":
                self.display_items("Armors")
            elif choice == "3":
                self.display_items("Shields")
            elif choice == "4":
                self.display_items("Footwear")
            elif choice == "5":
                self.display_items("Usable Items")
            elif choice == "6":
                self.display_status()
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)

    def display_items(self, item_type):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print(f"{item_type}:")
            print("=" * 40)
            if self.inventory[item_type]:
                for idx, item in enumerate(self.inventory[item_type], 1):
                    print(f"{idx}. {item['name']}: {item['description']}")
                print("0. Back to Inventory Menu")
                print("Enter the number to equip the item or 0 to go back.")
                choice = input("")
                if choice == "0":
                    break  # Break out of the inner loop to return to the previous menu
                elif choice.isdigit() and 0 < int(choice) <= len(self.inventory[item_type]):
                    self.equip_item(item_type, int(choice) - 1)
                else:
                    print("Invalid option. Please enter a valid number.")
                    time.sleep(1)
            else:
                print("No items in this category.")
                print("Press < to go back")
                choice = input("")
                if choice == "<":
                    break  # Break out of the inner loop to return to the previous menu

    def equip_item(self, item_type, index):
        item = self.inventory[item_type].pop(index)
        if item_type in ["Weapons", "Armors", "Shields", "Footwear"]:
            self.remove_equipped_item(item_type)  # Remove any previously equipped item of the same type
            self.equipped_items[item_type] = item  # Equip the new item
            self.update_stats()  # Update player stats with the new equipment
            print(f"{item['name']} equipped.")
            time.sleep(1)
        else:
            # Handle equipping usable items
            pass
        self.visit_inventory()

    def remove_equipped_item(self, item_type):
        if item_type in self.equipped_items:
            item = self.equipped_items.pop(item_type)
            self.inventory[item_type].append(item)

    def update_stats(self):
        # Reset stats to base values
        for stat in self.base_stats:
            setattr(self, stat.lower(), self.base_stats[stat])

        # Apply bonuses from equipped items
        equipped = False  # Flag to track if any item is equipped
        for item_type, item in self.equipped_items.items():
            if item:
                equipped = True
                self.when_equipped(item)

        # If no items are equipped, set all stats (except HP) to 0
        if not equipped:
            for stat in self.base_stats:
                if stat != "HP":
                    setattr(self, stat.lower(), 0)

    def when_equipped(self, item):
        for stat in item:
            if stat in self.base_stats:
                setattr(self, stat.lower(), self.base_stats[stat] + item[stat])

                
    def display_equipped_items(self):
        os.system('cls' if os.name == 'nt' else 'clear')
        print("Equipped Items:")
        print("=" * 40)
        for item_type, item in self.equipped_items.items():
            if item:
                print(f"{item_type}: {item['name']} - {item['description']}")
            else:
                print(f"{item_type}: None")
                
    def display_status(self):
        clear_screen()
        print("Player Status:")
        print("=" * 40)
        print(f"Name: {self.name}")
        print(f"Difficulty: {self.difficulty}")
        print("-" * 40)
        print("Stats:")
        print(f"HP      :❤️{self.base_stats['HP']}")
        print(f"Defense :🛡️{self.defense}")
        print(f"Attack  :⚔️{self.attack}")
        print(f"Dodge   :🤺{self.dodge}")
        print(f"Speed   :🏃{self.speed}")
        print("-"*40)
        print(f"Level: {self.level}")
        print(f"Experience: {self.experience}/{self.exp_required}")
        print("-"*40)
        print(f"Gold: {self.gold} 💰")
        print(f"Diamonds: {self.diamonds} 💎")
        print("="*40)
        print("Game Options:")
        print("1. Visit Shop")
        print("2. Inventory")
        print("3. Equipped Items")
        print("4. Play Game")
        print("5. Delete this Character")
        print("6. Add 50 Experience Points")
        print("\nEnter the number to select an option.")

        choice = input("")
        if choice == "1":
            self.visit_shop()
        elif choice == "2":
            self.visit_inventory()
        elif choice == "3":
            self.display_equipped_items()
        elif choice == "4":
            self.play_game()
        elif choice == "5":
            return
        elif choice == "6":
            self.add_experience(50)
        else:
            print("Invalid option. Please enter a valid number.")
            time.sleep(1)
            self.display_status()
            
    def calculate_stat(self, stat_name):
        base_stat = getattr(self, stat_name)
        bonus_stat = sum(item.get(stat_name, 0) for item in self.equipped_items.values() if item)
        return base_stat + bonus_stat

    def display_items(self, item_type):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"{item_type}:")
        print("=" * 40)
        if self.inventory[item_type]:
            for idx, item in enumerate(self.inventory[item_type], 1):
                if item:  # Check if item is not None
                    print(f"{idx}. {item['name']}: {item['description']}")
                else:
                    print("No items in this category.")
                    print("You need to press < to go back.")
            choice = input("")
            if choice == "<":
                self.visit_inventory()
            elif choice.isdigit() and 0 < int(choice) <= len(self.inventory[item_type]):
                self.equip_item(item_type, int(choice) - 1)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_items(item_type)
        else:
            print("No items in this category.")
            print("You need to press < to go back.")
            choice = input("")
            if choice == "<":
                self.visit_inventory()
            else:
                print("Invalid option. Please enter < to go back.")
                time.sleep(1)
                self.visit_inventory()
    def equip_item(self, item_type, index):
        if item_type in self.equipped_items:
            if 0 <= index < len(self.inventory[item_type]):
                item = self.inventory[item_type].pop(index)
                if self.equipped_items[item_type]:
                    old_item = self.equipped_items[item_type]
                    self.inventory[item_type].append(old_item)
                self.equipped_items[item_type] = item
                self.update_stats()  # Update stats after equipping any item
                print(f"{item['name']} equipped.")
                time.sleep(1)
            else:
                print("Invalid item index.")
                time.sleep(1)
        else:
            print("Invalid item type.")
            time.sleep(1)

    def apply_item_stats(self, item):
        if 'Attack' in item:
            self.attack += item['Attack']
        if 'Defense' in item:
            self.defense += item['Defense']
        if 'Dodge' in item:
            self.dodge += item['Dodge']
        if 'Speed' in item:
            self.speed += item['Speed']

    def unequip_item(self, item_type_to_unequip):
        if self.equipped_items[item_type_to_unequip]:
            self.inventory[item_type_to_unequip].append(self.equipped_items[item_type_to_unequip])
            self.equipped_items[item_type_to_unequip] = None
            print(f"{item_type_to_unequip}: None")
            time.sleep(1)
            self.unequip_menu(item_type_to_unequip)
        else:
            print("No item equipped.")
            time.sleep(1)
            self.display_equipped_items()
            
    def unequip_menu(self, item_type_to_unequip):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"Unequip {item_type_to_unequip}:")
        print("=" * 40)
        if self.equipped_items[item_type_to_unequip]:
            print(f"1. {self.equipped_items[item_type_to_unequip]['name']} - {self.equipped_items[item_type_to_unequip]['description']}")
            print("Enter 1 to unequip or press < to cancel.")
            choice = input("")
            if choice == "1":
                self.unequip_item(item_type_to_unequip)
            elif choice == "<":
                self.display_equipped_items()
            else:
                print("Invalid option. Please enter a valid option.")
                time.sleep(1)
                self.unequip_menu(item_type_to_unequip)
        else:
            print(f"No {item_type_to_unequip} equipped.")
            time.sleep(1)
            self.display_equipped_items()
            
    def display_equipped_items(self):
        clear_screen()
        print("Equipped Items:")
        print("=" * 40)
        for item_type, item in self.equipped_items.items():
            if item:
                print(f"{item_type}: {item['name']} - {item['description']}")
            else:
                print(f"{item_type}: None")
        print("\nUnequip Items:")
        print("=" * 40)
        for i, (item_type, item) in enumerate(self.equipped_items.items(), start=1):
            if item:
                print(f"{i}. {item_type}: {item['name']} - {item['description']}")
            else:
                print(f"{i}. {item_type}: None")
        print("Press < to go back to the player status menu.")
        choice = input("")
        if choice == "<":
            self.display_status()
        elif choice.isdigit():
            index = int(choice) - 1
            if 0 <= index < len(self.equipped_items):
                item_type_to_unequip = list(self.equipped_items.keys())[index]
                self.unequip_menu(item_type_to_unequip)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_equipped_items()
        else:
            print("Invalid option. Please enter a valid option.")
            time.sleep(1)
            self.display_equipped_items()
            
    def remove_equipped_item(self, item_type):
        if item_type in self.equipped_items:
            item = self.equipped_items.pop(item_type)
            self.inventory[item_type].append(item)

    def play_game(self):
        clear_screen()
        # Placeholder for play game functionality
        input("Play game functionality is under construction. Press Enter to return to the player status menu...")
        self.display_status()

    def add_experience(self, amount):
        self.experience += amount
        if self.experience >= self.exp_required:
            self.level_up()
        self.display_status()

    def level_up(self):
        self.level += 1
        self.experience = 0
        self.attack += 0.5
        self.defense += 0.5
        self.dodge += 0.5
        self.speed += 0.5
        self.exp_multiplier = 0.25
        self.exp_required = int(self.exp_required * (1 + self.exp_multiplier))  # Update exp required with new multiplier
        
    def equip_item_level_up(self, item):
        if 'Attack' in item:
            self.attack += item['Attack']
        if 'Defense' in item:
            self.defense += item['Defense']
        if 'Dodge' in item:
            self.dodge += item['Dodge']
        if 'Speed' in item:
            self.speed += item['Speed']
            
    def get_name_display(self):
        symbol = ""
        if self.difficulty == "Basic":
            symbol = "🛡️"
        elif self.difficulty == "Exemplar":
            symbol = "⚔️"
        elif self.difficulty == "Templar":
            symbol = "☠️"
        return f"{symbol} {self.name}"

    def get_difficulty_display(self):
        return self.difficulty

    def visit_shop(self):
        clear_screen()
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print("Welcome to the Shop!")
            print("=" * 40)
            print("Shop Sections:")
            print("1. Weapons")
            print("2. Armors")
            print("3. Shields")
            print("4. Footwear")
            print("5. Usable Items")
            print("6. Back to Player Status")
            print("\nEnter the number to select a shop section.")

            choice = input("")

            if choice == "1":
                self.display_shop_section("Weapons")
            elif choice == "2":
                self.display_shop_section("Armors")
            elif choice == "3":
                self.display_shop_section("Shields")
            elif choice == "4":
                self.display_shop_section("Footwear")
            elif choice == "5":
                self.display_shop_section("Usable Items")
            elif choice == "6":
                self.display_status()
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)

    def display_shop_section(self, item_type):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"Shop - {item_type}:")
        print("=" * 40)
        if item_type in items_groups:
            for idx, item in enumerate(items_groups[item_type], 1):
                print(f"{idx}. {item['name']}: {item['description']} - Cost: {item['cost']} gold")
            print("0. Back to Shop Sections")
            print("Enter the number to purchase the item or 0 to go back.")
            choice = input("")
            if choice == "0":
                self.visit_shop()
            elif choice.isdigit() and 0 < int(choice) <= len(items_groups[item_type]):
                self.purchase_item(item_type, int(choice) - 1)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_shop_section(item_type)
        else:
            print("Invalid shop section.")
            time.sleep(1)
            self.visit_shop()

    def purchase_item(self, item_type, index):
        item = items_groups[item_type][index]
        cost = item['cost']
        if self.gold >= cost:
            self.gold -= cost
            self.inventory[item_type].append(item)
            print(f"You have purchased {item['name']} for {cost} gold.")
            time.sleep(1)
        else:
            print("Insufficient gold to purchase this item.")
            time.sleep(1)
        self.display_shop_section(item_type)
            
items_groups = {
    "Usable Items": [
        {"name": "Small Healing Potion", "description": "+15 hp", "cost": 20},
        {"name": "Self Healing Potion", "description": "+20 hp", "cost": 50},
        {"name": "Moderated Potion", "description": "+25 hp", "cost": 75},
        {"name": "Regen Potion", "description": "+15%", "cost": 100},
        {"name": "Hammerhead Crocker", "description": "+7% attack for 7 turns", "cost": 55, "Attack": 0.07},
        {"name": "Warhammer Crocker", "description": "+15% attack for 7 turns", "cost": 75, "Attack": 0.15},
        {"name": "Barhog", "description": "+7% Defense for 7 turns", "cost": 45, "Defense": 0.07},
        {"name": "Warhog", "description": "+15% defense for 7 turns", "cost": 60, "Defense": 0.15},
        {"name": "Non applicable scroll", "description": "+2 Speed for 7 turns", "cost": 40, "Speed": 2},
        {"name": "Applicable scroll", "description": "+4 speed for 7 turns", "cost": 55, "Speed": 4},
        {"name": "Ransacked Shield", "description": "+12% Dodge chance for 3 turns", "cost": 60, "Dodge": 0.12},
        {"name": "Unbuilded Shield", "description": "+23% Dodge Chance for 5 turns", "cost": 90, "Dodge": 0.23},
        {"name": "Mystic Scroll", "description": "25% chance to negate all debuffs on player for 4 turns", "cost": 60},
        {"name": "Mystic Beurau", "description": "50% chance to negate all debuffs on player for 4 turns", "cost": 120},
        {"name": "Variant Bs", "description": "Increase all stats up to 25% for 10 turns", "cost": 200},
        {"name": "Variant Ex", "description": "Increase all stats up to 50% for 10 turns", "cost": 400},
        {"name": "Hide cloak", "description": "40% chance to dodge the battle against enemies when exploring", "cost": 50, "Dodge": 0.4},
        {"name": "Invisible potion", "description": "60% chance to dodge the battle against enemies when exploring", "cost": 75, "Dodge": 0.6},
        {"name": "Exp Moneter", "description": "Give you 20 exp points", "cost": 50},
        {"name": "Exp Vitalis", "description": "Give you 50 exp points", "cost": 100},
        {"name": "Exp For enhancer", "description": "Give you 100 points", "cost": 150}
    ],
    "Weapons": [
        {"name": "Stone Sword", "description": "+12 attack", "cost": 150, "Attack": 12},
        {"name": "Copper Sword", "description": "+15 attack", "cost": 275, "Attack": 15},
        {"name": "Sickanum Sword", "description": "+17 attack", "cost": 400, "Attack": 17},
        {"name": "Arivanum Sword", "description": "+23 attack", "cost": 600, "Attack": 23},
        {"name": "Viranium Sword", "description": "+25 attack", "cost": 850, "Attack": 25},
        {"name": "Titanium sword", "description": "+35 attack", "cost": 1250, "Attack": 35}
    ],
    "Armors": [
        {"name": "Jungle sets", "description": "+7 Defense", "cost": 90, "Defense": 7},
        {"name": "Byzantine sets", "description": "+12 Defense", "cost": 140, "Defense": 12},
        {"name": "Nikel Sets", "description": "+15 Defense", "cost": 350, "Defense": 15},
        {"name": "Warhead Sets", "description": "+25 Defense", "cost": 560, "Defense": 25},
        {"name": "Titanium Sets", "description": "+40 Defense", "cost": 850, "Defense": 40}
    ],
    "Shields": [
        {"name": "Wooden Ob", "description": "+2 dodge", "cost": 80, "Dodge": 2},
        {"name": "Long Ob", "description": "+3 dodge, +2 Defense", "cost": 120, "Dodge": 3, "Defense": 2},
        {"name": "Cob Ob", "description": "+5 dodge, +4 Defense", "cost": 300, "Dodge": 5, "Defense": 4},
        {"name": "Knock Ob", "description": "+7 dodge, +5 Defense, +3 Attack", "cost": 550, "Dodge": 7, "Defense": 5, "Attack": 3},
        {"name": "Neb Ob", "description": "+12 dodge, +7 Defense, +5 Attack", "cost": 760, "Dodge": 12, "Defense": 7, "Attack": 5}
    ],
    "Footwear": [
        {"name": "Jungle Foot", "description": "+3 speeds", "cost": 45, "Speed": 3},
        {"name": "Iron Foot", "description": "+5 Speed", "cost": 75, "Speed": 5},
        {"name": "Metal WarFoot", "description": "+8 Speeds", "cost": 120, "Speed": 8},
        {"name": "Diamond Boots", "description": "+12 Speeds", "cost": 230, "Speed": 12},
        {"name": "Noble Boots", "description": "+19 Speeds", "cost": 450, "Speed": 19},
        {"name": "Lizable Boots", "description": "+25 Speeds", "cost": 700, "Speed": 25}
    ]
}


def create_character():
    clear_screen()
    print("Character Creation")
    name = input("Enter your character's name: ")
    clear_screen()
    print(f"Character Name: {name}\n")
    
    while True:
        print("Select Difficulty:")
        print("1. Basic 🛡️")
        print("2. Exemplar ⚔️")
        print("3. Templar ☠️")
        difficulty_choice = input("Enter the number to select difficulty: ")
        
        if difficulty_choice == "1":
            difficulty = "Basic"
            description = "Enemies are powerful in their origins."
        elif difficulty_choice == "2":
            difficulty = "Exemplar"
            description = "Enemies are harder and more immortalized."
        elif difficulty_choice == "3":
            difficulty = "Templar"
            description = "Enemies are evils."
        else:
            print("Invalid difficulty choice. Please choose a valid option.")
            time.sleep(1)
            clear_screen()
            continue
        
        clear_screen()
        print("Selected Difficulty:")
        print(f"Name: {name}")
        print(f"Difficulty: {difficulty}")
        print(f"Description: {description}\n")
        print("1. Confirm")
        print("2. Back")
        
        confirm_choice = input("Enter your choice: ")
        if confirm_choice == "1":
            break
        elif confirm_choice == "2":
            clear_screen()
            continue
        else:
            print("Invalid choice. Please enter 1 to confirm or 2 to go back.")
            time.sleep(1)
            clear_screen()

    player = Player(name, difficulty)
    player.equipped_items["Weapons"] = {"name": "Broken Sword", "description": "+10 Damage", "attack": 10}
    player.equipped_items["Armors"] = {"name": "Broken Armor", "description": "+5 Defense", "defense": 5}
    player.equipped_items["Shields"] = {"name": "Broken Shield", "description": "+2 Dodge", "dodge": 2}
    player.equipped_items["Footwear"] = {"name": "Broken Footwear", "description": "+3 Speed", "speed": 3}

    return Player(name, difficulty)

def clear_screen():
    """Clears the console screen."""
    os.system('cls' if os.name == 'nt' else 'clear')

def main_menu():
    clear_screen()
    print("BeaVenture\n")
    print("1. Create Character")
    print("2. Exit")
    print("\nEnter the number to select an option.")

def main():
    while True:
        main_menu()
        try:
            choice = int(input(""))

            if choice == 1:
                player = create_character()
                player.display_status()
            elif choice == 2:
                clear_screen()
                print("Exiting BeaVenture. Goodbye!")
                time.sleep(2)
                clear_screen()
                print("Game Was Ended")
                input("Press Enter to exit...")
                clear_screen()
                break
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(2)
        except ValueError:
            print("Invalid input. Please enter a number.")

if __name__ == "__main__":
    main()
/*!
 * Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
 * Copyright 2011-2023 The Bootstrap Authors
 * Licensed under the Creative Commons Attribution 3.0 Unported License.
 */
 
(() => {
  'use strict';
 
  const storedTheme = localStorage.getItem('theme');
 
  const getPreferredTheme = () => {
    if (storedTheme) {
      return storedTheme;
    }
 
    return window.matchMedia('(prefers-color-scheme: dark)').matches
      ? 'dark'
      : 'light';
  };
 
  const setTheme = function (theme) {
    if (
      theme === 'auto' &&
      window.matchMedia('(prefers-color-scheme: dark)').matches
    ) {
      document.documentElement.setAttribute('data-bs-theme', 'dark');
    } else {
      document.documentElement.setAttribute('data-bs-theme', theme);
    }
  };
 
  setTheme(getPreferredTheme());
 
  const showActiveTheme = (theme, focus = false) => {
    const themeSwitcher = document.querySelector('#bd-theme');
 
    if (!themeSwitcher) {
      return;
    }
 
    const themeSwitcherText = document.querySelector('#bd-theme-text');
    const activeThemeIcon = document.querySelector('.theme-icon-active use');
    const btnToActive = document.querySelector(
      `[data-bs-theme-value="${theme}"]`
    );
    const svgOfActiveBtn = btnToActive
      .querySelector('svg use')
      .getAttribute('href');
 
    document.querySelectorAll('[data-bs-theme-value]').forEach((element) => {
      element.classList.remove('active');
      element.setAttribute('aria-pressed', 'false');
    });
 
    btnToActive.classList.add('active');
    btnToActive.setAttribute('aria-pressed', 'true');
    activeThemeIcon.setAttribute('href', svgOfActiveBtn);
    const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`;
    themeSwitcher.setAttribute('aria-label', themeSwitcherLabel);
 
    if (focus) {
      themeSwitcher.focus();
    }
  };
 
  window
    .matchMedia('(prefers-color-scheme: dark)')
    .addEventListener('change', () => {
      if (storedTheme !== 'light' || storedTheme !== 'dark') {
        setTheme(getPreferredTheme());
      }
    });
 
  window.addEventListener('DOMContentLoaded', () => {
    showActiveTheme(getPreferredTheme());
 
    document.querySelectorAll('[data-bs-theme-value]').forEach((toggle) => {
      toggle.addEventListener('click', () => {
        const theme = toggle.getAttribute('data-bs-theme-value');
        localStorage.setItem('theme', theme);
        setTheme(theme);
        showActiveTheme(theme, true);
      });
    });
  });
})();
<div id="carouselExampleControls" class="carousel slide" data-bs-ride="carousel">
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
      <img src="..." class="d-block w-100" alt="...">
    </div>
  </div>
  <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="visually-hidden">Previous</span>
  </button>
  <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControls" data-bs-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="visually-hidden">Next</span>
  </button>
</div>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg bg-light navbar-light">
  <!-- Container wrapper -->
  <div class="container-fluid">
    <!-- Navbar brand -->
    <a class="navbar-brand" href="#">Brand</a>
 
    <!-- Toggle button -->
    <button
      class="navbar-toggler"
      type="button"
      data-mdb-toggle="collapse"
      data-mdb-target="#navbarSupportedContent"
      aria-controls="navbarSupportedContent"
      aria-expanded="false"
      aria-label="Toggle navigation"
    >
      <i class="fas fa-bars"></i>
    </button>
 
    <!-- Collapsible wrapper -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
 
      <ul class="navbar-nav me-auto mb-2 mb-lg-0">
        <!-- Link -->
        <li class="nav-item"><a class="nav-link" href="#">Link</a></li>
        <!-- Dropdown -->
        <li class="nav-item dropdown">
          <a
            class="nav-link dropdown-toggle"
            href="#"
            id="navbarDropdown"
            role="button"
            data-mdb-toggle="dropdown"
            aria-expanded="false"
          >
            Dropdown
          </a>
          <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
            <li><a class="dropdown-item" href="#">Action</a></li>
            <li><a class="dropdown-item" href="#">Another action</a></li>
            <li><hr class="dropdown-divider" /></li>
            <li><a class="dropdown-item" href="#">Something else here</a></li>
          </ul>
        </li>
      </ul>
 
      <!-- Icons -->
      <ul class="navbar-nav d-flex flex-row me-1">
        <li class="nav-item me-3 me-lg-0">
          <a class="nav-link" href="#"><i class="fas fa-shopping-cart"></i></a>
        </li>
        <li class="nav-item me-3 me-lg-0">
          <a class="nav-link" href="#"><i class="fab fa-twitter"></i></a>
        </li>
      </ul>
      <!-- Search -->
      <form class="w-auto">
        <input
          type="search"
          class="form-control"
          placeholder="Type query"
          aria-label="Search"
        />
      </form>
    </div>
  </div>
  <!-- Container wrapper -->
</nav>
<!-- Navbar -->
“I want you to write a [NUMBER]-word [WRITING TYPE] about [THIS SPECIFIC TOPIC] for me, written in a tone that is [DESCRIBE TONE].
The text should be tailored to [SPECIFIC TARGET READER, GIVE CONTEXT].
It should be formatted with [PROVIDE FORMATTING INSTRUCTIONS]
Like this:
[EXAMPLE FORMAT]
The purpose of this text is to [WHAT THE TARGET OUTCOME IS FOR YOU].
For context, I am a [WHAT YOU DO, GIVE CONTEXT] looking to [YOUR GOAL].”
<p>Copyright &copy; <script>document.write(new Date().getFullYear())</script> Your Name All Rights Reserved</p>
curl --request POST \
  --url 'https://api.apyhub.com/convert/word-file/pdf-file?output=test-sample.pdf&landscape=false' \
  --header 'apy-token: APY0BOODK2plpXgxRjezmBOXqID51DGpFq8QnHJeBQrrzuIBc25UIglN93bbwvnkBWlUia1' \
  --header 'content-type: multipart/form-data' \
  --form 'file=@"test.doc"'
<div class="text-center">
  <img src="..." class="rounded" alt="...">
</div>
/*
 * This Java source file was generated by the Gradle 'init' task.
 */
package gradleproject2;

import java.io.IOException;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.pdmodel.font.Standard14Fonts;

public class App {

    public String getGreeting() {
        return "Hello World!";
    }

    public static void main(String[] args) throws IOException {
        // System.out.println(new App().getGreeting());

        //Creating PDF document object 
        PDDocument document = new PDDocument();

        for (int i = 0; i < 10; i++) {
            //Creating a blank page 
            PDPage blankPage = new PDPage();

            PDPageContentStream contentStream = new PDPageContentStream(document, blankPage);

            contentStream.setFont(new PDType1Font(Standard14Fonts.FontName.HELVETICA_BOLD), 12);

            // Add text to the page
            contentStream.beginText();

            contentStream.newLineAtOffset(100, 700);

            contentStream.showText("Hello World, how are you !");

            contentStream.endText();

            //Adding the blank page to the document
            document.addPage(blankPage);
            contentStream.close();
        }

        //Saving the document
        document.save("C:/Users/chachou/Desktop/test java/javageneratepdf.pdf");
        System.out.println("PDF created");
        
      
        //Closing the document
        document.close();
    }
}
import os
import time
import sys

class Player:
    def __init__(self, name, difficulty):
        self.name = name
        self.difficulty = difficulty
        self.attack = 10
        self.defense = 5
        self.dodge = 2
        self.speed = 3
        self.gold = 100
        self.diamonds = 0
        self.experience = 0
        self.level = 1
        self.exp_required = 100
        self.exp_multiplier = 0.75  # 75% increase for experience requirement per level
        self.inventory = {  # Initialize inventory
            "Weapons": [],
            "Armors": [],
            "Shields": [],
            "Footwear": [],
            "Usable Items": []  # Add Usable Items category
        }
        self.equipped_items = {  # Initialize equipped items
            "Weapons": {"name": "Broken Sword", "description": "+10 Damage", "attack": 10},
            "Armors": {"name": "Broken Armor", "description": "+5 Defense", "defense": 5},
            "Shields": {"name": "Broken Shield", "description": "+2 Dodge", "dodge": 2},
            "Footwear": {"name": "Broken Footwear", "description": "+3 Speed", "speed": 3},
            "Accessories": None,
            "Bag": None
        }
        self.base_stats = {
            "HP": 100,
            "Defense": 0,
            "Attack": 0,
            "Dodge": 0,
            "Speed": 0
        }
        self.max_inventory_slots = 30
        self.update_stats()  # Update player stats based on equipped items
        
    def visit_inventory(self):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print("Inventory:")
            print("=" * 40)
            print("1. Weapons")
            print("2. Armors")
            print("3. Shields")
            print("4. Footwear")
            print("5. Usable Items")
            print("6. Back to Player Status")
            print("\nEnter the number to select an option.")

            choice = input("")

            if choice == "1":
                self.display_items("Weapons")
            elif choice == "2":
                self.display_items("Armors")
            elif choice == "3":
                self.display_items("Shields")
            elif choice == "4":
                self.display_items("Footwear")
            elif choice == "5":
                self.display_items("Usable Items")
            elif choice == "6":
                self.display_status()
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)

    def display_items(self, item_type):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print(f"{item_type}:")
            print("=" * 40)
            if self.inventory[item_type]:
                for idx, item in enumerate(self.inventory[item_type], 1):
                    print(f"{idx}. {item['name']}: {item['description']}")
                print("0. Back to Inventory Menu")
                print("Enter the number to equip the item or 0 to go back.")
                choice = input("")
                if choice == "0":
                    break  # Break out of the inner loop to return to the previous menu
                elif choice.isdigit() and 0 < int(choice) <= len(self.inventory[item_type]):
                    self.equip_item(item_type, int(choice) - 1)
                else:
                    print("Invalid option. Please enter a valid number.")
                    time.sleep(1)
            else:
                print("No items in this category.")
                print("Press < to go back")
                choice = input("")
                if choice == "<":
                    break  # Break out of the inner loop to return to the previous menu

    def equip_item(self, item_type, index):
        item = self.inventory[item_type].pop(index)
        if item_type in ["Weapons", "Armors", "Shields", "Footwear"]:
            self.remove_equipped_item(item_type)  # Remove any previously equipped item of the same type
            self.equipped_items[item_type] = item  # Equip the new item
            self.update_stats()  # Update player stats with the new equipment
            print(f"{item['name']} equipped.")
            time.sleep(1)
        else:
            # Handle equipping usable items
            pass
        self.visit_inventory()

    def remove_equipped_item(self, item_type):
        if item_type in self.equipped_items:
            item = self.equipped_items.pop(item_type)
            self.inventory[item_type].append(item)

    def update_stats(self):
        # Reset stats to base values
        for stat in self.base_stats:
            setattr(self, stat.lower(), self.base_stats[stat])
        
        # Add bonuses from equipped items
        for item_type, item in self.equipped_items.items():
            if item:
                for stat in item:
                    if stat in self.base_stats:
                        setattr(self, stat.lower(), self.base_stats[stat] + item[stat])

                
    def display_equipped_items(self):
        os.system('cls' if os.name == 'nt' else 'clear')
        print("Equipped Items:")
        print("=" * 40)
        for item_type, item in self.equipped_items.items():
            if item:
                print(f"{item_type}: {item['name']} - {item['description']}")
            else:
                print(f"{item_type}: None")
        
        # Add option to unequip items
        print("Press u to unequip.")
        choice = input("")
        if choice == "u":
            self.unequip_menu()
        elif choice == "<":
            self.display_status()
        else:
            print("Invalid option. Please enter u to unequip or < to go back.")
            time.sleep(1)
            self.display_equipped_items()

    def display_status(self):
        print("Player Status:")
        print("=" * 40)
        print(f"Name: {self.name}")
        print(f"Difficulty: {self.difficulty}")
        print("-" * 40)
        print("Stats:")
        print(f"HP      :❤️{self.base_stats['HP']}")
        print(f"Defense :🛡️{self.defense}")
        print(f"Attack  :⚔️{self.attack}")
        print(f"Dodge   :🤺{self.dodge}")
        print(f"Speed   :🏃{self.speed}")
        print("-"*40)
        print(f"Level: {self.level}")
        print(f"Experience: {self.experience}/{self.exp_required}")
        print("-"*40)
        print(f"Gold: {self.gold} 💰")
        print(f"Diamonds: {self.diamonds} 💎")
        print("="*40)
        print("Game Options:")
        print("1. Visit Shop")
        print("2. Inventory")
        print("3. Equipped Items")  # New option to display equipped items
        print("4. Play Game")
        print("5. Delete this Character")
        print("6. Add 50 Experience Points")  # New option to add 50 exp
        print("\nEnter the number to select an option.")
        
        choice = input("")
        if choice == "1":
            self.visit_shop()
        elif choice == "2":
            self.visit_inventory()
        elif choice == "3":
            self.display_equipped_items()  
        elif choice == "4":
            self.play_game()
        elif choice == "5":
            return
        elif choice == "6":  # Option to add 50 exp
            self.add_experience(50)
        else:
            print("Invalid option. Please enter a valid number.")
            time.sleep(1)
            self.display_status()   
            
    def calculate_stat(self, stat_name):
        base_stat = getattr(self, stat_name)
        bonus_stat = sum(item.get(stat_name, 0) for item in self.equipped_items.values() if item)
        return base_stat + bonus_stat

    def display_items(self, item_type):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"{item_type}:")
        print("=" * 40)
        if self.inventory[item_type]:
            for idx, item in enumerate(self.inventory[item_type], 1):
                if item:  # Check if item is not None
                    print(f"{idx}. {item['name']}: {item['description']}")
                else:
                    print("No items in this category.")
                    print("You need to press < to go back.")
            choice = input("")
            if choice == "<":
                self.visit_inventory()
            elif choice.isdigit() and 0 < int(choice) <= len(self.inventory[item_type]):
                self.equip_item(item_type, int(choice) - 1)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_items(item_type)
        else:
            print("No items in this category.")
            print("You need to press < to go back.")
            choice = input("")
            if choice == "<":
                self.visit_inventory()
            else:
                print("Invalid option. Please enter < to go back.")
                time.sleep(1)
                self.visit_inventory()
    def equip_item(self, item_type, index):
        if item_type in self.inventory:
            if 0 <= index < len(self.inventory[item_type]):
                item = self.inventory[item_type].pop(index)
                if self.equipped_items[item_type]:
                    old_item = self.equipped_items[item_type]
                    self.inventory[item_type].append(old_item)
                self.equipped_items[item_type] = item
                self.update_stats()
                print(f"{item['name']} equipped.")
                time.sleep(1)
            else:
                print("Invalid item index.")
                time.sleep(1)
        else:
            print("Invalid item type.")
            time.sleep(1)


    def unequip_item(self, item_type_to_unequip):
        if self.equipped_items[item_type_to_unequip]:
            self.inventory[item_type_to_unequip].append(self.equipped_items[item_type_to_unequip])
            self.equipped_items[item_type_to_unequip] = None
            print(f"{item_type_to_unequip}: None")
            time.sleep(1)
            self.unequip_menu(item_type_to_unequip)
        else:
            print("No item equipped.")
            time.sleep(1)
            self.display_equipped_items()
            
    def unequip_menu(self, item_type_to_unequip):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"Unequip {item_type_to_unequip}:")
        print("=" * 40)
        if self.equipped_items[item_type_to_unequip]:
            print(f"1. {self.equipped_items[item_type_to_unequip]['name']} - {self.equipped_items[item_type_to_unequip]['description']}")
            print("Enter 1 to unequip or press < to cancel.")
            choice = input("")
            if choice == "1":
                self.unequip_item(item_type_to_unequip)
            elif choice == "<":
                self.display_equipped_items()
            else:
                print("Invalid option. Please enter a valid option.")
                time.sleep(1)
                self.unequip_menu(item_type_to_unequip)
        else:
            print(f"No {item_type_to_unequip} equipped.")
            time.sleep(1)
            self.display_equipped_items()
            
    def display_equipped_items(self):
        os.system('cls' if os.name == 'nt' else 'clear')
        print("Equipped Items:")
        print("=" * 40)
        for item_type, item in self.equipped_items.items():
            if item:
                print(f"{item_type}: {item['name']} - {item['description']}")
            else:
                print(f"{item_type}: None")
        print("\nUnequip Items:")
        print("=" * 40)
        for i, (item_type, item) in enumerate(self.equipped_items.items(), start=1):
            if item:
                print(f"{i}. {item_type}: {item['name']} - {item['description']}")
            else:
                print(f"{i}. {item_type}: None")
        print("Press < to go back to the player status menu.")
        choice = input("")
        if choice == "<":
            self.display_status()
        elif choice.isdigit():
            index = int(choice) - 1
            if 0 <= index < len(self.equipped_items):
                item_type_to_unequip = list(self.equipped_items.keys())[index]
                self.unequip_menu(item_type_to_unequip)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_equipped_items()
        else:
            print("Invalid option. Please enter a valid option.")
            time.sleep(1)
            self.display_equipped_items()
            
    def remove_equipped_item(self, item_type):
        if item_type in self.equipped_items:
            item = self.equipped_items.pop(item_type)
            self.inventory[item_type].append(item)

    def play_game(self):
        # Placeholder for play game functionality
        input("Play game functionality is under construction. Press Enter to return to the player status menu...")
        self.display_status()

    def add_experience(self, amount):
        self.experience += amount
        if self.experience >= self.exp_required:
            self.level_up()
        self.display_status()

    def level_up(self):
        self.level += 1
        self.exp_required = int(self.exp_required * (1 + self.exp_multiplier))  # Increase by 75%
        self.attack += 0.5
        self.defense += 0.5
        self.dodge += 0.5
        self.speed += 0.5

    def get_name_display(self):
        symbol = ""
        if self.difficulty == "Basic":
            symbol = "🛡️"
        elif self.difficulty == "Exemplar":
            symbol = "⚔️"
        elif self.difficulty == "Templar":
            symbol = "☠️"
        return f"{symbol} {self.name}"

    def get_difficulty_display(self):
        return self.difficulty

    def visit_shop(self):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print("Welcome to the Shop!")
            print("=" * 40)
            print("Shop Sections:")
            print("1. Weapons")
            print("2. Armors")
            print("3. Shields")
            print("4. Footwear")
            print("5. Usable Items")
            print("6. Back to Player Status")
            print("\nEnter the number to select a shop section.")

            choice = input("")

            if choice == "1":
                self.display_shop_section("Weapons")
            elif choice == "2":
                self.display_shop_section("Armors")
            elif choice == "3":
                self.display_shop_section("Shields")
            elif choice == "4":
                self.display_shop_section("Footwear")
            elif choice == "5":
                self.display_shop_section("Usable Items")
            elif choice == "6":
                self.display_status()
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)

    def display_shop_section(self, item_type):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"Shop - {item_type}:")
        print("=" * 40)
        if item_type in items_groups:
            for idx, item in enumerate(items_groups[item_type], 1):
                print(f"{idx}. {item['name']}: {item['description']} - Cost: {item['cost']} gold")
            print("0. Back to Shop Sections")
            print("Enter the number to purchase the item or 0 to go back.")
            choice = input("")
            if choice == "0":
                self.visit_shop()
            elif choice.isdigit() and 0 < int(choice) <= len(items_groups[item_type]):
                self.purchase_item(item_type, int(choice) - 1)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_shop_section(item_type)
        else:
            print("Invalid shop section.")
            time.sleep(1)
            self.visit_shop()

    def purchase_item(self, item_type, index):
        item = items_groups[item_type][index]
        cost = item['cost']
        if self.gold >= cost:
            self.gold -= cost
            self.inventory[item_type].append(item)
            print(f"You have purchased {item['name']} for {cost} gold.")
            time.sleep(1)
        else:
            print("Insufficient gold to purchase this item.")
            time.sleep(1)
        self.display_shop_section(item_type)
            
items_groups = {
    "Usable Items": [
        {"name": "Small Healing Potion", "description": "+15 hp", "cost": 20},
        {"name": "Self Healing Potion", "description": "+20 hp", "cost": 50},
        {"name": "Moderated Potion", "description": "+25 hp", "cost": 75},
        {"name": "Regen Potion", "description": "+15%", "cost": 100},
        {"name": "Hammerhead Crocker", "description": "+7% attack for 7 turns", "cost": 55, "attack_bonus": 0.07},
        {"name": "Warhammer Crocker", "description": "+15% attack for 7 turns", "cost": 75, "attack_bonus": 0.15},
        {"name": "Barhog", "description": "+7% Defense for 7 turns", "cost": 45, "defense_bonus": 0.07},
        {"name": "Warhog", "description": "+15% defense for 7 turns", "cost": 60, "defense_bonus": 0.15},
        {"name": "Non applicable scroll", "description": "+2 Speed for 7 turns", "cost": 40, "speed_bonus": 2},
        {"name": "Applicable scroll", "description": "+4 speed for 7 turns", "cost": 55, "speed_bonus": 4},
        {"name": "Ransacked Shield", "description": "+12% Dodge chance for 3 turns", "cost": 60, "dodge_bonus": 0.12},
        {"name": "Unbuilded Shield", "description": "+23% Dodge Chance for 5 turns", "cost": 90, "dodge_bonus": 0.23},
        {"name": "Mystic Scroll", "description": "25% chance to negate all debuffs on player for 4 turns", "cost": 60},
        {"name": "Mystic Beurau", "description": "50% chance to negate all debuffs on player for 4 turns", "cost": 120},
        {"name": "Variant Bs", "description": "Increase all stats up to 25% for 10 turns", "cost": 200},
        {"name": "Variant Ex", "description": "Increase all stats up to 50% for 10 turns", "cost": 400},
        {"name": "Hide cloak", "description": "40% chance to dodge the battle against enemies when exploring", "cost": 50, "dodge_bonus": 0.4},
        {"name": "Invisible potion", "description": "60% chance to dodge the battle against enemies when exploring", "cost": 75, "dodge_bonus": 0.6},
        {"name": "Exp Moneter", "description": "Give you 20 exp points", "cost": 50},
        {"name": "Exp Vitalis", "description": "Give you 50 exp points", "cost": 100},
        {"name": "Exp For enhancer", "description": "Give you 100 points", "cost": 150}
    ],
    "Weapons": [
        {"name": "Stone Sword", "description": "+12 attack", "cost": 150, "attack_bonus": 12},
        {"name": "Copper Sword", "description": "+15 attack", "cost": 275, "attack_bonus": 15},
        {"name": "Sickanum Sword", "description": "+17 attack", "cost": 400, "attack_bonus": 17},
        {"name": "Arivanum Sword", "description": "+23 attack", "cost": 600, "attack_bonus": 23},
        {"name": "Viranium Sword", "description": "+25 attack", "cost": 850, "attack_bonus": 25},
        {"name": "Titanium sword", "description": "+35 attack", "cost": 1250, "attack_bonus": 35}
    ],
    "Armors": [
                {"name": "Jungle sets", "description": "+7 Defense", "cost": 90, "defense_bonus": 7},
        {"name": "Byzantine sets", "description": "+12 Defense", "cost": 140, "defense_bonus": 12},
        {"name": "Nikel Sets", "description": "+15 Defense", "cost": 350, "defense_bonus": 15},
        {"name": "Warhead Sets", "description": "+25 Defense", "cost": 560, "defense_bonus": 25},
        {"name": "Titanium Sets", "description": "+40 Defense", "cost": 850, "defense_bonus": 40}
    ],
    "Shields": [
        {"name": "Wooden Ob", "description": "+2 dodge", "cost": 80, "dodge_bonus": 2},
        {"name": "Long Ob", "description": "+3 dodge, +2 Defense", "cost": 120, "dodge_bonus": 3, "defense_bonus": 2},
        {"name": "Cob Ob", "description": "+5 dodge, +4 Defense", "cost": 300, "dodge_bonus": 5, "defense_bonus": 4},
        {"name": "Knock Ob", "description": "+7 dodge, +5 Defense, +3 Attack", "cost": 550, "dodge_bonus": 7, "defense_bonus": 5, "attack_bonus": 3},
        {"name": "Neb Ob", "description": "+12 dodge, +7 Defense, +5 Attack", "cost": 760, "dodge_bonus": 12, "defense_bonus": 7, "attack_bonus": 5}
    ],
    "Footwear": [
        {"name": "Jungle Foot", "description": "+3 speeds", "cost": 45, "speed_bonus": 3},
        {"name": "Iron Foot", "description": "+5 Speed", "cost": 75, "speed_bonus": 5},
        {"name": "Metal WarFoot", "description": "+8 Speeds", "cost": 120, "speed_bonus": 8},
        {"name": "Diamond Boots", "description": "+12 Speeds", "cost": 230, "speed_bonus": 12},
        {"name": "Noble Boots", "description": "+19 Speeds", "cost": 450, "speed_bonus": 19},
        {"name": "Lizable Boots", "description": "+25 Speeds", "cost": 700, "speed_bonus": 25}
    ]
}


def create_character():
    clear_screen()
    print("Character Creation")
    name = input("Enter your character's name: ")
    clear_screen()
    print(f"Character Name: {name}\n")
    
    while True:
        print("Select Difficulty:")
        print("1. Basic 🛡️")
        print("2. Exemplar ⚔️")
        print("3. Templar ☠️")
        difficulty_choice = input("Enter the number to select difficulty: ")
        
        if difficulty_choice == "1":
            difficulty = "Basic"
            description = "Enemies are powerful in their origins."
        elif difficulty_choice == "2":
            difficulty = "Exemplar"
            description = "Enemies are harder and more immortalized."
        elif difficulty_choice == "3":
            difficulty = "Templar"
            description = "Enemies are evils."
        else:
            print("Invalid difficulty choice. Please choose a valid option.")
            time.sleep(1)
            clear_screen()
            continue
        
        clear_screen()
        print("Selected Difficulty:")
        print(f"Name: {name}")
        print(f"Difficulty: {difficulty}")
        print(f"Description: {description}\n")
        print("1. Confirm")
        print("2. Back")
        
        confirm_choice = input("Enter your choice: ")
        if confirm_choice == "1":
            break
        elif confirm_choice == "2":
            clear_screen()
            continue
        else:
            print("Invalid choice. Please enter 1 to confirm or 2 to go back.")
            time.sleep(1)
            clear_screen()

    player = Player(name, difficulty)
    player.equipped_items["Weapons"] = {"name": "Broken Sword", "description": "+10 Damage", "attack": 10}
    player.equipped_items["Armors"] = {"name": "Broken Armor", "description": "+5 Defense", "defense": 5}
    player.equipped_items["Shields"] = {"name": "Broken Shield", "description": "+2 Dodge", "dodge": 2}
    player.equipped_items["Footwear"] = {"name": "Broken Footwear", "description": "+3 Speed", "speed": 3}

    return Player(name, difficulty)

def clear_screen():
    """Clears the console screen."""
    os.system('cls' if os.name == 'nt' else 'clear')

def main_menu():
    clear_screen()
    print("BeaVenture\n")
    print("1. Create Character")
    print("2. Exit")
    print("\nEnter the number to select an option.")

def main():
    while True:
        main_menu()
        try:
            choice = int(input(""))

            if choice == 1:
                player = create_character()
                player.display_status()
            elif choice == 2:
                clear_screen()
                print("Exiting BeaVenture. Goodbye!")
                time.sleep(2)
                clear_screen()
                print("Game Was Ended")
                input("Press Enter to exit...")
                clear_screen()
                break
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(2)
        except ValueError:
            print("Invalid input. Please enter a number.")

if __name__ == "__main__":
    main()
@All :b :b  Dear cả lớp

Em là Huyền - Admin của CodeStar Academy. Lời đầu tiên xin cảm ơn mọi ng đã tin tưởng và lựa chọn Codestar để đồng hành trên chặng đường tìm hiểu về K8s. E xin phép gửi lại lớp 1 số Link quan trọng của lớp như sau:

1. Hướng dẫn tạo AWS Account như trong file hướng dẫn, mng tạo Account dần giúp em ạ: 
https://docs.google.com/document/d/1tGKfLg2v-rLxZdV5pUr1aVUK7InnZLoZ/edit?usp=drive_link&ouid=117593923093139842004&rtpof=true&sd=true

2. Tài liệu khóa học K8s (bao gồm Video record + slide tài liệu được up lên sau mỗi buổi học) 
https://docs.google.com/spreadsheets/d/1tCRlGgPhBQ1dtiYCGMXWqjJzsjCKZV-LmEcUjq094yA/edit?usp=drive_link

/-heart  Em cảm ơn.
import os
import time
import sys

class Player:
    def __init__(self, name, difficulty):
        self.name = name
        self.difficulty = difficulty
        self.gold = 100
        self.diamonds = 0
        self.experience = 0
        self.level = 1
        self.exp_required = 100
        self.exp_multiplier = 0.75  # 75% increase for experience requirement per level
        self.inventory = {  # Initialize inventory
            "Weapons": [],
            "Armors": [],
            "Shields": [],
            "Footwear": [],
            "Usable Items": []  # Add Usable Items category
        }
        self.equipped_items = {  # Initialize equipped items
            "Weapons": {"name": "Broken Sword", "description": "+10 Damage", "attack": 10},
            "Armors": {"name": "Broken Armor", "description": "+5 Defense", "defense": 5},
            "Shields": {"name": "Broken Shield", "description": "+2 Dodge", "dodge": 2},
            "Footwear": {"name": "Broken Footwear", "description": "+3 Speed", "speed": 3},
            "Accessories": None,
            "Bag": None
        }
        self.base_stats = {
            "HP": 100,
            "Defense": 0,
            "Attack": 0,
            "Dodge": 0,
            "Speed": 0
        }
        self.max_inventory_slots = 30
        self.update_stats()  # Update player stats based on equipped items
        
    def visit_inventory(self):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print("Inventory:")
            print("=" * 40)
            print("1. Weapons")
            print("2. Armors")
            print("3. Shields")
            print("4. Footwear")
            print("5. Usable Items")
            print("6. Back to Player Status")
            print("\nEnter the number to select an option.")

            choice = input("")

            if choice == "1":
                self.display_items("Weapons")
            elif choice == "2":
                self.display_items("Armors")
            elif choice == "3":
                self.display_items("Shields")
            elif choice == "4":
                self.display_items("Footwear")
            elif choice == "5":
                self.display_items("Usable Items")
            elif choice == "6":
                self.display_status()
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)

    def display_items(self, item_type):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print(f"{item_type}:")
            print("=" * 40)
            if self.inventory[item_type]:
                for idx, item in enumerate(self.inventory[item_type], 1):
                    print(f"{idx}. {item['name']}: {item['description']}")
                print("0. Back to Inventory Menu")
                print("Enter the number to equip the item or 0 to go back.")
                choice = input("")
                if choice == "0":
                    break  # Break out of the inner loop to return to the previous menu
                elif choice.isdigit() and 0 < int(choice) <= len(self.inventory[item_type]):
                    self.equip_item(item_type, int(choice) - 1)
                else:
                    print("Invalid option. Please enter a valid number.")
                    time.sleep(1)
            else:
                print("No items in this category.")
                print("Press < to go back")
                choice = input("")
                if choice == "<":
                    break  # Break out of the inner loop to return to the previous menu

    def equip_item(self, item_type, index):
        item = self.inventory[item_type].pop(index)
        if item_type in ["Weapons", "Armors", "Shields", "Footwear"]:
            self.remove_equipped_item(item_type)  # Remove any previously equipped item of the same type
            self.equipped_items[item_type] = item  # Equip the new item
            self.update_stats()  # Update player stats with the new equipment
            print(f"{item['name']} equipped.")
            time.sleep(1)
        else:
            # Handle equipping usable items
            pass
        self.visit_inventory()

    def remove_equipped_item(self, item_type):
        if item_type in self.equipped_items:
            item = self.equipped_items.pop(item_type)
            self.inventory[item_type].append(item)

    def update_stats(self):
        # Reset stats to base values
        for stat in self.base_stats:
            setattr(self, stat.lower(), self.base_stats[stat])
        
        # Add bonuses from equipped items
        for item_type, item in self.equipped_items.items():
            if item:
                for stat in item:
                    if stat in self.base_stats:
                        setattr(self, stat.lower(), self.base_stats[stat] + item[stat])

                
    def display_equipped_items(self):
        os.system('cls' if os.name == 'nt' else 'clear')
        print("Equipped Items:")
        print("=" * 40)
        for item_type, item in self.equipped_items.items():
            if item:
                print(f"{item_type}: {item['name']} - {item['description']}")
            else:
                print(f"{item_type}: None")
        
        # Add option to unequip items
        print("Press u to unequip.")
        choice = input("")
        if choice == "u":
            self.unequip_menu()
        elif choice == "<":
            self.display_status()
        else:
            print("Invalid option. Please enter u to unequip or < to go back.")
            time.sleep(1)
            self.display_equipped_items()

    def display_status(self):
        print("Player Status:")
        print("=" * 40)
        print(f"Name: {self.name}")
        print(f"Difficulty: {self.difficulty}")
        print("-" * 40)
        print("Stats:")
        print(f"HP      :❤️{self.base_stats['HP']}")
        print(f"Defense :🛡️{self.defense}")
        print(f"Attack  :⚔️{self.attack}")
        print(f"Dodge   :🤺{self.dodge}")
        print(f"Speed   :🏃{self.speed}")
        print("-"*40)
        print(f"Level: {self.level}")
        print(f"Experience: {self.experience}/{self.exp_required}")
        print("-"*40)
        print(f"Gold: {self.gold} 💰")
        print(f"Diamonds: {self.diamonds} 💎")
        print("="*40)
        print("Game Options:")
        print("1. Visit Shop")
        print("2. Inventory")
        print("3. Equipped Items")  # New option to display equipped items
        print("4. Play Game")
        print("5. Delete this Character")
        print("\nEnter the number to select an option.")
        
        choice = input("")
        if choice == "1":
            self.visit_shop()
        elif choice == "2":
            self.visit_inventory()
        elif choice == "3":
            self.display_equipped_items()  # Call the new method to display equipped items
        elif choice == "4":
            self.play_game()
        elif choice == "5":
            return
        else:
            print("Invalid option. Please enter a valid number.")
            time.sleep(1)
            self.display_status()
            
    def calculate_stat(self, stat_name):
        base_stat = getattr(self, stat_name)
        bonus_stat = sum(item.get(stat_name, 0) for item in self.equipped_items.values() if item)
        return base_stat + bonus_stat

    def display_items(self, item_type):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"{item_type}:")
        print("=" * 40)
        if self.inventory[item_type]:
            for idx, item in enumerate(self.inventory[item_type], 1):
                if item:  # Check if item is not None
                    print(f"{idx}. {item['name']}: {item['description']}")
                else:
                    print("No items in this category.")
                    print("You need to press < to go back.")
            choice = input("")
            if choice == "<":
                self.visit_inventory()
            elif choice.isdigit() and 0 < int(choice) <= len(self.inventory[item_type]):
                self.equip_item(item_type, int(choice) - 1)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_items(item_type)
        else:
            print("No items in this category.")
            print("You need to press < to go back.")
            choice = input("")
            if choice == "<":
                self.visit_inventory()
            else:
                print("Invalid option. Please enter < to go back.")
                time.sleep(1)
                self.visit_inventory()
    def equip_item(self, item_type, index):
        if item_type in self.inventory:
            if 0 <= index < len(self.inventory[item_type]):
                item = self.inventory[item_type].pop(index)
                if self.equipped_items[item_type]:
                    old_item = self.equipped_items[item_type]
                    self.inventory[item_type].append(old_item)
                self.equipped_items[item_type] = item
                self.update_stats()
                print(f"{item['name']} equipped.")
                time.sleep(1)
            else:
                print("Invalid item index.")
                time.sleep(1)
        else:
            print("Invalid item type.")
            time.sleep(1)


    def unequip_item(self, item_type_to_unequip):
        if self.equipped_items[item_type_to_unequip]:
            self.inventory[item_type_to_unequip].append(self.equipped_items[item_type_to_unequip])
            self.equipped_items[item_type_to_unequip] = None
            print(f"{item_type_to_unequip}: None")
            time.sleep(1)
            self.unequip_menu(item_type_to_unequip)
        else:
            print("No item equipped.")
            time.sleep(1)
            self.display_equipped_items()
            
    def unequip_menu(self, item_type_to_unequip):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"Unequip {item_type_to_unequip}:")
        print("=" * 40)
        if self.equipped_items[item_type_to_unequip]:
            print(f"1. {self.equipped_items[item_type_to_unequip]['name']} - {self.equipped_items[item_type_to_unequip]['description']}")
            print("Enter 1 to unequip or press < to cancel.")
            choice = input("")
            if choice == "1":
                self.unequip_item(item_type_to_unequip)
            elif choice == "<":
                self.display_equipped_items()
            else:
                print("Invalid option. Please enter a valid option.")
                time.sleep(1)
                self.unequip_menu(item_type_to_unequip)
        else:
            print(f"No {item_type_to_unequip} equipped.")
            time.sleep(1)
            self.display_equipped_items()
            
    def display_equipped_items(self):
        os.system('cls' if os.name == 'nt' else 'clear')
        print("Equipped Items:")
        print("=" * 40)
        for item_type, item in self.equipped_items.items():
            if item:
                print(f"{item_type}: {item['name']} - {item['description']}")
            else:
                print(f"{item_type}: None")
        print("\nUnequip Items:")
        print("=" * 40)
        for i, (item_type, item) in enumerate(self.equipped_items.items(), start=1):
            if item:
                print(f"{i}. {item_type}: {item['name']} - {item['description']}")
            else:
                print(f"{i}. {item_type}: None")
        print("Press < to go back to the player status menu.")
        choice = input("")
        if choice == "<":
            self.display_status()
        elif choice.isdigit():
            index = int(choice) - 1
            if 0 <= index < len(self.equipped_items):
                item_type_to_unequip = list(self.equipped_items.keys())[index]
                self.unequip_menu(item_type_to_unequip)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_equipped_items()
        else:
            print("Invalid option. Please enter a valid option.")
            time.sleep(1)
            self.display_equipped_items()
            
    def remove_equipped_item(self, item_type):
        if item_type in self.equipped_items:
            item = self.equipped_items.pop(item_type)
            self.inventory[item_type].append(item)

    def play_game(self):
        # Placeholder for play game functionality
        input("Play game functionality is under construction. Press Enter to return to the player status menu...")
        self.display_status()

    def add_experience(self, amount):
        self.experience += amount
        if self.experience >= self.exp_required:
            self.level_up()
        self.display_status()

    def level_up(self):
        self.level += 1
        self.exp_required = int(self.exp_required * (1 + self.exp_multiplier))  # Increase by 75%
        self.attack += 0.5
        self.defense += 0.5
        self.dodge += 0.5
        self.speed += 0.5

    def get_name_display(self):
        symbol = ""
        if self.difficulty == "Basic":
            symbol = "🛡️"
        elif self.difficulty == "Exemplar":
            symbol = "⚔️"
        elif self.difficulty == "Templar":
            symbol = "☠️"
        return f"{symbol} {self.name}"

    def get_difficulty_display(self):
        return self.difficulty

    def visit_shop(self):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print("Welcome to the Shop!")
            print("=" * 40)
            print("Shop Sections:")
            print("1. Weapons")
            print("2. Armors")
            print("3. Shields")
            print("4. Footwear")
            print("5. Usable Items")
            print("6. Back to Player Status")
            print("\nEnter the number to select a shop section.")

            choice = input("")

            if choice == "1":
                self.display_shop_section("Weapons")
            elif choice == "2":
                self.display_shop_section("Armors")
            elif choice == "3":
                self.display_shop_section("Shields")
            elif choice == "4":
                self.display_shop_section("Footwear")
            elif choice == "5":
                self.display_shop_section("Usable Items")
            elif choice == "6":
                self.display_status()
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)

    def display_shop_section(self, item_type):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"Shop - {item_type}:")
        print("=" * 40)
        if item_type in items_groups:
            for idx, item in enumerate(items_groups[item_type], 1):
                print(f"{idx}. {item['name']}: {item['description']} - Cost: {item['cost']} gold")
            print("0. Back to Shop Sections")
            print("Enter the number to purchase the item or 0 to go back.")
            choice = input("")
            if choice == "0":
                self.visit_shop()
            elif choice.isdigit() and 0 < int(choice) <= len(items_groups[item_type]):
                self.purchase_item(item_type, int(choice) - 1)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_shop_section(item_type)
        else:
            print("Invalid shop section.")
            time.sleep(1)
            self.visit_shop()

    def purchase_item(self, item_type, index):
        item = items_groups[item_type][index]
        cost = item['cost']
        if self.gold >= cost:
            self.gold -= cost
            self.inventory[item_type].append(item)
            print(f"You have purchased {item['name']} for {cost} gold.")
            time.sleep(1)
        else:
            print("Insufficient gold to purchase this item.")
            time.sleep(1)
        self.display_shop_section(item_type)
            
items_groups = {
    "Usable Items": [
        {"name": "Small Healing Potion", "description": "+15 hp", "cost": 20},
        {"name": "Self Healing Potion", "description": "+20 hp", "cost": 50},
        {"name": "Moderated Potion", "description": "+25 hp", "cost": 75},
        {"name": "Regen Potion", "description": "+15%", "cost": 100},
        {"name": "Hammerhead Crocker", "description": "+7% attack for 7 turns", "cost": 55, "attack_bonus": 0.07},
        {"name": "Warhammer Crocker", "description": "+15% attack for 7 turns", "cost": 75, "attack_bonus": 0.15},
        {"name": "Barhog", "description": "+7% Defense for 7 turns", "cost": 45, "defense_bonus": 0.07},
        {"name": "Warhog", "description": "+15% defense for 7 turns", "cost": 60, "defense_bonus": 0.15},
        {"name": "Non applicable scroll", "description": "+2 Speed for 7 turns", "cost": 40, "speed_bonus": 2},
        {"name": "Applicable scroll", "description": "+4 speed for 7 turns", "cost": 55, "speed_bonus": 4},
        {"name": "Ransacked Shield", "description": "+12% Dodge chance for 3 turns", "cost": 60, "dodge_bonus": 0.12},
        {"name": "Unbuilded Shield", "description": "+23% Dodge Chance for 5 turns", "cost": 90, "dodge_bonus": 0.23},
        {"name": "Mystic Scroll", "description": "25% chance to negate all debuffs on player for 4 turns", "cost": 60},
        {"name": "Mystic Beurau", "description": "50% chance to negate all debuffs on player for 4 turns", "cost": 120},
        {"name": "Variant Bs", "description": "Increase all stats up to 25% for 10 turns", "cost": 200},
        {"name": "Variant Ex", "description": "Increase all stats up to 50% for 10 turns", "cost": 400},
        {"name": "Hide cloak", "description": "40% chance to dodge the battle against enemies when exploring", "cost": 50, "dodge_bonus": 0.4},
        {"name": "Invisible potion", "description": "60% chance to dodge the battle against enemies when exploring", "cost": 75, "dodge_bonus": 0.6},
        {"name": "Exp Moneter", "description": "Give you 20 exp points", "cost": 50},
        {"name": "Exp Vitalis", "description": "Give you 50 exp points", "cost": 100},
        {"name": "Exp For enhancer", "description": "Give you 100 points", "cost": 150}
    ],
    "Weapons": [
        {"name": "Stone Sword", "description": "+12 attack", "cost": 150, "attack_bonus": 12},
        {"name": "Copper Sword", "description": "+15 attack", "cost": 275, "attack_bonus": 15},
        {"name": "Sickanum Sword", "description": "+17 attack", "cost": 400, "attack_bonus": 17},
        {"name": "Arivanum Sword", "description": "+23 attack", "cost": 600, "attack_bonus": 23},
        {"name": "Viranium Sword", "description": "+25 attack", "cost": 850, "attack_bonus": 25},
        {"name": "Titanium sword", "description": "+35 attack", "cost": 1250, "attack_bonus": 35}
    ],
    "Armors": [
                {"name": "Jungle sets", "description": "+7 Defense", "cost": 90, "defense_bonus": 7},
        {"name": "Byzantine sets", "description": "+12 Defense", "cost": 140, "defense_bonus": 12},
        {"name": "Nikel Sets", "description": "+15 Defense", "cost": 350, "defense_bonus": 15},
        {"name": "Warhead Sets", "description": "+25 Defense", "cost": 560, "defense_bonus": 25},
        {"name": "Titanium Sets", "description": "+40 Defense", "cost": 850, "defense_bonus": 40}
    ],
    "Shields": [
        {"name": "Wooden Ob", "description": "+2 dodge", "cost": 80, "dodge_bonus": 2},
        {"name": "Long Ob", "description": "+3 dodge, +2 Defense", "cost": 120, "dodge_bonus": 3, "defense_bonus": 2},
        {"name": "Cob Ob", "description": "+5 dodge, +4 Defense", "cost": 300, "dodge_bonus": 5, "defense_bonus": 4},
        {"name": "Knock Ob", "description": "+7 dodge, +5 Defense, +3 Attack", "cost": 550, "dodge_bonus": 7, "defense_bonus": 5, "attack_bonus": 3},
        {"name": "Neb Ob", "description": "+12 dodge, +7 Defense, +5 Attack", "cost": 760, "dodge_bonus": 12, "defense_bonus": 7, "attack_bonus": 5}
    ],
    "Footwear": [
        {"name": "Jungle Foot", "description": "+3 speeds", "cost": 45, "speed_bonus": 3},
        {"name": "Iron Foot", "description": "+5 Speed", "cost": 75, "speed_bonus": 5},
        {"name": "Metal WarFoot", "description": "+8 Speeds", "cost": 120, "speed_bonus": 8},
        {"name": "Diamond Boots", "description": "+12 Speeds", "cost": 230, "speed_bonus": 12},
        {"name": "Noble Boots", "description": "+19 Speeds", "cost": 450, "speed_bonus": 19},
        {"name": "Lizable Boots", "description": "+25 Speeds", "cost": 700, "speed_bonus": 25}
    ]
}


def create_character():
    clear_screen()
    print("Character Creation")
    name = input("Enter your character's name: ")
    clear_screen()
    print(f"Character Name: {name}\n")
    
    while True:
        print("Select Difficulty:")
        print("1. Basic 🛡️")
        print("2. Exemplar ⚔️")
        print("3. Templar ☠️")
        difficulty_choice = input("Enter the number to select difficulty: ")
        
        if difficulty_choice == "1":
            difficulty = "Basic"
            description = "Enemies are powerful in their origins."
        elif difficulty_choice == "2":
            difficulty = "Exemplar"
            description = "Enemies are harder and more immortalized."
        elif difficulty_choice == "3":
            difficulty = "Templar"
            description = "Enemies are evils."
        else:
            print("Invalid difficulty choice. Please choose a valid option.")
            time.sleep(1)
            clear_screen()
            continue
        
        clear_screen()
        print("Selected Difficulty:")
        print(f"Name: {name}")
        print(f"Difficulty: {difficulty}")
        print(f"Description: {description}\n")
        print("1. Confirm")
        print("2. Back")
        
        confirm_choice = input("Enter your choice: ")
        if confirm_choice == "1":
            break
        elif confirm_choice == "2":
            clear_screen()
            continue
        else:
            print("Invalid choice. Please enter 1 to confirm or 2 to go back.")
            time.sleep(1)
            clear_screen()

    player = Player(name, difficulty)
    player.equipped_items["Weapons"] = {"name": "Broken Sword", "description": "+10 Damage", "attack": 10}
    player.equipped_items["Armors"] = {"name": "Broken Armor", "description": "+5 Defense", "defense": 5}
    player.equipped_items["Shields"] = {"name": "Broken Shield", "description": "+2 Dodge", "dodge": 2}
    player.equipped_items["Footwear"] = {"name": "Broken Footwear", "description": "+3 Speed", "speed": 3}

    return Player(name, difficulty)

def clear_screen():
    """Clears the console screen."""
    os.system('cls' if os.name == 'nt' else 'clear')

def main_menu():
    clear_screen()
    print("BeaVenture\n")
    print("1. Create Character")
    print("2. Exit")
    print("\nEnter the number to select an option.")

def main():
    while True:
        main_menu()
        try:
            choice = int(input(""))

            if choice == 1:
                player = create_character()
                player.display_status()
            elif choice == 2:
                clear_screen()
                print("Exiting BeaVenture. Goodbye!")
                time.sleep(2)
                clear_screen()
                print("Game Was Ended")
                input("Press Enter to exit...")
                clear_screen()
                break
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(2)
        except ValueError:
            print("Invalid input. Please enter a number.")

if __name__ == "__main__":
    main()
int low=0;
          int high=0;
          queue<int>que;
          vector<long long>V;
          while(low<N && high<N)
          {
              if(A[high]<0)
              {
                  que.push(A[high]);
              }
              if(high-low+1==k)
              {
                  if(que.size()==0)
                  {
                      V.push_back(0);
                  }
                  else
                  {
                      V.push_back(que.front());
                  }
              }
              else if(high-low+1>k)
              {
                  while(high-low+1>k)
                  {
                      if(A[low]==que.front())
                      {
                          que.pop();
                      }
                      low++;
                  }
                  if(high-low+1==k)
                  {
                      if(que.size()==0)
                  {
                      V.push_back(0);
                  }
                  else
                  {
                      V.push_back(que.front());
                  }
                      
                  }
              }
              high++;
          }
          return V;
import os
import time
import sys

class Player:
    def __init__(self, name, difficulty):
        self.name = name
        self.difficulty = difficulty
        self.attack = 10
        self.defense = 5
        self.dodge = 2
        self.speed = 3
        self.gold = 100
        self.diamonds = 0
        self.experience = 0
        self.level = 1
        self.exp_required = 100
        self.exp_multiplier = 0.75  # 75% increase for experience requirement per level
        self.inventory = {  # Initialize inventory
            "Weapons": [],
            "Armors": [],
            "Shields": [],
            "Footwear": [],
            "Usable Items": []  # Add Usable Items category
        }
        self.equipped_items = {  # Initialize equipped items
            "Weapons": None,
            "Armors": None,
            "Shields": None,
            "Footwear": None
        }

        self.max_inventory_slots = 30

    # Existing methods...

    def visit_inventory(self):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print("Inventory:")
            print("=" * 40)
            print("1. Weapons")
            print("2. Armors")
            print("3. Shields")
            print("4. Footwear")
            print("5. Usable Items")
            print("6. Back to Player Status")
            print("\nEnter the number to select an option.")

            choice = input("")

            if choice == "1":
                self.display_items("Weapons")
            elif choice == "2":
                self.display_items("Armors")
            elif choice == "3":
                self.display_items("Shields")
            elif choice == "4":
                self.display_items("Footwear")
            elif choice == "5":
                self.display_items("Usable Items")
            elif choice == "6":
                self.display_status()
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)

    def display_items(self, item_type):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print(f"{item_type}:")
            print("=" * 40)
            if self.inventory[item_type]:
                for idx, item in enumerate(self.inventory[item_type], 1):
                    print(f"{idx}. {item['name']}: {item['description']}")
                print("0. Back to Inventory Menu")
                print("Enter the number to equip the item or 0 to go back.")
                choice = input("")
                if choice == "0":
                    break  # Break out of the inner loop to return to the previous menu
                elif choice.isdigit() and 0 < int(choice) <= len(self.inventory[item_type]):
                    self.equip_item(item_type, int(choice) - 1)
                else:
                    print("Invalid option. Please enter a valid number.")
                    time.sleep(1)
            else:
                print("No items in this category.")
                print("Press < to go back")
                choice = input("")
                if choice == "<":
                    break  # Break out of the inner loop to return to the previous menu

    def equip_item(self, item_type, index):
        item = self.inventory[item_type].pop(index)
        if item_type in ["Weapons", "Armors", "Shields", "Footwear"]:
            self.remove_equipped_item(item_type)  # Remove any previously equipped item of the same type
            self.equipped_items[item_type] = item  # Equip the new item
            self.update_stats()  # Update player stats with the new equipment
            print(f"{item['name']} equipped.")
            time.sleep(1)
        else:
            # Handle equipping usable items
            pass
        self.visit_inventory()

    def remove_equipped_item(self, item_type):
        if item_type in self.equipped_items:
            item = self.equipped_items.pop(item_type)
            self.inventory[item_type].append(item)

    def update_stats(self):
        # Reset base stats
        self.attack = 10
        self.defense = 5
        self.dodge = 2
        self.speed = 3
        
        # Add bonuses from equipped items
        for item_type, item in self.equipped_items.items():
            if item:
                self.attack += item.get('attack', 0)
                self.defense += item.get('defense', 0)
                self.dodge += item.get('dodge', 0)
                self.speed += item.get('speed', 0)
                
    def display_status(self):
        os.system('cls' if os.name == 'nt' else 'clear')
        print("Player Status:\n")
        print("="*40)
        print(f"Name: {self.get_name_display()}")
        print(f"Difficulty: {self.get_difficulty_display()}")
        print("-"*40)
        print("Stats:")
        print(f"HP      :❤️{self.calculate_stat('attack')}")
        print(f"Defense :🛡️{self.calculate_stat('defense')}")
        print(f"Attack  :⚔️{self.calculate_stat('attack')}")
        print(f"Dodge   :🤺{self.calculate_stat('dodge')}")
        print(f"Speed   :🏃{self.calculate_stat('speed')}")
        print("-"*40)
        print(f"Level: {self.level}")
        print(f"Experience: {self.experience}/{self.exp_required}")
        print("-"*40)
        print(f"Gold: {self.gold} 💰")
        print(f"Diamonds: {self.diamonds} 💎")
        print("="*40)
        print("Game Options:")
        print("1. Visit Shop")
        print("2. Inventory")
        print("3. Play Game")
        print("4. Delete this Character")
        print("\nEnter the number to select an option.")

        choice = input("")
        if choice == "1":
            self.visit_shop()
        elif choice == "2":
            self.visit_inventory()
        elif choice == "3":
            self.play_game()
        elif choice == "4":
            return
        else:
            print("Invalid option. Please enter a valid number.")
            time.sleep(1)
            self.display_status()

    
    def calculate_stat(self, stat_name):
        base_stat = getattr(self, stat_name)
        bonus_stat = sum(item.get(stat_name, 0) for item in self.equipped_items.values() if item)
        return base_stat + bonus_stat

    def display_items(self, item_type):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"{item_type}:")
        print("=" * 40)
        if self.inventory[item_type]:
            for idx, item in enumerate(self.inventory[item_type], 1):
                print(f"{idx}. {item['name']}: {item['description']}")
            print("0. Back to Inventory Menu")
            print("Enter the number to equip the item or 0 to go back.")
            choice = input("")
            if choice == "0":
                self.visit_inventory()
            elif choice.isdigit() and 0 < int(choice) <= len(self.inventory[item_type]):
                self.equip_item(item_type, int(choice) - 1)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_items(item_type)
        else:
            print("No items in this category.")
            print("You need to press < to go back.")
            choice = input("")
            if choice == "<":
                self.visit_inventory()
            else:
                print("Invalid option. Please enter < to go back.")
                time.sleep(1)
                self.visit_inventory()
    def equip_item(self, item_type, index):
        item = self.inventory[item_type].pop(index)
        if item_type in ["Weapons", "Armors", "Shields", "Footwear"]:
            self.remove_equipped_item(item_type)
            self.equipped_items[item_type] = item
            print(f"{item['name']} equipped.")
            time.sleep(1)
        else:
            # Handle equipping usable items
            pass
        self.visit_inventory()

    def remove_equipped_item(self, item_type):
        if item_type in self.equipped_items:
            item = self.equipped_items.pop(item_type)
            self.inventory[item_type].append(item)

    def play_game(self):
        # Placeholder for play game functionality
        input("Play game functionality is under construction. Press Enter to return to the player status menu...")
        self.display_status()

    def add_experience(self, amount):
        self.experience += amount
        if self.experience >= self.exp_required:
            self.level_up()
        self.display_status()

    def level_up(self):
        self.level += 1
        self.exp_required = int(self.exp_required * (1 + self.exp_multiplier))  # Increase by 75%
        self.attack += 0.5
        self.defense += 0.5
        self.dodge += 0.5
        self.speed += 0.5

    def get_name_display(self):
        symbol = ""
        if self.difficulty == "Basic":
            symbol = "🛡️"
        elif self.difficulty == "Exemplar":
            symbol = "⚔️"
        elif self.difficulty == "Templar":
            symbol = "☠️"
        return f"{symbol} {self.name}"

    def get_difficulty_display(self):
        return self.difficulty

    def visit_shop(self):
        while True:
            os.system('cls' if os.name == 'nt' else 'clear')
            print("Welcome to the Shop!")
            print("=" * 40)
            print("Shop Sections:")
            print("1. Weapons")
            print("2. Armors")
            print("3. Shields")
            print("4. Footwear")
            print("5. Usable Items")
            print("6. Back to Player Status")
            print("\nEnter the number to select a shop section.")

            choice = input("")

            if choice == "1":
                self.display_shop_section("Weapons")
            elif choice == "2":
                self.display_shop_section("Armors")
            elif choice == "3":
                self.display_shop_section("Shields")
            elif choice == "4":
                self.display_shop_section("Footwear")
            elif choice == "5":
                self.display_shop_section("Usable Items")
            elif choice == "6":
                self.display_status()
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)

    def display_shop_section(self, item_type):
        os.system('cls' if os.name == 'nt' else 'clear')
        print(f"Shop - {item_type}:")
        print("=" * 40)
        if item_type in items_groups:
            for idx, item in enumerate(items_groups[item_type], 1):
                print(f"{idx}. {item['name']}: {item['description']} - Cost: {item['cost']} gold")
            print("0. Back to Shop Sections")
            print("Enter the number to purchase the item or 0 to go back.")
            choice = input("")
            if choice == "0":
                self.visit_shop()
            elif choice.isdigit() and 0 < int(choice) <= len(items_groups[item_type]):
                self.purchase_item(item_type, int(choice) - 1)
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(1)
                self.display_shop_section(item_type)
        else:
            print("Invalid shop section.")
            time.sleep(1)
            self.visit_shop()

    def purchase_item(self, item_type, index):
        item = items_groups[item_type][index]
        cost = item['cost']
        if self.gold >= cost:
            self.gold -= cost
            self.inventory[item_type].append(item)
            print(f"You have purchased {item['name']} for {cost} gold.")
            time.sleep(1)
        else:
            print("Insufficient gold to purchase this item.")
            time.sleep(1)
        self.display_shop_section(item_type)
            
items_groups = {
    "Usable Items": [
        {"name": "Small Healing Potion", "description": "+15 hp", "cost": 20},
        {"name": "Self Healing Potion", "description": "+20 hp", "cost": 50},
        {"name": "Moderated Potion", "description": "+25 hp", "cost": 75},
        {"name": "Regen Potion", "description": "+15%", "cost": 100},
        {"name": "Hammerhead Crocker", "description": "+7% attack for 7 turns", "cost": 55},
        {"name": "Warhammer Crocker", "description": "+15% attack for 7 turns", "cost": 75},
        {"name": "Barhog", "description": "+7% Defense for 7 turns", "cost": 45},
        {"name": "Warhog", "description": "+15% defense for 7 turns", "cost": 60},
        {"name": "Non applicable scroll", "description": "+2 Speed for 7 turns", "cost": 40},
        {"name": "Applicable scroll", "description": "+4 speed for 7 turns", "cost": 55},
        {"name": "Ransacked Shield", "description": "+12% Dodge chance for 3 turns", "cost": 60},
        {"name": "Unbuilded Shield", "description": "+23% Dodge Chance for 5 turns", "cost": 90},
        {"name": "Mystic Scroll", "description": "25% chance to negate all debuffs on player for 4 turns", "cost": 60},
        {"name": "Mystic Beurau", "description": "50% chance to negate all debuffs on player for 4 turns", "cost": 120},
        {"name": "Variant Bs", "description": "Increase all stats up to 25% for 10 turns", "cost": 200},
        {"name": "Variant Ex", "description": "Increase all stats up to 50% for 10 turns", "cost": 400},
        {"name": "Hide cloak", "description": "40% chance to dodge the battle against enemies when exploring", "cost": 50},
        {"name": "Invisible potion", "description": "60% chance to dodge the battle against enemies when exploring", "cost": 75},
        {"name": "Exp Moneter", "description": "Give you 20 exp points", "cost": 50},
        {"name": "Exp Vitalis", "description": "Give you 50 exp points", "cost": 100},
        {"name": "Exp For enhancer", "description": "Give you 100 points", "cost": 150}
    ],
    "Weapons": [
        {"name": "Stone Sword", "description": "+12 attack", "cost": 150},
        {"name": "Copper Sword", "description": "+15 attack", "cost": 275},
        {"name": "Sickanum Sword", "description": "+17 attack", "cost": 400},
        {"name": "Arivanum Sword", "description": "+23 attack", "cost": 600},
        {"name": "Viranium Sword", "description": "+25 attack", "cost": 850},
        {"name": "Titanium sword", "description": "+35 attack", "cost": 1250}
    ],
    "Armors": [
        {"name": "Jungle sets", "description": "+7 Defense", "cost": 90},
        {"name": "Byzantine sets", "description": "+12 Defense", "cost": 140},
        {"name": "Nikel Sets", "description": "+15 Defense", "cost": 350},
        {"name": "Warhead Sets", "description": "+25 Defense", "cost": 560},
        {"name": "Titanium Sets", "description": "+40 Defense", "cost": 850}
    ],
    "Shields": [
        {"name": "Wooden Ob", "description": "+2 dodge", "cost": 80},
        {"name": "Long Ob", "description": "+3 dodge, +2 Defense", "cost": 120},
        {"name": "Cob Ob", "description": "+5 dodge, +4 Defense", "cost": 300},
        {"name": "Knock Ob", "description": "+7 dodge, +5 Defense, +3 Attack", "cost": 550},
        {"name": "Neb Ob", "description": "+12 dodge, +7 Defense, +5 Attack", "cost": 760}
    ],
    "Footwear": [
        {"name": "Jungle Foot", "description": "+3 speeds", "cost": 45},
        {"name": "Iron Foot", "description": "+5 Speed", "cost": 75},
        {"name": "Metal WarFoot", "description": "+8 Speeds", "cost": 120},
        {"name": "Diamond Boots", "description": "+12 Speeds", "cost": 230},
        {"name": "Noble Boots", "description": "+19 Speeds", "cost": 450},
        {"name": "Lizable Boots", "description": "+25 Speeds", "cost": 700}
    ]
}


def create_character():
    clear_screen()
    print("Character Creation")
    name = input("Enter your character's name: ")
    clear_screen()
    print(f"Character Name: {name}\n")
    
    while True:
        print("Select Difficulty:")
        print("1. Basic 🛡️")
        print("2. Exemplar ⚔️")
        print("3. Templar ☠️")
        difficulty_choice = input("Enter the number to select difficulty: ")
        
        if difficulty_choice == "1":
            difficulty = "Basic"
            description = "Enemies are powerful in their origins."
        elif difficulty_choice == "2":
            difficulty = "Exemplar"
            description = "Enemies are harder and more immortalized."
        elif difficulty_choice == "3":
            difficulty = "Templar"
            description = "Enemies are evils."
        else:
            print("Invalid difficulty choice. Please choose a valid option.")
            time.sleep(1)
            clear_screen()
            continue
        
        clear_screen()
        print("Selected Difficulty:")
        print(f"Name: {name}")
        print(f"Difficulty: {difficulty}")
        print(f"Description: {description}\n")
        print("1. Confirm")
        print("2. Back")
        
        confirm_choice = input("Enter your choice: ")
        if confirm_choice == "1":
            break
        elif confirm_choice == "2":
            clear_screen()
            continue
        else:
            print("Invalid choice. Please enter 1 to confirm or 2 to go back.")
            time.sleep(1)
            clear_screen()

    return Player(name, difficulty)

def clear_screen():
    """Clears the console screen."""
    os.system('cls' if os.name == 'nt' else 'clear')

def main_menu():
    clear_screen()
    print("BeaVenture\n")
    print("1. Create Character")
    print("2. Exit")
    print("\nEnter the number to select an option.")

def main():
    while True:
        main_menu()
        try:
            choice = int(input(""))

            if choice == 1:
                player = create_character()
                player.display_status()
            elif choice == 2:
                clear_screen()
                print("Exiting BeaVenture. Goodbye!")
                time.sleep(2)
                clear_screen()
                print("Game Was Ended")
                input("Press Enter to exit...")
                clear_screen()
                break
            else:
                print("Invalid option. Please enter a valid number.")
                time.sleep(2)
        except ValueError:
            print("Invalid input. Please enter a number.")

if __name__ == "__main__":
    main()
BankAccount.java

import java.util.Scanner;

public class BankAccount {
    String name;
	private double balance;
	private int depositCount = 0;
	private int withdrawCount = 0;
	private String accountType;
	
	
	public void deposit(double amount){
		balance += amount;
		System.out.println(amount + " is successfully Deposited");
		depositCount++;
		if(balance > 100000){
			balance = balance + (amount / 100);
		}
	}
	public void setAccountType(String type){
		this.accountType = type;
	}
	
	public void withdraw(double amount){
		if(balance >= amount){
			if(balance - amount < 50000){
				System.out.println("Asre you sure you want to withdraw, it would make your balance below 50,000");
				System.out.println("Press 1 to continue and 0 to abort");
				Scanner input = new Scanner(System.in);
				int confirm = input.nextInt();
				if(confirm != 1){
					System.out.println("Withdrawal aborted");
					return;
				}
			}
			double withdrawAmount = amount;
			if(balance < 50000){
				withdrawAmount = withdrawAmount + amount * 0.02;
				withdrawCount++;
			}
			balance = balance - withdrawAmount;
			System.out.println(withdrawAmount + " is successfully withdrawn");
			
		}
		else{
			System.out.println("Insufficient funds");
		}
			
	}
	public double getBalance(){
		return balance;
	}
	
	public void subscribeSmsAlert(){
		if(accountType.equals("STANDARD")){
			balance -= 2000;
		}
	}
	
	public void subscribeDebitCard(){
		if(accountType.equals("STANDARD")){
			balance -= 5000;
		}
	}
	
	
	void transaction(){
		System.out.println("Account title: " + name);
		System.out.println("Total deposit: " + depositCount);
		System.out.println("Total withdraw: " + withdrawCount);
		System.out.println("Balance: " + balance);
	}
	
}

//////////////////////////////////////////////////////////////////////////////////////

//BankAccountTest.Java

import java.util.Scanner;

public class BankAccountTest{
	
	public static void main(String args[]){
		
		BankAccount account = new BankAccount();
		
		Scanner input = new Scanner(System.in);
		account.name = "Maan";
		
		System.out.println("Enter the account type: ");
		String accountType = input.nextLine();
		account.setAccountType(accountType);
		
		System.out.println("Do want to subscribe SMS alerts(Y or N): ");
		String sms = input.nextLine();
		if(sms.equals("Y") || sms.equals("y")){
			account.subscribeSmsAlert();
		}
		System.out.println("Do you want to subscribe Debit Card(Y or N): ");
		String debit = input.nextLine();
		
		if(debit.equals("Y") || debit.equals("y")){
			account.subscribeDebitCard();
		}
		
		int choice;
		
		do{
			System.out.println("Press 1: To Deposit an amount\nPress 2: To Withdraw an amount\nPress 3: To View the current balance\nPress 4: To Close the program");
		    choice = input.nextInt();
		
		    switch(choice){
			case 1:
			System.out.println("Enter the amount you want to Deposite");
			double depositeAmount = input.nextDouble(); 
			account.deposit(depositeAmount);
			break;
			case 2:
			System.out.println("Enter the amount you want to withdraw");
			double withdrawAmount = input.nextDouble();
			account.withdraw(withdrawAmount);
			break;
			case 3:
			System.out.println("Your current balance is " + account.getBalance());
			break;
			case 4:
			System.out.println("The program is terminated");
			account.transaction();
			break;
			default:
			System.out.println("Incorrect choice. Please try again!");
			break;
			
		
		}
		
	}while(choice!=4);
  }
	
}
SELECT * from strings;

---------+
    S    |
---------+
 coffee  |
 ice tea |
 latte   |
 tea     |
 [NULL]  |
---------+

SELECT * FROM strings WHERE CONTAINS(s, 'te');

---------+
    S    |
---------+
 ice tea |
 latte   |
 tea     |
---------+
curl --request POST \
  --url 'https://api.apyhub.com/convert/rss-file/json?detailed=true' \
  --header 'apy-token: APY0BOODK2plpXgxRjezmBOXqID51DGpFq8QnHJeBQrrzuIBc25UIglN93bbwvnkBWlUia1' \
  --header 'content-type: multipart/form-data' \
  --form 'file=@"test.xml"'
curl --request POST \
  --url 'https://api.apyhub.com/convert/word-file/pdf-file?output=test-sample.pdf&landscape=false' \
  --header 'apy-token: APY0BOODK2plpXgxRjezmBOXqID51DGpFq8QnHJeBQrrzuIBc25UIglN93bbwvnkBWlUia1' \
  --header 'content-type: multipart/form-data' \
  --form 'file=@"test.doc"'
curl --request POST \
  --url 'https://api.apyhub.com/generate/charts/bar/file?output=sample.png' \
  --header 'Content-Type: application/json' \
  --header 'apy-token: APY0BOODK2plpXgxRjezmBOXqID51DGpFq8QnHJeBQrrzuIBc25UIglN93bbwvnkBWlUia1' \
  --data '{
    "title":"Simple Bar Chart",
    "theme":"Light",
    "data":[
        {
            "value":10,
            "label":"label a"
        },
        {
            "value":20,
            "label":"label b"
        },
        {
            "value":80,
            "label":"label c"
        },
        {
            "value":50,
            "label":"label d"
        },
        {
            "value":70,
            "label":"label e"
        },
        {
            "value":25,
            "label":"label f"
        },
        {
            "value":60,
            "label":"label g"
        }
    ]
}'
curl --request POST \
  --url 'https://api.apyhub.com/generate/charts/bar/file?output=sample.png' \
  --header 'Content-Type: application/json' \
  --header 'apy-token: APY0BOODK2plpXgxRjezmBOXqID51DGpFq8QnHJeBQrrzuIBc25UIglN93bbwvnkBWlUia1' \
  --data '{
    "title":"Simple Bar Chart",
    "theme":"Light",
    "data":[
        {
            "value":10,
            "label":"label a"
        },
        {
            "value":20,
            "label":"label b"
        },
        {
            "value":80,
            "label":"label c"
        },
        {
            "value":50,
            "label":"label d"
        },
        {
            "value":70,
            "label":"label e"
        },
        {
            "value":25,
            "label":"label f"
        },
        {
            "value":60,
            "label":"label g"
        }
    ]
}'
curl --request POST \
  --url 'https://api.apyhub.com/generate/qr-code/file?output=sample.png' \
  --header 'Content-Type: application/json' \
  --header 'apy-token: APY0BOODK2plpXgxRjezmBOXqID51DGpFq8QnHJeBQrrzuIBc25UIglN93bbwvnkBWlUia1' \
  --data '{
    "content": "https://apyhub.com",
    "logo": "https://apyhub.com/logo.svg",
    "background_color": "#000000",
    "foreground_color": ["#e8bf2a", "#e8732a"]
}'
[
    {
        "$match": {
            "partnerShortCode": {
                "$in": []
            }
        }
    },
    {
        "$group": {
            "_id": "$partnerShortCode",
            "clinics": {
                "$push": {
                    "clinicName": "$name",
                    "clinicId": "$_id"
                }
            }
        }
    },
    {
        "$project": {
            _id:0,
            "partnerShortCode": "$_id",
            "clinics": 1
        }
    }
]
<?php  require_once 'dc.php'; 

error_reporting(0);

echo "<div class='ris'>";

if ($_SERVER["REQUEST_METHOD"] == "POST") {

// reCAPTCHA verify
$recaptchaSecretKey = '6Lf7Yw8pAAAAAMS-xv8MsdtMQRHgxQ2V-3ZSndxM';
$recaptchaResponse = $_POST['g-recaptcha-response'];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.google.com/recaptcha/api/siteverify");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
    'secret' => $recaptchaSecretKey,
    'response' => $recaptchaResponse
)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
//end reCAPTCHA

if(isset($_POST['remember_me'])) {
    // Usuario marcó "Recuérdame", establecer cookie para 30 días
    setcookie('username', $_POST['username'], time() + (86400 * 30), "/");
} else {
    // Usuario no marcó "Recuérdame", eliminar cookie si existe
    if(isset($_COOKIE['username'])) {
        // Establecer el tiempo de expiración en el pasado para eliminarla
        setcookie('username', '', time() - 3600, "/");
    }
}


// Decodificar la respuesta
$responseKeys = json_decode($response, true);
    if (intval($responseKeys["success"]) !== 1) {    // CAPTCHA failed
        header("Location: user-incorrect.php?ms=3");
        exit();
    } else {
        $user = mysqli_real_escape_string($mysqli, $_POST['username']);  
        $pass = $_POST['password']; 

        // Consulta de inicio de sesión
        $sql = "SELECT user.u_code AS u_code, user.nombre, user.pswr AS password, docentes.cedula AS username, user.level AS nivel 
                FROM user INNER JOIN docentes ON docentes.d_code = user.nombre WHERE docentes.cedula = ?";
        $stmt = $mysqli->prepare($sql);
        
        $stmt->bind_param("s", $user);
        $stmt->execute();
        $result = $stmt->get_result();
        $numregis = $result->num_rows;

        if ($numregis > 0) {
            $row = $result->fetch_assoc();

            // Verificar PSWD
            if (password_verify($pass, $row['password'])) {
                session_start();
                $_SESSION['estarted'] = true;
                $_SESSION['UNI_CODE'] = $row['u_code'];
                $_SESSION['MM_Username'] = $row['username'];
                $_SESSION['MM_UserGroup'] = $row['nombre'];
                $_SESSION['MM_Level'] = $row['nivel'];
                $_SESSION['u_code']=$row['u_code'];

                switch ($_SESSION['MM_Level']) {
                    case 1: // ADMINER
                        header("Location: ../noaAdminer/pag0.php"); exit();
                    case 2: // SECRETARIAS
                        header("Location: ../noaAdmin/index.php"); exit();
                    case 3: // DOCENTES
                        header("Location: ../noaCV/index.php"); exit();
                    case 4: // PRACTICAS    
                        header("Location: ../pracVIN/index.php"); exit();
                    case 5: // VINCULACION
                        header("Location: ../noaLogos/navybar/mono/index.php"); exit();
                    case 6: // INSPECTORES
                        header("Location: ../ASISTOR/index.php"); exit();                        
                    case 8: // ALUMNOS
                        header("Location: ../noaAlumnos/index.php"); exit();
                    case 9: // ADMIN_vinc
                        header("Location: ../noaLogos/navybar/maister\index1.php"); exit();
                    default:
                        header("Location: ../index.php"); exit();
                }
            } else {
                header("Location: user-incorrect.php?ms=1"); die();
            }
        } else {
            header("Location: user-incorrect.php?ms=2"); die();
        }
        $_SESSION['estarted'] = false; 
    }
}
$mysqli->close();
?>
</div>
handleCodeChange(event) {
        let codeLength = event.target.value.length;
        
        if(codeLength === 6) {
            const selectedEvent = new CustomEvent("showvalidatebutton", {
                detail: {
                    codeReceivedFromCustomer: event.target.value,
                    codeSentToCustomer: this.completeCode.toString()
                }
            });
            this.dispatchEvent(selectedEvent);
        } else {
            this.dispatchEvent(new CustomEvent('hidevalidatebutton'));
        }
    }
class msRichards {
  protected
  public void favClass() {
    System.out.println("My FAVOURITE Class is...");
  }
}

class course extends msRichards {
  private String courseName = "ICS4U";
  public static void main(String[] args) {
    course myCourse = new course();
    myCourse.favClass();
    System.out.println( myCourse.grade + " " + myCourse.courseName + "!");
  }
}

class Main {

	public static void main(String[] args) {
        msRichards newCourse = new course();
    	msRichards firstCourse = new courseICS3U();
        msRichards secondCourse = new courseICS4U();
        
       newCourse.favClass();
       newCourse.favClass();
       newCourse.favClass();
        
       }
                            <li>
                                <form action="../Connections/kiler.php" method="POST">
                                    <button type="submit" name="logout" 
                                    style="background: none; border: none; padding: 0; margin: 0; 
                                           font: inherit; color: inherit; cursor: pointer;">
                                        Salir
                                    </button>
                                </form>
                            </li>






				<li>
					<a href="" target="_self">
						<form action="../../../Connections/kiler.php" method="POST">
                                    <button type="submit" name="logout" 
                                    style="background: none; border: none; padding: 0; margin: 0; 
                                           font: inherit; color: inherit; cursor: pointer;">
                                        <i class="fa fa-power-off" aria-hidden="true"></i>
										<span id="salirSpan">Salir</span>
                                    </button>
                                </form>
					</a>
				</li>
xCardMemNumber is int
HRead (Members,hRecNumCurrent)
//info(Members.Member_Number)
QRY_MembersCardprint.ParamMember_Number = Members.Member_Number
//info(QRY_MembersCardprint.ParamMember_Number)
HExecuteQuery(QRY_MembersCardprint)
//Trace("YResolution = " + iParameter(iYResolution))
iDestination(iViewer)
//iParameter(iYResolution, 300)
iPrintReport(RPT_Card)
#include <stdio.h>
#include<math.h>

int main() {
 int a, b, order;
 char choice ; 
 printf("Enter : \n A = for arithmetic operations. \n N = for exponents of a number. \n D = for Area/Volume of 2 and 3-Dimentional figures. \n C = for Condition checking(greater/or smaller and for to check Even/or odd . \n: ");
 scanf("%c", &choice);

 if (choice == 'A' ) {
  printf("Enter a numbers a:\n");
  scanf("%d", &a);
  printf("Enter a numbers b:\n");
  scanf("%d", &b);
  printf("Enter 1 for operations from a to b or 2 for operations from b to a: ");
  scanf("%d", &order);

  if (order == 1 ) {
   int sum = a + b;
   int difference = a - b;
   int product = a * b;
   float quotient = (float)a / b; // Cast to float for potential division by 0

   printf("Results (a to b):\n");
   printf("Sum: %d\n", sum);
   printf("Difference: %d\n", difference);
   printf("Product: %d\n", product);
   printf("Quotient: %.2f\n", quotient); // Format quotient with 2 decimal places
  } else if (order == 2) {
   int sum = b + a;
   int difference = b - a;
   int product = b * a;
   float quotient = (float)b / a; // Cast to float for potential division by 0

   printf("Results (b to a):\n");
   printf("Sum: %d\n", sum);
   printf("Difference: %d\n", difference);
   printf("Product: %d\n", product);
   printf("Quotient: %.2f\n", quotient); // Format quotient with 2 decimal places
  } else {
   printf("Invalid order. Please enter 1 or 2 \n");
  } }
   
  if (choice == 'N' ) { 
    
   int base, exponent, power = 1; // Initialize power to 1

 printf("Enter the base number: ");
 scanf("%d", &base);

 printf("Enter the exponent (power): ");
 scanf("%d", &exponent);

 // Handle negative exponents (optional)
 if (exponent < 0) {
  printf("Error: Exponents cannot be negative.\n");
  return 1; // Indicate error
 }

 // Calculate the power using a loop
 for (int i = 1; i <= exponent; ++i) {
  power *= base; // Multiply power by base in each iteration
 }

 printf("%d raised to the power of %d is %d.\n", base, exponent, power);
 } 
 if ( choice == 'D') {
   float l , b ,c , h , r , m , n , x , y , f ;
   char ch ;
   printf("Enter : A = for finding Area of 2D figures.\n V = for finding Volume of a 3D figures :");
   scanf(" %c", &ch);
   if ( ch == 'A') {
     char ch;
   printf(" Enter : \n k = for area of a square . \n R = for area of a Rectangle . \n p = for area of a Parallelogram .\n T = for area of a Trapezium . \n t = for area of a Triangle .\n E = for area of a Equilateral Triangle . \n P = for area of a Pentagone .\n H = for area of a Hexagone. \n O = for area of a Octagone . \n a = for area of a Annulus. \n C = for area of a Circle , \n S = for Sector area of a circle.\n s = for Segment area of a circle. \n e = for area of a Ellipse");
   scanf(" %c" , &ch);
   if ( ch == 'k') {
     printf(" Enter the side of a square");
     scanf(" %f", &l);
     f = l*l ;
     printf(" Area of a Square is : %f", f );
   }
   if ( ch == 'R') {
     printf("Enter the Length of a Rectangle :");
     scanf(" %f" , &l);
     printf(" Enter the Breadth of a Rectangle :");
     scanf(" %f" , &b);
     f = l*b ;
     printf(" Area of a Rectangle is : %f" , f);
   }
   if ( ch == 'p') {
     printf("Enter the Length of a Parallelogram:");
     scanf(" %f" , &l);
     printf(" Enter the height of a Parallelogram :");
     scanf(" %f" , &b);
     f = l*b ;
     printf(" Area of a Parallelogram is : %f" , f);
   }
   if ( ch == 'T') {
     printf("Enter First parallel side of a Trapezium :");
     scanf(" %f" , &l);
     printf(" Enter the Second parallel side of a Trapezium :");
     scanf(" %f" , &b);
     printf(" Enter the Height of a Trapezium :");
     scanf(" %f", &h );
     f = 0.5*(l + b)*h ;
     printf(" Area of a Trapezium is : %f" , f);
   }
   if ( ch == 't') {
     printf(" Enter the Breadth of a Triangle :");
     scanf(" %f ", &b);
     printf(" Enter the Height of the Triangle :");
     scanf(" %f", &h);
     f = 0.5*(b*h) ;
     printf(" Area of a Triangle is : %f" , f);
     }
     if ( ch == 'E') {
       printf(" Enter the Side of an Equilateral Triangle :");
     scanf(" %f ", &b);
     f = sqrt(3.0)/4 * b * b;
     printf(" Area of an Equilateral Triangle is : %f" , f);
     }
     if ( ch == 'P')
     {
       printf(" Enter the Radius enclosed under the Pentagon :");
       scanf(" %f ", &b);
       f = 5.0/8.0 * b * b * sqrt( 10 + 2*sqrt(5)) ;
       printf(" Area of a Pentagone is : %f" , f);
     }
     if ( ch == 'H') {
       printf(" Enter the side of a Hexagone :");
       scanf(" %f", &b);
       f = 1.0 * b * b * sqrt( 2 ) ;
       printf(" Area of a Hexagone is : %f", f);
     }
     if ( ch == 'O') {
       printf("Enter the side of a Octagone :");
       scanf(" %f", &b);
       f = 6.64*b ;
       printf("Area of a Octagone is : %f", f);
     }
     if ( ch == 'C') {
       printf(" Enter the Radius of a Circle :");
       scanf(" %f", &b);
       f = M_PI * b * b ;
       printf(" Area of a Circle is : %f", f);
     }
     if ( ch == 'a') {
       printf(" Enter the minor diameter is a CIrcle :");
       scanf(" %f", &b);
       printf(" Enter the major diameter of a Circle :");
       scanf(" %f", &l);
       f = M_PI/4.0 *b*b*l*l ;
       printf(" Area of a Annulus is : %f" , f);
     }
     if ( ch == 'S') {
       printf(" Enter the radius of a sector :");
       scanf(" %f", &b );
       printf(" Enter the arc of a sector :");
       scanf(" %f" , &l);
       f = 0.5 * l * b ;
       printf(" Area of a sector is : %f", f);
     }
     if ( ch == 's') {
        double angle_degrees, sin_value;
       printf(" Enter the segment radius :");
       scanf(" %f", &b);
  // Prompt user to enter angle in degrees
  printf("Enter the angle in degrees (0 to 360): ");
  scanf("%lf", &angle_degrees);

  // Calculate sine value
  sin_value = sin(angle_degrees * M_PI / 180.0); // Convert degrees to radians
  f = 0.5 * ( (angle_degrees * M_PI / 180.0) - sin_value ) *b*b ;
 }
 if ( ch == 'e') {
   printf(" Enter the major axis radius of an Ellipse :");
   scanf( " %f " , &b);
   printf(" Enter the minor axis radius of the Ellipse :");l
   scanf(" %f", &l);
   f = M_PI * b * l ;
   printf(" Area of an Ellipse is : %f", f);
 }
   }
   if ( ch == 'V') { 
       float a , b , c , l , b , h , f , c ;
       int chh ;
      printf("Enter: \n");
      printf("1 = for finding Volume of a Cube.\n");
      printf("2 = for finding Volume of a Cuboid.\n");
      printf("3 = for finding Volume of a Parallelepiped.\n");
      printf("4 = for finding Volume of a Pyramid.\n");
      printf("5 = for finding Volume of a Frustum of Pyramid.\n");
      printf("6 = for finding Volume of a Cylinder.\n");
      printf("7 = for finding Volume of a Hollow Cylinder.\n");
      printf("8 = for finding Volume of a Cone.\n");
      printf("9 = for finding Volume of a Frustum of a Cone.\n");
      printf("10 = for finding Volume of a Barrel.\n");
      printf("11 = for finding Volume of a Sphere.\n");
      printf("12 = for finding Volume of a Zone of a Sphere.\n");
      printf("13 = for finding Volume of a Segment of a Sphere.\n");
      printf("14 = for finding Volume of a Sector of a Sphere.\n");
      printf("15 = for finding Volume of a Sphere with Cylinder.\n");
      printf("16 = for finding Volume of a Sphere with Two Cones.\n");
      printf("17 = for finding Volume of a Sliced Cylinder.\n");
      printf("18 = for finding Volume of an Ungulla. \n");
      scanf("%d",  &chh);
      if ( chh == 1) { 
          printf(" Enter the Side of the Cube :");
          scanf("%f", &a);
          f = a*a*a ;
          printf(" Volume is : %f", f);
      }
       if ( chh == 2) { 
           printf(" Enter the Length of a Cuboid :");
           scanf(" %f", &l);
           printf(" Enter the Breadth of the Cuboid :");
           scanf(" %f", &b);
           printf(" Enter the Height of a Cuboid :");
           scanf(" %f", &h);
           f = l*b*h ;
           printf("Volume of a Cuboid : %f", f);
      }
       if ( chh == 4) {
            printf(" Enter the Base Length of a Pyramid  :");
           scanf(" %f", &l);
           printf(" Enter the Base Width of a Pyramid :");
           scanf(" %f", &b);
           printf(" Enter the Height of a Pyramid:");
           scanf(" %f", &h); 
           f = 1.0/3.0 * (l*b*h) ;
           printf(" Volume of a Pyramid is : %f " ,f);
      }
    if ( chh == 5) {
       printf(" Enter the Base Length of a Frustum of Pyramid  :");
           scanf(" %f", &l);
           printf(" Enter the Base Width of Frustum of Pyramid :");
           scanf(" %f", &b);
          printf(" Enter the smaller Base Length of a Frustum of Pyramid  :");
           scanf(" %f", &a);
           printf(" Enter the Smaller Base Width of Frustum of Pyramid :");
           scanf(" %f", &c);
           printf(" Enter the Height of a Pyramid Frustum:");
           scanf(" %f", &h); 
           f =1.0/3.0 * h*( l*b*a*c + sqrt( a*b*l*c)) ;
           printf( " Vloume of a Frustum of Pyramid is : %f", f);
      }
  if ( chh == 6) { 
      printf(" Enter the Diameter of a Cylinder : ");
      scanf(" %f", &l);
      printf(" Enter the Height of a Cylinder:");
      scanf(" %f", &h);
          f = 1.0/4.0 * M_PI * l*l * h ;
          printf(" Volume of a Cylinder is : %f ", f);
      }
    if ( chh == 7) { 
        printf(" Enter the Bigger Diameter of a Hollow Cylinder : ");
      scanf(" %f", &l);
        printf(" Enter the Smaller Diameter of a Hollow Cylinder : ");
      scanf(" %f", &a);
      printf(" Enter the Height of a Cylinder:");
      scanf(" %f", &h);
          f = 1.0/4.0 * M_PI * ( l*l - a*a);
          printf(" Volume of a Hollow Cylinder is : %f ", f);
      } 
 if ( chh == 8) {
       printf(" Enter the Radius of a Cone : ");
      scanf(" %f", &l);
      printf(" Enter the Height of a Cylinder:");
      scanf(" %f", &h); 
      f = 1.0/3.0 * M_PI * l*l*h ;
      printf("Volume of a cone is : %f", f);
      } if ( chh == 3) { 
           printf(" Enter the Length of a Parallelepiped:");
           scanf(" %f", &l);
           printf(" Enter the Breadth of the Parallelepiped:");
           scanf(" %f", &b);
           printf(" Enter the Height of a Parallelepiped :");
           scanf(" %f", &h);
           f = l*b*h ;
           printf("Volume of a Parallelepiped : %f", f);
          
      } if ( chh == 9) { 
          printf(" Enter the Larger Diameter of a Frustum of a Cone : ");
      scanf(" %f", &l); 
       printf(" Enter the Smaller Diameter of a Frustum of a Cone : ");
      scanf(" %f", &b); 
      printf(" Enter the Height of a Cylinder:");
      scanf(" %f", &h); 
      f = h*M_PI * ( l*l + l*b + b*b) * 1.0/12.0  ;
      printf(" Volume of a Frustum of Cone is : %f", f);
      } if ( chh == 10) {
            printf(" Enter the Larger Diameter of a Barrel: ");
      scanf(" %f", &l); 
       printf(" Enter the Smaller Diameter of a Barrel : ");
      scanf(" %f", &b); 
       printf(" Enter the Height of a Barrel:");
      scanf(" %f", &h); 
      f = M_PI * h * ( 2*l*l + b*b ) * 1.0/ 12.0  ;
      printf(" Volume of a Barrel is : %f", f);
      } if ( chh == 11) {
          printf(" Enter the Diameter of the Sphere :");
          scanf("%f", &l);
          f = M_PI * l*l*l * 1.0/6.0 ;
          printf(" Volume of a Sphere is : %f", f);
      } if ( chh == 12) { 
           printf(" Enter the Bigger Radius of Zone of the Sphere :");
          scanf("%f", &l);
           printf(" Enter the Smaller Radius of Zone of the Sphere :"); 
          scanf("%f", &b);
           printf(" Enter the Height of a Zone of a Sphere:");
      scanf(" %f", &h); 
          f = M_PI * h * ( 3*l*l + 3*b*b + h*h);
          printf("Volume of a Zone of  a Sphere is : %f", f);
      } if ( chh == 13) { 
          printf(" Enter the Diameter of a Segment of a Sphere :");
          scanf("%f", &l);
           printf(" Enter the Height of a Segment of a Sphere :"); 
          scanf("%f", &b);
          f = M_PI * h * ( 3.0/4.0 * l*l + h*h);
          printf(" Vomume of a Segment of a Sphere is : %f", f);
      } if ( chh == 14) {
          printf(" Enter Radius of a Sector Sphere :");
          scanf("%f", &l);
           printf(" Enter the Height of the Sector of a sphere:"); 
          scanf("%f", &b);
          f = 2.0/3.0 * M_PI * l*l * b ;
          printf(" Volume of a sector of a Sphere is : %f", f);
} if ( chh == 15) {
          printf(" Enter the Height of a Sphere with a Cylinder:");
          scanf("%f", &l);
         f = 1.0/6.0 * l*l*l ;
         printf(" VOlume of a Sphere with a Cylinder is : %f", f);
      } if ( chh == 16) {
          printf("  :");
          scanf("%f", &l);
           printf(" Enter the Smaller Radius of Zone of the Sphere :"); 
          scanf("%f", &b);
      } if ( chh == 17) { 
          printf(" Enter the Diameter of a Sliced Cylinder:");
          scanf(" %f ", &l);
          printf(" Enter the Height of a Sliced Cylinder :");
          scanf(" %f ", &b);
       f = M_PI * 1.0/4.0 * l*l * b  ;
       printf(" Volume of a Sliced Cylinder is : %f", f);
      
      }  if ( chh == 18) {
          printf(" Enter Radius of an Ungulla :");
          scanf(" %f", &l);
          printf(" Enter the height of an Ungulla :");
          scanf(" %f", &b);
          f = 2.0/3.0 * l*l * b  ;
          printf(" Volume of an Ungulla :%f", f);
      } }
      
      }  
      if ( choice == 'C' ) {
          
      }
      
      
      
      return 0 ;
}
      
@page
@model WebUI.Pages.Shared.ServitörVyModel

@{
    var swedishTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Central European Standard Time");
    var nowSwedishTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, swedishTimeZone);
}

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Välj Bord</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/StyleFoodMenu.css" asp-append-version="true">

    <style>
        .table-button {
            width: 100%;
            margin-bottom: 20px;
            height: 60px;
        }

        .iframe-container {
            width: 100%;
            border: none;
            height: 400px;
        }
    </style>
</head>

<div class="container" style="display:flex; flex-direction:column;" >

    <button class="btn btn-warning" id="offcanvasbutton" style=" color:black;" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasBottom" aria-controls="offcanvasBottom">Toggle bottom offcanvas</button>

    <div id="accordion">
        <div class="card">
            
                    <button class="btn btn-warning" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                        Välj bord
                    </button>
             
            <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
                <div class="card-body">
                    Välj bord

                    <select id="tableSelect" class="form-control">
                        @foreach (var table in Model.TablesProp)
                        {
                            <option value="@table.Number">@table.Number</option>
                        }
                    </select>

                    <button class="btn btn-success" id="confirmButton">Bekräfta </button>
                </div>
            </div>
        </div>
        <div class="card">

            <button class="btn btn-warning collapsed" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
              Beställning
            </button>

            <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordion">
                <div class="card-body">
                    <button class="btn btn-success" id="orderButton">Ny Beställning </button>
                </div>
            </div>
        </div>
        <div class="card">
           
                    <button class="btn btn-warning collapsed" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
                        Välj maträtt
                    </button>
                
            <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
                <div class="card-body">
                    <div class="row special-list">
                        @if (Model.Foods != null)
                        {
                            foreach (var food in Model.Foods)
                            {
                                if ((food.PublishDate == null || food.PublishDate <= nowSwedishTime) &&
                                (food.RemoveDate == null || food.RemoveDate > nowSwedishTime))
                                {
                                    <div class="col-lg-4 col-md-6 special-grid menu-card" data-food-id="@food.Id"
                                         data-food-title="@food.Title" data-food-description="@food.Description"
                                         data-food-price="@food.Price" data-food-category="@food.Category"
                                         data-food-ingredients="@food.Ingredients">
                                        <div class="gallery-single fix">
                                            @if (!string.IsNullOrEmpty(food.ImagePath))
                                            {
                                                <img src="@Url.Content($"~/{food.ImagePath}")" class="img-fluid" alt="Bild av @food.Title">
                                            }
                                            <div class="why-text">
                                                @if (User.IsInRole("Admin") || User.IsInRole("Owner"))
                                                {
                                                    <div class="options-menu" style="display:none;">
                                                    </div>
                                                }
                                                <h4>@food.Title</h4>

                                                <button class="button btn-success add-to-cart" id="addtocart" data-food-id="@food.Id">Lägg till</button>
                                                <h5>@food.Price kr</h5>
                                            </div>
                                        </div>
                                    </div>
                                }
                            }
                        }
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<title>Offcanvas Button Example</title>
<!-- Include Bootstrap CSS -->

<div class="offcanvas offcanvas-bottom" tabindex="-1" id="offcanvasBottom" aria-labelledby="offcanvasBottomLabel">
    <div class="offcanvas-header">
        <h5 class="offcanvas-title" id="offcanvasBottomLabel">Offcanvas bottom</h5>
        <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
    </div>
    <div class="offcanvas-body small" id="ordersContainer">
        
    </div>

    

</div>

<button class="btn-btn btn-success" id="confirmorder"> Bekräfta beställning </button>

<!-- Include Bootstrap JavaScript (popper.js and bootstrap.js are also required) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.11.6/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/5.3.0/js/bootstrap.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script>
    document.getElementById('confirmButton').addEventListener('click', function () {
        // Get the selected table number
        var selectedTableNumber = document.getElementById('tableSelect').value;

        // Do something with the selected table number
        console.log('Selected table number:', selectedTableNumber);

        // You can perform further actions here, such as sending the selected table number to the server
        // using AJAX or submitting a form.
    });

    let orderId;
    let guest;
    let waiter;
    let date;
    let receit
    let status
    let table;


         //POST Order
        document.getElementById('orderButton').addEventListener('click', function () {
            // Prepare the order data

        const currentDate = new Date();
            const orderData = {
             table:document.getElementById('tableSelect').value
            };
            
            // Send the order data to the server using Fetch API
            fetch('/api/Order/', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify(orderData)
            })
                .then(response => {
                    if (!response.ok) {
                        throw new Error('Network response was not ok');
                    }
                    return response.json();
                })
                .then(data => {
                    // Handle the response data if needed
                    console.log('Order created successfully:', data);
                    console.log('Order Id: ', data.id)
                    console.log('Order Guest: ', data.guest)
                    console.log('Order Table: ', data.table )
                    console.log('Order WaiterId: ', data.waiterId)
                    console.log('Order Date: ', data.date)
                    console.log('Order ReceitId: ', data.receitId)
                    console.log('Order Status: ', data.status)

                    date = order.date;
                    orderId = data.id;
                    guest = data.guest;
                    table = data.table;
                    waiter = data.waiterId;
                    receit = data.receitId;
                    status = data.status;

                    // You can redirect or show a success message here
                })
                .catch(error => {
                    console.error('There was a problem with your fetch operation:', error);
                    // Handle errors appropriately, e.g., show an error message to the user
                });
        });

    //POST OrderItem
    document.querySelectorAll('.add-to-cart').forEach(item => {
        item.addEventListener('click', function () {
            var foodId = $(this).data('food-id');
            var data = {
                FoodId: foodId,
                Quantity: 1,
                OrderId: orderId
            };

            fetch('/api/OrderItem/', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify(data)
            })
                .then(response => {
                    if (!response.ok) {
                        throw new Error('Network response was not ok');
                    }
                    return response.json();
                })
                .then(data => {
                    // Handle success
                    console.log('Success:', data);
                })
                .catch(error => {
                    // Handle error
                    console.error('Error:', error);
                });
        });
    });


    //GET OrderItems
    function fetchOrders() {
        fetch(`/api/OrderItem/?columnName=orderid&columnValue=${orderId}`)
            .then(response => {
                if (!response.ok) {
                    throw new Error('Network response was not ok');
                }
                return response.json();
            })
            .then(data => {
                // Work with the JSON data retrieved from the endpoint
                const ordersContainer = document.getElementById('ordersContainer');

                // Clear existing content
                ordersContainer.innerHTML = '';

                // Iterate over the data and append to the container
                data.forEach(order => {
                    const orderElement = document.createElement('div');
                    orderElement.textContent = `Quantity: ${order.quantity} FoodId:${order.foodId}, OrderId: ${order.orderId}`;
                    ordersContainer.appendChild(orderElement);
                });
            })
            console.log()
            .catch(error => {
                console.error('There was a problem with the fetch operation:', error);
            });
    }



    document.getElementById('confirmorder').addEventListener('click', function () {


        const itemIdToUpdate = orderId; // Example item ID to update
        const updatedData = {
            id : orderId,
            guest : guest,
            table : table,
            waiterId : waiter,
            date : date,
            receitId : receit,
            confirmed : true,
            status : status
            // Example updated data for the item
            
            // Add other fields as needed
        };

        // Construct the URL targeting the specific item
        const url = `/api/Order/${itemIdToUpdate}`;

        // Prepare the request object
        const requestOptions = {
            method: 'PUT', // or 'PATCH' depending on the server's API
            headers: {
                'Content-Type': 'application/json', // Specify content type as JSON
                // Add any other headers if required
            },
            body: JSON.stringify(updatedData), // Convert data to JSON format
        };

        // Send the request
        fetch(url, requestOptions)
            .then(response => {
                if (!response.ok) {
                    throw new Error('Network response was not ok');
                }
                return response.json(); // Parse response JSON if needed
            })
            .then(data => {
                // Handle successful response (if required)
                console.log('Item updated successfully:', data);
            })
            .catch(error => {
                // Handle errors
                console.error('There was a problem updating the item:', error);
            });

        

    });

    // Attach an event listener to the button
    const refreshButton = document.getElementById('addtocart');
    refreshButton.addEventListener('click', fetchOrders);
    const refreshButton2 = document.getElementById('offcanvasbutton');
    refreshButton2.addEventListener('click', fetchOrders);
</script>




/**
 * 255颜色值转16进制颜色值
 * @param n 255颜色值
 * @returns hex 16进制颜色值
 */
export const toHex = (n) => `${n > 15 ? '' : 0}${n.toString(16)}`;

/**
 * 颜色对象转化为16进制颜色字符串
 * @param colorObj 颜色对象
 */
export const toHexString = (colorObj) => {
  const {
    r, g, b, a = 1,
  } = colorObj;
  return `#${toHex(r)}${toHex(g)}${toHex(b)}${a === 1 ? '' : toHex(Math.floor(a * 255))}`;
};
/**
 * 颜色对象转化为rgb颜色字符串
 * @param colorObj 颜色对象
 */
export const toRgbString = (colorObj) => {
  const { r, g, b } = colorObj;
  return `rgb(${r},${g},${b})`;
};

/**
 * 颜色对象转化为rgba颜色字符串
 * @param colorObj 颜色对象
 */
export const toRgbaString = (colorObj, n = 10000) => {
  const {
    r, g, b, a = 1,
  } = colorObj;
  return `rgba(${r},${g},${b},${Math.floor(a * n) / n})`;
};

/**
   * 16进制颜色字符串解析为颜色对象
   * @param color 颜色字符串
   * @returns
   */
export const parseHexColor = (color) => {
  let hex = color.slice(1);
  let a = 1;
  if (hex.length === 3) {
    hex = `${hex[0]}${hex[0]}${hex[1]}${hex[1]}${hex[2]}${hex[2]}`;
  }
  if (hex.length === 8) {
    a = parseInt(hex.slice(6), 16) / 255;
    hex = hex.slice(0, 6);
  }
  const bigint = parseInt(hex, 16);
  return {
    r: (bigint >> 16) & 255,
    g: (bigint >> 8) & 255,
    b: bigint & 255,
    a,
  };
};

/**
   * rgba颜色字符串解析为颜色对象
   * @param color 颜色字符串
   * @returns
   */
export const parseRgbaColor = (color) => {
  const arr = color.match(/(\d(\.\d+)?)+/g) || [];
  const res = arr.map((s) => parseInt(s, 10));
  return {
    r: res[0],
    g: res[1],
    b: res[2],
    a: parseFloat(arr[3]),
  };
};

/**
   * 颜色字符串解析为颜色对象
   * @param color 颜色字符串
   * @returns
   */
export const parseColorString = (color) => {
  if (color.startsWith('#')) {
    return parseHexColor(color);
  } if (color.startsWith('rgb')) {
    return parseRgbaColor(color);
  } if (color === 'transparent') {
    return parseHexColor('#00000000');
  }
  throw new Error(`color string error: ${color}`);
};

/**
   * 颜色字符串解析为各种颜色表达方式
   * @param color 颜色字符串
   * @returns
   */
export const getColorInfo = (color) => {
  const colorObj = parseColorString(color);
  const hex = toHexString(colorObj);
  const rgba = toRgbaString(colorObj);
  const rgb = toRgbString(colorObj);
  return {
    hex,
    rgba,
    rgb,
    rgbaObj: colorObj,
  };
};

/**
   * 16进制颜色字符串转化为rgba颜色字符串
   * @param hex 16进制颜色字符串
   * @returns rgba颜色字符串
   */
export const hexToRgba = (hex) => {
  const colorObj = parseColorString(hex);
  return toRgbaString(colorObj);
};

/**
   * rgba颜色字符串转化为16进制颜色字符串
   * @param rgba rgba颜色字符串
   * @returns 16进制颜色字符串
   */
export const rgbaToHex = (rgba) => {
  const colorObj = parseColorString(rgba);
  return toHexString(colorObj);
};
Step 1 : Download Link : https://docs.flutter.dev/get-started/install/macos/mobile-ios?tab=download
Step 2 : Paste UnZip file in Users/Apple/Development folder.
Step 3 : add this path to .zshenv file 
export PATH=/Users/apple/development/flutter/bin:$PATH
Step 4 : Run terminal Command flutter doctor
add_action('admin_menu', 'plt_hide_woocommerce_menus', 71);
function plt_hide_woocommerce_menus() {
	global $submenu , $menu;     
	remove_menu_page( 'themes.php' );
	remove_menu_page( 'plugins.php' );
// 	remove_menu_page( 'users.php' );
}


/* Add .pa-inline-buttons class to column or row */

.pa-inline-buttons .et_pb_button_module_wrapper {
    display: inline-block;
}

.pa-inline-buttons {
    text-align: center !important;
}
Here you can select "start on Search by date view" and get the link https://fareharbor.com/embeds/book/estacionautica/items/calendar/?full-items=yes

Please keep in mind this same link would show a large calendar when SBD option is not enabled on the dashb
 String paragraph = "bob ,,, %&*lonlaskhdfshkfhskfh,,@!~";
            String normalized = paragraph.replaceAll("[^a-zA-Z0-9]", " ");

// replacing multiple spaces with single space

 String normalized = paragraph.replaceAll("[ ]+", " ");
LOAD DATA INFILE 'C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/Employee_Details.csv' 
INTO TABLE  Employee_Details
FIELDS TERMINATED BY ','  
OPTIONALLY ENCLOSED BY '"'  
LINES TERMINATED BY '\r\n'   
IGNORE 1 ROWS  
SET Date= STR_TO_DATE(@Date, '%m/%d/%Y');  
LOAD DATA INFILE '{  [file_path]  /  [file_name].csv}'
INTO TABLE table_name
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
cat <<EOT >> ~/.bashrc
unset HTTP_PROXY
unset HTTPS_PROXY
EOT
cat <<EOT >> ~/.zshrc
unset HTTP_PROXY
unset HTTPS_PROXY
EOT
/* html code */

<div class="preloader-container">
     <div class="preloader">
         <img src="/wp-content/uploads/2024/03/logo-gif.gif" alt="Loading...">
         <span class="close-btn" onclick="closePreloader()">Visit</span>
    </div>
</div>

/* preloader */
.preloader-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgb(0 0 0 / 94%);
	display: flex;
	z-index: 9999;
	justify-content: center;
	align-items: center;
}
.preloader {
	width: 400px;
	height: 225px;
	position: relative;
	text-align: center;
}
.close-btn {
	position: relative;
	top: 30px;
	right: 0;
	left: 0;
	margin: auto !important;
	cursor: pointer;
	color: white;
	font-size: 30px;
	text-align: center;
	padding: 10px;
	background: green;
	width: 150px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #008000;
	transition: all ease 0.5s;
}

.close-btn:hover {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}
/* preloader */

// Function to close the preloader
function closePreloader() {
	document.querySelector('.preloader-container').style.display = 'none';
}
  //Challenge Solution - Part #2
  else if (digitalRead(sw2Pin) == HIGH) {
    delay(250);
    flipSwitch(sw2Pos);
  } 
  // Challenge Solution - Part #1
  // Cascading "if" statement to turn switches "ON" if they are "OFF"
  // The PULLUP configuration means that a "LOW" signal equals the switch being "ON",
  // while a "HIGH" signal equals the switch being in the "OFF" position
  if (digitalRead(sw1Pin) == HIGH) {
    delay(250);
    flipSwitch(sw1Pos);
  } 
star

Sun Mar 24 2024 00:57:00 GMT+0000 (Coordinated Universal Time)

@SkyFragment

star

Sat Mar 23 2024 21:49:49 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/dark-light-mode-toggle-javascript-javascript/6512e47034967700139f79ad

@DKMitt #bootstrap #javascript #toggle

star

Sat Mar 23 2024 21:46:11 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/bootstrap-4-6-0-the-default-breakpoints-css/64bba96cef21fa0013a53a7d

@DKMitt #bootstrap

star

Sat Mar 23 2024 21:43:32 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/carousel-bootstrap-v5-2/6366e1c243f3120015119587

@DKMitt #bootstrap #carousel

star

Sat Mar 23 2024 21:41:55 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/150-bootstrap-navbar-examples-free-generator-creator-html/639e04f3a245070015bd15ac

@DKMitt #bootstrap #navbar

star

Sat Mar 23 2024 20:59:38 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/chatgpt-prompt-frameworks-or-the-rundown-ai/65e9fee7cebeb800146f2a89

@DKMitt #chatgpt #prompt's

star

Sat Mar 23 2024 20:54:01 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/dynamic-copyright-footer/65faf918999e0a001433ac25

@DKMitt #api's #javascript

star

Sat Mar 23 2024 20:51:53 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/doc-to-pdf-conversion-api-data/65fdb54b05080e0014aed7ba

@DKMitt

star

Sat Mar 23 2024 20:32:16 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/images-bootstrap-center/638e2bcf80f66300158ca522

@DKMitt #bootstrap

star

Sat Mar 23 2024 16:04:56 GMT+0000 (Coordinated Universal Time)

@chachou #java

star

Sat Mar 23 2024 13:53:29 GMT+0000 (Coordinated Universal Time) https://darkwebmarketbuyer.com/product/red-xanax-bar/

@darkwebmarket

star

Sat Mar 23 2024 13:37:44 GMT+0000 (Coordinated Universal Time)

@SkyFragment

star

Sat Mar 23 2024 12:50:31 GMT+0000 (Coordinated Universal Time)

@manhmd

star

Sat Mar 23 2024 11:05:57 GMT+0000 (Coordinated Universal Time)

@SkyFragment

star

Sat Mar 23 2024 09:51:44 GMT+0000 (Coordinated Universal Time) <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />

@codeing

star

Sat Mar 23 2024 07:05:44 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/problems/first-negative-integer-in-every-window-of-size-k3345/1

@akshay@999 #sliding

star

Sat Mar 23 2024 05:44:43 GMT+0000 (Coordinated Universal Time)

@SkyFragment

star

Fri Mar 22 2024 22:11:54 GMT+0000 (Coordinated Universal Time)

@abdul_rehman #java

star

Fri Mar 22 2024 18:41:13 GMT+0000 (Coordinated Universal Time) https://darkwebmarketbuyer.com/product/cake-delta-8-510-cartridge-2g/

@darkwebmarket

star

Fri Mar 22 2024 18:03:52 GMT+0000 (Coordinated Universal Time) https://docs.snowflake.com/en/sql-reference/functions/contains

@rosasoracio

star

Fri Mar 22 2024 16:44:48 GMT+0000 (Coordinated Universal Time) https://apyhub.com/utility/converter-rss-json

@apysohail #api #data

star

Fri Mar 22 2024 16:43:55 GMT+0000 (Coordinated Universal Time) https://apyhub.com/utility/converter-doc-pdf

@apysohail #api #data

star

Fri Mar 22 2024 16:42:46 GMT+0000 (Coordinated Universal Time) https://apyhub.com/utility/bar-graph

@apysohail #api #data

star

Fri Mar 22 2024 16:42:45 GMT+0000 (Coordinated Universal Time) https://apyhub.com/utility/bar-graph

@apysohail #api #data

star

Fri Mar 22 2024 16:41:45 GMT+0000 (Coordinated Universal Time) https://apyhub.com/utility/generate-qr-code

@apysohail #api #data

star

Fri Mar 22 2024 16:40:29 GMT+0000 (Coordinated Universal Time) https://apyhub.com/utility/analyse-keywords

@apysohail #api #data

star

Fri Mar 22 2024 16:37:26 GMT+0000 (Coordinated Universal Time) http://34.74.16.180:3000/question#eyJkYXRhc2V0X3F1ZXJ5Ijp7InR5cGUiOiJuYXRpdmUiLCJuYXRpdmUiOnsiY29sbGVjdGlvbiI6ImNsaW5pY3MiLCJxdWVyeSI6IltcclxuICAgIHtcclxuICAgICAgICBcIiRtYXRjaFwiOiB7XHJcbiAgICAgICAgICAgIFwicGFydG5lclNob3J0Q29kZVwiOiB7XHJcbiAgICAgICAgICAgICAgICBcIiRpblwiOiBbXVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfSxcclxuICAgIHtcclxuICAgICAgICBcIiRncm91cFwiOiB7XHJcbiAgICAgICAgICAgIFwiX2lkXCI6IFwiJHBhcnRuZXJTaG9ydENvZGVcIixcclxuICAgICAgICAgICAgXCJjbGluaWNzXCI6IHtcclxuICAgICAgICAgICAgICAgIFwiJHB1c2hcIjoge1xyXG4gICAgICAgICAgICAgICAgICAgIFwiY2xpbmljTmFtZVwiOiBcIiRuYW1lXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgXCJjbGluaWNJZFwiOiBcIiRfaWRcIlxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfSxcclxuICAgIHtcclxuICAgICAgICBcIiRwcm9qZWN0XCI6IHtcclxuICAgICAgICAgICAgX2lkOjAsXHJcbiAgICAgICAgICAgIFwicGFydG5lclNob3J0Q29kZVwiOiBcIiRfaWRcIixcclxuICAgICAgICAgICAgXCJjbGluaWNzXCI6IDFcclxuICAgICAgICB9XHJcbiAgICB9XHJcbl1cclxuIiwidGVtcGxhdGUtdGFncyI6e319LCJkYXRhYmFzZSI6Mn0sImRpc3BsYXkiOiJ0YWJsZSIsInZpc3VhbGl6YXRpb25fc2V0dGluZ3MiOnt9fQ==

@CodeWithSachin #aggregation #mongodb #$push

star

Fri Mar 22 2024 15:17:21 GMT+0000 (Coordinated Universal Time)

@pablo1766

star

Fri Mar 22 2024 14:38:11 GMT+0000 (Coordinated Universal Time)

@MrSpongeHead

star

Fri Mar 22 2024 14:08:24 GMT+0000 (Coordinated Universal Time)

@MsRichards

star

Fri Mar 22 2024 13:59:31 GMT+0000 (Coordinated Universal Time)

@pablo1766

star

Fri Mar 22 2024 12:23:58 GMT+0000 (Coordinated Universal Time)

@Chinner #csv #cr #parse

star

Fri Mar 22 2024 12:09:04 GMT+0000 (Coordinated Universal Time) http://localhost/wordpress-cli/wp-admin/admin.php?page

@uvesh.admin

star

Fri Mar 22 2024 10:55:10 GMT+0000 (Coordinated Universal Time)

@pankaj

star

Fri Mar 22 2024 09:44:25 GMT+0000 (Coordinated Universal Time)

@knugen0839 #javascript #c# #html

star

Fri Mar 22 2024 09:20:25 GMT+0000 (Coordinated Universal Time) https://blog.51cto.com/u_12881709/6176760

@yangxudong #plain

star

Fri Mar 22 2024 07:02:08 GMT+0000 (Coordinated Universal Time)

@hasnat #flutter #dart

star

Fri Mar 22 2024 05:46:49 GMT+0000 (Coordinated Universal Time) https://www.programiz.com/cpp-programming/online-compiler/

@alexmanhol #c++

star

Thu Mar 21 2024 23:30:06 GMT+0000 (Coordinated Universal Time)

@hamzakhan123

star

Thu Mar 21 2024 19:24:29 GMT+0000 (Coordinated Universal Time) https://www.peeayecreative.com/how-to-place-two-divi-buttons-side-by-side-in-the-same-column/

@KaiTheKingRook

star

Thu Mar 21 2024 15:38:04 GMT+0000 (Coordinated Universal Time) https://darkwebmarketbuyer.com/product/gsm-data-receiver-skimmer-60m-model-name-number-v-2/

@darkwebmarket

star

Thu Mar 21 2024 13:12:59 GMT+0000 (Coordinated Universal Time)

@Shira

star

Thu Mar 21 2024 10:31:54 GMT+0000 (Coordinated Universal Time)

@hiimsa #java

star

Thu Mar 21 2024 07:28:52 GMT+0000 (Coordinated Universal Time) https://www.scaler.com/topics/import-csv-into-mysql/

@talaviyabhavik

star

Thu Mar 21 2024 07:27:45 GMT+0000 (Coordinated Universal Time) https://www.scaler.com/topics/import-csv-into-mysql/

@talaviyabhavik #sql #csv

star

Thu Mar 21 2024 06:37:51 GMT+0000 (Coordinated Universal Time)

@hardikraja #commandline #git

star

Wed Mar 20 2024 21:20:06 GMT+0000 (Coordinated Universal Time)

@nofil

star

Wed Mar 20 2024 20:56:14 GMT+0000 (Coordinated Universal Time)

@TechBox #c++

star

Wed Mar 20 2024 20:55:27 GMT+0000 (Coordinated Universal Time)

@TechBox #c++

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension