heartranked

git clone https://git.tarina.org/heartranked
Log | Files | Refs

orders.html (3390B)


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