{{!
    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.

    Course Completion 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/completion

    Context variables required for this template:

    Example context (json):
    {
    }
}}
{{> local_edwiserreports/navigation }}
{{> local_edwiserreports/report-page-header }}
<div class="report-content" id="completion" data-sesskey="{{sesskey}}">
    <div id="userfilter" class="h-auto mt-2">
        <div class="row">
            {{# cohortfilters }}
                <div class="filter-selector col-12 col-md-4 mb-3 col-lg-3 col-sl-6">
                    <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 }}
            <div class="filter-selector col-12 col-lg-3 col-md-4 mb-3 col-lg-3 col-sl-6">
                <label>{{#str}} course, local_edwiserreports {{/str}}</label>
                {{> local_edwiserreports/filters/courses_filter }}
            </div>

            <div class="filter-selector col-12 col-lg-3 col-md-4 mb-3 {{^ groups }} d-none {{/ groups }}">
                <label>{{#str}} group, local_edwiserreports {{/str}}</label>
                {{> local_edwiserreports/filters/groups_filter }}
            </div>

        </div>
    </div>

    {{> local_edwiserreports/summary/summary-card }}

    <div id="userfilter" class="h-auto mt-2 mb-2">
        <div class="row">
            <div class="filter-selector col-12 col-md-4 mb-3 col-lg-3 col-sl-6">
                <label>{{#str}} search, local_edwiserreports {{/str}}</label>
                {{> local_edwiserreports/datatable/search }}
            </div>

            <div class="filter-selector col-12 col-lg-3 col-md-4 mb-3">
                <label>{{#str}} exclude, local_edwiserreports {{/str}}</label>
                <select class="exclude-select notselected form-control singleselect" multiple>
                    <option value="0">{{#str}} suspendedusers, core {{/str}}</option>
                    <option value="2">{{#str}} inactivesince1month, local_edwiserreports {{/str}}</option>
                    <option value="3">{{#str}} inactivesince1year, local_edwiserreports {{/str}}</option>
                </select>
            </div>

            <div class="filter-selector col-12 col-lg-3 col-md-4 mb-3">
                <label>{{#str}} inactive, local_edwiserreports {{/str}}</label>
                <select class="inactive-select form-control singleselect">
                    <option value="0">{{#str}} allusers, local_edwiserreports {{/str}}</option>
                    <option value="1">{{#str}} since1week, local_edwiserreports {{/str}}</option>
                    <option value="2">{{#str}} since2weeks, local_edwiserreports {{/str}}</option>
                    <option value="3">{{#str}} since1month, local_edwiserreports {{/str}}</option>
                    <option value="4">{{#str}} since1year, local_edwiserreports {{/str}}</option>
                </select>
            </div>

            <div class="filter-selector col-12 col-lg-3 col-md-4 mb-3">
                <label>{{#str}} progress, local_edwiserreports {{/str}}</label>
                <select class="progress-select form-control singleselect">
                    <option value="0">{{#str}} all, local_edwiserreports {{/str}}</option>
                    <option value="1">{{#str}} notstarted, local_edwiserreports {{/str}}</option>
                    <option value="2">0% - 20%</option>
                    <option value="3">>20% - 40%</option>
                    <option value="4">>40% - 60%</option>
                    <option value="5">>60% - 80%</option>
                    <option value="6">>80% - 100%</option>
                    <option value="7">{{#str}} completed, local_edwiserreports {{/str}}</option>
                </select>
            </div>

            <div class="filter-selector col-12 col-lg-3 col-md-4 mb-3">
                <label>{{#str}} grade, local_edwiserreports {{/str}}</label>
                <select class="grade-select form-control singleselect">
                    <option value="0">{{#str}} all, local_edwiserreports {{/str}}</option>
                    <option value="1">0% - 20%</option>
                    <option value="2">>20% - 40%</option>
                    <option value="3">>40% - 60%</option>
                    <option value="4">>60% - 80%</option>
                    <option value="5">>80% - 100%</option>
                </select>
            </div>

            <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">
        <thead>
            <tr>
                <th>
                    <div class="text-left">{{#str}} learner, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} email, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} status, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} enrolledon, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} completedon, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} lastaccess, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} progress, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} grade, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} completedactivities, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} completedassignments, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} completedquizzes, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} completedscorms, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} totalvisits, local_edwiserreports {{/str}} </div>
                </th>
                <th>
                    <div class="text-left">{{#str}} timespent, local_edwiserreports {{/str}} </div>
                </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/completion');
require(['local_edwiserreports/reports/completion'], function(amd) {
    amd.init();
    M.util.js_complete('local_edwiserreports/reports/completion');
});
{{/js}}
