<?php  include 'conector.php';
include 'mysql_compat.php';
session_start();
include 'menu_header.php';
$men="";$val1="";$val2="";$val3="";$val4="";$cur1="";$cur2="";$cur3="";$cur4="";
$class1="";$class2="";$class3="";$class4="";$act1="";$act2="";$act3="";$act4="";$tbody="";
$ide1="";$nombre1="";$identi1="";$eps1="";$pension1="";$escalafon1="";$especialidad1="";$obs1="";
$nombre_docente1="";$fecha_nacimiento1="";$sexo1="";$grupo_sangre1="";$direccion1="";$telefono1="";$correo1="";
$usuario1="";$pass1="";$acudiente1="";$id_acud1="";$exp_acud1="";$dir_acud1="";$tel_acud1="";$correo_acud1="";
$formacion_acud1="";$empresa_acud1="";$cargo_acud1="";$dir_emp_acud1="";$tel_emp_acud1="";$u_plataforma_acud1="";$c_plataforma_acud1="";
$acudiente2="";$id_acud2="";$exp_acud2="";$dir_acud2="";$tel_acud2="";$correo_acud2="";
$formacion_acud2="";$empresa_acud2="";$cargo_acud2="";$dir_emp_acud2="";$tel_emp_acud2="";$u_plataforma_acud2="";$c_plataforma_acud2="";
$identi="";$estado1="";

if(isset($_GET['eliminar']) && !empty($_GET['eliminar'])){
	$acud_id = intval($_GET['eliminar']);
	$eliminar_acud="delete from acudiente where Id=".$acud_id;
	if(mysql_query($eliminar_acud)){
		$men="<div class=\"alert alert-success\">
                     <button type=\"button\" class=\"close\" data-dismiss=\"alert\">X</button>
                     Acudiente Eliminado                
 			</div>";
	}else{
		$men="<div class=\"alert alert-danger\">
                     <button type=\"button\" class=\"close\" data-dismiss=\"alert\">X</button>
                     Error al Eliminar Acudiente
 			</div>";
	}
}

if(isset($_SESSION["user"])){

  $class1="class=\"active\"";
  $class2="";
  $act2="";
  $act1=" active ";

if(isset($_POST['val2'])&&!empty($_POST['val2'])){

 if($_POST['val2']==1){
  $class1="";
  $class2="class=\"active\"";
  $act1="";
  $act2=" active ";

	$insertar_acudiente='insert into acudiente (nombre_asistente,id_acud,exp_acud,dir_acud,tel_acud,correo_acud,formacion_acud,empresa_acud,cargo_acud,dir_emp_acud,tel_emp_acud,usuario_acud,clave_acud
	)
values(UPPER("'.$_POST['acudiente2'].'"),"'.$_POST['id_acud2'].'","'.$_POST['exp_acud2'].'","'.$_POST['dir_acud2'].'","'.$_POST['tel_acud2'].'","'.$_POST['correo_acud2'].'","'.$_POST['formacion_acud2'].'","'.$_POST['empresa_acud2'].'","'.$_POST['cargo_acud2'].'","'.$_POST['dir_emp_acud2'].'","'.$_POST['tel_emp_acud2'].'","'.$_POST['u_plataforma_acud2'].'","'.$_POST['c_plataforma_acud2'].'"
	)';
	

	if(mysql_query($insertar_acudiente)){
	}
	
	
	
	$men="<div class=\"alert alert-success\">
                    <button type=\"button\" class=\"close\" data-dismiss=\"alert\">X</button>
                    Acudiente: ".$_POST['acudiente2']." Creado(a)
			</div>";

 }
}




