1 # Copyright 2016, 2017 Paul Hänsch
3 # This file is part of Confetti.
5 # Confetti is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # Confetti is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Affero General Public License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with Confetti. If not, see <http://www.gnu.org/licenses/>.
22 color=session${session_n}_note${note_n}_color
23 unset c0 c1 c2 c3 c4 c5 c6 c7
25 if [ "$note_n" -eq 1 -o -n "${tpy[session${session_n}_note${note_n}]}" ]; then
26 printf '<input class="trailbtn" type="checkbox" checked="checked">'
28 printf '<input class="trailbtn" type="checkbox">'
31 _checked="$(validate "$tpy[$color]" '#(888|00A|0A0|0AA|A00|A0A|AA0)' '#FFF')"
33 <fieldset class="note trailbox">
34 <input class=color type=radio name="$color" value="#888" id=${color}_000 $(checked \#888)><label for=${color}_000></label>
35 <input class=color type=radio name="$color" value="#00A" id=${color}_001 $(checked \#00A)><label for=${color}_001></label>
36 <input class=color type=radio name="$color" value="#0A0" id=${color}_010 $(checked \#0A0)><label for=${color}_010></label>
37 <input class=color type=radio name="$color" value="#0AA" id=${color}_011 $(checked \#0AA)><label for=${color}_011></label>
38 <input class=color type=radio name="$color" value="#A00" id=${color}_100 $(checked \#A00)><label for=${color}_100></label>
39 <input class=color type=radio name="$color" value="#A0A" id=${color}_101 $(checked \#A0A)><label for=${color}_101></label>
40 <input class=color type=radio name="$color" value="#AA0" id=${color}_110 $(checked \#AA0)><label for=${color}_110></label>
41 <input class=color type=radio name="$color" value="#FFF" id=${color}_111 $(checked \#FFF)><label for=${color}_111></label>
42 <textarea name="session${session_n}_note${note_n}">${tpy[session${session_n}_note${note_n}]}</textarea>
50 sid=session${session_n}
52 if [ "$tpy[${sid}_sigset]" = pos ]; then
59 <input type=hidden name=$sid value=exists>
60 <input class="tab" type="checkbox" id=${sid}_open name="${sid}_open" value="checked" ${tpy[${sid}_open]}>
61 <label class="tab" for="${sid}_open">
62 <span class=no>${session_n}.</span><!--
63 --><span class=date>${tpy[${sid}_date]}</span><!--
64 --><input class="date" name="${sid}_date" value="${tpy[${sid}_date]}" placeholder="$(l10n date)"><!--
65 --><span class=therapist>${tpy[${sid}_therapist]}</span><!--
66 --><input class="therapist" name="${sid}_therapist" value="${tpy[${sid}_therapist]}" placeholder="$(l10n therapist)"><!--
67 --><span class=signature><input type="checkbox" name="${sid}_sigset" value="pos" $sigcheck></span>
70 <img class="dotmark ov" src="/therapies/${id%.tpy}_${sid}.png" alt="">
72 while [ -n "${tpy[session${session_n}_note${n}]+x}" ]; do
73 if [ -n "${tpy[session${session_n}_note${n}]}" ]; then
78 for n in $(seq 1 $((${x:-0} + 3)) ); do t_session_note $session_n $n; done
80 <button class="trailbtn" type="submit">$(l10n trailsave)</button>
81 <button class=delete type=submit name=delete_session value=${session_n}>$(l10n delete_session)</button>
87 n=1; while [ -n "${tpy[session${n}]}" ]; do
95 <fieldset class="tab">
96 <button class=no type=submit name=new_session value=$sid>+</button><!--
97 --><input class=date name=${sid}_date value="" placeholder="$(l10n date)" /><!--
98 --><input class=therapist name=${sid}_therapist value="" placeholder="$(l10n therapist)" /><!--
99 --><span class=signature><span></span>
100 <input type=hidden name="${sid}_note1" value="">
106 <h1>$(l10n therapy)</h1>
108 <div class="patient">
109 <h2>$client_name</h2>
110 <a href="?p=prescriptions&client=${id%%.*}.vcf">< $(l10n prescriptionlist)</a>
113 <div class="prescription">
114 <h2>$(l10n therapy_prescription)</h2>
115 <span class="insurance">${mpx[insurance]}</span>
116 <span class="date"><label>$(l10n date):</label>${mpx[date]}</span>
118 <label class="checkbox ${mpx[prescreviewed]:+checked}" for="prescreviewed">
119 $([ -n "${mpx[prescreviewed]}" ] && printf %s "$(l10n prescreviewed)" \
120 || printf %s "$(l10n prescreview)" )
123 ${mpx[prescno]:+<span class="prescno">$(l10n presc${mpx[prescno]})</span>}
124 ${mpx[grouptherapy]:+<span class="catalogue">$(l10n grouptherapy)</span>}
125 ${mpx[housecall]:+<span class="catalogue">$(l10n housecall)</span>}
126 ${mpx[report]:+<span class="catalogue">$(l10n report)</span>}
128 <ul>$(for n in '' {0..10}; do
129 [ -n "${mpx[remidy$n]}" ] && \
130 printf '<li>%s %s %s</li>' "${mpx[quantity$n]}" \
132 "${mpx[quantity_weekly$n]:+($mpx[quantity_weekly$n] $(l10n weekly))}"
135 ${mpx[indicator]:+<span class="indicator"><label>$(l10n indicator):</label>${mpx[indicator]}</span>}
136 ${mpx[icd10]:+<span class="icd10"> <label>$(l10n icd10):</label>${mpx[icd10]}</span>}
139 <label class='checkbox ${mpx[contribconfirm]:+checked}' for="addcontrib">
140 $([ -n "${mpx[contribconfirm]}" ] && printf %s "$(l10n contribconfirm)" ${mpx[contribconfirm]} \
141 || printf %s "$(l10n addcontrib)" )
145 <input class="tab" type="checkbox" id="indicator_reading">
146 <label class="tab" for="indicator_reading">$(l10n indicator_reading)</label>
147 <div class="tab">${mpx[indicator_reading]}</div>
150 <form id="report" method="POST" action="?action=update_therapy">
151 <input type="hidden" name="id" value="${id}">
153 <input class="stickynote" type="checkbox" name="c_stickynote" id="show_stickynote">
154 <fieldset class="stickynote">
155 <label for="show_stickynote">$(l10n notes)</label>
156 <h2>$(l10n notes)</h2>
157 <textarea name="stickynote">${tpy[stickynote]}</textarea>
158 <button type="submit">$(l10n save)</button>
161 <input class="stickynote" type="checkbox" name="c_timesheet" id="show_timesheet">
162 <fieldset class="stickynote">
163 <label for="show_timesheet">$(l10n timesheet)</label>
164 <h2>$(l10n timesheet)</h2>
166 <tr><th>$(l10n time_goal)</th><th>$(l10n time_actual)</th><th>$(l10n time_difference)</th></tr>
168 $(for n in '' {0..10}; do
169 printf '<tr><td><input type="number" name="tsgoal" value="%s"/></td>
170 <td><input type="number" name="tsactual" value="%s"/></td>
173 "$mpx[tsgoal${n}]" "$mpx[tsactual${n}]" "$((${mpx[tsgoal${n}]:-0} - ${mpx[tsactual${n}]:-0}))"
176 <button type="submit">$(l10n save)</button>
179 <!--input class="tab" type="checkbox" id="lookout">
180 <label class="tab" for="lookout">$(l10n indicator_reading)</label>
181 <div class="tab"><textarea name="lookout">${mpx[lookout]}</textarea -->
183 <label class="tab heading">
184 <span class=no>$(l10n number)</span><!--
185 --><span class=date>$(l10n date)</span><!--
186 --><span class=therapist>$(l10n therapist)</span><!--
187 --><span class=signature>$(l10n signature)</span>
193 _checked="$(validate "$tpy[penwidth]" '(4|12|36)' '4')"
195 <fieldset class="penwidth">
196 <input type="radio" name="penwidth" value="4" id="pw1" $(checked 4)><label for="pw2"></label>
197 <input type="radio" name="penwidth" value="12" id="pw2" $(checked 12)><label for="pw3"></label>
198 <input type="radio" name="penwidth" value="36" id="pw3" $(checked 36)><label for="pw1"></label>
202 _checked="$(validate "$tpy[color]" '#(0[0A]{2}|A00|A0A|AA0|FFF)' '#000')"
204 <fieldset class="color">
205 <input class="color" type="radio" name="color" value="#000" id="c000" $(checked \#000)><label for="c000"></label>
206 <input class="color" type="radio" name="color" value="#00A" id="c001" $(checked \#00A)><label for="c001"></label>
207 <input class="color" type="radio" name="color" value="#0A0" id="c010" $(checked \#0A0)><label for="c010"></label>
208 <input class="color" type="radio" name="color" value="#0AA" id="c011" $(checked \#0AA)><label for="c011"></label>
209 <input class="color" type="radio" name="color" value="#A00" id="c100" $(checked \#A00)><label for="c100"></label>
210 <input class="color" type="radio" name="color" value="#A0A" id="c101" $(checked \#A0A)><label for="c101"></label>
211 <input class="color" type="radio" name="color" value="#AA0" id="c110" $(checked \#AA0)><label for="c110"></label>
212 <input class="color" type="radio" name="color" value="#FFF" id="c111" $(checked \#FFF)><label for="c111"></label>
214 <img class="dotmark bg" src="?static=therapy_background.png" alt="WARNING: Background Image not available!">
215 <canvas id="canvas" class="dotmark ov" width="${bg_dim%x*}" height="${bg_dim#*x}"></canvas>
217 <input type=hidden id=image_serialize name=imagedata value="">
219 <button type="submit">$(l10n save)</button>
222 <span id="jsdebug" style="display: none; position: fixed; right:0; bottom:0">Debug</span>
224 <script type="text/javascript" src="?static=therapy_draw.js"></script>
227 # vi:set filetype=html: