3 _EXEC="$(realpath "${0%/*}")"
4 . "$_EXEC/cgilite/cgilite.sh"
5 . "$_EXEC/cgilite/logging.sh"
6 . "$_EXEC/cgilite/storage.sh"
7 . "$_EXEC/cgilite/session.sh"
10 printf 'Content-Type: text/html; charset=utf-8\r\n\r\n'
11 "$_EXEC/cgilite/html-sh.sed" <<EOF
13 [meta name="viewport" content="width=device-width"]
14 [link rel="stylesheet" type="text/css" href="/invoices.css"]
18 [a "/invoices/" Invoices]
19 [a "/clients/" Clients]
20 [a "/senders/" Senders]
27 info="$(PATH "${PATH_INFO#http://*/}")"
29 which git && [ ! -d .git ] && {
31 mkdir -p clients/ invoices/ senders/
33 serverkey' >.gitignore
34 git add clients/ invoices/ senders/ .gitignore
35 git commit -m 'initialisation of invoice repo'
40 . "$_EXEC/cgilite/file.sh"
41 FILE "$_EXEC/invoices.css"
46 printf '[a .new href="/clients/%s" New]' "$(timeid)"
47 } | yield_page clients
51 edit_client "${info#/clients/}" |yield_page client
60 printf '[a .new href="/senders/%s" New]' "$(timeid)"
61 } | yield_page senders
65 edit_sender "${info#/senders/}" |yield_page sender
72 . "$_EXEC/invoices.sh"
73 { printf '[a .new href="/invoices/%s" New]' "$(timeid)"
75 } | yield_page invoices
78 . "$_EXEC/invoices.sh"
79 edit_invoice "${info#/invoices/}" |yield_page invoice
82 . "$_EXEC/invoices.sh"
86 . "$_EXEC/cgilite/file.sh"
88 FILE "${file#/}" application/pdf