if(isset($_POST['val1'])&&!empty($_POST['val1'])){

//echo "archivo".$_POST['ide1']."<br>";
//$_FILES["archivo".$_POST['ide1']]

 if($_POST['val1']==1){


	$actualiza_acud="update acudiente set
	
	nombre_asistente='".$_POST['acudiente1']."',
	id_acud='".$_POST['id_acud1']."',
	exp_acud='".$_POST['exp_acud1']."',
	dir_acud='".$_POST['dir_acud1']."',
	tel_acud='".$_POST['tel_acud1']."',
	correo_acud='".$_POST['correo_acud1']."',
	formacion_acud='".$_POST['formacion_acud1']."',
	empresa_acud='".$_POST['empresa_acud1']."',
	cargo_acud='".$_POST['cargo_acud1']."',
	dir_emp_acud='".$_POST['dir_emp_acud1']."',
	tel_emp_acud='".$_POST['tel_emp_acud1']."',
	usuario_acud='".$_POST['u_plataforma_acud1']."',
	clave_acud='".$_POST['c_plataforma_acud1']."',
	estado='".$_POST['estado1']."'
	where id=".$_POST['identi']."  ";
	

	if(mysql_query($actualiza_acud)){

		       	$men="<div class=\"alert alert-success\">
	                    <button type=\"button\" class=\"close\" data-dismiss=\"alert\">X</button>
	                    Acudiente Actualizado
				</div>";
		}else{
		//echo $actualiza_docente;
		
		       	$men="<div class=\"alert alert-danger\">
	                    <button type=\"button\" class=\"close\" data-dismiss=\"alert\">X</button>
	                    Error al Actualizar Acudiente
				</div>";
		
		}
	
	
	
	 
 }
}



