<?
session_start();
require('../valtiempoinact.php');
 require('libFormato.php');
$fechaActual=date("Y-m-d");
require("../conectar.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script> 
$(document).ready(function(){ 
        $("#socios").click(function(evento){ 
                if ($("#socios").attr("checked")){ 
                        $("#capsocios").css("display", "block"); 
						$("#capasm").css("display", "none");
                } 
        }); 
       $("#asm").click(function(evento){ 
                if ($("#asm").attr("checked")){ 
                        $("#capsocios").css("display", "none"); 
						$("#capasm").css("display", "block"); 
                } 
        }); 
}); 
</script> 
		<style>	
                 .datos{border:0;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;-khtml-border-radius: 5px;border-collapse: collapse;background:#ffffff url(images/tlcancion.jpg) repeat-x;;color:#0d0d0d;font-family:arial;}
	.datos input{border:none;}
	.datos .btngr{padding:3px;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;-khtml-border-radius: 5px;}
	.datos .btngr:hover{background:#393B0B;-moz-box-shadow:inset 0 0 10px #000000;-webkit-box-shadow: inset 0 0 10px #000000;box-shadow: inset 0 0 10px #000000;}
    .datos a{color:#ffffff;font-weight:bold;} 
	.datos img{border:none}
    .datos .tdi{font-size:11px;}
    .datos .tdi b{color:#585858;}
	.datos .trs{min-height:15px !important;max-height:15px !important;height:15px !important;background:#ffffff;font-size:12px;}
	.datos .trs:hover{background:#01A9DB;color:#ffffff;}	
	.datos .trs:hover a{color:#ffffff;}	
	.datos .trs:hover .trssb{color:#FE9A2E;}	
	/*.datos .trs  td{border-left:1px solid #BDBDBD;}	*/
	.datos .trs2 .tdf{border-left:1px solid #BDBDBD;overflow:hidden;}	
	.datos .trs2{min-height:15px !important;max-height:15px !important;height:15px !important;background:#CEECF5;font-size:12px;}
	.datos .trs2:hover{background:#01A9DB;color:#ffffff;}	
	.datos .trs2:hover a{color:#ffffff;}	
	.datos .trs2:hover .trssb{color:#FE9A2E;}	
	/*.datos .trs2  td{border-left:1px solid #BDBDBD;}	*/
	.datos .trs2 .tdf{border-left:1px solid #BDBDBD;overflow:hidden;}	
	.datos .trss{min-height:30px !important;}	
	.datos .trss1{min-height:30px !important;max-height:30px !important;height:30px !important;background:url(images/tcancion.jpg);color:#ffffff;font-size:12px;}	
	.datos .trssb{min-height:15px !important;max-height:15px !important;height:15px !important;background:url(images/tcancion2.png);color:#ffffff;font-size:10px;padding-left:5px;padding-right:5px;}	
            .tabla{width:100%;background:#ffffff;border-collapse: collapse;font-family:arial;}
			.titulo{height:35px;max-height:35px !important;background:#ffffff url(images/tlcancion.jpg) repeat-x;color:#0d0d0d;font-size:15px;}
			.titulos{height:30px;background:url(images/tcancion.jpg) ;max-height:30px !important;color:#ffffff;font-size:12px;}
			.subtitulos{height:30px;background:url(images/tcancion.jpg) repeat-x;max-height:30px !important;color:#ffffff;font-size:10px;}
			.nombre{height:28px;color:#000000;text-align:center;font-size:12px;}
			.concepto{height:28px;background:url(images/tcancion.jpg) repeat-x;color:#ffffff;text-align:center;font-size:11px;}
			.inp{width:35px;text-align:right;font-size:10px;}
			.inpd{width:15px;text-align:right;font-size:10px;}
			.tdcal{background:#ffffff;font-size:11px;}
			.tdcali{background:#ffffff;font-size:11px;border-right:solid 1px #A9D0F5;}
			.tdcalm{background:#A9D0F5;font-size:11px;}
			.tdcal1p{background:#F9F263;font-size:11px;font-weight:bold;}
			.tdcali1p{background:#F9F263;font-size:11px;border-right:solid 1px #A9D0F5;}
			.tdcalm1p{background:#C6E06D;font-size:11px;font-weight:bold;text-align:left;}
			.act{display:block;overflow:hidden;width:100%;height:50px;background:#BEF781;font-family:arial;font-size:17px;font-weight:bold;color:#4B610B;text-align:center;border:solid 2px #4B610B;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;-khtml-border-radius: 5px; -Moz-box-shadow: 0px 5px 10px # 556B2F;-webkit-box-shadow: 0px 5px 10px #556B2F; box-shadow: 0px 5px 10px #556B2F;}
			.act p{position:relative;top:0px;}
			.act img{position:relative;width:40px;height:40px;top:-50px;left:250px;}
			h2{font-family:arial;font-size:16px;}
			.sinfor{text-decoration:none;}
			.tdlin{border-right:solid 1px #A4A4A4;}
			.tdlin2{border-right:solid 1px #ffffff;}
        </style>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function(){
  $("#accordion h3:first").addClass("active");
  $("#accordion div:not(:first)").hide();
  $("#accordion h3").click(function(){
    $(this).next("div").slideToggle("slow")
    .siblings("div:visible").slideUp("slow");
    $(this).toggleClass("active");
    $(this).siblings("h3").removeClass("active");
  });
});
//]]>
</script>
<style>
#demoacordeon {width:900px;}
#main-wrapper {margin:0;padding:0;}
.post p, .post div {margin:0;}
#accordion {width:900px;}
#accordion h3 {-moz-border-radius: 3px;-moz-box-shadow: 0 0 10px #444 inset;background-color: #DCDFF4;color: #6D76AF;cursor: pointer;font-family: Tahoma;font-size: 17px;font-weight: normal;height: 1.7em;line-height: 1.7em;margin: 0 0 2px;padding: 0 20px;position: relative;}
#accordion h3:hover {-moz-box-shadow: 0 0 10px #000 inset;background-color: #BBBFF4;color: #FFF;}
#accordion h3 span {background: transparent url(http://4.bp.blogspot.com/_hljKDuw-cxQ/TRGAe8HVtVI/AAAAAAAARWQ/zvuYXtF1o1c/s00/demoacordeonjs.gif) no-repeat right top;display: block;height: 16px;position: absolute;right: 20px;top: 7px;width: 16px;}
#accordion h3.active span {background-position: right bottom;}
#accordion div {font-family:arial;font-size:10px;line-height: 1.5;margin: 10px;padding: 10px;}
</style>
</head> 
<body>
<center>
</div>
<? 
$mesini=1;
$mesfin=date("m");
$aņo=date("Y");
switch($mesini)
      {
	   case 1:
	    $mi=1;
	   break;
	   case 2:
	    $mi=2;
	   break;
	   case 3:
	     $mi=3;
	   break;
	   case 4:
	     $mi=4;
	   break;
	   case 5:
	     $mi=5;
	   break;
	   case 6:
	     $mi=6;
	   break;
	   case 7:
	     $mi=7;
	   break;
	   case 8:
	     $mi=8;
	   break;
	   case 9:
	     $mi=9;
	   break;
	   case 10:
	     $mi=10;
	   break;
	   case 11:
	     $mi=11;
	   break;
	   case 12:
	     $mi=12;
	   break;
	   default: echo"error 2";
	  }
	 /////mesfin
	 
	 switch($mesfin)
      {
	   case 1:
	    $mf=1;
	   break;
	   case 2:
	    $mf=2;
	   break;
	   case 3:
	     $mf=3;
	   break;
	   case 4:
	     $mf=4;
	   break;
	   case 5:
	     $mf=5;
	   break;
	   case 6:
	     $mf=6;
	   break;
	   case 7:
	     $mf=7;
	   break;
	   case 8:
	     $mf=8;
	   break;
	   case 9:
	     $mf=9;
	   break;
	   case 10:
	     $mf=10;
	   break;
	   case 11:
	     $mf=11;
	   break;
	   case 12:
	     $mf=12;
	   break;
	   default: echo"error 1";
	  }
	  $n=($mf-$mi)+1;
	  $mi2=$mi;
	  $tn=$n*4;
	  $tn=$tn+3;
	  ?>  
	  <div id="accordion">
    <h3>EXPEDIENTES DE EMPLEADOS ACTIVOS<span></span></h3>
	<div style="display: none;">
	  <center>	   
	<table class="tabla" border="1">
		
		<tr class="titulos">
		  <td align="center"><b>SOCIO</b></td>
		  <!--<td align='center'><b>CARATULA</b></td>-->
		  <td align='center'><b>IDENTIFICACION</b></td>
		  <td align='center'><b>ACTA DE NACIMIENTO</b></td>
		  <td align='center'><b>COMP. ESTUDIOS</b></td>
		  <td align='center'><b>COMP. DOMICILIO</b></td>
		  <td align='center'><b>CURP</b></td>
		  <td align='center'><b>RFC</b></td>		  
		  <td align='center'><b>CONT. BANCARIO</b></td>
		  <td align='center'><b>SOLICITUD O CURRICULUM</b></td>
		  <td align='center'><b>CONTRATO(S)</b></td>
		  <td align='center'><b>OBSERVACION</b></td>
		</tr>
<?		$nom="select nombre, a_pat, a_mat, id_empleado
		   from empleados as em where fechabaja='0000-00-00' and id_empleado<>'11'  and id_empleado<>'53'and id_empleado<>'54' and id_empleado<>'61' order by nombre";
		  $ejenom=mysql_query($nom);
	      while($dat=mysql_fetch_array($ejenom))
		  {	
		  $datos=0;
		  $exp="SELECT ex.IdEmpleado,ex.caratula,ex.ife,ex.rfc,ex.ContratoBan,ex.ComEstudios,ex.ComDomicilio,ex.contrato,ex.curp,ex.actanac,ex.sol_curri,ex.observaciones from expedientes as ex where ex.IdEmpleado='$dat[id_empleado]'";
		  $expe=mysql_query($exp);
		  $datos=mysql_fetch_array($expe);
			
		   if($datos['caratula']!=""){
			  $caratula="<a href='$datos[caratula]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $caratula="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['ife']!=""){
			  $ife="<a href='$datos[ife]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $ife="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['rfc']!=""){
			  $rfc="<a href='$datos[rfc]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $rfc="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['ContratoBan']!=""){
			  $ContratoBan="<a href='$datos[ContratoBan]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $ContratoBan="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['ComEstudios']!=""){
			  $ComEstudios="<a href='$datos[ComEstudios]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $ComEstudios="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['ComDomicilio']!=""){
			  $ComDomicilio="<a href='$datos[ComDomicilio]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $ComDomicilio="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['contrato']!=""){
			  $contrato="<a href='$datos[contrato]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $contrato="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }		
			if($datos['curp']!=""){
			  $curp="<a href='$datos[curp]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $curp="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }	
			if($datos['actanac']!=""){
			  $actanac="<a href='$datos[actanac]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $actanac="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }	
			if($datos['sol_curri']!=""){
			  $sol_curri="<a href='$datos[sol_curri]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $sol_curri="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }					   
				   
	
		?>
		
		<tr>		
		  <td align="left"><a href="#" onclick="window.open('caratulaE.php?id=<?echo $datos['id_empleado']?>','','toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0,width=1170,height=550');" class="sinfor" style="color:#000000;"><?echo htmlentities($dat['nombre'])." ".htmlentities($dat['a_pat'])." ".htmlentities($dat['a_mat']);?></a></td>
		  <!--<td class="tdcalm1p"><center><?echo $caratula; ?></center></td>-->
			 <td class="tdcalm1p"><center><?echo $ife; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $actanac; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $ComEstudios; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $ComDomicilio; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $curp; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $rfc; ?></center></td> 
			 <td class="tdcalm1p"><center><?echo $ContratoBan; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $sol_curri; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $contrato; ?></center></td>
			 <td class="tdcalm1p"><center><?echo htmlentities($datos['observaciones']); ?></center></td>
		</tr>
		<? } ?>
	</table>
</center>
	</div>
	

    <h3>EXPEDIENTES DE EMPLEADOS DADOS DE BAJA<span></span></h3>
	<div style="display: none;">
	  <center>	   
	<table class="tabla" border="1">
		
		<tr class="titulos">
		  <td align="center"><b>SOCIO</b></td>
		  <!--<td align='center'><b>CARATULA</b></td>-->
		  <td align='center'><b>IDENTIFICACION</b></td>
		  <td align='center'><b>ACTA DE NACIMIENTO</b></td>
		  <td align='center'><b>COMP. ESTUDIOS</b></td>
		  <td align='center'><b>COMP. DOMICILIO</b></td>
		  <td align='center'><b>CURP</b></td>
		  <td align='center'><b>RFC</b></td>
		  <td align='center'><b>CONT. BANCARIO</b></td>
		  <td align='center'><b>SOLICITUD O CURRICULUM</b></td>
		  <td align='center'><b>CONTRATO(S)</b></td>
		  <td align='center'><b>CARTA FINIQUITO</b></td>
		  <td align='center'><b>OBSERVACION</b></td>
		 
		</tr>
<?		$nom="select nombre,a_pat,a_mat,id_empleado 
		   from empleados  where fechabaja<>'0000-00-00'  order by nombre";
		  $ejenom=mysql_query($nom);
	      while($dat=mysql_fetch_array($ejenom)){	
		  $datos=0;
		  $exp="SELECT ex.IdEmpleado,ex.caratula,ex.ife,ex.rfc,ex.ContratoBan,ex.ComEstudios,ex.ComDomicilio,ex.contrato,ex.curp,ex.actanac,ex.sol_curri,ex.observaciones,ex.cartafini from expedientes as ex where ex.IdEmpleado='$dat[id_empleado]'";
		  $expe=mysql_query($exp);
		  $datos=mysql_fetch_array($expe);
		 		   if($datos['caratula']!=""){
			  $caratula="<a href='$datos[caratula]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $caratula="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['ife']!=""){
			  $ife="<a href='$datos[ife]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $ife="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['rfc']!=""){
			  $rfc="<a href='$datos[rfc]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $rfc="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['ContratoBan']!=""){
			  $ContratoBan="<a href='$datos[ContratoBan]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $ContratoBan="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['ComEstudios']!=""){
			  $ComEstudios="<a href='$datos[ComEstudios]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $ComEstudios="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['ComDomicilio']!=""){
			  $ComDomicilio="<a href='$datos[ComDomicilio]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $ComDomicilio="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		   if($datos['contrato']!=""){
			  $contrato="<a href='$datos[contrato]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $contrato="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }		
			if($datos['curp']!=""){
			  $curp="<a href='$datos[curp]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $curp="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }	
			if($datos['actanac']!=""){
			  $actanac="<a href='$datos[actanac]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $actanac="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }	
			if($datos['sol_curri']!=""){
			  $sol_curri="<a href='$datos[sol_curri]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $sol_curri="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }				   
				   if($datos['cartafini']!=""){
			  $cartafini="<a href='$datos[cartafini]' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
			  }else{
			        $cartafini="<img src='img/nook.png' width='15' height='15' border='0'>";
				   }
		
		?>
		<tr>		
		  <td align="left"><a href="#" onclick="window.open('caratulaE.php?id=<?echo $datos['id_empleado']?>','','toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0,width=1170,height=550');" class="sinfor" style="color:#000000;"><?echo htmlentities($dat['nombre'])." ".htmlentities($dat['a_pat'])." ".htmlentities($dat['a_mat']);?></a></td>
		  <!--<td class="tdcalm1p"><center><?echo $caratula; ?></center></td>-->
			 <td class="tdcalm1p"><center><?echo $ife; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $actanac; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $ComEstudios; ?></center></td>
			  <td class="tdcalm1p"><center><?echo $ComDomicilio; ?></center></td>
			  <td class="tdcalm1p"><center><?echo $curp; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $rfc; ?></center></td>			
			 <td class="tdcalm1p"><center><?echo $ContratoBan; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $sol_curri; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $contrato; ?></center></td>
			 <td class="tdcalm1p"><center><?echo $cartafini; ?></center></td>
			 <td class="tdcalm1p"><center><?echo  htmlentities($datos['observaciones']); ?></center></td>
			
		</tr> 
		<? } ?>
	</table>
</div>	
	<h3>ASAMBLEAS<span></span></h3>
	<div style="text-align:center;">
	 <table align="center" class="datos" border="2">
	 <tr>
	     <td align="center" colspan="<?echo $tn?>"><b>ASAMBLEAS <?echo $aņo;?></b></td>
	 </tr>
	 <tr class="trss1">
	     <td align="center"><b>SOCIEDAD</b></td>
		 <?
	for($i=1;$i<=$n;$i++)
      { 
	  switch($mi)
	  {
	  case 1:
	  $me="ENERO";
	  $meg="ENE";
	  ?>
	  <td colspan="5" align="center"><b>Enero</b></td>
      <?
	  break;
	  case 2:
	  $me="FEBRERO";
	  $meg="FEB";
	  ?>
	  <td colspan="4" align="center"><b>Febrero</b></td>
      <?
	  break;
	  case 3:
	  $me="MARZO";
	  $meg="MAR";
	  ?>
	  <td colspan="4" align="center"><b>Marzo</b></td>
      <?
	  break;
	  case 4:
	  $me="ABRIL";
	  $meg="ABR";
	  ?>
	  <td colspan="4" align="center"><b>Abril</b></td>
      <?
	  break;
	  case 5:
	  $me="MAYO";
	  $meg="MAY";
	  ?>
	  <td  colspan="4" align="center"><b>Mayo</b></td>
      <?
	  break;
	  case 6:
	  $me="JUNIO";
	  $meg="JUN";
	  ?>
	  <td colspan="4" align="center"><b>Junio</b></td>
      <?
	  break;
	  case 7:
	  $me="JULIO";
	  $meg="JUL";
	  ?>
	  <td colspan="4" align="center"><b>Julio</b></td>
      <?
	  break;
	  case 8:
	  $me="AGOSTO";
	  $meg="AGO";
	  ?>
	  <td colspan="4" align="center"><b>Agosto</b></td>
      <?
	  break;
	  case 9:
	  $me="SEPTIEMBRE";
	  $meg="SEP";
	  ?>
	  <td colspan="4" align="center"><b>Septiembre</b></td>
      <?
	  break;
	  case 10:
	  $me="OCTUBE";
	  $meg="OCT";
	  ?>
	  <td colspan="4" align="center"><b>Octubre</b></td>
      <?
	  break;
	  case 11:
	  $me="NOVIEMBRE";
	  $meg="NOV";
	  ?>
	  <td colspan="4" align="center"><b>Noviembre</b></td>
      <?
	  break;
	  case 12:
	  $me="DICIEMBRE";
	  $meg="DIC";
	  ?>
	  <td  colspan="4" align="center"><b>Diciembre</b></td>
      <?
	  break;
	  }
	  $mi=$mi+1;
	  }
	  $mi=$mi2;
	  ?>
     </tr>	
     <tr class="trssb">
	      <td colspan="2" align="center"></td>
	   <?
		 for($i=1;$i<=$n;$i++)
          { 
	  ?>
	      <td colspan="2" align="center">1er per</td>
		  <td colspan="2" align="center" class="tdlin2">2o per</td>
      <?		  
	      }
	  ?>
     </tr>	
     <tr class="trs">
      <td colspan="2">ACABANDO METAS PROFESIONALES S.C</td>
	  <?
	$sql="select id_empleado from empleados where usuario='JESUS'";
    $con=mysql_query($sql);	
    while($res=mysql_fetch_array($con))
     {
for($i=1;$i<=$n;$i++)
   { 
	switch($i)
	  {
	  case 1:
	  $me="ENERO";
	  $fi=$aņo."-01-03";
	  $fin=$aņo."-01-17";
	  $fi2=$aņo."-01-18";
	  $fin2=$aņo."-02-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 2:
	  $me="FEBRERO";
	  $fi=$aņo."-02-03";
	  $fin=$aņo."-02-17";
	  $fi2=$aņo."-02-18";
	  $fin2=$aņo."-03-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 3:
	  $me="MARZO";
	  $fi=$aņo."-03-03";
	  $fin=$aņo."-03-17";
	  $fi2=$aņo."-03-18";
	  $fin2=$aņo."-04-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 4:
	  $me="ABRIL";
	  $fi=$aņo."-04-03";
	  $fin=$aņo."-04-17";
	  $fi2=$aņo."-04-18";
	  $fin2=$aņo."-05-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 5:
	  $me="MAYO";
	  $fi=$aņo."-05-03";
	  $fin=$aņo."-05-17";
	  $fi2=$aņo."-05-18";
	  $fin2=$aņo."-06-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 6:
	  $me="JUNIO";
	  $fi=$aņo."-06-03";
	  $fin=$aņo."-06-17";
	  $fi2=$aņo."-06-18";
	  $fin2=$aņo."-07-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 7:
	  $me="JULIO";
	  $fi=$aņo."-07-03";
	  $fin=$aņo."-07-17";
	  $fi2=$aņo."-07-18";
	  $fin2=$aņo."-08-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 8:
	  $me="AGOSTO";
	  $fi=$aņo."-08-03";
	  $fin=$aņo."-08-17";
	  $fi2=$aņo."-08-18";
	  $fin2=$aņo."-09-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 9:
	  $me="SEPTIEMBRE";
	  $fi=$aņo."-09-03";
	  $fin=$aņo."-09-17";
	  $fi2=$aņo."-09-18";
	  $fin2=$aņo."-10-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 10:
	  $me="OCTUBRE";
	  $fi=$aņo."-10-03";
	  $fin=$aņo."-10-17";
	  $fi2=$aņo."-10-18";
	  $fin2=$aņo."-11-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 11:
	  $me="NOVIEMBRE";
	  $fi=$aņo."-11-03";
	  $fin=$aņo."-11-17";
	  $fi2=$aņo."-11-18";
	  $fin2=$aņo."-12-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  case 12:
	  $me="DICIEMBRE";
	  $fi=$aņo."-12-03";
	  $fin=$aņo."-12-17";
	  $fi2=$aņo."-12-18";
	  $fin2=$aņosig."-01-02";
	  $fecha5d=$fin;
      $fecha5d2=$fin2;	  
	  $dias= 3;
	  $f5d=date("Y-m-d", strtotime("$fecha5d +$dias day"));
	  $f5d2=date("Y-m-d", strtotime("$fecha5d2 +$dias day"));
	  break;
	  }
	  $fechai=$fi;//fecha inicial 1er periodo
	  $fechaf1=$fin;
	  $asm1="SELECT * FROM asambleas WHERE fasm between '$fechai' AND '$fechaf1'";
	  $ejeasm1=mysql_query($asm1);
	  $regasm1=mysql_fetch_array($ejeasm1);
	  $ruta=$regasm1['asamblea'];
	  if($regasm1['asamblea']==""){
	      $asamblea1="<img src='img/nook.png' width='15' height='15'>";
		  }
	  if($regasm1['freg'] >= $fechai && $regasm1['freg'] <= $f5d){  
		  $asamblea1="<a href='$ruta' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
	      }
	  if($regasm1['freg'] > $f5d){  
		  $asamblea1="<a href='$ruta' target='_blank'><img src='img/atencion.png' width='15' height='15' border='0'></a>";
	      }
		  
	  $asm2="SELECT * FROM asambleas WHERE fasm between '$fi2' AND '$fin2'";
	  $ejeasm2=mysql_query($asm2);
	  $regasm2=mysql_fetch_array($ejeasm2);
	  $ruta2=$regasm2['asamblea'];
	  	  if($regasm2['asamblea']==""){
	      $asamblea2="<img src='img/nook.png' width='15' height='15'>";
		  }
	  if($regasm2['freg'] >= $fi2 && $regasm1['freg'] <= $f5d2){  
		  $asamblea2="<a href='$ruta2' target='_blank'><img src='img/ok.png' width='15' height='15' border='0'></a>";
	      }
	  if($regasm2['freg'] > $f5d2){  
		  $asamblea2="<a href='$ruta2' target='_blank'><img src='img/atencion.png' width='15' height='15' border='0'></a>";
	      }
	  ?>
	    <td colspan="2" align="center"><?echo $asamblea1; ?></td>
		<td colspan="2" align="center" class="tdlin"><?echo $asamblea2; ?></td>
	  <?
	}
	}
	  ?>
	 </tr>
</table>
</center>
</body> 
</html> 