{"id":7573,"date":"2025-09-13T20:48:10","date_gmt":"2025-09-13T17:48:10","guid":{"rendered":"https:\/\/athensmusic.gr\/?page_id=7573"},"modified":"2025-09-14T18:00:39","modified_gmt":"2025-09-14T15:00:39","slug":"rental-calculator","status":"publish","type":"page","link":"https:\/\/athensmusic.gr\/en\/rental-calculator\/","title":{"rendered":"Rental Calculator"},"content":{"rendered":"\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><strong>1st Day:<\/strong> Regular price (0% discount)<\/li>\r\n\r\n\r\n\r\n<li><strong>2nd Day:<\/strong> 20% discount off the list price<\/li>\r\n\r\n\r\n\r\n<li><strong>3rd Day:<\/strong> 25% discount off the list price<\/li>\r\n\r\n\r\n\r\n<li><strong>4rd Day:<\/strong> 30% discount off the list price<\/li>\r\n\r\n\r\n\r\n<li><strong>5rd Day:<\/strong> 35% discount off the list price<\/li>\r\n\r\n\r\n\r\n<li><strong>6rd Day:<\/strong> 40% discount off the list price<\/li>\r\n\r\n\r\n\r\n<li><strong>7rd Day:<\/strong> 45% discount off the list price<\/li>\r\n\r\n\r\n\r\n<li><strong>8th Day and onwards:<\/strong> 50% discount off the list price<\/li>\r\n<\/ul>\r\n\r\n\r\n<div style=\"margin:20px auto; padding:20px;\">\r\n  <label for=\"dailyPrice\">Daily Rate (\u20ac):<\/label><br>\r\n  <input\r\n    type=\"text\"\r\n    id=\"dailyPrice\"\r\n    placeholder=\"e.g. 100\u20ac\"\r\n    style=\"width:100%; padding:8px; margin:8px 0; text-align:right;\"\r\n    oninput=\"this.value = this.value.replace(\/[^0-9]\/g, '');\"\r\n  ><br>\r\n\r\n  <label for=\"days\">Number of Days:<\/label><br>\r\n  <input\r\n    type=\"text\"\r\n    id=\"days\"\r\n    value=\"2\"\r\n    style=\"width:100%; padding:8px; margin:8px 0; text-align:right;\"\r\n    oninput=\"this.value = this.value.replace(\/[^0-9]\/g, '').replace(\/^0+\/, '');\"\r\n    onblur=\"if(this.value==='') { this.value='2'; } else if(parseInt(this.value,10) < 2) { this.value='2'; }\"\r\n  ><br>\r\n\r\n  <button\r\n    onclick=\"calculateTotal()\"\r\n    style=\"width:100%; padding:10px; margin-top:10px; background:#1a84ee; color:#fff; border:none; border-radius:8px; cursor:pointer;\"\r\n  >\r\n    Calculate\r\n  <\/button>\r\n\r\n  <div id=\"result\" style=\"margin-top:15px; font-size:16px; font-weight:bold; text-align:center;\"><\/div>\r\n<\/div>\r\n\r\n<script>\r\n  function calculateTotal() {\r\n    const priceField = document.getElementById('dailyPrice');\r\n    const daysField = document.getElementById('days');\r\n    if (daysField.value === '') daysField.value = '2';\r\n    let days = parseInt(daysField.value, 10);\r\n    if (isNaN(days) || days < 2) {\r\n      daysField.value = '2';\r\n      days = 2;\r\n    }\r\n\r\n    const price = parseFloat(priceField.value);\r\n    if (isNaN(price) || price <= 0) {\r\n      document.getElementById('result').innerText = \"Please enter a valid daily rate (numbers only).\";\r\n      return;\r\n    }\r\n\r\n    \/\/ Original cost without discounts\r\n    const originalTotal = price * days;\r\n\r\n    \/\/ Discount table\r\n    const discounts = {\r\n      1: 0,\r\n      2: 0.20,\r\n      3: 0.25,\r\n      4: 0.30,\r\n      5: 0.35,\r\n      6: 0.40,\r\n      7: 0.45\r\n      \/\/ 8+ => 0.50\r\n    };\r\n\r\n    \/\/ Calculate total with discounts\r\n    let total = 0;\r\n    for (let i = 1; i <= days; i++) {\r\n      let discount = discounts[i] !== undefined ? discounts[i] : 0.50;\r\n      total += price * (1 - discount);\r\n    }\r\n\r\n    document.getElementById('result').innerText =\r\n      \"From \" + originalTotal.toFixed(2) + \"\u20ac, final price for \" + days + \" days: \" + total.toFixed(2) + \"\u20ac\";\r\n  }\r\n<\/script>\r\n\r\n\r\n\r\n\r\n\r\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\r\n<div class=\"wp-block-button has-custom-width wp-block-button__width-100\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/athensmusic.gr\/en\/rental-equipment\/\">BACK TO RENTAL EQUIPMENT<\/a><\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\r\n","protected":false},"excerpt":{"rendered":"<p>1st Day: Regular price (0% discount) 2nd Day: 20% discount off the list price 3rd Day: 25% discount off the list price 4rd Day: 30% discount off the list price [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"wf_page_folders":[114],"class_list":["post-7573","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/athensmusic.gr\/en\/wp-json\/wp\/v2\/pages\/7573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/athensmusic.gr\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/athensmusic.gr\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/athensmusic.gr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/athensmusic.gr\/en\/wp-json\/wp\/v2\/comments?post=7573"}],"version-history":[{"count":0,"href":"https:\/\/athensmusic.gr\/en\/wp-json\/wp\/v2\/pages\/7573\/revisions"}],"wp:attachment":[{"href":"https:\/\/athensmusic.gr\/en\/wp-json\/wp\/v2\/media?parent=7573"}],"wp:term":[{"taxonomy":"wf_page_folders","embeddable":true,"href":"https:\/\/athensmusic.gr\/en\/wp-json\/wp\/v2\/wf_page_folders?post=7573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}