asbasawaraj | 4c26348 | 2018-06-15 10:04:19 +0530 | [diff] [blame] | 1 | {% extends "templates/web.html" %} |
| 2 | |
| 3 | {% block title %} ERPNext Certification {% endblock %} |
| 4 | |
| 5 | {% block page_content %} |
| 6 | |
| 7 | {% macro show_currency_options() %} |
| 8 | |
| 9 | <p> Certification price is 20,000 INR / 300 USD.</p> |
| 10 | |
| 11 | <section> |
| 12 | <input type="radio" name="gender" value="USD" checked> USD <br> |
| 13 | <input type="radio" name="gender" value="INR" style="margin-top: 15px;"> INR <br> |
| 14 | </section> |
| 15 | |
| 16 | <div class="section" style="margin-top:10px;"><a class="btn btn-primary next"> Next </a></div> |
| 17 | |
| 18 | <script> |
| 19 | frappe.ready(function() { |
| 20 | $('.next').on('click', function() { |
| 21 | if($("input[type=radio]:checked").val() == 'INR'){ |
| 22 | window.location = '/certification-application?new=1' |
| 23 | } |
| 24 | else{ |
| 25 | window.location = '/certification-application-usd?new=1' |
| 26 | } |
| 27 | }) |
| 28 | }) |
| 29 | </script> |
| 30 | |
| 31 | {% endmacro %} |
| 32 | |
| 33 | {% if frappe.session.user=='Guest' %} |
| 34 | <div class='with-border'> |
| 35 | <p>You must first sign up and login to apply for certification.</p> |
| 36 | <p><a href="/login#signup" class=''>Sign Up</a></p> |
| 37 | </div> |
| 38 | |
| 39 | {% else %} |
| 40 | |
| 41 | {% if all_certifications %} |
| 42 | |
| 43 | <h2>Certification History</h2> |
| 44 | |
| 45 | <div class="table"> |
| 46 | <table class="table table-bordered table-hover"> |
| 47 | <thead> |
| 48 | <tr class="active"> |
| 49 | <th style="width: 150px">Certification Id</th> |
| 50 | <th style="width: 120px">From</th> |
| 51 | <th style="width: 120px">To</th> |
| 52 | <th style="width: 100px">Amount</th> |
| 53 | </tr> |
| 54 | </thead> |
| 55 | <tbody> |
| 56 | {% for certification in all_certifications %} |
| 57 | |
| 58 | <tr> |
| 59 | <td>{{ certification['name'] }}</td> |
| 60 | <td>{{ frappe.format_date(certification['from_date']) }}</td> |
| 61 | <td>{{ frappe.format_date(certification['to_date']) }}</td> |
| 62 | <td>{{ frappe.utils.fmt_money(certification['amount'],currency=frappe.db.get_value("Currency",certification['currency'],"symbol")) }}</td> |
| 63 | </tr> |
| 64 | {% endfor %} |
| 65 | </tbody> |
| 66 | </table> |
| 67 | </div> |
| 68 | |
| 69 | {% endif %} |
| 70 | |
| 71 | {% if not all_certifications %} |
| 72 | {{ show_currency_options() }} |
| 73 | |
| 74 | {% elif all_certifications and (frappe.utils.getdate(all_certifications[0]['to_date']) < frappe.utils.getdate(frappe.utils.nowdate())) %} |
| 75 | <p>Your certification has expired. Click on the button below to start a new certification.</p> |
| 76 | {{ show_currency_options() }} |
| 77 | |
| 78 | {% elif all_certifications and (frappe.utils.getdate(frappe.utils.add_days(all_certifications[0]['to_date'], -30)) < frappe.utils.getdate(frappe.utils.nowdate()))%} |
| 79 | <p>Your certification is due to expire soon. Click on the button below to start a new certification.</p> |
| 80 | {{ show_currency_options() }} |
| 81 | |
| 82 | {% endif %} |
| 83 | |
| 84 | {% endif %} |
| 85 | |
| 86 | {% endblock %} |