Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1320 | Rev 14614 | 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
                $('#tableStudents tbody').empty();
61
                $('#tableStudents tbody').append(
62
                    $( "#progressRowTemplate" ).render( response['data'] )
63
 
64
                );
65
 
66
 
67
            } else {
68
                if(jQuery.type(response['data']) == 'string') {
69
                    $.fn.showError(response['data']);
70
                } else  {
71
                    $.each(response['data'], function( fieldname, errors ) {
72
                        $.fn.showFormErrorValidator('#form-slide-video-edit #' + fieldname, errors);
73
                    });
74
                }
75
            }
76
        }).fail(function( jqXHR, textStatus, errorThrown) {
77
            $.fn.showError(textStatus);
78
        }).always(function() {
79
            NProgress.done();
80
        });
81
        return false;
82
    }
83
 
84
    $('#form-filter #topic_uuid').change(function(e) {
85
        e.preventDefault();
86
 
87
        $('#form-filter #capsule_uuid').empty();
88
        $.fn.changeFilter();
89
    })
90
 
91
 
92
    $('#form-filter #capsule_uuid').change(function(e) {
93
        e.preventDefault();
94
 
95
        $.fn.changeFilter();
96
    })
97
 
98
 
99
    $.fn.changeFilter();
100
 
101
});
102
JS;
103
$this->inlineScript()->captureEnd();
104
?>
105
 
106
<!-- Content Header (Page header) -->
107
<section class="content-header">
108
	<div class="container-fluid">
109
    	<div class="row mb-2">
110
        	<div class="col-sm-12">
111
            	<h1>LABEL_PROGRESS_FOR_CAPSULE</h1>
112
			</div>
113
		</div>
114
	</div><!-- /.container-fluid -->
115
</section>
116
 
117
<section class="content">
118
	<div class="container-fluid">
119
    	<div class="row">
120
        	<div class="col-12">
121
				<div class="card">
122
					<div class="card-header">
123
						<?php
124
                        $form = $this->form;
125
            	        $form->setAttributes([
126
                            'name'    => 'form-filter',
127
                            'id'      => 'form-filter',
128
                        ]);
129
 
130
                        $form->prepare();
131
                        echo $this->form()->openTag($form);
132
                        ?>
133
                        <div class="row">
134
                            <div class="col-md-6 col-sm-12">
135
                                <div class="form-group">
136
                                    <?php
4938 efrain 137
                                    //$element = $form->get('topic_uuid');
1320 efrain 138
 
4938 efrain 139
                                   // $element->setOptions(['label' => 'LABEL_TOPIC']);
1320 efrain 140
 
4938 efrain 141
                                   // $element->setAttributes(['class' => 'form-control']);
142
                                   // echo $this->formLabel($element);
143
                                   // echo $this->formSelect($element);
1320 efrain 144
                                    ?>
145
                                </div>
146
                            </div>
147
                            <div class="col-md-6 col-sm-12">
148
                                <div class="form-group">
149
                                    <?php
4938 efrain 150
                                    //$element = $form->get('capsule_uuid');
151
                                   // $element->setOptions(['label' => 'LABEL_CAPSULE']);
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
159
                                class="col-md-12 col-sm-12"
160
                            >
161
                                <div style="float:right;">
162
                                    <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
163
                                    <?php if($allowUpload) : ?>
164
                                        <button type="button" class="btn btn-primary btn-upload"><i class="fa fa-upload"></i> LABEL_UPLOAD  </button>
165
                                    <?php endif; ?>
166
                                    <?php if($allowNotification) : ?>
167
                                        <button type="button" class="btn btn-primary btn-notification"><i class="fa fa-tablet"></i> LABEL_NOTIFICATION </button>
168
                                    <?php endif; ?>
169
                                </div>
170
                            </div>
171
                        </div>
172
						<?php echo $this->form()->closeTag($form); ?>
173
					</div>
174
					<div class="card-body">
175
        	    		<table id="gridTable" class="table   table-hover">
176
                      		<thead>
177
        						<tr>
178
									<th style="width: 12%">LABEL_FIRST_NAME</th>
179
									<th style="width: 12%">LABEL_LAST_NAME</th>
180
									<th style="width: 16%">LABEL_EMAIL_NAME</th>
181
       								<th style="width: 20%">LABEL_DATE</th>
182
                      				<th style="width: 12%">LABEL_REPORTS_PROGRESS</th>
183
                      				<th style="width: 8%" class="text-right">%</th>
184
                                </tr>
185
                       		</thead>
186
                         	<tbody>
187
                         	</tbody>
188
                    	</table>
189
                   	</div>
190
          		</div>
191
           	</div>
192
        </div>
193
 	</div>
194
</section>
195
 
196
 
197
 
198
 
199
<script id="progressRowTemplate" type="text/x-jsrender">
200
    <tr>
201
        <td style="width: 12%">
202
            {{>first_name}}
203
        </td>
204
        <td style="width: 12%">
205
             {{>last_name}}
206
        </td>
207
        <td style="width: 16%">
208
            {{>email}}
209
        </td>
210
 
211
        <td style="width: 20%">
212
            LABEL_REPORTS_FIRST_DATE
213
            <br>
214
            {{>first_date}} {{>first_time}}
215
            <br>
216
            LABEL_REPORTS_LAST_DATE
217
            <br>
218
            {{>last_date}} {{>last_time}}
219
        </td>
220
        <td style="width: 12%">
221
            <div class="progress progress-xs progress-striped active">
222
                <div class="progress-bar bg-primary" style="width: {{>total_capsules_percentaje}}%"></div>
223
            </div>
224
        </td>
225
        <td style="width: 8%" class="text-right">{{>total_capsules_percentaje}}</td>
226
    </tr>
227
</script>
228
 
229
 
230
 
231
 
232
 
233
 
234