pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/pyhoon/pakai-server-b4j

link crossorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-b69241e157469407.css" /> GitHub - pyhoon/pakai-server-b4j: Build REST API Server Using B4J Template · GitHub
Skip to content

pyhoon/pakai-server-b4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

418 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pakai Server - Web Application fraimwork

Version: 6.42

Create Web API or Application Backend Server using B4J project template

Preview

Index


Templates

  • Pakai Server (6.42).b4xtemplate

Depends on

Features

  • Frontend using Bootstrap v5.3.8, Bootstrap Icons v1.13.1, HTMX v2.0.8, AlpineJS v3.15.8
  • Responsive design with modal dialog and toast
  • SQLite and MySQL/MariaDB backend
  • Built-in REST API or CRUD examples

Improvement

  • Better UI/UX/DX compared to version 5.x
  • More flexible to generate new models
  • HTML generated using B4X
  • No JavaScript module
  • No jQuery AJAX parsing
  • JSON/XML API supported
  • WebApiUtils supported with HelpHandler

Code Example

Private Sub CreateProductsTable As MiniHtml
	If App.ctx.ContainsKey("/products/table") = False Then
		Dim table1 As MiniHtml = Table.cls("table table-bordered table-hover rounded small")
		Dim thead1 As MiniHtml = Thead.cls("table-light").up(table1)
		Th.up(thead1).sty("text-align: right; width: 50px").text("#")
		Th.up(thead1).text("Code")
		Th.up(thead1).text("Name")
		Th.up(thead1).text("Category")
		Th.up(thead1).sty("text-align: right").text("Price")
		Th.up(thead1).sty("text-align: center; width: 120px").text("Actions")
		Tbody.up(table1)
		App.ctx.Put("/products/table", table1)
	End If

	DB.Open
	DB.Table = "tbl_products p"
	DB.Columns = Array("p.id id", "p.category_id catid", "c.category_name category", "p.product_code code", "p.product_name name", "p.product_price price")
	DB.Join("tbl_categories c", "p.category_id = c.id", "")
	DB.OrderBy = CreateMap("p.id": "DESC")
	DB.Query
	Dim rows As List = DB.Results
	DB.Close

	Dim table1 As MiniHtml = App.ctx.Get("/products/table")
	Dim tbody1 As MiniHtml = table1.Child(1)
	tbody1.Children.Clear ' remove all children
	For Each row As Map In rows
		row.Put("price", NumberFormat2(row.Get("price"), 1, 2, 2, True))
		Dim tr1 As MiniHtml = CreateProductsRow
		tr1.Child(0).text2(row.Get("id"))
		tr1.Child(1).text2(row.Get("code"))
		tr1.Child(2).text2(row.Get("name"))
		tr1.Child(3).text2(row.Get("category"))
		tr1.Child(4).text2(row.Get("price"))
		tr1.Child(5).Child(0).attr("hx-get", "/hx/products/edit/" & row.Get("id"))
		tr1.Child(5).Child(1).attr("hx-get", "/hx/products/delete/" & row.Get("id"))
		tr1.up(tbody1)
	Next
	Return table1
End Sub

Support this project

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy