OptInManagementProd/optmanagementprod/www/optanalystauth.html

61 lines
1.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>OPT IN ANALYST</title>
<!-- Tabulator CSS -->
</style>
</head>
<body>
<!-- {% extends "templates/web.html" %} -->
{% block content %}
<div id="loader" class="loader"></div>
<p style="padding-left: 5px;"><strong>Opt In Data </strong> </p>
<p> {{ frappe.session.user }}</p>
<div style="padding-left: 5px;">
<button id="download-csv" class="button button1">Download CSV</button>
<button id="download-xlsx" class="button button2">Download XLSX</button>
<button id="download-pdf" class="button button3">Download PDF</button>
</div>
<div style="padding-left: 5px; padding-bottom: 5px;" id="tabulator-table" class="tabulator-table"></div>
{% endblock %}
{% block script %}
<script src="https://unpkg.com/tabulator-tables@5.4.4/dist/js/tabulator.min.js"></script>
<script frappe.csrf_token = "{{frappe.session.csrf_token}}"; ></script>
<script type="text/javascript" src="https://oss.sheetjs.com/sheetjs/xlsx.full.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.20/jspdf.plugin.autotable.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// if( is_subscribed )
// {
// window.location.href = '/login?redirect-to=/optanalystview';
// // window.location.replace('/login');
// }
// else
// {
// //window.location.href = '/optanalystview';
// }
frappe.call({
method: 'optmanagementprod.www.optanlaystauth.isUserLoggedIn',
callback: function(r) {
console.log(r.message);
if(!r.message)
{
window.location.href = '/login?redirect-to=/optanalystview';
}
}
});
});
</script>
{% endblock %}
</body>
</html>