$select_acud="select Id,nombre_asistente,id_acud,exp_acud,dir_acud,tel_acud,correo_acud,formacion_acud,empresa_acud,cargo_acud,dir_emp_acud,tel_emp_acud,usuario_acud,clave_acud,estado
from acudiente where acudiente.estado in ('A','I')  order by nombre_asistente";

 $res_select_acud=mysql_query($select_acud);
			
					$tbody="<tbody>";
					while($r_sd=mysql_fetch_array($res_select_acud)){
													$c1='';$c2='';
					if($r_sd[14]=='A'){$est='Activo';$lab='success ';}else{$est='Inactivo';$lab='danger ';}
					
					$tbody.="<tr role='row'><td>".$r_sd[0]."</td><td>".$r_sd[1]."</td><td><span class='label label-".$lab."'>".$est."</span></td><td>
					<a class='btn btn-info btn-xs' name='".$r_sd[0]."' id='".$r_sd[0]."' data-toggle='modal' data-target='#mimodala".$r_sd[0]."' onclick=''>
                			<i class='glyphicon glyphicon-edit icon-white'></i>  
			                Editar               
				            </a>
					</td></tr>";
					
						$tbody.="<div name='mimodala".$r_sd[0]."' id='mimodala".$r_sd[0]."' class='modal fade bs-example-modal-sm' tabindex='-1' role='dialog' aria-labelledby='mySmallModalLabel' aria-hidden='true'>
						  <div class='modal-dialog modal-md'>
						    <div class='modal-content'>
						      <div class='modal-header'>
							      <button type='button' class='close' data-dismiss='modal' aria-hidden='true'>x</button>
						      		<h4 class='modal-title' id='myLargeModalLabel'>Consultar Acudiente</h4>
	      					      </div>
	      					      <div class='modal-body'>";
						
						     //     $select_obs_doc="select * from observacion_docente where planilla=".$_POST['per1']." and estudiante=".$r_sce[0]."   ";
						       //   $res_select_obs_doc=mysql_query($select_obs_doc);
						        //  while($r_sodoc=mysql_fetch_array($res_select_obs_doc)){

								 $tbody.="
									<div align=center>
									<b>$r_sd[1]</b>
									</div>
									<br>";
								$a1='';$a2='';
								if($r_sd[3]=='Masculino'){$a1=' selected ';}
								if($r_sd[3]=='Femenino'){$a2=' selected ';}								
								$b1='';$b2='';$b3='';$b4='';$b5='';$b6='';$b7='';$b8='';

								if($r_sd[4]=='AB+'){$b1=' selected ';}
								if($r_sd[4]=='AB-'){$b2=' selected ';}
								if($r_sd[4]=='B+'){$b3=' selected ';}
								if($r_sd[4]=='B-'){$b4=' selected ';}
								if($r_sd[4]=='A+'){$b5=' selected ';}
								if($r_sd[4]=='A-'){$b6=' selected ';}
								if($r_sd[4]=='O+'){$b7=' selected ';}
								if($r_sd[4]=='O-'){$b8=' selected ';}
								if($r_sd[14]=='A'){$c1=' selected ';}
								if($r_sd[14]=='I'){$c2=' selected ';}								
								
														
								
								$tbody.="
								 <div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Nombre Acudiente&nbsp;
								  </div>
								 <div class='input' >
								    <input value='$r_sd[1]' type='text' id='acudiente_".$r_sd[0]."' name='acudiente_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px'>
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Identificaci&oacute;n&nbsp;
								  </div>
								 <div class='input' >
								    <input value='$r_sd[2]' type='text' id='id_acud_".$r_sd[0]."' name='id_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px'>
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Lugar Expedici&oacute;n&nbsp;
								  </div>
								 <div class='input' >
								    <input value='$r_sd[3]' type='text' id='exp_acud_".$r_sd[0]."' name='exp_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px'>
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Direcci&oacute;n&nbsp;
								  </div>
								 <div class='input' >
								    <input value='$r_sd[4]' type='text' id='dir_acud_".$r_sd[0]."' name='dir_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px'>
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Tel&eacute;fono&nbsp;
								  </div>
								 <div class='input' >
								    <input value='$r_sd[5]' type='text' id='tel_acud_".$r_sd[0]."' name='tel_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px'>
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Correo&nbsp;
								  </div>
								 <div class='input' >
								    <input  value='$r_sd[6]' required type='text' id='correo_acud_".$r_sd[0]."' name='correo_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px' onblur='validarEmail(this.value)'>
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Form. Acad&eacute;mica&nbsp;
								  </div>
								 <div class='input' >
								    <input  value='$r_sd[7]' type='text' id='formacion_acud_".$r_sd[0]."' name='formacion_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px' >
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Empresa Labora&nbsp;
								  </div>
								 <div class='input' >
								    <input  value='$r_sd[8]' type='text' id='empresa_acud_".$r_sd[0]."' name='empresa_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px' >
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Cargo Laboral&nbsp;
								  </div>
								 <div class='input' >
								    <input  value='$r_sd[9]' type='text' id='cargo_acud_".$r_sd[0]."' name='cargo_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px' >
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Direcci&oacute;n Laboral&nbsp;
								  </div>
								 <div class='input' >
								    <input  value='$r_sd[10]' type='text' id='dir_emp_acud_".$r_sd[0]."' name='dir_emp_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px' >
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Tel&eacute;fono Lab.&nbsp;
								  </div>
								 <div class='input' >
								    <input  value='$r_sd[11]' type='text' id='tel_emp_acud_".$r_sd[0]."' name='tel_emp_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px' >
								 </div>
								
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Usuario Plataforma&nbsp;
								  </div>
								 <div class='input' >
								    <input value='$r_sd[12]' required type='text' id='u_plataforma_acud_".$r_sd[0]."' name='u_plataforma_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px' >
								 </div>
								<div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
									Clave&nbsp;
								  </div>
								 <div class='input' >
								    <input value='$r_sd[13]' required type='text' id='c_plataforma_acud_".$r_sd[0]."' name='c_plataforma_acud_".$r_sd[0]."' class='form-control2' placeholder='' style='width:48%;margin-bottom: 10px' >
								 </div>
								 <div class='input' style='float:left;width: 120px;padding-top: 5px;padding-left: 10px;text-align: left;height:20px;font-size:12px;' >
								Estado&nbsp;  </div>
								 <div class='input' >
								 <select id='estado_".$r_sd[0]."' name='estado_".$r_sd[0]."' class='form-control2' style='width:48%;margin-bottom: 10px'>
								 	<option value='A' $c1 >Activo</option>
								 	<option value='I' $c2 >Inactivo</option>
								 </select>
								 </div>

								 
								 
								";
						 $tbody.="<div>
						 <button type=\"button\" class=\"btn btn-success btn-xs\" onclick='actualizar_acudiente(".$r_sd[0].")' >Actualizar</button>
						 <button type=\"button\" class=\"btn btn-danger btn-xs\" onclick='if(confirm(\"¿Está seguro que desea eliminar este acudiente?\")){window.location.href=\"acudiente.php?eliminar=".$r_sd[0]."\"}' >Eliminar</button>
							<button type=\"button\" class=\"btn btn-info btn-xs\" data-dismiss='modal' >Cerrar</button>
							</div>";								
								
						$tbody.="
							</div>
						    </div>
						  </div>
						</div>	";	
					
					
					
					}
					$tbody.="</tbody>";







echo "
<!DOCTYPE html>
<html lang=\"en\">
  <head>
    <meta charset=\"utf-8\">
    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">
    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
    <meta name=\"description\" content=\"\">
    <meta name=\"author\" content=\"\">
    <link rel=\"shortcut icon\" href=\"assets/ico/favicon.ico\">
	<style>
	.fileUpload {
	position: relative;
	overflow: hidden;
	margin: 10px;
	}
	.fileUpload input.upload {
	position: absolute;
	top: 0;
	right: 0;
	margin: 10px;
	padding: 10px;
	font-size: 12px;
	cursor: pointer;
	opacity: 0;
	filter: alpha(opacity=0);
	}
	</style>
    <title>Acudiente</title>

    <!-- Bootstrap core CSS -->
    <link href=\"dist/css/bootstrap.min.css\" rel=\"stylesheet\">

    <!-- Custom styles for this template -->
    <link href=\"offcanvas.css\" rel=\"stylesheet\">

    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src=\"../../assets/js/ie8-responsive-file-warning.js\"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src=\"https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js\"></script>
      <script src=\"https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js\"></script>
    <![endif]-->
    <script>
   
function actualizar_acudiente(ide){


if(document.getElementById('acudiente_'+ide).value==''){alert('Debe digitar el nombre del acudiente');return false;}else{document.getElementById('acudiente1').value=document.getElementById('acudiente_'+ide).value}
if(document.getElementById('id_acud_'+ide).value==''){alert('Debe digitar el documento de identidad');return false;}else{document.getElementById('id_acud1').value=document.getElementById('id_acud_'+ide).value}
if(document.getElementById('exp_acud_'+ide).value==''){alert('Debe digitar lugar de exped. del documento');return false;}else{document.getElementById('exp_acud1').value=document.getElementById('exp_acud_'+ide).value}
if(document.getElementById('dir_acud_'+ide).value==''){alert('Debe digitar direccion del acudiente');return false;}else{document.getElementById('dir_acud1').value=document.getElementById('dir_acud_'+ide).value}
if(document.getElementById('tel_acud_'+ide).value==''){alert('Debe digitar telefono del acudiente');return false;}else{document.getElementById('tel_acud1').value=document.getElementById('tel_acud_'+ide).value}
if(document.getElementById('correo_acud_'+ide).value==''){alert('Debe digitar correo del acudiente');return false;}else{document.getElementById('correo_acud1').value=document.getElementById('correo_acud_'+ide).value}
if(document.getElementById('formacion_acud_'+ide).value==''){alert('Debe digitar nivel formacion acudiente');return false;}else{document.getElementById('formacion_acud1').value=document.getElementById('formacion_acud_'+ide).value}
if(document.getElementById('empresa_acud_'+ide).value==''){alert('Debe digitar empresa donde labora');return false;}else{document.getElementById('empresa_acud1').value=document.getElementById('empresa_acud_'+ide).value}
if(document.getElementById('cargo_acud_'+ide).value==''){alert('Debe digitar cargo del acudiente');return false;}else{document.getElementById('cargo_acud1').value=document.getElementById('cargo_acud_'+ide).value}
if(document.getElementById('dir_emp_acud_'+ide).value==''){alert('Debe digitar direccion de empresa');return false;}else{document.getElementById('dir_emp_acud1').value=document.getElementById('dir_emp_acud_'+ide).value}
if(document.getElementById('tel_emp_acud_'+ide).value==''){alert('Debe digitar telefono de empresa');return false;}else{document.getElementById('tel_emp_acud1').value=document.getElementById('tel_emp_acud_'+ide).value}
if(document.getElementById('u_plataforma_acud_'+ide).value==''){alert('Debe digitar usuario para el acudiente');return false;}else{document.getElementById('u_plataforma_acud1').value=document.getElementById('u_plataforma_acud_'+ide).value}
if(document.getElementById('c_plataforma_acud_'+ide).value==''){alert('Debe digitar clave para el acudiente');return false;}else{document.getElementById('c_plataforma_acud1').value=document.getElementById('c_plataforma_acud_'+ide).value}
if(document.getElementById('estado_'+ide).value==''){}else{document.getElementById('estado1').value=document.getElementById('estado_'+ide).value}
document.getElementById('identi').value=ide;



	
document.getElementById('val1').value=1;
	document.forms['gestion_doc'].submit();	

}

