Mercurial > hg > batmud > misc
changeset 367:02bacce48be0 misc
Update and fix prices calculator slightly, the extra field was not displayed
for services2 array.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 18 Aug 2022 03:28:50 +0300 |
parents | b74c3b9e2339 |
children | 0416ede8f5c8 |
files | prices.config.php prices.php |
diffstat | 2 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/prices.config.php Thu May 12 13:00:12 2022 +0300 +++ b/prices.config.php Thu Aug 18 03:28:50 2022 +0300 @@ -107,12 +107,12 @@ ], "surg80" => [ "name" => "Surgery to 80%", - "subj" => "item", + "subj" => "patient", "price" => 10000, ], "surg100" => [ "name" => "Surgery to 100", - "subj" => "item", + "subj" => "patient", "price" => 15000, ], "mip" => [
--- a/prices.php Thu May 12 13:00:12 2022 +0300 +++ b/prices.php Thu Aug 18 03:28:50 2022 +0300 @@ -184,7 +184,7 @@ { foreach ($services1_prices as $key => $item) { - $s = isset($item["extra"]) ? $item["extra"] : ""; + $extra = isset($item["extra"]) ? $item["extra"] : ""; echo " <tr>\n". " <th>".$item["name"]."</th>\n". @@ -193,17 +193,17 @@ " <th class=\"hide\"></th>\n". " </tr>\n". " <tr><td>1-".($item["tresh"]-1)." ".$item["subj"]."s</td>". - "<td>".convPrice($item["price1"])." / ".$item["subj"].$s."</td>". + "<td>".convPrice($item["price1"])." / ".$item["subj"].$extra."</td>". "<td>-</td><td class=\"hide\"></td></tr>\n". " <tr><td>".$item["tresh"]."+ ".$item["subj"]."s</td><td>"; if (isset($item["base"])) { - echo convPrice($item["base"])." initial fee + ".convPrice($item["price2"])." / ".$item["subj"].$s; + echo convPrice($item["base"])." initial fee + ".convPrice($item["price2"])." / ".$item["subj"].$extra; } else { - echo convPrice($item["price2"])." / ".$item["subj"].$s; + echo convPrice($item["price2"])." / ".$item["subj"].$extra; } echo "</td><td>".getField($key)."</td>"; @@ -234,9 +234,11 @@ foreach ($services2_prices as $key => $item) { + $extra = isset($item["extra"]) ? $item["extra"] : ""; echo " <tr><td>".$item["name"]."</td>". - "<td>".convPrice($item["price"])." / ".$item["subj"]."</td>". + "<td>".convPrice($item["price"])." / ".$item["subj"].$extra. + "</td>". "<td>".getField($key)."</td>"; if (isset($item["extra"]))