Guest User

Untitled

a guest
Nov 22nd, 2012
2,135
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // build the top of our HTML page
  2. xbuf_xcat(reply, "<!DOCTYPE HTML>"
  3. "<html lang=\"en\"><head><title>Loan Calculator</title><meta http-equiv"
  4. "=\"Content-Type\" content=\"text/html; charset=utf-8\">"
  5. "<link href=\"/imgs/style.css\" rel=\"stylesheet\" type=\"text/css\">"
  6. "</head><body style=\"margin:16px;\">"
  7. "<h2>Dear %s, your loan goes as follows:</h2><br>",
  8. (*szName && *szName != '-') ? szName : "client");
  9.  
  10. xbuf_xcat(reply, "<table class=\"clean\" width=240px>"
  11. "<tr><th>loan</th><th>details</th></tr>"
  12. "<tr class=\"d1\"><td>Amount</td><td>%.2F</td></tr>"
  13. "<tr class=\"d0\"><td>Rate</td><td>%.2F%%</td></tr>"
  14. "<tr class=\"d1\"><td>Term</td><td>%u %s(s)</td></tr>"
  15. "<tr class=\"d0\"><td>Cost</td><td>%.2F (%.2F%%)</td></tr>"
  16. "</table>", amount, rate * 100,
  17. ((u32)term)?((u32)term):uceil(12 * term),
  18. ((u32)term)?"year":"month", cost, 100 / (amount / cost));
  19.  
  20. xbuf_xcat(reply, "<br><table class=\"clean\" width=112px>"
  21. "<tr class=\"d1\"><td><b>YEAR %u</b></td></tr></table>"
  22. "<table class=\"clean\" width=550px>"
  23. "<tr><th>month</th><th>payment</th><th>interest</th>"
  24. "<th>principal</th><th>balance</th></tr>", year);
RAW Paste Data