Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 4938 | Rev 15386 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1320 efrain 1
<?php
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
 
5
$routeReports = $this->url('microlearning/reports/progress');
6
 
7
$roleName = $currentUser->getUserTypeId();
8
 
9
 
10
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
11
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
12
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.js'));
13
 
14
$this->headStyle()->captureStart();
15
echo <<<CSS
16
 
17
 
18
#tableStudents {
19
    display: flex;
20
    flex-flow: column;
21
    width: 100%;
22
}
23
 
24
#tableStudents thead {
25
    flex: 0 0 auto;
26
}
27
 
28
#tableStudents tbody {
29
    flex: 1 1 auto;
30
    display: block;
31
    overflow-y: auto;
32
    overflow-x: hidden;
33
}
34
 
35
#tableStudents tr {
36
    width: 100%;
37
    display: table;
38
    table-layout: fixed;
39
}
40
CSS;
41
$this->headStyle()->captureEnd();
42
 
43
 
44
 
45
$this->inlineScript()->captureStart();
46
echo <<<JS
47
jQuery( document ).ready(function( $ ) {
48
 
49
    $.fn.changeFilter = function() {
50
        NProgress.start();
51
        $.ajax({
52
            'dataType'  : 'json',
53
            'accept'    : 'application/json',
54
            'method'    : 'get',
55
            'url'       :  $('#form-filter').attr('action'),
56
            'data'      :  $('#form-filter').serialize(),
57
        }).done(function(response) {
58
            if(response['success']) {
59
 
60
 
14614 efrain 61
                if(response['data']['capsules']) {
62
 
63
                    $('#form-filter #capsule_uuid').empty();
64
 
65
                    $.each(response['data']['capsules'], function( value, label ) {
66
                      $('#form-filter #capsule_uuid').append(new Option(label, value));
67
                    });
68
                }
69
 
70
                if(response['data']['items']) {
71
                    $('#gridTable tbody').empty();
72
                    $('#gridTable tbody').append(
73
                        $( "#progressRowTemplate" ).render( response['data']['items'] )
1320 efrain 74
 
14614 efrain 75
                    );
76
 
77
                }
1320 efrain 78
 
79
            } else {
80
                if(jQuery.type(response['data']) == 'string') {
81
                    $.fn.showError(response['data']);
82
                } else  {
83
                    $.each(response['data'], function( fieldname, errors ) {
14614 efrain 84
                        $.fn.showFormErrorValidator('#form-filter #' + fieldname, errors);
1320 efrain 85
                    });
86
                }
87
            }
88
        }).fail(function( jqXHR, textStatus, errorThrown) {
89
            $.fn.showError(textStatus);
90
        }).always(function() {
91
            NProgress.done();
92
        });
93
        return false;
94
    }
95
 
96
    $('#form-filter #topic_uuid').change(function(e) {
97
        e.preventDefault();
98
 
99
        $('#form-filter #capsule_uuid').empty();
100
        $.fn.changeFilter();
101
    })
102
 
103
 
104
    $('#form-filter #capsule_uuid').change(function(e) {
105
        e.preventDefault();
106
 
107
        $.fn.changeFilter();
108
    })
109
 
110
 
111
    $.fn.changeFilter();
112
 
113
});
114
JS;
115
$this->inlineScript()->captureEnd();
116
?>
117
 
118
<!-- Content Header (Page header) -->
119
<section class="content-header">
120
	<div class="container-fluid">
121
    	<div class="row mb-2">
122
        	<div class="col-sm-12">
123
            	<h1>LABEL_PROGRESS_FOR_CAPSULE</h1>
124
			</div>
125
		</div>
126
	</div><!-- /.container-fluid -->
127
</section>
128
 
129
<section class="content">
130
	<div class="container-fluid">
131
    	<div class="row">
132
        	<div class="col-12">
133
				<div class="card">
134
					<div class="card-header">
135
						<?php
