5.651
Bearbeitungen
Admin (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Admin (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 3: | Zeile 3: | ||
<br> | <br> | ||
<br> | <br> | ||
<html> | <html> | ||
<head> | <head> | ||
Zeile 158: | Zeile 157: | ||
<table style="width: 350px; height: 219px;"> | <table style="width: 350px; height: 219px;"> | ||
<tbody> | <tbody> | ||
<tr> | <tr> | ||
<td colspan="4" style="text-align: center"> <input name="cmd" | <td colspan="4" style="text-align: center"> <input name="cmd" | ||
Zeile 189: | Zeile 167: | ||
</tbody> | </tbody> | ||
</table> | </table> | ||
</form> | |||
</td> | </td> | ||
<td id="{{{banner}}}-close-wrapper"> <span id="{{{banner}}}-close"> </span> | <td id="{{{banner}}}-close-wrapper"> <span id="{{{banner}}}-close"> </span> | ||
Zeile 277: | Zeile 250: | ||
} | } | ||
function increaseImpCount() { | |||
impCount = parseInt($.cookie('centralnotice_banner_impression_count')) | 0; | |||
$.cookie('centralnotice_banner_impression_count', impCount + 1, { expires: 7, path: '/' }); | |||
return impCount + 1; | |||
} | |||
function increaseBannerImpCount() { | |||
var impCount = 0; | |||
if($.cookie('centralnotice_single_banner_impression_count')) { | |||
var impCountCookie = $.cookie('centralnotice_single_banner_impression_count'); | |||
var bannerImpCount = impCountCookie.split("|"); | |||
if(bannerImpCount[0] === '{{{banner}}}') { | |||
impCount = parseInt(bannerImpCount[1]); | |||
} | |||
} | |||
$.cookie('centralnotice_single_banner_impression_count', '{{{banner}}}|' + (impCount + 1), { expires: 7, path: '/' }); | |||
return (impCount + 1); | |||
} | |||
function validateForm() { | |||
var chkdPayment = $( 'input[name=pay]:checked', '#{{{banner}}}-form' ).val(); | |||
switch( chkdPayment ) { | |||
case "BEZ": | |||
$( '#form-page' ).val( 'Formularseite2-Lastschrift' ); | |||
break; | |||
case "UEB": | |||
$( '#form-page' ).val( 'Formularseite2-Überweisung' ); | |||
break; | |||
case "PPL": | |||
$( '#form-page' ).val( 'Formularseite2-PayPal' ); | |||
break; | |||
case "MCP": | |||
$( '#form-page' ).val( 'Formularseite2-Micropayment' ); | |||
break; | |||
} | |||
var form = document.donationForm; | |||
var error = false; | |||
if($('#interval_multiple').attr('checked') === 'checked') { | |||
if($('input[name=interval]:checked', form).length !== 1) { | |||
alert("Es wurde kein Zahlungsintervall ausgewählt."); | |||
return false; | |||
} else { | |||
$('#periode').val($('input[name=interval]:checked', form).val()); | |||
} | |||
} else { | |||
$('#periode').val("0"); | |||
} | |||
// Get amount selection | |||
var amount = null; | |||
for ( var i = 0; i < form.betrag.length; i++ ) { | |||
if ( form.betrag[i].checked ) { | |||
amount = form.betrag[i].value; | |||
break; | |||
} | |||
} | |||
if ( form.amountGiven.value != "" ) { | |||
var otherAmount = form.amountGiven.value; | |||
otherAmount = otherAmount.replace(/[,.](\d)$/, '\:$10'); | |||
otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, '\:$1$2'); | |||
otherAmount = otherAmount.replace(/[\$,.]/g, ''); | |||
otherAmount = otherAmount.replace(/:/, '.'); | |||
form.amountGiven.value = otherAmount; | |||
amount = otherAmount; | |||
$('#input_amount_other').val( otherAmount ); | |||
} | |||
// Check amount is a real number | |||
error = ( amount == null || isNaN( amount ) || amount.value <= 0 ); | |||
// Check amount is at least the minimum | |||
if ( amount < 1 || error ) { | |||
alert( 'Der Mindestbetrag beträgt 1 Euro.'); | |||
return false; | |||
} else if ( amount > 99999 ) { | |||
alert( 'Der Spendenbetrag ist zu hoch.' ); | |||
return false; | |||
} | |||
return !error; | |||
} | |||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |