Update index.html
This commit is contained in:
parent
4254c45d20
commit
154cbb0d48
|
@ -80,7 +80,7 @@
|
|||
<!-- general form elements -->
|
||||
<div class="box box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"> Make a wave</h3>
|
||||
<h3 class="box-title"> Make a eve</h3>
|
||||
</div><!-- /.box-header -->
|
||||
<!-- form start -->
|
||||
<form role="form">
|
||||
|
@ -108,9 +108,9 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="nooftickets">Date</label>
|
||||
<input type="text" class="form-control" data-inputmask="'alias': 'dd/mm/yyyy'" data-mask/>
|
||||
</div><!-- /.input group -->
|
||||
<label for="cldate">Date</label>
|
||||
<input type="text" class="form-control" id="cldate"></input>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="prpertick">Price per ticket</label>
|
||||
|
@ -122,7 +122,7 @@
|
|||
|
||||
<div class="box-footer">
|
||||
|
||||
<button onclick="postwave()" type="button" class="btn btn-info">Create wave</button><p style="color:red;" id="error"></p>
|
||||
<button onclick="postev()" type="button" class="btn btn-info">Create Wave</button><p style="color:red;" id="error"></p>
|
||||
</div>
|
||||
</form>
|
||||
</div><!-- /.box -->
|
||||
|
@ -136,7 +136,7 @@
|
|||
<div class="col-md-6">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Ticket waves<b id="withdraws"></b></h3>
|
||||
<h3 class="box-title">Ticket Waves<b id="withdraws"></b></h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body no-padding">
|
||||
|
@ -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 =
|
||||
"<tr><td style='width: 50%'>" +
|
||||
wv.tit +
|
||||
ev.tit +
|
||||
'</td><td>' +
|
||||
wv.nosold +
|
||||
ev.nosold +
|
||||
'</td><td>' +
|
||||
wv.noavail +
|
||||
ev.noavail +
|
||||
'</td><td>' +
|
||||
wv.prpertick +
|
||||
ev.prpertick +
|
||||
'</td><td>' +
|
||||
"<a href='{{ url_for('wallet') }}?usr="+ user +"'>" + wv.uni.substring(0, 4) + "...</a>" +
|
||||
"<a href='{{ url_for('wallet') }}?usr="+ user +"'>" + ev.uni.substring(0, 4) + "...</a>" +
|
||||
'</td><td>' +
|
||||
"<i onclick='editlink("+ i +")'' class='fa fa-edit'></i>" +
|
||||
'</td><td>' +
|
||||
"<b><a style='color:red;' href='" + "{{ url_for('withdraw.index') }}?del=" + wv.uni + "&usr=" + user +"'>" + "<i class='fa fa-trash'></i>" + "</a></b>" +
|
||||
"<b><a style='color:red;' href='" + "{{ url_for('withdraw.index') }}?del=" + ev.uni + "&usr=" + user +"'>" + "<i class='fa fa-trash'></i>" + "</a></b>" +
|
||||
'</td></tr>' +
|
||||
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 = "<div class='row'>"+
|
||||
|
@ -257,7 +262,7 @@ document.getElementById('editlink').innerHTML = "<div class='row'>"+
|
|||
" <!-- general form elements -->"+
|
||||
"<div class='box box-primary'>"+
|
||||
"<div class='box-header'>"+
|
||||
"<h3 class='box-title'> Edit: <i id='unid'>" + wavdetails.tit + "-" + wavdetails.uni + "</i> </h3>"+
|
||||
"<h3 class='box-title'> Edit: <i id='unid'>" + evdetails.tit + "-" + evdetails.uni + "</i> </h3>"+
|
||||
"<div class='box-tools pull-right'>" +
|
||||
"<button class='btn btn-box-tool' data-widget='remove'><i class='fa fa-times'></i></button>" +
|
||||
"</div>" +
|
||||
|
@ -269,7 +274,7 @@ document.getElementById('editlink').innerHTML = "<div class='row'>"+
|
|||
"<div class='form-group'>"+
|
||||
"<label for='exampleInputEmail1'>Link title</label>"+
|
||||
"<input id='edittit' type='text' class='form-control' value='"+
|
||||
wavdetails.tit +
|
||||
evdetails.tit +
|
||||
"'></input> </div>"+
|
||||
" </div>"+
|
||||
" <div class='col-sm-4 col-md-4'>"+
|
||||
|
@ -277,7 +282,7 @@ document.getElementById('editlink').innerHTML = "<div class='row'>"+
|
|||
" <div class='form-group'>"+
|
||||
" <label>Select a wallet</label>"+
|
||||
"<select id='editwal' class='form-control'>"+
|
||||
" <option>" + wavdetails.walnme + "-" + wavdetails.wal + "</option>"+
|
||||
" <option>" + evdetails.walnme + "-" + evdetails.wal + "</option>"+
|
||||
" {% for w in user_wallets %}"+
|
||||
|
||||
" <option>{{w.name}}-{{w.id}}</option>"+
|
||||
|
@ -289,38 +294,26 @@ document.getElementById('editlink').innerHTML = "<div class='row'>"+
|
|||
" <div class='col-sm-3 col-md-4'>"+
|
||||
"<div class='form-group'>"+
|
||||
" <label for='exampleInputPassword1'>No of tickets:</label>"+
|
||||
" <input id='edittme' type='number' class='form-control' placeholder='0' max='86400' value='"+
|
||||
wavdetails.notickets +
|
||||
" <input id='editnooftickets' type='number' class='form-control' placeholder='0' max='86400' value='"+
|
||||
evdetails.nooftickets +
|
||||
"'></input>"+
|
||||
"</div> </div>"+
|
||||
" <div class='col-sm-3 col-md-4'>"+
|
||||
"<div class='form-group'>"+
|
||||
"<label for='exampleInputEmail1'>Price per ticket:</label>"+
|
||||
" <input id='editmaxamt' type='number' class='form-control' placeholder='1' value='"+
|
||||
wavdetails.prperticket +
|
||||
" <input id='editprtick' type='number' class='form-control' placeholder='1' value='"+
|
||||
evdetails.prtick +
|
||||
"'></input>"+
|
||||
" </div></div>"+
|
||||
" <div class='col-sm-3 col-md-4'>"+
|
||||
" <div class='form-group'>"+
|
||||
" <label for='exampleInputEmail1'>Close date:</label>"+
|
||||
" <input id='editminamt' type='number' class='form-control' placeholder='1' value='"+
|
||||
wavdetails.minamt +
|
||||
evdetails.cldate +
|
||||
"'></input>"+
|
||||
" </div></div>"+
|
||||
" <div class='col-sm-3 col-md-4'>"+
|
||||
"<div class='form-group'>"+
|
||||
" <label for='exampleInputPassword1'>Amount of uses:</label>"+
|
||||
" <input id='editamt' type='number' class='form-control' placeholder='1' value='"+
|
||||
wavdetails.inc +
|
||||
"'></input>"+
|
||||
" </div> </div>"+
|
||||
" <div class='col-sm-3 col-md-4'>"+
|
||||
" <div class='checkbox'>"+
|
||||
"<label data-toggle='tooltip' title='Some tooltip text!'><input id='edituniq' type='checkbox' "+
|
||||
checkbox +
|
||||
">"+
|
||||
"Unique links</label>"+
|
||||
"</div></div><!-- /.box-body -->"+
|
||||
"</div><!-- /.box-body -->"+
|
||||
" </div><br/>"+
|
||||
" <div class='box-footer'>"+
|
||||
" <button onclick='editlinkcont()' type='button' class='btn btn-info'>Edit link(s)</button><p style='color:red;' id='error2'></p>"+
|
||||
|
@ -328,20 +321,20 @@ document.getElementById('editlink').innerHTML = "<div class='row'>"+
|
|||
|
||||
|
||||
}
|
||||
usr, wal, walnme, walinvkey, uni, tit, cldate, nooftickets, prtick
|
||||
|
||||
function editlinkcont(){
|
||||
|
||||
unid = document.getElementById('unid').innerHTML
|
||||
wal = document.getElementById('editwal').value
|
||||
tit = document.getElementById('edittit').value
|
||||
amt = document.getElementById('editamt').value
|
||||
maxamt = document.getElementById('editmaxamt').value
|
||||
minamt = document.getElementById('editminamt').value
|
||||
nooftickets = document.getElementById('editnooftickets').value
|
||||
prtick = document.getElementById('editprtick').value
|
||||
cldate = document.getElementById('editcldate').value
|
||||
tme = document.getElementById('edittme').value
|
||||
uniq = document.getElementById('edituniq').checked
|
||||
|
||||
|
||||
|
||||
if (tit == "") {
|
||||
document.getElementById("error2").innerHTML = "Only use letters in title"
|
||||
return amt
|
||||
|
|
Loading…
Reference in New Issue
Block a user