1function ValidateEmail(emailid) 2{ 3 var mailformat = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; 4 if(emailid.match(mailformat)) 5 { 6 return true; 7 } 8 return false; 9} 10 11function is_url(str) 12{ 13 regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/; 14 if (regexp.test(str)) 15 { 16 return true; 17 } 18 else 19 { 20 return false; 21 } 22} 23 24 25$('#product').on('change', function(){ 26 27 $('#products_error').html(''); 28 $("#productdropdown_error").html(''); 29 30 var product_val = $(this).val(); 31 console.log('product'+product_val); 32 if(product_val == 0){ 33 $('#selectdown').hide(); 34 }else{ 35 $('#selectdown').show(); 36 } 37 38}); 39 40$('#phone_add1').bind('keyup', function(){ 41 this.value = this.value.replace(/[^\d+]/g, ''); 42}); 43 44 45 46$("#proceed").click(function(e){ 47 48 var status = true; 49 50 if ($("#name_add1").val()=="") { 51 status = false; 52 e.preventDefault(); 53 $("#name_error").html("Please enter your Name."); 54 $("#name_add1").focus(); 55 $('html,body').animate({ 56 scrollTop: $('.col-sm-6').offset().top 57}); 58 } else { 59 $("#name_error").html(""); 60 } 61 62 63 if ($("#email_add1").val()=="") { 64 status = false; 65 e.preventDefault(); 66 $("#emailadd_error").html("Please enter your Email Id."); 67 $("#email_add1").focus(); 68 $('html,body').animate({ 69 scrollTop: $('.col-sm-6').offset().top 70}); 71 } else if (ValidateEmail($("#email_add1").val())==false) { 72 status = false; 73 e.preventDefault(); 74 $("#emailadd_error").html("Please enter valid Email Id."); 75 $("#email_add1").focus(); 76 $('html,body').animate({ 77 scrollTop: $('.col-sm-6').offset().top 78}); 79 } else { 80 $("#emailadd_error").html(""); 81 } 82 83 if ($("#phone_add1").val()=="") { 84 status = false; 85 e.preventDefault(); 86 $("#phone_error").html("Please enter your Phone Number."); 87 $("#phone_add1").focus(); 88 $('html,body').animate({ 89 scrollTop: $('.col-sm-6').offset().top 90}); 91 } else { 92 $("#phone_error").html(""); 93 } 94 95 if ($("#country_add1").val()==0) { 96 status = false; 97 e.preventDefault(); 98 $("#country_error").html("Please select your Country."); 99 $("#country_add1").focus(); 100 $('html,body').animate({ 101 scrollTop: $('.col-sm-6').offset().top 102}); 103 } else { 104 $("#country_error").html(""); 105 } 106 107 if ($("#address_add1").val()=="") { 108 status = false; 109 e.preventDefault(); 110 $("#address_error").html("Please enter your Address."); 111 $("#address_add1").focus(); 112 $('html,body').animate({ 113 scrollTop: $('.col-sm-6').offset().top 114}); 115 } else if (is_url($("#address_add1").val())==true) { 116 status = false; 117 e.preventDefault(); 118 $("#address_error").html("We don't allow urls in address."); 119 $("#address_add1").focus(); 120 $('html,body').animate({ 121 scrollTop: $('.col-sm-6').offset().top 122}); 123 } else { 124 $("#address_error").html(""); 125 } 126 127 128 if ($("#6_letters_code").val()=="") { 129 status = false; 130 e.preventDefault(); 131 $("#captcha_code_error").html("Please enter 6 Digit captcha code."); 132 $("#6_letters_code").focus(); 133 } else { 134 $("#captcha_code_error").html(""); 135 } 136 137 // if ($("#products_list").val()=="") { 138 // status = false; 139 // $("#products_error").html("Please select registation items."); 140 /* } else if($("#products_list").val()=="[[]]") { 141 status = false; 142 $("#products_error").html("Please select registation items."); */ 143 // } else { 144 // $("#products_error").html(""); 145 // } 146 147 var product = $('#tot_amt').val(); 148 //alert('product:'+product); 149 if (product == 0 || product == ''||product == undefined) { 150 status = false; 151 e.preventDefault(); 152 $("#productdropdown_error").html("Please select registation items."); 153 154 } else { 155 $("#productdropdown_error").html(''); 156 } 157 158 if ($("#conditions").prop("checked")==false) { 159 status = false; 160 e.preventDefault(); 161 $("#conditions_error").html("Please check the terms and conditions."); 162 163 } else { 164 $("#conditions_error").html(""); 165 } 166 167 if ($("#product_checkbox").prop("checked")==false) { 168 status = false; 169 e.preventDefault(); 170 $("#products_checkbox_error").html("Please check the items."); 171 } else { 172 $("#products_checkbox_error").html(""); 173 } 174 175 if (status) { 176 $("#submitbtn").click(); 177 } 178 179 //clear register form errors 180 181 $('#name_add1').keyup(function(){ 182 $('#name_error').html(''); 183 }); 184 185 $('#email_add1').keyup(function(){ 186 $('#emailadd_error').html(''); 187 }); 188 189 $('#phone_add1').keyup(function(){ 190 $('#phone_error').html(''); 191 }); 192 193 $('#address_add1').keyup(function(){ 194 $('#address_error').html(''); 195 }); 196 197 $('#6_letters_code').keyup(function(){ 198 $('#captcha_code_error').html(''); 199 }); 200 201 $('#country_add1').on('change', function(){ 202 $('#country_error').html(''); 203 }); 204 205 $('#conditions').click(function(){ 206 if (this.checked) { 207 $("#conditions_error").html(''); 208 } 209 }); 210 211 $('#product_checkbox').click(function(){ 212 if (this.checked) { 213 $("#products_checkbox_error").html(''); 214 } 215 }); 216 217}); 218 219 220var tot_amt = 0; 221var currency = "eur"; 222var currency_symbol = "€"; 223var ticket = []; 224var product = null; 225var selected = []; 226var finalSelectedProducts = []; 227var table = ""; 228 229load(); 230 231$('label.currency_checker').click(function() { 232 currency = $(this).data("value"); 233 $("#currency").val(currency); 234 $("#currency_code").html(currency.toUpperCase()); 235 reset1();
236 load(); 237}); 238 239function reset1() { 240 $("#selectdown").slideUp(500); 241 $("#selectedProducts").html(""); 242 $("#product").val(0); 243 selected = []; 244 finalSelectedProducts = []; 245 finalSelectedProducts.length = 0; 246 table = ""; 247 tot_amt = 0; 248 ticket = []; 249 ticket.length = 0; 250} 251 252function load() 253{ 254 $('#product').on('change', function(){ 255 256 console.log('test'); 257 258 product = $(this).val(); 259 260 ticket = []; 261 ticket.length = 0; 262 263 ticket.product_id = products[product].regproducts_id; 264 265 if (currency=="usd") { 266 ticket.currency_symbol = "$"; 267 ticket.earlybird = products[product].price1; 268 ticket.normal = products[product].price2; 269 ticket.final = products[product].price3; 270 } 271 272 if (currency=="eur") { 273 ticket.currency_symbol = "€"; 274 ticket.earlybird = products[product].price4; 275 ticket.normal = products[product].price5; 276 ticket.final = products[product].price6; 277 } 278 279 if (currency=="gbp") { 280 ticket.currency_symbol = "£"; 281 ticket.earlybird = products[product].price7; 282 ticket.normal = products[product].price8; 283 ticket.final = products[product].price9; 284 } 285 286 $("#earlybird").html(ticket.currency_symbol + " " + ticket.earlybird); 287 $("#normal").html(ticket.currency_symbol + " " + ticket.normal); 288 $("#final").html(ticket.currency_symbol + " " + ticket.final); 289 $("#product_checkbox").val(ticket.product_id); 290 291 //console.log(selected.indexOf(ticket.product_id)); 292 293 if (selected.indexOf(ticket.product_id)>=0) { 294 $("#product_checkbox").prop('checked',true); 295 } else { 296 $("#product_checkbox").prop('checked',false); 297 } 298 299 $("#selectdown").slideDown(500); 300 301 if (dateType=="early") { 302 $("#earlybird").css('font-weight','bold'); 303 $("#earlybird").css('color','#3fff00'); 304 } 305 306 if (dateType=="normal") { 307 $("#normal").css('font-weight','bold'); 308 $("#normal").css('color','#3fff00'); 309 } 310 311 if (dateType=="final") { 312 $("#final").css('font-weight','bold'); 313 $("#final").css('color','#3fff00'); 314 } 315 }); 316 317 table = ""; 318 selected.length = 0; 319 320} 321 322 323 $("body input#product_checkbox").on('click',function(){ 324 325 if($(this).prop('checked') === true){ 326 selected.push(ticket.product_id); 327 }else { 328 selected.pop(ticket.product_id); 329 } 330 // if (this.checked) { 331 // } 332 333 console.log(selected); 334 335 finalSelectedProducts = []; 336 337 //$("#products_list").val(selecteds); 338 339 $.each(selected,function(index,value){ 340 var ticket_details = []; 341 ticket_details.product_id = value; 342 ticket_details.type = products[value].type; 343 ticket_details.newtype = products[value].newtype; 344 ticket_details.productname = products[value].productname; 345 346 if (dateType=="early" & currency=="usd") { 347 ticket_details.price = products[value].price1; 348 ticket_details.currency = "usd"; 349 ticket_details.currency_symbol = "$"; 350 } 351 352 if (dateType=="normal" & currency=="usd") { 353 ticket_details.price = products[value].price2; 354 ticket_details.currency = "usd"; 355 ticket_details.currency_symbol = "$"; 356 } 357 358 if (dateType=="final" & currency=="usd") { 359 ticket_details.price = products[value].price3; 360 ticket_details.currency = "usd"; 361 ticket_details.currency_symbol = "$"; 362 } 363 364 if (dateType=="early" & currency=="eur") { 365 ticket_details.price = products[value].price4; 366 ticket_details.currency = "eur"; 367 ticket_details.currency_symbol = "€"; 368 } 369 370 if (dateType=="normal" & currency=="eur") { 371 ticket_details.price = products[value].price5; 372 ticket_details.currency = "eur"; 373 ticket_details.currency_symbol = "€"; 374 } 375 376 if (dateType=="final" & currency=="eur") { 377 ticket_details.price = products[value].price6; 378 ticket_details.currency = "eur"; 379 ticket_details.currency_symbol = "€"; 380 } 381 382 if (dateType=="early" & currency=="gbp") { 383 ticket_details.price = products[value].price7; 384 ticket_details.currency = "gbp"; 385 ticket_details.currency_symbol = "£"; 386 } 387 388 if (dateType=="normal" & currency=="gbp") { 389 ticket_details.price = products[value].price8; 390 ticket_details.currency = "gbp"; 391 ticket_details.currency_symbol = "£"; 392 } 393 394 if (dateType=="final" & currency=="gbp") { 395 ticket_details.price = products[value].price9; 396 ticket_details.currency = "gbp"; 397 ticket_details.currency_symbol = "£"; 398 } 399 400 finalSelectedProducts.push(ticket_details); 401 }); 402 403 table = "<br/><table class='table table-bordered' id='prices-table'><tr><td>Item Name</td><td>Price</td></tr>"; 404 405 tot_amt = 0; 406 407 var selectedProducts = ""; 408 409 $.each(finalSelectedProducts,function(index,value){ 410 411 console.log(value); 412 413 selectedProducts += value.product_id+","; 414 415 tot_amt += parseInt(value.price); 416 table+= "<tr><td>"+value.newtype+value.productname+"</td><td>"+value.currency_symbol + " " + value.price+"</td></tr>"; 417 }); 418 419 table += "<tr class='tot_amt'><td>Your Total Amount</td><td>" + finalSelectedProducts[0].currency_symbol + " " + tot_amt + "</td></tr></table>"; 420 421 $("#selectedProducts").html(table); 422 423 $("#products_list").val(selectedProducts); 424 425 $("#tot_amt").val(tot_amt); 426 427 //$("#products_list").val(JSON.stringify(finalSelectedProducts)); 428 429 }); 430 431
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.