function crea_acudiente(){

if(document.getElementById('acudiente').value==''){alert('Debe digitar el nombre del acudiente');return false;}
	else{document.getElementById('acudiente2').value=document.getElementById('acudiente').value}
if(document.getElementById('id_acud').value==''){alert('Debe digitar el documento del acudiente');return false;}
	else{document.getElementById('id_acud2').value=document.getElementById('id_acud').value}
if(document.getElementById('exp_acud').value==''){alert('Debe digitar el lugar de expedicion del documento del acudiente');return false;}
	else{document.getElementById('exp_acud2').value=document.getElementById('exp_acud').value}
if(document.getElementById('dir_acud').value==''){alert('Debe digitar direccion del acudiente');return false;}
	else{document.getElementById('dir_acud2').value=document.getElementById('dir_acud').value}
if(document.getElementById('tel_acud').value==''){alert('Debe digitar el telefono del acudiente');return false;}
	else{document.getElementById('tel_acud2').value=document.getElementById('tel_acud').value}
if(document.getElementById('correo_acud').value==''){alert('Debe digitar el correo del acudiente');return false;}
	else{document.getElementById('correo_acud2').value=document.getElementById('correo_acud').value}
if(document.getElementById('formacion_acud').value==''){alert('Debe digitar la formacion del acudiente');return false;}
	else{document.getElementById('formacion_acud2').value=document.getElementById('formacion_acud').value}
if(document.getElementById('empresa_acud').value==''){alert('Debe digitar el lugar de trabajo del acudiente');return false;}
	else{document.getElementById('empresa_acud2').value=document.getElementById('empresa_acud').value}
if(document.getElementById('cargo_acud').value==''){alert('Debe digitar el cargo del acudiente');return false;}
	else{document.getElementById('cargo_acud2').value=document.getElementById('cargo_acud').value}
if(document.getElementById('dir_emp_acud').value==''){alert('Debe digitar la direccion de trabajo del acudiente');return false;}
	else{document.getElementById('dir_emp_acud2').value=document.getElementById('dir_emp_acud').value}
if(document.getElementById('tel_emp_acud').value==''){alert('Debe digitar el telefono del trabajo del acudiente');return false;}
	else{document.getElementById('tel_emp_acud2').value=document.getElementById('tel_emp_acud').value}
if(document.getElementById('u_plataforma_acud').value==''){alert('Debe digitar el usuario del acudiente');return false;}
	else{document.getElementById('u_plataforma_acud2').value=document.getElementById('u_plataforma_acud').value}
if(document.getElementById('c_plataforma_acud').value==''){alert('Debe digitar la clave del acudiente');return false;}
	else{document.getElementById('c_plataforma_acud2').value=document.getElementById('c_plataforma_acud').value}






	document.getElementById('val2').value=1;
	document.forms['crear_doc'].submit();			
}

