Sindbad~EG File Manager

Current Path : /proc/self/cwd/food_kit_scan_badges/core/templates/badge/
Upload File :
Current File : //proc/self/cwd/food_kit_scan_badges/core/templates/badge/view_commitment.html

{% extends 'badge/badge_layout.html' %}

<title>{% block title %}View Commitments{% endblock %}</title>

{% block content %} {% for mesg in get_flashed_messages(category_filter=["successMsg"]) %}
<div class="row">
    <div class="col-sm-4"></div>
    <div class="col-sm-4">
        <div class="text-center" id="successMsg">
            <h6 class="alert alert-success alert-dismissible"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>{{ mesg }}</h6>
        </div>
        <div class="col-sm-4"></div>
    </div>
</div>
{% endfor %} {% for mesg in get_flashed_messages(category_filter=["errorMsg"]) %}
<div class="row">
    <div class="col-sm-4"></div>
    <div class="col-sm-4">
        <div class="text-center" id="successMsg">
            <h6 class="alert alert-danger alert-dismissible"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>{{ mesg }}</h6>
        </div>
        <div class="col-sm-4"></div>
    </div>
</div>
{% endfor %}

<form>
    <input type="hidden" name="conf_id" id="conf_id" value="{{conf_id}}" />
    <input type="hidden" name="conf_key" id="conf_key" value="{{conf_key}}" />
    <div class="alert alert-success text-center successMessage alert-dismissible" id="successMessage" style="display: none;">
        <p class="close" data-dismiss="alert" aria-label="close">&times;</p>
        <span id="successMsg"></span>
    </div>
    <div class="container" style="margin-top: 100px;">
        <div class="card">
            <div class="card-body">
                <center><h4>COMMITMENTS IN {{conf_data.conf_name}}</h4></center>
                <br />
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-12 text-center">
                        <button type="button" class="btn btn-info" id="generate_btn">Generate Commitment</button>
                        <br />
                        <br />
                        <h2 id="generate_total_count"></h2>
                    </div>
                    <div class="col-lg-6 col-md-6 col-sm-12 text-left">
                        <button type="button" class="btn btn-secondary" id="update_btn">Update Commitment in Delegate table</button>
                        <br />
                        <br />
                        <h2 id="updated_total_commitment_count"></h2>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
{% endblock %} {% block bottomscript %}

<script type= "text/javascript">

var BaseUrl = document.location.origin;

$(document).on("click", "#generate_btn", function (e) {
    if (confirm("Are you sure to you want generate the commitment ?")){
    e.preventDefault();
    var conf_id           = $("#conf_id").val();
    var conf_key          = $("#conf_key").val();
    $.ajax({
        type: "POST",
        url: BaseUrl + "/" + conf_id + "/" + conf_key +"/generate_commitments",
        
        success: function (reposnse) {
            var data_1 = JSON.parse(reposnse);
            var status = data_1.status;
            var msg    = data_1.msg;
            var generate_total_count = data_1.generate_total_count;
            $("#generate_total_count").text("");
            $("#generate_total_count").text(generate_total_count);
            alert(msg);                 
            
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {},
    });
    };
});

$(document).on("click", "#update_btn", function (e) {
    if (confirm("Are you sure to you want update the commitment ?")){
      e.preventDefault();
      var conf_id           = $("#conf_id").val();
      var conf_key          = $("#conf_key").val();
      $.ajax({
          type: "POST",
          url: BaseUrl + "/" + conf_id + "/" + conf_key +"/update_commitment",
          
          success: function (reposnse) {
              var data_1 = JSON.parse(reposnse);
              var status = data_1.status;
              var msg = data_1.msg;
              var updated_total_commitment_count = data_1.updated_total_commitment_count;
              $("#updated_total_commitment_count").text("");
              $("#updated_total_commitment_count").text(updated_total_commitment_count);

              alert(msg);
          },
          error: function (XMLHttpRequest, textStatus, errorThrown) {},
      });
    };
  });
</script>
{% endblock %}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists