1$(function () { 2 3 var debounce = function debounce(func, wait, immediate) { 4 var timeout; 5 return function () { 6 var context = this, 7 args = arguments; 8 var later = function () { 9 timeout = null; 10 if (!immediate) func.apply(context, args); 11 }; 12 var callNow = immediate && !timeout; 13 clearTimeout(timeout); 14 timeout = setTimeout(later, wait); 15 if (callNow) func.apply(context, args); 16 }; 17 }; 18$("body").on("click", "div#booking_section input[data-booking]", function (e) { 19 e.preventDefault(); 20 var $thisbookdiv = $("div#booking_section"); 21 pleasewait(1); 22 if ( 23 $thisbookdiv.find("select.productselect").val() == "0" || 24 $thisbookdiv.find("input#date_booking").val().length < 2 || 25 $thisbookdiv.find("input#name_booking").val().length < 5 || 26 $thisbookdiv.find("input#email_booking").val().length < 10 27 ) { 28 messagecentre( "yel", decodeURIComponent(escape(atob(window.theSetting['databasemessage']))).split('!!')[11], ); 29 return false; 30 } 31 var $ProductID = $thisbookdiv.find("select.productselect").val(); 32 var $CartName = btoa(unescape(encodeURIComponent($thisbookdiv.find("input#name_booking").val().replace(/\'/g, "â")))); 33 var $CartEmail = btoa(unescape(encodeURIComponent($thisbookdiv.find("input#email_booking").val().replace(/\'/g, "â")))); 34 var $CartPhone = btoa(unescape(encodeURIComponent("+90"))); 35 var $AddressArray = ["x", "x", "x", "x", "x"]; 36 var $CartAddress = btoa( unescape(encodeURIComponent($AddressArray.join(",").replace(/\'/g, "â"))) ); 37 var $CartDate = $.format.date(new Date(), "yyyy-MM-dd HH:mm"); 38 var $CartNote = []; 39 $CartNote.push( 40 $thisbookdiv.find("textarea#subject_booking").val().replace(/\'/g, "â") 41 ); 42 $CartNote.push($thisbookdiv.find("input#date_booking").val()); 43 var dataProdClass = []; 44 var selectedOptionValue = [ 45 $thisbookdiv.find("input#date_booking").val(), 46 decodeURIComponent(escape(atob(getformvalues($thisbookdiv)))), 47 ]; 48 var $itemCount = 1; 49 50 $("div.bookform").load( 51 "../webparts/addcart.modal.php", 52 { 53 ProductID: $ProductID, 54 ProdClassID: dataProdClass, 55 BookNote: selectedOptionValue, 56 ItemCount: $itemCount, 57 }, 58 function () { 59 var $thisform = $("div.bookform").find("form"); 60 var $CartID = $thisform.find("input.CartID").val(); 61 var $ProductID = $thisform.find("input.ProductID").val(); 62 var $ItemCount = $thisform.find("input.ItemCount").val(); 63 var $ItemPrice = parseFloat($thisform.find("input.ProductPrice").val()); 64 var $SuccessMessage = $thisform.find("input.SuccessMessage").val(); 65 var $ItemNotes = btoa( unescape( encodeURIComponent( $thisform.find("input.MessageBody").val().replace(/\'/g, "â") ) ) ); 66 var $CartProduct = btoa( unescape( encodeURIComponent( $thisform.find("input.CartProduct").val().replace(/\'/g, "â") ) ) ); 67 $thisform.find("input").attr("disabled", "disabled"); 68 $thisform.find("input").attr("readonly", "readonly"); 69 $thisform.find("textarea").attr("disabled", "disabled"); 70 $thisform.find("textarea").attr("readonly", "readonly"); 71 // console.log($thisform.find("input.CartUpgrade").val().replace(/\'/g, "â")); 72 if (true) { 73 $.post( 74 "../datacontrol/bookingitems.dc.php", 75 { 76 bookingitemsman: "bookingitemsadd", 77 submit: "submit", 78 ItemID: "", 79 CartID: $CartID, 80 ProductID: $ProductID, 81 ItemCount: $ItemCount, 82 ItemPrice: $ItemPrice, 83 ItemNotes: $ItemNotes, 84 ItemImage: $CartProduct, 85 ItemMeasure:'', 86 ItemCost:0, 87 ItemWeight:0, 88 ItemStatus: 1, 89 }, 90 function (data, status) { 91 console.log(data); 92 if (status == "success") { 93 var $ardata = JSON.parse(data); 94 if ($ardata[0].substring(0, 2) == "--") { 95 var itemcats = $thisform 96 .find("input.CategoryName") 97 .val() 98 .split(","); 99 try { 100 dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. 101 dataLayer.push({ 102 event: "add_to_cart", 103 ecommerce: {
104 currency: decodeURIComponent( 105 escape(atob($("body").data("currency"))) 106 ).split(";;")[0], 107 value: $ItemPrice * $itemCount, 108 items: [ 109 { 110 item_id: $ProductID, 111 item_name: $thisform 112 .find("input.MessageSubject") 113 .val(), 114 affiliation: $("html title").text(), 115 coupon: "NOKOPON", 116 discount: 0, 117 index: 0, 118 item_brand: $thisform 119 .find("input.MessageSubject") 120 .val(), 121 item_category: itemcats[0], 122 item_category2: 123 itemcats.length > 1 ? itemcats[1] : "", 124 item_category3: 125 itemcats.length > 2 ? itemcats[2] : "", 126 item_category4: "", 127 item_category5: "", 128 item_list_id: "feature_products", 129 item_list_name: "Feature Products", 130 item_variant: selectedOptionValue.join("-"), 131 location_id: "", 132 price: $ItemPrice, 133 quantity: $itemCount, 134 }, 135 ], 136 }, 137 }); 138 } catch (error) {} 139 var icon = "green"; 140 var datamsg = $ardata[0].substring(2); 141 $.post( 142 "../datacontrol/bookingcart.dc.php", 143 { 144 bookingcartman: "bookingcartedit", 145 submit: "submit", 146 CartID: $CartID, 147 CartName: $CartName, 148 CartPhone: $CartPhone, 149 CartEmail: $CartEmail, 150 CartAddress: $CartAddress, 151 CartDate: $CartDate, 152 CartNote: btoa( 153 unescape(encodeURIComponent($CartNote.join(" - "))) 154 ), 155 CartStatus: 2, 156 }, 157 function (data, status) { 158 console.log(data); 159 if (status == "success") { 160 var $ardata = JSON.parse(data); 161 if ($ardata[0].substring(0, 2) == "--") { 162 // prepCartItems(); 163 try { 164 dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. 165 dataLayer.push({ 166 event: "purchase", 167 ecommerce: { 168 transaction_id: "ORDER-" + pad($CartID, 5), 169 // Sum of (price * quantity) for all items. 170 value: parseFloat( 171 $( 172 "body div.shopping-cart-area div.shopping-cart div.tab-content div#shopping-cart table.total-cart tr.total-cart td.total-cart" 173 ).attr("data-totalcart") 174 ), 175 tax: 0, 176 shipping: 0, 177 currency: decodeURIComponent(escape(atob(window.theSetting['sitecurrency']))).split('!!')[0], 178 coupon: $( 179 "body div.shopping-cart-area div.shopping-cart div.tab-content div#shopping-cart table.total-cart tr.couponcode td.couponcode" 180 ).attr("data-couponcode"), 181 items: cartItemList, 182 }, 183 }); 184 } catch (error) {} 185 var icon = "green"; 186 var datamsg = $ardata[0].substring(2); 187 $("body").attr("data-cartid", $ardata[1]); 188 Swal.fire({ 189 title: decodeURIComponent( escape( atob( $thisform .find("input.CartSuccess") .attr("data-head") ) ) ).replace("%s", pad($ardata[1], 5)), 190 text: decodeURIComponent( escape( atob( $thisform .find("input.CartSuccess") .attr("data-title") ) ) ), 191 icon: "success",
192 showDenyButton: false, 193 allowEscapeKey: false, 194 allowOutsideClick: false, 195 denyButtonColor: "#12C6CD80", 196 denyButtonText: 197 '<i class="fal fa-file-pdf"></i> ' + 198 txtLang( 199 "Download Reservation", 200 "تØÙ ÙÙ Ù ÙÙ Ø§ÙØ·Ùب", 201 "indir" 202 ), 203 }).then((result) => { 204 if (result.isConfirmed) { 205 $.post( 206 "../include/email.template.php", 207 { 208 emailCont: { 209 CartID: $ardata[1], 210 }, 211 }, 212 function (data) {} 213 ); 214 window.location = "../thankyou/"; 215 } else if (result.isDenied) { 216 $.post( 217 "../include/email.template.php", 218 { 219 emailCont: { 220 CartID: $ardata[1], 221 }, 222 }, 223 function (data) {} 224 ); 225 let pdfwin; 226 pdfwin = window.open( 227 "../include/pdf.template.php?emailCont[CartID]=" + 228 $ardata[1], 229 "_blank" 230 ); 231 setTimeout(() => { 232 pdfwin.close(); 233 window.location = "../thankyou/"; 234 }, 10000); 235 } 236 }); 237 } else { 238 if ($ardata[0].substring(0, 2) == "++") { 239 var icon = "yel"; 240 var datamsg = $ardata[0].substring(2); 241 } else { 242 var icon = "red"; 243 var datamsg = $ardata[0]; 244 } 245 messagecentre(icon, datamsg); 246 } 247 // 248 } 249 } 250 ); 251 } else { 252 if ($ardata[0].substring(0, 2) == "++") { 253 var icon = "yel"; 254 var datamsg = $ardata[0].substring(2); 255 messagecentre(icon, datamsg); 256 } else { 257 Swal.fire({ 258 title: decodeURIComponent( 259 escape( 260 atob( 261 $thisform.find("input.CartFail").attr("data-head") 262 ) 263 ) 264 ).replace("%s", pad($ardata[1], 5)), 265 text: decodeURIComponent( 266 escape( 267 atob( 268 $thisform.find("input.CartFail").attr("data-title") 269 ) 270 ) 271 ), 272 icon: "error", 273 showDenyButton: false, 274 allowEscapeKey: false, 275 allowOutsideClick: false, 276 }); 277 } 278 } 279 // 280 } 281 } 282 ); 283 } 284 } 285 ); 286}); 287 288});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.