@@ -171,33 +171,33 @@
window.user = {{ user | megajson | safe }}
window.user_wallets = {{ user_wallets | megajson | safe }}
window.user_ext = {{ user_ext | megajson | safe }}
- window.user_wav = {{ user_fau | megajson | safe }}
+ window.user_ev = {{ user_ev | megajson | safe }}
- const user_wav = window.user_wav
- console.log(user_wav)
+ const user_ev = window.user_ev
+ console.log(user_ev)
-function drawChart(user_wav) {
+function drawChart(user_ev) {
var transactionsHTML = ''
- for (var i = 0; i < user_wav.length; i++) {
- var wv = user_wav[i]
+ for (var i = 0; i < user_ev.length; i++) {
+ var ev = user_ev[i]
transactionsHTML =
"
" +
- wv.tit +
+ ev.tit +
' | ' +
- wv.nosold +
+ ev.nosold +
' | ' +
- wv.noavail +
+ ev.noavail +
' | ' +
- wv.prpertick +
+ ev.prpertick +
' | ' +
- "" + wv.uni.substring(0, 4) + "..." +
+ "" + ev.uni.substring(0, 4) + "..." +
' | ' +
"" +
' | ' +
- "" + "" + "" +
+ "" + "" + "" +
' |
' +
transactionsHTML
document.getElementById('ticketwaves').innerHTML = transactionsHTML
@@ -205,10 +205,11 @@ function drawChart(user_wav) {
}
}
-function postwav(){
+function postev(){
wal = document.getElementById('wal').value
tit = document.getElementById('tit').value
+ cldate = document.getElementById('cldate').value
nooftickets = document.getElementById('nooftickets').value
prtick = document.getElementById('prtick').value
@@ -220,6 +221,10 @@ function postwav(){
document.getElementById("error").innerHTML = "No wallet selected"
return amt
}
+ if (cldate == "") {
+ document.getElementById("error").innerHTML = "No date selected"
+ return amt
+ }
if (isNaN(notickets) || notickets < 1) {
document.getElementById("error").innerHTML = "Must be more than 1"
@@ -231,25 +236,25 @@ function postwav(){
}
postAjax(
- "{{ url_for('wave.create') }}",
- JSON.stringify({"tit": tit, "nooftickets": nooftickets, "nooftickets": nooftickets, "prtick": prtick}),
+ "{{ url_for('events.create') }}",
+ JSON.stringify({"tit": tit, "wal": wal, "nooftickets": nooftickets,"cldate": cldate, "prtick": prtick}),
"filla",
- function(data) { location.replace("{{ url_for('wav.index') }}?usr=" + user)
+ function(data) { location.replace("{{ url_for('events.index') }}?usr=" + user)
})
}
-function editlink(wavnum){
+function editlink(evnum){
-wavdetails = user_wav[wavnum]
+evdetails = user_ev[evnum]
-console.log(wavdetails)
+console.log(evdetails)
wallpick = ""
checkbox = ""
-if (wavdetails.uniq == 1){
+if (evdetails.uniq == 1){
checkbox = "checked"}
document.getElementById('editlink').innerHTML = "
"+
@@ -257,7 +262,7 @@ document.getElementById('editlink').innerHTML = "