{% extends "base.html" %}
{#% load endless %#}
{% load static %}

{% block head %}

<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>

<!-- Load js for initializing tables via their server-side options -->
<script type="text/javascript" charset="utf8" src="{% static 'js/datatableview.js' %}"></script>
<script type="text/javascript">
    datatableview.auto_initialize = false;
    $(function(){

        var xeditable_options = {};
        datatableview.initialize($('.datatable'), {
            fnRowCallback: datatableview.make_xeditable(xeditable_options),
        });

        $('#btn-download').on('click', function() {
            var $this = $(this);
            var loadingText = '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>  Loading...';
            if ($(this).html() !== loadingText) {
            $this.data('original-text', $(this).html());
            $this.html(loadingText);
            }
            setTimeout(function() {
            $this.html($this.data('original-text'));
            }, 20000);
        });
    });  


</script>
{% endblock %}


{% block content %}

    <div class="container text-center">

    <h1>CI/nCI</h1>
      <br/>
      <br/>


      <form action="" method="post">
          {% csrf_token %}
          {{ form.as_p }}



          <button type="submit" name="calculate">Calculate</button>



      </form>

      <br/>
      <br/>
    <table class="table">
        <tbody>
            <tr>
                <td>TV<sub>PIV</sub></td><td>{{result.TVPIV}}</td>
            </tr>
            <tr>
                <td>CI</td><td>{{result.CI}}</td>
            </tr>
            <tr>
                <td>nCI</td><td>{{result.nCI}}</td>
            </tr>
        </tbody>
    </table>

    </div>

<iframe width="239" height="264" seamless frameborder="0" scrolling="no" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSiRp1tMV67Lz9JfpSnK7HnaLcymeV0_eOVlC8EmT9s1tQ0yIekcmIfYFmGMewpOgqgLBbW_Edl4NCW/pubchart?oid=1656506575&amp;format=interactive"></iframe>
<iframe width="239" height="264" seamless frameborder="0" scrolling="no" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSiRp1tMV67Lz9JfpSnK7HnaLcymeV0_eOVlC8EmT9s1tQ0yIekcmIfYFmGMewpOgqgLBbW_Edl4NCW/pubchart?oid=1192959745&amp;format=interactive"></iframe>
<iframe width="239" height="264" seamless frameborder="0" scrolling="no" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSiRp1tMV67Lz9JfpSnK7HnaLcymeV0_eOVlC8EmT9s1tQ0yIekcmIfYFmGMewpOgqgLBbW_Edl4NCW/pubchart?oid=1745528973&amp;format=interactive"></iframe>
<iframe width="239" height="264" seamless frameborder="0" scrolling="no" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSiRp1tMV67Lz9JfpSnK7HnaLcymeV0_eOVlC8EmT9s1tQ0yIekcmIfYFmGMewpOgqgLBbW_Edl4NCW/pubchart?oid=248708849&amp;format=interactive"></iframe>

{% endblock %}

