datos_docente.jsp 59.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="validar.jsp" %>
<!DOCTYPE html>
<html lang="es">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>:::SISTEMA DE HORARIOS:::</title>

		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
                
                
                
		<link rel="stylesheet" href="../assets/css/bootstrap.css" />
		<link rel="stylesheet" href="../assets/css/font-awesome.css" />
                <link rel="stylesheet" href="../assets/css/jquery-ui.css" />
		<link rel="stylesheet" href="../assets/css/ace-fonts.css" />
		<link rel="stylesheet" href="../assets/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />
		<script src="../assets/js/ace-extra.js"></script>
                
                
        
		<!-- inline scripts related to this page -->
		<script type="text/javascript" language="javascript">
                    
			/*$(document).ready( function() {
                jQuery("#registroEncuesta").validationEngine();
            });*/
		</script>
	</head>

	<body class="no-skin" onLoad="cargar();">
		<!-- #section:basics/navbar.layout -->
		<div id="navbar" class="navbar navbar-default">
			<script type="text/javascript">
				try{ace.settings.check('navbar' , 'fixed')}catch(e){}
			</script>

			<div class="navbar-container" id="navbar-container">
            <%@ include file="banner.jsp" %>
			</div><!-- /.navbar-container -->
43
			<p id="lblUsuario" style="display: none;"><%=usuario!=null?usuario.getCodigoTipoUsuario():""%></p>
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533
		</div>

		<!-- /section:basics/navbar.layout -->
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<!-- #section:basics/sidebar -->
			<div id="sidebar" class="sidebar                  responsive">
				<script type="text/javascript">
					try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
				</script>
                                <input id="codModulo" type="hidden" value="<%=menu!=null?menu.getCodModulo():""%>">
                                <input id="codCategoria" type="hidden" value="<%=menu!=null?menu.getCodCategoria():""%>">
                                <%@ include file="menu.jsp" %>
				<!-- #section:basics/sidebar.layout.minimize -->
				<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
					<i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
				</div>
				<!-- /section:basics/sidebar.layout.minimize -->
				<script type="text/javascript">
					try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
				</script>
			</div>

			<!-- /section:basics/sidebar -->
			<div class="main-content">
				<div class="main-content-inner">
					<!-- #section:basics/content.breadcrumbs -->
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="ace-icon fa fa-home home-icon"></i>
								<a href="principal.jsp">INICIO</a>
							</li>
							<li class="active">DOCENTE</li>
						</ul><!-- /.breadcrumb -->
					</div>

					<!-- /section:basics/content.breadcrumbs -->
					<div class="page-content">
						
						<div class="page-header">
							<h1>
								Docente
								<small>
									<i class="ace-icon fa fa-angle-double-right"></i>
									Datos Personales
								</small>
							</h1>
						</div><!-- /.page-header -->

						<div class="row">
							
                                                    
                                                    
                                                    
                                                    
                                                    <!-- ----------- CONTENEDOR DE FORMULARIOS--------INI----- -->
                                                    <div class="col-sm-12" style="width:100%;">
                                                        
                                                        <div  class="col-sm-4"></div>
                                                        <div  class="col-sm-4">
                                                            <div class="widget-box widget-color-blue">
                                                                <div class="widget-header">
                                                                    <h4 class="widget-title">Búsqueda de Docentes</h4>
                                                                </div>

                                                                <div class="widget-body">
                                                                    <div class="widget-main no-padding">
                                                                        <form id="registroEncuesta"  method="post">
                                                                            <fieldset>
                                                                                <label>Ingrese Apellidos del Docente <span style='color:red;'>*</span></label>
                                                                                <div>
                                                                                    <input type="text" id="txt_bus_doc" size="80" class='form-control validate[required ,custom[onlyLetterSp]]'  onChange="conMayusculas(this);" onkeypress="enter(event);" > 
                                                                                </div>
                                                                            </fieldset>
                                                                            <div class="form-actions center">
                                                                                <button  class="btn btn-sm btn-info" type="button" onclick="validar_busqueda();">
                                                                                    <i class="ace-icon fa fa-search icon-on-right bigger-110"></i>
                                                                                    Buscar
                                                                                </button>
                                                                            </div>
                                                                        </form>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div  class="col-sm-4"></div>
                                                        
                                                    </div>
                                                    <div class="col-sm-12" style="width:100%; height: 40px;"></div>
                                                    <div  class="col-sm-12" style="width:100%;">
                                                        <div  class="col-sm-1" ></div>
                                                        <div  class="col-sm-10">
                                                            <!-- -------------TABLA---INI------------ -->
                                                            <div style='display: none;' id='divListadoDoc'>
                                                                
                                                            </div>
                                                            <!-- -------------TABLA---FIN------------ -->
                                                        </div>
                                                        <div  class="col-sm-1"></div>
                                                    </div>
                                                    <!-- ----------- CONTENEDOR DE FORMULARIOS--------FIN----- -->
                                                    
                                                    
                                                    
                                                   
                                                    <!-- ::::::::::-ALERTAS-::::::::::::::: -->
                                                    <input type="hidden" id="ape">
                                                    <input id='pagina' type='hidden'>
                                                    
                                                    <div id="dialog-noti1" class="hide">
                                                        <br>
                                                        Se actualizó con éxito.
                                                        <br><br>
                                                    </div>
                                                    
                                                    <div id="dialog-noti2" class="hide">
                                                        <br>
                                                        Se registró con éxito.
                                                        <br><br>
                                                    </div>
                                                    
                                                    <div id="dialog-confor1" class="hide">
                                                        <br>
                                                        ¿Está seguro de modificar el registro? 
                                                        <br><br>
                                                    </div>
                                                    
                                                    <div id="dialog-confor2" class="hide">
                                                        <br>
                                                        ¿Está seguro de registrar los nuevos datos? 
                                                        <br><br>
                                                    </div>
                                                    
                                                    
                                                    <div id="dialog-advertencia1" class="hide">
                                                        <br>
                                                        Ya existen datos.
                                                        <br><br>
                                                    </div>
                                                    
                                                    
                                                    <div id="dialog-Alerta2" class="hide">
                                                        <br>
                                                        Ocurrió un error en el registro.
                                                        <br><br>
                                                    </div>
                                                    
                                                    <div id="dialog-edit" class="hide">
                                                        <br>
                                                            <form id="RegistroDatos"  method="post">
                                                                <div class="sttxt2" id="divRegistroDatos"></div>
                                                            </form>
                                                        <br><br>
                                                    </div>
                                                    
                                                    <div id="dialog-cargando" class="hide">
                                                        <table cellpadding="0" cellspacing="0" width="100%">
                                                            <tr><td align="center"><img src="imagenes/cargando.gif" border=0></td></tr>
                                                        </table>
                                                    </div>
                                                    
                                                    
                                                    
                                                    <!-- ::::::::::-ALERTAS-::::::::::::::: -->
                                                    
                                                    
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->

			<div class="footer">
				<%@ include file="footer.jsp" %>
			</div>

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script type="text/javascript">
			window.jQuery || document.write("<script src='../assets/js/jquery.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='../assets/js/jquery1x.js'>"+"<"+"/script>");
