Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // build the top of our HTML page
- xbuf_xcat(reply, "<!DOCTYPE HTML>"
- "<html lang=\"en\"><head><title>Loan Calculator</title><meta http-equiv"
- "=\"Content-Type\" content=\"text/html; charset=utf-8\">"
- "<link href=\"/imgs/style.css\" rel=\"stylesheet\" type=\"text/css\">"
- "</head><body style=\"margin:16px;\">"
- "<h2>Dear %s, your loan goes as follows:</h2><br>",
- (*szName && *szName != '-') ? szName : "client");
- xbuf_xcat(reply, "<table class=\"clean\" width=240px>"
- "<tr><th>loan</th><th>details</th></tr>"
- "<tr class=\"d1\"><td>Amount</td><td>%.2F</td></tr>"
- "<tr class=\"d0\"><td>Rate</td><td>%.2F%%</td></tr>"
- "<tr class=\"d1\"><td>Term</td><td>%u %s(s)</td></tr>"
- "<tr class=\"d0\"><td>Cost</td><td>%.2F (%.2F%%)</td></tr>"
- "</table>", amount, rate * 100,
- ((u32)term)?((u32)term):uceil(12 * term),
- ((u32)term)?"year":"month", cost, 100 / (amount / cost));
- xbuf_xcat(reply, "<br><table class=\"clean\" width=112px>"
- "<tr class=\"d1\"><td><b>YEAR %u</b></td></tr></table>"
- "<table class=\"clean\" width=550px>"
- "<tr><th>month</th><th>payment</th><th>interest</th>"
- "<th>principal</th><th>balance</th></tr>", year);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement