mpxfile="$_DATA/prescriptions/${id%.tpy}.mpx"
client="$_DATA/vcard/${id%%.*}.vcf"
+identify "$_EXEC/static/therapy_background.png" \
+| sed -r 's;^.* ([0-9]+x[0-9]+) .*$;\1;' \
+| read bg_dim
+
card_N="$(sed -nr 's:^(N)(;[^"\:]+|;"[^"]+")*\:(.*)$:\3:gp' "$client")"
card_FN="$(sed -nr 's:^(FN)(;[^"\:]+|;"[^"]+")*\:(.*)$:\3:gp' "$client")"
card_NICK="$(sed -nr 's:^(NICKNAME)(;[^"\:]+|;"[^"]+")*\:(.*)$:\3:gp' "$client")"
mpx=()
cat "$mpxfile" |while read -r line; do
val="${line#*:}"
- mpx[${line%%:*}]="${val//\\n/$BR}"
+ mpx[${line%%:*}]="$(htmlsafe "${val//\\n/$BR}")"
done
tpy=()
cat "$tpyfile" |while read -r line; do
val="${line#*:}"
- tpy[${line%%:*}]="${val//\\n/$BR}"
+ tpy[${line%%:*}]="$(htmlsafe "${val//\\n/$BR}")"
done