PageSourceSearch

https://soporte.unae.edu.ec/login?ret=/

html unae.edu.ec collected 2026-10-02 04:20:18 UTC 78,621 bytes, 2,031 lines download raw bytes

1<!DOCTYPE html>
2<html lang="es">
3<head>
4    <!-- Google tag (gtag.js) -->
vendor: 63 bytes, line 4
4<script async src="https://www.googletagmanager.com/gtag/js?id=
4G-LWJVQFXMQE
vendor: 12 bytes, line 4
4"></script>
5<script>
6  
vendor: 133 bytes, lines 6-9
6window.dataLayer = window.dataLayer || [];
7  function gtag(){dataLayer.push(arguments);}
8  gtag('js', new Date());
9  gtag('config', '
9G-LWJVQFXMQE
vendor: 4 bytes, line 9
9');
10</script>
10
11    <meta charset="utf-8">
12    <title>Inicio de Sesi&oacute;n - MESA DE AYUDA</title>
13    <meta name="viewport" content="width=device-width, initial-scale=1.0">
14    <meta name="description" content="ACADEMIC-OK">
15    <meta name="author" content="OKSOFTWR">
16
17    <link rel="stylesheet" href="/static/css/bootstrap.min.css?v=1.9.3">
18    <link rel="stylesheet" href="/static/css/sticky-footer.css?v=1.7.2">
19    <link rel="stylesheet" href="/static/css/style.css?v=1.8.7">
20    <link rel="stylesheet" href="/static/css/fontello.css?v=1.7.2">
21    <link rel="stylesheet" href="/static/css/smoke.css?v=1.7.0">
22    <link rel="stylesheet" href="/static/css/datepicker.css?v=1.7.0"/>
23    <link rel="stylesheet" href="/static/css/bootstrap-timepicker.css?v=1.7.0" />
24    <link rel="stylesheet" href="/static/css/jquery.fancybox.css?v=1.7.0" type="text/css" media="screen" />
25    <link rel="stylesheet" href="/static/css/select2.css?v=1.8.2">
26    <link rel="stylesheet" href="/static/css/vswitch.css?v=1.7.0" type="text/css" />
27    <link rel="stylesheet" href="/static/css/vswitch-blue.css?v=1.7.0" type="text/css" />
28    <link href="/static/css/bootstrap-colorpicker.css?v=1.7.0" rel="stylesheet">
29    <link href="/static/css/bootstrap-toggle.min.css?v=1.2.10" rel="stylesheet">
30    <link rel="stylesheet" href="/static/fontawesome6.1.1/css/all.css?v=1.1">
31
32    
33    <!-- Path to manifest.json -->
34<link rel="manifest" href="/manifest.json">
35
36<!-- Add to homescreen for Chrome on Android -->
37<meta name="mobile-web-app-capable" content="yes">
38<meta name="application-name" content="MyApp">
39
40
41<!-- Chrome for Android theme color -->
42<meta name="theme-color" content="#000">
43
44<!-- Add to homescreen for Safari on iOS -->
45<meta name="apple-mobile-web-app-capable" content="yes">
46<meta name="apple-mobile-web-app-title" content="MyApp">
47<meta name="apple-mobile-web-app-status-bar-style" content="default">
48
49
50    
51        <link rel="apple-touch-icon" href="/static/images/icons/icon-72x72.png" sizes="72x72">
52    
53        <link rel="apple-touch-icon" href="/static/images/icons/icon-96x96.png" sizes="96x96">
54    
55        <link rel="apple-touch-icon" href="/static/images/icons/icon-128x128.png" sizes="128x128">
56    
57        <link rel="apple-touch-icon" href="/static/images/icons/icon-144x144.png" sizes="144x144">
58    
59        <link rel="apple-touch-icon" href="/static/images/icons/icon-152x152.png" sizes="152x152">
60    
61        <link rel="apple-touch-icon" href="/static/images/icons/icon-192x192.png" sizes="192x192">
62    
63        <link rel="apple-touch-icon" href="/static/images/icons/icon-384x384.png" sizes="384x384">
64    
65        <link rel="apple-touch-icon" href="/static/images/icons/icon-512x512.png" sizes="512x512">
66    
67
68
69
70
71<link href="/static/images/icons/splash-640x1136.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"/>
72
73<link href="/static/images/icons/splash-750x1334.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"/>
74
75<link href="/static/images/icons/splash-1242x2208.png" media="(device-width: 621px) and (device-height: 1104px) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image"/>
76
77<link href="/static/images/icons/splash-1125x2436.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image"/>
78
79<link href="/static/images/icons/splash-828x1792.png" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"/>
80
81<link href="/static/images/icons/splash-1242x2688.png" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image"/>
82
83<link href="/static/images/icons/splash-1536x2048.png" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"/>
84
85<link href="/static/images/icons/splash-1668x2224.png" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"/>
86
87<link href="/static/images/icons/splash-1668x2388.png" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"/>
88
89<link href="/static/images/icons/splash-2048x2732.png" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image"/>
90
91
92
93<!-- Tile for Win8 -->
94<meta name="msapplication-TileColor" content="#fff">
95
96<meta name="msapplication-TileImage" content="/static/images/icons/icon-512x512.png">
97
98
99<link rel="icon" sizes="512x512" href="/static/images/icons/icon-512x512.png">
100
101
102<script type="text/javascript">
103    // Initialize the service worker
104    if ('serviceWorker' in navigator) {
105        navigator.serviceWorker.register('/serviceworker.js', {
106            scope: '/'
107        }).then(function (registration) {
108            // Registration was successful
109            
110            console.log('django-pwa: ServiceWorker registration successful with scope: ', registration.scope);
111            
112        }, function (err) {
113            // registration failed :(
114            
115            console.log('django-pwa: ServiceWorker registration failed: ', err);
116            
117        });
118    }
119</script>
119
120
121    <meta name="vapid-key" content="">
122    <meta name="islogged" content="false">
123
124    <link rel="shortcut icon" href="/static/images/aok/favicon.ico?v=1.0.6">
125
126
127</head>
128<body data-spy="scroll" data-target=".subnav" data-offset="50" class=''>
129<input type="hidden" name="csrfmiddlewaretoken" value="wV4EPKfMJTtIHQH2FdEIB1iiByXlwyW3IE5FIW8Vk5E45Zm2hBlhdL1IYQW06vt8">
130<nav class="navbar navbar-fixed-top bg-header" id="contentheadpage" style="z-index: 1000; vertical-align: middle">
131    <div id="menunav" class="float-left" style="vertical-align: middle">
132        <a class="float-left item-menu namelogo" href="/"> <img style="height: 25px; margin-top: 0px;" src='/static/images/aok/logo.png?v1.0.6'/></a>
133    </div>
134    
135</nav>
136<nav id="footer" class="navbar navbar-fixed-bottom bg-footer" style="; z-index: 1000; color: white; font-size: 9pt">
137    <div style="background-color: transparent;">
138        <div class="col-12">
139
140            <div class="small text-center">
141                <span>Universidad Nacional de Educación. Todos los derechos reservados(c) 2022 </span>
142            </div>
143        </div>
144    </div>
145</nav>
146
147
148    
149    <input type="hidden" name="csrfmiddlewaretoken" value="wV4EPKfMJTtIHQH2FdEIB1iiByXlwyW3IE5FIW8Vk5E45Zm2hBlhdL1IYQW06vt8">
150    
151    <div class="container-scroller">
152        <div class="container-fluid page-body-wrapper full-page-wrapper">
153
154            <div class="content-wrapper d-flex align-items-stretch auth auth-img-bg">
155                <div class="row flex-grow">
156
157                    <div class="col-lg-6 login-half-bg flex-row hidden-phone hidden-tablet">
158                        
159                        
160                        
161                        
162                        
163                        
164                        
165                        
166                    </div>
167                    <div class="col-lg-6 col-sm-12 col-xs-12 d-flex align-items-center justify-content-center">
168                        <div class="auth-form-transparent text-left p-3">
169
170                            <h4 style="color: #3e295f"><b>Acceso a la Mesa de Ayuda</b></h4>
171                            <h6 class="font-weight-light"><b style="color: #3e295f">Universidad Nacional de Educación</b></h6>
172                            <form class="pt-3" onSubmit="return false;" action="" >
173                                <p class="mensajes" id="errormensaje" style="display: None; color: red"></p>
174                                <div class="form-group">
175                                    <div class="input-group">
176                                        <div class="input-group-prepend bg-transparent">
177                                            <span class="input-group-text bg-transparent"><i class="fa fa-user text-primary"></i></span>
178                                        </div>
179                                        <input type="text" class="form-control form-control" id="user" placeholder="Usuario">
180                                    </div>
181                                </div>
182                                <div class="form-group" style="margin-top: 10px">
183                                    <div class="input-group">
184                                        <div class="input-group-prepend bg-transparent">
185                                            <span class="input-group-text bg-transparent"><i class="fa fa-lock text-primary"></i></span>
186                                        </div>
187                                        <input type="password" class="form-control form-control" id="pass" data-toggle="password" data-placement="after" name="pass" placeholder="Contraseña">
188                                        <input type="text" style="width: 207px; display: none;" placeholder="Ingrese su contraseña">
189
190                                    </div>
191                                </div>
192                                <div class="my-2 d-flex justify-content-between align-items-center">
193
194                                    <a href="https://cas.unae.edu.ec" target="_blank" class="auth-link text-black">Recuperar contraseña</a>
195                                </div>
196                                <div class="my-3">
197                                    <a id="login" class="btn btn-block btn-secondary btn-lg font-weight-medium auth-form-btn" href="javascript:;">Iniciar sesión</a>
198                                </div>
199                                <div class="text-center">
200                                    <b class="w-100 text-center text-muted">— O —</b>
201                                </div>
202                                <div class="my-3">
203                                    <a class="btn btn-block btn-outline-secondary btn-lg font-weight-medium auth-form-btn" href="/cas/login/">Inicia sesión con CAS</a>
204                                </div>
205
206
207
208
209
210                            </form>
211                        </div>
212                    </div>
213                </div>
214            </div>
215        </div>
216    </div>
217
218
219<div class="modal fade" id="waitpanel" style="display: none;">
220    <div class="modal-dialog" role="document">
221        <div class="modal-content">
222            <div class="modal-header">
223                <h4 id="waitpaneltitle"></h4>
224            </div>
225            <div class="modal-body">
226                <p id="waitpanelbody"></p>
227            </div>
228        </div>
229    </div>
230</div>
231<div id="throbber" style="display:none; margin: 0 auto; width: 60px; height: 60px">
232    <img src="/static/images/ajax-document-loader.gif" />
233</div>
234<div class="modal fade static" id="formatoreporte" style="display: none;">
235    <div class="modal-dialog" role="document">
236        <div class="modal-content" style="background-color: #f6f6f6">
237            <div class="modal-header">
238                <h4 id="paneltitle">
238Formato de reporte</h4>
239            </div>
240            <div class="modal-body">
241                <select style="width: 100%;" id="formatoreporte_formato">
242                    <option id="formatopdf" value="0">PORTABLE DOCUMENT FORMAT (PDF)</option>
243                    <option id="formatodoc" value="1">MICROSOFT WORD (DOCX)</option>
244                    <option id="formatoxls" value="2">MICROSOFT EXCEL (XLXS)</option>
245                    <option id="formatocsv" value="3">COMMA-SEPARATED VALUES (CSV)</option>
246                </select>
247            </div>
248            <div class="modal-footer">
249                <a href="javascript:" id="formatoreporte_run" class="btn btn-success">Ejecutar</a>
250                <a href="javascript:" id="formatoreporte_close" class="btn btn-info">Cerrar</a>
251            </div>
252        </div>
253    </div>
254</div>
255<div class="modal fade " id="ficheromodal" style="display: none;">
256    <div class="modal-dialog" role="document">
257        <div class="modal-content">
258            <div class="modal-header">
259                <h4>Descargar archivo</h4>
260            </div>
261            <div class="modal-body" style="text-align: center; min-height: 30px">
262                <div style="width: 40px; float: left"><a id='enlacefichero' href="javascript:" target="_blank" class="btn btn-success btn-xs tu" title="Descargar"><i class="icon-download"></i></a></div>
263                <div style="float: left"><p id='enlaceficheronombre' ></p></div>
264            </div>
265            <div class="modal-footer">
266                <a href="javascript:" class="btn btn-cerrar btn-info">Cerrar</a>
267            </div>
268        </div>
269    </div>
270</div>
271<div class="modal  " id="confirmacionmodaldinamico" style="display: none;"></div>
272<div class="modal " id="eliminacionmodaldinamico" style="display: none;"></div>
273<div class="modal " id="formulariomodaldinamico" style="display: none;"></div>
274<div class="modal" id="mensajemodaldinamico" style="display: none;"></div>
275<div class="modal " id="infomodaldinamico" style="display: none;">
276    <div id="ajaxextradinamicbs"></div>
277    <div class="modal-dialog" role="document">
278        <div class="modal-content">
279            <div class="modal-header"><h4>Información</h4></div>
280            <div class="modal-body" id="infomodaldinamico_body" style="min-height: 60px">
281            </div>
282            <div class="modal-footer">
283                <p style="text-align: right; margin-bottom: 0">
284                    <a href="javascript:" id="infomodaldinamico_cancel" class="btn btn-info"> Aceptar</a>
285                </p>
286            </div>
287        </div>
288    </div>
289</div>
290<div class="modal fade static" id="extra_confirmacion_modal" style="display: none; margin-top: 20px">
291    <div id="ajaxextradinamicbs"></div>
292    <div class="modal-dialog" role="document">
293        <div class="modal-content">
294            <div class="modal-header"><h4>Alerta</h4></div>
295            <div class="modal-body" style="min-height: 60px">
296                <p id="extra_confirmacion"></p>
297            </div>
298            <div class="modal-footer">
299                <p style="text-align: right; margin-bottom: 0">
300                    <a href="javascript:" id="extra_confirmacion_save" class="btn btn-info"> Aceptar</a>
301                    <a href="javascript:" id="extra_confirmacion_cancel" class="btn btn-danger"> Cancelar</a>
302                </p>
303            </div>
304        </div>
305    </div>
306</div>
307<div class="modal fade" id="formsearch" style="display: none;">
308    <div class="modal-dialog modal-lg" role="document">
309        <div class="modal-content">
310            <div class="modal-header">
311                <h5 style="color: black">Interacción</h5>
312            </div>
313            <form>
314                <div class="modal-body" id="item-body-obj">
315
316                </div>
317            </form>
318            <div class="modal-footer">
319                <div style="float: right">
320                    <a href="javascript:;" id="search_close" class="btn btn-info">Cerrar</a>
321                </div>
322            </div>
323        </div>
324    </div>
325</div>
326
327
328
329<!--[if lt IE 9]>
330<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
330
331<![endif]-->
332
333
334<script type="text/javascript" src="/static/js/jquery-3.2.1.min.js?v=1.7.0"></script>
vendor: 1 bytes, line 334
334
335<script type="text/javascript" src="/static/js/popper.min.js?v=1.7.0"></script>
vendor: 1 bytes, line 335
335
336<script type="text/javascript" src="/static/js/bootstrap.min.js?v=1.7.0"></script>
vendor: 1 bytes, line 336
336
337<script type="text/javascript" src="/static/js/jquery.masked-input.js?v=1.7.0"></script>
vendor: 1 bytes, line 337
337
338<script type="text/javascript" src="/static/js/jquery.blockUI.js?v=1.7.0"></script>
vendor: 1 bytes, line 338
338
339<script type="text/javascript" src="/static/js/bootstrap-datepicker.js?v=1.7.0"></script>
vendor: 1 bytes, line 339
339
340<script type="text/javascript" src="/static/js/bootstrap-timepicker.js?v=1.7.0"></script>
vendor: 1 bytes, line 340
340
341<script type="text/javascript" src="/static/js/jquery.vswitch.js?v=1.7.0"></script>
vendor: 1 bytes, line 341
341
342<script type="text/javascript" src="/static/js/jquery.fancybox.pack.js?v=1.7.0"></script>
vendor: 1 bytes, line 342
342
343<script type="text/javascript" src='/static/js/jquery.validationEngine.js?v=1.7.0'></script>
vendor: 1 bytes, line 343
343
344<script type="text/javascript" src='/static/js/jquery.validationEngine-es.js?v=1.7.0' ></script>
vendor: 1 bytes, line 344
344
345<script type="text/javascript" src='/static/js/select2.js?v=1.7.6' ></script>
345
346
347
348
349<script>
350    navigator.serviceWorker.ready.then(registrationObj => {
351        const SERVICE_WORKER_VERSION_STARTS = "HELPDESK-V";
352        const INDEX_END = SERVICE_WORKER_VERSION_STARTS.length;
353        const SERVICE_WORKER_VERSION = `${SERVICE_WORKER_VERSION_STARTS}5`;
354        if (!localStorage.getItem(SERVICE_WORKER_VERSION)) {
355            fetch("/clear-site-data/", {
356                method: 'GET'
357            }).then(async r => {
358                await registrationObj.update();
359                await registrationObj.unregister();
360                const registrations = await navigator.serviceWorker.getRegistrations();
361                for (let registration of registrations) {
362                    await registration.update();
363                    await registration.unregister();
364                }
365                for (let key of Object.keys(localStorage)) {
366                    if (key.substring(0, INDEX_END).toUpperCase() === SERVICE_WORKER_VERSION_STARTS) {
367                        localStorage.removeItem(key);
368                    }
369                }
370                localStorage.setItem(SERVICE_WORKER_VERSION, "true");
371                window.location.href = window.location.href;
372            });
373        }
374    });
375</script>
vendor: 1 bytes, line 375
375
376<script src="/static/webpush/registerSw.js?v=4"></script>
376
377<!-- SweetAlert2 -->
378<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
vendor: 1 bytes, line 378
378
379<script type="text/javascript" src='/static/js/typeahead.js?v=1.7.0' ></script>
vendor: 1 bytes, line 379
379
380<script type='text/javascript' src="/static/js/sysend.js?v=1.7.0"></script>
vendor: 1 bytes, line 380
380
381<script type='text/javascript' src="/static/js/smoke.js?v=1.7.0"></script>
vendor: 1 bytes, line 381
381
382<script type='text/javascript' src="/static/js/swetalert.js?v=1.7.0"></script>
vendor: 1 bytes, line 382
382
383<script src="/static/js/bootstrap-colorpicker.js?v=1.7.0"></script>
vendor: 1 bytes, line 383
383
384<script type="text/javascript" src="/static/js/bootstrap-toggle.min.js?v=2.1.9"></script>
384
385
386
387
388
389<script>
390    var csrftoken = jQuery("[name=csrfmiddlewaretoken]").val();
391    var modalposition = 0;
392    var mensaje = '';
393    var categoriasoporte = 0;
394    var test;
395    var sessionid = null;
396    var chequearsesion = null;
397    var chequearnoti = null;
398    var logouttimer = null;
399    var tikets = null;
400    var url_home = true;
401    var iddep = 0;
402
403    $(function() {
404        if(!('contains' in String.prototype)) {
405            String.prototype.contains = function(str, startIndex) {
406                return -1 !== String.prototype.indexOf.call(this, str, startIndex);
407            };
408        }
409
410        $("*").focusin(function(){
411            $('.datepicker').css({"display": "none"});
412        });
413
414        showWaiting = function(titulo, mensaje, close) {
415            var panel = $("#waitpanel");
416            $("#waitpaneltitle").html(titulo);
417            $("#waitpanelbody").html(mensaje);
418            panel.modal("show");
419        };
420
421        hideWaiting = function() {
422            $("#waitpanel").modal("hide");
423        };
424
425        sinurlatrasbutton = function(){
426            if (location.pathname === '/'){
427                $("#urlatrasbutton").remove();
428            }
429        };
430
431        deshabilitar = function(nombre) {
432            $(nombre).attr({"disabled": "disabled"});
433        };
434
435        habilitar = function(nombre) {
436            $(nombre).removeAttr("disabled").removeAttr("readonly");
437        };
438
439        numerico = function(elemento, min, max, decimales) {
440            var nvalor;
441            var valor = elemento.val().trim();
442            if (valor.length === 0){
443                valor = parseFloat(min).toFixed(decimales);
444                elemento.val(valor);
445            } else if (isNaN(valor)){
446                nvalor = parseFloat(min).toFixed(decimales);
447                elemento.val(nvalor);
448            } else if (parseFloat(valor) < min) {
449                nvalor = parseFloat(min).toFixed(decimales);
450                elemento.val(nvalor);
451            } else if (max > 0 && parseFloat(valor) > max){
452                nvalor = parseFloat(max).toFixed(decimales);
453                elemento.val(nvalor);
454            } else {
455                nvalor = parseFloat(valor).toFixed(decimales);
456                elemento.val(nvalor);
457            }
458        };
459
460        replaceAll = function (str, find, replace) {
461            return str.replace(new RegExp(find, 'g'), replace);
462        };
463
464        validacionesnumericas = function() {
465            $(".validarnumero").blur(function(){
466                numerico($(this), 0, 0, 0);
467            });
468
469            $(".validarmoneda").blur(function(){
470                numerico($(this), 0, 0, 2);
471            });
472        };
473
474        radionbuttonselectedvalueset = function(name, SelectdValue) {
475            $('input[name="' + name+ '"][value="' + SelectdValue + '"]').prop('checked', true);
476        };
477
478        
479
480        $("#infomodaldinamico_cancel").click(function(){
481            $("#infomodaldinamico").modal("hide");
482        });
483
484        $("#extra_confirmacion_cancel").click(function(){
485            $("#extra_confirmacion_modal").modal("hide");
486        });
487
488        actualiza_path = function () {
489            $(".cambiac").each(function () {
490                var elemento = $(this);
491                var hr = elemento.attr('nhref');
492                elemento.attr({'nhref': hr+"?path="+location.pathname});
493            });
494        };
495
496        actualiza_path();
497
498        
499
500
501
502
503        $(".changeuser").click(function () {
504            var id = $(this).attr('idu');
505            bloqueointerface();
506            $.ajax({
507                type: "POST",
508                url: "/cu",
509                data: {'id': id, 'csrfmiddlewaretoken': csrftoken},
510                success: function(data) {
511                    if (data.result === 'ok') {
512                        localStorage.removeItem('sessionid');
513                        localStorage.setItem('sessionid', data.sessionid);
514                        window.name = data.sessionid;
515                        chequearsesionid = true;
516                        sysend.broadcast('sga', {message: 'reload', token: data.sessionid});
517                        location.href = "/";
518                    } else {
519                        desbloqueointerface();
520                        swal("Error", data.mensaje, "error");
521                    }
522                },
523                error: function() {
524                    desbloqueointerface();
525                    swal("Error", "Error de conexión.", "error");
526                },
527                dataType: "json"
528            });
529        });
530
531
532
533
534
535        function sleep_function ( sleepDuration, prototipe ){
536            setTimeout(function() { prototipe(); }, sleepDuration);
537        }
538
539        function sleep ( sleepDuration ){
540            var now = new Date().getTime();
541            while(new Date().getTime() < now + sleepDuration){ /* do nothing */ }
542        }
543
544        rezisewindows = function () {
545            var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
546            
547        };
548
549        window.onresize = function(event) {
550            rezisewindows();
551        };
552
553        bloqueointerface = function(){
554            try {
555                if ($('.blockOverlay').length === 0){
556                    $.blockUI({message: '<img width="35" src="/static/images/ajax-document-loader.gif">', css: { 'border': '1px solid', 'border-radius' : '10px', 'left': '45%', 'width':'60px',  'height':'60px',  'padding-top': '12px',  '-webkit-border-radius': '10px', '-moz-border-radius': '10px', 'opacity': '.5', 'color': '#000' }});
557                }
558            } catch (err){
559            }
560        };
561
562        desbloqueointerface = function(){
563            try {
564                if ($('.blockOverlay').length >= 1){
565                    $.unblockUI();
566                }
567            } catch (err){
568            }
569        };
570
571
572
573        ajustar_ancho_label = function () {
574            $(".label-vertical").each(function () {
575                var padre = $(this).parent().parent();
576                if (parseInt(padre.height()) < parseInt($(this).width() + 14)){
577                    padre.css({'height': ($(this).width() + 14 )+'px'});
578                }
579            });
580            if (labeltimer ){
581                clearInterval(labeltimer);
582            }
583        };
584
585        loginfow = function (varsessionid) {
586            if (window.name !== sessionid){
587                bloqueointerface();
588                localStorage.setItem('sessionid', varsessionid);
589                window.name = varsessionid;
590                sysend.broadcast('sga', {message: 'inicio', token: varsessionid});
591                location.href = '/';
592            }
593        };
594
595        serverdate=new Date(2026,10-1,1, 23,20,16,0);
596        clientdate=new Date();
597
598        showTime = function(){
599            date = new Date;
600            var hours = date.getHours();
601            var minutes = date.getMinutes();
602            var ampm = hours >= 12 ? 'PM' : 'AM';
603            hours = hours % 12;
604            hours = hours ? hours : 12; // the hour '0' should be '12'
605            minutes = minutes < 10 ? '0'+minutes : minutes;
606            var strTime = hours + ':' + minutes + ' ' + ampm;
607            $("#clock").text(strTime);
608
609        };
610
611        checkTime = function(i){
612            if (i<10){
613                i="0" + i;
614            }
615            return i;
616        };
617
618        setInterval(showTime,15000);
619
620        showTime();
621
622        
623            $("#chat").click(function () {
624                if ($(this).attr('visible') == 'si'){
625                    $(this).attr({'visible': 'no'});
626                    $("#chatwindows").show();
627                } else {
628                    $(this).attr({'visible': 'si'});
629                    $("#chatwindows").show();
630                }
631            });
632
633
634
635
636
637
638
639
640
641            chequearsesionfn = function () {
642                $.ajax({
643                    type: "POST",
644                    url: "/api",
645                    data: {'a': 'checksession', 'csrfmiddlewaretoken': csrftoken},
646                    success: function (data) {
647                        if (data.result === 'ok') {
648                            if (data.nuevasesion) {
649                                
650                            } else {
651                                if ($("#chat").attr('visible') === 'no') {
652                                    $("#chatwindows").show();
653                                }
654
655                                if (!data.ticket) {
656                                    $("#chatwindowsmensaje").hide();
657                                    $("#chatwindowssolicitud").show();
658                                    $("#chatwindowsnumero").hide();
659                                } else if (data.ticket && !data.atendiendo) {
660                                    $("#chatwindowsmensaje").hide();
661                                    $("#chatwindowssolicitud").show();
662                                    $("#chatwindowsnumero").hide();
663                                    $("#numerosoporte").html(data.numero);
664                                } else if (data.ticket && data.atendiendo) {
665                                    $("#chatwindowsmensaje").hide();
666                                    $("#chatwindowssolicitud").show();
667                                    $("#chatwindowsnumero").hide();
668                                }
669                            }
670                        }
671                    },
672                    dataType: "json"
673                });
674            };
675            var _calif_idp = null;
676            var _calif_ids = null;
677            function textoCalificacion(idp) {
678                switch (parseInt(idp)) {
679                    case 1:
680                        return "Excelente";
681                    case 2:
682                        return "Muy Bueno";
683                    case 3:
684                        return "Bueno";
685                    case 4:
686                        return "Regular";
687                    case 5:
688                        return "Malo";
689                    default:
690                        return "Calificación";
691                }
692            }
693
694            function enviarCalificacion(idp, ids, obs) {
695                var payload = {
696                    'a': 'calificaticket',
697                    'id': idp,
698                    'ids': ids,
699                    'csrfmiddlewaretoken': csrftoken
700                };
701
702                // Solo mandamos observación cuando NO es excelente
703                if (parseInt(idp) !== 1) {
704                    payload['obs'] = obs;  // <-- el backend debe leer esto
705                }
706
707                $.ajax({
708                    type: "POST",
709                    url: "/api",
710                    data: payload,
711                    success: function (data) {
712                        if (data.result === 'ok') {
713                            Swal.fire({
714                                icon: 'success',
715                                title: '¡Gracias!',
716                                text: 'Tu calificación fue registrada.',
717                                timer: 1500,
718                                showConfirmButton: false
719                            }).then(() => {
720                                bloqueointerface();
721                                location.reload();
722                                clearInterval(tikets);
723                            });
724                        } else {
725                            Swal.fire({
726                                icon: 'error',
727                                title: 'Ups',
728                                text: data.mensaje || 'Ocurrió un error al calificar.'
729                            });
730                        }
731                    },
732                    dataType: "json"
733                });
734            }
735            conectar_controles_calif = function () {
736                $(".calificar_soporte").unbind();
737                $(".calificar_soporte").click(function () {
738                    var elemento = $(this);
739                    var idp = elemento.attr('idp');
740                    var ids = elemento.attr('ids');
741                    // Si es Excelente -> comportamiento actual (sin modal)
742                    if (parseInt(idp) === 1) {
743                        enviarCalificacion(idp, ids, null);
744                        return;
745                    }
746// Si NO es Excelente -> abrir modal y pedir observación
747                    _calif_idp = idp;
748                    _calif_ids = ids;
749
750                    $("#txtCalifElegida").html(
751                        "Seleccionaste: <b>" + textoCalificacion(idp) + "</b>. Por favor indica el motivo."
752                    );
753
754                    $("#obsCalif").val("");
755                    $("#errObsCalif").hide();
756                    $("#btnEnviarObsCalif").prop("disabled", true);
757
758                    $("#modalObsCalif").modal({
759                        backdrop: 'static', // no cierra al hacer click fuera
760                        keyboard: false,    // no cierra con ESC
761                        show: true
762                    });
763                });
764            }
765            function contarPalabras(texto) {
766                // Quita espacios al inicio/fin y separa por uno o más espacios
767                var limpio = $.trim(texto);
768                if (!limpio) return 0;
769                return limpio.split(/\s+/).length;
770            }
771            // Validación en vivo (mínimo 5 caracteres)
772            $(document).on("input", "#obsCalif", function () {
773                var txt = $.trim($(this).val());
774                var n = contarPalabras(txt);
775                var ok = n >= 10;
776                $("#btnEnviarObsCalif").prop("disabled", !ok);
777                $("#errObsCalif").toggle(!ok && txt.length > 0);
778            });
779
780            // Click del botón Enviar del modal
781            $(document).on("click", "#btnEnviarObsCalif", function () {
782                var obs = $.trim($("#obsCalif").val());
783                var n = contarPalabras(obs);
784
785                if (n < 10) {
786                    $("#errObsCalif").show();
787                    return;
788                }
789
790                $("#modalObsCalif").modal("hide");
791                enviarCalificacion(_calif_idp, _calif_ids, obs);
792            });
793
794            chequeartickets = function () {
795                $(".icon-attention").hide();
796                $(".calif").hide();
797                $.ajax({
798                    type: "POST",
799                    url: "/api",
800                    data: {'a': 'checkticket', 'csrfmiddlewaretoken': csrftoken},
801                    success: function (data) {
802                        if (data.result === 'ok') {
803                            $("#numero_" + data.id).html(data.numero);
804                            if (data.activo) {
805
806                                if (data.nuevo) {
807                                    $("#mail_" + data.id).show();
808                                }
809                            }
810                            if (data.cerrado) {
811                                $("#cal_" + data.id).show();
812                                conectar_controles_calif();
813                                $("#nueva").hide();
814                                $("#mensaje").show();
815
816                            }
817                        }
818                    },
819                    dataType: "json"
820                });
821            };
822
823            
824                $("#chatwindowsmensaje").hide();
825                $("#chatcalificar").hide();
826                $("#chatwindowssolicitud").show();
827                $("#chatwindowsnumero").hide();
828            
829
830
831
832            
833
834
835
836            sendmensajechat = function () {
837                var mensaje = $("#textchatmensaje").val().trim();
838                if (mensaje.length > 0) {
839                    $.ajax({
840                        type: "POST",
841                        url: "/api",
842                        data: {'a': 'sendmensajeclientsuport', 'mensaje': mensaje, 'csrfmiddlewaretoken': csrftoken},
843                        success: function (data) {
844                            if (data.result === 'ok') {
845                                $("#textchatmensaje").val('');
846                                $("#chatmessajes").append(data.html);
847                                var div = document.getElementById('chatmessajes');
848                                div.scrollTop = div.scrollHeight - div.clientHeight;
849                            }
850                        },
851                        dataType: "json"
852                    });
853                }
854            };
855
856            $("#sendchatmensaje").click(function () {
857                sendmensajechat();
858            });
859
860            $("#cancelarsoporte").click(function () {
861                $.ajax({
862                    type: "POST",
863                    url: "/api",
864                    data: {'a': 'closeticket', 'csrfmiddlewaretoken': csrftoken},
865                    success: function (data) {
866                        if (data.result === 'ok') {
867                            $("#chatwindowsmensaje").hide();
868                            $("#chatwindowssolicitud").show();
869                            $("#chatwindowsnumero").hide();
870                            clearInterval(tikets);
871                        } else {
872                            smoke.alrt(data.mensaje);
873                        }
874                    },
875                    dataType: "json"
876                });
877            });
878            $(function () {
879                conectar_controles_calif();
880            });
881
882
883            chequearsesion = setInterval(chequearsesionfn, 30000);
884
885
886        
887
888        $('.dropdown-toggle').dropdown();
889        $(".collapse").collapse();
890
891        $("#id_email, #id_emailinst, #id_correoinstasoc, #id_correoinst, " +
892            "#id_emailcontactoemergencia, #id_correo, #id_facebook, #i
892d_instagram, #id_youtube, #id_skype, #id_twitter").css({'text-transform': 'none'});
893
894        $(".btn-form").click(function(){
895            bloqueointerface();
896        });
897
898        if (typeof String.prototype.startsWith !== 'function') {
899            String.prototype.startsWith = function (str){
900                return this.indexOf(str) === 0;
901            };
902        }
903
904        if (typeof String.prototype.endsWith !== 'function') {
905            String.prototype.endsWith = function (str){
906                return this.slice(-str.length) === str;
907            };
908        }
909
910        adicionar_lista = function(lista, elemento){
911            lista.push(elemento);
912        };
913
914        remover_lista = function(lista, elemento){
915            for(var i = lista.length - 1; i >= 0; i--) {
916                if(lista[i] === elemento) {
917                    lista.splice(i, 1);
918                }
919            }
920        };
921
922        $('.tooltip').tooltip('hide');
923        $('[data-toggle="tooltip"]').tooltip();
924        $('.lcs_switch').bootstrapToggle();
925
926
927        tooltips = function() {
928            $(".tl").tooltip({placement:"left"});
929            $(".tr").tooltip({placement:"right"});
930            $(".tu").tooltip({placement:"top"});
931            $(".tb").tooltip({placement:"bottom"});
932        };
933        conectar_reportes = function(){
934            var href = $(this).attr('nhref');
935            var tipos = $(this).attr('tipos');
936            if (!tipos){
937                tipos = "pdf, xls, csv, doc";
938            }
939            formato_final = '';
940            if(tipos.contains("pdf")){
941                formato_final = '&rt=pdf';
942                $("#formatopdf").removeAttr("hidden");
943            }else{
944                $("#formatopdf").attr({"hidden":"hidden"});
945            }
946            if(tipos.contains("doc")){
947                formato_final = '&rt=docx';
948                $("#formatodoc").removeAttr("hidden");
949            }else{
950                $("#formatodoc").attr({"hidden":"hidden"});
951            }
952            if(tipos.contains("xls")){
953                formato_final = '&rt=xlsx';
954                $("#formatoxls").removeAttr("hidden");
955            }else{
956                $("#formatoxls").attr({"hidden":"hidden"});
957            }
958            if(tipos.contains("csv")){
959                formato_final = '&rt=csv';
960                $("#formatocsv").removeAttr("hidden");
961            }else{
962                $("#formatocsv").attr({"hidden":"hidden"});
963            }
964            var tipo = $("#formatoreporte_formato").find("option:not([hidden]):eq(0)");
965            $("#formatoreporte_formato").val(tipo.val()).trigger('change');
966            if (tipos.length > 4) {
967                $('#formatoreporte').modal({'width':'400'}).modal('show');
968                $('#formatoreporte_run').attr('nhref', href);
969            }else{
970                ejecutar_reporte_directo(href + formato_final);
971            }
972            
973        };
974
975        $('#formatoreporte_close').click(function(){
976            $('#formatoreporte').modal('hide');
977        });
978
979        openwindow_reporte = function (url, width, height) {
980            newwindow = window.open(url, 'name', 'height='+height+' ,width='+width);
981        };
982
983        openwindow = function(verb, url, data, target) {
984            var form = document.createElement("form");
985            form.action = url;
986            form.method = verb;
987            form.target = target || "_self";
988            if (data) {
989                for (var key in data) {
990                    var input = document.createElement("textarea");
991                    input.name = key;
992                    input.value = typeof data[key] === "object" ? JSON.stringify(data[key]) : data[key];
993                    form.appendChild(input);
994                }
995            }
996            form.style.display = 'none';
997            document.body.appendChild(form);
998            form.submit();
999        };
1000
1001        ejecutar_reporte_directo = function(ruta) {
1002            var href = ruta;
1003            $('#formatoreporte').modal('hide');
1004            var formato = parseInt($('#formatoreporte_formato').val());
1005            var formato_final = '';
1006            if (formato === 0) {
1007                formato_final = '&rt=pdf';
1008            }else if (formato === 1) {
1009                formato_final = '&rt=docx';
1010            }else if (formato === 2){
1011                formato_final = '&rt=xlsx';
1012            }else if (formato === 3){
1013                formato_final = '&rt=csv';
1014            }
1015            bloqueointerface();
1016            var report_url = href + formato_final;
1017            $.ajax({
1018                type: "GET",
1019                url: report_url,
1020                success: function(data) {
1021                    desbloqueointerface();
1022                    if (data.result === 'ok') {
1023                        if(formato === 0 ){
1024                            openwindow_reporte(location.origin + data.reportfile, 800, 500);
1025                        }else{
1026                            location.href = location.origin + data.reportfile;
1027                        }
1028                    } else {
1029                        smoke.alert("Error al generar el reporte.");
1030                    }
1031                },
1032                error: function() {
1033                    desbloqueointerface();
1034                    swal("Error", "Error de conexión.", "error");
1035                },
1036                dataType: "json"
1037            });
1038        };
1039
1040
1041
1042
1043        ejecutar_reporte = function() {
1044            var href = $(this).attr('nhref');
1045            $('#formatoreporte').modal('hide');
1046            var formato = parseInt($('#formatoreporte_formato').val());
1047            var formato_final = '';
1048            if (formato === 0) {
1049                formato_final = '&rt=pdf';
1050            }else if (formato === 1) {
1051                formato_final = '&rt=docx';
1052            }else if (formato === 2){
1053                formato_final = '&rt=xlsx';
1054            }else if (formato === 3){
1055                formato_final = '&rt=csv';
1056            }
1057            bloqueointerface();
1058            var report_url = href + formato_final;
1059            $.ajax({
1060                type: "GET",
1061                url: report_url,
1062                success: function(data) {
1063                    desbloqueointerface();
1064                    if (data.result === 'ok') {
1065                        if(formato === 0 ){
1066                            openwindow_reporte(location.origin + data.reportfile, 800, 500);
1067                        }else{
1068                            location.href = location.origin + data.reportfile;
1069                        }
1070                    } else {
1071                        smoke.alert("Error al generar el reporte.");
1072                    }
1073                },
1074                error: function() {
1075                    desbloqueointerface();
1076                    swal("Error", "Error de conexión.", "error");
1077                },
1078                dataType: "json"
1079            });
1080        };
1081
1082
1083
1084        load_confirmacion = function (href) {
1085            bloqueointerface();
1086            $.ajax({
1087                type: "GET",
1088                url: href,
1089                success: function(data) {
1090                    desbloqueointerface();
1091                    if (data.search('"'+'ajaxconfirmaciondinamicbs'+'"') >= 0){
1092                        var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
1093                        $("#confirmacionmodaldinamico").html(data);
1094                        if (w > 650){
1095                            $('#confirmacionmodaldinamico').modal({'width': '650', 'margin-left': '0'}).modal('show');
1096                        } else {
1097                            $('#confirmacionmodaldinamico').modal({'width': w, 'margin-left': '0'}).modal('show');
1098                        }
1099                    } else {
1100                        swal("Error", data.mensaje, "error");
1101                    }
1102                },
1103                error: function() {
1104                    desbloqueointerface();
1105                    swal("Error", "Error de conexión", "error");
1106                },
1107                dataType: "html"
1108            });
1109        };
1110
1111        conectar_confirmacion = function(){
1112            var href = $(this).attr('nhref');
1113            load_confirmacion(href);
1114        };
1115
1116        verifica_marcado = function () {
1117            if ($(".marcado").length > 0){
1118                $('html, body').animate({scrollTop: $(".marcado").offset().top - 50}, 1000);
1119            }
1120        };
1121
1122
1123
1124
1125        verifica_marcado();
1126
1127
1128
1129        conectar_eliminacion = function(){
1130            var href = $(this).attr('nhref');
1131            var margenleft = 0;
1132
1133            bloqueointerface();
1134            $.ajax({
1135                type: "GET",
1136                url: href,
1137                success: function(data) {
1138                    desbloqueointerface();
1139                    if (data.search('"'+'ajaxdeletedinamicbs'+'"') >= 0){
1140                        $("#eliminacionmodaldinamico").html(data);
1141                        var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
1142                        if (w > 650){
1143                            $('#eliminacionmodaldinamico').modal({'width':'650px', 'margin-left': '0'}).modal('show');
1144                        } else {
1145                            $('#eliminacionmodaldinamico').modal({'width': w+'px', 'margin-left': '0'}).modal('show');
1146                        }
1147
1148                    } else {
1149                        swal("Error", "Error de conexión", "error");
1150                    }
1151                },
1152                error: function() {
1153                    desbloqueointerface();
1154                    swal("Error", "Error de conexión", "error");
1155                },
1156                dataType: "html"
1157            });
1158        };
1159
1160        conectar_formulario = function(){
1161            var control = $(this);
1162            var widthform = 850;
1163            var margenleft = 0;
1164            var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
1165            var href = control.attr('nhref');
1166            if (href.contains('?')) {
1167                href += '&screenwidth=' + w;
1168            } else {
1169                href += '?screenwidth=' + w;
1170            }
1171            bloqueointerface();
1172            $.ajax({
1173                type: "GET",
1174                url: href,
1175                success: function(data) {
1176                    desbloqueointerface();
1177                    if ($('#formbs').length > 0) {
1178                        $('#formbs').modal('hide');
1179                    }
1180                    if (data.search('"'+'ajaxformdinamicbs'+'"') >= 0){
1181                        var modalwidth = parseInt($(data).filter("#ajaxformdinamicbs").attr('nwidth'));
1182                        if (modalwidth > w){
1183                            modalwidth = w;
1184                            margenleft = 0;
1185
1186                        }else {
1187                            margenleft = parseInt((w - modalwidth) / 2);
1188                        }
1189                        $('#formulariomodaldinamico').modal({keyboard: false,  backdrop: 'static' });
1190
1191                        $("#formulariomodaldinamico").html(data);
1192                        $(".modal-scrollable").css({'width': (modalwidth) + 'px', 'margin-left': margenleft + 'px', 'overflow-y': 'auto', 'overflow-x': 'hidden'});
1193                        $('#formulariomodaldinamico').modal('show');
1194                        $(".select2-search__field").css({'text-transform': 'uppercase'});
1195                    } else {
1196                        data = JSON.parse(data);
1197                        if ('mensaje' in data) {
1198                            swal("Error", data.mensaje, "error");
1199                        } else {
1200                            swal("Error", "Error de conexión.", "error");
1201                        }
1202
1203                    }
1204                },
1205                error: function() {
1206                    desbloqueointerface();
1207                    swal("Error", "Error de conexión.", "error");
1208                },
1209                dataType: "html"
1210            });
1211        };
1212
1213        conectar_mensaje = function(){
1214            var href = $(this).attr('nhref');
1215            bloqueointerface();
1216            $.ajax({
1217                type: "GET",
1218                url: '/api',
1219                data: {'a': 'mensaje', 'ids': href, 'csrfmiddlewaretoken': csrftoken},
1220                success: function(data) {
1221                    desbloqueointerface();
1222                    if (data.search('"'+'ajaxmensajedinamicbs'+'"') >= 0){
1223                        $("#mensajemodaldinamico").html(data);
1224                        $('#mensajemodaldinamico').modal('show');
1225                    } else {
1226                        mensajes("Error de conexión.", "Error");
1227                    }
1228                },
1229                error: function() {
1230                    desbloqueointerface();
1231                    mensajes("Error de conexión.", "Error");
1232                },
1233                dataType: "html"
1234            });
1235        };
1236
1237        $("#formmodal_mensaje_cancel").click(function(){
1238            $('#mensajemodaldinamico').modal('hide');
1239        });
1240
1241        
1242
1243
1244        
1245
1246        $('.reportedirecto').bind('click.conectar_reportes', conectar_reportes);
1247        $('.confirmacionmodal').bind('click.conectar_confirmacion', conectar_confirmacion);
1248        $('.eliminacionmodal').bind('click.conectar_eliminacion', conectar_eliminacion);
1249        $('.formmodal').bind('click.conectar_formulario', conectar_formulario);
1250        $('.mensajecorreomodal').bind('click.conectar_mensajes', conectar_mensaje);
1251        $("#formatoreporte_run").bind("click.ejecutar_reporte", ejecutar_reporte);
1252
1253        conectar_reportes_interface = function(){
1254            $('.reportedirecto').unbind('click.conectar_reportes');
1255            $('.reportedirecto').bind('click.conectar_reportes', conectar_reportes);
1256        };
1257
1258
1259        $("#search_close").click(function (){
1260            $('#formsearch').modal('hide');
1261        });
1262
1263        $(".mensajes").click(function(){
1264            var elemento = $(this);
1265            var id = elemento.attr('idl')
1266            var path = elemento.attr('path')
1267            var action = elemento.attr('action')
1268
1269            $('#item-body-obj').html('');
1270
1271            $.ajax({
1272                type: "POST",
1273                url: path,
1274                data: {'action': action, 'id': id, 'csrfmiddlewaretoken': 'wV4EPKfMJTtIHQH2FdEIB1iiByXlwyW3IE5FIW8Vk5E45Zm2hBlhdL1IYQW06vt8'},
1275                success: function(data) {
1276                    if (data.result === 'ok') {
1277                        desbloqueointerface();
1278                        $('#item-body-obj').html(data.html);
1279                        $('#formsearch').modal('show');
1280                    } else {
1281                        desbloqueointerface();
1282                        swal("Error", data.mensaje, "error");
1283                        $('#item-body-obj').html('');
1284                    }
1285                },
1286                error: function() {
1287                    desbloqueointerface();
1288                    swal("Error", "Error de conexión.", "error");
1289                    $('#item-body-obj').html('');
1290                },
1291                dataType: "json",
1292            });
1293
1294        });
1295
1296
1297
1298
1299        
1300        $(".changeperfil").click(function (){
1301            var elemento = $(this);
1302            var id = elemento.attr('idp');
1303            bloqueointerface();
1304            $.ajax({
1305                type: "POST",
1306                url: "/api",
1307                data: {'a': 'changeperfil', 'id': id, 'csrfmiddlewaretoken': csrftoken},
1308                success: function(data) {
1309                    if (data.result === 'ok') {
1310                        location.href = "/panel";
1311                    }
1312                },
1313                dataType: "json"
1314            });
1315        });
1316
1317        $(".changecargo").click(function (){
1318            var elemento = $(this);
1319            var id = elemento.attr('idp');
1320            bloqueointerface();
1321            $.ajax({
1322                type: "POST",
1323                url: "/api",
1324                data: {'a': 'changecargo', 'id': id, 'csrfmiddlewaretoken': csrftoken},
1325                success: function(data) {
1326                    if (data.result === 'ok') {
1327                        location.href = "/panel";
1328                    }
1329                },
1330                dataType: "json"
1331            });
1332        });
1333
1334
1335
1336        
1337
1338        history.pushState(null, null, location.href);
1339   
1339     window.addEventListener('popstate', function(event) {
1340            history.pushState(null, null, location.href);
1341        });
1342
1343        actualizarnumerico = function(){
1344            $('.imp-number[decimales], .imp-moneda[decimales], .imp-numbersmall[decimales], .imp-numbermed-right[decimales], .imp-numbermed-center[decimales], .nota[decimales]').each(function(){
1345                numerico($(this), 0, 0, $(this).attr('decimales'));
1346            });
1347            $(".select2-container--default").css({'width': '100%'});
1348            $(".select2-container--above").css({'width': '100%'});
1349            $(".select2-search__field").css({'text-transform': 'uppercase'});
1350        };
1351
1352        foconumerico = function () {
1353            $('.imp-number, .imp-moneda, .imp-numbersmall, .imp-numbermed-right, .imp-numbermed-center, .nota').focus(function(){
1354                if (!parseFloat($(this).val())){
1355                    $(this).val("");
1356                }
1357            });
1358        };
1359
1360        $(document).ready(function(){
1361            actualizarnumerico();
1362            foconumerico();
1363
1364            multiselect_validation = function () {
1365                $(".custom-multiselect").find('input').unbind();
1366                $(".custom-multiselect").find('input').bind("click", function () {
1367                    cantidad = $('input:checked[name='+$(this).attr('name')+']').length;
1368                    $("#id_"+$(this).attr('name')+"_control").val((cantidad?"1":"")).attr({'value':(cantidad?"1":"")});
1369                });
1370                $(".inputmultiselect").each(function () {
1371                    var cantidad = $('input:checked[name='+$(this).attr('basename')+']').length;
1372                    $(this).val((cantidad?"1":"")).attr({'value':(cantidad?"1":"")});
1373                });
1374            };
1375            $(".select2-container--default").css({'width': '400px'});
1376            multiselect_validation();
1377
1378
1379            
1380
1381            labeltimer = setInterval(ajustar_ancho_label, 700);
1382
1383        });
1384
1385        $('.selectorfecha').keypress(function(){
1386            return false;
1387        });
1388
1389        redondear = function (valor, lugares) {
1390            return parseFloat(Big(valor).toFixed(lugares));
1391        };
1392
1393        logoutajax =  function () {
1394            $.ajax({
1395                type: "POST",
1396                url: "/logout",
1397                data: {'csrfmiddlewaretoken': csrftoken},
1398                success: function(data) {
1399                    if (data.result === 'ok') {
1400                        localStorage.removeItem('sessionid');
1401                        sessionid = null;
1402                        window.name = '';
1403                        location.href = "/";
1404                        sysend.broadcast('sga', {message: 'exit'});
1405                    } else {
1406                        sleep(5000);
1407                        logoutajax()
1408                    }
1409                },
1410                error: function() {
1411                    sleep(5000);
1412                    logoutajax();
1413                },
1414                dataType: "json"
1415            });
1416        };
1417
1418        logoutcomplet = function () {
1419            bloqueointerface();
1420            logoutajax();
1421        };
1422
1423        logoutsimple = function () {
1424            bloqueointerface();
1425            localStorage.removeItem('sessionid');
1426            sessionid = null;
1427            window.name = '';
1428            location.href = "/";
1429        };
1430
1431        logout = function(){
1432            if (window.name && sessionid && window.name === sessionid) {
1433                logoutcomplet();
1434            }
1435        };
1436
1437
1438
1439
1440
1441
1442        sysend.on('sga', function(obj) {
1443            if (obj.message === 'check'){
1444                if (window.name && sessionid && window.name === sessionid) {
1445                    sysend.broadcast('sga', {message: 'set', token: window.name});
1446                }
1447            }
1448            if (obj.message === 'exit'){
1449                bloqueointerface();
1450                localStorage.removeItem('sessionid');
1451                sessionid = null;
1452                window.name = '';
1453                location.href = '/';
1454            }
1455            if (obj.message === 'reload'){
1456                bloqueointerface();
1457                window.name = obj.token;
1458                localStorage.setItem('sessionid', obj.token);
1459                location.href = '/';
1460            }
1461            if (obj.message === 'refresh'){
1462                location.href = location.pathname;
1463            }
1464            if (obj.message === 'set'){
1465                clearInterval(logouttimer);
1466                if (window.name === '') {
1467                    desbloqueointerface();
1468                    window.name = obj.token;
1469                    localStorage.setItem('sessionid', obj.token);
1470                    sessionid = obj.token;
1471                }
1472            }
1473            if (obj.message === 'inicio'){
1474                loginfow(obj.token);
1475            }
1476        });
1477
1478        try {
1479            sessionid = localStorage.getItem('sessionid');
1480        } catch (err) {
1481            console.log(err.message);
1482        }
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503    });
1504
1505
1506
1507    rezisewindows = function () {
1508        var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
1509        
1510            if (w < 500) {
1511                $("#logincontainerelement").css({'width': '100%'});
1512                $(".desktop").hide();
1513            } else {
1514                $("#logincontainerelement").css({'width': '400px'});
1515                $(".desktop").show();
1516            }
1517        
1518    };
1519
1520
1521    window.onresize = function(event) {
1522        rezisewindows();
1523    };
1524
1525
1526
1527
1528    rezisewindows();
1529
1530
1531    var timeout;
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541</script>
1541
1542
1543    <link rel="stylesheet" href="/static/css/owl.carousel.css">
1544    <link rel="stylesheet" href="/static/css/owl.theme.css">
1545    <link rel="stylesheet" href="/static/css/owl.transitions.css">
1546    <link rel="stylesheet" href="/static/css/loginstyle.css">
1547    
1548
1549    <style type="text/css">
1550        .auth.auth-img-bg .auth-form-transparent    { width:55%; }
1551
1552        @media screen and (max-width: 500px) {
1553            .auth.auth-img-bg .auth-form-transparent    { width: 100%; }
1554        }
1555
1556        {
1557            box-sizing: border-box;
1558        }
1559        .text-left {
1560            text-align: left !important;
1561        }
1562        .input-group {
1563            position: relative;
1564            display: flex;
1565            flex-wrap: wrap;
1566            align-items: stretch;
1567            width: 100%;
1568        }
1569        .input-group-prepend, .input-group-append {
1570  display: flex;
1571}
1572.input-group-prepend {
1573  margin-right: -1px;
1574}
1575.bg-transparent {
1576  background-color: transparent !important;
1577}
1578.input-group-append, .input-group-prepend {
1579  color: #c9c8c8;
1580  width: auto;
1581  border: none;
1582}
1583        .input-group:not(.has-validation) > .dropdown-toggle:nth-last-child(n+3), .input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) {
1584            border-top-right-radius: 0;
1585            border-bottom-right-radius: 0;
1586        }
1587        .input-group-prepend, .input-group-append {
1588            display: flex;
1589        }
1590        .input-group-prepend {
1591            margin-right: -1px;
1592        }
1593        .input-group-text {
1594            display: flex;
1595            align-items: center;
1596            padding: .375rem .75rem;
1597            font-size: 1rem;
1598            font-weight: 400;
1599            line-height: 1.5;
1600            color: #212529;
1601            text-align: center;
1602            white-space: nowrap;
1603            background-color: #e9ecef;
1604            border: 1px solid #ced4da !important;
1605            border-right: 1px solid #ced4da !important;
1606            border-radius: .25rem;
1607        }
1608        .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
1609            margin-left: -1px;
1610            border-top-left-radius: 0;
1611            border-bottom-left-radius: 0;
1612        }
1613        .input-group > .form-control, .input-group > .form-select {
1614            position: relative;
1615            flex: 1 1 auto;
1616            width: 1%;
1617            min-width: 0;
1618        }
1619        .text-primary {
1620            color: #007bff !important;
1621        }
1622        .form-control {
1623            display: block;
1624            width: 100%;
1625            padding: .375rem .75rem;
1626            font-size: 0.8rem;
1627            font-weight: 400;
1628            line-height: 1.5;
1629            color: #212529;
1630            background-color: #fff;
1631            background-clip: padding-box;
1632            border: 1px solid #ced4da;
1633            -webkit-appearance: none;
1634            -moz-appearance: none;
1635            appearance: none;
1636            border-radius: .25rem;
1637            border-top-left-radius: 0.25rem;
1638            border-bottom-left-radius: 0.25rem;
1639            transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
1640        }
1641        button, input, optgroup, select, textarea {
1642            margin: 0;
1643            margin-left: 0px;
1644            font-family: inherit;
1645            font-size: inherit;
1646            line-height: inherit;
1647        }
1648    </style>
1649    
1649<script type="text/javascript">
1650        var options = {
1651            enableHighAccuracy: true,
1652            timeout: 6000,
1653            maximumAge: 0
1654        };
1655
1656
1657    </script>
1657
1658    
1658<script>
1659
1660        var loginsend = false;
1661
1662
1663
1664        $(document).ready(function() {
1665
1666            $(".fancybox").attr('rel', 'gallery').fancybox({padding : 0, autoScale: true, transitionIn: 'fade', transitionOut: 'fade'});
1667            $("#noticiagrafica").fancybox().trigger('click');
1668
1669        });
1670
1671        $(function() {
1672            var csrftoken = jQuery("[name=csrfmiddlewaretoken]").val();
1673            $("#recuperarform").hide();
1674            $("#user").focus();
1675
1676            clienteinfo = function(window) {
1677                {
1678                    var unknown = '-';
1679
1680                    // screen
1681                    var screenSize = '';
1682                    if (screen.width) {
1683                        width = (screen.width) ? screen.width : '';
1684                        height = (screen.height) ? screen.height : '';
1685                        screenSize += '' + width + " x " + height;
1686                    }
1687
1688                    // browser
1689                    var nVer = navigator.appVersion;
1690                    var nAgt = navigator.userAgent;
1691                    var browser = navigator.appName;
1692                    var version = '' + parseFloat(navigator.appVersion);
1693                    var majorversion = parseInt(navigator.appVersion, 10);
1694                    var nameOffset, verOffset, ix;
1695
1696                    // Opera
1697                    if ((verOffset = nAgt.indexOf('Opera')) !== -1) {
1698                        browser = 'Opera';
1699                        version = nAgt.substring(verOffset + 6);
1700                        if ((verOffset = nAgt.indexOf('Version')) !== -1) {
1701                            version = nAgt.substring(verOffset + 8);
1702                        }
1703                    }
1704                    // Opera Next
1705                    if ((verOffset = nAgt.indexOf('OPR')) !== -1) {
1706                        browser = 'Opera';
1707                        version = nAgt.substring(verOffset + 4);
1708                    }
1709                    // MSIE
1710                    else if ((verOffset = nAgt.indexOf('MSIE')) !== -1) {
1711                        browser = 'Microsoft Internet Explorer';
1712                        version = nAgt.substring(verOffset + 5);
1713                    }
1714                    // Chrome
1715                    else if ((verOffset = nAgt.indexOf('Chrome')) !== -1) {
1716                        browser = 'Chrome';
1717                        version = nAgt.substring(verOffset + 7);
1718                    }
1719                    // Safari
1720                    else if ((verOffset = nAgt.indexOf('Safari')) !== -1) {
1721                        browser = 'Safari';
1722                        version = nAgt.substring(verOffset + 7);
1723                        if ((verOffset = nAgt.indexOf('Version')) !== -1) {
1724                            version = nAgt.substring(verOffset + 8);
1725                        }
1726                    }
1727                    // Firefox
1728                    else if ((verOffset = nAgt.indexOf('Firefox')) !== -1) {
1729                        browser = 'Firefox';
1730                        version = nAgt.substring(verOffset + 8);
1731                    }
1732                    // MSIE 11+
1733                    else if (nAgt.indexOf('Trident/') !== -1) {
1734                        browser = 'Microsoft Internet Explorer';
1735                        version = nAgt.substring(nAgt.indexOf('rv:') + 3);
1736                    }
1737                    // Other browsers
1738                    else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
1739                        browser = nAgt.substring(nameOffset, verOffset);
1740                        version = nAgt.substring(verOffset + 1);
1741                        if (browser.toLowerCase()  === browser.toUpperCase()) {
1742                            browser = navigator.appName;
1743                        }
1744                    }
1745                    // trim the version string
1746                    if ((ix = version.indexOf(';')) !== -1) version = version.substring(0, ix);
1747                    if ((ix = version.indexOf(' ')) !== -1) version = version.substring(0, ix);
1748                    if ((ix = version.indexOf(')')) !== -1) version = version.substring(0, ix);
1749
1750                    majorversion = parseInt('' + version, 10);
1751                    if (isNaN(majorversion)) {
1752                        version = '' + parseFloat(navigator.appVersion);
1753                        majorversion = parseInt(navigator.appVersion, 10);
1754                    }
1755
1756                    // mobile version
1757                    var mobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(nVer);
1758
1759                    // cookie
1760                    var cookieEnabled = (navigator.cookieEnabled);
1761
1762                    if (typeof navigator.cookieEnabled  === 'undefined' && !cookieEnabled) {
1763                        document.cookie = 'testcookie';
1764                        cookieEnabled = (document.cookie.indexOf('testcookie') !== -1);
1765                    }
1766
1767                    // system
1768                    var os = unknown;
1769                    var clientStrings = [
1770                        {s:'Windows 10', r:/(Windows 10.0|Windows NT 10.0)/},
1771                        {s:'Windows 8.1', r:/(Windows 8.1|Windows NT 6.3)/},
1772                        {s:'Windows 8', r:/(Windows 8|Windows NT 6.2)/},
1773                        {s:'Windows 7', r:/(Windows 7|Windows NT 6.1)/},
1774                        {s:'Windows Vista', r:/Windows NT 6.0/},
1775                        {s:'Windows Server 2003', r:/Windows NT 5.2/},
1776                        {s:'Windows XP', r:/(Windows NT 5.1|Windows XP)/},
1777                        {s:'Windows 2000', r:/(Windows NT 5.0|Windows 2000)/},
1778                        {s:'Windows ME', r:/(Win 9x 4.90|Windows ME)/},
1779                        {s:'Windows 98', r:/(Windows 98|Win98)/},
1780                        {s:'Windows 95', r:/(Windows 95|Win95|Windows_95)/},
1781                        {s:'Windows NT 4.0', r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},
1782                        {s:'Windows CE', r:/Windows CE/},
1783                        {s:'Windows 3.11', r:/Win16/},
1784                        {s:'Android', r:/Android/},
1785                        {s:'Open BSD', r:/OpenBSD/},
1786                        {s:'Sun OS', r:/SunOS/},
1787                        {s:'Linux', r:/(Linux|X11)/},
1788                        {s:'iOS', r:/(iPhone|iPad|iPod)/},
1789                        {s:'Mac OS X', r:/Mac OS X/},
1790                        {s:'Mac OS', r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},
1791                        {s:'QNX', r:/QNX/},
1792                        {s:'UNIX', r:/UNIX/},
1793                        {s:'BeOS', r:/BeOS/},
1794                        {s:'OS/2', r:/OS\/2/},
1795                        {s:'Search Bot', r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}
1796                    ];
1797                    for (var id in clientStrings) {
1798                        var cs = clientStrings[id];
1799                        if (cs.r.test(nAgt)) {
1800                            os = cs.s;
1801                            break;
1802                        }
1803                    }
1804
1805                    var osVersion = unknown;
1806
1807                    if (/Windows/.test(os)) {
1808                        osVersion = /Windows (.*)/.exec(os)[1];
1809                        os = 'Windows';
1810                    }
1811
1812                    switch (os) {
1813                        case 'Mac OS X':
1814                            osVersion = /Mac OS X (10[\.\_\d]+)/.exec(nAgt)[1];
1815                            break;
1816
1817                        case 'Android':
1818                            osVersion = /Android ([\.\_\d]+)/.exec(nAgt)[1];
1819                            break;
1820
1821                        case 'iOS':
1822                            osVersion = /OS (\d+)_(\d+)_?(\d+)?/.exec(nVer);
1823                            osVersion = osVersion[1] + '.' + osVersion[2] + '.' + (osVersion[3] | 0);
1824                            break;
1825                    }
1826
1827                    // flash (you'll need to include swfobject)
1828                    /* script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" */
1829                    var flashVersion = 'no check';
1830                    if (typeof swfobject !== 'undefined') {
1831                        var fv = swfobject.getFlashPlayerVersion();
1832                        if (fv.major > 0) {
1833                            flashVersion = fv.major + '.' + fv.minor + ' r' + fv.release;
1834                        }
1835                        else  {
1836                            flashVersion = unknown;
1837                        }
1838                    }
1839                }
1840
1841                window.jscd = {
1842                    screen: screenSize,
1843                    browser: browser,
1844                    browserVersion: version,
1845                    browsermajorversion: majorversion,
1846                    mobile: mobile,
1847                    os: os,
1848                    osVersion: osVersion,
1849                    cookies: cookieEnabled,
1850                    flashVersion: flashVersion
1851                };
1852            };
1853
1854            clienteinfo(window);
1855
1856            var navegador = jscd.browser +' '+ jscd.browsermajorversion;
1857            var os =  jscd.os +' '+ jscd.osVersion;
1858            var cookies = jscd.cookies;
1859            var screensize = jscd.screen;
1860
1861            $("#user").blur(function(){
1862                $(this).val($(this).val().trim());
1863            });
1864
1865            $("#pass, #user").keydown(function(){
1866                $("#errormensaje").hide();
1867            });
1868
1869
1870            $("#login").click(function(){
1871                login();
1872            });
1873
1874            $("#recuperar").click(function(){
1875                $("#ingresarb").show();
1876                $("#loginform").hide();
1877                $("#tabla").hide();
1878                $('#datos').val('');
1879                $("#recuperarform").show();
1880                $("#recuperarform").attr('style','background-color: rgb(255 255 255 / 70%);transition:all .4s linear');
1881            });
1882
1883            $("#ingresar").click(function(){
1884                $('#user').val($('#datousuario').html());
1885                $("#recuperarform").hide();
1886                $("#loginform").show();
1887            });
1888            $("#ingresarb").click(function(){
1889                $('#user').val($('').html());
1890                $("#recuperarform").hide();
1891                $("#loginform").show();
1892            });
1893
1894            buscar = function(){
1895                var busqueda = $("#datos").val();
1896                $("#errorb").hide();
1897                if (busqueda.trim().length > 0) {
1898                    bloqueointerface();
1899                    $.ajax({
1900                        type: "POST",
1901                        url: "/datos",
1902                        data: {"action": "busqueda", "busqueda": busqueda, 'csrfmiddlewaretoken': 'wV4EPKfMJTtIHQH2FdEIB1iiByXlwyW3IE5FIW8Vk5E45Zm2hBlhdL1IYQW06vt8'},
1903                        success: function (data) {
1904                            desbloqueointerface();
1905                            if (data.result  === "ok") {
1906                                $("#ingresarb").hide();
1907                                $("#tabla").show();
1908                                $("#tablacontenido").html("<tr>" +
1909                                    "<td style='width: 70px' id='datousuario'>" +
1910                                    "" + data.user + "</td><td style='width: 300px'>" + data.nombre + "" +
1911                                    "</td></tr>");
1912                            } else {
1913                                $("#ingresarb").show();
1914                                $("#tabla").hide();
1915                                $("#errorb").html('No existen datos para esta consulta').show();
1916                            }
1917                        },
1918                        error: function(){
1919                            desbloqueointerface();
1920                            $("#tabla").hide();
1921                            $("#errorb").html('No se pudo realizar la consulta').show();
1922                        },
1923                        dataType:"json"
1924                    });
1925                } else {
1926                    $("#datos").focus();
1927                }
1928            };
1929
1930            $("#busqueda").click(function(){
1931                buscar();
1932            });
1933
1934            $("#cambioclave").click(function(){
1935                var usuario = $("#datousuario").html();
1936                $("#errorb, #success").hide();
1937                if (usuario.trim().length > 0) {
1938                    bloqueointerface();
1939                    $.ajax({
1940                        type: "POST",
1941                        url: "/datos",
1942                        data: {"action": "generarnuevaclave", "usuario": usuario, 'csrfmiddlewaretoken': 'wV4EPKfMJTtIHQH2FdEIB1iiByXlwyW3IE5FIW8Vk5E45Zm2hBlhdL1IYQW06vt8'},
1943                        success: function (data) {
1944                            desbloqueointerface();
1945                            if (data.result  === "ok") {
1946                                swal("Cambio de Clave", "Revise su email para completar la solicitud.", "warning");
1947                                $("#success").html('Revise su email para completar la solicitud.').show();
1948                                $("#tabla").hide();
1949                            } else {
1950                                $("#errorb").html(data.mensaje).show();
1951                            }
1952                        },
1953                        error: function(){
1954                            desbloqueointerface();
1955                            swal("Error", "Error de conexión.", "error");
1956                        },
1957                        dataType:"json"
1958                    });
1959                } else {
1960                    $("#datos").focus();
1961                }
1962            });
1963
1964            login = function(){
1965                if (!loginsend){
1966                    var usuario = $("#user").val();
1967                    var clave = $("#pass").val();
1968                    if (usuario.length  === 0){
1969                        $("#user").focus();
1970                    } else if (clave.length  === 0){
1971                        $("#pass").focus();
1972                    } else {
1973                        $("#login").attr({"disabled": "disabled"});
1974                        loginsend = true;
1975                        $.ajax({
1976                            type: "POST",
1977                            url: "/login",
1978                            data: {'action': 'login', 'navegador': navegador, 'os': os, 'screensize': screensize, 'user': usuario, 'pass': clave, 'csrfmiddlewaretoken': 'wV4EPKfMJTtIHQH2FdEIB1iiByXlwyW3IE5FIW8Vk5E45Zm2hBlhdL1IYQW06vt8' },
1979                            success: function(data) {
1980                                if (data.result === 'ok') {
1981                                    localStorage.clear();
1982                                    localStorage.setItem('sessionid', data.sessionid);
1983                                    window.name = data.sessionid;
1984                                    chequearsesionid = true;
1985
1986                                    sysend.broadcast('sga', {message: 'inicio', token: data.sessionid});
1987                                    let ret = "/"
1988                                    let searchUrl = location.search;
1989                                    let arrSearchUrl = searchUrl.split("next=");
1990                                    if(arrSearchUrl.length > 1){
1991                                        ret = decodeURIComponent(arrSearchUrl[1].split("&")[0]);
1992                                    }
1993                                    location.href = ret.length > 0?ret:"/";
1994                                } else {
1995                                    loginsend = false;
1996                                    $("#login").removeAttr('disabled');
1997                                    $("#errormensaje").html(data.mensaje).show();
1998                                }
1999                            },
2000                            error: function() {
2001                                loginsend = false;
2002                                $("#login").removeAttr('disabled');
2003                                $("#errormensaje").html(data.mensaje).show();
2004                            },
2005                            dataType: "json"
2006                        });
2007
2008                    }
2009                }
2010            };
2011
2012            $('#user, #pass').keyup(function(e) {
2013                if(e.keyCode  === 13) {
2014                    login();
2015                }
2016            });
2017
2018            $('#datos').keyup(function(e) {
2019                if(e.keyCode  === 13) {
2020                    buscar();
2021                }
2022            });
2023
2024            $(".fancybox").eq(0).trigger('click');
2025
2026        });
2027    </script>
2027
2028
2029
2030</body>
2031</html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.