function validarEmail( email ) {
    expr = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if ( !expr.test(email) && email!='no tiene')
        alert('Error: La direccion de correo - ' + email + ' - es incorrecta.');
}
</script>
  
    
    
    
  </head>

  <body>
    <div class=\"navbar navbar-fixed-top navbar-inverse\" role=\"navigation\">
      <div class=\"container\">
       
         <a class=\"\" href=\"general.php\"><img src='img/logo1.png' style='margin-top:5px'></a>
      
 
        <a href=\"index.php\"><img src='img/salir.png' style='float:right;margin-top:15px'>
       </a><span style='float:right;margin-right:10px; margin-top:15px' class='label label-success'><span class='glyphicon glyphicon-user'></span> ".$_SESSION["user"]."</span>
      </div><!-- /.container -->
    </div><!-- /.navbar -->


    <div class=\"container\">

      <div class=\"row row-offcanvas row-offcanvas-left\">

       <div class=\"col-xs-6 col-sm-3 sidebar-offcanvas\" id=\"sidebar\" role=\"navigation\">
          <div class=\"list-group\">
            <a href=\"general.php\" class=\"list-group-item \" data-rel='popover' data-content='Dashboard' data-original-title><span class=\"glyphicon glyphicon-home\"></span> General</a>
            <a href=\"estudiantes.php\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-th\"></span> Estudiantes</a>
            <a href=\"docentes.php\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-user\"></span> Docentes</a>
            <a href=\"acudiente.php\" class=\"list-group-item active\"><span class=\"glyphicon glyphicon-user\"></span> Acudientes</a>                      
            <a href=\"asignaturas.php\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-book\"></span> Asignaturas</a>
            <a href=\"cursos.php\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-list\"></span> Cursos</a>
            <a href=\"pensum.php\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-edit\"></span> Pensum</a>    
            <a href=\"logros.php\" class=\"list-group-item \"><span class=\"glyphicon glyphicon-edit\"></span> Logros</a>                        
            <a href=\"observaciones.php\" class=\"list-group-item \"><span class=\"glyphicon glyphicon-edit\"></span> Indicadores de Comportamiento</a>                                    
            <a href=\"horario.php\" class=\"list-group-item \"><span class=\"glyphicon glyphicon-edit\"></span> Horario</a>
            <a href=\"horario_atencion.php\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-edit\"></span> Horario de Atenci&oacute;n</a>            
            <a href=\"planilla_asistencia.php\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-file\"></span> Control de Asistencia</a>            
            <a href=\"planilla.php\" class=\"list-group-item \"><span class=\"glyphicon glyphicon-file\"></span> Registro de Calificaciones</a>            
            <a href=\"planilla_obs.php\" class=\"list-group-item \"><span class=\"glyphicon glyphicon-file\"></span> Observador del Estudiante</a>                        
            <a href=\"pagos.php\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-list\"></span> Pagos</a>                  
            <a href=\"reportes.php\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-file\"></span> Boletines</a>            
            <a href=\"eventos.php\" class=\"list-group-item \"><span class=\"glyphicon glyphicon-edit\"></span> Anuncios</a>           
            <a href=\"config.php\" class=\"list-group-item\"><span class=\"glyphicon glyphicon-wrench\"></span> Configuraci&oacute;n</a>
          </div>
        </div><!--/span-->

        <div class=\"col-xs-12 col-sm-9\">
          <p class=\"pull-left visible-xs\">
            <button type=\"button\" class=\"btn btn-primary btn-xs\" data-toggle=\"offcanvas\">menu</button>
          </p>
    
	<div class=\"panel panel-default\">
	<br>";
