{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    Certificates Stats report page.

    @package   local_edwiserreports/reports
    @author    Yogesh Shirsath
    @copyright (c) 2022 WisdmLabs (https://wisdmlabs.com/)
    @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

}}
{{!
    @template local_edwiserreports/reports/certificates

    Context variables required for this template:

    Example context (json):
    {
    }
}}
{{> local_edwiserreports/navigation }}
{{> local_edwiserreports/report-page-header }}
<div class="report-content" id="certificates">
    <div id="wdm-userfilter" class="h-auto my-10">
        <div class="row">
            <div class="filter-selector col-12 col-md-3 mb-3">
                <label>{{#str}} search, local_edwiserreports {{/str}}</label>
                {{> local_edwiserreports/datatable/search }}
            </div>
            {{# cohortfilters }}
                <div class="filter-selector col-12 col-md-2 mb-3">
                <label>{{#str}} cohort, local_edwiserreports {{/str}}</label>
                    <select class="cohort-select form-control singleselect" name="cohort-select">
                        {{#values}}
                            <option value="{{id}}">{{name}}</option>
                        {{/values}}
                    </select>
                </div>
            {{/ cohortfilters }}
            {{# hascertificates}}
                <div class="filter-selector col-12 col-md-3 mb-3" id="wdm-certificates-dropdown">
                    <label>{{#str}} certificate, local_edwiserreports {{/str}}</label>
                    <select class="certificate-select form-control singleselect" name="certificate-select">
                        {{#certificates}}
                        <option value="{{id}}">{{coursename}}: {{name}}</option>
                        {{/certificates}}
                    </select>
                </div>
            {{/ hascertificates}}
            <div class="filter-selector col-12 table-length-input ml-auto mb-3">
                <label>{{#str}} show, local_edwiserreports {{/str}}</label>
                {{> local_edwiserreports/datatable/length }}
            </div>
            {{# export }}
                {{> local_edwiserreports/exportreports }}
            {{/ export }}
        </div>
    </div>
    <table class="table" class="table-responsive">
        <thead>
            <tr>
                <th>{{#str}} username, local_edwiserreports {{/str}}</th>
                <th>{{#str}} useremail, local_edwiserreports {{/str}}</th>
                <th>{{#str}} dateofissue, local_edwiserreports {{/str}}</th>
                <th>{{#str}} dateofenrol, local_edwiserreports {{/str}}</th>
                <th>{{#str}} grade, local_edwiserreports {{/str}}</th>
                <th>{{#str}} courseprogress, local_edwiserreports {{/str}}</th>
            </tr>
        </thead>
        <tbody></tbody>
    </table>
</div>

{{#setactive}}
    {{> local_edwiserreports/setactivenav }}
{{/setactive}}

{{#js}}
M.local_edwiserreports = {
    secret: '{{{secret}}}'
};

M.util.js_pending('local_edwiserreports/reports/certificates');
require(['local_edwiserreports/reports/certificates'], function(amd) {
    amd.init();
    M.util.js_complete('local_edwiserreports/reports/certificates');
});
{{/js}}