136
                        $form = $this->form;
137
            	        $form->setAttributes([
138
                            'name'    => 'form-filter',
139
                            'id'      => 'form-filter',
140
                        ]);
141
 
142
                        $form->prepare();
143
                        echo $this->form()->openTag($form);
144
                        ?>
145
                        <div class="row">
146
                            <div class="col-md-6 col-sm-12">
147
                                <div class="form-group">
148
                                    <?php
14614 efrain 149
                                    $element = $form->get('topic_uuid');
150
                                    $element->setOptions(['label' => 'LABEL_TOPIC']);
1320 efrain 151
 
14614 efrain 152
                                    $element->setAttributes(['class' => 'form-control']);
153
                                    echo $this->formLabel($element);
154
                                    echo $this->formSelect($element);
1320 efrain 155
                                    ?>
156
                                </div>
157
                            </div>
158
                            <div class="col-md-6 col-sm-12">
159
                                <div class="form-group">
160
                                    <?php
14614 efrain 161
                                    $element = $form->get('capsule_uuid');
162
                                    $element->setOptions(['label' => 'LABEL_CAPSULE']);
163
                                    $element->setAttributes(['class' => 'form-control']);
164
                                    echo $this->formLabel($element);
165
                                    echo $this->formSelect($element);
1320 efrain 166
                                    ?>
167
                                </div>
168
                            </div>
14614 efrain 169
                            <!--
1320 efrain 170
                            <div
171
                                class="col-md-12 col-sm-12"
172
                            >
173
                                <div style="float:right;">
174
                                    <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
14614 efrain 175
 
1320 efrain 176
                                </div>
177
                            </div>
14614 efrain 178
                             -->
1320 efrain 179
                        </div>
180
						<?php echo $this->form()->closeTag($form); ?>
181
					</div>
182
					<div class="card-body">
183
        	    		<table id="gridTable" class="table   table-hover">
184
                      		<thead>
185
        						<tr>
186
									<th style="width: 12%">LABEL_FIRST_NAME</th>
187
									<th style="width: 12%">LABEL_LAST_NAME</th>
14614 efrain 188
									<th style="width: 16%">LABEL_EMAIL</th>
1320 efrain 189
       								<th style="width: 20%">LABEL_DATE</th>
14614 efrain 190
                      				<th style="width: 20%">LABEL_REPORTS_PROGRESS</th>
191
 
1320 efrain 192
                                </tr>
193
                       		</thead>
194
                         	<tbody>
195
                         	</tbody>
196
                    	</table>
197
                   	</div>
198
          		</div>
199
           	</div>
200
        </div>
201
 	</div>
202
</section>
203
 
204
 
205
 
206
 
207
<script id="progressRowTemplate" type="text/x-jsrender">
208
    <tr>
209
        <td style="width: 12%">
210
            {{>first_name}}
211
        </td>
212
        <td style="width: 12%">
213
             {{>last_name}}
214
        </td>
215
        <td style="width: 16%">
216
            {{>email}}
217
        </td>
218
 
219
        <td style="width: 20%">
220
            LABEL_REPORTS_FIRST_DATE
221
            <br>
14614 efrain 222
            {{>added_on}}
223
            <br><br>
1320 efrain 224
            LABEL_REPORTS_LAST_DATE
225
            <br>
14614 efrain 226
            {{>updated_on}}
1320 efrain 227
        </td>
14614 efrain 228
        <td style="width: 20%">
229
 
230
 
231
            <div class="progress progress-xs progress-striped active" style="height: 15px">
232
                <div class="progress-bar {{if completed == '1' }} bg-success {{ else }} bg-primary {{/if}}" style="width: {{>progress}}%">
233
{{>progress}}  %
234
                </div>
1320 efrain 235
            </div>
236
        </td>
14614 efrain 237
 
1320 efrain 238
    </tr>
239
</script>
240
 
241
 
242
 
243
 
244
 
245
 
246