echo $men;
echo	      "<!-- Nav tabs -->
	<ul class=\"nav nav-tabs\">
		<li >&nbsp;</li>
	  <li $class1 ><a href=\"#gestion_docente\" data-toggle=\"tab\">Listado Acudiente</a></li>
	  <li $class2 ><a href=\"#crear_docente\" data-toggle=\"tab\">Crear Acudiente</a></li>
	</ul>
	
	<!-- Tab panes -->

	<div class=\"tab-content\">
	<div class=\"tab-pane fade in $act2 \" id=\"crear_docente\">
		<form name='crear_doc' id='crear_doc' method='post' action='acudiente.php#crear_docente' target='' >
		<input type='hidden' name='val2' id='val2' value='".$val2."'>	

		<input type='hidden' name='acudiente2' id='acudiente2' value='".$acudiente2."'>	
		<input type='hidden' name='id_acud2' id='id_acud2' value='".$id_acud2."'>		
		<input type='hidden' name='exp_acud2' id='exp_acud2' value='".$exp_acud2."'>	
		<input type='hidden' name='dir_acud2' id='dir_acud2' value='".$dir_acud2."'>		
		<input type='hidden' name='tel_acud2' id='tel_acud2' value='".$tel_acud2."'>			
		<input type='hidden' name='correo_acud2' id='correo_acud2' value='".$correo_acud2."'>
		<input type='hidden' name='formacion_acud2' id='formacion_acud2' value='".$formacion_acud2."'>		
		<input type='hidden' name='empresa_acud2' id='empresa_acud2' value='".$empresa_acud2."'>		
		<input type='hidden' name='cargo_acud2' id='cargo_acud2' value='".$cargo_acud2."'>
		<input type='hidden' name='dir_emp_acud2' id='dir_emp_acud2' value='".$dir_emp_acud2."'>
		<input type='hidden' name='tel_emp_acud2' id='tel_emp_acud2' value='".$tel_emp_acud2."'>
		<input type='hidden' name='u_plataforma_acud2' id='u_plataforma_acud2' value='".$u_plataforma_acud2."'>
		<input type='hidden' name='c_plataforma_acud2' id='c_plataforma_acud2' value='".$c_plataforma_acud2."'>
					

		
		<div class=\"page\">
			<fieldset>
				<legend>
					<br><span class=\"glyphicon glyphicon-plus\"></span> Crear Nuevo Acudiente          
				</legend>			
			</fieldset>
		
		
		 	<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Nombre Acudiente&nbsp;
		  </div>
		 <div class='input' >
		    <input type='text' id='acudiente' name='acudiente' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px'>
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Identificaci&oacute;n&nbsp;
		  </div>
		 <div class='input' >
		    <input type='text' id='id_acud' name='id_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px'>
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Lugar Expedici&oacute;n&nbsp;
		  </div>
		 <div class='input' >
		    <input type='text' id='exp_acud' name='exp_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px'>
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Direcci&oacute;n&nbsp;
		  </div>
		 <div class='input' >
		    <input type='text' id='dir_acud' name='dir_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px'>
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Tel&eacute;fono&nbsp;
		  </div>
		 <div class='input' >
		    <input type='text' id='tel_acud' name='tel_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px'>
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Correo&nbsp;
		  </div>
		 <div class='input' >
		    <input required type='text' id='correo_acud' name='correo_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px' onblur='validarEmail(this.value)'>
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Form. Acad&eacute;mica&nbsp;
		  </div>
		 <div class='input' >
		    <input required type='text' id='formacion_acud' name='formacion_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px' >
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Empresa Labora&nbsp;
		  </div>
		 <div class='input' >
		    <input required type='text' id='empresa_acud' name='empresa_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px' >
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Cargo Laboral&nbsp;
		  </div>
		 <div class='input' >
		    <input required type='text' id='cargo_acud' name='cargo_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px' >
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Direcci&oacute;n Laboral&nbsp;
		  </div>
		 <div class='input' >
		    <input required type='text' id='dir_emp_acud' name='dir_emp_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px' >
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Tel&eacute;fono Lab.&nbsp;
		  </div>
		 <div class='input' >
		    <input required type='text' id='tel_emp_acud' name='tel_emp_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px' >
		 </div>
		
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Usuario Plataforma&nbsp;
		  </div>
		 <div class='input' >
		    <input required type='text' id='u_plataforma_acud' name='u_plataforma_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px' >
		 </div>
		<div class='input' style='float:left;width: 140px;padding-top: 5px;text-align: right;' >
			Clave&nbsp;
		  </div>
		 <div class='input' >
		    <input required type='text' id='c_plataforma_acud' name='c_plataforma_acud' class='form-control' placeholder='' style='width:48%;margin-bottom: 10px' >
		 </div>
		


		
		
		
		<fieldset>
		<legend>
					<br>
					
		</legend>	
			<button type='button' class='btn btn-info' onclick='crea_acudiente()'> Crear Acudiente</button>     
			<input type='reset' class='btn' value='Borrar'>
						
		</fieldset>
			
			<br>
		</div>
	</form>
</div>

