$('document').ready(function(){ var supporterd='foundingsupporters'; $("#supporterwrapper").height($("#foundingsupporters").outerHeight()); setInterval(function(){ if(supporterd=='foundingsupporters'){ $("#foundingsupporters").fadeOut(); $("#mediasupporters").fadeIn(); $("#supporterwrapper").height($("#mediasupporters").outerHeight()); supporterd='mediasupporters' } else if(supporterd=='mediasupporters'){ $("#mediasupporters").fadeOut(); $("#currentsupporters1").fadeIn(); supporterd='currentsupporters1' } else if(supporterd=='currentsupporters1'){ $("#currentsupporters1").fadeOut(); $("#currentsupporters2").fadeIn(); supporterd='currentsupporters2' } else if(supporterd=='currentsupporters2'){ $("#currentsupporters2").fadeOut(); $("#foundingsupporters").fadeIn(); supporterd='foundingsupporters' } }, 3000); $("#icon-totop").click(function(event) { event.preventDefault(); $('html,body').animate({ scrollTop: $("body").offset().top}, 'slow'); }); $(window).scroll(function(){ var topdistance=$("#pageTopNavbar").offset().top - $(window).scrollTop(); if(topdistance>-600) $("#icon-totop").fadeOut('slow'); else $("#icon-totop").fadeIn('slow'); }); $("#chkRqSktShowOnMap").click(function(e){ if($(this).prop('checked')) $("#pRqSktShowOnMap").slideDown(); else $("#pRqSktShowOnMap").slideUp(); }) $("#formRequestSkate").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/requestskates_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); if(data==1){ $("#response-output").html('

Thank you for submitting your request. It is under review. We will get back to you shortly.

'); return; } else if(data==''){$("#formRequestSkate").submit(); return;} else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $("#formLogin").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); var pagename=$(this).attr('data-pagename'); $("#response-output-login").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/login_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); if(data==''){$("#formLogin").submit(); return;} else if(data==1){ if(pagename=='reqrec'){ $("html, body").animate({ scrollTop: 0 }, "slow"); $("#loginBoxHolder").fadeOut(500); setTimeout(function(){ $("#pReqReceipt").fadeIn();; }, 500); return; } else if(pagename=='userlogin'){window.location = "https://skatetogreat.org/user-portal"; return} else{location.reload; return;} } else if(data==0){ $("#response-output-login").html('

You have entered a wrong password.

'); return; } else{ $("#response-output-login").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output-login").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $("#formSignup").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); var pagename=$(this).attr('data-pagename'); $("#response-output-signup").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/login_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); if(data==''){$("#formSignup").submit(); return;} else if(data==1){ if(pagename=='reqrec'){ $("html, body").animate({ scrollTop: 0 }, "slow"); $("#loginBoxHolder").fadeOut(500); setTimeout(function(){ $("#pReqReceipt").fadeIn();; }, 500); return; } else if(pagename=='userlogin'){window.location = "https://skatetogreat.org/user-portal"; return} else{location.reload; return;} } else if(data==0){ $("#response-output-signup").html('

The Email Address is already registered. Please use a different one or Login.

'); } else{ $("#response-output-signup").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output-signup").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $("#formReqReceipt").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/requestreceipt_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); $("#response-output").html(''); if(data==1){ $("html, body").animate({ scrollTop: 0 }, "slow"); $("#formReqReceiptHolder").fadeOut(500); setTimeout(function(){ $("#requestSubmitted").css('display','block'); }, 500); return; } else if(data==''){$("#formReqReceipt").submit(); return;} else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $("#reqAnotherReceipt").click(function(e){ e.preventDefault(); $("html, body").animate({ scrollTop: 0 }, "slow"); $("#formReqReceipt")[0].reset(); $("#requestSubmitted").fadeOut(500); setTimeout(function(){ $("#formReqReceiptHolder").fadeIn();; }, 500); return; }); $("#typeOfDonation").change(function(e){ if($(this).val()=='Property') $(".pPropertyOnly").show(); else $(".pPropertyOnly").hide(); if($(this).val()=='Monetary')$(".pMoneytaryOnly").show(); else $(".pMoneytaryOnly").hide(); }); $("#AmountReceived,#ValueOfAdvantage").blur(function(e){ $("#EligibleAmount").val($("#AmountReceived").val() - $("#ValueOfAdvantage").val()); }); $("#formVolunteer").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/volunter_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); if(data==''){$("#formVolunteer").submit(); return;} else if(data==1){ $("#response-output").html('

Thank you for submitting your request. It is under review. We will get back to you shortly.

'); return; } else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $("#formContactUs").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/contactus_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); grecaptcha.reset(); if(data==''){$("#formContactUs").submit(); return;} else if(data==1){ $("#response-output").html('

Your message has been sent. Thank you for contacting us.

'); return; } else if(data==0){ $("#response-output").html('

You have entered a wrong password.

'); return; } else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $("#formPPR").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/PartnerPickup_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); grecaptcha.reset(); if(data==''){$("#formPPR").submit(); return;} else if(data==1){ $("#response-output").html('

Your pickup request has been submitted.

'); return; } else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $("#formChnagePwd").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/userpwdchange_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); if(data==''){$("#formChnagePwd").submit(); return;} else if(data==1){ $("#response-output").html('

Your password is changed successfully.

'); return; } else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); /******************************** Admin ********************************/ $("#fApproveMoneytaryDonation").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admindonatsm_sendmail.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); $("#response-output").html(''); if(data==''){$("#fApproveMoneytaryDonation").submit(); return;} else if(data==1){ $("#response-output").html('

Success! The receipt has been sent.

'); } else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $("#fDenyMoneytaryDonation").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admindonatsm_sendmail.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); $("#response-output").html(''); if(data==''){$("#fDenyMoneytaryDonation").submit(); return;} else if(data==1){ $("#response-output").html('

Request denied and email sent to requesting person.

'); } else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $(".formDonationButton").submit(function(e){ e.preventDefault(); var reqID=$(this).attr('data-requestid'); var form_data = new FormData(this); //$("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admindonatsm_sendmail.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); //$("#response-output").html(''); if(data==''){$("#formDonationButton").submit(); return;} else if(data==1){ //location.reload(); $("#pendingDonationRow"+ reqID).slideUp(); } else{ alert(data); } }, error: function(){ alert('There is some technical issue. We are working on it and will restore soon.'); } }); }); $("#fApprovePropertyDonation").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admindonatsp_sendmail.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); $("#response-output").html(''); if(data==''){$("#fApprovePropertyDonation").submit(); return;} else if(data==1){ $("#response-output").html('

Success! The receipt has been sent.

'); } else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $(".formAdminContactUs").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); var cntctid=$(this).attr('data-contactid'); $("#response-output"+cntctid).html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admincontacts_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); $("#response-output"+cntctid).html(''); if(data==''){$("#formAdminContactUs").submit(); return;} else if(data==1){ $("#response-output"+cntctid).html('

Success! The reply has been sent.

'); $("#submit"+cntctid).hide(); } else{ $("#response-output"+cntctid).html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $(".formAdmCntcAddNote").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); var cntctid=$(this).attr('data-contactid'); $("#response2-output"+cntctid).html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admincontacts_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); $("#response2-output"+cntctid).html(''); if(data==''){$("#formAdmCntcAddNote").submit(); return;} else if(data==1){ $("#response2-output"+cntctid).html('

Note added to the message.

'); } else{ $("#response2-output"+cntctid).html('

Error! ' + data + '

'); } }, error: function(){ $("#response2-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $(".unreadCR").click(function(){ var reqId=$(this).attr('href').replace('#collapse',''); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admincontacts_ajax.php', data: {'requestId':reqId}, success: function(data, status){ if(data==1) $("a[href=\"#collapse"+reqId+"\"]").removeClass('unreadCR'); } }); }); $(".deleteRecord").click(function(){ var delID=$(this).attr('data-recordid'); console.log(delID); //return; var r = confirm('Are yo sure you want to delete this message?'); if (r == true) { $.ajax({ type: 'post', url: 'https://skatetogreat.org/admincontacts_ajax.php', data: {'deleteID':delID}, success: function(data, status){console.log(data); if(data==1) $("#messageBox"+delID).slideUp(); } }); } }); $(".formAdminSSR").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); var shipskateid=$(this).attr('data-shipskateid'); $("#responseoutput"+ shipskateid).html('

Sending response

'); //$("#responseoutput1").html('aaaa'); return; $.ajax({ type: 'post', url: 'https://skatetogreat.org/admin_shipsketreq_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); $("#responseoutput"+shipskateid).html(''); if(data==''){$("#formAdminSSR").submit(); return;} else if(data==1){ $("#responseoutput"+shipskateid).html('

Success! The reply has been sent.

'); $("#submit"+shipskateid).hide(); } else{ $("#responseoutput"+shipskateid).html('

Error! ' + data + '

'); } }, error: function(){ $("#responseoutput").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $(".formAdmSSRAddNote").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); var shipskateid=$(this).attr('data-shipskateid'); $("#response2output"+shipskateid).html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admin_shipsketreq_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); $("#response2output"+shipskateid).html(''); if(data==''){$("#formAdmSSRAddNote").submit(); return;} else if(data==1){ $("#response2output"+shipskateid).html('

Note added to the request.

'); } else{ $("#response2output"+shipskateid).html('

Error! ' + data + '

'); } }, error: function(){ $("#response2output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $(".unreadSSR").click(function(){ var reqId=$(this).attr('href').replace('#collapse',''); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admin_shipsketreq_ajax.php', data: {'requestId':reqId}, success: function(data, status){console.log(data); if(data==1) $("a[href=\"#collapse"+reqId+"\"]").removeClass('unreadSSR'); } }); }); $(".deleteSSR").click(function(){ var delID=$(this).attr('data-recordid'); console.log(delID); //return; var r = confirm('Are yo sure you want to delete this message?'); if (r == true) { $.ajax({ type: 'post', url: 'https://skatetogreat.org/admin_shipsketreq_ajax.php', data: {'deleteID':delID}, success: function(data, status){console.log(data); if(data==1) $("#ssrBox"+delID).slideUp(); } }); } }); $(".panel-title>.unreadPPR").click(function(){ var reqId=$(this).attr('data-reqid'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/adminpartnerpickup_ajax.php', data: {'requestId':reqId}, success: function(data, status){ if(data==1) $("a[href=\"#collapse"+reqId+"\"]").removeClass('unread'); } }); }); $("#formAddMedia").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/adminaddmedia_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); $("#response-output").html(''); if(data==''){$("#formAddMedia").submit(); return;} else if(data==1){ $("#response-output").html('

Success! The media has been published.

'); $("#submit").hide(); } else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $(".fAdmnSRMap").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); var reqid=$(this).attr('data-requestid'); //console.log(reqid); return; $("#response-output"+reqid).html('

Adding To Map

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/adminskatereq_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); if(data==''){$("#fAdmnSRMap").submit(); return;} else if(data==1){ $("#response-output"+reqid).html(''); $("#AddMapStatus"+reqid).html('Added to map'); } else{ $("#response-output"+reqid).html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output"+reqid).html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $(".reqAction").click(function(e){ var reqid=$(this).attr('data-requestid'); var actn=$(this).attr('data-action'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/adminskatereq_ajax.php', data: {'requestId':reqid,'applActn':actn} }); if(actn==1)$("#response2-output"+reqid).html('This request has been approved.') else if(actn==-1)$("#response2-output"+reqid).html('This request has been rejected.') else if(actn==15)$("#response2-output"+reqid).html('This request has been postponded.') }); $("#frmAdminNewLocation").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output1").html('

Adding New Location

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admindonationlocations_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); if(data==''){$("#frmAdminNewLocation").submit(); return;} else if(data==1){ $("#response-output1").html('

Location Added

'); } else{ $("#response-output1").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output1").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $("#formAdminLocations").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Updating Map

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/admindonationlocations_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); if(data==''){$("#formAdminLocations").submit(); return;} else if(data==1){ $("#response-output").html('

Map updated

'); } else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); $("#formShipYourSkates").submit(function(e){ e.preventDefault(); var form_data = new FormData(this); $("#response-output").html('

Submitting your request

'); $.ajax({ type: 'post', url: 'https://skatetogreat.org/ship_your_skates_ajax.php', data: form_data, cache: false, contentType: false, processData: false, success: function(data, status){console.log(data); if(data==''){$("#formShipYourSkates").submit(); return;} else if(data==1){ $("#response-output").html('

Thank you for submitting your skat shipment request. It is under review. We will get back to you shortly.

'); $("#formShipYourSkates").trigger("reset"); return; } else{ $("#response-output").html('

Error! ' + data + '

'); } }, error: function(){ $("#response-output").html('

There is some technical issue. We are working on it and will restore soon.

'); } }); }); });