</script>
<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='../assets/js/jquery.mobile.custom.js'>"+"<"+"/script>");
		</script>
		<script src="../assets/js/bootstrap.js"></script>

		<!-- page specific plugin scripts -->
                <script src="../assets/js/jquery-ui.js"></script>
		<script src="../assets/js/jquery.ui.touch-punch.js"></script>

		<!--[if lte IE 8]>
		  <script src="../assets/js/excanvas.js"></script>
		<![endif]-->
		<script src="../assets/js/jquery-ui.custom.js"></script>
		<script src="../assets/js/jquery.ui.touch-punch.js"></script>
		<script src="../assets/js/jquery.easypiechart.js"></script>
		<script src="../assets/js/jquery.sparkline.js"></script>
		<script src="../assets/js/flot/jquery.flot.js"></script>
		<script src="../assets/js/flot/jquery.flot.pie.js"></script>
		<script src="../assets/js/flot/jquery.flot.resize.js"></script>

		<!-- ace scripts -->
		<script src="../assets/js/ace/elements.scroller.js"></script>
		<script src="../assets/js/ace/elements.colorpicker.js"></script>
		<script src="../assets/js/ace/elements.fileinput.js"></script>
		<script src="../assets/js/ace/elements.typeahead.js"></script>
		<script src="../assets/js/ace/elements.wysiwyg.js"></script>
		<script src="../assets/js/ace/elements.spinner.js"></script>
		<script src="../assets/js/ace/elements.treeview.js"></script>
		<script src="../assets/js/ace/elements.wizard.js"></script>
		<script src="../assets/js/ace/elements.aside.js"></script>
		<script src="../assets/js/ace/ace.js"></script>
		<script src="../assets/js/ace/ace.ajax-content.js"></script>
		<script src="../assets/js/ace/ace.touch-drag.js"></script>
		<script src="../assets/js/ace/ace.sidebar.js"></script>
		<script src="../assets/js/ace/ace.sidebar-scroll-1.js"></script>
		<script src="../assets/js/ace/ace.submenu-hover.js"></script>
		<script src="../assets/js/ace/ace.widget-box.js"></script>
		<script src="../assets/js/ace/ace.settings.js"></script>
		<script src="../assets/js/ace/ace.settings-rtl.js"></script>
		<script src="../assets/js/ace/ace.settings-skin.js"></script>
		<script src="../assets/js/ace/ace.widget-on-reload.js"></script>
		<script src="../assets/js/ace/ace.searchbox-autocomplete.js"></script>
		<script src="../assets/js/ace/ace.searchbox-autocomplete.js"></script>
                
                
                <link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
                <!--<link rel="stylesheet" href="css/template.css" type="text/css"/>-->
                
                
		<!-- inline scripts related to this page -->
		<script type="text/javascript">
                        
			jQuery(function($) {
                                
                                
				//override dialog's title function to allow for HTML titles
				$.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
					_title: function(title) {
						var $title = this.options.title || '&nbsp;'
						if( ("title_html" in this.options) && this.options.title_html == true )
							title.html($title);
						else title.text($title);
					}
				}));
			
				
			
				$( "#id-btn-dialog2" ).on('click', function(e) {//--
					e.preventDefault();
                                    $( "#dialog-confirm" ).removeClass('hide').dialog({
                                        resizable: false,
                                        modal: true,
                                        title: "<div class='widget-header'><h4 class='smaller'><i class='ace-icon fa fa-exclamation-triangle red'></i> Empty the recycle bin?</h4></div>",
                                        title_html: true,
                                        buttons: [
                                            {
                                                html: "<i class='ace-icon fa fa-trash-o bigger-110'></i>&nbsp; Delete all items",
                                                "class" : "btn btn-danger btn-xs",
                                                click: function() {
                                                    $( this ).dialog( "close" );
                                                }
                                            }
                                            ,
                                            {
                                                html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; Cancel",
                                                "class" : "btn btn-xs",
                                                click: function() {
                                                    $( this ).dialog( "close" );
                                                }
                                            }
                                        ]
                                    });
				});
                                
				$('.easy-pie-chart.percentage').each(function(){
					var $box = $(this).closest('.infobox');
					var barColor = $(this).data('color') || (!$box.hasClass('infobox-dark') ? $box.css('color') : 'rgba(255,255,255,0.95)');
					var trackColor = barColor == 'rgba(255,255,255,0.95)' ? 'rgba(255,255,255,0.25)' : '#E2E2E2';
					var size = parseInt($(this).data('size')) || 50;
					$(this).easyPieChart({
						barColor: barColor,
						trackColor: trackColor,
						scaleColor: false,
						lineCap: 'butt',
						lineWidth: parseInt(size/10),
						animate: /msie\s*(8|7|6)/.test(navigator.userAgent.toLowerCase()) ? false : 1000,
						size: size
					});
				})
			
				$('.sparkline').each(function(){
					var $box = $(this).closest('.infobox');
					var barColor = !$box.hasClass('infobox-dark') ? $box.css('color') : '#FFF';
					$(this).sparkline('html',
                                                                    {
                                                                           tagValuesAttribute:'data-values',
                                                                           type: 'bar',
                                                                           barColor: barColor ,
                                                                           chartRangeMin:$(this).data('min') || 0
                                                                    });
				});
			
			
			  //flot chart resize plugin, somehow manipulates default browser resize event to optimize it!
			  //but sometimes it brings up errors with normal resize event handlers
			  $.resize.throttleWindow = false;
			
			  var placeholder = $('#piechart-placeholder').css({'width':'90%' , 'min-height':'150px'});
			  var data = [
				{ label: "social networks",  data: 38.7, color: "#68BC31"},
				{ label: "search engines",  data: 24.5, color: "#2091CF"},
				{ label: "ad campaigns",  data: 8.2, color: "#AF4E96"},
				{ label: "direct traffic",  data: 18.6, color: "#DA5430"},
				{ label: "other",  data: 10, color: "#FEE074"}
			  ]
			  function drawPieChart(placeholder, data, position) {
			 	  $.plot(placeholder, data, {
					series: {
						pie: {
							show: true,
							tilt:0.8,
							highlight: {
								opacity: 0.25
							},
							stroke: {
								color: '#fff',
								width: 2
							},
							startAngle: 2
						}
					},
					legend: {
						show: true,
						position: position || "ne", 
						labelBoxBorderColor: null,
						margin:[-30,15]
					}
					,
					grid: {
						hoverable: true,
						clickable: true
					}
				 })
			 }
			 drawPieChart(placeholder, data);
			
			 /**
			 we saved the drawing function and the data to redraw with different position later when switching to RTL mode dynamically
			 so that's not needed actually.
			 */
			 placeholder.data('chart', data);
			 placeholder.data('draw', drawPieChart);
			
			
			  //pie chart tooltip example
			  var $tooltip = $("<div class='tooltip top in'><div class='tooltip-inner'></div></div>").hide().appendTo('body');
			  var previousPoint = null;
			
			  placeholder.on('plothover', function (event, pos, item) {
				if(item) {
					if (previousPoint != item.seriesIndex) {
						previousPoint = item.seriesIndex;
						var tip = item.series['label'] + " : " + item.series['percent']+'%';
						$tooltip.show().children(0).text(tip);
					}
					$tooltip.css({top:pos.pageY + 10, left:pos.pageX + 10});
				} else {
					$tooltip.hide();
					previousPoint = null;
				}
				
			 });
			
				/////////////////////////////////////
				$(document).one('ajaxloadstart.page', function(e) {
					$tooltip.remove();
				});
			
			
			
			
				var d1 = [];
				for (var i = 0; i < Math.PI * 2; i += 0.5) {
					d1.push([i, Math.sin(i)]);
				}
			
				var d2 = [];
				for (var i = 0; i < Math.PI * 2; i += 0.5) {
					d2.push([i, Math.cos(i)]);
				}
			
				var d3 = [];
				for (var i = 0; i < Math.PI * 2; i += 0.2) {
					d3.push([i, Math.tan(i)]);
				}
				
			
				var sales_charts = $('#sales-charts').css({'width':'100%' , 'height':'220px'});
				$.plot("#sales-charts", [
					{ label: "Domains", data: d1 },
					{ label: "Hosting", data: d2 },
					{ label: "Services", data: d3 }
				], {
					hoverable: true,
					shadowSize: 0,
					series: {
						lines: { show: true },
						points: { show: true }
					},
					xaxis: {
						tickLength: 0
					},
					yaxis: {
						ticks: 10,
						min: -2,
						max: 2,
						tickDecimals: 3
					},
					grid: {
						backgroundColor: { colors: [ "#fff", "#fff" ] },
						borderWidth: 1,
						borderColor:'#555'
					}
				});
			
			
				$('#recent-box [data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('.tab-content')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					//var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			
			
				$('.dialogs,.comments').ace_scroll({
					size: 300
			    });
				
				
				//Android's default browser somehow is confused when tapping on label which will lead to dragging the task
				//so disable dragging when clicking on label
				var agent = navigator.userAgent.toLowerCase();
				if("ontouchstart" in document && /applewebkit/.test(agent) && /android/.test(agent))
				  $('#tasks').on('touchstart', function(e){
					var li = $(e.target).closest('#tasks li');
					if(li.length == 0)return;
					var label = li.find('label.inline').get(0);
					if(label == e.target || $.contains(label, e.target)) e.stopImmediatePropagation() ;
				});
			
				$('#tasks').sortable({
					opacity:0.8,
					revert:true,
					forceHelperSize:true,
					placeholder: 'draggable-placeholder',
					forcePlaceholderSize:true,
					tolerance:'pointer',
					stop: function( event, ui ) {
						//just for Chrome!!!! so that dropdowns on items don't appear below other items after being moved
						$(ui.item).css('z-index', 'auto');
					}
534
				   }
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591
				);
				$('#tasks').disableSelection();
				$('#tasks input:checkbox').removeAttr('checked').on('click', function(){
					if(this.checked) $(this).closest('li').addClass('selected');
					else $(this).closest('li').removeClass('selected');
				});
			
			
				//show the dropdowns on top or bottom depending on window height and menu position
				$('#task-tab .dropdown-hover').on('mouseenter', function(e) {
					var offset = $(this).offset();
			
					var $w = $(window)
					if (offset.top > $w.scrollTop() + $w.innerHeight() - 100) 
						$(this).addClass('dropup');
					else $(this).removeClass('dropup');
				});
			
                        
                        
			});
                        
                    //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                    
                        $(document).ready( function() {
                            jQuery("#registroEncuesta").validationEngine();
                        });
                        
                        function conMayuscula(field){
                            field.value = field.value.toUpperCase();
                        }
                        
                        function cargando(){
                            $( "#dialog-cargando" ).removeClass('hide').dialog({
                                resizable: false,
                                modal: true,
                                title: "<div class='widget-header' ><h4 class='smaller'><i class='fa fa-spinner'></i> Cargando...</h4></div>",
                                title_html: true
                            });
                        }
                        
                        function close_carga(){
                            $( "#dialog-cargando" ).dialog( "close" );
                        }
                        
                        function validar_busqueda(){
                            var estado=$('#registroEncuesta').validationEngine('validate');
                            if(estado){
                                var pagina=1;
                                BuscarDocente(pagina);
                            }else{
                                $("#listaDocenteBusqueda").fadeOut();
                                $("#txt_bus_doc").val("");
                            }
                        }
                        
                        
