frm - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of frm.php

  1. class App(customtkinter.CTk):
  2.  
  3.     def __init__(self):
  4.         super().__init__()
  5.  
  6.         # configure wnd =========================
  7.         self.title("Legion Quest Manager")
  8.         self.geometry(f"{1180}x{680}")
  9.  
  10.         # configure grid layout ==============
  11.         self.grid_columnconfigure(1, weight=1)
  12.         self.grid_columnconfigure((2, 3), weight=0)
  13.         self.grid_rowconfigure((0, 1, 2), weight=1)
  14.  
  15.         # create sidebar frame with widgets
  16.         self.sidebar_frame = customtkinter.CTkFrame(self, width=140, corner_radius=0)
  17.         self.sidebar_frame.grid(row=0, column=0, rowspan=4, sticky="nsew")
  18.         self.sidebar_frame.grid_rowconfigure(4, weight=1)
  19.         self.logo_label = customtkinter.CTkLabel(self.sidebar_frame, text="Quest Manager",
  20.                                                  font=customtkinter.CTkFont(size=20, weight="bold"))
  21.         self.logo_label.grid(row=0, column=0, padx=20, pady=(20, 10))
  22.         self.sidebar_button_1 = customtkinter.CTkButton(self.sidebar_frame, text="Create Quest")
  23.         self.sidebar_button_1.grid(row=1, column=0, padx=20, pady=10)
  24.         self.sidebar_button_2 = customtkinter.CTkButton(self.sidebar_frame, text="Edit Quest")
  25.         self.sidebar_button_2.grid(row=2, column=0, padx=20, pady=10)
  26.         self.sidebar_button_3 = customtkinter.CTkButton(self.sidebar_frame, text="Delete Quest")
  27.         self.sidebar_button_3.grid(row=3, column=0, padx=20, pady=10)
  28.         self.appearance_mode_label = customtkinter.CTkLabel(self.sidebar_frame, text="Appearance Mode:", anchor="w")
  29.         self.appearance_mode_label.grid(row=5, column=0, padx=20, pady=(10, 0))
  30.         self.appearance_mode_optionemenu = customtkinter.CTkOptionMenu(self.sidebar_frame,
  31.                                                                        values=["Light", "Dark", "System"], command=self.change_appearance_mode_event)
  32.         self.appearance_mode_optionemenu.grid(row=6, column=0, padx=20, pady=(10, 10))
  33.  
  34.         # create checkbox for actions
  35.         self.checkbox_frame = customtkinter.CTkFrame(self)
  36.         self.checkbox_frame.grid(row=0, column=3, padx=(20, 20), pady=(20, 0), sticky="nsew")
  37.         self.checkbox_label = customtkinter.CTkLabel(self.checkbox_frame, text="Select option's:", anchor="w")
  38.         self.checkbox_label.grid(row=1, column=0, pady=(20, 10), padx=20, sticky="n")
  39.         self.checkbox_1 = customtkinter.CTkCheckBox(master=self.checkbox_frame, text="Create Scripts")
  40.         self.checkbox_1.grid(row=2, column=0, pady=(20, 10), padx=20, sticky="n")
  41.         self.checkbox_2 = customtkinter.CTkCheckBox(master=self.checkbox_frame, text="Create DB")
  42.         self.checkbox_2.grid(row=3, column=0, pady=10, padx=20, sticky="n")
  43.         self.checkbox_3 = customtkinter.CTkCheckBox(master=self.checkbox_frame, text="Create Media")
  44.         self.checkbox_3.grid(row=4, column=0, pady=10, padx=20, sticky="n")
  45.  
  46.         # create start frame
  47.         self.start_frame = customtkinter.CTkFrame(self)
  48.         self.start_frame.grid(row=1, column=3, padx=(20, 20), pady=(20, 0), sticky="nsew")
  49.         self.start_button_1 = customtkinter.CTkButton(self.start_frame, text="Clear All")
  50.         self.start_button_1.grid(row=2, column=0, padx=20, pady=10)
  51.         self.start_button_2 = customtkinter.CTkButton(self.start_frame, text="GENERATE", command=self.generate)
  52.         self.start_button_2.grid(row=3, column=0, padx=20, pady=10)
  53.  
  54.         # create tabview
  55.         self.tabview = customtkinter.CTkTabview(self, width=750, height=500)
  56.         #self.tabview.grid(row=0, column=2, padx=(20, 0), pady=(2, 0), sticky="nsew")
  57.         self.tabview.add("Collect")
  58.         self.tabview.add("Kill")
  59.         self.tabview.add("Talk")
  60.         self.tabview.tab("Collect").grid_columnconfigure(0, weight=1)
  61.         self.tab2_frame = self.tabview.tab("Collect")
  62.         self.canvas = customtkinter.CTkCanvas(self.tab2_frame, width=750, height=560, borderwidth=0, background="#0000FF")
  63.         self.frame = tkinter.Frame(self.canvas,width=750, height=560, background="#00FF00")
  64.         self.frame.grid(row=0, column=0, rowspan=4, sticky="nsew")
  65.         self.frame.grid_rowconfigure(1, weight=1)
  66.         self.vsb = customtkinter.CTkScrollbar(self.tab2_frame, command=self.canvas.yview)
  67.         self.canvas.configure(yscrollcommand=self.vsb.set)
  68.         self.vsb.pack(side="right", fill="y")
  69.         self.canvas.pack( fill="both", expand=False)
  70.         self.canvas.create_window((0, 0), window=self.frame, anchor="nw",
  71.                                   tags="frame")
  72.  
  73.         self.frame.bind("<Configure>", self.onFrameConfigure)
  74.  
  75.         self.populate()
  76.         self.tabview.grid(row=0, column=2, padx=(20, 0), pady=(0, 0), sticky="nsew")
  77.         #self.tabview.tab("Collect").grid_columnconfigure(1, weight=1)  # configure grid of individual tabs
  78.         #self.tabview.tab("Collect").grid_columnconfigure((2, 3), weight=0)
  79.         #self.tabview.tab("Collect").grid_rowconfigure((0, 1, 2), weight=0)
  80.  
  81.         # ------------------ COLLECT -------------
  82.  
  83.  
  84.         # create textbox
  85.         self.textbox = customtkinter.CTkTextbox(self, height=100)
  86.         self.textbox.grid(row=1, column=2, padx=(20, 0), pady=(20, 0), sticky="nsew")
  87.         # dev info
  88.         self.developer = customtkinter.CTkLabel(self, text="Created by Kesatas @ Legion Online")
  89.         self.developer.grid(row=2, column=2, padx=(0, 0), pady=(0, 0), sticky="nsew")
  90.  
  91.         self.mainloop()
  92.  
  93.     def change_appearance_mode_event(self, new_appearance_mode: str):
  94.         customtkinter.set_appearance_mode(new_appearance_mode)
  95.    def populate(self):
  96.         self.collect_name_lable = customtkinter.CTkLabel(self.frame, text="Quest Name")
  97.         self.collect_name_lable.grid(row=0, column=0, padx=0, pady=0)
  98.         self.collect_name_input = customtkinter.CTkEntry(self.frame, placeholder_text="QNO_TEST_QUEST")
  99.         self.collect_name_input.grid(row=0, column=1, padx=0, pady=0)
  100.         self.collect_id_lable = customtkinter.CTkLabel(self.frame, text="Quest ID")
  101.         self.collect_id_lable.grid(row=1, column=0, padx=0, pady=0)
  102.         self.collect_id_input = customtkinter.CTkEntry(self.frame, placeholder_text="12345")
  103.         self.collect_id_input.grid(row=1, column=1, padx=0, pady=0)
  104.         self.collect_npc_lable = customtkinter.CTkLabel(self.frame, text="Npc Codename")
  105.         self.collect_npc_lable.grid(row=2, column=0, padx=0, pady=0)
  106.         self.collect_npc_input = customtkinter.CTkEntry(self.frame, placeholder_text="NPC_CH_SMITH")
  107.         self.collect_npc_input.grid(row=2, column=1, padx=0, pady=0)
  108.         self.collect_ritem_lable = customtkinter.CTkLabel(self.frame, text="Reward Item")
  109.         self.collect_ritem_lable.grid(row=3, column=0, padx=0, pady=0)
  110.         self.collect_ritem_input = customtkinter.CTkEntry(self.frame,
  111.                                                           placeholder_text="ITEM_MALL_GLOBAL_CHATTING")
  112.         self.collect_ritem_input.grid(row=3, column=1, padx=0, pady=0)
  113.         self.collect_ritemcount_lable = customtkinter.CTkLabel(self.frame, text="Reward's Amount")
  114.         self.collect_ritemcount_lable.grid(row=4, column=0, padx=0, pady=0)
  115.         self.collect_ritemcount_input = customtkinter.CTkEntry(self.frame, placeholder_text="20")
  116.         self.collect_ritemcount_input.grid(row=4, column=1, padx=0, pady=0)
  117.         self.collect_rexp_lable = customtkinter.CTkLabel(self.frame, text="Reward Exp")
  118.         self.collect_rexp_lable.grid(row=5, column=0, padx=0, pady=0)
  119.         self.collect_rexp_input = customtkinter.CTkEntry(self.frame, placeholder_text="12345")
  120.         self.collect_rexp_input.grid(row=5, column=1, padx=0, pady=0)
  121.         self.collect_rsp_lable = customtkinter.CTkLabel(self.frame, text="Reward Sp")
  122.         self.collect_rsp_lable.grid(row=6, column=0, padx=0, pady=0)
  123.         self.collect_rsp_input = customtkinter.CTkEntry(self.frame, placeholder_text="12345")
  124.         self.collect_rsp_input.grid(row=6, column=1, padx=0, pady=0)
  125.         self.collect_rgold_lable = customtkinter.CTkLabel(self.frame, text="Reward Gold")
  126.         self.collect_rgold_lable.grid(row=7, column=0, padx=0, pady=0)
  127.         self.collect_rgold_input = customtkinter.CTkEntry(self.frame, placeholder_text="12345")
  128.         self.collect_rgold_input.grid(row=7, column=1, padx=0, pady=0)
  129.         self.collect_level_input = customtkinter.CTkEntry(self.frame, placeholder_text="Lvl required")
  130.         self.collect_level_input.grid(row=8, column=1, padx=0, pady=0)
  131.         # requirements
  132.         self.collect_monster_lable_1 = customtkinter.CTkLabel(self.frame, text="Monster Codename 1")
  133.         self.collect_monster_lable_1.grid(row=9, column=0, padx=0, pady=0)
  134.         self.collect_monster_input_1 = customtkinter.CTkEntry(self.frame,
  135.                                                               placeholder_text="MOB_CH_MANGNYANG")
  136.         self.collect_monster_input_1.grid(row=9, column=1, padx=0, pady=0)
  137.         self.collect_monster_type_1 = customtkinter.CTkOptionMenu(self.frame, dynamic_resizing=False,
  138.                                                                   values=["Normal", "Champion", "Giant", "Unique"])
  139.         self.collect_monster_type_1.grid(row=9, column=2, padx=0, pady=(0, 0))
  140.         self.collect_qitem_lable_1 = customtkinter.CTkLabel(self.frame, text="Quest Item 1")
  141.         self.collect_qitem_lable_1.grid(row=10, column=0, padx=0, pady=0)
  142.         self.collect_qitem_input_1 = customtkinter.CTkEntry(self.frame,
  143.                                                             placeholder_text="ITEM_CH_BLAHBLAH")
  144.         self.collect_qitem_input_1.grid(row=10, column=1, padx=0, pady=0)
  145.         self.collect_qitem_rate_1 = customtkinter.CTkOptionMenu(self.frame, dynamic_resizing=False,
  146.                                                                 values=["rate 10%", "rate 25%", "rate 35%", "rate 50%",
  147.                                                                         "rate 75%", "rate 100%"])
  148.         self.collect_qitem_rate_1.grid(row=10, column=2, padx=0, pady=(0, 0))
  149.         self.collect_qitemcount_lable_1 = customtkinter.CTkLabel(self.frame, text="Items Required 1")
  150.         self.collect_qitemcount_lable_1.grid(row=11, column=0, padx=0, pady=0)
  151.         self.collect_qitemcount_input_1 = customtkinter.CTkEntry(self.frame,
  152.                                                                  placeholder_text="12345")
  153.         self.collect_qitemcount_input_1.grid(row=11, column=1, padx=0, pady=0)
  154.         self.collect_monster_lable_2 = customtkinter.CTkLabel(self.frame, text="Monster Codename 2")
  155.         self.collect_monster_lable_2.grid(row=12, column=0, padx=0, pady=0)
  156.         self.collect_monster_input_2 = customtkinter.CTkEntry(self.frame,
  157.                                                               placeholder_text="MOB_CH_MANGNYANG")
  158.         self.collect_monster_input_2.grid(row=12, column=1, padx=0, pady=0)
  159.         self.collect_monster_type_2 = customtkinter.CTkOptionMenu(self.frame, dynamic_resizing=False,
  160.                                                                   values=["Normal", "Champion", "Giant", "Unique"])
  161.         self.collect_monster_type_2.grid(row=12, column=2, padx=0, pady=(0, 0))
  162.         self.collect_qitem_lable_2 = customtkinter.CTkLabel(self.frame, text="Quest Item 2")
  163.         self.collect_qitem_lable_2.grid(row=13, column=0, padx=0, pady=0)
  164.         self.collect_qitem_input_2 = customtkinter.CTkEntry(self.frame,
  165.                                                             placeholder_text="ITEM_CH_BLAHBLAH")
  166.         self.collect_qitem_input_2.grid(row=13, column=1, padx=0, pady=0)
  167.         self.collect_qitem_rate_2 = customtkinter.CTkOptionMenu(self.frame, dynamic_resizing=False,
  168.                                                                 values=["rate 10%", "rate 25%", "rate 35%", "rate 50%",
  169.                                                                         "rate 75%", "rate 100%"])
  170.         self.collect_qitem_rate_2.grid(row=13, column=2, padx=0, pady=(0, 0))
  171.         self.collect_qitemcount_lable_2 = customtkinter.CTkLabel(self.frame, text="Items Required 2")
  172.         self.collect_qitemcount_lable_2.grid(row=14, column=0, padx=0, pady=0)
  173.         self.collect_qitemcount_input_2 = customtkinter.CTkEntry(self.frame,
  174.                                                                  placeholder_text="12345")
  175.         self.collect_qitemcount_input_2.grid(row=14, column=1, padx=0, pady=0)
  176.         self.collect_monster_lable_3 = customtkinter.CTkLabel(self.frame, text="Monster Codename 3")
  177.         self.collect_monster_lable_3.grid(row=15, column=0, padx=0, pady=0)
  178.         self.collect_monster_input_3 = customtkinter.CTkEntry(self.frame,
  179.                                                               placeholder_text="MOB_CH_MANGNYANG")
  180.         self.collect_monster_input_3.grid(row=15, column=1, padx=0, pady=0)
  181.         self.collect_monster_type_3 = customtkinter.CTkOptionMenu(self.frame, dynamic_resizing=False,
  182.                                                                   values=["Normal", "Champion", "Giant", "Unique"])
  183.         self.collect_monster_type_3.grid(row=15, column=2, padx=0, pady=(0, 0))
  184.         self.collect_qitem_lable_3 = customtkinter.CTkLabel(self.frame, text="Quest Item 3")
  185.         self.collect_qitem_lable_3.grid(row=16, column=0, padx=0, pady=0)
  186.         self.collect_qitem_input_3 = customtkinter.CTkEntry(self.frame,
  187.                                                             placeholder_text="ITEM_CH_BLAHBLAH")
  188.         self.collect_qitem_input_3.grid(row=16, column=1, padx=0, pady=0)
  189.         self.collect_qitem_rate_3 = customtkinter.CTkOptionMenu(self.frame, dynamic_resizing=False,
  190.                                                                 values=["rate 10%", "rate 25%", "rate 35%", "rate 50%",
  191.                                                                         "rate 75%", "rate 100%"])
  192.         self.collect_qitem_rate_3.grid(row=16, column=2, padx=0, pady=(0, 0))
  193.         self.collect_qitemcount_lable_2 = customtkinter.CTkLabel(self.frame, text="Items Required 3")
  194.         self.collect_qitemcount_lable_2.grid(row=17, column=0, padx=0, pady=0)
  195.         self.collect_qitemcount_input_2 = customtkinter.CTkEntry(self.frame,
  196.                                                                  placeholder_text="12345")
  197.         self.collect_qitemcount_input_2.grid(row=17, column=1, padx=0, pady=0)
  198.  
  199.         self.collect_qitemcount_lable_6 = customtkinter.CTkLabel(self.frame, text="Items Required 1")
  200.         self.collect_qitemcount_lable_6.grid(row=18, column=0, padx=0, pady=0)
  201.         self.collect_qitemcount_lable_7 = customtkinter.CTkLabel(self.frame, text="Items Required 1")
  202.         self.collect_qitemcount_lable_7.grid(row=19, column=0, padx=0, pady=0)
  203.         self.collect_qitemcount_lable_8 = customtkinter.CTkLabel(self.frame, text="Items Required 1")
  204.         self.collect_qitemcount_lable_8.grid(row=20, column=0, padx=0, pady=0)
  205.         self.collect_qitemcount_lable_9 = customtkinter.CTkLabel(self.frame, text="Items Required 1")
  206.         self.collect_qitemcount_lable_9.grid(row=21, column=0, padx=0, pady=0)
  207.  
  208.     def onFrameConfigure(self, event):
  209.         '''Reset the scroll region to encompass the inner frame'''
  210.         self.canvas.configure(scrollregion=self.canvas.bbox("all"))
File Description
  • frm
  • PHP Code
  • 03 Feb-2023
  • 14.88 Kb
You can Share it: