[{"Id":11262,"Author":{"Name":"Lyle Seaman","FirstName":"Lyle","ShortDescription":"networking, security infra and filesystems kernel hacker turned application programmer, SRE and engineering manager, Lyle traded tilting at windmills for viking at Vikings but couldn\u0027t catch any.","DescriptionHtml":null,"Slug":"lyle-seaman","IsAdmin":true,"IsActive":true,"ImageUrl":"/images/imageslws/viking.jpg"},"Status":"Published","SummaryHtml":"\u003cp\u003eAstute readers noticed last week that this editor (that is to say, me) had his own error\u0026#39;d failure to remember what day it was. Thank you for pointing it out promptly, and then proceeding to send in a bunch of examples of \u003cem\u003eother\u003c/em\u003e sites calendar failures.  Misery loves company!\u003c/p\u003e\n\n\u003cp\u003eTraveler\u0026#39;s travails, from\n\u003cstrong\u003eC_Chell\u003c/strong\u003e \n\u0026#34;Trying to complete the form on https://www.ihg.com to tell when\nI plan to arrive at the hotel, I can\u0026#39;t complete\nthe form because of this little time problem.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003c/blockquote\u003e","BodyHtml":"\u003cp\u003eAstute readers noticed last week that this editor (that is to say, me) had his own error\u0026#39;d failure to remember what day it was. Thank you for pointing it out promptly, and then proceeding to send in a bunch of examples of \u003cem\u003eother\u003c/em\u003e sites calendar failures.  Misery loves company!\u003c/p\u003e\n\n\u003cp\u003eTraveler\u0026#39;s travails, from\n\u003cstrong\u003eC_Chell\u003c/strong\u003e \n\u0026#34;Trying to complete the form on https://www.ihg.com to tell when\nI plan to arrive at the hotel, I can\u0026#39;t complete\nthe form because of this little time problem.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#06036a0253dc4d61b4bd648ab59c2dae\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"06036a0253dc4d61b4bd648ab59c2dae\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/30/06036a0253dc4d61b4bd648ab59c2dae.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003e\u0026#34;You Have -1 Month(s) To Order!\u0026#34; announces \n\u003cstrong\u003edragoncoder047\u003c/strong\u003e.\n\u0026#34;Ah, GradImages... the company that told all graduates that they\u0026#39;d\nget a free 5x7 but tried to charge me for\nit, then refused to honor my \u0026#34;unsubscribe\u0026#34; request and is\n*still* emailing me to this day... Can\u0026#39;t do date math?\nPar for the course.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#1820ae48b9df4a759ffbde45a8c715e0\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"1820ae48b9df4a759ffbde45a8c715e0\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/30/1820ae48b9df4a759ffbde45a8c715e0.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003e\u0026#34;Stansted Temporal UI design\u0026#34; shared by \n\u003cstrong\u003eMichael R.\u003c/strong\u003e\n\u0026#34;While waiting for a friend to arrive at Stansted I\nsee this. I better fire up the DeLorean to pick\nher up at 00:06 tomorrow.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#8fa526db89fe46d88d6d2597fe0fa3ae\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"8fa526db89fe46d88d6d2597fe0fa3ae\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/30/8fa526db89fe46d88d6d2597fe0fa3ae.jpeg\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\u003cp\u003eWhile he was hunting through the website, \n\u003cstrong\u003eMichael R.\u003c/strong\u003e also found that\n\u0026#34;The Stansted airport website seems to suffer from Directional Confusion.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#89c37786ca724e82868eaab4f7285fcf\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"89c37786ca724e82868eaab4f7285fcf\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/30/89c37786ca724e82868eaab4f7285fcf.jpeg\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003eNothing wrong with the calendar here, but \n\u003cstrong\u003eSlaoput\u003c/strong\u003e simply opposes mandatory existence. \n\u0026#34;I was filling out a form that said the Birthdate\nis optional, but when I hit submit I found out\nit was required. (I guess technically you have to be\nborn to fill out the form.)\u0026#34;\n\u003cbr/\u003e\u003cb\u003eNOT\u003c/b\u003e TO BE!\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#8bf00b3dc8ae4ca19481b42b9e63d0f4\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"8bf00b3dc8ae4ca19481b42b9e63d0f4\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/30/8bf00b3dc8ae4ca19481b42b9e63d0f4.jpeg\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n","BodyAndAdHtml":"\u003cp\u003eAstute readers noticed last week that this editor (that is to say, me) had his own error\u0026#39;d failure to remember what day it was. Thank you for pointing it out promptly, and then proceeding to send in a bunch of examples of \u003cem\u003eother\u003c/em\u003e sites calendar failures.  Misery loves company!\u003c/p\u003e\n\n\u003cp\u003eTraveler\u0026#39;s travails, from\n\u003cstrong\u003eC_Chell\u003c/strong\u003e \n\u0026#34;Trying to complete the form on https://www.ihg.com to tell when\nI plan to arrive at the hotel, I can\u0026#39;t complete\nthe form because of this little time problem.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#06036a0253dc4d61b4bd648ab59c2dae\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"06036a0253dc4d61b4bd648ab59c2dae\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/30/06036a0253dc4d61b4bd648ab59c2dae.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003e\u0026#34;You Have -1 Month(s) To Order!\u0026#34; announces \n\u003cstrong\u003edragoncoder047\u003c/strong\u003e.\n\u0026#34;Ah, GradImages... the company that told all graduates that they\u0026#39;d\nget a free 5x7 but tried to charge me for\nit, then refused to honor my \u0026#34;unsubscribe\u0026#34; request and is\n*still* emailing me to this day... Can\u0026#39;t do date math?\nPar for the course.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#1820ae48b9df4a759ffbde45a8c715e0\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"1820ae48b9df4a759ffbde45a8c715e0\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/30/1820ae48b9df4a759ffbde45a8c715e0.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003e\u0026#34;Stansted Temporal UI design\u0026#34; shared by \n\u003cstrong\u003eMichael R.\u003c/strong\u003e\n\u0026#34;While waiting for a friend to arrive at Stansted I\nsee this. I better fire up the DeLorean to pick\nher up at 00:06 tomorrow.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#8fa526db89fe46d88d6d2597fe0fa3ae\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"8fa526db89fe46d88d6d2597fe0fa3ae\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/30/8fa526db89fe46d88d6d2597fe0fa3ae.jpeg\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\u003cp\u003eWhile he was hunting through the website, \n\u003cstrong\u003eMichael R.\u003c/strong\u003e also found that\n\u0026#34;The Stansted airport website seems to suffer from Directional Confusion.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#89c37786ca724e82868eaab4f7285fcf\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"89c37786ca724e82868eaab4f7285fcf\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/30/89c37786ca724e82868eaab4f7285fcf.jpeg\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003eNothing wrong with the calendar here, but \n\u003cstrong\u003eSlaoput\u003c/strong\u003e simply opposes mandatory existence. \n\u0026#34;I was filling out a form that said the Birthdate\nis optional, but when I hit submit I found out\nit was required. (I guess technically you have to be\nborn to fill out the form.)\u0026#34;\n\u003cbr/\u003e\u003cb\u003eNOT\u003c/b\u003e TO BE!\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#8bf00b3dc8ae4ca19481b42b9e63d0f4\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"8bf00b3dc8ae4ca19481b42b9e63d0f4\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/30/8bf00b3dc8ae4ca19481b42b9e63d0f4.jpeg\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\u003cdiv\u003e\n\t[Advertisement] Picking up \u003cb\u003eNuGet\u003c/b\u003e is easy. Getting good at it takes time. \u003ca href=\"https://inedo.com/support/whitepapers/nuget-guide?utm_source=tdwtf\u0026amp;utm_medium=Footerad\u0026amp;utm_campaign=nuget\"\u003eDownload our guide to learn the best practice of NuGet for the Enterprise.\u003c/a\u003e\n\n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e","Title":"Good Time","RssTitle":"Error\u0027d: Good Time","CachedCommentCount":13,"LastCommentDate":"\/Date(1788579709270)\/","LastCommentDateDescription":"2026-09-05","DiscourseTopicId":null,"DiscourseTopicOpened":false,"PublishedDate":"\/Date(1788503400000)\/","ISODate":"2026-09-04","DisplayDate":"2026-09-04","Series":{"Slug":"errord","Title":"Error\u0027d","Description":"Error\u0027d features fun error messages and other visual oddities from the world of IT.","CssClass":"errord"},"FooterAdHtml":"\u003cdiv\u003e\n\t[Advertisement] Picking up \u003cb\u003eNuGet\u003c/b\u003e is easy. Getting good at it takes time. \u003ca href=\"https://inedo.com/support/whitepapers/nuget-guide?utm_source=tdwtf\u0026amp;utm_medium=Footerad\u0026amp;utm_campaign=nuget\"\u003eDownload our guide to learn the best practice of NuGet for the Enterprise.\u003c/a\u003e\n\n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e","Url":"https://thedailywtf.com/articles/good-time","CommentsUrl":"https://thedailywtf.com/articles/comments/good-time","Slug":"good-time","TwitterUrl":"//www.twitter.com/home?status=https%3a%2f%2fthedailywtf.com%2farticles%2fgood-time+-+Good+Time+-+The+Daily+WTF","FacebookUrl":"//www.facebook.com/sharer.php?u=https%3a%2f%2fthedailywtf.com%2farticles%2fgood-time\u0026t=Good+Time+-+The+Daily+WTF","EmailUrl":"mailto:%20?subject=Check%20out%20this%20article%20on%20The%20Daily%20WTF...\u0026body=Good%20Time:%20https://thedailywtf.com/articles/good-time","GooglePlusUrl":"//plus.google.com/share?url=https%3a%2f%2fthedailywtf.com%2farticles%2fgood-time","PreviousArticleId":11265,"PreviousArticleTitle":"Heating Up","PreviousArticleSlug":"heating-up","PreviousArticleUrl":"//thedailywtf.com/articles/heating-up","NextArticleId":null,"NextArticleTitle":null,"NextArticleSlug":null,"NextArticleUrl":"//thedailywtf.com/articles/"},{"Id":11265,"Author":{"Name":"Remy Porter","FirstName":"Remy","ShortDescription":"Computers were a mistake, so I accidentally became a farmer? Editor-in-Chief for TDWTF.","DescriptionHtml":"\u003cp\u003eRemy is a veteran developer who writes software for farming robots. They pick tomatoes.\u003c/p\u003e\r\n\u003cp\u003eHe\u0027s often on stage, doing improv comedy, but insists that \u003cem\u003ehe\u003c/em\u003e isn\u0027t doing comedy- it\u0027s deadly serious. You\u0027re laughing at him, not with him. That, by the way, is usually true- you\u0027re laughing at him, not with him.\u003c/p\u003e","Slug":"remy-porter","IsAdmin":true,"IsActive":true,"ImageUrl":"https://s3.amazonaws.com/remy.jetpackshark.com/remy-thumb.jpg"},"Status":"Published","SummaryHtml":"\u003cp\u003eA common option for retrofitting heating and cooling into older homes is a mini-split, frequently tied to a heat pump. They\u0026#39;re (relatively) cheap to install, energy efficient, and can be added without substantial modifications to the home. They also, annoyingly, are mostly controlled via IR remotes, making them challenging to wire up to home automation or even a household thermostat.\u003c/p\u003e\n\u003cp\u003ePeople have made solutions, and today\u0026#39;s code comes from one of those solutions. Which, I want to stress, this code comes from an open source project for home automation, so it\u0026#39;s not \u003cem\u003ethe code\u003c/em\u003e that\u0026#39;s wrong, here. At first I thought it was, and had a moment of, \u0026#34;I\u0026#39;m not going to pick on some hobby project,\u0026#34; but then I realised the hobby project points at a deeper issue.\u003c/p\u003e\n","BodyHtml":"\u003cp\u003eA common option for retrofitting heating and cooling into older homes is a mini-split, frequently tied to a heat pump. They\u0026#39;re (relatively) cheap to install, energy efficient, and can be added without substantial modifications to the home. They also, annoyingly, are mostly controlled via IR remotes, making them challenging to wire up to home automation or even a household thermostat.\u003c/p\u003e\n\u003cp\u003ePeople have made solutions, and today\u0026#39;s code comes from one of those solutions. Which, I want to stress, this code comes from an open source project for home automation, so it\u0026#39;s not \u003cem\u003ethe code\u003c/em\u003e that\u0026#39;s wrong, here. At first I thought it was, and had a moment of, \u0026#34;I\u0026#39;m not going to pick on some hobby project,\u0026#34; but then I realised the hobby project points at a deeper issue.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-cpp\"\u003e\u003cspan class=\"hljs-comment\"\u003e// temperature helper these are direct mappings based on the remote\u003c/span\u003e\n\u003cspan class=\"hljs-function\"\u003e\u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e \u003cspan class=\"hljs-title\"\u003etoFahrenheit\u003c/span\u003e\u003cspan class=\"hljs-params\"\u003e(\u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e fromCelsius)\u003c/span\u003e \u003c/span\u003e{\n    \u003cspan class=\"hljs-comment\"\u003e// Lookup table for specific mappings\u003c/span\u003e\n    \u003cspan class=\"hljs-type\"\u003econst\u003c/span\u003e std::map\u0026lt;\u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e, \u003cspan class=\"hljs-type\"\u003eint\u003c/span\u003e\u0026gt; lookupTable = {\n        {\u003cspan class=\"hljs-number\"\u003e16.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e61\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e16.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e62\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e17.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e63\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e17.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e64\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e18.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e65\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e18.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e66\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e19.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e67\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e20.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e68\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e21.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e69\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e21.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e70\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e22.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e71\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e22.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e72\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e23.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e73\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e23.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e74\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e24.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e75\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e24.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e76\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e25.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e77\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e25.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e78\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e26.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e79\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e26.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e80\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e27.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e81\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e27.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e82\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e28.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e83\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e28.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e84\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e29.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e85\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e29.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e86\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e30.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e87\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e30.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e88\u003c/span\u003e}\n    };\n\n    \u003cspan class=\"hljs-comment\"\u003e// Check if the input is in the lookup table\u003c/span\u003e\n    \u003cspan class=\"hljs-keyword\"\u003eauto\u003c/span\u003e it = lookupTable.\u003cspan class=\"hljs-built_in\"\u003efind\u003c/span\u003e(fromCelsius);\n    \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (it != lookupTable.\u003cspan class=\"hljs-built_in\"\u003eend\u003c/span\u003e()) {\n        \u003cspan class=\"hljs-keyword\"\u003ereturn\u003c/span\u003e it-\u0026gt;second;\n    }\n\n    \u003cspan class=\"hljs-comment\"\u003e// Default conversion and rounding to nearest integer\u003c/span\u003e\n    \u003cspan class=\"hljs-keyword\"\u003ereturn\u003c/span\u003e \u003cspan class=\"hljs-built_in\"\u003eroundf\u003c/span\u003e(fromCelsius * \u003cspan class=\"hljs-number\"\u003e1.8\u003c/span\u003e + \u003cspan class=\"hljs-number\"\u003e32.0\u003c/span\u003e);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eOkay, I \u003cem\u003eam\u003c/em\u003e going to pick on their code a little bit; using \u003ccode\u003efloat\u003c/code\u003e as a key in a \u003ccode\u003emap\u003c/code\u003e is asking for trouble, because rounding errors are going to surprise you. But honestly, failing to find the key you\u0026#39;re looking for is \u003cem\u003ebetter\u003c/em\u003e than the opposite, since that actually does the correct thing. Because if you look carefully at the table, you\u0026#39;ll see that it\u0026#39;s \u003cem\u003ewrong\u003c/em\u003e.\u003c/p\u003e\n\u003cp\u003e18C, for example, should be 64F. Well, 64.4F, but we\u0026#39;re rounding to an integer. The choice here is to roughly map every 0.5C increase to a 1F increase, which is not the conversion factor. They try and correct- note how the table mostly steps by 0.5C, but skips 19.5C.\u003c/p\u003e\n\u003cp\u003eThe opposite direction is similarly bad:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-cpp\"\u003e\u003cspan class=\"hljs-comment\"\u003e// temperature helper these are direct mappings based on the remote\u003c/span\u003e\n\u003cspan class=\"hljs-function\"\u003e\u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e \u003cspan class=\"hljs-title\"\u003etoCelsius\u003c/span\u003e\u003cspan class=\"hljs-params\"\u003e(\u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e fromFahrenheit)\u003c/span\u003e \u003c/span\u003e{\n    \u003cspan class=\"hljs-comment\"\u003e// Lookup table for specific mappings\u003c/span\u003e\n    \u003cspan class=\"hljs-type\"\u003econst\u003c/span\u003e std::map\u0026lt;\u003cspan class=\"hljs-type\"\u003eint\u003c/span\u003e, \u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e\u0026gt; lookupTable = {\n        {\u003cspan class=\"hljs-number\"\u003e61\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e16.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e62\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e16.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e63\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e17.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e64\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e17.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e65\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e18.0\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e66\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e18.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e67\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e19.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e68\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e20.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e69\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e21.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e70\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e21.5\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e71\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e22.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e72\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e22.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e73\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e23.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e74\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e23.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e75\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e24.0\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e76\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e24.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e77\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e25.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e78\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e25.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e79\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e26.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e80\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e26.5\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e81\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e27.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e82\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e27.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e83\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e28.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e84\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e28.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e85\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e29.0\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e86\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e29.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e87\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e30.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e88\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e30.5\u003c/span\u003e}\n    };\n\n    \u003cspan class=\"hljs-comment\"\u003e// Check if the input is in the lookup table\u003c/span\u003e\n    \u003cspan class=\"hljs-keyword\"\u003eauto\u003c/span\u003e it = lookupTable.\u003cspan class=\"hljs-built_in\"\u003efind\u003c/span\u003e(\u003cspan class=\"hljs-built_in\"\u003estatic_cast\u003c/span\u003e\u0026lt;\u003cspan class=\"hljs-type\"\u003eint\u003c/span\u003e\u0026gt;(fromFahrenheit));\n    \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (it != lookupTable.\u003cspan class=\"hljs-built_in\"\u003eend\u003c/span\u003e()) {\n        \u003cspan class=\"hljs-keyword\"\u003ereturn\u003c/span\u003e it-\u0026gt;second;\n    }\n\n    \u003cspan class=\"hljs-comment\"\u003e// Default conversion and rounding to nearest 0.5\u003c/span\u003e\n    \u003cspan class=\"hljs-keyword\"\u003ereturn\u003c/span\u003e \u003cspan class=\"hljs-built_in\"\u003eroundf\u003c/span\u003e((fromFahrenheit - \u003cspan class=\"hljs-number\"\u003e32.0\u003c/span\u003e) / \u003cspan class=\"hljs-number\"\u003e1.8\u003c/span\u003e * \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e) / \u003cspan class=\"hljs-number\"\u003e2.0\u003c/span\u003e;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eHere, we can be off by as much as a 1C, which is certainly a noticeable feeling.\u003c/p\u003e\n\u003cp\u003eAt first glance, I thought this was just a misguided attempt at optimizing the lookup. For common values, do a lookup instead of calculating because it\u0026#39;s faster. Seems like the kind of mistake a hobby project might make, and definitely not a WTF. But it\u0026#39;s the comment which corrects me: \u003ccode\u003ethese are direct mappings based on the remote\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThese remotes usually have a display. So when you see on the remote that you\u0026#39;re trying to set the temperature to a comfortable 72F, the remote is actually sending 22.5C to the unit. That\u0026#39;s the actual temperature being sent.\u003c/p\u003e\n\u003cp\u003eNow, why on Earth does the remote behave this way? Well, I haven\u0026#39;t cracked one open to read off the part numbers, but I\u0026#39;m going to go out on a limb and guess that the microcontoller in the remote doesn\u0026#39;t handle floating point operations all that well. So it almost certainly does use a lookup table to decide what signal to send, and the lookup table is populated by \u0026#34;good enough\u0026#34; approximations of temperature conversions. There aren\u0026#39;t a \u003cem\u003elot\u003c/em\u003e of places that use Fahrenheit, so being \u0026#34;close enough\u0026#34; is a reasonable solution. If you want accurate temperatures, use SI units, not \u0026#34;freedom units\u0026#34;.\u003c/p\u003e\n\u003cp\u003eIn the end, I\u0026#39;d say that neither the hobby project, nor the remote control are the WTF here; locales that insist on using weird ass units are.\u003c/p\u003e\n\u003c!-- Easy Reader Version: Rankine is, of course, the most absurd version of this: keep the Fahrenheit scaling, but anchor at absolute zero, like Kelvin, though it\u0027s also worth reading up on the both the Newton scale and the Rømer scale, because \"coming up with a canonical temperature measurement\" was a hard thing to do in the early modern period! It was cutting edge science! Weird scales were a natural reaction to trying to find reproducible conditions. --\u003e\n\u003cstyle\u003e.comment { border: none }\u003c/style\u003e","BodyAndAdHtml":"\u003cp\u003eA common option for retrofitting heating and cooling into older homes is a mini-split, frequently tied to a heat pump. They\u0026#39;re (relatively) cheap to install, energy efficient, and can be added without substantial modifications to the home. They also, annoyingly, are mostly controlled via IR remotes, making them challenging to wire up to home automation or even a household thermostat.\u003c/p\u003e\n\u003cp\u003ePeople have made solutions, and today\u0026#39;s code comes from one of those solutions. Which, I want to stress, this code comes from an open source project for home automation, so it\u0026#39;s not \u003cem\u003ethe code\u003c/em\u003e that\u0026#39;s wrong, here. At first I thought it was, and had a moment of, \u0026#34;I\u0026#39;m not going to pick on some hobby project,\u0026#34; but then I realised the hobby project points at a deeper issue.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-cpp\"\u003e\u003cspan class=\"hljs-comment\"\u003e// temperature helper these are direct mappings based on the remote\u003c/span\u003e\n\u003cspan class=\"hljs-function\"\u003e\u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e \u003cspan class=\"hljs-title\"\u003etoFahrenheit\u003c/span\u003e\u003cspan class=\"hljs-params\"\u003e(\u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e fromCelsius)\u003c/span\u003e \u003c/span\u003e{\n    \u003cspan class=\"hljs-comment\"\u003e// Lookup table for specific mappings\u003c/span\u003e\n    \u003cspan class=\"hljs-type\"\u003econst\u003c/span\u003e std::map\u0026lt;\u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e, \u003cspan class=\"hljs-type\"\u003eint\u003c/span\u003e\u0026gt; lookupTable = {\n        {\u003cspan class=\"hljs-number\"\u003e16.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e61\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e16.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e62\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e17.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e63\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e17.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e64\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e18.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e65\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e18.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e66\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e19.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e67\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e20.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e68\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e21.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e69\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e21.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e70\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e22.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e71\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e22.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e72\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e23.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e73\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e23.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e74\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e24.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e75\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e24.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e76\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e25.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e77\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e25.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e78\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e26.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e79\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e26.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e80\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e27.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e81\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e27.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e82\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e28.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e83\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e28.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e84\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e29.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e85\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e29.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e86\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e30.0\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e87\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e30.5\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e88\u003c/span\u003e}\n    };\n\n    \u003cspan class=\"hljs-comment\"\u003e// Check if the input is in the lookup table\u003c/span\u003e\n    \u003cspan class=\"hljs-keyword\"\u003eauto\u003c/span\u003e it = lookupTable.\u003cspan class=\"hljs-built_in\"\u003efind\u003c/span\u003e(fromCelsius);\n    \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (it != lookupTable.\u003cspan class=\"hljs-built_in\"\u003eend\u003c/span\u003e()) {\n        \u003cspan class=\"hljs-keyword\"\u003ereturn\u003c/span\u003e it-\u0026gt;second;\n    }\n\n    \u003cspan class=\"hljs-comment\"\u003e// Default conversion and rounding to nearest integer\u003c/span\u003e\n    \u003cspan class=\"hljs-keyword\"\u003ereturn\u003c/span\u003e \u003cspan class=\"hljs-built_in\"\u003eroundf\u003c/span\u003e(fromCelsius * \u003cspan class=\"hljs-number\"\u003e1.8\u003c/span\u003e + \u003cspan class=\"hljs-number\"\u003e32.0\u003c/span\u003e);\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eOkay, I \u003cem\u003eam\u003c/em\u003e going to pick on their code a little bit; using \u003ccode\u003efloat\u003c/code\u003e as a key in a \u003ccode\u003emap\u003c/code\u003e is asking for trouble, because rounding errors are going to surprise you. But honestly, failing to find the key you\u0026#39;re looking for is \u003cem\u003ebetter\u003c/em\u003e than the opposite, since that actually does the correct thing. Because if you look carefully at the table, you\u0026#39;ll see that it\u0026#39;s \u003cem\u003ewrong\u003c/em\u003e.\u003c/p\u003e\n\u003cp\u003e18C, for example, should be 64F. Well, 64.4F, but we\u0026#39;re rounding to an integer. The choice here is to roughly map every 0.5C increase to a 1F increase, which is not the conversion factor. They try and correct- note how the table mostly steps by 0.5C, but skips 19.5C.\u003c/p\u003e\n\u003cp\u003eThe opposite direction is similarly bad:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-cpp\"\u003e\u003cspan class=\"hljs-comment\"\u003e// temperature helper these are direct mappings based on the remote\u003c/span\u003e\n\u003cspan class=\"hljs-function\"\u003e\u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e \u003cspan class=\"hljs-title\"\u003etoCelsius\u003c/span\u003e\u003cspan class=\"hljs-params\"\u003e(\u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e fromFahrenheit)\u003c/span\u003e \u003c/span\u003e{\n    \u003cspan class=\"hljs-comment\"\u003e// Lookup table for specific mappings\u003c/span\u003e\n    \u003cspan class=\"hljs-type\"\u003econst\u003c/span\u003e std::map\u0026lt;\u003cspan class=\"hljs-type\"\u003eint\u003c/span\u003e, \u003cspan class=\"hljs-type\"\u003efloat\u003c/span\u003e\u0026gt; lookupTable = {\n        {\u003cspan class=\"hljs-number\"\u003e61\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e16.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e62\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e16.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e63\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e17.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e64\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e17.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e65\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e18.0\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e66\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e18.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e67\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e19.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e68\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e20.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e69\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e21.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e70\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e21.5\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e71\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e22.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e72\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e22.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e73\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e23.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e74\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e23.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e75\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e24.0\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e76\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e24.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e77\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e25.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e78\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e25.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e79\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e26.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e80\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e26.5\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e81\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e27.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e82\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e27.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e83\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e28.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e84\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e28.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e85\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e29.0\u003c/span\u003e},\n        {\u003cspan class=\"hljs-number\"\u003e86\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e29.5\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e87\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e30.0\u003c/span\u003e}, {\u003cspan class=\"hljs-number\"\u003e88\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e30.5\u003c/span\u003e}\n    };\n\n    \u003cspan class=\"hljs-comment\"\u003e// Check if the input is in the lookup table\u003c/span\u003e\n    \u003cspan class=\"hljs-keyword\"\u003eauto\u003c/span\u003e it = lookupTable.\u003cspan class=\"hljs-built_in\"\u003efind\u003c/span\u003e(\u003cspan class=\"hljs-built_in\"\u003estatic_cast\u003c/span\u003e\u0026lt;\u003cspan class=\"hljs-type\"\u003eint\u003c/span\u003e\u0026gt;(fromFahrenheit));\n    \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (it != lookupTable.\u003cspan class=\"hljs-built_in\"\u003eend\u003c/span\u003e()) {\n        \u003cspan class=\"hljs-keyword\"\u003ereturn\u003c/span\u003e it-\u0026gt;second;\n    }\n\n    \u003cspan class=\"hljs-comment\"\u003e// Default conversion and rounding to nearest 0.5\u003c/span\u003e\n    \u003cspan class=\"hljs-keyword\"\u003ereturn\u003c/span\u003e \u003cspan class=\"hljs-built_in\"\u003eroundf\u003c/span\u003e((fromFahrenheit - \u003cspan class=\"hljs-number\"\u003e32.0\u003c/span\u003e) / \u003cspan class=\"hljs-number\"\u003e1.8\u003c/span\u003e * \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e) / \u003cspan class=\"hljs-number\"\u003e2.0\u003c/span\u003e;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eHere, we can be off by as much as a 1C, which is certainly a noticeable feeling.\u003c/p\u003e\n\u003cp\u003eAt first glance, I thought this was just a misguided attempt at optimizing the lookup. For common values, do a lookup instead of calculating because it\u0026#39;s faster. Seems like the kind of mistake a hobby project might make, and definitely not a WTF. But it\u0026#39;s the comment which corrects me: \u003ccode\u003ethese are direct mappings based on the remote\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThese remotes usually have a display. So when you see on the remote that you\u0026#39;re trying to set the temperature to a comfortable 72F, the remote is actually sending 22.5C to the unit. That\u0026#39;s the actual temperature being sent.\u003c/p\u003e\n\u003cp\u003eNow, why on Earth does the remote behave this way? Well, I haven\u0026#39;t cracked one open to read off the part numbers, but I\u0026#39;m going to go out on a limb and guess that the microcontoller in the remote doesn\u0026#39;t handle floating point operations all that well. So it almost certainly does use a lookup table to decide what signal to send, and the lookup table is populated by \u0026#34;good enough\u0026#34; approximations of temperature conversions. There aren\u0026#39;t a \u003cem\u003elot\u003c/em\u003e of places that use Fahrenheit, so being \u0026#34;close enough\u0026#34; is a reasonable solution. If you want accurate temperatures, use SI units, not \u0026#34;freedom units\u0026#34;.\u003c/p\u003e\n\u003cp\u003eIn the end, I\u0026#39;d say that neither the hobby project, nor the remote control are the WTF here; locales that insist on using weird ass units are.\u003c/p\u003e\n\u003c!-- Easy Reader Version: Rankine is, of course, the most absurd version of this: keep the Fahrenheit scaling, but anchor at absolute zero, like Kelvin, though it\u0027s also worth reading up on the both the Newton scale and the Rømer scale, because \"coming up with a canonical temperature measurement\" was a hard thing to do in the early modern period! It was cutting edge science! Weird scales were a natural reaction to trying to find reproducible conditions. --\u003e\n\u003cstyle\u003e.comment { border: none }\u003c/style\u003e\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/proget-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\tProGet’s got you covered with security and access controls on your NuGet feeds. \u003ca href=\"https://inedo.com/proget/private-nuget-server?utm_source=tdwtf\u0026amp;utm_medium=footer\u0026amp;utm_content=GotYouCoveredFooter\u0026amp;utm_campaign=Cyclops2020\"\u003eLearn more.\u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Title":"Heating Up","RssTitle":"CodeSOD: Heating Up","CachedCommentCount":32,"LastCommentDate":"\/Date(1788521701423)\/","LastCommentDateDescription":"2026-09-04","DiscourseTopicId":null,"DiscourseTopicOpened":false,"PublishedDate":"\/Date(1788417000000)\/","ISODate":"2026-09-03","DisplayDate":"2026-09-03","Series":{"Slug":"code-sod","Title":"CodeSOD","Description":"Code Snippet Of the Day (CodeSOD) features interesting and usually incorrect code snippets taken from actual production code in a commercial and/or open source software projects.","CssClass":"code"},"FooterAdHtml":"\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/proget-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\tProGet’s got you covered with security and access controls on your NuGet feeds. \u003ca href=\"https://inedo.com/proget/private-nuget-server?utm_source=tdwtf\u0026amp;utm_medium=footer\u0026amp;utm_content=GotYouCoveredFooter\u0026amp;utm_campaign=Cyclops2020\"\u003eLearn more.\u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Url":"https://thedailywtf.com/articles/heating-up","CommentsUrl":"https://thedailywtf.com/articles/comments/heating-up","Slug":"heating-up","TwitterUrl":"//www.twitter.com/home?status=https%3a%2f%2fthedailywtf.com%2farticles%2fheating-up+-+Heating+Up+-+The+Daily+WTF","FacebookUrl":"//www.facebook.com/sharer.php?u=https%3a%2f%2fthedailywtf.com%2farticles%2fheating-up\u0026t=Heating+Up+-+The+Daily+WTF","EmailUrl":"mailto:%20?subject=Check%20out%20this%20article%20on%20The%20Daily%20WTF...\u0026body=Heating%20Up:%20https://thedailywtf.com/articles/heating-up","GooglePlusUrl":"//plus.google.com/share?url=https%3a%2f%2fthedailywtf.com%2farticles%2fheating-up","PreviousArticleId":11264,"PreviousArticleTitle":"What You Measure","PreviousArticleSlug":"what-you-measure","PreviousArticleUrl":"//thedailywtf.com/articles/what-you-measure","NextArticleId":11262,"NextArticleTitle":"Good Time","NextArticleSlug":"good-time","NextArticleUrl":"//thedailywtf.com/articles/good-time"},{"Id":11264,"Author":{"Name":"Remy Porter","FirstName":"Remy","ShortDescription":"Computers were a mistake, so I accidentally became a farmer? Editor-in-Chief for TDWTF.","DescriptionHtml":"\u003cp\u003eRemy is a veteran developer who writes software for farming robots. They pick tomatoes.\u003c/p\u003e\r\n\u003cp\u003eHe\u0027s often on stage, doing improv comedy, but insists that \u003cem\u003ehe\u003c/em\u003e isn\u0027t doing comedy- it\u0027s deadly serious. You\u0027re laughing at him, not with him. That, by the way, is usually true- you\u0027re laughing at him, not with him.\u003c/p\u003e","Slug":"remy-porter","IsAdmin":true,"IsActive":true,"ImageUrl":"https://s3.amazonaws.com/remy.jetpackshark.com/remy-thumb.jpg"},"Status":"Published","SummaryHtml":"\u003cp\u003e\u003cstrong\u003eRachel\u003c/strong\u003e joined a new team which was proudly \u0026#34;metrics driven\u0026#34;. When she first met with her boss, Zane, he explained his thinking.\u003c/p\u003e\n\u003cp\u003e\u0026#34;We need to be data-driven to make good decisions, right? We\u0026#39;re a manufacturing company. We make widgets. At the end of the day, we need to make the most widgets for the lowest cost of goods sold. So we track that, and that feeds into every decision.\u0026#34;\u003c/p\u003e\n","BodyHtml":"\u003cp\u003e\u003cstrong\u003eRachel\u003c/strong\u003e joined a new team which was proudly \u0026#34;metrics driven\u0026#34;. When she first met with her boss, Zane, he explained his thinking.\u003c/p\u003e\n\u003cp\u003e\u0026#34;We need to be data-driven to make good decisions, right? We\u0026#39;re a manufacturing company. We make widgets. At the end of the day, we need to make the most widgets for the lowest cost of goods sold. So we track that, and that feeds into every decision.\u0026#34;\u003c/p\u003e\n\u003cp\u003eThe team oversaw an automated production line, which meant the software was a mix of robotics, embedded firmware, high-level web based monitoring tools, and thickets of dreaded PLC code. And because you can\u0026#39;t build an entire factory for test purposes, they only way they could test real-world scales with real-world data was to roll changes out to production. They could simulate, they could run tests on subsets of the system, but a change in the production line software couldn\u0026#39;t truly be validated until it rolled out into the real world.\u003c/p\u003e\n\u003cp\u003eRachel\u0026#39;s first task on the new team involved making some changes to their metrics dashboard. It was viewed as a good way to get her feet wet with the new team. As it turned out, the metrics dashboard was a Google Sheet, with a complex series of formulas that involved multi-level \u003ccode\u003eINDEX\u003c/code\u003e functions- essentially querying the spreadsheets like they were a database. Why not use an actual database? Oh, they did — six actually — but the company obeyed Remy\u0026#39;s Law of Requirements Gathering: \u0026#34;no matter what the requirements the users ask for, what they really wanted was Excel\u0026#34;. The database data was pulled into the spreadsheet for reporting.\u003c/p\u003e\n\u003cp\u003eNow, a complicated sheet pulling in data from not one, but six different databases, they must have a pretty complex model to explain how changes to their software would impact productivity. And since they needed to model the software to make predictions about how it\u0026#39;d behave in production, that model must be extremely useful.\u003c/p\u003e\n\u003cp\u003eOf course it wasn\u0026#39;t. The only metrics they tracked were output metrics, variations on \u0026#34;widgets produced per unit time\u0026#34;. There were some performance metrics, so you could maybe potentially identify \u0026#34;oh, our overall throughput dropped because unit 5 became a bottleneck and started taking 1.5 extra seconds per widget\u0026#34;, but nothing that actually helped you understand how the complex system made decisions. Or even \u003cem\u003ewhy\u003c/em\u003e unit 5 was taking longer.\u003c/p\u003e\n\u003cp\u003eFor example, there was an automated quality control scanner. It examined widgets as they came off the line, and rejected defective ones based on a computer vision algorithm. Did that subsystem record why it rejected a widget? No, it did not. The CV model was able to tag widgets with a defect category based on what it saw, but that information didn\u0026#39;t get recorded anywhere. In fact, it didn\u0026#39;t even record how \u003cem\u003emany\u003c/em\u003e widgets got rejected. The only way to know was to have an operator on the assembly line count widgets in the bin manually. Since that ate up a bunch of an operator\u0026#39;s time, it never happened unless the developers begged for it. And since the operator still couldn\u0026#39;t answer the question \u0026#34;why was this widget rejected\u0026#34;, it wasn\u0026#39;t all that useful anyway.\u003c/p\u003e\n\u003cp\u003eEvery change to the software was scored against the overall output metrics. This meant that when Rachel was ready to push out her first software change, something that would \u003cem\u003erecord how many widgets were rejected and why\u003c/em\u003e, whether or not it could be deployed was dependent on seeing the change improve, or at least not regress, the widgets-over-time scores. But the widgets-over-time were a noisy metric; it varied based on which operators were working any given shift, or based on supply chain constraints. Or sometimes, based on when one of the machines was last calibrated- theoretically something that happened on a set schedule, but really was up to the operators. This meant the first three times Rachel rolled her code out for a test run, the metrics regressed. Nothing she changed should have impacted the metrics, but the metrics regressed due to environmental issues.\u003c/p\u003e\n\u003cp\u003eThis meant making a simple change could take weeks, because you could only do final validation on the real system, which means you had to mark off a block of time for a test run, you could only run a handful of tests a day, and if metrics regressed you had to account for that before you could release the software for actual production use.\u003c/p\u003e\n\u003cp\u003eOver the first few months, Rachel added instrumentation to the code. Anything along the way to generating an output widget, she recorded. The hope was that once they had enough data, they could build a useful model of the system. Unfortunately, Zane had other ideas.\u003c/p\u003e\n\u003cp\u003e\u0026#34;So, you haven\u0026#39;t improved our metrics,\u0026#34; Zane said. \u0026#34;Which, I remind you, we\u0026#39;re a metrics driven organization. Every change needs to improve our metrics.\u0026#34;\u003c/p\u003e\n\u003cp\u003e\u0026#34;Sure, but I\u0026#39;m gathering more data so we have a better idea of what makes our metrics tick. We don\u0026#39;t know why our system does some of the things it does, because we don\u0026#39;t record any logging about the decisions it makes.\u0026#34;\u003c/p\u003e\n\u003cp\u003e\u0026#34;Right, but we already gather the key metrics.\u0026#34;\u003c/p\u003e\n\u003cp\u003e\u0026#34;But you don\u0026#39;t gather the data that tells you why those metrics are what they are!\u0026#34;\u003c/p\u003e\n\u003cp\u003e\u0026#34;Sure,\u0026#34; Zane said. \u0026#34;But those aren\u0026#39;t our key metrics.\u0026#34;\u003c/p\u003e\n\u003cp\u003eThat, unfortunately for Rachel, was where things landed. Understanding their complex system was a low priority. Pushing top-level metrics without understanding what fed into them, that was the priority. That didn\u0026#39;t mean Rachel was powerless: any time she made a change that she thought might help the top level metrics, she also made sure to add instrumentation that explained how that change behaved. It was the compromise that kept Zane happy: she released features that impacted the top-level metrics, but she also made the system more observable.\u003c/p\u003e","BodyAndAdHtml":"\u003cp\u003e\u003cstrong\u003eRachel\u003c/strong\u003e joined a new team which was proudly \u0026#34;metrics driven\u0026#34;. When she first met with her boss, Zane, he explained his thinking.\u003c/p\u003e\n\u003cp\u003e\u0026#34;We need to be data-driven to make good decisions, right? We\u0026#39;re a manufacturing company. We make widgets. At the end of the day, we need to make the most widgets for the lowest cost of goods sold. So we track that, and that feeds into every decision.\u0026#34;\u003c/p\u003e\n\u003cp\u003eThe team oversaw an automated production line, which meant the software was a mix of robotics, embedded firmware, high-level web based monitoring tools, and thickets of dreaded PLC code. And because you can\u0026#39;t build an entire factory for test purposes, they only way they could test real-world scales with real-world data was to roll changes out to production. They could simulate, they could run tests on subsets of the system, but a change in the production line software couldn\u0026#39;t truly be validated until it rolled out into the real world.\u003c/p\u003e\n\u003cp\u003eRachel\u0026#39;s first task on the new team involved making some changes to their metrics dashboard. It was viewed as a good way to get her feet wet with the new team. As it turned out, the metrics dashboard was a Google Sheet, with a complex series of formulas that involved multi-level \u003ccode\u003eINDEX\u003c/code\u003e functions- essentially querying the spreadsheets like they were a database. Why not use an actual database? Oh, they did — six actually — but the company obeyed Remy\u0026#39;s Law of Requirements Gathering: \u0026#34;no matter what the requirements the users ask for, what they really wanted was Excel\u0026#34;. The database data was pulled into the spreadsheet for reporting.\u003c/p\u003e\n\u003cp\u003eNow, a complicated sheet pulling in data from not one, but six different databases, they must have a pretty complex model to explain how changes to their software would impact productivity. And since they needed to model the software to make predictions about how it\u0026#39;d behave in production, that model must be extremely useful.\u003c/p\u003e\n\u003cp\u003eOf course it wasn\u0026#39;t. The only metrics they tracked were output metrics, variations on \u0026#34;widgets produced per unit time\u0026#34;. There were some performance metrics, so you could maybe potentially identify \u0026#34;oh, our overall throughput dropped because unit 5 became a bottleneck and started taking 1.5 extra seconds per widget\u0026#34;, but nothing that actually helped you understand how the complex system made decisions. Or even \u003cem\u003ewhy\u003c/em\u003e unit 5 was taking longer.\u003c/p\u003e\n\u003cp\u003eFor example, there was an automated quality control scanner. It examined widgets as they came off the line, and rejected defective ones based on a computer vision algorithm. Did that subsystem record why it rejected a widget? No, it did not. The CV model was able to tag widgets with a defect category based on what it saw, but that information didn\u0026#39;t get recorded anywhere. In fact, it didn\u0026#39;t even record how \u003cem\u003emany\u003c/em\u003e widgets got rejected. The only way to know was to have an operator on the assembly line count widgets in the bin manually. Since that ate up a bunch of an operator\u0026#39;s time, it never happened unless the developers begged for it. And since the operator still couldn\u0026#39;t answer the question \u0026#34;why was this widget rejected\u0026#34;, it wasn\u0026#39;t all that useful anyway.\u003c/p\u003e\n\u003cp\u003eEvery change to the software was scored against the overall output metrics. This meant that when Rachel was ready to push out her first software change, something that would \u003cem\u003erecord how many widgets were rejected and why\u003c/em\u003e, whether or not it could be deployed was dependent on seeing the change improve, or at least not regress, the widgets-over-time scores. But the widgets-over-time were a noisy metric; it varied based on which operators were working any given shift, or based on supply chain constraints. Or sometimes, based on when one of the machines was last calibrated- theoretically something that happened on a set schedule, but really was up to the operators. This meant the first three times Rachel rolled her code out for a test run, the metrics regressed. Nothing she changed should have impacted the metrics, but the metrics regressed due to environmental issues.\u003c/p\u003e\n\u003cp\u003eThis meant making a simple change could take weeks, because you could only do final validation on the real system, which means you had to mark off a block of time for a test run, you could only run a handful of tests a day, and if metrics regressed you had to account for that before you could release the software for actual production use.\u003c/p\u003e\n\u003cp\u003eOver the first few months, Rachel added instrumentation to the code. Anything along the way to generating an output widget, she recorded. The hope was that once they had enough data, they could build a useful model of the system. Unfortunately, Zane had other ideas.\u003c/p\u003e\n\u003cp\u003e\u0026#34;So, you haven\u0026#39;t improved our metrics,\u0026#34; Zane said. \u0026#34;Which, I remind you, we\u0026#39;re a metrics driven organization. Every change needs to improve our metrics.\u0026#34;\u003c/p\u003e\n\u003cp\u003e\u0026#34;Sure, but I\u0026#39;m gathering more data so we have a better idea of what makes our metrics tick. We don\u0026#39;t know why our system does some of the things it does, because we don\u0026#39;t record any logging about the decisions it makes.\u0026#34;\u003c/p\u003e\n\u003cp\u003e\u0026#34;Right, but we already gather the key metrics.\u0026#34;\u003c/p\u003e\n\u003cp\u003e\u0026#34;But you don\u0026#39;t gather the data that tells you why those metrics are what they are!\u0026#34;\u003c/p\u003e\n\u003cp\u003e\u0026#34;Sure,\u0026#34; Zane said. \u0026#34;But those aren\u0026#39;t our key metrics.\u0026#34;\u003c/p\u003e\n\u003cp\u003eThat, unfortunately for Rachel, was where things landed. Understanding their complex system was a low priority. Pushing top-level metrics without understanding what fed into them, that was the priority. That didn\u0026#39;t mean Rachel was powerless: any time she made a change that she thought might help the top level metrics, she also made sure to add instrumentation that explained how that change behaved. It was the compromise that kept Zane happy: she released features that impacted the top-level metrics, but she also made the system more observable.\u003c/p\u003e\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/buildmaster-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\t\u003ca href=\"https://inedo.com/BuildMaster?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eBuildMaster\u003c/a\u003e allows you to create a self-service release management platform that allows different teams to manage their applications. \u003ca href=\"https://inedo.com/BuildMaster/download?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eExplore how!\u003c/a\u003e \n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Title":"What You Measure","RssTitle":"What You Measure","CachedCommentCount":26,"LastCommentDate":"\/Date(1788431384687)\/","LastCommentDateDescription":"2026-09-03","DiscourseTopicId":null,"DiscourseTopicOpened":false,"PublishedDate":"\/Date(1788330600000)\/","ISODate":"2026-09-02","DisplayDate":"2026-09-02","Series":{"Slug":"feature-articles","Title":"Feature Articles","Description":"","CssClass":"featured"},"FooterAdHtml":"\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/buildmaster-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\t\u003ca href=\"https://inedo.com/BuildMaster?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eBuildMaster\u003c/a\u003e allows you to create a self-service release management platform that allows different teams to manage their applications. \u003ca href=\"https://inedo.com/BuildMaster/download?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eExplore how!\u003c/a\u003e \n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Url":"https://thedailywtf.com/articles/what-you-measure","CommentsUrl":"https://thedailywtf.com/articles/comments/what-you-measure","Slug":"what-you-measure","TwitterUrl":"//www.twitter.com/home?status=https%3a%2f%2fthedailywtf.com%2farticles%2fwhat-you-measure+-+What+You+Measure+-+The+Daily+WTF","FacebookUrl":"//www.facebook.com/sharer.php?u=https%3a%2f%2fthedailywtf.com%2farticles%2fwhat-you-measure\u0026t=What+You+Measure+-+The+Daily+WTF","EmailUrl":"mailto:%20?subject=Check%20out%20this%20article%20on%20The%20Daily%20WTF...\u0026body=What%20You%20Measure:%20https://thedailywtf.com/articles/what-you-measure","GooglePlusUrl":"//plus.google.com/share?url=https%3a%2f%2fthedailywtf.com%2farticles%2fwhat-you-measure","PreviousArticleId":11263,"PreviousArticleTitle":"So Much Room","PreviousArticleSlug":"so-much-room","PreviousArticleUrl":"//thedailywtf.com/articles/so-much-room","NextArticleId":11265,"NextArticleTitle":"Heating Up","NextArticleSlug":"heating-up","NextArticleUrl":"//thedailywtf.com/articles/heating-up"},{"Id":11263,"Author":{"Name":"Remy Porter","FirstName":"Remy","ShortDescription":"Computers were a mistake, so I accidentally became a farmer? Editor-in-Chief for TDWTF.","DescriptionHtml":"\u003cp\u003eRemy is a veteran developer who writes software for farming robots. They pick tomatoes.\u003c/p\u003e\r\n\u003cp\u003eHe\u0027s often on stage, doing improv comedy, but insists that \u003cem\u003ehe\u003c/em\u003e isn\u0027t doing comedy- it\u0027s deadly serious. You\u0027re laughing at him, not with him. That, by the way, is usually true- you\u0027re laughing at him, not with him.\u003c/p\u003e","Slug":"remy-porter","IsAdmin":true,"IsActive":true,"ImageUrl":"https://s3.amazonaws.com/remy.jetpackshark.com/remy-thumb.jpg"},"Status":"Published","SummaryHtml":"\u003cp\u003eToday\u0026#39;s representative comment ran out of room.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-java\"\u003e\u003cspan class=\"hljs-type\"\u003eint\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003emaxLen\u003c/span\u003e \u003cspan class=\"hljs-operator\"\u003e=\u003c/span\u003e getColumnSize(session, \u003cspan class=\"hljs-string\"\u003e\u0026#34;audit\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;text_value1\u0026#34;\u003c/span\u003e) - \u003cspan class=\"hljs-number\"\u003e16\u003c/span\u003e; \u003cspan class=\"hljs-comment\"\u003e// Leave some room for\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\n","BodyHtml":"\u003cp\u003eToday\u0026#39;s representative comment ran out of room.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-java\"\u003e\u003cspan class=\"hljs-type\"\u003eint\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003emaxLen\u003c/span\u003e \u003cspan class=\"hljs-operator\"\u003e=\u003c/span\u003e getColumnSize(session, \u003cspan class=\"hljs-string\"\u003e\u0026#34;audit\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;text_value1\u0026#34;\u003c/span\u003e) - \u003cspan class=\"hljs-number\"\u003e16\u003c/span\u003e; \u003cspan class=\"hljs-comment\"\u003e// Leave some room for\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eNo, it isn\u0026#39;t continued on the next line and just got trimmed out, except perhaps by a careless merge. This is the entire comment.\u003c/p\u003e\n\u003cp\u003eClearly, written by David Chase, the creator of \u0026#34;The Sopranos\u0026#34;.\u003c/p\u003e\n\u003cp\u003eThere are so many things we might be leaving room for. We could leave some room for dessert. Leave some room for activities. Leave some room for the holy spirit. Leave some room for improvisation.\u003c/p\u003e\n\u003c!-- Easy Reader Version: Leave some room for comments --\u003e","BodyAndAdHtml":"\u003cp\u003eToday\u0026#39;s representative comment ran out of room.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-java\"\u003e\u003cspan class=\"hljs-type\"\u003eint\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003emaxLen\u003c/span\u003e \u003cspan class=\"hljs-operator\"\u003e=\u003c/span\u003e getColumnSize(session, \u003cspan class=\"hljs-string\"\u003e\u0026#34;audit\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;text_value1\u0026#34;\u003c/span\u003e) - \u003cspan class=\"hljs-number\"\u003e16\u003c/span\u003e; \u003cspan class=\"hljs-comment\"\u003e// Leave some room for\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eNo, it isn\u0026#39;t continued on the next line and just got trimmed out, except perhaps by a careless merge. This is the entire comment.\u003c/p\u003e\n\u003cp\u003eClearly, written by David Chase, the creator of \u0026#34;The Sopranos\u0026#34;.\u003c/p\u003e\n\u003cp\u003eThere are so many things we might be leaving room for. We could leave some room for dessert. Leave some room for activities. Leave some room for the holy spirit. Leave some room for improvisation.\u003c/p\u003e\n\u003c!-- Easy Reader Version: Leave some room for comments --\u003e\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/proget-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\tProGet’s got you covered with security and access controls on your NuGet feeds. \u003ca href=\"https://inedo.com/proget/private-nuget-server?utm_source=tdwtf\u0026amp;utm_medium=footer\u0026amp;utm_content=GotYouCoveredFooter\u0026amp;utm_campaign=Cyclops2020\"\u003eLearn more.\u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Title":"So Much Room","RssTitle":"Representative Line: So Much Room","CachedCommentCount":22,"LastCommentDate":"\/Date(1788515776167)\/","LastCommentDateDescription":"2026-09-04","DiscourseTopicId":null,"DiscourseTopicOpened":false,"PublishedDate":"\/Date(1788244200000)\/","ISODate":"2026-09-01","DisplayDate":"2026-09-01","Series":{"Slug":"representative-line","Title":"Representative Line","Description":"A single line of code from a large application that somehow manages to provide an almost endless insight into the pain that its maintainers face each day.","CssClass":"soapbox"},"FooterAdHtml":"\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/proget-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\tProGet’s got you covered with security and access controls on your NuGet feeds. \u003ca href=\"https://inedo.com/proget/private-nuget-server?utm_source=tdwtf\u0026amp;utm_medium=footer\u0026amp;utm_content=GotYouCoveredFooter\u0026amp;utm_campaign=Cyclops2020\"\u003eLearn more.\u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Url":"https://thedailywtf.com/articles/so-much-room","CommentsUrl":"https://thedailywtf.com/articles/comments/so-much-room","Slug":"so-much-room","TwitterUrl":"//www.twitter.com/home?status=https%3a%2f%2fthedailywtf.com%2farticles%2fso-much-room+-+So+Much+Room+-+The+Daily+WTF","FacebookUrl":"//www.facebook.com/sharer.php?u=https%3a%2f%2fthedailywtf.com%2farticles%2fso-much-room\u0026t=So+Much+Room+-+The+Daily+WTF","EmailUrl":"mailto:%20?subject=Check%20out%20this%20article%20on%20The%20Daily%20WTF...\u0026body=So%20Much%20Room:%20https://thedailywtf.com/articles/so-much-room","GooglePlusUrl":"//plus.google.com/share?url=https%3a%2f%2fthedailywtf.com%2farticles%2fso-much-room","PreviousArticleId":11261,"PreviousArticleTitle":"Tales from the World Cup","PreviousArticleSlug":"tales-from-the-world-cup","PreviousArticleUrl":"//thedailywtf.com/articles/tales-from-the-world-cup","NextArticleId":11264,"NextArticleTitle":"What You Measure","NextArticleSlug":"what-you-measure","NextArticleUrl":"//thedailywtf.com/articles/what-you-measure"},{"Id":11261,"Author":{"Name":"Ellis Morning","FirstName":"Ellis","ShortDescription":null,"DescriptionHtml":"\u003cb\u003eEllis Morning\u003c/b\u003e is a Computer Science graduate who fought in the trenches of Tech Support, occasionally crossing enemy lines into the Business Analyst and Project Management spheres of war. She\u0027s now a freelance writer and technical writer. Check out her highly-rated \u003ca href=\"https://swordandstarship.com/\" target=\"_blank\"\u003esci-fi/fantasy novels\u003c/a\u003e and find more humor, fiction, and blog posts at her \u003ca href=\"https://www.ellismorning.com\" target=\"_blank\"\u003ewebsite\u003c/a\u003e.","Slug":"ellis-morning","IsAdmin":true,"IsActive":true,"ImageUrl":"https://ellismorning.com/img/ellis2.jpeg"},"Status":"Published","SummaryHtml":"\u003cp\u003eAll I can say in response to our \u003cb\u003eanonymous\u003c/b\u003e submitter\u0026#39;s story is, ALMOST?!\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003eWith the World Cup being hosted in North America this year, I remembered this story that happened back in 2014. At the time I was working in Brazil, for a company that builds software systems for public services. And, with the World Cup being hosted there, in came the opportunity for local agencies to invest in modernization, with pretty much a blank check to get new services, so long as it was deployed before the end of the World Cup. And so the sales people did what they did best, and went around trying to upsell whoever would be willing to buy — no matter our actual capacity for developing the things.\u003c/p\u003e\n\n\u003c/blockquote\u003e","BodyHtml":"\u003cp\u003eAll I can say in response to our \u003cb\u003eanonymous\u003c/b\u003e submitter\u0026#39;s story is, ALMOST?!\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003eWith the World Cup being hosted in North America this year, I remembered this story that happened back in 2014. At the time I was working in Brazil, for a company that builds software systems for public services. And, with the World Cup being hosted there, in came the opportunity for local agencies to invest in modernization, with pretty much a blank check to get new services, so long as it was deployed before the end of the World Cup. And so the sales people did what they did best, and went around trying to upsell whoever would be willing to buy — no matter our actual capacity for developing the things.\u003c/p\u003e\n\n\u003cp\u003eSo it was that I was pulled into this new fancy digital system for the police force of a state capital. However, we had only about 4 engineers available, and what they sold was a project estimated for a team of 20, to be delivered in 3 months, with no room for delay. And it wasn\u0026#39;t just our core C\u0026amp;D product, but this massive thing with customized public-facing websites, live tracking of the position of different police cars delivered to a tablet in each car, automated reporting, etc.\u003c/p\u003e\n\n\u003cp style=\"float:right; padding-left:10px; padding-bottom:10px;\"\u003e\u003ca title=\"Danilo Borges/copa2014.gov.br  LicenÃ§a Creative Commons AtribuiÃ§Ã£o 3.0 Brasil, CC BY 3.0 \u0026lt;https://creativecommons.org/licenses/by/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:Germany_and_Argentina_face_off_in_the_final_of_the_World_Cup_2014_-2014-07-13_(5).jpg\"\u003e\u003cimg itemprop=\"image\" width=\"300\" alt=\"Germany and Argentina face off in the final of the World Cup 2014 -2014-07-13 (5)\" src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Germany_and_Argentina_face_off_in_the_final_of_the_World_Cup_2014_-2014-07-13_%285%29.jpg/330px-Germany_and_Argentina_face_off_in_the_final_of_the_World_Cup_2014_-2014-07-13_%285%29.jpg?utm_source=commons.wikimedia.org\u0026amp;utm_campaign=index\u0026amp;utm_content=thumbnail\"/\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eFirst thing: We received a pile of 24 resumes, and were told to choose 16 of those. Maybe 3 were acceptable, but we had to waste 1 month hiring and onboarding 13 other people who were worse than useless. Classic man-month problem. We eventually had to tell management that nothing would be delivered this way, so they did the very best next thing: fly us to this other city, so we could work embedded there, in full crunch mode for the delivery. We pretty much worked 12+ hours a day, 7 days a week, for those next 2 weeks.\u003c/p\u003e\n\n\u003cp\u003eAnother situation: they wanted this system where people could take a photo of an incident in progress, and submit via this app + website, to be verified by an operator in real-time. We nicknamed it the \u0026#34;dick-pic encyclopedia.\u0026#34; Even worse, we only had the budget to run a single server, so this thing receiving public traffic would live in the same system that was tracking police car locations. Luckily they were convinced it was a bad idea so it was only ever online for a short period of time.\u003c/p\u003e\n\n\u003cp\u003eNext, was the police car tracking. This was done by a tablet installed in each car, which would be sending and receiving location information. But, 1 week before our deadline, we were hitting a serious bug: everything was working when we ran the tests ourselves, but the cops would report very weird bugs when testing it in the field. So we asked to do some field debugging, and I went on a ride-along. Things were working pretty much fine everywhere, so I asked to be taken to where he remembered seeing the tablets fail—to which the policeman just decides to drive off straight into one of the favelas around the city. I guess I can cross out \u0026#34;doing debugging in a police car passenger seat in a notoriously dangerous neighborhood\u0026#34; off my bucket list. Root cause: turns out cellphone connections would be pretty spotty in those areas, which we weren\u0026#39;t handling properly.\u003c/p\u003e\n\n\u003cp\u003eEither way, we delivered something on time that was severely below spec, and very much over-budget. Company tried to squirm out of paying overtime (was told that we would gain \u0026#34;prestige\u0026#34; by doing those extra hours), but I put my foot down and left that job shortly after. Last I heard they actually got sued for this and a bunch of similar projects, and almost went under.\u003c/p\u003e\n\u003c/blockquote\u003e","BodyAndAdHtml":"\u003cp\u003eAll I can say in response to our \u003cb\u003eanonymous\u003c/b\u003e submitter\u0026#39;s story is, ALMOST?!\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003eWith the World Cup being hosted in North America this year, I remembered this story that happened back in 2014. At the time I was working in Brazil, for a company that builds software systems for public services. And, with the World Cup being hosted there, in came the opportunity for local agencies to invest in modernization, with pretty much a blank check to get new services, so long as it was deployed before the end of the World Cup. And so the sales people did what they did best, and went around trying to upsell whoever would be willing to buy — no matter our actual capacity for developing the things.\u003c/p\u003e\n\n\u003cp\u003eSo it was that I was pulled into this new fancy digital system for the police force of a state capital. However, we had only about 4 engineers available, and what they sold was a project estimated for a team of 20, to be delivered in 3 months, with no room for delay. And it wasn\u0026#39;t just our core C\u0026amp;D product, but this massive thing with customized public-facing websites, live tracking of the position of different police cars delivered to a tablet in each car, automated reporting, etc.\u003c/p\u003e\n\n\u003cp style=\"float:right; padding-left:10px; padding-bottom:10px;\"\u003e\u003ca title=\"Danilo Borges/copa2014.gov.br  LicenÃ§a Creative Commons AtribuiÃ§Ã£o 3.0 Brasil, CC BY 3.0 \u0026lt;https://creativecommons.org/licenses/by/3.0\u0026gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:Germany_and_Argentina_face_off_in_the_final_of_the_World_Cup_2014_-2014-07-13_(5).jpg\"\u003e\u003cimg itemprop=\"image\" width=\"300\" alt=\"Germany and Argentina face off in the final of the World Cup 2014 -2014-07-13 (5)\" src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Germany_and_Argentina_face_off_in_the_final_of_the_World_Cup_2014_-2014-07-13_%285%29.jpg/330px-Germany_and_Argentina_face_off_in_the_final_of_the_World_Cup_2014_-2014-07-13_%285%29.jpg?utm_source=commons.wikimedia.org\u0026amp;utm_campaign=index\u0026amp;utm_content=thumbnail\"/\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eFirst thing: We received a pile of 24 resumes, and were told to choose 16 of those. Maybe 3 were acceptable, but we had to waste 1 month hiring and onboarding 13 other people who were worse than useless. Classic man-month problem. We eventually had to tell management that nothing would be delivered this way, so they did the very best next thing: fly us to this other city, so we could work embedded there, in full crunch mode for the delivery. We pretty much worked 12+ hours a day, 7 days a week, for those next 2 weeks.\u003c/p\u003e\n\n\u003cp\u003eAnother situation: they wanted this system where people could take a photo of an incident in progress, and submit via this app + website, to be verified by an operator in real-time. We nicknamed it the \u0026#34;dick-pic encyclopedia.\u0026#34; Even worse, we only had the budget to run a single server, so this thing receiving public traffic would live in the same system that was tracking police car locations. Luckily they were convinced it was a bad idea so it was only ever online for a short period of time.\u003c/p\u003e\n\n\u003cp\u003eNext, was the police car tracking. This was done by a tablet installed in each car, which would be sending and receiving location information. But, 1 week before our deadline, we were hitting a serious bug: everything was working when we ran the tests ourselves, but the cops would report very weird bugs when testing it in the field. So we asked to do some field debugging, and I went on a ride-along. Things were working pretty much fine everywhere, so I asked to be taken to where he remembered seeing the tablets fail—to which the policeman just decides to drive off straight into one of the favelas around the city. I guess I can cross out \u0026#34;doing debugging in a police car passenger seat in a notoriously dangerous neighborhood\u0026#34; off my bucket list. Root cause: turns out cellphone connections would be pretty spotty in those areas, which we weren\u0026#39;t handling properly.\u003c/p\u003e\n\n\u003cp\u003eEither way, we delivered something on time that was severely below spec, and very much over-budget. Company tried to squirm out of paying overtime (was told that we would gain \u0026#34;prestige\u0026#34; by doing those extra hours), but I put my foot down and left that job shortly after. Last I heard they actually got sued for this and a bunch of similar projects, and almost went under.\u003c/p\u003e\n\u003c/blockquote\u003e\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/buildmaster-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\t\u003ca href=\"https://inedo.com/BuildMaster?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eBuildMaster\u003c/a\u003e allows you to create a self-service release management platform that allows different teams to manage their applications. \u003ca href=\"https://inedo.com/BuildMaster/download?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eExplore how!\u003c/a\u003e \n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Title":"Tales from the World Cup","RssTitle":"Tales from the World Cup","CachedCommentCount":7,"LastCommentDate":"\/Date(1788245597167)\/","LastCommentDateDescription":"2026-09-01","DiscourseTopicId":null,"DiscourseTopicOpened":false,"PublishedDate":"\/Date(1788157800000)\/","ISODate":"2026-08-31","DisplayDate":"2026-08-31","Series":{"Slug":"feature-articles","Title":"Feature Articles","Description":"","CssClass":"featured"},"FooterAdHtml":"\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/buildmaster-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\t\u003ca href=\"https://inedo.com/BuildMaster?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eBuildMaster\u003c/a\u003e allows you to create a self-service release management platform that allows different teams to manage their applications. \u003ca href=\"https://inedo.com/BuildMaster/download?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eExplore how!\u003c/a\u003e \n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Url":"https://thedailywtf.com/articles/tales-from-the-world-cup","CommentsUrl":"https://thedailywtf.com/articles/comments/tales-from-the-world-cup","Slug":"tales-from-the-world-cup","TwitterUrl":"//www.twitter.com/home?status=https%3a%2f%2fthedailywtf.com%2farticles%2ftales-from-the-world-cup+-+Tales+from+the+World+Cup+-+The+Daily+WTF","FacebookUrl":"//www.facebook.com/sharer.php?u=https%3a%2f%2fthedailywtf.com%2farticles%2ftales-from-the-world-cup\u0026t=Tales+from+the+World+Cup+-+The+Daily+WTF","EmailUrl":"mailto:%20?subject=Check%20out%20this%20article%20on%20The%20Daily%20WTF...\u0026body=Tales%20from%20the%20World%20Cup:%20https://thedailywtf.com/articles/tales-from-the-world-cup","GooglePlusUrl":"//plus.google.com/share?url=https%3a%2f%2fthedailywtf.com%2farticles%2ftales-from-the-world-cup","PreviousArticleId":11260,"PreviousArticleTitle":"Hello, New Mexico!","PreviousArticleSlug":"hello-new-mexico","PreviousArticleUrl":"//thedailywtf.com/articles/hello-new-mexico","NextArticleId":11263,"NextArticleTitle":"So Much Room","NextArticleSlug":"so-much-room","NextArticleUrl":"//thedailywtf.com/articles/so-much-room"},{"Id":11260,"Author":{"Name":"Lyle Seaman","FirstName":"Lyle","ShortDescription":"networking, security infra and filesystems kernel hacker turned application programmer, SRE and engineering manager, Lyle traded tilting at windmills for viking at Vikings but couldn\u0027t catch any.","DescriptionHtml":null,"Slug":"lyle-seaman","IsAdmin":true,"IsActive":true,"ImageUrl":"/images/imageslws/viking.jpg"},"Status":"Published","SummaryHtml":"\u003cp\u003e\n\u003cstrong\u003ePeter G.\u003c/strong\u003e shared with us yet another ordering bungled example of.\n\u0026#34;Should really say \u0026#34;please engage in an Easter egg hunt\nto find your language\u0026#34;.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#3ccdf44218264528b28550518f7d6aea\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"3ccdf44218264528b28550518f7d6aea\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/3ccdf44218264528b28550518f7d6aea.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003c/blockquote\u003e","BodyHtml":"\u003cp\u003e\n\u003cstrong\u003ePeter G.\u003c/strong\u003e shared with us yet another ordering bungled example of.\n\u0026#34;Should really say \u0026#34;please engage in an Easter egg hunt\nto find your language\u0026#34;.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#3ccdf44218264528b28550518f7d6aea\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"3ccdf44218264528b28550518f7d6aea\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/3ccdf44218264528b28550518f7d6aea.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003e\u0026#34;Google can\u0026#39;t count\u0026#34; claimed \n\u003cstrong\u003ePeter S.\u003c/strong\u003e.  It adds up.\n\u0026#34;Yet another proof that 0=1, this time from Google.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#2d284d0f696d48669a9c59251ecf9bc0\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"2d284d0f696d48669a9c59251ecf9bc0\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/2d284d0f696d48669a9c59251ecf9bc0.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\n\u003cp\u003e\u0026#34;Thanks, Microsoft\u0026#34; groused \n\u003cstrong\u003eIvan\u003c/strong\u003e\n\u0026#34;Ever since Microsoft ate university e-mail services worldwide and became\nresponsible for major free software mailing lists, quality of service\nhas been steadily dropping. In order to report delivery problems\nto Outlook, you need a Microsoft account. You\u0026#39;re prevented from\ncreating it at first because of \u0026#34;suspicious activity\u0026#34;. Once you\u0026#39;re\nin, the contact address is pre-filled for you with an\ninvalid email. Once you fix that in the web developer\ntoolbar, fuck you anyway! I think the form isn\u0026#39;t actually\nexpected to work; the fact that the request was submitted\nis an error. The only thing missing from the experience\nis the \u0026#34;beware of the leopard\u0026#34; sign.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#ae9ba09cc9474a2f89b8358201b0419a\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"ae9ba09cc9474a2f89b8358201b0419a\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/ae9ba09cc9474a2f89b8358201b0419a.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003e\u0026#34;Mango Math\u0026#34; needs a bit of money math for the rest of the world to understand.\n\u003cstrong\u003eMichael R.\u003c/strong\u003e muttered \n\u0026#34;I will buy it by the slice then.\u0026#34; The joke here is on the tip of my tongue.  Explainer: the new pence is one hundredth of the decimal pound. No shillings no more, decreps! At that ratio, 3p per slice of cheesecake would indeed be far less dear than four pounds for the whole thing, barring translucent slices. Alas, the reality is simply the boring fact that the price is 3p per gram.  Not as funny but I\u0026#39;m chuckling imagining Michael\u0026#39;s transparent serving of diet cheesecake. I\u0026#39;ll leave it up to you to decide if a gram really counts as an \u0026#34;item\u0026#34;. \n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#bd6d8a538f7a45b2a81f8b52d425b180\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"bd6d8a538f7a45b2a81f8b52d425b180\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/bd6d8a538f7a45b2a81f8b52d425b180.jpeg\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003e\n\u003cstrong\u003eClint\u003c/strong\u003e clucked \n\u0026#34;Got this email from Bigbadtoystore. Lots of links available for\npreorder!\u0026#34; I think the talented website builders behind the New Mexico DOT have been busy.\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#d7efd5aabe754173a54fccb84c60b942\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"d7efd5aabe754173a54fccb84c60b942\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/d7efd5aabe754173a54fccb84c60b942.jpeg\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n","BodyAndAdHtml":"\u003cp\u003e\n\u003cstrong\u003ePeter G.\u003c/strong\u003e shared with us yet another ordering bungled example of.\n\u0026#34;Should really say \u0026#34;please engage in an Easter egg hunt\nto find your language\u0026#34;.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#3ccdf44218264528b28550518f7d6aea\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"3ccdf44218264528b28550518f7d6aea\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/3ccdf44218264528b28550518f7d6aea.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003e\u0026#34;Google can\u0026#39;t count\u0026#34; claimed \n\u003cstrong\u003ePeter S.\u003c/strong\u003e.  It adds up.\n\u0026#34;Yet another proof that 0=1, this time from Google.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#2d284d0f696d48669a9c59251ecf9bc0\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"2d284d0f696d48669a9c59251ecf9bc0\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/2d284d0f696d48669a9c59251ecf9bc0.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\n\u003cp\u003e\u0026#34;Thanks, Microsoft\u0026#34; groused \n\u003cstrong\u003eIvan\u003c/strong\u003e\n\u0026#34;Ever since Microsoft ate university e-mail services worldwide and became\nresponsible for major free software mailing lists, quality of service\nhas been steadily dropping. In order to report delivery problems\nto Outlook, you need a Microsoft account. You\u0026#39;re prevented from\ncreating it at first because of \u0026#34;suspicious activity\u0026#34;. Once you\u0026#39;re\nin, the contact address is pre-filled for you with an\ninvalid email. Once you fix that in the web developer\ntoolbar, fuck you anyway! I think the form isn\u0026#39;t actually\nexpected to work; the fact that the request was submitted\nis an error. The only thing missing from the experience\nis the \u0026#34;beware of the leopard\u0026#34; sign.\u0026#34;\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#ae9ba09cc9474a2f89b8358201b0419a\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"ae9ba09cc9474a2f89b8358201b0419a\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/ae9ba09cc9474a2f89b8358201b0419a.png\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003e\u0026#34;Mango Math\u0026#34; needs a bit of money math for the rest of the world to understand.\n\u003cstrong\u003eMichael R.\u003c/strong\u003e muttered \n\u0026#34;I will buy it by the slice then.\u0026#34; The joke here is on the tip of my tongue.  Explainer: the new pence is one hundredth of the decimal pound. No shillings no more, decreps! At that ratio, 3p per slice of cheesecake would indeed be far less dear than four pounds for the whole thing, barring translucent slices. Alas, the reality is simply the boring fact that the price is 3p per gram.  Not as funny but I\u0026#39;m chuckling imagining Michael\u0026#39;s transparent serving of diet cheesecake. I\u0026#39;ll leave it up to you to decide if a gram really counts as an \u0026#34;item\u0026#34;. \n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#bd6d8a538f7a45b2a81f8b52d425b180\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"bd6d8a538f7a45b2a81f8b52d425b180\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/bd6d8a538f7a45b2a81f8b52d425b180.jpeg\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\n\u003cp\u003e\n\u003cstrong\u003eClint\u003c/strong\u003e clucked \n\u0026#34;Got this email from Bigbadtoystore. Lots of links available for\npreorder!\u0026#34; I think the talented website builders behind the New Mexico DOT have been busy.\n\u003c/p\u003e\u003cblockquote\u003e\u003cp\u003e\u003ca href=\"#d7efd5aabe754173a54fccb84c60b942\"\u003e\u003cimg itemprop=\"image\" border=\"0\" alt=\"d7efd5aabe754173a54fccb84c60b942\" src=\"https://d3hvi6t161kfmf.cloudfront.net/images/2026/08/27/d7efd5aabe754173a54fccb84c60b942.jpeg\"/\u003e\u003c/a\u003e\u003c/p\u003e\u003cp\u003e \u003c/p\u003e\u003c/blockquote\u003e\n\n\u003cdiv\u003e\n\t[Advertisement] Picking up \u003cb\u003eNuGet\u003c/b\u003e is easy. Getting good at it takes time. \u003ca href=\"https://inedo.com/support/whitepapers/nuget-guide?utm_source=tdwtf\u0026amp;utm_medium=Footerad\u0026amp;utm_campaign=nuget\"\u003eDownload our guide to learn the best practice of NuGet for the Enterprise.\u003c/a\u003e\n\n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e","Title":"Hello, New Mexico!","RssTitle":"Error\u0027d: Hello, New Mexico!","CachedCommentCount":26,"LastCommentDate":"\/Date(1788262058847)\/","LastCommentDateDescription":"2026-09-01","DiscourseTopicId":null,"DiscourseTopicOpened":false,"PublishedDate":"\/Date(1787898600000)\/","ISODate":"2026-08-28","DisplayDate":"2026-08-28","Series":{"Slug":"errord","Title":"Error\u0027d","Description":"Error\u0027d features fun error messages and other visual oddities from the world of IT.","CssClass":"errord"},"FooterAdHtml":"\u003cdiv\u003e\n\t[Advertisement] Picking up \u003cb\u003eNuGet\u003c/b\u003e is easy. Getting good at it takes time. \u003ca href=\"https://inedo.com/support/whitepapers/nuget-guide?utm_source=tdwtf\u0026amp;utm_medium=Footerad\u0026amp;utm_campaign=nuget\"\u003eDownload our guide to learn the best practice of NuGet for the Enterprise.\u003c/a\u003e\n\n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e","Url":"https://thedailywtf.com/articles/hello-new-mexico","CommentsUrl":"https://thedailywtf.com/articles/comments/hello-new-mexico","Slug":"hello-new-mexico","TwitterUrl":"//www.twitter.com/home?status=https%3a%2f%2fthedailywtf.com%2farticles%2fhello-new-mexico+-+Hello%2c+New+Mexico!+-+The+Daily+WTF","FacebookUrl":"//www.facebook.com/sharer.php?u=https%3a%2f%2fthedailywtf.com%2farticles%2fhello-new-mexico\u0026t=Hello%2c+New+Mexico!+-+The+Daily+WTF","EmailUrl":"mailto:%20?subject=Check%20out%20this%20article%20on%20The%20Daily%20WTF...\u0026body=Hello,%20New%20Mexico!:%20https://thedailywtf.com/articles/hello-new-mexico","GooglePlusUrl":"//plus.google.com/share?url=https%3a%2f%2fthedailywtf.com%2farticles%2fhello-new-mexico","PreviousArticleId":11259,"PreviousArticleTitle":"The Big Family","PreviousArticleSlug":"the-big-family","PreviousArticleUrl":"//thedailywtf.com/articles/the-big-family","NextArticleId":11261,"NextArticleTitle":"Tales from the World Cup","NextArticleSlug":"tales-from-the-world-cup","NextArticleUrl":"//thedailywtf.com/articles/tales-from-the-world-cup"},{"Id":11259,"Author":{"Name":"Remy Porter","FirstName":"Remy","ShortDescription":"Computers were a mistake, so I accidentally became a farmer? Editor-in-Chief for TDWTF.","DescriptionHtml":"\u003cp\u003eRemy is a veteran developer who writes software for farming robots. They pick tomatoes.\u003c/p\u003e\r\n\u003cp\u003eHe\u0027s often on stage, doing improv comedy, but insists that \u003cem\u003ehe\u003c/em\u003e isn\u0027t doing comedy- it\u0027s deadly serious. You\u0027re laughing at him, not with him. That, by the way, is usually true- you\u0027re laughing at him, not with him.\u003c/p\u003e","Slug":"remy-porter","IsAdmin":true,"IsActive":true,"ImageUrl":"https://s3.amazonaws.com/remy.jetpackshark.com/remy-thumb.jpg"},"Status":"Published","SummaryHtml":"\u003cp\u003eSome time ago, \u003cstrong\u003eCharles\u003c/strong\u003e shared with us \u003ca href=\"https://thedailywtf.com/articles/contact-us\"\u003esome awful PHP\u003c/a\u003e, aka the most common sort. Today\u0026#39;s code sample is maybe a little too big to sum up, but I\u0026#39;ll let Charles take a crack at it.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eIt\u0026#39;s so bad that even analyzing and laughing at it feels impossible. But it’s so bad, I couldn’t not share it.\u003c/p\u003e\n\u003c/blockquote\u003e","BodyHtml":"\u003cp\u003eSome time ago, \u003cstrong\u003eCharles\u003c/strong\u003e shared with us \u003ca href=\"https://thedailywtf.com/articles/contact-us\"\u003esome awful PHP\u003c/a\u003e, aka the most common sort. Today\u0026#39;s code sample is maybe a little too big to sum up, but I\u0026#39;ll let Charles take a crack at it.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eIt\u0026#39;s so bad that even analyzing and laughing at it feels impossible. But it’s so bad, I couldn’t not share it.\u003c/p\u003e\n\u003cp\u003eI’m the only one handling all the IT-related tasks at my company, and I don’t have anyone here to vent or laugh about this kind of thing with. So, I figured, why not share it here? I’m hoping it’ll provide at least a little bit of catharsis or some dark humor.\u003c/p\u003e\n\u003cp\u003eTo make sure the confidentiality of the codebase was respected, I took the liberty of generalizing it. You might notice some inconsistencies, but that’s just me trying to keep things neutral while protecting the original structure and functionality. Apologies if it looks a bit patchy – the goal was to avoid revealing any specific details or sensitive code.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eThe whole block is north of 400 lines, and it\u0026#39;s doing a \u003cem\u003elot\u003c/em\u003e. Or well, maybe it\u0026#39;s not, as you\u0026#39;ll see.\u003c/p\u003e\n\u003cp\u003eLet\u0026#39;s star with the outermost layer.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e\u003cspan class=\"hljs-variable\"\u003e$resm_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;group=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$item_id\u003c/span\u003e);\n\u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$value\u003c/span\u003e) {\n\u003cspan class=\"hljs-comment\"\u003e// rest of the code here\u003c/span\u003e\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eWe fetch data from a data source, presumably a database, passing our condition as a string, which reeks of probable SQL injection, but I don\u0026#39;t know what library they\u0026#39;re using. I also note they\u0026#39;re using the key/value style of array iteration, but never actually check the key.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e    \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$value\u003c/span\u003e-\u0026gt;option_id;\n    \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e);\n    \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e) {\n        \u003cspan class=\"hljs-variable\"\u003e$label\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;label\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n        \u003cspan class=\"hljs-variable\"\u003e$description\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;description\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n        \u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;category;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eNice little bit of \u0026#34;meta\u0026#34; programming to get their localization working, it\u0026#39;ll fetch \u003ccode\u003elabelen\u003c/code\u003e or \u003ccode\u003elabelde\u003c/code\u003e as needed. Definitely not a horrible, dangerous way to solve that problem.\u003c/p\u003e\n\u003cp\u003eWe use that again to get our currency figured out. That lets us do number formatting. So much number formatting code.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e =\n                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e .\n                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e4\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\n            \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eand\u003c/span\u003e\n            \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e\n        ) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e200\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        }\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eWhat is the \u003ccode\u003e$mot\u003c/code\u003e array? Why am I jumping to seemingly random locations in that array? Clearly it contains some headers for our output.\u003c/p\u003e\n\u003cp\u003eAnyway, there\u0026#39;s plenty of HTML string munging happening too, don\u0026#39;t you worry.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e =\n                \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;quantity-container\u0026#34;\u0026gt;\n                    \u0026lt;input type=\u0026#34;text\u0026#34; value=\u0026#34;1\u0026#34; id=\u0026#34;quantity-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; class=\u0026#34;qty-control\u0026#34; name=\u0026#34;quantity\u0026#34; min=\u0026#34;1\u0026#34; max=\u0026#34;1\u0026#34;\u0026gt;\n                    \u0026lt;div class=\u0026#34;increase button\u0026#34;\u0026gt;+\u0026lt;/div\u0026gt;\n                    \u0026lt;div class=\u0026#34;decrease button\u0026#34;\u0026gt;-\u0026lt;/div\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n            \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;all\u0026#34;\u003c/span\u003e;\n        }\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAnd then there\u0026#39;s this little treat for parsing the time stored in our database: \u003ccode\u003e$time_data = json_decode($resm_details-\u0026gt;time_data);\u003c/code\u003e That tells me they\u0026#39;re storing date times as strings, so that\u0026#39;s fun.\u003c/p\u003e\n\u003cp\u003eThere are also a couple more bon mots as they build a drop down list:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e            \u003cspan class=\"hljs-variable\"\u003e$departure_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e300\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$arrival_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e301\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAnd then there\u0026#39;s \u003cem\u003ethis\u003c/em\u003e monstrosity:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e        \u003cspan class=\"hljs-comment\"\u003e// Add the main option to the template\u003c/span\u003e\n        \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS\u0026#34;\u003c/span\u003e, [\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$label_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$action_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$label\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$description\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_cost_display\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CHILD_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$extra\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_extra\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$time_block\u003c/span\u003e\n        ]);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAll the nonsense that we concatenate together above gets shoved into some sort of template. And after that, that\u0026#39;s where the good stuff starts. Because guess what? We have to do the same thing for child items.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e        \u003cspan class=\"hljs-variable\"\u003e$resm_children_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;parent=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e);\n        \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_children_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$child_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_value\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_value\u003c/span\u003e-\u0026gt;option_id;\n            \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eThat\u0026#39;s right, it\u0026#39;s the same block of code, not quite copy/pasted, since they needed to put the word \u003ccode\u003echild\u003c/code\u003e in everything.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e                \u003cspan class=\"hljs-comment\"\u003e// Add the child option to the template\u003c/span\u003e\n                \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS.Block_OPTIONS_CHILD\u0026#34;\u003c/span\u003e, [\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_quantity\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_label_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_action_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_label\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_description\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_quantity_block\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_cost_display\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;CHILD_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_extra\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_extra\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$child_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_time_block\u003c/span\u003e\n                ]);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAnd now, if you liked the child record, guess what? Those children have got siblings. What can I say, it\u0026#39;s a big family.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e                \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;parent=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$parent_option_id\u003c/span\u003e);\n                \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_sibling_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$sibling_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_value\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_value\u003c/span\u003e-\u0026gt;option_id;\n                    \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAnd that means, yes, we also use that template thing again:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e                        \u003cspan class=\"hljs-comment\"\u003e// Add the sibling option to the template\u003c/span\u003e\n                        \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS.Block_OPTIONS_CHILD\u0026#34;\u003c/span\u003e, [\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_label_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_action_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_label\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_description\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity_block\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_cost_display\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;SIBLING_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_extra\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_extra\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$sibling_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_time_block\u003c/span\u003e\n                        ]);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eSomeday, I hope the person who wrote this learn about methods and function calls. Maybe they could write their own one day.\u003c/p\u003e\n\u003cp\u003eIn any case, here\u0026#39;s the whole thing:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e\u003cspan class=\"hljs-variable\"\u003e$resm_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;group=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$item_id\u003c/span\u003e);\n\u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$value\u003c/span\u003e) {\n    \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$value\u003c/span\u003e-\u0026gt;option_id;\n    \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e);\n    \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e) {\n        \u003cspan class=\"hljs-variable\"\u003e$label\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;label\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n        \u003cspan class=\"hljs-variable\"\u003e$description\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;description\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n        \u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;category;\n\n        \u003cspan class=\"hljs-comment\"\u003e// Process cost based on category\u003c/span\u003e\n        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e =\n                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e .\n                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e4\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\n            \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eand\u003c/span\u003e\n            \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e\n        ) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e200\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        }\n\n        \u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;location;\n        \u003cspan class=\"hljs-variable\"\u003e$label_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;has-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;no-quantity\u0026#34;\u003c/span\u003e;\n        \u003cspan class=\"hljs-variable\"\u003e$action_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-with-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-no-quantity\u0026#34;\u003c/span\u003e;\n        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e =\n                \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;quantity-container\u0026#34;\u0026gt;\n                    \u0026lt;input type=\u0026#34;text\u0026#34; value=\u0026#34;1\u0026#34; id=\u0026#34;quantity-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; class=\u0026#34;qty-control\u0026#34; name=\u0026#34;quantity\u0026#34; min=\u0026#34;1\u0026#34; max=\u0026#34;1\u0026#34;\u0026gt;\n                    \u0026lt;div class=\u0026#34;increase button\u0026#34;\u0026gt;+\u0026lt;/div\u0026gt;\n                    \u0026lt;div class=\u0026#34;decrease button\u0026#34;\u0026gt;-\u0026lt;/div\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n            \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;all\u0026#34;\u003c/span\u003e;\n        }\n\n        \u003cspan class=\"hljs-variable\"\u003e$has_times\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;has_times;\n\n        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$time_counter\u003c/span\u003e++;\n            \u003cspan class=\"hljs-variable\"\u003e$time_data\u003c/span\u003e = \u003cspan class=\"hljs-title function_ invoke__\"\u003ejson_decode\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;time_data);\n\n            \u003cspan class=\"hljs-variable\"\u003e$departure_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e300\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$arrival_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e301\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n\n            \u003cspan class=\"hljs-variable\"\u003e$departures\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$time_data\u003c/span\u003e-\u0026gt;departures;\n            \u003cspan class=\"hljs-variable\"\u003e$arrivals\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$time_data\u003c/span\u003e-\u0026gt;arrivals;\n\n            \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$departures\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$dep_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$departure\u003c/span\u003e) {\n                \u003cspan class=\"hljs-variable\"\u003e$departure_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$dep_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$departure\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n            }\n\n            \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$arrivals\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$arr_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$arrival\u003c/span\u003e) {\n                \u003cspan class=\"hljs-variable\"\u003e$arrival_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$arr_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$arrival\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n            }\n\n            \u003cspan class=\"hljs-variable\"\u003e$departure_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-right: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-departure\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$departure_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n            \u003cspan class=\"hljs-variable\"\u003e$arrival_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-left: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-arrival\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$arrival_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n            \u003cspan class=\"hljs-variable\"\u003e$time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;row time-container\u0026#34;\u0026gt;\n                \u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$departure_block\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$arrival_block\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\n            \u0026lt;/div\u0026gt;\u0026lt;small class=\u0026#34;error-message time-error\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e302\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/small\u0026gt;\u0026#39;\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n            \u003cspan class=\"hljs-variable\"\u003e$time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e;\n        }\n\n        \u003cspan class=\"hljs-variable\"\u003e$host_cost_display\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n        \u003cspan class=\"hljs-variable\"\u003e$extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;extra;\n        \u003cspan class=\"hljs-variable\"\u003e$host_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;host_extra;\n        \u003cspan class=\"hljs-variable\"\u003e$host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n\n        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$extra_cost_1\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_1\u0026#34;\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$extra_cost_2\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_2\u0026#34;\u003c/span\u003e};\n\n            \u003cspan class=\"hljs-variable\"\u003e$default_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$host_price\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e ? \u003cspan class=\"hljs-variable\"\u003e$extra_cost_2\u003c/span\u003e : \u003cspan class=\"hljs-variable\"\u003e$extra_cost_1\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;extra-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$default_extra\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) .\n                \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;child-cost\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n\n            \u003cspan class=\"hljs-variable\"\u003e$host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34; extra-option\u0026#34;\u003c/span\u003e;\n        }\n        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$host_extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$host_cost_display\u003c/span\u003e =\n                \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;span class=\u0026#34;host-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;host-price\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e .\n                \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026lt;br\u0026gt;\u0026#34;\u003c/span\u003e;\n        }\n\n        \u003cspan class=\"hljs-comment\"\u003e// Add the main option to the template\u003c/span\u003e\n        \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS\u0026#34;\u003c/span\u003e, [\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$label_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$action_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$label\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$description\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_cost_display\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CHILD_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$extra\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_extra\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$time_block\u003c/span\u003e\n        ]);\n\n        \u003cspan class=\"hljs-variable\"\u003e$resm_children_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;parent=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e);\n        \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_children_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$child_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_value\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_value\u003c/span\u003e-\u0026gt;option_id;\n            \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e);\n            \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e) {\n                \u003cspan class=\"hljs-variable\"\u003e$child_label\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;label\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n                \u003cspan class=\"hljs-variable\"\u003e$child_description\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;description\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n                \u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;category;\n\n                \u003cspan class=\"hljs-comment\"\u003e// Process cost for child category\u003c/span\u003e\n                \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e =\n                        \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e .\n                        \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e4\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\n                    \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eand\u003c/span\u003e\n                    \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e\n                ) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e200\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                }\n\n                \u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;location;\n                \u003cspan class=\"hljs-variable\"\u003e$child_label_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;has-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;no-quantity\u0026#34;\u003c/span\u003e;\n                \u003cspan class=\"hljs-variable\"\u003e$child_action_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-with-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-no-quantity\u0026#34;\u003c/span\u003e;\n                \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_quantity_block\u003c/span\u003e =\n                        \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;quantity-container\u0026#34;\u0026gt;\n                    \u0026lt;input type=\u0026#34;text\u0026#34; value=\u0026#34;1\u0026#34; id=\u0026#34;child-quantity-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; class=\u0026#34;qty-control\u0026#34; name=\u0026#34;quantity\u0026#34; min=\u0026#34;1\u0026#34; max=\u0026#34;1\u0026#34;\u0026gt;\n                    \u0026lt;div class=\u0026#34;increase button\u0026#34;\u0026gt;+\u0026lt;/div\u0026gt;\n                    \u0026lt;div class=\u0026#34;decrease button\u0026#34;\u0026gt;-\u0026lt;/div\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_quantity\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_quantity_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_quantity\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;all\u0026#34;\u003c/span\u003e;\n                }\n\n                \u003cspan class=\"hljs-variable\"\u003e$child_has_times\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;has_times;\n\n                \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_time_counter\u003c/span\u003e++;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_time_data\u003c/span\u003e = \u003cspan class=\"hljs-title function_ invoke__\"\u003ejson_decode\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;time_data);\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_departure_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e300\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_arrival_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e301\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_departures\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_time_data\u003c/span\u003e-\u0026gt;departures;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_arrivals\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_time_data\u003c/span\u003e-\u0026gt;arrivals;\n\n                    \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_departures\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$child_dep_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_departure\u003c/span\u003e) {\n                        \u003cspan class=\"hljs-variable\"\u003e$child_departure_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_dep_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_departure\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                    }\n\n                    \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_arrivals\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$child_arr_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_arrival\u003c/span\u003e) {\n                        \u003cspan class=\"hljs-variable\"\u003e$child_arrival_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_arr_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_arrival\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                    }\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_departure_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-right: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-departure\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_departure_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_arrival_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-left: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-arrival\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_arrival_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;row time-container\u0026#34;\u0026gt;\n                \u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_departure_block\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_arrival_block\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\n            \u0026lt;/div\u0026gt;\u0026lt;small class=\u0026#34;error-message time-error\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e302\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/small\u0026gt;\u0026#39;\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e;\n                }\n\n                \u003cspan class=\"hljs-variable\"\u003e$child_host_cost_display\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                \u003cspan class=\"hljs-variable\"\u003e$child_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;extra;\n                \u003cspan class=\"hljs-variable\"\u003e$child_host_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;host_extra;\n                \u003cspan class=\"hljs-variable\"\u003e$child_host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n\n                \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost_1\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_1\u0026#34;\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost_2\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_2\u0026#34;\u003c/span\u003e};\n\n                    \u003cspan class=\"hljs-variable\"\u003e$default_child_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$host_price\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e ? \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost_2\u003c/span\u003e : \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost_1\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;extra-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$default_child_extra\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) .\n                        \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;child-cost\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34; extra-option\u0026#34;\u003c/span\u003e;\n                }\n                \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_host_extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_host_cost_display\u003c/span\u003e =\n                        \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;span class=\u0026#34;host-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;host-price\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e .\n                        \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026lt;br\u0026gt;\u0026#34;\u003c/span\u003e;\n                }\n\n                \u003cspan class=\"hljs-comment\"\u003e// Add the child option to the template\u003c/span\u003e\n                \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS.Block_OPTIONS_CHILD\u0026#34;\u003c/span\u003e, [\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_quantity\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_label_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_action_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_label\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_description\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_quantity_block\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_cost_display\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;CHILD_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_extra\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_extra\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$child_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_time_block\u003c/span\u003e\n                ]);\n\n                \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;parent=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$parent_option_id\u003c/span\u003e);\n                \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_sibling_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$sibling_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_value\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_value\u003c/span\u003e-\u0026gt;option_id;\n                    \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e);\n                    \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e) {\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_label\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;label\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_description\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;description\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;category;\n\n                        \u003cspan class=\"hljs-comment\"\u003e// Process cost for sibling category\u003c/span\u003e\n                        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;sibling_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e =\n                                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e .\n                                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;sibling_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e4\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\n                            \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eand\u003c/span\u003e\n                            \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;sibling_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e\n                        ) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e200\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                        }\n\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;location;\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_label_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;has-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;no-quantity\u0026#34;\u003c/span\u003e;\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_action_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-with-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-no-quantity\u0026#34;\u003c/span\u003e;\n                        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity_block\u003c/span\u003e =\n                                \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;quantity-container\u0026#34;\u0026gt;\n                    \u0026lt;input type=\u0026#34;text\u0026#34; value=\u0026#34;1\u0026#34; id=\u0026#34;sibling-quantity-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; class=\u0026#34;qty-control\u0026#34; name=\u0026#34;quantity\u0026#34; min=\u0026#34;1\u0026#34; max=\u0026#34;1\u0026#34;\u0026gt;\n                    \u0026lt;div class=\u0026#34;increase button\u0026#34;\u0026gt;+\u0026lt;/div\u0026gt;\n                    \u0026lt;div class=\u0026#34;decrease button\u0026#34;\u0026gt;-\u0026lt;/div\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;all\u0026#34;\u003c/span\u003e;\n                        }\n\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_has_times\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;has_times;\n\n                        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_time_counter\u003c/span\u003e++;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_time_data\u003c/span\u003e = \u003cspan class=\"hljs-title function_ invoke__\"\u003ejson_decode\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;time_data);\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_departure_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e300\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e301\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_departures\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_time_data\u003c/span\u003e-\u0026gt;departures;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_arrivals\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_time_data\u003c/span\u003e-\u0026gt;arrivals;\n\n                            \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_departures\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$sibling_dep_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_departure\u003c/span\u003e) {\n                                \u003cspan class=\"hljs-variable\"\u003e$sibling_departure_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_dep_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_departure\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                            }\n\n                            \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_arrivals\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$sibling_arr_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival\u003c/span\u003e) {\n                                \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_arr_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                            }\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_departure_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-right: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-departure\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_departure_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-left: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-arrival\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;row time-container\u0026#34;\u0026gt;\n                \u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_departure_block\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival_block\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\n            \u0026lt;/div\u0026gt;\u0026lt;small class=\u0026#34;error-message time-error\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e302\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/small\u0026gt;\u0026#39;\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e;\n                        }\n\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_host_cost_display\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;extra;\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_host_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;host_extra;\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n\n                        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost_1\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_1\u0026#34;\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost_2\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_2\u0026#34;\u003c/span\u003e};\n\n                            \u003cspan class=\"hljs-variable\"\u003e$default_sibling_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$host_price\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e ? \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost_2\u003c/span\u003e : \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost_1\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;extra-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$default_sibling_extra\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) .\n                                \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;sibling-cost\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34; extra-option\u0026#34;\u003c/span\u003e;\n                        }\n                        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_host_extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_host_cost_display\u003c/span\u003e =\n                                \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;span class=\u0026#34;host-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;host-price\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e .\n                                \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026lt;br\u0026gt;\u0026#34;\u003c/span\u003e;\n                        }\n\n                        \u003cspan class=\"hljs-comment\"\u003e// Add the sibling option to the template\u003c/span\u003e\n                        \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS.Block_OPTIONS_CHILD\u0026#34;\u003c/span\u003e, [\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_label_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_action_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_label\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_description\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity_block\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_cost_display\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;SIBLING_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_extra\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_extra\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$sibling_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_time_block\u003c/span\u003e\n                        ]);\n                    }\n                }\n            }\n        }\n    }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003c!-- Easy Reader Version: Who doesn\u0027t love a gigantic code blob? --\u003e\n\u003cstyle\u003e.comment { border: none; }\u003c/style\u003e","BodyAndAdHtml":"\u003cp\u003eSome time ago, \u003cstrong\u003eCharles\u003c/strong\u003e shared with us \u003ca href=\"https://thedailywtf.com/articles/contact-us\"\u003esome awful PHP\u003c/a\u003e, aka the most common sort. Today\u0026#39;s code sample is maybe a little too big to sum up, but I\u0026#39;ll let Charles take a crack at it.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eIt\u0026#39;s so bad that even analyzing and laughing at it feels impossible. But it’s so bad, I couldn’t not share it.\u003c/p\u003e\n\u003cp\u003eI’m the only one handling all the IT-related tasks at my company, and I don’t have anyone here to vent or laugh about this kind of thing with. So, I figured, why not share it here? I’m hoping it’ll provide at least a little bit of catharsis or some dark humor.\u003c/p\u003e\n\u003cp\u003eTo make sure the confidentiality of the codebase was respected, I took the liberty of generalizing it. You might notice some inconsistencies, but that’s just me trying to keep things neutral while protecting the original structure and functionality. Apologies if it looks a bit patchy – the goal was to avoid revealing any specific details or sensitive code.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eThe whole block is north of 400 lines, and it\u0026#39;s doing a \u003cem\u003elot\u003c/em\u003e. Or well, maybe it\u0026#39;s not, as you\u0026#39;ll see.\u003c/p\u003e\n\u003cp\u003eLet\u0026#39;s star with the outermost layer.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e\u003cspan class=\"hljs-variable\"\u003e$resm_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;group=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$item_id\u003c/span\u003e);\n\u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$value\u003c/span\u003e) {\n\u003cspan class=\"hljs-comment\"\u003e// rest of the code here\u003c/span\u003e\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eWe fetch data from a data source, presumably a database, passing our condition as a string, which reeks of probable SQL injection, but I don\u0026#39;t know what library they\u0026#39;re using. I also note they\u0026#39;re using the key/value style of array iteration, but never actually check the key.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e    \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$value\u003c/span\u003e-\u0026gt;option_id;\n    \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e);\n    \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e) {\n        \u003cspan class=\"hljs-variable\"\u003e$label\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;label\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n        \u003cspan class=\"hljs-variable\"\u003e$description\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;description\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n        \u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;category;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eNice little bit of \u0026#34;meta\u0026#34; programming to get their localization working, it\u0026#39;ll fetch \u003ccode\u003elabelen\u003c/code\u003e or \u003ccode\u003elabelde\u003c/code\u003e as needed. Definitely not a horrible, dangerous way to solve that problem.\u003c/p\u003e\n\u003cp\u003eWe use that again to get our currency figured out. That lets us do number formatting. So much number formatting code.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e =\n                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e .\n                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e4\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\n            \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eand\u003c/span\u003e\n            \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e\n        ) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e200\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        }\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eWhat is the \u003ccode\u003e$mot\u003c/code\u003e array? Why am I jumping to seemingly random locations in that array? Clearly it contains some headers for our output.\u003c/p\u003e\n\u003cp\u003eAnyway, there\u0026#39;s plenty of HTML string munging happening too, don\u0026#39;t you worry.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e =\n                \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;quantity-container\u0026#34;\u0026gt;\n                    \u0026lt;input type=\u0026#34;text\u0026#34; value=\u0026#34;1\u0026#34; id=\u0026#34;quantity-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; class=\u0026#34;qty-control\u0026#34; name=\u0026#34;quantity\u0026#34; min=\u0026#34;1\u0026#34; max=\u0026#34;1\u0026#34;\u0026gt;\n                    \u0026lt;div class=\u0026#34;increase button\u0026#34;\u0026gt;+\u0026lt;/div\u0026gt;\n                    \u0026lt;div class=\u0026#34;decrease button\u0026#34;\u0026gt;-\u0026lt;/div\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n            \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;all\u0026#34;\u003c/span\u003e;\n        }\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAnd then there\u0026#39;s this little treat for parsing the time stored in our database: \u003ccode\u003e$time_data = json_decode($resm_details-\u0026gt;time_data);\u003c/code\u003e That tells me they\u0026#39;re storing date times as strings, so that\u0026#39;s fun.\u003c/p\u003e\n\u003cp\u003eThere are also a couple more bon mots as they build a drop down list:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e            \u003cspan class=\"hljs-variable\"\u003e$departure_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e300\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$arrival_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e301\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAnd then there\u0026#39;s \u003cem\u003ethis\u003c/em\u003e monstrosity:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e        \u003cspan class=\"hljs-comment\"\u003e// Add the main option to the template\u003c/span\u003e\n        \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS\u0026#34;\u003c/span\u003e, [\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$label_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$action_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$label\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$description\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_cost_display\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CHILD_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$extra\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_extra\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$time_block\u003c/span\u003e\n        ]);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAll the nonsense that we concatenate together above gets shoved into some sort of template. And after that, that\u0026#39;s where the good stuff starts. Because guess what? We have to do the same thing for child items.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e        \u003cspan class=\"hljs-variable\"\u003e$resm_children_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;parent=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e);\n        \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_children_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$child_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_value\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_value\u003c/span\u003e-\u0026gt;option_id;\n            \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eThat\u0026#39;s right, it\u0026#39;s the same block of code, not quite copy/pasted, since they needed to put the word \u003ccode\u003echild\u003c/code\u003e in everything.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e                \u003cspan class=\"hljs-comment\"\u003e// Add the child option to the template\u003c/span\u003e\n                \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS.Block_OPTIONS_CHILD\u0026#34;\u003c/span\u003e, [\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_quantity\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_label_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_action_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_label\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_description\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_quantity_block\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_cost_display\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;CHILD_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_extra\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_extra\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$child_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_time_block\u003c/span\u003e\n                ]);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAnd now, if you liked the child record, guess what? Those children have got siblings. What can I say, it\u0026#39;s a big family.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e                \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;parent=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$parent_option_id\u003c/span\u003e);\n                \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_sibling_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$sibling_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_value\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_value\u003c/span\u003e-\u0026gt;option_id;\n                    \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eAnd that means, yes, we also use that template thing again:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e                        \u003cspan class=\"hljs-comment\"\u003e// Add the sibling option to the template\u003c/span\u003e\n                        \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS.Block_OPTIONS_CHILD\u0026#34;\u003c/span\u003e, [\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_label_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_action_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_label\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_description\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity_block\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_cost_display\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;SIBLING_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_extra\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_extra\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$sibling_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_time_block\u003c/span\u003e\n                        ]);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eSomeday, I hope the person who wrote this learn about methods and function calls. Maybe they could write their own one day.\u003c/p\u003e\n\u003cp\u003eIn any case, here\u0026#39;s the whole thing:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-php\"\u003e\u003cspan class=\"hljs-variable\"\u003e$resm_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;group=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$item_id\u003c/span\u003e);\n\u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$value\u003c/span\u003e) {\n    \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$value\u003c/span\u003e-\u0026gt;option_id;\n    \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e);\n    \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e) {\n        \u003cspan class=\"hljs-variable\"\u003e$label\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;label\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n        \u003cspan class=\"hljs-variable\"\u003e$description\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;description\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n        \u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;category;\n\n        \u003cspan class=\"hljs-comment\"\u003e// Process cost based on category\u003c/span\u003e\n        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e =\n                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e .\n                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e4\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\n            \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eand\u003c/span\u003e\n            \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e\n        ) {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n            \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e200\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n        }\n\n        \u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;location;\n        \u003cspan class=\"hljs-variable\"\u003e$label_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;has-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;no-quantity\u0026#34;\u003c/span\u003e;\n        \u003cspan class=\"hljs-variable\"\u003e$action_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-with-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-no-quantity\u0026#34;\u003c/span\u003e;\n        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e =\n                \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;quantity-container\u0026#34;\u0026gt;\n                    \u0026lt;input type=\u0026#34;text\u0026#34; value=\u0026#34;1\u0026#34; id=\u0026#34;quantity-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; class=\u0026#34;qty-control\u0026#34; name=\u0026#34;quantity\u0026#34; min=\u0026#34;1\u0026#34; max=\u0026#34;1\u0026#34;\u0026gt;\n                    \u0026lt;div class=\u0026#34;increase button\u0026#34;\u0026gt;+\u0026lt;/div\u0026gt;\n                    \u0026lt;div class=\u0026#34;decrease button\u0026#34;\u0026gt;-\u0026lt;/div\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n            \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;all\u0026#34;\u003c/span\u003e;\n        }\n\n        \u003cspan class=\"hljs-variable\"\u003e$has_times\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;has_times;\n\n        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$time_counter\u003c/span\u003e++;\n            \u003cspan class=\"hljs-variable\"\u003e$time_data\u003c/span\u003e = \u003cspan class=\"hljs-title function_ invoke__\"\u003ejson_decode\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;time_data);\n\n            \u003cspan class=\"hljs-variable\"\u003e$departure_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e300\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$arrival_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e301\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n\n            \u003cspan class=\"hljs-variable\"\u003e$departures\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$time_data\u003c/span\u003e-\u0026gt;departures;\n            \u003cspan class=\"hljs-variable\"\u003e$arrivals\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$time_data\u003c/span\u003e-\u0026gt;arrivals;\n\n            \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$departures\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$dep_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$departure\u003c/span\u003e) {\n                \u003cspan class=\"hljs-variable\"\u003e$departure_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$dep_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$departure\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n            }\n\n            \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$arrivals\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$arr_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$arrival\u003c/span\u003e) {\n                \u003cspan class=\"hljs-variable\"\u003e$arrival_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$arr_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$arrival\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n            }\n\n            \u003cspan class=\"hljs-variable\"\u003e$departure_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-right: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-departure\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$departure_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n            \u003cspan class=\"hljs-variable\"\u003e$arrival_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-left: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-arrival\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$arrival_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n            \u003cspan class=\"hljs-variable\"\u003e$time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;row time-container\u0026#34;\u0026gt;\n                \u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$departure_block\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$arrival_block\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\n            \u0026lt;/div\u0026gt;\u0026lt;small class=\u0026#34;error-message time-error\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e302\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/small\u0026gt;\u0026#39;\u003c/span\u003e;\n        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n            \u003cspan class=\"hljs-variable\"\u003e$time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e;\n        }\n\n        \u003cspan class=\"hljs-variable\"\u003e$host_cost_display\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n        \u003cspan class=\"hljs-variable\"\u003e$extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;extra;\n        \u003cspan class=\"hljs-variable\"\u003e$host_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;host_extra;\n        \u003cspan class=\"hljs-variable\"\u003e$host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n\n        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$extra_cost_1\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_1\u0026#34;\u003c/span\u003e};\n            \u003cspan class=\"hljs-variable\"\u003e$extra_cost_2\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_2\u0026#34;\u003c/span\u003e};\n\n            \u003cspan class=\"hljs-variable\"\u003e$default_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$host_price\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e ? \u003cspan class=\"hljs-variable\"\u003e$extra_cost_2\u003c/span\u003e : \u003cspan class=\"hljs-variable\"\u003e$extra_cost_1\u003c/span\u003e;\n            \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;extra-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$default_extra\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) .\n                \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;child-cost\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n\n            \u003cspan class=\"hljs-variable\"\u003e$host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34; extra-option\u0026#34;\u003c/span\u003e;\n        }\n        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$host_extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$host_cost_display\u003c/span\u003e =\n                \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;span class=\u0026#34;host-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;host-price\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e .\n                \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026lt;br\u0026gt;\u0026#34;\u003c/span\u003e;\n        }\n\n        \u003cspan class=\"hljs-comment\"\u003e// Add the main option to the template\u003c/span\u003e\n        \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS\u0026#34;\u003c/span\u003e, [\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$quantity\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$label_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$action_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$label\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$description\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$quantity_block\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$cost_info\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_cost_display\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$cost\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CHILD_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$location\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$category\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_class\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$extra\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$host_extra\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$time_block\u003c/span\u003e\n        ]);\n\n        \u003cspan class=\"hljs-variable\"\u003e$resm_children_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;parent=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$option_id\u003c/span\u003e);\n        \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_children_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$child_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_value\u003c/span\u003e) {\n            \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_value\u003c/span\u003e-\u0026gt;option_id;\n            \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e);\n            \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e) {\n                \u003cspan class=\"hljs-variable\"\u003e$child_label\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;label\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n                \u003cspan class=\"hljs-variable\"\u003e$child_description\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;description\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n                \u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;category;\n\n                \u003cspan class=\"hljs-comment\"\u003e// Process cost for child category\u003c/span\u003e\n                \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e =\n                        \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e .\n                        \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e4\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\n                    \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eand\u003c/span\u003e\n                    \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;child_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e\n                ) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e200\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                }\n\n                \u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;location;\n                \u003cspan class=\"hljs-variable\"\u003e$child_label_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;has-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;no-quantity\u0026#34;\u003c/span\u003e;\n                \u003cspan class=\"hljs-variable\"\u003e$child_action_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-with-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-no-quantity\u0026#34;\u003c/span\u003e;\n                \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_quantity_block\u003c/span\u003e =\n                        \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;quantity-container\u0026#34;\u0026gt;\n                    \u0026lt;input type=\u0026#34;text\u0026#34; value=\u0026#34;1\u0026#34; id=\u0026#34;child-quantity-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; class=\u0026#34;qty-control\u0026#34; name=\u0026#34;quantity\u0026#34; min=\u0026#34;1\u0026#34; max=\u0026#34;1\u0026#34;\u0026gt;\n                    \u0026lt;div class=\u0026#34;increase button\u0026#34;\u0026gt;+\u0026lt;/div\u0026gt;\n                    \u0026lt;div class=\u0026#34;decrease button\u0026#34;\u0026gt;-\u0026lt;/div\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_quantity\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_quantity_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_quantity\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;all\u0026#34;\u003c/span\u003e;\n                }\n\n                \u003cspan class=\"hljs-variable\"\u003e$child_has_times\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;has_times;\n\n                \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_time_counter\u003c/span\u003e++;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_time_data\u003c/span\u003e = \u003cspan class=\"hljs-title function_ invoke__\"\u003ejson_decode\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;time_data);\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_departure_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e300\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_arrival_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e301\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_departures\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_time_data\u003c/span\u003e-\u0026gt;departures;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_arrivals\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$child_time_data\u003c/span\u003e-\u0026gt;arrivals;\n\n                    \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_departures\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$child_dep_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_departure\u003c/span\u003e) {\n                        \u003cspan class=\"hljs-variable\"\u003e$child_departure_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_dep_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_departure\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                    }\n\n                    \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_arrivals\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$child_arr_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_arrival\u003c/span\u003e) {\n                        \u003cspan class=\"hljs-variable\"\u003e$child_arrival_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_arr_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_arrival\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                    }\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_departure_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-right: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-departure\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_departure_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_arrival_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-left: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-arrival\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_arrival_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;row time-container\u0026#34;\u0026gt;\n                \u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_departure_block\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_arrival_block\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\n            \u0026lt;/div\u0026gt;\u0026lt;small class=\u0026#34;error-message time-error\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e302\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/small\u0026gt;\u0026#39;\u003c/span\u003e;\n                } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e;\n                }\n\n                \u003cspan class=\"hljs-variable\"\u003e$child_host_cost_display\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                \u003cspan class=\"hljs-variable\"\u003e$child_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;extra;\n                \u003cspan class=\"hljs-variable\"\u003e$child_host_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;host_extra;\n                \u003cspan class=\"hljs-variable\"\u003e$child_host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n\n                \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost_1\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_1\u0026#34;\u003c/span\u003e};\n                    \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost_2\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_child_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_2\u0026#34;\u003c/span\u003e};\n\n                    \u003cspan class=\"hljs-variable\"\u003e$default_child_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$host_price\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e ? \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost_2\u003c/span\u003e : \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost_1\u003c/span\u003e;\n                    \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;extra-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$default_child_extra\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) .\n                        \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;child-cost\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n\n                    \u003cspan class=\"hljs-variable\"\u003e$child_host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34; extra-option\u0026#34;\u003c/span\u003e;\n                }\n                \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$child_host_extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$child_host_cost_display\u003c/span\u003e =\n                        \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;span class=\u0026#34;host-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;host-price\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e .\n                        \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026lt;br\u0026gt;\u0026#34;\u003c/span\u003e;\n                }\n\n                \u003cspan class=\"hljs-comment\"\u003e// Add the child option to the template\u003c/span\u003e\n                \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS.Block_OPTIONS_CHILD\u0026#34;\u003c/span\u003e, [\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_quantity\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_label_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_action_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_label\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_description\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_quantity_block\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost_info\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_cost_display\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_cost\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;CHILD_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_extra_cost\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_location\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_category\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_class\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_extra\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_host_extra\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$child_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$child_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n                    \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$child_time_block\u003c/span\u003e\n                ]);\n\n                \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_data\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$data_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetchData\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;parent=\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$parent_option_id\u003c/span\u003e);\n                \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_sibling_data\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$sibling_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_value\u003c/span\u003e) {\n                    \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_value\u003c/span\u003e-\u0026gt;option_id;\n                    \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$detail_source\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003efetch\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e);\n                    \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e) {\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_label\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;label\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_description\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;description\u003cspan class=\"hljs-subst\"\u003e$lang\u003c/span\u003e\u0026#34;\u003c/span\u003e};\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;category;\n\n                        \u003cspan class=\"hljs-comment\"\u003e// Process cost for sibling category\u003c/span\u003e\n                        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;sibling_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e =\n                                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e .\n                                \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;sibling_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e4\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelseif\u003c/span\u003e (\n                            \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eand\u003c/span\u003e\n                            \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;sibling_cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e} == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e\n                        ) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e200\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#34; : +\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n                        }\n\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;location;\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_label_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;has-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;no-quantity\u0026#34;\u003c/span\u003e;\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_action_class\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e ? \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-with-quantity\u0026#34;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#34;active-no-quantity\u0026#34;\u003c/span\u003e;\n                        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity_block\u003c/span\u003e =\n                                \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;quantity-container\u0026#34;\u0026gt;\n                    \u0026lt;input type=\u0026#34;text\u0026#34; value=\u0026#34;1\u0026#34; id=\u0026#34;sibling-quantity-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; class=\u0026#34;qty-control\u0026#34; name=\u0026#34;quantity\u0026#34; min=\u0026#34;1\u0026#34; max=\u0026#34;1\u0026#34;\u0026gt;\n                    \u0026lt;div class=\u0026#34;increase button\u0026#34;\u0026gt;+\u0026lt;/div\u0026gt;\n                    \u0026lt;div class=\u0026#34;decrease button\u0026#34;\u0026gt;-\u0026lt;/div\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity\u003c/span\u003e = \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;all\u0026#34;\u003c/span\u003e;\n                        }\n\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_has_times\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;has_times;\n\n                        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_time_counter\u003c/span\u003e++;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_time_data\u003c/span\u003e = \u003cspan class=\"hljs-title function_ invoke__\"\u003ejson_decode\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;time_data);\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_departure_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e300\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival_select\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;-1\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e301\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_departures\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_time_data\u003c/span\u003e-\u0026gt;departures;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_arrivals\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$sibling_time_data\u003c/span\u003e-\u0026gt;arrivals;\n\n                            \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_departures\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$sibling_dep_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_departure\u003c/span\u003e) {\n                                \u003cspan class=\"hljs-variable\"\u003e$sibling_departure_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_dep_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_departure\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                            }\n\n                            \u003cspan class=\"hljs-keyword\"\u003eforeach\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_arrivals\u003c/span\u003e \u003cspan class=\"hljs-keyword\"\u003eas\u003c/span\u003e \u003cspan class=\"hljs-variable\"\u003e$sibling_arr_key\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival\u003c/span\u003e) {\n                                \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival_select\u003c/span\u003e .= \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;option value=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_arr_key\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/option\u0026gt;\u0026#39;\u003c/span\u003e;\n                            }\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_departure_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-right: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-departure\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_departure_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;col-half time-select-\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; style=\u0026#34;padding-left: 0;\u0026#34;\u0026gt;\n                \u0026lt;select class=\u0026#34;form-control time-arrival\u0026#34; style=\u0026#34;text-align: center;\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival_select\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/select\u0026gt;\n                \u0026lt;/div\u0026gt;\u0026#39;\u003c/span\u003e;\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;div class=\u0026#34;row time-container\u0026#34;\u0026gt;\n                \u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_departure_block\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_arrival_block\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\n            \u0026lt;/div\u0026gt;\u0026lt;small class=\u0026#34;error-message time-error\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e302\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;/small\u0026gt;\u0026#39;\u003c/span\u003e;\n                        } \u003cspan class=\"hljs-keyword\"\u003eelse\u003c/span\u003e {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_time_block\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e;\n                        }\n\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_host_cost_display\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;extra;\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_host_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;host_extra;\n                        \u003cspan class=\"hljs-variable\"\u003e$sibling_host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026#34;\u003c/span\u003e;\n\n                        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost_1\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_1\u0026#34;\u003c/span\u003e};\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost_2\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$resm_sibling_details\u003c/span\u003e-\u0026gt;{\u003cspan class=\"hljs-string\"\u003e\u0026#34;cost\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34;_2\u0026#34;\u003c/span\u003e};\n\n                            \u003cspan class=\"hljs-variable\"\u003e$default_sibling_extra\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$host_price\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e ? \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost_2\u003c/span\u003e : \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost_1\u003c/span\u003e;\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e = \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e101\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;extra-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-title function_ invoke__\"\u003enumber_format\u003c/span\u003e(\u003cspan class=\"hljs-variable\"\u003e$default_sibling_extra\u003c/span\u003e, \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34;,\u0026#34;\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\u0026#34; \u0026#34;\u003c/span\u003e) .\n                                \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#34; - \u0026#34;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e102\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;sibling-cost\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e;\n\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_host_class\u003c/span\u003e = \u003cspan class=\"hljs-string\"\u003e\u0026#34; extra-option\u0026#34;\u003c/span\u003e;\n                        }\n                        \u003cspan class=\"hljs-keyword\"\u003eif\u003c/span\u003e (\u003cspan class=\"hljs-variable\"\u003e$sibling_host_extra\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) {\n                            \u003cspan class=\"hljs-variable\"\u003e$sibling_host_cost_display\u003c/span\u003e =\n                                \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026lt;span class=\u0026#34;host-cost\u0026#34;\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$mot\u003c/span\u003e[\u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e] . \u003cspan class=\"hljs-string\"\u003e\u0026#39; : +\u0026lt;span class=\u0026#34;host-price\u0026#34;\u0026gt;0.00\u0026lt;/span\u0026gt;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$currency_symbol\u003c/span\u003e .\n                                \u003cspan class=\"hljs-string\"\u003e\u0026#34;\u0026lt;/span\u0026gt;\u0026lt;br\u0026gt;\u0026#34;\u003c/span\u003e;\n                        }\n\n                        \u003cspan class=\"hljs-comment\"\u003e// Add the sibling option to the template\u003c/span\u003e\n                        \u003cspan class=\"hljs-variable\"\u003e$TEMPLATE\u003c/span\u003e-\u0026gt;\u003cspan class=\"hljs-title function_ invoke__\"\u003eSET_BLOCK_VARIABLES\u003c/span\u003e(\u003cspan class=\"hljs-string\"\u003e\u0026#34;Block_OPTIONS.Block_OPTIONS_CHILD\u0026#34;\u003c/span\u003e, [\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ID\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_label_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;ACTION_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_action_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LABEL\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_label\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;DESCRIPTION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_description\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;QUANTITY_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_quantity_block\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST_INFO\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_cost_info\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_COST_DISPLAY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_cost_display\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_cost\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;SIBLING_COST\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_extra_cost\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;LOCATION\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_location\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;CATEGORY\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_category\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_CLASS\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_class\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_extra\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;HOST_EXTRA\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_host_extra\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_CHECKED\u0026#34;\u003c/span\u003e =\u0026gt; (\u003cspan class=\"hljs-variable\"\u003e$sibling_has_times\u003c/span\u003e == \u003cspan class=\"hljs-number\"\u003e1\u003c/span\u003e) ? \u003cspan class=\"hljs-string\"\u003e\u0026#39;selected=\u0026#34;\u0026#39;\u003c/span\u003e . \u003cspan class=\"hljs-variable\"\u003e$sibling_option_id\u003c/span\u003e . \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#34; checked=\u0026#34;true\u0026#34;\u0026#39;\u003c/span\u003e : \u003cspan class=\"hljs-string\"\u003e\u0026#39;\u0026#39;\u003c/span\u003e,\n                            \u003cspan class=\"hljs-string\"\u003e\u0026#34;TIME_BLOCK\u0026#34;\u003c/span\u003e =\u0026gt; \u003cspan class=\"hljs-variable\"\u003e$sibling_time_block\u003c/span\u003e\n                        ]);\n                    }\n                }\n            }\n        }\n    }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003c!-- Easy Reader Version: Who doesn\u0027t love a gigantic code blob? --\u003e\n\u003cstyle\u003e.comment { border: none; }\u003c/style\u003e\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/proget-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\tProGet’s got you covered with security and access controls on your NuGet feeds. \u003ca href=\"https://inedo.com/proget/private-nuget-server?utm_source=tdwtf\u0026amp;utm_medium=footer\u0026amp;utm_content=GotYouCoveredFooter\u0026amp;utm_campaign=Cyclops2020\"\u003eLearn more.\u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Title":"The Big Family","RssTitle":"CodeSOD: The Big Family","CachedCommentCount":20,"LastCommentDate":"\/Date(1788199938567)\/","LastCommentDateDescription":"2026-08-31","DiscourseTopicId":null,"DiscourseTopicOpened":false,"PublishedDate":"\/Date(1787812200000)\/","ISODate":"2026-08-27","DisplayDate":"2026-08-27","Series":{"Slug":"code-sod","Title":"CodeSOD","Description":"Code Snippet Of the Day (CodeSOD) features interesting and usually incorrect code snippets taken from actual production code in a commercial and/or open source software projects.","CssClass":"code"},"FooterAdHtml":"\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/proget-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\tProGet’s got you covered with security and access controls on your NuGet feeds. \u003ca href=\"https://inedo.com/proget/private-nuget-server?utm_source=tdwtf\u0026amp;utm_medium=footer\u0026amp;utm_content=GotYouCoveredFooter\u0026amp;utm_campaign=Cyclops2020\"\u003eLearn more.\u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Url":"https://thedailywtf.com/articles/the-big-family","CommentsUrl":"https://thedailywtf.com/articles/comments/the-big-family","Slug":"the-big-family","TwitterUrl":"//www.twitter.com/home?status=https%3a%2f%2fthedailywtf.com%2farticles%2fthe-big-family+-+The+Big+Family+-+The+Daily+WTF","FacebookUrl":"//www.facebook.com/sharer.php?u=https%3a%2f%2fthedailywtf.com%2farticles%2fthe-big-family\u0026t=The+Big+Family+-+The+Daily+WTF","EmailUrl":"mailto:%20?subject=Check%20out%20this%20article%20on%20The%20Daily%20WTF...\u0026body=The%20Big%20Family:%20https://thedailywtf.com/articles/the-big-family","GooglePlusUrl":"//plus.google.com/share?url=https%3a%2f%2fthedailywtf.com%2farticles%2fthe-big-family","PreviousArticleId":11258,"PreviousArticleTitle":"Lock \u0027Em Dead","PreviousArticleSlug":"lock-em-dead","PreviousArticleUrl":"//thedailywtf.com/articles/lock-em-dead","NextArticleId":11260,"NextArticleTitle":"Hello, New Mexico!","NextArticleSlug":"hello-new-mexico","NextArticleUrl":"//thedailywtf.com/articles/hello-new-mexico"},{"Id":11258,"Author":{"Name":"Remy Porter","FirstName":"Remy","ShortDescription":"Computers were a mistake, so I accidentally became a farmer? Editor-in-Chief for TDWTF.","DescriptionHtml":"\u003cp\u003eRemy is a veteran developer who writes software for farming robots. They pick tomatoes.\u003c/p\u003e\r\n\u003cp\u003eHe\u0027s often on stage, doing improv comedy, but insists that \u003cem\u003ehe\u003c/em\u003e isn\u0027t doing comedy- it\u0027s deadly serious. You\u0027re laughing at him, not with him. That, by the way, is usually true- you\u0027re laughing at him, not with him.\u003c/p\u003e","Slug":"remy-porter","IsAdmin":true,"IsActive":true,"ImageUrl":"https://s3.amazonaws.com/remy.jetpackshark.com/remy-thumb.jpg"},"Status":"Published","SummaryHtml":"\u003cp\u003e\u003cstrong\u003eKevin\u003c/strong\u003e sends us an exception handler from C++. Let\u0026#39;s see if we can spot what\u0026#39;s going wrong:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-cpp\"\u003e\u003cspan class=\"hljs-built_in\"\u003ecatch\u003c/span\u003e (Exception::Deadlock)\n{\n   retry;\n}\n\u003c/code\u003e\u003c/pre\u003e\n","BodyHtml":"\u003cp\u003e\u003cstrong\u003eKevin\u003c/strong\u003e sends us an exception handler from C++. Let\u0026#39;s see if we can spot what\u0026#39;s going wrong:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-cpp\"\u003e\u003cspan class=\"hljs-built_in\"\u003ecatch\u003c/span\u003e (Exception::Deadlock)\n{\n   retry;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eWhen we catch a deadlock happening, we \u003ccode\u003eretry\u003c/code\u003e. That\u0026#39;s not a keyword in C++, and looking at how it\u0026#39;s used, it has to be some kind of macro, and I suspect that the macro is hiding a \u003ccode\u003egoto\u003c/code\u003e underneath it.\u003c/p\u003e\n\u003cp\u003eThe real problem, though, is that we suspect we\u0026#39;re in a deadlock situation. That means this thread is waiting on a resource held by another thread which is waiting for a resource held by this thread. Neither train may continue until the other has passed. So this \u003ccode\u003eretry\u003c/code\u003e only works if it releases the resource held by this thread (letting the deadlocking thread proceed). But does it?\u003c/p\u003e\n\u003cp\u003eNot according ot Kevin. The code already had a pile of deadlocks in it, so they brought in a highly paid consultant to try and fix them by reordering access and tracing where mutexes were causing issues. This \u003ccode\u003eretry\u003c/code\u003e just jumps back up to the top of the block, without releasing any resources. It \u0026#34;seems the consultant wanted to add some deadlocks of their own,\u0026#34; Kevin says.\u003c/p\u003e\n\u003c!-- Easy Reader Version: Usually it\u0027s \"kill a thread\" to clear a deadlock, but not for this HPC. --\u003e","BodyAndAdHtml":"\u003cp\u003e\u003cstrong\u003eKevin\u003c/strong\u003e sends us an exception handler from C++. Let\u0026#39;s see if we can spot what\u0026#39;s going wrong:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-cpp\"\u003e\u003cspan class=\"hljs-built_in\"\u003ecatch\u003c/span\u003e (Exception::Deadlock)\n{\n   retry;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eWhen we catch a deadlock happening, we \u003ccode\u003eretry\u003c/code\u003e. That\u0026#39;s not a keyword in C++, and looking at how it\u0026#39;s used, it has to be some kind of macro, and I suspect that the macro is hiding a \u003ccode\u003egoto\u003c/code\u003e underneath it.\u003c/p\u003e\n\u003cp\u003eThe real problem, though, is that we suspect we\u0026#39;re in a deadlock situation. That means this thread is waiting on a resource held by another thread which is waiting for a resource held by this thread. Neither train may continue until the other has passed. So this \u003ccode\u003eretry\u003c/code\u003e only works if it releases the resource held by this thread (letting the deadlocking thread proceed). But does it?\u003c/p\u003e\n\u003cp\u003eNot according ot Kevin. The code already had a pile of deadlocks in it, so they brought in a highly paid consultant to try and fix them by reordering access and tracing where mutexes were causing issues. This \u003ccode\u003eretry\u003c/code\u003e just jumps back up to the top of the block, without releasing any resources. It \u0026#34;seems the consultant wanted to add some deadlocks of their own,\u0026#34; Kevin says.\u003c/p\u003e\n\u003c!-- Easy Reader Version: Usually it\u0027s \"kill a thread\" to clear a deadlock, but not for this HPC. --\u003e\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/buildmaster-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\t\u003ca href=\"https://inedo.com/BuildMaster?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eBuildMaster\u003c/a\u003e allows you to create a self-service release management platform that allows different teams to manage their applications. \u003ca href=\"https://inedo.com/BuildMaster/download?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eExplore how!\u003c/a\u003e \n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Title":"Lock \u0027Em Dead","RssTitle":"CodeSOD: Lock \u0027Em Dead","CachedCommentCount":25,"LastCommentDate":"\/Date(1788106101143)\/","LastCommentDateDescription":"2026-08-30","DiscourseTopicId":null,"DiscourseTopicOpened":false,"PublishedDate":"\/Date(1787725800000)\/","ISODate":"2026-08-26","DisplayDate":"2026-08-26","Series":{"Slug":"code-sod","Title":"CodeSOD","Description":"Code Snippet Of the Day (CodeSOD) features interesting and usually incorrect code snippets taken from actual production code in a commercial and/or open source software projects.","CssClass":"code"},"FooterAdHtml":"\u003cdiv\u003e\n\t\u003cimg src=\"https://thedailywtf.com/images/inedo/buildmaster-icon.png\" style=\"display:block; float: left; margin: 0 10px 10px 0;\"/\u003e [Advertisement] \n\t\u003ca href=\"https://inedo.com/BuildMaster?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eBuildMaster\u003c/a\u003e allows you to create a self-service release management platform that allows different teams to manage their applications. \u003ca href=\"https://inedo.com/BuildMaster/download?utm_source=tdwtf\u0026amp;utm_medium=footerad\u0026amp;utm_term=2018\u0026amp;utm_content=Self_Service\u0026amp;utm_campaign=Buildmaster_Footer\"\u003eExplore how!\u003c/a\u003e \n\u003c/div\u003e\n\u003cdiv style=\"clear: left;\"\u003e \u003c/div\u003e\n","Url":"https://thedailywtf.com/articles/lock-em-dead","CommentsUrl":"https://thedailywtf.com/articles/comments/lock-em-dead","Slug":"lock-em-dead","TwitterUrl":"//www.twitter.com/home?status=https%3a%2f%2fthedailywtf.com%2farticles%2flock-em-dead+-+Lock+%27Em+Dead+-+The+Daily+WTF","FacebookUrl":"//www.facebook.com/sharer.php?u=https%3a%2f%2fthedailywtf.com%2farticles%2flock-em-dead\u0026t=Lock+%27Em+Dead+-+The+Daily+WTF","EmailUrl":"mailto:%20?subject=Check%20out%20this%20article%20on%20The%20Daily%20WTF...\u0026body=Lock%20\u0027Em%20Dead:%20https://thedailywtf.com/articles/lock-em-dead","GooglePlusUrl":"//plus.google.com/share?url=https%3a%2f%2fthedailywtf.com%2farticles%2flock-em-dead","PreviousArticleId":11257,"PreviousArticleTitle":"Both Ways Bug Me","PreviousArticleSlug":"both-ways-bug-me","PreviousArticleUrl":"//thedailywtf.com/articles/both-ways-bug-me","NextArticleId":11259,"NextArticleTitle":"The Big Family","NextArticleSlug":"the-big-family","NextArticleUrl":"//thedailywtf.com/articles/the-big-family"}]