orders2.html (3029B)
1 $def with (payments,db,getinvoice,totsats,status,paid,unpaid,shipped,nonshipped,pickup,removed,productname,getprice) 2 $ link = '' 3 <h2>Orders</h2> 4 <h4>total $totsats</h4> 5 <p>paid $paid</p> 6 <p>shipped $shipped</p> 7 <p>pickup $pickup</p> 8 <p>unpaid $unpaid</p> 9 <p>removed $removed</p> 10 <h3>waiting to be shipped $nonshipped</h3> 11 <a href="?status=unpaid">unpaid</a> 12 <a href="?status=paid">paid</a> 13 <a href="?status=shipped">shipped</a> 14 <a href="?status=pickup">pickup</a> 15 <a href="?status=removed">removed</a> 16 <a href="?status=thankyou">thankyou</a> 17 $ id=0 18 $ totsats=0 19 $ toteuro=0 20 $for i in payments: 21 $ id=id+1 22 $if i.status == status: 23 <div class="orders" id="$id"> 24 <pre> 25 $ bag = db.query("SELECT * FROM paidbags WHERE sessionkey='" + i.invoice_key +"';") 26 $ pending = db.select('pending', where="invoice_key='"+i.invoice_key+"'")[0] 27 $ invoice = db.select('invoices', where="invoice_key='"+i.invoice_key+"'")[0] 28 $ ln = getinvoice(i.ln) 29 $if i.payment == 'Bitcoin': 30 $ link = "/paybtc/" + i.invoice_key 31 $if i.payment == 'Bitcoin Lightning': 32 $ link = "/payln/" + i.invoice_key 33 <b>order status: $i.status</b> 34 <b>ln status: $ln['status']</b> 35 <a href=$link>$i.invoice_key</a> 36 $ln['msatoshi'] mSatoshis 37 $if ln['status'] == 'paid': 38 $ totsats=totsats+ln['msatoshi'] 39 $i.payment 40 $i.ln 41 in your order:<br> 42 $ total = 0 43 $for b in bag: 44 $ goodies = db.query("SELECT * FROM soundlink WHERE id='"+b.product+"';") 45 $code: 46 price = getprice(b.product) 47 quantity = b.quantity 48 p_totsats=b.quantity*price[0] 49 p_toteuro=b.quantity*price[1] 50 $b.quantity x $productname(b.product) 51 <a href="/dropitem/$b.product">X</a> $p_totsats $p_toteuro€<br> 52 $for g in goodies: 53 $if g.soundname[-5:] == '.jpeg' or g.soundname[-4:] == '.png': 54 <img src="/static/img/thumb/$g.soundname" style="width:120px"><br> 55 $code: 56 totsats += p_totsats 57 toteuro += p_toteuro 58 $if totsats > 0: 59 <br> 60 total: $totsats Satoshi or $toteuro € 61 62 Satoshis: $i.totsats 63 order $i.timestamp 64 $pending.email 65 $pending.firstname $pending.lastname 66 $if pending.country != 'NO-SHIPPING': 67 $pending.address 68 $pending.postalcode 69 $pending.town 70 $pending.country 71 </pre> 72 <a href='/orders?status=thankyou&key=$i.invoice_key'>thank you</a> | <a href='/orders?status=shipped&key=$i.invoice_key'>shipped</a> | <a href='/orders?status=paid&key=$i.invoice_key'>paid</a> | <a href='/orders?status=pickup&key=$i.invoice_key'>pickup</a> |<a href='/orders?status=paynotice&key=$i.invoice_key'>payment notice</a> | <a href='/orders?status=removed&key=$i.invoice_key'>remove</a> 73 </div> 74 <br> 75