<div class=\"tab-pane fade in $act1 \" id=\"gestion_docente\">
	<form name='gestion_doc' id='gestion_doc' method='post' action='acudiente.php' target='' >
	<div class=\"page\">
	

	<input type='hidden' name='val1' id='val1' value='".$val1."'>	
	<input type='hidden' name='cur1' id='cur1' value='".$cur1."'>	
	<input type='hidden' name='ide1' id='ide1' value='".$ide1."'>

	<input type='hidden' name='nombre1' id='nombre1' value='".$nombre1."'>					
	<input type='hidden' name='identi1' id='identi1' value='".$identi1."'>			
		<input type='hidden' name='eps1' id='eps1' value='".$eps1."'>
		<input type='hidden' name='pension1' id='pension1' value='".$pension1."'>			
		<input type='hidden' name='escalafon1' id='escalafon1' value='".$escalafon1."'>
		<input type='hidden' name='especialidad1' id='especialidad1' value='".$especialidad1."'>			
		<input type='hidden' name='obs1' id='obs1' value='".$obs1."'>
				
		<input type='hidden' name='nombre_docente1' id='nombre_docente1' value='".$nombre_docente1."'>	
		<input type='hidden' name='fecha_nacimiento1' id='fecha_nacimiento1' value='".$fecha_nacimiento1."'>
		<input type='hidden' name='sexo1' id='sexo1' value='".$sexo1."'>	
		<input type='hidden' name='grupo_sangre1' id='grupo_sangre1' value='".$grupo_sangre1."'>	


		<input type='hidden' name='direccion1' id='direccion1' value='".$direccion1."'>	
		<input type='hidden' name='telefono1' id='telefono1' value='".$telefono1."'>	
		<input type='hidden' name='correo1' id='correo1' value='".$correo1."'>
		<input type='hidden' name='usuario1' id='usuario1' value='".$usuario1."'>
		<input type='hidden' name='pass1' id='pass1' value='".$pass1."'>
	
	
		<input type='hidden' name='acudiente1' id='acudiente1' value='".$acudiente1."'>	
		<input type='hidden' name='id_acud1' id='id_acud1' value='".$id_acud1."'>		
		<input type='hidden' name='exp_acud1' id='exp_acud1' value='".$exp_acud1."'>	
		<input type='hidden' name='dir_acud1' id='dir_acud1' value='".$dir_acud1."'>		
		<input type='hidden' name='tel_acud1' id='tel_acud1' value='".$tel_acud1."'>			
		<input type='hidden' name='correo_acud1' id='correo_acud1' value='".$correo_acud1."'>
		<input type='hidden' name='formacion_acud1' id='formacion_acud1' value='".$formacion_acud1."'>		
		<input type='hidden' name='empresa_acud1' id='empresa_acud1' value='".$empresa_acud1."'>		
		<input type='hidden' name='cargo_acud1' id='cargo_acud1' value='".$cargo_acud1."'>
		<input type='hidden' name='dir_emp_acud1' id='dir_emp_acud1' value='".$dir_emp_acud1."'>
		<input type='hidden' name='tel_emp_acud1' id='tel_emp_acud1' value='".$tel_emp_acud1."'>
		<input type='hidden' name='u_plataforma_acud1' id='u_plataforma_acud1' value='".$u_plataforma_acud1."'>
		<input type='hidden' name='c_plataforma_acud1' id='c_plataforma_acud1' value='".$c_plataforma_acud1."'>
		<input type='hidden' name='identi' id='identi' value='".$identi."'>	
		<input type='hidden' name='estado1' id='estado1' value='".$estado1."'>		
	
		<fieldset>
			<legend>
			<br><span class=\"glyphicon glyphicon-th-list\"></span> Lista de Acudientes
			</legend>			
		</fieldset>
	</div>
	
	<fieldset>
	<div class='table-responsive'>
	<table id='acudientes_tabla' class='table table-striped table-bordered '>
		<thead>
			<tr role='row'>
				<th>Codigo</th>
				<th>Nombre</th>				
				<th>Estado</th>								
				<th>&nbsp;</th>				
			</tr>
		</thead>";
		
echo $tbody;
echo	"</table>
	</div>
	</fieldset>
	
	
	
	</form>

</div>
 
         
        </div><!--/span-->

       
      </div><!--/row-->


      </div><!--/row-->      </div><!--/row-->
      <hr>
      <footer>
        <p>Todos los derechos reservados - Copyright &copy; CDLE</p>
      </footer>

    </div><!--/.container-->

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src=\"https://code.jquery.com/jquery-1.10.2.min.js\"></script>
    <script src=\"dist/js/bootstrap.min.js\"></script>
    <script src=\"offcanvas.js\"></script>
<script src='js/tablesort.min.js'></script>
    <script>
      new Tablesort(document.getElementById('acudientes_tabla'));
    </script>
  </body>
</html>
";
}else{
echo "<div align='center'>Debe registrase para usar la aplicaci&oacute;n <a href='index.php' > Registrar</a></div>";
}
  ?>