592 593
                        
                        
594
                        function BuscarDocente(pagina){
595
			    let name=''
596 597 598 599 600 601 602 603 604 605 606 607 608 609
                            var accion = "";
                            var cantidad=15;
                            var apellido = $("#txt_bus_doc").val();
                            $("#ape").val(apellido);

                            $.ajax({
                                    type:'POST',
                                    url:'../ServletDocente?Accion=buscarUsuarioDocenteDatos',
                                    data: 'accion='+accion+'&apellido='+apellido+'&pagina='+pagina+'&cantidad='+cantidad,
                                    beforeSend: function() {
                                        cargando();
                                    },success:function(resultado){
                                        close_carga();
                                        $("#divListadoDoc").html(resultado);
610
																				
611 612 613 614 615 616 617
                                        name=$("#lblUsuario").text();

                                        if(name === "6"){
                                            $("#divListadoDoc #btnRegEdit").hide();
                                            $("#divListadoDoc #btnReg").hide();
                                            $("#divListadoDoc #thDatos").hide();
                                        }
618
																				
619 620
                                    },
                                    complete:function(){
621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650
                                       if(apellido==""){
                                          $("#divListadoDoc").fadeOut(); 
                                       }else{
                                           $("#divListadoDoc").fadeIn();
                                           $("#pagina").val(pagina);
                                       }

                                    }
                            });

                        }
                        
                        //------------------------------
                        
                        
                        function armarRegistroEdit(codDocente,nomDocente){
                            var accion="";
                           // alert(codDocente);
                            $.ajax({
                                    type:'POST',
                                    url:'../ServletDocente?Accion=armarRegistroDatosDocenteEdit',
                                    data: 'codDocente='+codDocente+'&nomDocente='+nomDocente+'&accion='+accion,
                                    beforeSend: function() {
                                        cargando();
                                    },success:function(resultado){
                                        close_carga();
                                        $("#divRegistroDatos").html(resultado);
                                    },complete:function(){ 
                                        alerta1(codDocente);
                                        cargarDepartamentoEdit(codDocente);
651
                                        cargarAreaEdit(codDocente);
652 653 654 655
                                    }
                            });
                        }
                        
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692
                        //PENDIENTE DESARROLLO
                        function cargarAreaEdit(codDocente){
                            var nombre="cmbAreaEditarDatos";
                            var accion="cargarPlanaAsisteEdit("+codDocente+");";
                          
                            $.ajax({
                                type: 'POST',
                                url: '../ServletArea?Accion=cargarAreaEditar',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDocente='+codDocente,
                                success:function(resultado){
                                    $('#divAreaEditarDatos').html(resultado);
                                },complete:function(){
                                    cargarPlanaAsisteEdit(codDocente);
                                }
                            });                     
                        }
                        
                        function cargarPlanaAsisteEdit(codDocente){
                            let codigoDocente = codDocente
                            console.log("codigoDocente-->")
                            console.log(codDocente)
                                var nombre = "cmbPlanaAsisteEdit";
                                    //  var accion = "limpiar2();";
                                var periodo = "<%=periodo != null ? periodo.getCodigoPeriodo() : ""%>";
                                var codArea = $("#cmbAreaEditarDatos").val()
                                $.ajax({
                                    type: 'POST',
                                    url: '../ServletPlana?Accion=listarPlanaAsiste',
                                    data: 'nombre=' + nombre +'&codDocente=' + codigoDocente+'&codper='+periodo+'&codArea='+codArea,
                                    success: function (resultado) {
                                        $('#divPlanaEditarDatos').html(resultado);
                                    }
                                });
                        }
                        
                        
                        
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871
                        function cargarDepartamentoEdit(codDocente){
                            var nombre="cmbDepartamentoEdit";
                            var accion="cargarProvincia2();limpiar2();";
                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarDepartamento',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDocente='+codDocente,
                                success:function(resultado){
                                    $('#divDepartamentoEdit').html(resultado);
                                },complete:function(){
                                   cargarProvinciaEdit(codDocente);
                                   //cargarDistritoEdit(codDocente);
                                }
                            });
                            /*var nombre="cmbDepartamento";
                            var accion="cargarProvinciaEdit("+codDocente+");";

                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarDepartamento',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDocente='+codDocente,
                                beforeSend: function() {
                                    cargando();
                                },success:function(resultado){
                                    close_carga();
                                    $('#divDepartamentoEdit').html(resultado);
                                },complete:function(){
                                   cargarProvinciaEdit(codDocente);
                                }
                            });*/
                        }
                        
                        function cargarProvinciaEdit(codDocente){
                            var nombre="cmbprovinciaEdit";
                            var accion="cargarDistrito2();";
                            var codDepartamento=$("#cmbDepartamentoEdit").val();
                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarProvincia',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDepartamento='+codDepartamento+'&codDocente='+codDocente,
                                success:function(resultado){
                                    $('#divProvinciaEdit').html(resultado);
                                },complete:function(){
                                    cargarDistritoEdit(codDocente);

                                }
                            });
                            /*var nombre="cmbprovincia";
                            var accion="cargarDistritoEdit("+codDocente+");";
                            var codDepartamento=$("#cmbDepartamento").val();
                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarProvincia',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDepartamento='+codDepartamento+'&codDocente='+codDocente,
                                success:function(resultado){
                                    $('#divProvinciaEdit').html(resultado);
                                },complete:function(){
                                    cargarDistritoEdit(codDocente);

                                }
                            });*/
                        }
                        
                        function cargarDistritoEdit(codDocente){
                            var nombre="cmbDistritoEdit";
                            var accion="";
                            var codDepartamento=$("#cmbDepartamentoEdit").val();
                            var codProvincia=$("#cmbprovinciaEdit").val();
                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarDistrito',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDepartamento='+codDepartamento+'&codProvincia='+codProvincia+'&codDocente='+codDocente,
                                success:function(resultado){
                                    $('#divDistritoEdit').html(resultado);
                                },complete:function(){

                                }
                            });
                            /*var nombre="cmbDistrito";
                            var accion="";
                            var codDepartamento=$("#cmbDepartamento").val();
                            var codProvincia=$("#cmbprovincia").val();

                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarDistrito',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDepartamento='+codDepartamento+'&codProvincia='+codProvincia+'&codDocente='+codDocente,
                                success:function(resultado){
                                    $('#divDistritoEdit').html(resultado);
                                },complete:function(){

                                }
                            });*/
                        }
                        
                        function cargarProvincia2(){
                            var nombre="cmbprovinciaEdit";
                            var accion="cargarDistrito2();";
                            var codDepartamento=$("#cmbDepartamentoEdit").val();

                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarProvincia1',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDepartamento='+codDepartamento,
                                success:function(resultado){
                                    $('#divProvinciaEdit').html(resultado);
                                },complete:function(){
                                }
                            });
                        }
                        
                        function cargarDistrito2(){
                            var nombre="cmbDistritoEdit";
                            var accion="";
                            var codDepartamento=$("#cmbDepartamentoEdit").val();
                            var codProvincia=$("#cmbprovinciaEdit").val();
                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarDistrito1',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDepartamento='+codDepartamento+'&codProvincia='+codProvincia,
                                success:function(resultado){
                                    $('#divDistritoEdit').html(resultado);
                                },complete:function(){

                                }
                            });
                        }
                        
                        function limpiar2(){
                            $('#cmbDistritoEdit').val("");
                        };
                        
                          
                        
                        function alerta1(codDocente){
                            $( "#dialog-edit" ).removeClass('hide').dialog({
                                resizable: false,
                                width: 600,
                                modal: true,
                                title: "<div class='widget-color-blue' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-check-circle white'></i> <span class='white'>Edición de datos personales</span></h4></div></div>",
                                title_html: true,
                                buttons: [
                                    {
                                        html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; ACTUALIZAR",
                                        "class" : "btn btn-primary btn-xs",
                                        click: function() {
                                            validar_registroDatosEdit(codDocente);
                                        }
                                    },{
                                        html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; CANCELAR",
                                        "class" : "btn btn-danger btn-xs",
                                        click: function() {
                                            $( this ).dialog( "close" ); 
                                        }
                                    }
                                ]
                            });
                        }
                        
                        
                        function validar_registroDatosEdit(codDocente){
                            var estado=jQuery('#RegistroDatos').validationEngine('validate');
                            if(estado){
                                editDatos(codDocente); 
                            }
                        }


                       function editDatos(codDocente){
                            // 1: se registro normal   2: ya exista   3: error
                            var telefono = $("#txt_new_tel").val();
                            var mail = $("#txt_new_mail").val();
                            var cel = $("#txt_new_celEdit").val();
                            var dir = $("#txt_new_dirEdit").val();
                            //var zona = $("#txt_new_zona").val();
                            var codDepartamento=$("#cmbDepartamentoEdit").val();
                            var codProvincia=$("#cmbprovinciaEdit").val();
                            var codDistrito=$("#cmbDistritoEdit").val();
                            
872 873 874 875
                            var codArea = $("#cmbAreaEditarDatos").val();
                            var codPlana = $("#cmbPlanaAsisteEdit").val();
                            var txt_numHijos = $("#txt_numHijos").val();
                            var periodo = "<%=periodo != null ? periodo.getCodigoPeriodo() : ""%>";
876 877 878 879
                            
                            $.ajax({
                                    type:'POST',
                                    url:'../ServletDocente?Accion=registraDatosDocenteEdit',
880
                                    data: 'codDocente='+codDocente+'&telefono='+telefono+'&mail='+mail+'&codDepartamento='+codDepartamento+'&codProvincia='+codProvincia+'&codDistrito='+codDistrito+'&cel='+cel+'&dir='+dir+'&cantHijos='+txt_numHijos+'&codArea='+codArea+'&codPlana='+codPlana+'&periodo='+periodo,
881 882 883 884 885 886 887 888 889
                                    beforeSend: function() {
                                        cargando();
                                    },success:function(resultado){
                                        close_carga();
                                        if(resultado==0){
                                            alerta2();  
                                        }else if(resultado==1){
                                            alerta3(); 
                                        }
890
                                    },complete:function(){
891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909

                                    }
                            });
                        }

                           
                     
                        function alerta2(){
                            $( "#dialog-edit" ).dialog( "close" );
                            $( "#dialog-advertencia1" ).removeClass('hide').dialog({
                                resizable: false,
                                modal: true,
                                title: "<div class='widget-color-orange' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-exclamation-triangle white'></i> <span class='white'>Advertencia</span></h4></div></div>",
                                title_html: true,
                                buttons: [
                                    {
                                        html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; ACEPTAR",
                                        "class" : "btn btn-warning btn-xs",
                                        click: function() {
910
                                            $(this).dialog("close");
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932
                                            var pagina=$("#pagina").val();
                                            BuscarDocente(pagina);
                                        }
                                    }
                                ]
                            });
                        }
                        
                            
                        
                        function alerta3(){
                            $( "#dialog-edit" ).dialog( "close" );
                            $( "#dialog-noti1" ).removeClass('hide').dialog({
                                resizable: false,
                                modal: true,
                                title: "<div class='widget-color-green' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-tags white'></i> <span class='white'>Notificación</span></h4></div></div>",
                                title_html: true,
                                buttons: [
                                    {
                                        html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; ACEPTAR",
                                        "class" : "btn btn-success btn-xs",
                                        click: function() {
933
                                            $(this).dialog("close");
934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957
                                            var pagina=$("#pagina").val();
                                            BuscarDocente(pagina);
                                        }
                                    }
                                ]
                            });
                        }
                        
                        
                        //-------------------------------
                        
                        
                        
                        function armarRegistro(codDocente,nomDocente){
                            var accion="cargarDepartamento("+codDocente+")";
                            $.ajax({
                                type:'POST',
                                url:'../ServletDocente?Accion=armarRegistroDatosDocente',
                                data: 'codDocente='+codDocente+'&nomDocente='+nomDocente+'&accion='+accion,
                                beforeSend: function() {
                                    cargando();
                                },success:function(resultado){
                                    close_carga();
                                    $("#divRegistroDatos").html(resultado);
958
                                },complete:function(){
959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979
                                    alerta4(codDocente);
                                    //ilumina();
                                    cargarDepartamento(codDocente);
                                }
                            });
                        }
                        
                        function alerta4(codDocente){
                            $( "#dialog-edit" ).removeClass('hide').dialog({
                                resizable: false,
                                width: 600,
                                modal: true,
                                title: "<div class='widget-color-blue' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-check-circle white'></i> <span class='white'>Registro de Datos Personales</span></h4></div></div>",
                                title_html: true,
                                buttons: [
                                    {
                                        html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; REGISTRAR",
                                        "class" : "btn btn-primary btn-xs",
                                        click: function() {
                                            validar_registroDatos(codDocente);
                                        }
980 981
                                    },
                                    {
982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034
                                        html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; CANCELAR",
                                        "class" : "btn btn-danger btn-xs",
                                        click: function() {
                                            $( this ).dialog( "close" ); 
                                        }
                                    }
                                ]
                            });
                        }
                        
                        function cargarDepartamento(){
                            var nombre="cmbDepartamento";
                            var accion="cargarProvincia();limpiar();";
                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarDepartamento1',
                                data: 'nombre='+nombre+'&accion='+accion,
                                success:function(resultado){
                                    $('#divDepartamento').html(resultado);
                                },complete:function(){
                                   cargarProvincia();
                                }
                            });
                        }
                        
                        function cargarProvincia(){
                            var nombre="cmbprovincia";
                            var accion="cargarDistrito();";
                            var codDepartamento=$("#cmbDepartamento").val();
                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarProvincia1',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDepartamento='+codDepartamento,
                                success:function(resultado){
                                    $('#divProvincia').html(resultado);
                                },complete:function(){
                                    cargarDistrito();
                                }
                            });
                        }
                        
                        function cargarDistrito(){
                            var nombre="cmbDistrito";
                            var accion="";
                            var codDepartamento=$("#cmbDepartamento").val();
                            var codProvincia=$("#cmbprovincia").val();
                            $.ajax({
                                type: 'POST',
                                url: '../ServletUbigeoDocente?Accion=cargarDistrito1',
                                data: 'nombre='+nombre+'&accion='+accion+'&codDepartamento='+codDepartamento+'&codProvincia='+codProvincia,
                                success:function(resultado){
                                    $('#divDistrito').html(resultado);
                                },complete:function(){
1035
                                    
1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200
                                }
                            });
                        }
                        
                        function limpiar(){
                            $('#cmbDistrito').val("");
                        };
                        
                        function validar_registroDatos(codDocente){
                            var estado=jQuery('#RegistroDatos').validationEngine('validate');
                            if(estado){
                                alerta6(codDocente);
                            }
                        }
                        
                        function registrarDatos(codDocente){
                            // 1: se registro normal   2: ya exista   3: error
                            var telefono = $("#txt_new_tel").val();
                            var mail = $("#txt_new_mail").val();
                            var cel = $("#txt_new_celular").val();
                            var direccion = $("#txt_new_dir").val();
                            var zona = $("#txt_new_zona").val();
                            var codDepartamento=$("#cmbDepartamento").val();
                            var codProvincia=$("#cmbprovincia").val();
                            var codDistrito=$("#cmbDistrito").val();

                            $.ajax({
                                    type:'POST',
                                    url:'../ServletDocente?Accion=registraDatosDocente',
                                    data: 'codDocente='+codDocente+'&telefono='+telefono+'&mail='+mail+'&zona='+zona+'&codDepartamento='+codDepartamento+'&codProvincia='+codProvincia+'&codDistrito='+codDistrito+'&cel='+cel+'&direccion='+direccion,
                                    beforeSend: function() {
                                        cargando();
                                    },success:function(resultado){
                                       close_carga();
                                        if(resultado==0){
                                            alerta5();  
                                        }else if(resultado==1){
                                            alerta7(); 
                                        }
                                    },complete:function(){ 

                                    }
                            });
                        }
                        
                        
                        function alerta5(){
                            $( "#dialog-advertencia1" ).removeClass('hide').dialog({
                                resizable: false,
                                modal: true,
                                title: "<div class='widget-color-orange' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-exclamation-triangle white'></i> <span class='white'>Advertencia</span></h4></div></div>",
                                title_html: true,
                                buttons: [
                                    {
                                        html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; ACEPTAR",
                                        "class" : "btn btn-warning btn-xs",
                                        click: function() {
                                            $( this ).dialog( "close" );
                                            var pagina=$("#pagina").val();
                                            BuscarDocente(pagina);
                                        }
                                    }
                                ]
                            });
                        }
                        
                        function alerta7(){
                            $( "#dialog-edit" ).dialog( "close" );
                            $( "#dialog-confor2" ).dialog( "close" );
                            $( "#dialog-noti2" ).removeClass('hide').dialog({
                                resizable: false,
                                modal: true,
                                title: "<div class='widget-color-green' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-tags white'></i> <span class='white'>Notificación</span></h4></div></div>",
                                title_html: true,
                                buttons: [
                                    {
                                        html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; ACEPTAR",
                                        "class" : "btn btn-success btn-xs",
                                        click: function() {
                                            $( this ).dialog( "close" );
                                            var pagina=$("#pagina").val();
                                            BuscarDocente(pagina);
                                        }
                                    }
                                ]
                            });
                        }
                        
                         
                        
                        function alerta6(codDocente){
                            $( "#dialog-confor2" ).removeClass('hide').dialog({
                                resizable: false,
                                modal: true,
                                title: "<div class='widget-color-blue' ><div class='widget-header white' ><h4 class='smaller' ><i class='ace-icon fa fa-check-circle white'></i> <span class='white'>Conformidad</span></h4></div></div>",
                                title_html: true,
                                buttons: [
                                    {
                                        html: "<i class='ace-icon fa fa-check bigger-110'></i>&nbsp; SI",
                                        "class" : "btn btn-primary btn-xs",
                                        click: function() {
                                            registrarDatos(codDocente);
                                        }
                                    },{
                                        html: "<i class='ace-icon fa fa-times bigger-110'></i>&nbsp; NO",
                                        "class" : "btn btn-danger btn-xs",
                                        click: function() {
                                            $( this ).dialog( "close" ); 
                                        }
                                    }
                                ]
                            });
                        }
            
            
            
            
                      
             
                        //-------------------------------
                        
                        
                        function conMayusculas(field) {
                            field.value = field.value.toUpperCase()
                        }
                        
                        function segundaCarga(){
                            //listarArea();
                        }
                        
                        function enter(e) {
                            tecla = (document.all) ? e.keyCode : e.which;
                            if (tecla==13) validar_busqueda();
                        }

			$('input').keypress(function(e){
                            if(e.which == 13){
                                return false;
                            }
                        });
                        
                        
                        
		</script>

		<!-- the following scripts are used in demo only for onpage help and you don't need them -->
               
		<link rel="stylesheet" href="../assets/css/ace.onpage-help.css" />
		<link rel="stylesheet" href="../docs/assets/js/themes/sunburst.css" />
                
		<script type="text/javascript"> ace.vars['base'] = '..'; </script>
		<script src="../assets/js/ace/elements.onpage-help.js"></script>
		<script src="../assets/js/ace/ace.onpage-help.js"></script>
		<script src="../docs/assets/js/rainbow.js"></script>
		<script src="../docs/assets/js/language/generic.js"></script>
		<script src="../docs/assets/js/language/html.js"></script>
		<script src="../docs/assets/js/language/css.js"></script>
		<script src="../docs/assets/js/language/javascript.js"></script>
                
                
                
                <script src="js/languages/jquery.validationEngine-es.js" type="text/javascript" charset="utf-8"></script>
                <script src="js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>

</html>