<?php session_start();?>
<?php include('php_gene1.php'); ?>
<?php include('../cfg/config.php');?>
<?php include('php_session.php');?>
<?php //include('excel_reader2.php');?>
<?php //include('vrreadxls.php');?>
<?php include('simplexlsx.class.php');?>
<?php $docu=$_POST['docu']; ?>
<?php $anio=$_POST['anio']; ?>
<?php $mes=$_POST['mes']; ?>
<?php $modif=$_POST['modif']; ?>
<?php

$jworgs='http://wol.jw.org';
$jworgl=$jworgs.'/es/wol/dt/r4/lp-s/';
// echo $jworgl;


$cong_sql='select * from cong0 where cong_codigo="'.$_SESSION['cong_codigo'].'"';
$cong_res=msql_query($cong_sql,$link_vcrx);
$salas = msql_result($cong_res,0,'cong_sala');


// $jwib_sql='select * from user0 where user_codigo="'.$_SESSION['user_codigo'].'"';
// $jwib_res=msql_query($jwib_sql,$link_vcrx);

$jwib_sql='select *, user_vida +user_mmae +user_estu +user_dpub +user_vari +user_asem as modifica ';
$jwib_sql.='from user0 where user_codigo="'.$_SESSION['user_codigo'].'"';
$jwib_res=msql_query($jwib_sql,$link_vcrx);

$modifica= msql_result($jwib_res,0,'modifica');

$full=false;
$invi=false;

// echo '****'.$modif;

if($modif=='1') 
{
$acce=msql_result($jwib_res,0,'user_acce');
$vida=msql_result($jwib_res,0,'user_vida');
$mmae=msql_result($jwib_res,0,'user_mmae');
$dpub=msql_result($jwib_res,0,'user_dpub');
$estu=msql_result($jwib_res,0,'user_estu');
$asem=msql_result($jwib_res,0,'user_asem');
$vari=msql_result($jwib_res,0,'user_vari');

if(mb_stristr('sist.admi',$_SESSION['user_tipo'])){$full=true;}

if(mb_stristr('invi',$_SESSION['user_tipo'])){$invi=true;}

}

if($modifica>0 and $anio=='' and $modif=='') {$bmodif=true;}

$semaa=date('W',strtotime('now'));
$fechaa=date('Y-m-d');
$prdoa=date('Ym');

$fecha2=strtotime ('last Monday');
if($modif=='1')
{$fecha2=strtotime ('last Monday -56 days');}
$fecha2=date('Y-m-d',$fecha2);

$fecha=date('Y-m-01');
$printer=false;

if($fecha2>$fecha){$fecha2=$fecha;}

$ipip=$_SERVER['REMOTE_ADDR'];
$ipip_sql='insert into ipip0(ipip_codigo)value("'.$ipip.'")';
$ipip_res=msql_query($ipip_sql,$link_vcrx);
$ipip_sql='update ipip0 set ';
$ipip_sql.='ipip_descri="'.$_SERVER['REMOTE_PORT'].'",';
$ipip_sql.='ipip_idate=now(),';
$ipip_sql.='ipip_status=ipip_status ';
$ipip_sql.='where ipip_codigo="'.$ipip.'"';
$ipip_res=msql_query($ipip_sql,$link_vcrx);

if($docu=='DPU2')
{
	$jwib_sql='update jwib1, cong0 set fechar=adddate(fecha,5) where cong=cong_codigo and docu="DPU2" and fecha>="'.$fecha.'"';
	$jwib_res=msql_query($jwib_sql,$link_vcrx);

	$jwib_sql='update jwib1, cong0 set fechar=adddate(fecha,6) where cong=cong_codigo and docu="DPU2" and fecha>="'.$fecha.'" and (left(cong2_dpud,1)="7" or left(cong2_dpud,1)="D")';
	$jwib_res=msql_query($jwib_sql,$link_vcrx);
}

if(mb_stristr('DPU1.DPU2',$docu))
{
	$jwib_sql='select * from jwib11 where docu="'.$docu.'" and cong="'.$cong_codigo.'" ';
// 	if($invi or $dpub==0){$jwib_sql.=' and bsqj!="" ';}	
	if($dpub==0){$jwib_sql.=' and bsqj!="" ';}	
	if($anio!='')
	{	
	$jwib_sql.=' and fanior="'.$anio.'"';
	$jwib_sql.=' and fmesr="'.$mes.'"';
	$printer=true;
	}
	else
	{$jwib_sql.=' and fechar>="'.$fecha2.'" ';}
	
	
	if($docu=='DPU1')
	{$jwib_sql.=' order by fecha ';}

	if($docu=='DPU2')
	{$jwib_sql.=' order by fanior,fmesr,cong2_descri,fecha ';}
}

if($docu=='ESTU')
{
	$jwib_sql='select *, ';
	$jwib_sql.='max(case when docu="ELIB" then idnum1 end) as idn_lib,';
	$jwib_sql.='max(case when docu="ELIB" then nombre1 end) as nom1_lib,';
	$jwib_sql.='max(case when docu="ELIB" then nombre2 end) as nom2_lib,';
	$jwib_sql.='max(case when docu="ELIB" then fechar end) as fecha_lib,';
	$jwib_sql.='max(case when docu="ELIB" then concat(fdianr," /",fdiar) end) as fec_lib,';
	$jwib_sql.='max(case when docu="EATA" then idnum1 end) as idn_ata,';
	$jwib_sql.='max(case when docu="EATA" then nombre1 end) as nom1_ata,';
	$jwib_sql.='max(case when docu="EATA" then nombre2 end) as nom2_ata,';
	$jwib_sql.='max(case when docu="EATA" then fechar end) as fecha_ata,';
	$jwib_sql.='max(case when docu="EATA" then concat(fdianr," /",fdiar) end) as fec_ata,';
	$jwib_sql.='status as st1 ';
	$jwib_sql.=' from jwib11 where docu in ("ELIB","EATA") and cong="'.$cong_codigo.'" ';

	if($anio!='')
	{	
	$jwib_sql.=' and fanior="'.$anio.'"';
	$jwib_sql.=' and fmesr="'.$mes.'"';
	$printer=true;
	}
	else
	{$jwib_sql.=' and fechar>="'.$fecha2.'" ';}
	
	if($iniv or $estu==0){$jwib_sql.=' and nombre1>"" ';}	
	$jwib_sql.=' group by fanio,fsema ';
	$jwib_sql.=' order by fecha,fechar ';
// 	echo $jwib_sql;
}

if($docu=='VIDA')
{
	$jwib_sql='select *, ';
	$jwib_sql.='max(case when docu="VM11" then idnum1 end) as idn_vmc,';
	$jwib_sql.='max(case when docu="VM11" then nombre1 end) as nom1vmc,';
	$jwib_sql.='max(case when docu="VM11" then nombre2 end) as nom2vmc,';
	$jwib_sql.='max(case when docu="VM21" then idnum1 end) as idn_tdb,';
	$jwib_sql.='max(case when docu="VM21" then nombre1 end) as nom1tdb,';
	$jwib_sql.='max(case when docu="VM21" then nombre2 end) as nom2tdb,';
	$jwib_sql.='max(case when docu="VM41" then idnum1 end) as idn_nvc,';
	$jwib_sql.='max(case when docu="VM41" then nombre1 end) as nom1nvc,';
	$jwib_sql.='max(case when docu="VM41" then nombre2 end) as nom2nvc,';
	$jwib_sql.='status as st1 ';
	$jwib_sql.=' from jwib11 where docu like "VM%" and cong="'.$cong_codigo.'" ';
	
	if($anio!='')
	{	
	$jwib_sql.=' and fanior="'.$anio.'"';
	$jwib_sql.=' and fmesr="'.$mes.'"';
	$printer=true;
	}
	else
	{$jwib_sql.=' and fechar>="'.$fecha2.'" ';}
	
	if($invi or $vida==0){$jwib_sql.=' and nombre1>"" ';}	
	$jwib_sql.=' group by fanio,fsema ';
	$jwib_sql.=' order by fecha,fechar ';
// 	echo $jwib_sql;
}

if($docu=='MMAE')
{
	$jwib_sql='select *, ';
	$jwib_sql.='max(case when sala=0 then idnum1 end) as idn_sala0,';
	$jwib_sql.='max(case when sala=0 then nombre1 end) as nom1sala0,';
	$jwib_sql.='max(case when sala=0 then nombre2 end) as nom2sala0,';
	
	$jwib_sql.='max(case when sala=1 then idnum1 end) as idn_sala1,';
	$jwib_sql.='max(case when sala=1 then nombre1 end) as nom1sala1,';
	$jwib_sql.='max(case when sala=1 then nombre2 end) as nom2sala1,';
	
	$jwib_sql.='max(case when sala=2 then idnum1 end) as idn_sala2,';
	$jwib_sql.='max(case when sala=2 then nombre1 end) as nom1sala2,';
	$jwib_sql.='max(case when sala=2 then nombre2 end) as nom2sala2,';
	
	$jwib_sql.='max(case when sala=3 then idnum1 end) as idn_sala3,';
	$jwib_sql.='max(case when sala=3 then nombre1 end) as nom1sala3,';
	$jwib_sql.='max(case when sala=3 then nombre2 end) as nom2sala3,';
	
	$jwib_sql.='status as st1 ';
	$jwib_sql.=' from jwib11 where docu like "VM3%" and cong="'.$cong_codigo.'" ';
	
	if($anio!='')
	{	
	$jwib_sql.=' and fanior="'.$anio.'"';
	$jwib_sql.=' and fmesr="'.$mes.'"';
	$printer=true;
	}
	else
	{$jwib_sql.=' and fechar>="'.$fecha2.'"';}
// 	{$jwib_sql.=' and fechar>=date(now()) ';}
// 	{$jwib_sql.=' and fechar>="'.$fecha2.'" ';}
	
	if($invi or $mmae==0){$jwib_sql.=' and nombre1>"" ';}	
	
 	if($mobile!='true' and !$printer)
	{	
	}
	$jwib_sql.=' group by fanio,fsema,docu';
	$jwib_sql.=' order by fecha,fechar,docu,sala ';
	
 	if($mobile=='true' and !$printer)
	{
// 	$jwib_sql.=' order by fecha,fechar,sala,docu ';
// 	$jwib_sql=str_replace('max(','(',$jwib_sql);
	}
	
// 	echo $jwib_sql;
}

if(mb_stristr('VARI',$docu))
{
	$jwib_sql='select * from jwiv11 where docu="'.$docu.'" and cong="'.$cong_codigo.'" ';
	if($anio!='')
	{	
	$printer=true;
	}
// 	$jwib_sql.=' order by fanio desc,fmes desc, fecha ';
	$jwib_sql.=' order by fecha desc';
}


?>

<?php
if($docu=='ASEM')
{
	$jwib_sql='select *, ';
	
	for($cas10=11; $cas10<=19; $cas10++)
	{
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then idnum1 end) as idn_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then docu end) as docuc_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then docu_descri end) as docud_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then nombre1 end) as nom1_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then nombre2 end) as nom2_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then fechar end) as fecha_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then concat(fdianr," /",fdiar) end) as fec_'.$cas10.',';
	}

// 	$jwib_sql.='case when fecha2 is not null then upper(date_format(fecha2,"%a - %d/%b")) end as fecha2dm,';
	$jwib_sql.='case when fecha2 is not null then upper(date_format(fecha2,"%a/%d")) end as fecha2dm,';
// 		$calfec.='case when fecha is not null then date_format(fecha,"%Y-%m-%d") end as fechaymd,';
// 		$calfec.='date_format(fecha,"%Y") as fanio,';
// 		$calfec.='date_format(fecha,"%m") as fmes,';
// 		$calfec.='date_format(fecha,"%d") as fdia,';
// 		$calfec.='upper(date_format(fecha,"%b")) as fmesn,';
// 		$calfec.='upper(date_format(fecha,"%a")) as fdian,';
// 		$calfec.='date_format(fecha,"%v") as fsema, ';
// 		$calfec.='date_format(fecha,"%j") as fdoy, ';
	
	
	
	$jwib_sql.='status as st1 ';
	$jwib_sql.='from jwib11 where left(docu,2)="AS" and cong="'.$cong_codigo.'" ';

	if($anio!='')
	{	
	$jwib_sql.=' and fanior="'.$anio.'"';
	$jwib_sql.=' and fmesr="'.$mes.'"';
	$printer=true;
	}
	else
	{$jwib_sql.=' and fechar>="'.$fecha2.'" ';}
	
	if($iniv or $asem==0){$jwib_sql.=' and nombre1>"" ';}	
	$jwib_sql.=' group by fanio,fsema ';
	$jwib_sql.=' order by fecha,fechar ';
// 	echo $jwib_sql;
}

?>


<?php
//$ponclick="jwib_rpu1('".$docu."','".$jwib_aso['fanior']."','".''.$jwib_aso['fmesr']."')";
?>
<div id="tabla">
	
<?php if(mb_stristr('DPU1.DPU2',$docu)) { ?>
		<?php if($mobile=='false' and !$printer) {?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; include('vrbutton.php');?>
									<?php } ?>
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;">
			<?php $lmes=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="height:30px;border-top:solid 2px;border-bottom:solid 1px;background: #A9F5F2;">
									<th align="center" style="">
					<?php if($jwib_aso['fanior'].$jwib_aso['fmesr']>=$prdoa){  ?>
					<a name="scroll"></a>
					<div id="scrollhere" ></div>
					<?php } ?>
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
									<th>No.</th>
									<th>BOSQUEJO</th>
									<th>TEMA</th>
									<th>
										DISCURSANTES
										<br>
									<?php if($docu=='DPU1'){echo ' VIENEN DE : '.$jwib_aso['cong2_descri'];} ?>								
									<?php if($docu=='DPU2'){echo ' VAN A : '.$jwib_aso['cong2_descri'];} ?>								
									</th>

									<?php if(($full or $dpub==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
											<?php $pcaption='Congregacion'; $pidtxt='cong2'.$jwib_aso['idnum1']; $pobj=2; $pdefa=$jwib_aso['cong2_descri']; $plong=20; $pdocu=$docu; $pcolu='cong2_descri'; include('vrgettxt.php'); ?>
											<?php if($docu=='DPU2'){?>
											<?php $pcaption='Dia'; $pidtxt='dpud'.$jwib_aso['idnum1']; $pobj=2; $pdefa=$jwib_aso['cong2_dpud']; $plong=3; $pdocu=$docu; $pcolu='cong2_dpud'; include('vrgettxt.php'); ?>
											<?php $pcaption='Hora'; $pidtxt='dpuh'.$jwib_aso['idnum1']; $pobj=2; $pdefa=$jwib_aso['cong2_dpuh']; $plong=5; $pdocu=$docu; $pcolu='cong2_dpuh'; include('vrgettxt.php'); ?>
											<?php } ?>
											<th>
											<?php 
													$pcaption="Imprimir"; $pidtxt='imprimir'.$jwib_aso['idnum1']; 
													$ponclick="jwib_rpu1('".$docu."','".$jwib_aso['fanior']."','".$jwib_aso['fmesr']."')";
													include('vrbutton.php');
											?>
											<?php 
													$pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idnum1']; 
													$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idnum1']."','".$docu."','nom1".$jwib_aso['idnum1']."','','bsqj".$jwib_aso['idnum1']."','cong2".$jwib_aso['idnum1']."','dpud".$jwib_aso['idnum1']."','dpuh".$jwib_aso['idnum1']."')";
													include('vrbutton.php');
											?>
											</th>
									<?php }else{ ?>
											<th>
											<?php 
													$pcaption="Imprimir"; $pidtxt='imprimir'.$jwib_aso['idnum1']; 
													$ponclick="jwib_rpu1('".$docu."','".$jwib_aso['fanior']."','".$jwib_aso['fmesr']."')";
													include('vrbutton.php');
											?>
												
											</th>
									<th></th>
									<?php } ?>
								</tr>
							<?php if($docu=='DPU2'){ ?>
									<tr>
										<td>
										<?php //echo $jwib_aso['cong2_descri']; ?>
										</td>
									</tr>
							<?php } ?>
					<?php } ?>
		<!--   <tr> -->
			<tr style="<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4){echo 'font-weight:bold;';}?>" >

				<td align="center">
					<?php echo $jwib_aso['fdianr'].' /'.$jwib_aso['fdiar']; ?>
				</td>
				<td align="center">
					<?php echo ($jwib_aso['bsqj']); ?>
				</td>
				<td>
					<?php echo ($jwib_aso['bsqj_descri']); ?>
				</td>
				<td>
					<?php echo $jwib_aso['bsqj_tema']; ?>
				</td>
				<td>
					<?php if(($full or $dpub==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
					<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idnum1']; $pobj=1; $pdefa=$jwib_aso['nombre1']; $plong=20; $pdocu=$docu; $pcolu='nombre1'; include('vrgettxt.php'); ?>
					<?php $ptabla='bsqj'; $pidtxt='bsqj'.$jwib_aso['idnum1']; $pobj=5; $pdefa=$jwib_aso['bsqj']; $pdisab='0'; include('vrgetcod.php'); ?>
					<?php }else{ ?>
					<?php echo ($jwib_aso['nombre1']); ?>
					<?php } ?>
				</td>
				<td>
					<?php if(($full or $dpub==1)  and $jwib_aso['fechar']>=date('Y-m-d')) {?>
					<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idnum1']; 
							$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idnum1']."','".$docu."','nom1".$jwib_aso['idnum1']."','','bsqj".$jwib_aso['idnum1']."')";
						 include('vrbutton.php'); ?>
					<?php } ?>
				</td>
			</tr>

			<?php }  ?>
		</table>  
		<?php } ?>


		<?php if($mobile=='true' and !$printer) {?>
		<?php //if($mobile and !$printer) {?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; $psize=30;include('vrbu<?php session_start();?>
<?php include('php_gene1.php'); ?>
<?php include('../cfg/config.php');?>
<?php include('php_session.php');?>
<?php //include('excel_reader2.php');?>
<?php //include('vrreadxls.php');?>
<?php include('simplexlsx.class.php');?>
<?php $docu=$_POST['docu']; ?>
<?php $anio=$_POST['anio']; ?>
<?php $mes=$_POST['mes']; ?>
<?php $modif=$_POST['modif']; ?>
<?php

$jworgs='http://wol.jw.org';
$jworgl=$jworgs.'/es/wol/dt/r4/lp-s/';
// echo $jworgl;


$cong_sql='select * from cong0 where cong_codigo="'.$_SESSION['cong_codigo'].'"';
$cong_res=msql_query($cong_sql,$link_vcrx);
$salas = msql_result($cong_res,0,'cong_sala');


// $jwib_sql='select * from user0 where user_codigo="'.$_SESSION['user_codigo'].'"';
// $jwib_res=msql_query($jwib_sql,$link_vcrx);

$jwib_sql='select *, user_vida +user_mmae +user_estu +user_dpub +user_vari +user_asem as modifica ';
$jwib_sql.='from user0 where user_codigo="'.$_SESSION['user_codigo'].'"';
$jwib_res=msql_query($jwib_sql,$link_vcrx);

$modifica= msql_result($jwib_res,0,'modifica');

$full=false;
$invi=false;

// echo '****'.$modif;

if($modif=='1') 
{
$acce=msql_result($jwib_res,0,'user_acce');
$vida=msql_result($jwib_res,0,'user_vida');
$mmae=msql_result($jwib_res,0,'user_mmae');
$dpub=msql_result($jwib_res,0,'user_dpub');
$estu=msql_result($jwib_res,0,'user_estu');
$asem=msql_result($jwib_res,0,'user_asem');
$vari=msql_result($jwib_res,0,'user_vari');

if(mb_stristr('sist.admi',$_SESSION['user_tipo'])){$full=true;}

if(mb_stristr('invi',$_SESSION['user_tipo'])){$invi=true;}

}

if($modifica>0 and $anio=='' and $modif=='') {$bmodif=true;}

$semaa=date('W',strtotime('now'));
$fechaa=date('Y-m-d');
$prdoa=date('Ym');

$fecha2=strtotime ('last Monday');
if($modif=='1')
{$fecha2=strtotime ('last Monday -56 days');}
$fecha2=date('Y-m-d',$fecha2);

$fecha=date('Y-m-01');
$printer=false;

if($fecha2>$fecha){$fecha2=$fecha;}

$ipip=$_SERVER['REMOTE_ADDR'];
$ipip_sql='insert into ipip0(ipip_codigo)value("'.$ipip.'")';
$ipip_res=msql_query($ipip_sql,$link_vcrx);
$ipip_sql='update ipip0 set ';
$ipip_sql.='ipip_descri="'.$_SERVER['REMOTE_PORT'].'",';
$ipip_sql.='ipip_idate=now(),';
$ipip_sql.='ipip_status=ipip_status ';
$ipip_sql.='where ipip_codigo="'.$ipip.'"';
$ipip_res=msql_query($ipip_sql,$link_vcrx);

if($docu=='DPU2')
{
	$jwib_sql='update jwib1, cong0 set fechar=adddate(fecha,5) where cong=cong_codigo and docu="DPU2" and fecha>="'.$fecha.'"';
	$jwib_res=msql_query($jwib_sql,$link_vcrx);

	$jwib_sql='update jwib1, cong0 set fechar=adddate(fecha,6) where cong=cong_codigo and docu="DPU2" and fecha>="'.$fecha.'" and (left(cong2_dpud,1)="7" or left(cong2_dpud,1)="D")';
	$jwib_res=msql_query($jwib_sql,$link_vcrx);
}

if(mb_stristr('DPU1.DPU2',$docu))
{
	$jwib_sql='select * from jwib11 where docu="'.$docu.'" and cong="'.$cong_codigo.'" ';
// 	if($invi or $dpub==0){$jwib_sql.=' and bsqj!="" ';}	
	if($dpub==0){$jwib_sql.=' and bsqj!="" ';}	
	if($anio!='')
	{	
	$jwib_sql.=' and fanior="'.$anio.'"';
	$jwib_sql.=' and fmesr="'.$mes.'"';
	$printer=true;
	}
	else
	{$jwib_sql.=' and fechar>="'.$fecha2.'" ';}
	
	
	if($docu=='DPU1')
	{$jwib_sql.=' order by fecha ';}

	if($docu=='DPU2')
	{$jwib_sql.=' order by fanior,fmesr,cong2_descri,fecha ';}
}

if($docu=='ESTU')
{
	$jwib_sql='select *, ';
	$jwib_sql.='max(case when docu="ELIB" then idnum1 end) as idn_lib,';
	$jwib_sql.='max(case when docu="ELIB" then nombre1 end) as nom1_lib,';
	$jwib_sql.='max(case when docu="ELIB" then nombre2 end) as nom2_lib,';
	$jwib_sql.='max(case when docu="ELIB" then fechar end) as fecha_lib,';
	$jwib_sql.='max(case when docu="ELIB" then concat(fdianr," /",fdiar) end) as fec_lib,';
	$jwib_sql.='max(case when docu="EATA" then idnum1 end) as idn_ata,';
	$jwib_sql.='max(case when docu="EATA" then nombre1 end) as nom1_ata,';
	$jwib_sql.='max(case when docu="EATA" then nombre2 end) as nom2_ata,';
	$jwib_sql.='max(case when docu="EATA" then fechar end) as fecha_ata,';
	$jwib_sql.='max(case when docu="EATA" then concat(fdianr," /",fdiar) end) as fec_ata,';
	$jwib_sql.='status as st1 ';
	$jwib_sql.=' from jwib11 where docu in ("ELIB","EATA") and cong="'.$cong_codigo.'" ';

	if($anio!='')
	{	
	$jwib_sql.=' and fanior="'.$anio.'"';
	$jwib_sql.=' and fmesr="'.$mes.'"';
	$printer=true;
	}
	else
	{$jwib_sql.=' and fechar>="'.$fecha2.'" ';}
	
	if($iniv or $estu==0){$jwib_sql.=' and nombre1>"" ';}	
	$jwib_sql.=' group by fanio,fsema ';
	$jwib_sql.=' order by fecha,fechar ';
// 	echo $jwib_sql;
}

if($docu=='VIDA')
{
	$jwib_sql='select *, ';
	$jwib_sql.='max(case when docu="VM11" then idnum1 end) as idn_vmc,';
	$jwib_sql.='max(case when docu="VM11" then nombre1 end) as nom1vmc,';
	$jwib_sql.='max(case when docu="VM11" then nombre2 end) as nom2vmc,';
	$jwib_sql.='max(case when docu="VM21" then idnum1 end) as idn_tdb,';
	$jwib_sql.='max(case when docu="VM21" then nombre1 end) as nom1tdb,';
	$jwib_sql.='max(case when docu="VM21" then nombre2 end) as nom2tdb,';
	$jwib_sql.='max(case when docu="VM41" then idnum1 end) as idn_nvc,';
	$jwib_sql.='max(case when docu="VM41" then nombre1 end) as nom1nvc,';
	$jwib_sql.='max(case when docu="VM41" then nombre2 end) as nom2nvc,';
	$jwib_sql.='status as st1 ';
	$jwib_sql.=' from jwib11 where docu like "VM%" and cong="'.$cong_codigo.'" ';
	
	if($anio!='')
	{	
	$jwib_sql.=' and fanior="'.$anio.'"';
	$jwib_sql.=' and fmesr="'.$mes.'"';
	$printer=true;
	}
	else
	{$jwib_sql.=' and fechar>="'.$fecha2.'" ';}
	
	if($invi or $vida==0){$jwib_sql.=' and nombre1>"" ';}	
	$jwib_sql.=' group by fanio,fsema ';
	$jwib_sql.=' order by fecha,fechar ';
// 	echo $jwib_sql;
}

if($docu=='MMAE')
{
	$jwib_sql='select *, ';
	$jwib_sql.='max(case when sala=0 then idnum1 end) as idn_sala0,';
	$jwib_sql.='max(case when sala=0 then nombre1 end) as nom1sala0,';
	$jwib_sql.='max(case when sala=0 then nombre2 end) as nom2sala0,';
	
	$jwib_sql.='max(case when sala=1 then idnum1 end) as idn_sala1,';
	$jwib_sql.='max(case when sala=1 then nombre1 end) as nom1sala1,';
	$jwib_sql.='max(case when sala=1 then nombre2 end) as nom2sala1,';
	
	$jwib_sql.='max(case when sala=2 then idnum1 end) as idn_sala2,';
	$jwib_sql.='max(case when sala=2 then nombre1 end) as nom1sala2,';
	$jwib_sql.='max(case when sala=2 then nombre2 end) as nom2sala2,';
	
	$jwib_sql.='max(case when sala=3 then idnum1 end) as idn_sala3,';
	$jwib_sql.='max(case when sala=3 then nombre1 end) as nom1sala3,';
	$jwib_sql.='max(case when sala=3 then nombre2 end) as nom2sala3,';
	
	$jwib_sql.='status as st1 ';
	$jwib_sql.=' from jwib11 where docu like "VM3%" and cong="'.$cong_codigo.'" ';
	
	if($anio!='')
	{	
	$jwib_sql.=' and fanior="'.$anio.'"';
	$jwib_sql.=' and fmesr="'.$mes.'"';
	$printer=true;
	}
	else
	{$jwib_sql.=' and fechar>="'.$fecha2.'"';}
// 	{$jwib_sql.=' and fechar>=date(now()) ';}
// 	{$jwib_sql.=' and fechar>="'.$fecha2.'" ';}
	
	if($invi or $mmae==0){$jwib_sql.=' and nombre1>"" ';}	
	
 	if($mobile!='true' and !$printer)
	{	
	}
	$jwib_sql.=' group by fanio,fsema,docu';
	$jwib_sql.=' order by fecha,fechar,docu,sala ';
	
 	if($mobile=='true' and !$printer)
	{
// 	$jwib_sql.=' order by fecha,fechar,sala,docu ';
// 	$jwib_sql=str_replace('max(','(',$jwib_sql);
	}
	
// 	echo $jwib_sql;
}

if(mb_stristr('VARI',$docu))
{
	$jwib_sql='select * from jwiv11 where docu="'.$docu.'" and cong="'.$cong_codigo.'" ';
	if($anio!='')
	{	
	$printer=true;
	}
// 	$jwib_sql.=' order by fanio desc,fmes desc, fecha ';
	$jwib_sql.=' order by fecha desc';
}


?>

<?php
if($docu=='ASEM')
{
	$jwib_sql='select *, ';
	
	for($cas10=11; $cas10<=19; $cas10++)
	{
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then idnum1 end) as idn_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then docu end) as docuc_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then docu_descri end) as docud_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then nombre1 end) as nom1_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then nombre2 end) as nom2_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then fechar end) as fecha_'.$cas10.',';
	$jwib_sql.='max(case when docu="AS'.$cas10.'" then concat(fdianr," /",fdiar) end) as fec_'.$cas10.',';
	}

// 	$jwib_sql.='case when fecha2 is not null then upper(date_format(fecha2,"%a - %d/%b")) end as fecha2dm,';
	$jwib_sql.='case when fecha2 is not null then upper(date_format(fecha2,"%a/%d")) end as fecha2dm,';
// 		$calfec.='case when fecha is not null then date_format(fecha,"%Y-%m-%d") end as fechaymd,';
// 		$calfec.='date_format(fecha,"%Y") as fanio,';
// 		$calfec.='date_format(fecha,"%m") as fmes,';
// 		$calfec.='date_format(fecha,"%d") as fdia,';
// 		$calfec.='upper(date_format(fecha,"%b")) as fmesn,';
// 		$calfec.='upper(date_format(fecha,"%a")) as fdian,';
// 		$calfec.='date_format(fecha,"%v") as fsema, ';
// 		$calfec.='date_format(fecha,"%j") as fdoy, ';
	
	
	
	$jwib_sql.='status as st1 ';
	$jwib_sql.='from jwib11 where left(docu,2)="AS" and cong="'.$cong_codigo.'" ';

	if($anio!='')
	{	
	$jwib_sql.=' and fanior="'.$anio.'"';
	$jwib_sql.=' and fmesr="'.$mes.'"';
	$printer=true;
	}
	else
	{$jwib_sql.=' and fechar>="'.$fecha2.'" ';}
	
	if($iniv or $asem==0){$jwib_sql.=' and nombre1>"" ';}	
	$jwib_sql.=' group by fanio,fsema ';
	$jwib_sql.=' order by fecha,fechar ';
// 	echo $jwib_sql;
}

?>


<?php
//$ponclick="jwib_rpu1('".$docu."','".$jwib_aso['fanior']."','".''.$jwib_aso['fmesr']."')";
?>
<div id="tabla">
	
<?php if(mb_stristr('DPU1.DPU2',$docu)) { ?>
		<?php if($mobile=='false' and !$printer) {?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; include('vrbutton.php');?>
									<?php } ?>
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;">
			<?php $lmes=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="height:30px;border-top:solid 2px;border-bottom:solid 1px;background: #A9F5F2;">
									<th align="center" style="">
					<?php if($jwib_aso['fanior'].$jwib_aso['fmesr']>=$prdoa){  ?>
					<a name="scroll"></a>
					<div id="scrollhere" ></div>
					<?php } ?>
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
									<th>No.</th>
									<th>BOSQUEJO</th>
									<th>TEMA</th>
									<th>
										DISCURSANTES
										<br>
									<?php if($docu=='DPU1'){echo ' VIENEN DE : '.$jwib_aso['cong2_descri'];} ?>								
									<?php if($docu=='DPU2'){echo ' VAN A : '.$jwib_aso['cong2_descri'];} ?>								
									</th>

									<?php if(($full or $dpub==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
											<?php $pcaption='Congregacion'; $pidtxt='cong2'.$jwib_aso['idnum1']; $pobj=2; $pdefa=$jwib_aso['cong2_descri']; $plong=20; $pdocu=$docu; $pcolu='cong2_descri'; include('vrgettxt.php'); ?>
											<?php if($docu=='DPU2'){?>
											<?php $pcaption='Dia'; $pidtxt='dpud'.$jwib_aso['idnum1']; $pobj=2; $pdefa=$jwib_aso['cong2_dpud']; $plong=3; $pdocu=$docu; $pcolu='cong2_dpud'; include('vrgettxt.php'); ?>
											<?php $pcaption='Hora'; $pidtxt='dpuh'.$jwib_aso['idnum1']; $pobj=2; $pdefa=$jwib_aso['cong2_dpuh']; $plong=5; $pdocu=$docu; $pcolu='cong2_dpuh'; include('vrgettxt.php'); ?>
											<?php } ?>
											<th>
											<?php 
													$pcaption="Imprimir"; $pidtxt='imprimir'.$jwib_aso['idnum1']; 
													$ponclick="jwib_rpu1('".$docu."','".$jwib_aso['fanior']."','".$jwib_aso['fmesr']."')";
													include('vrbutton.php');
											?>
											<?php 
													$pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idnum1']; 
													$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idnum1']."','".$docu."','nom1".$jwib_aso['idnum1']."','','bsqj".$jwib_aso['idnum1']."','cong2".$jwib_aso['idnum1']."','dpud".$jwib_aso['idnum1']."','dpuh".$jwib_aso['idnum1']."')";
													include('vrbutton.php');
											?>
											</th>
									<?php }else{ ?>
											<th>
											<?php 
													$pcaption="Imprimir"; $pidtxt='imprimir'.$jwib_aso['idnum1']; 
													$ponclick="jwib_rpu1('".$docu."','".$jwib_aso['fanior']."','".$jwib_aso['fmesr']."')";
													include('vrbutton.php');
											?>
												
											</th>
									<th></th>
									<?php } ?>
								</tr>
							<?php if($docu=='DPU2'){ ?>
									<tr>
										<td>
										<?php //echo $jwib_aso['cong2_descri']; ?>
										</td>
									</tr>
							<?php } ?>
					<?php } ?>
		<!--   <tr> -->
			<tr style="<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4){echo 'font-weight:bold;';}?>" >

				<td align="center">
					<?php echo $jwib_aso['fdianr'].' /'.$jwib_aso['fdiar']; ?>
				</td>
				<td align="center">
					<?php echo ($jwib_aso['bsqj']); ?>
				</td>
				<td>
					<?php echo ($jwib_aso['bsqj_descri']); ?>
				</td>
				<td>
					<?php echo $jwib_aso['bsqj_tema']; ?>
				</td>
				<td>
					<?php if(($full or $dpub==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
					<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idnum1']; $pobj=1; $pdefa=$jwib_aso['nombre1']; $plong=20; $pdocu=$docu; $pcolu='nombre1'; include('vrgettxt.php'); ?>
					<?php $ptabla='bsqj'; $pidtxt='bsqj'.$jwib_aso['idnum1']; $pobj=5; $pdefa=$jwib_aso['bsqj']; $pdisab='0'; include('vrgetcod.php'); ?>
					<?php }else{ ?>
					<?php echo ($jwib_aso['nombre1']); ?>
					<?php } ?>
				</td>
				<td>
					<?php if(($full or $dpub==1)  and $jwib_aso['fechar']>=date('Y-m-d')) {?>
					<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idnum1']; 
							$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idnum1']."','".$docu."','nom1".$jwib_aso['idnum1']."','','bsqj".$jwib_aso['idnum1']."')";
						 include('vrbutton.php'); ?>
					<?php } ?>
				</td>
			</tr>

			<?php }  ?>
		</table>  
		<?php } ?>


		<?php if($mobile=='true' and !$printer) {?>
		<?php //if($mobile and !$printer) {?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; $psize=30;include('vrbutton.php');?>
									<?php } ?>
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white; " border=0>
			<?php $lmes=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="height:30px;border-top:solid 2px;border-bottom:solid 1px;background: #A9F5F2;font-size:30px;">
									<th align="center" style="">
					<?php if($jwib_aso['fanior'].$jwib_aso['fmesr']>=$prdoa){  ?>
					<a name="scroll"></a>
					<div id="scrollhere" ></div>
					<?php } ?>
										
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
										<br>
									<?php if(($full or $dpub==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
									<?php $pcaption='Cong:'; $pidtxt='cong2'.$jwib_aso['idnum1']; $pobj=1; $pdefa=$jwib_aso['cong2_descri']; $plong=20; $psize=30; $pdocu=$docu; $pcolu='cong2_descri'; include('vrgettxt.php'); ?>
									<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idnum1']; $psize=30;
// 											$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idnum1']."','".$docu."','nom1".$jwib_aso['idnum1']."','','bsqj".$jwib_aso['idnum1']."')";
											$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idnum1']."','".$docu."','nom1".$jwib_aso['idnum1']."','','bsqj".$jwib_aso['idnum1']."','cong2".$jwib_aso['idnum1']."','dpud".$jwib_aso['idnum1']."','dpuh".$jwib_aso['idnum1']."')";
											 include('vrbutton.php'); ?>
									<?php }else{?>
									<?php if($docu=='DPU1'){echo ' VIENEN DE : '.$jwib_aso['cong2_descri'];} ?>								
									<?php if($docu=='DPU2'){echo ' VAN A : '.$jwib_aso['cong2_descri'];} ?>								
									<?php }?>
									</th>
								</tr>
					<?php } ?>
			<tr >
				<td align="center" style="border-top:solid 1px;<?php if($jwib_aso['fsema']==$semaa){echo 'background-color: #E5E5E5;';}?>">
					<?php if($jwib_aso['fecha']>=$prdoa){ ?>
					<a name="scroll"></a>
					<div id="scrollhere" ></div>
					<?php } ?>
					<div style="font-size:30px;<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4){echo 'font-weight:bold;';}?>">
					<?php echo $jwib_aso['fdianr'].' /'.$jwib_aso['fdiar']; ?>
					</div>
					<div style=" font-size:30px;font-weight:bold;">
					<?php echo ($jwib_aso['bsqj']).' - '.($jwib_aso['bsqj_descri']); ?>
					</div>
					<div style="font-size:25px;">
					<?php echo $jwib_aso['bsqj_tema']; ?>
					</div>
				</td>
			</tr>

			<?php if(($full or $dpub==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
			<tr>
				<td align="center" >
					<?php $pidtxt='nom1'.$jwib_aso['idnum1']; $pobj=1; $pdefa=$jwib_aso['nombre1']; $plong=20; $psize=30; $pdocu=$docu; $pcolu='nombre1';include('vrgettxt.php'); ?>
				</td>
			</tr>
			<tr align="center" class="">
					<?php $ptabla='bsqj'; $pidtxt='bsqj'.$jwib_aso['idnum1']; $pobj=5; $pdefa=$jwib_aso['bsqj']; $pdisab='0'; $psize=30; include('vrgetcod.php'); ?>
			</tr>
					<?php }else{ ?>
			<tr align="center" style="font-size:30px; font-style:italic;<?php if($jwib_aso['fsema']==$semaa){echo 'background-color: #E5E5E5;';}else{echo 'background-color: ;';}?>">
				<td>
					<?php echo ($jwib_aso['nombre1']); ?>
				</td>
			</tr>
			<?php } ?>

			<tr>
				<td>
					<?php if(($full or $dpub==1)  and $jwib_aso['fechar']>=date('Y-m-d')) {?>
					<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idnum1']; $psize=30;
							$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idnum1']."','".$docu."','nom1".$jwib_aso['idnum1']."','','bsqj".$jwib_aso['idnum1']."')";
							 include('vrbutton.php'); ?>
					<?php } ?>
					<br>
				</td>
			</tr>

			<?php }  ?>
		</table>  
		<?php } ?>

		<?php if ($printer) { ?>
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
		<?php if($docu=='DPU1'){echo 'Conferencias';} ?>	
		<?php if($docu=='DPU2'){echo 'Discursantes';} ?>	
		</title>
		<style type="text/css">
		/* body{ font-family:"Courier New", Courier, monospace;} */
		@page {
		/*    size: 7in 9.25in; */
		/* 	 top left bott right */
		/*     size: 210mm 297mm;  */
		/*     margin: 0mm 10mm 10mm 0mm; /* 	top right bottom left */ */
				size: 105mm 148mm; 
				margin: 20mm 5mm 0mm 5mm; /* 	top right bottom left */
		}

		</style>

		</head>
		<body>


		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="40%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;" align="left">
			<?php $lmes=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="height:30px;border-top:solid 2px;border-bottom:solid 1px;background: #A9F5F2;font-size:12px;">
									<th align="center" style="">
											<?php echo 'PROGRAMA DE CONFERENCIAS'; ?>
											<br>
											<?php echo $cong_descri; ?>
											<br>
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
										<br>
									<?php if($docu=='DPU1'){echo ' VIENEN DE : '.$jwib_aso['cong2_descri'];} ?>								
									<?php if($docu=='DPU2'){echo ' VAN A : '.$jwib_aso['cong2_descri'];} ?>								
										
									</th>
								</tr>
					<?php } ?>
			<tr>
				<td align="center" style="border-top:solid 1px;">
					<div style="font-size:12px;">
					<?php echo $jwib_aso['fdianr'].' /'.$jwib_aso['fdiar']; ?>
					</div>
					<div style=" font-size:12px;font-weight:bold;">
					<?php echo ($jwib_aso['bsqj']).' - '.($jwib_aso['bsqj_descri']); ?>
					</div>
					<div style="font-size:10px;">
					<?php echo $jwib_aso['bsqj_tema']; ?>
					</div>
				</td>
			</tr>

			<tr align="center" style="font-size:12px; font-style:italic;">
				<td>
					<?php echo ($jwib_aso['nombre1']); ?>
				</td>
			</tr>

			<tr>
				<td>
				</td>
			</tr>

			<?php }  ?>
			<tr style="border-top:solid 2px;">
				<td colspan="1" align="right">
				<?php echo 'jwib.vcrxol.com/?'.$_SESSION['cong_codigo']; ?>
				</td>
			</tr>
		
		</table>  

		</body>
		</html>

		<?php } ?>

<?php } ?>

<?php if(mb_stristr('ASEM',$docu) ) { ?>
		<?php if($mobile=='false' and !$printer){ ?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; include('vrbutton.php');?>
									<?php } ?>
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;" border=1>
			<?php $lmes=''; ?>
			<?php $lsema=''; ?>
			<?php $ardocu=array(); ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fsema']!=$lsema){ ?>
<!-- 					<input type="text" class="jwfecha" style="display:none;" value="<?php //echo $jwib_aso['fecha'] ?>"> -->
					<?php $lsema=$jwib_aso['fsema']; ?>
					<?php } ?>
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #A9F5F2;">
									<th align="center" style="" width="">
					<?php if($jwib_aso['fanior'].$jwib_aso['fmesr']>=$prdoa){  ?>
					<a name="scroll"></a>
					<div id="scrollhere" ></div>
					<?php } ?>
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
									<?php for($cas10=11; $cas10<=19; $cas10++)	{ ?>
											<?php $ardocu[$cas10]=$jwib_aso['docud_'.$cas10]; ?>
											<th colspan=1 width=""><?php echo $ardocu[$cas10]; ?></th>
									<?php } ?>
									<th>
									<?php 
											$pcaption="Imprimir"; $pidtxt='imprimir'.$jwib_aso['idnum1']; 
											$ponclick="jwib_rpu1('".$docu."','".$jwib_aso['fanior']."','".$jwib_aso['fmesr']."')";
											include('vrbutton.php');
									?>
										
									</th>
								</tr>
					<?php } ?>
				<tr style="<?php if($jwib_aso['fsema']==$semaa){echo 'font-weight:bold;';}?>text-transform:capitalize;" align="center">
					<td>
						<?php  echo ucwords(strtolower($jwib_aso['fdianr'].'/'.$jwib_aso['fdiar'].' - '.$jwib_aso['fecha2dm'])); ?>
					</td>
			
					<?php if(($full or $estu==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
								<?php for($cas10=11; $cas10<=19; $cas10++)	{ ?>
									<td >
									<div style="<?php if($ardocu[$cas10]==''){echo 'display:none;';}else{echo 'display:block;';} ?> ">
										
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_'.$cas10]; $pobj=1; $pdefa=$jwib_aso['nom1_'.$cas10]; $plong=20; $pdocu=$jwib_aso['docuc_'.$cas10]; $pcolu='nombre1'; 
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_'.$cas10]."').click()}";
									include('vrgettxt.php'); ?>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_'.$cas10]; $pobj=1; $pdefa=$jwib_aso['nom2_'.$cas10]; $plong=20; $pdocu=$jwib_aso['docuc_'.$cas10]; $pcolu='nombre2'; 
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_'.$cas10]."').click()}";
									include('vrgettxt.php'); ?>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_'.$cas10]; 
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_'.$cas10]."','".$docu."','nom1".$jwib_aso['idn_'.$cas10]."','nom2".$jwib_aso['idn_'.$cas10]."')";
								 include('vrbutton.php'); ?>
									</div>	
								</td>
								<?php } ?>
					<?php }else{ ?>
								<?php for($cas10=11; $cas10<=19; $cas10++)	{ ?>
<!-- 								<td style="<?php if($ardocu[$cas10]==''){echo 'display:none;';}else{echo 'display:block;';} ?> "> -->
								<td>
								<?php echo ucwords(strtolower($jwib_aso['nom1_'.$cas10])); ?>
								<br>
								<?php echo ucwords(strtolower($jwib_aso['nom2_'.$cas10])); ?>
								</td>
								<?php } ?>
					<?php } ?>

					</tr>
				<?php } ?>
		</table>
		<?php } ?>

		<?php if($mobile=='true' and !$printer){ ?>
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; $psize=30;include('vrbutton.php');?>
									<?php } ?>

		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;font-size:30px;" border=1>
			<?php $lmes=''; ?>
			<?php $lsema=''; ?>
			<?php $ardocu=array(); ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fsema']!=$lsema){ ?>
<!-- 					<input type="text" class="jwfecha" style="display:none;" value="<?php //echo $jwib_aso['fecha'] ?>"> -->
					<?php $lsema=$jwib_aso['fsema']; ?>
					<?php } ?>
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #A9F5F2;">
									<th colspan="2" align="center" style="" width="">
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
								</tr>
					<?php } ?>
			<tr style="border-top:solid 2px; border-bottom:solid 2px;background: #A9F5F2;<?php if($jwib_aso['fsema']==$semaa){echo 'font-weight:bold;';}?>">
					<td colspan="2" align="center">
					<?php if($jwib_aso['fechar']>=$fechaa){ ?>
					<a name="scroll"></a>
					<div id="scrollhere" ></div>
					<?php } ?>
						
						<?php  echo ucwords(strtolower($jwib_aso['fdianr'].'/'.$jwib_aso['fdiar'].' - '.$jwib_aso['fecha2dm'])); ?>
					</td>
			</tr>

					<?php for($cas10=11; $cas10<=19; $cas10++)	{ ?>
							<?php $ardocu[$cas10]=$jwib_aso['docud_'.$cas10]; ?>
						<?php if($ardocu[$cas10]!=''){ ?>
						<tr>
							<td ><?php echo $ardocu[$cas10]; ?></td>
							<td align="center">
					<?php if(($full or $estu==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
									<div style="<?php if($ardocu[$cas10]==''){echo 'display:none;';}else{echo 'display:block;';} ?> ">
										
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_'.$cas10]; $pobj=1; $pdefa=$jwib_aso['nom1_'.$cas10]; $plong=20; $psize=25; $pdocu=$jwib_aso['docuc_'.$cas10]; $pcolu='nombre1'; 
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_'.$cas10]."').click()}";
									include('vrgettxt.php'); ?>
									<br>	
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_'.$cas10]; $pobj=1; $pdefa=$jwib_aso['nom2_'.$cas10]; $plong=20; $psize=25; $pdocu=$jwib_aso['docuc_'.$cas10]; $pcolu='nombre2'; 
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_'.$cas10]."').click()}";
									include('vrgettxt.php'); ?>
									<br>	
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_'.$cas10]; 
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_'.$cas10]."','".$docu."','nom1".$jwib_aso['idn_'.$cas10]."','nom2".$jwib_aso['idn_'.$cas10]."')";
								 include('vrbutton.php'); ?>
									<br>	
									</div>	
					<?php }else{ ?>
								<?php echo ucwords(strtolower($jwib_aso['nom1_'.$cas10])); ?>
								<br>
								<?php echo ucwords(strtolower($jwib_aso['nom2_'.$cas10])); ?>
					<?php } ?>


							</td>
							</tr>
						<?php } ?>
			
					<?php } ?>

			<tr style="<?php if($jwib_aso['fsema']==$semaa){echo 'font-weight:bold;';}?>text-transform:capitalize;" align="center">

			
					</tr>
				<?php } ?>
		</table>

		<?php } ?>

		<?php if($printer){ ?>
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
		<?php echo 'ESTUDIOS'; ?>
		</title>
		<style type="text/css">
		/* body{ font-family:"Courier New", Courier, monospace;} */
		@page {
		/*    size: 7in 9.25in; */
		/* 	 top left bott right */
		/*     size: 210mm 297mm;  */
		/*     margin: 0mm 10mm 10mm 0mm; /* 	top right bottom left */ */
				size: 105mm 148mm; 
				margin: 20mm 5mm 0mm 5mm; /* 	top right bottom left */
		}

		</style>

		</head>
		<body>

	
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;" border=1>
			<?php $lmes=''; ?>
			<?php $lsema=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fsema']!=$lsema){ ?>
<!-- 					<input type="text" class="jwfecha" style="display:none;" value="<?php //echo $jwib_aso['fecha'] ?>"> -->
					<?php $lsema=$jwib_aso['fsema']; ?>
					<?php } ?>
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #A9F5F2;font-size:10px;">
									<th align="center" style="" width="1%">
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
									<?php for($cas10=11; $cas10<=19; $cas10++)	{ ?>
									<?php $ardocu[$cas10]=$jwib_aso['docud_'.$cas10]; ?>
									<th >
											<?php echo $ardocu[$cas10]; ?>
									</th>
									<?php } ?>
								</tr>
					<?php } ?>
				<tr style="text-transform:capitalize;font-size:12px;" align="center">
					<td>
						<?php  echo ucwords(strtolower($jwib_aso['fdianr'].'/'.$jwib_aso['fdiar'].'<br>'.$jwib_aso['fecha2dm'])); ?>
					</td>
								<?php for($cas10=11; $cas10<=19; $cas10++)	{ ?>
									<td >
								<?php echo ucwords(strtolower($jwib_aso['nom1_'.$cas10])); ?>
								<br>
								<?php echo ucwords(strtolower($jwib_aso['nom2_'.$cas10])); ?>
								</td>
								<?php } ?>
					</tr>
				<?php } ?>
			<tr style="border-top:solid 2px;font-size:10px;">
				<td colspan="10" align="right">
				<?php echo 'jwib.vcrxol.com/?'.$_SESSION['cong_codigo']; ?>
				</td>
			</tr>
		</table>


		<?php } ?>

<?php } ?>

<?php if(mb_stristr('ESTU',$docu) ) { ?>
		<?php if($mobile=='false' and !$printer){ ?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; include('vrbutton.php');?>
									<?php } ?>
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;" border=0>
			<?php $lmes=''; ?>
			<?php $lsema=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fsema']!=$lsema){ ?>
<!-- 					<input type="text" class="jwfecha" style="display:none;" value="<?php //echo $jwib_aso['fecha'] ?>"> -->
					<?php $lsema=$jwib_aso['fsema']; ?>
					<?php } ?>
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #A9F5F2;">
									<th align="center" style="" width="">
					<?php if($jwib_aso['fanior'].$jwib_aso['fmesr']>=$prdoa){  ?>
					<a name="scroll"></a>
					<div id="scrollhere" ></div>
					<?php } ?>
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
									<th colspan=3 width="">EST. L I B R O</th>
									<th></th>
									<th colspan=3 width="">EST. A T A L A Y A</th>
									<th>
									<?php 
											$pcaption="Imprimir"; $pidtxt='imprimir'.$jwib_aso['idnum1']; 
											$ponclick="jwib_rpu1('".$docu."','".$jwib_aso['fanior']."','".$jwib_aso['fmesr']."')";
											include('vrbutton.php');
									?>
										
									</th>
								</tr>
								<tr style="border-bottom:solid 1px;background: #A9F5F2;font-size:12px;">
									<th width="5%">SEMANA</th>
									<th width="15%">FECHA</th>
									<th width="15%">CONDUCTOR</th>
									<th width="15%">LECTOR</th>
									<th></th>
									<th width="15%">FECHA</th>
									<th width="15%">CONDUCTOR</th>
									<th width="15%">LECTOR</th>
									<th width="5%"></th>
								</tr>
					<?php } ?>
				<tr style="<?php if($jwib_aso['fsema']==$semaa){echo 'font-weight:bold;';}?>text-transform:capitalize;" align="center">
					<td>
						<?php echo $jwib_aso['fsemar'] ?>
					</td>
					<td style="border-left:solid 1px;">
						<?php echo $jwib_aso['fec_lib']; ?>
							<br>
							<?php echo '<div id="jw_lib_'.$jwib_aso['fecha'].'" >'; ?>
							<?php echo $jwib_aso['jwol_lib1'];?>
							<?php echo '</div>'; ?>
					</td>
					<?php if(($full or $estu==1) and $jwib_aso['fecha_lib']>=date('Y-m-d')) {?>
						<td>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_lib']; $pobj=1; $pdefa=$jwib_aso['nom1_lib']; $plong=20; $pdocu='ELIB'; $pcolu='nombre1'; 
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_lib']."').click()}";
									include('vrgettxt.php'); ?>
						</td>
						<td>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_lib']; $pobj=1; $pdefa=$jwib_aso['nom2_lib']; $plong=20; $pdocu='ELIB'; $pcolu='nombre2';
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_lib']."').click()}";
									include('vrgettxt.php'); ?>
						</td>
						<td>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_lib']; 
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_lib']."','".$docu."','nom1".$jwib_aso['idn_lib']."','nom2".$jwib_aso['idn_lib']."')";
								 include('vrbutton.php'); ?>
						</td>
					<?php }else{ ?>
						<td><?php echo (($jwib_aso['nom1_lib'])); ?></td>
						<td><?php echo (($jwib_aso['nom2_lib'])); ?></td>
						<td></td>
					<?php } ?>
					<td style="border-left:solid 1px;">
						<?php echo $jwib_aso['fec_ata']; ?>
							<br>
							<?php echo '<div id="jw_ata_'.$jwib_aso['fecha'].'" >'; ?>
							<?php //echo ''.$ata1; ?>
							<?php echo $jwib_aso['jwol_ata1'];?>
							<?php echo '</div>'; ?>
							<br>
					</td>
					<?php if(($full or $estu==1) and $jwib_aso['fecha_ata']>=date('Y-m-d')) {?>
						<td>
							<?php //echo $jwib_aso['fecha_ata'] ;?>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_ata']; $pobj=1; $pdefa=$jwib_aso['nom1_ata']; $plong=20; $pdocu='EATA'; $pcolu='nombre1';
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_ata']."').click()}";
									include('vrgettxt.php'); ?>
						</td>
						<td>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_ata']; $pobj=1; $pdefa=$jwib_aso['nom2_ata']; $plong=20; $pdocu='EATA'; $pcolu='nombre1';
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_ata']."').click()}";
									include('vrgettxt.php'); ?>
						</td>
						<td>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_ata']; 
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_ata']."','".$docu."','nom1".$jwib_aso['idn_ata']."','nom2".$jwib_aso['idn_ata']."')";
								 include('vrbutton.php'); ?>
						</td>
					<td></td>
					<?php }else{ ?>
						<td><?php echo (($jwib_aso['nom1_ata'])); ?></td>
						<td><?php echo (($jwib_aso['nom2_ata'])); ?></td>
					<td></td>
					<?php } ?>
					</tr>
				<?php } ?>
		</table>
		<?php } ?>

		<?php if($mobile=='true' and !$printer){ ?>
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; $psize=30;include('vrbutton.php');?>
									<?php } ?>

		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;"  border=0>
			<?php $lmes=''; ?>
			<?php $lsema=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fsema']!=$lsema){ ?>
					<?php $pfecha=$jwib_aso['fecha']; //include('jwib_geturl.php') ?>
<!-- 					<input type="text" class="jwfecha" style="display:none;" value="<?php //echo $jwib_aso['fecha'] ?>"> -->
					<?php $lsema=$jwib_aso['fsema']; ?>
					<?php } ?>
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #A9F5F2;font-size:30px;">
									<th align="center" style="" colspan=2>
					<?php if($jwib_aso['fanior'].$jwib_aso['fmesr']>=$prdoa){  ?>
					<a name="scroll"></a>
					<div id="scrollhere" ></div>
					<?php } ?>
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
								</tr>
								<tr style="border-bottom:solid 2px;background: #A9F5F2;font-size:30px;">
									<th colspan=1 width="45%">EST. LIBRO</th>
									<th colspan=1 width="45%">EST. ATALAYA</th>
								</tr>
					<?php } ?>
			
				<tr style="<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4){echo 'font-weight:bold;';}?>font-size:30px;border-top:solid 1px;" align="center" valign="top">
					
					<?php if(($full or $estu==1) and $jwib_aso['fecha_lib']>=date('Y-m-d')) {?>
						<td style="border-right:solid 1px;">
								<?php echo $jwib_aso['fec_lib']; ?>
								<br>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_lib']; $pobj=1; $pdefa=$jwib_aso['nom1_lib']; $plong=20; $psize=25; $pdocu='ELIB'; $pcolu='nombre1'; include('vrgettxt.php'); ?>
								<br>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_lib']; $pobj=1; $pdefa=$jwib_aso['nom2_lib']; $plong=20; $psize=25; $pdocu='ELIB'; $pcolu='nombre2'; include('vrgettxt.php'); ?>
								<br>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_lib']; $psize=25;
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_lib']."','".$docu."','nom1".$jwib_aso['idn_lib']."','nom2".$jwib_aso['idn_lib']."')";
								 include('vrbutton.php'); ?>
								<br>
							<?php echo '<div id="jw_lib_'.$jwib_aso['fecha'].'" >'; ?>
							<?php //echo ''.$lib1; ?>
							<?php echo $jwib_aso['jwol_lib1'];?>
							
							<?php echo '</div>'; ?>
							<br>
						</td>
					
					<?php }else{ ?>
						<td style="border-right:solid 1px;">
							<?php echo $jwib_aso['fec_lib']; ?>
							<br>
							<?php echo ''.$jwib_aso['nom1_lib']; ?>
							<br>
							<?php echo ''.$jwib_aso['nom2_lib']; ?>
							<br>
							<?php echo '<div id="jw_lib_'.$jwib_aso['fecha'].'" >'; ?>
							<?php //echo ''.$lib1; ?>
							<?php echo $jwib_aso['jwol_lib1'];?>
							<?php echo '</div>'; ?>
							<br>
						</td>

					<?php } ?>

					<?php if(($full or $estu==1) and $jwib_aso['fecha_ata']>=date('Y-m-d')) {?>
						<td>
								<?php echo $jwib_aso['fec_ata']; ?>
								<br>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_ata']; $pobj=1; $pdefa=$jwib_aso['nom1_ata']; $plong=20; $psize=25; $pdocu='EATA'; $pcolu='nombre1'; include('vrgettxt.php'); ?>
								<br>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_ata']; $pobj=1; $pdefa=$jwib_aso['nom2_ata']; $plong=20; $psize=25; $pdocu='EATA'; $pcolu='nombre2'; include('vrgettxt.php'); ?>
							<br>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_ata']; $psize=25;
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_ata']."','".$docu."','nom1".$jwib_aso['idn_ata']."','nom2".$jwib_aso['idn_ata']."')";
								 include('vrbutton.php'); ?>
								<br>
							<?php echo '<div id="jw_ata_'.$jwib_aso['fecha'].'" >'; ?>
							<?php //echo ''.$ata1; ?>
							<?php echo $jwib_aso['jwol_ata1'];?>
							
							<?php echo '</div>'; ?>
								<br>
						</td>
					<?php }else{ ?>
						<td>
							<?php echo $jwib_aso['fec_ata']; ?>
							<br>
							<?php echo ''.$jwib_aso['nom1_ata']; ?>
							<br>
							<?php echo ''.$jwib_aso['nom2_ata']; ?>
							<br>
							<?php echo '<div id="jw_ata_'.$jwib_aso['fecha'].'" >'; ?>
							<?php //echo ''.$ata1; ?>
							<?php echo $jwib_aso['jwol_ata1'];?>
							
							<?php echo '</div>'; ?>
							<br>
						</td>
					<?php } ?>
					

				</tr>
				<?php } ?>
		</table>

		<?php } ?>

		<?php if($printer){ ?>
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
		<?php echo 'ESTUDIOS'; ?>
		</title>
		<style type="text/css">
		/* body{ font-family:"Courier New", Courier, monospace;} */
		@page {
		/*    size: 7in 9.25in; */
		/* 	 top left bott right */
		/*     size: 210mm 297mm;  */
		/*     margin: 0mm 10mm 10mm 0mm; /* 	top right bottom left */ */
				size: 105mm 148mm; 
				margin: 20mm 5mm 0mm 5mm; /* 	top right bottom left */
		}

		</style>

		</head>
		<body>

	
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="40%" style="border-collapse:collapse;border:#000000 solid 2px;font-size:12px;background-color:white; " align="left" border=0>
			<?php $lmes=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #A9F5F2;font-size:15px;">
									<th align="center" style="" colspan=2>
										<?php echo 'ESTUDIOS PARA : '.$jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
								</tr>
								<tr style="border-bottom:solid 2px;background: #A9F5F2;font-size:15px;">
									<th colspan=1 width="45%">LIBRO</th>
									<th colspan=1 width="45%">ATALAYA</th>
								</tr>
					<?php } ?>
			
				<tr style="border-top:solid 1px;" align="center">
					
						<td valign="top" style="border-right:solid 1px;">
							<b><?php echo $jwib_aso['fec_lib']; ?></b>
							<br>
							<?php echo ''.$jwib_aso['nom1_lib']; ?>
							<br>
							<?php echo ''.$jwib_aso['nom2_lib']; ?>
							<br>
							<?php echo $jwib_aso['jwol_lib1'];?>
<!-- 							<br> -->
						</td>
						<td valign="top">
							<b><?php echo $jwib_aso['fec_ata']; ?></b>
							<br>
							<?php echo ''.$jwib_aso['nom1_ata']; ?>
							<br>
							<?php echo ''.$jwib_aso['nom2_ata']; ?>
							<br>
							<?php echo $jwib_aso['jwol_ata1'];?>
<!-- 							<br> -->
						</td>
					

				</tr>
				<?php } ?>
			<tr style="border-top:solid 2px;">
				<td colspan="2" align="right">
				<?php echo 'jwib.vcrxol.com/?'.$_SESSION['cong_codigo']; ?>
				</td>
			</tr>
		</table>


		<?php } ?>

<?php } ?>

<?php if(mb_stristr('VIDA',$docu)) { ?>

		<?php if($mobile=='false' and !$printer){ ?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; include('vrbutton.php');?>
									<?php } ?>
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<?php $lmes=''; ?>
		<?php $lsema=''; ?>
			
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;" border=0>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){ ?>  
					<?php if($jwib_aso['fsema']!=$lsema){ ?>
					<?php $pfecha=$jwib_aso['fecha'];?>
					<?php $lsema=$jwib_aso['fsema']; ?>
					<?php } ?>
				<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: white;">
									<th width="1%" align="center" style="">
					<?php if($jwib_aso['fanior'].$jwib_aso['fmesr']>=$prdoa){  ?>
					<a name="scroll"></a>
					<div id="scrollhere" ></div>
					<?php } ?>
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
									<th width="20%" colspan=2 style="background-color:#799FCC; color:white;">VIDA Y MINISTERIO</th>
									<th width="1%"></th>
									<th width="35%" colspan=2 style="background-color:#5A6A70; color:white;">TESOROS DE LA BIBLIA</th>
									<th width="1%"></th>
									<th width="35%" colspan=2 style="background-color:#961526; color:white;">NUESTRA VIDA CRISTIANA</th>
									<th width="1%">
									<?php 
											$pcaption="Imprimir"; $pidtxt='imprimir'.$jwib_aso['idnum1']; 
											$ponclick="jwib_rpu1('".$docu."','".$jwib_aso['fanior']."','".$jwib_aso['fmesr']."')";
											include('vrbutton.php');
									?>
									</th>
								</tr>
								<tr style="border-bottom:solid 1px;background: #A9F5F2;font-size:12px; display:;">
									<th></th>
									<th style="background-color:#799FCC; color:white;">PRESIDENTE</th>
									<th style="background-color:#799FCC; color:white;">ORACION FINAL</th>
									<th></th>
									<th style="background-color:#5A6A70; color:white;">DISCURSO 1</th>
									<th style="background-color:#5A6A70; color:white;">PERLAS ESCONDIDAS</th>
									<th style=""></th>
									<th style="background-color:#961526; color:white;">ASIGNACION 1</th>
									<th style="background-color:#961526; color:white;" width="15%">ASIGNACION 2</th>
									<th></th>
								</tr>
					<?php } ?>
				<tr style="<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format('%a')<4){echo 'font-weight:bold;';}?>" align="center" valign="top" >
					<td onclick="{window.open('<?php echo $jworgl.str_replace('-','/',$jwib_aso['fecha']); ?>','_blank');}">
						<?php echo $jwib_aso['fdianr'].' /'.$jwib_aso['fdiar'] ?>
					</td>
					<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
						<td>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_vmc']; $pobj=1; $pdefa=$jwib_aso['nom1vmc']; $plong=20; $pdocu='VM11'; $pcolu='nombre1'; 
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_vmc']."').click()}";
									include('vrgettxt.php'); ?>
						</td>
						<td>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_vmc']; $pobj=1; $pdefa=$jwib_aso['nom2vmc']; $plong=20; $pdocu='VM11'; $pcolu='nombre2';
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_vmc']."').click()}";
									include('vrgettxt.php'); ?>
						</td>
						<td>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_vmc']; 
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_vmc']."','".$docu."','nom1".$jwib_aso['idn_vmc']."','nom2".$jwib_aso['idn_vmc']."')";
								 include('vrbutton.php'); ?>
						</td>
					<?php }else{ ?>
						<td><?php echo (($jwib_aso['nom1vmc'])); ?></td>
						<td><?php echo (($jwib_aso['nom2vmc'])); ?></td>
						<td></td>
					<?php } ?>
					<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
						<td>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_tdb']; $pobj=1; $pdefa=$jwib_aso['nom1tdb']; $plong=20; $pdocu='VM21'; $pcolu='nombre1';
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_tdb']."').click()}";
									include('vrgettxt.php'); ?>
							<?php echo $jwib_aso['jwol_tdb1'];?>
							<br>
						</td>
						<td>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_tdb']; $pobj=1; $pdefa=$jwib_aso['nom2tdb']; $plong=20; $pdocu='VM21'; $pcolu='nombre2';
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_tdb']."').click()}";
									include('vrgettxt.php'); ?>
							<?php echo $jwib_aso['jwol_tdb2'];?>
						</td>
						<td>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_tdb']; 
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_tdb']."','".$docu."','nom1".$jwib_aso['idn_tdb']."','nom2".$jwib_aso['idn_tdb']."')";
								 include('vrbutton.php'); ?>
						</td>
					<?php }else{ ?>
						<td>
							<?php echo (($jwib_aso['nom1tdb'])); ?>
							<br>
							<?php echo $jwib_aso['jwol_tdb1'];?>
							<br>
						</td>
						<td>
							<?php echo (($jwib_aso['nom2tdb'])); ?>
							<br>
							<?php echo $jwib_aso['jwol_tdb2'];?>
						</td>
					<td></td>
					<?php } ?>

					<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
						<td>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_nvc']; $pobj=1; $pdefa=$jwib_aso['nom1nvc']; $plong=20; $pdocu='VM41'; $pcolu='nombre1';
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_nvc']."').click()}";
									include('vrgettxt.php'); ?>
							<?php echo $jwib_aso['jwol_nvc1'];?>
						</td>
						<td>
								<?php if($jwib_aso['jwol_nvc2']==""){$phide=1;};?>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_nvc']; $pobj=1; $pdefa=$jwib_aso['nom2nvc']; $plong=20; $pdocu='VM41'; $pcolu='nombre2';
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_nvc']."').click()}";
									include('vrgettxt.php'); ?>
							<?php echo $jwib_aso['jwol_nvc2'];?>
						</td>
						<td>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_nvc']; 
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_nvc']."','".$docu."','nom1".$jwib_aso['idn_nvc']."','nom2".$jwib_aso['idn_nvc']."')";
								 include('vrbutton.php'); ?>
						</td>
					<td></td>
					<?php }else{ ?>
						<td>
							<?php echo (($jwib_aso['nom1nvc'])); ?>
							<br>
							<?php echo $jwib_aso['jwol_nvc1'];?>
						</td>
						<td>
							<?php echo ucwords(strtolower($jwib_aso['nom2nvc'])); ?>
							<br>
							<?php echo $jwib_aso['jwol_nvc2'];?>
						</td>
					<td></td>
					<?php } ?>

					
				</tr>
				<?php } ?>
		</table>

		<?php } ?>

		<?php if($mobile=='true' and !$printer){ ?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; $psize=30;include('vrbutton.php');?>
									<?php } ?>
			
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;font-size:30px;"  border=0>
			<?php $lmes=''; ?>
			<?php $lsema=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fsema']!=$lsema){ ?>
					<?php $pfecha=$jwib_aso['fecha']; //include('jwib_geturl.php') ?>
<!-- 					<input type="text" class="jwfecha" style="display:none;" value="<?php //echo $jwib_aso['fecha'] ?>"> -->
					<?php $lsema=$jwib_aso['fsema']; ?>
					<?php } ?>
			
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #A9F5F2;font-size:30px;">
									<th align="center" style="" colspan=3>
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
								</tr>
					<?php } ?>
				<tr style="<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4){echo 'font-weight:bold;';}?>font-size:30px;border-top:solid 1px; border-bottom:solid 1px;background: #A9F5F2;" align="center">
						<td colspan=3 onclick="{window.open('<?php echo $jworgl.str_replace('-','/',$jwib_aso['fecha']); ?>','_blank');}">
					<?php if($jwib_aso['fechar']>=$fechaa){ ?>
					<a name="scroll"></a>
					<div id="scrollhere" ></div>
					<?php } ?>
								<?php echo $jwib_aso['fdianr'].' - '.$jwib_aso['fechadmyr']; ?>
						</td>
				</tr>
			
				<tr style="<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4){echo 'font-weight:bold;';}?>font-size:30px;border-top:solid 1px;" align="center">
					
				</tr>
																											 
			
					<?php if(1==1)	{ ?>
						<tr align="center" style="border-top:solid 1px;" valign="center">
						<td rowspan=2 style="background-color:#799FCC; border-right:solid 1px; ">
						<?php echo 'VMC'; ?>
						</td>
						<td style="border-right:solid 1px;" width="50%" >
							<i><?php echo 'Presidente' ?></i>
							<br>	
						</td>
						<td style="border-right:solid 1px;">
						<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_vmc']; $pobj=1; $pdefa=$jwib_aso['nom1vmc']; $plong=20; $psize=25; $pdocu='VM11'; $pcolu='nombre1'; include('vrgettxt.php'); ?>
						<?php }else{ ?> 
							<?php echo ''.$jwib_aso['nom1vmc']; ?>
							<br>
						<?php } ?>
						</td>
						</tr>
						<tr align="center" >
						<td style="border-right:solid 1px;">
							<i><?php echo 'Oración Final' ?></i>
						</td>
						<td>
						<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_vmc']; $pobj=1; $pdefa=$jwib_aso['nom2vmc']; $plong=20; $psize=25; $pdocu='VM11'; $pcolu='nombre2'; include('vrgettxt.php'); ?>
						<?php }else{ ?> 
							<?php echo ''.$jwib_aso['nom2vmc']; ?>
						<?php } ?>
						</td>
						</tr>
						<tr>
						<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
							<td></td>
							<td style="border-right:solid 1px;"></td>
							<td>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_vmc']; $psize=25;
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_vmc']."','".$docu."','nom1".$jwib_aso['idn_vmc']."','nom2".$jwib_aso['idn_vmc']."')";
								 include('vrbutton.php'); ?>
							<br>
							</td>
						<?php } ?>
						</tr>

						<tr align="center" style="border-top:solid 1px;" valign="center">
						<td rowspan=2 style="background-color:#5A6A70; border-right:solid 1px; ">
						<?php echo 'TDB'; ?>
						</td>
						<td style="border-right:solid 1px;"  valign="center">
							<?php //echo $tdb1; ?>
							<?php echo $jwib_aso['jwol_tdb1']; ?>
							<br>
						</td>
						<td style="border-right:solid 1px;" >
						<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_tdb']; $pobj=1; $pdefa=$jwib_aso['nom1tdb']; $plong=20; $psize=25; $pdocu='VM21'; $pcolu='nombre1'; include('vrgettxt.php'); ?>
						<?php }else{ ?> 
							<?php echo ''.$jwib_aso['nom1tdb']; ?>
						<?php } ?>
						</td>
						</tr>
						<tr align="center" valign="center">
						<td style="border-right:solid 1px;">
								<?php //echo $tdb2; ?>
							<?php echo $jwib_aso['jwol_tdb2'];?>
							
						</td>
						<td>
						<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_tdb']; $pobj=1; $pdefa=$jwib_aso['nom2tdb']; $plong=20; $psize=25; $pdocu='VM21'; $pcolu='nombre2'; include('vrgettxt.php'); ?>
						<?php }else{ ?> 
							<?php echo ''.$jwib_aso['nom2tdb']; ?>
						<?php } ?>
						</td>
						</tr>
						<tr>
						<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
							<td></td>
							<td style="border-right:solid 1px;"></td>
							<td>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_tdb']; $psize=25;
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_tdb']."','".$docu."','nom1".$jwib_aso['idn_tdb']."','nom2".$jwib_aso['idn_tdb']."')";
								 include('vrbutton.php'); ?>
							<br>
							</td>
						<?php } ?>
						</tr>

						<tr align="center" style="border-top:solid 1px;" valign="center">
						<td rowspan=2 style="background-color:#961526; border-right:solid 1px; ">
						<?php echo 'NVC'; ?>
						</td>
						<td style="border-right:solid 1px;"  >
							<?php //echo $nvc1; ?>
							<?php echo $jwib_aso['jwol_nvc1'];?>
							
							<br>
						</td>
						<td style="border-right:solid 1px;">
						<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_nvc']; $pobj=1; $pdefa=$jwib_aso['nom1nvc']; $plong=20; $psize=25; $pdocu='VM41'; $pcolu='nombre1'; include('vrgettxt.php'); ?>
						<?php }else{ ?> 
							<?php echo ''.$jwib_aso['nom1nvc']; ?>
							<?php } ?>
						</td>
						</tr>
						<tr align="center" valign="center">
						<td style="border-right:solid 1px;">
							<i><?php //echo 'Asignación 2' ?></i>
							<?php //echo $nvc2; ?>
							<?php echo $jwib_aso['jwol_nvc2'];?>
						</td>
						<td>
						<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
								<?php if($jwib_aso['jwol_nvc2']==""){$phide=1;};?>							
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_nvc']; $pobj=1; $pdefa=$jwib_aso['nom2nvc']; $plong=20; $psize=25; $pdocu='VM41'; $pcolu='nombre2'; include('vrgettxt.php'); ?>
						<?php }else{ ?> 
							<?php echo ''.$jwib_aso['nom2nvc']; ?>
						<?php } ?>
						</td>
						</tr>
						<tr style="border-bottom:solid 1px;">
						<?php if(($full or $vida==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
							<td></td>
							<td style="border-right:solid 1px;"></td>
							<td>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_nvc']; $psize=25;
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_nvc']."','".$docu."','nom1".$jwib_aso['idn_nvc']."','nom2".$jwib_aso['idn_nvc']."')";
								 include('vrbutton.php'); ?>
							<br>
							</td>
						<?php } ?>
						</tr>


			
				<?php } ?>
					

				<?php } ?>
			
		</table>

		<?php } ?>

		<?php if($printer){ ?>
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
		<?php echo 'VIDA Y MINISTERIO'; ?>
		</title>
		<style type="text/css">
		/* body{ font-family:"Courier New", Courier, monospace;} */
		@page {
		/*    size: 7in 9.25in; */
		/* 	 top left bott right */
		/*     size: 210mm 297mm;  */
		/*     margin: 0mm 10mm 10mm 0mm; /* 	top right bottom left */ */
				size: 105mm 148mm; 
				margin: 20mm 5mm 0mm 5mm; /* 	top right bottom left */
		}

		</style>

		</head>
		<body>

	
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="50%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;font-size:12px;"  border=0>
			<?php $lmes=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #A9F5F2;font-size:15px;">
									<th align="center" style="" colspan=3>
										<?php echo 'ASIGNACIONES PARA LA REUNION '; ?>
										<br>
										<?php echo 'VIDA Y MINISTERIO : '.$jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
								</tr>
					<?php } ?>
				<tr style="<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4){echo 'font-weight:bold;';}?>font-size:15px;border-top:solid 1px; border-bottom:solid 1px;background: #A9F5F2;" align="center">
						<td colspan=3>
								<?php echo $jwib_aso['fdianr'].' - '.$jwib_aso['fechadmyr']; ?>
						</td>
				</tr>
			
				<tr style="<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4){echo 'font-weight:bold;';}?>font-size:15px;border-top:solid 1px;" align="center">
					
				</tr>
																											 
					<?php if(1==1)	{ ?>
						<tr align="center" style="border-top:solid 1px;">
						<td rowspan=2 style="background-color:#799FCC; border-right:solid 1px; ">
						<?php echo 'VMC'; ?>
						</td>
						<td style="border-right:solid 1px;" width="50%" >
							<i><?php echo 'Presidente' ?></i>
						</td>
						<td style="border-right:solid 1px;" width="45%">
							<?php echo ''.$jwib_aso['nom1vmc']; ?>
						</td>
						</tr>
						<tr align="center">
						<td style="border-right:solid 1px;">
							<i><?php echo 'Oracion Final' ?></i>
						</td>
						<td>
							<?php echo ''.$jwib_aso['nom2vmc']; ?>
						</td>
						</tr>

						<tr align="center" style="border-top:solid 1px;">
						<td rowspan=2 style="background-color:#5A6A70; border-right:solid 1px; ">
						<?php echo 'TDB'; ?>
						</td>
						<td style="border-right:solid 1px;"  >
							<i><?php echo $jwib_aso['jwol_tdb1']; ?></i>
						</td>
						<td style="border-right:solid 1px;">
							<?php echo ''.$jwib_aso['nom1tdb']; ?>
						</td>
						</tr>
						<tr align="center">
						<td style="border-right:solid 1px;">
							<i><?php echo $jwib_aso['jwol_tdb2']; ?></i>
						</td>
						<td>
							<?php echo ''.$jwib_aso['nom2tdb']; ?>
						</td>
						</tr>

						<tr align="center" style="border-top:solid 1px;">
						<td rowspan=2 style="background-color:#961526; border-right:solid 1px; ">
						<?php echo 'NVC'; ?>
						</td>
						<td style="border-right:solid 1px;"  >
							<i><?php echo $jwib_aso['jwol_nvc1']; ?></i>
						</td>
						<td style="border-right:solid 1px;">
							<?php echo ''.$jwib_aso['nom1nvc']; ?>
						</td>
						</tr>
						<tr align="center" >
						<td style="border-right:solid 1px; ">
							<i><?php echo $jwib_aso['jwol_nvc2']; ?></i>
						</td>
						<td>
							<?php echo ''.$jwib_aso['nom2nvc']; ?>
						</td>
						</tr>


			
				<?php } ?>
					

				<?php } ?>
			<tr style="border-top:solid 2px;">
				<td colspan="3" align="right">
				<?php echo 'jwib.vcrxol.com/?'.$_SESSION['cong_codigo']; ?>
				</td>
			</tr>
		</table>


		<?php } ?>

<?php } ?>

<?php if(mb_stristr('MMAE',$docu)) { ?>

		<?php if($mobile=='false' and !$printer){ ?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; include('vrbutton.php');?>
									<?php } ?>
										

			<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
<!-- <div id="scrollhere" ></div>			 -->
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;" border=0>
			<?php $lmes=''; ?>
			<?php $lsema=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
				<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #C18626;">
									<th width="30%" align="center" style="">
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
									<th width="" colspan=2 style="background-color:#C18626; color:white;">SEAMOS MEJORES MAESTROS</th>
									<th width="" align="right">
									<?php 
											$pcaption="Imprimir"; $pidtxt='imprimir'.$jwib_aso['idnum1']; 
											$ponclick="jwib_rpu1('".$docu."','".$jwib_aso['fanior']."','".$jwib_aso['fmesr']."')";
											include('vrbutton.php');
									?>
									</th>
								</tr>
					<?php } ?>
					<?php if($jwib_aso['fsema']!=$lsema){ ?>
					<?php $pfecha=$jwib_aso['fecha']; //include('jwib_geturl.php') ?>
<!-- 					<input type="text" class="jwfecha" style="display:none;" value="<?php //echo $jwib_aso['fecha'] ?>"> -->
					<?php $lsema=$jwib_aso['fsema']; ?>
								<tr id="sema<?php echo $jwib_aso['fsema']; ?>" style="border-top:solid 1px;border-bottom:solid 1px;background-color: #C18626;font-size:15px; <?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4){echo 'font-weight:bold;';}?>display:;">
									<th  width="" style="background-color:#C18626; color:white;" onclick="{window.open('<?php echo $jworgl.str_replace('-','/',$jwib_aso['fecha']); ?>','_blank');}">
										<?php if($jwib_aso['fechar']>=$fechaa){ ?>
					<a name="scroll"></a>
										<div id="scrollhere" ></div>
										<?php } ?>
										<?php echo $jwib_aso['fdianr'].' - '.$jwib_aso['fdiar'].'/'.$jwib_aso['fmesnr']; ?>
									</th>
									<th style="background-color:#C18626; color:white;">PRINCIPAL</th>
									<th style="background-color:#C18626; color:white;">SALA 1</th>
									<th style="background-color:#C18626; color:white;">SALA 2</th>
								</tr>
					<?php } ?>
			
				<?php $jwol_smm=''; ?>
				<?php if($jwib_aso['docu']=='VM30'){$jwol_smm=$jwib_aso['jwol_smm0'];} ?>
				<?php if($jwib_aso['docu']=='VM31'){$jwol_smm=$jwib_aso['jwol_smm1'];} ?>
				<?php if($jwib_aso['docu']=='VM32'){$jwol_smm=$jwib_aso['jwol_smm2'];} ?>
				<?php if($jwib_aso['docu']=='VM33'){$jwol_smm=$jwib_aso['jwol_smm3'];} ?>
				<tr style="border-bottom:dotted 1px; <?php if($jwol_smm=='' and $jwib_aso['jwol_smm0']!=''){echo 'display:none;';} ?>" align="center" valign="top" >
					<td align="">
						<?php if($jwol_smm!=''){echo $jwol_smm;}else{echo $jwib_aso['docu_descri']; } ?>
						<?php //echo $jwib_aso['docu_descri']; ?>
<!-- 						<br> -->
						<?php //echo $jwol_smm; ?>
					</td>

					
				<?php  //$salas=2;?>
					
					<?php for ($csala=0;$csala<=2;$csala++) { ?>
					<?php if(($full or $mmae==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
						<td style="<?php if($csala>$salas){echo 'display:none;';} ?>" >
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_sala'.$csala]; $pobj=1; $pdefa=$jwib_aso['nom1sala'.$csala]; $plong=20; $pdocu=$jwib_aso['docu']; $pcolu='nombre1'; 
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_sala'.$csala]."').click()}";
									include('vrgettxt.php'); ?>
								<div style="<?php if($jwib_aso['docu']=='VM30'){echo 'display:none;';} ?>" >
								<br>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_sala'.$csala]; $pobj=1; $pdefa=$jwib_aso['nom2sala'.$csala]; $plong=20; $pdocu=$jwib_aso['docu']; $pcolu='nombre2';
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_sala'.$csala]."').click()}";
									include('vrgettxt.php'); ?>
								</div>
								<br>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_sala'.$csala]; 
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_sala'.$csala]."','".$docu."','nom1".$jwib_aso['idn_sala'.$csala]."','nom2".$jwib_aso['idn_sala'.$csala]."')";
								 include('vrbutton.php'); ?>
								<br>
						</td>
					<?php }else{ ?>
						<td>
								<div style="<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4){echo 'font-weight:bold;';}?>;">
								<?php echo (($jwib_aso['nom1sala'.$csala])); ?>
								</div>
								<div style="<?php if($jwib_aso['docu']=='VM30'){echo 'display:none;';} ?>;" >
<!-- 								<br> -->
								<?php echo ucwords(strtolower($jwib_aso['nom2sala'.$csala])); ?>
								</div>
						</td>
					<?php } ?>
					<?php } ?>
				</tr>
				<?php } ?>
		</table>
		<?php } ?>

		<?php if($mobile=='true' and !$printer){ ?>
<?php // echo $jwib_sql; ?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; $psize=30;include('vrbutton.php');?>
									<?php } ?>

			<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
			
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;" border=1>
			<?php $lmes=''; ?>
			<?php $lsema=''; ?>
			<?php $ldocu=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
				<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #C18626; font-size:30px; ">
									<th align="center" style="" colspan=3 >
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
<!-- 									<th width="" colspan=1 style="background-color:#C18626; font-size:30px; color:white;">SEAMOS MEJORES MAESTROS</th> -->
								</tr>
					<?php } ?>
					<?php if($jwib_aso['fsema']!=$lsema){ ?>
					<?php $pfecha=$jwib_aso['fecha']; //include('jwib_geturl.php') ?>
<!-- 					<input type="text" class="jwfecha" style="display:none;" value="<?php //echo $jwib_aso['fecha'] ?>"> -->
					<?php $lsema=$jwib_aso['fsema']; ?>
					<?php $ldocu=''; ?>
								<tr style="border-top:solid 1px;border-bottom:solid 1px;background: #C18626;font-size:30px; display:;">
									<th style="background-color:#C18626; color:white;" colspan=3 onclick="{window.open('<?php echo $jworgl.str_replace('-','/',$jwib_aso['fecha']); ?>','_blank');}">
										<?php if($jwib_aso['fechar']>=$fechaa){ ?>
					<a name="scroll"></a>
										<div id="scrollhere" ></div>
										<?php } ?>
										<?php echo $jwib_aso['fdianr'].' - '.$jwib_aso['fdiar'].' /'.$jwib_aso['fmesnr']; ?>
									</th>
								</tr>
								<tr style="border-top:solid 1px;border-bottom:solid 1px;background: #C18626;font-size:30px; display:none;">
									<td style="background-color:#C18626; color:white;" align="left" >
										<?php echo '1'; ?>
									</td>
									<th style="background-color:#C18626; color:white;" align="left" >
										<?php echo '2'; ?>
									</th>
									<th style="background-color:#C18626; color:white;" align="left" >
										<?php echo '3'; ?>
									</th>
								</tr>
					<?php } ?>
			
					<?php if($jwib_aso['docu']!=$ldocu){ ?>
					<?php $ldocu=$jwib_aso['docu']; ?>

							<?php $jwol_smm=''; ?>
							<?php if($jwib_aso['docu']=='VM30'){$jwol_smm=$jwib_aso['jwol_smm0'];} ?>
							<?php if($jwib_aso['docu']=='VM31'){$jwol_smm=$jwib_aso['jwol_smm1'];} ?>
							<?php if($jwib_aso['docu']=='VM32'){$jwol_smm=$jwib_aso['jwol_smm2'];} ?>
							<?php if($jwib_aso['docu']=='VM33'){$jwol_smm=$jwib_aso['jwol_smm3'];} ?>
			
							<tr style="border-top:solid 2px;border-bottom:solid 2px; " align="center" valign="top">
								<td align="left"  colspan=3 style="">
									<?php //echo $jwib_aso['docu_descri']; ?>
									<?php $jwol_smm=str_replace('<br>',' ',$jwol_smm); ?>
									<?php $jwol_smm=str_replace('<div ','<div style="font-size:30px;" ',$jwol_smm); ?>
									<?php echo $jwol_smm; ?>
								</td>
							</tr>
					<?php } ?>
			
				<tr style="border-bottom:solid 1px;">
					<?php for ($csala=0;$csala<=2;$csala++) { ?>
					<?php if(($full or $mmae==1) and $jwib_aso['fechar']>=date('Y-m-d')) {?>
						<td style="font-size:30px;<?php if($csala>$salas){echo 'display:none;';} ?>" align="center" valign="top">
								<i><small>
								<?php if($csala==0){echo 'PRINCIPAL';}else{echo $csala;}; ?>
								<br>
								</small></i>
								<?php $pcaption='Nombre'; $pidtxt='nom1'.$jwib_aso['idn_sala'.$csala]; $pobj=1; $pdefa=$jwib_aso['nom1sala'.$csala]; $plong=20; $pdocu=$jwib_aso['docu']; $psize=25; $pcolu='nombre1'; 
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_sala'.$csala]."').click()}";
									include('vrgettxt.php'); ?>
								<div style="<?php if($jwib_aso['docu']=='VM30'){echo 'display:none;';} ?>" >
								<br>
								<?php $pcaption='Nombre'; $pidtxt='nom2'.$jwib_aso['idn_sala'.$csala]; $pobj=1; $pdefa=$jwib_aso['nom2sala'.$csala]; $plong=20; $pdocu=$jwib_aso['docu']; $psize=25; $pcolu='nombre2';
									$ponclick="{document.getElementById('gra1_".$jwib_aso['idn_sala'.$csala]."').click()}";
									include('vrgettxt.php'); ?>
								</div>
								<br>
							<?php $pcaption="Grabar"; $pidtxt='gra1_'.$jwib_aso['idn_sala'.$csala]; $psize=20; 
									$ponclick="jwib_graba1('".$pidtxt."','".$jwib_aso['idn_sala'.$csala]."','".$docu."','nom1".$jwib_aso['idn_sala'.$csala]."','nom2".$jwib_aso['idn_sala'.$csala]."')";
								 include('vrbutton.php'); ?>
								<br>
						</td>
					<?php }else{ ?>
						<td style="font-size:30px;" align="center" valign="top">
								<i><small>
								<?php if($csala==0){echo 'PRINCIPAL';}else{echo $csala;}; ?>
								<br>
								</small></i>
								<div style="<?php if(date_diff(date_create($jwib_aso['fechar']),date_create($fechaa))->format("%a")<4) {echo 'font-weight:bold;';} ?>">
								<?php echo ''.(($jwib_aso['nom1sala'.$csala]));   ?>
								<br>
								</div>	
								<?php echo ucwords(strtolower($jwib_aso['nom2sala'.$csala])); ?>
								<br>
								<?php if($csala==0){echo '<br>';} ?>
						</td>
					<?php } ?>
					<?php } ?>
			</tr>
				<?php } ?>
		</table>

		<?php } ?>

		<?php if($printer){ ?>
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
		<?php echo 'MEJORES MAESTROS'; ?>
		</title>
		<style type="text/css">
		/* body{ font-family:"Courier New", Courier, monospace;} */
		@page {
		/*    size: 7in 9.25in; */
		/* 	 top left bott right */
		/*     size: 210mm 297mm;  */
		/*     margin: 0mm 10mm 10mm 0mm; /* 	top right bottom left */ */
				size: 105mm 148mm; 
				margin: 20mm 5mm 0mm 5mm; /* 	top right bottom left */
		}

		</style>

		</head>
		<body>


		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;" border=0>
			<?php $lmes=''; ?>
			<?php $lsema=''; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
				<?php if($jwib_aso['fmesr']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #C18626;">
									<th width="40%" align="center" style="">
										<?php echo $jwib_aso['fmesnr'].' /'.$jwib_aso['fanior']; ?>
										<?php $lmes= $jwib_aso['fmesr']; ?>
									</th>
									<th width="" colspan=2 style="background-color:#C18626; color:white;">SEAMOS MEJORES MAESTROS</th>
									<th width="" align="right">
									</th>
								</tr>
					<?php } ?>
					<?php if($jwib_aso['fsema']!=$lsema){ ?>
					<?php $pfecha=$jwib_aso['fecha']; //include('jwib_geturl.php') ?>
<!-- 					<input type="text" class="jwfecha" style="display:none;" value="<?php //echo $jwib_aso['fecha'] ?>"> -->
					<?php $lsema=$jwib_aso['fsema']; ?>
								<tr style="border-top:solid 1px;border-bottom:solid 1px;background: #C18626;font-size:15px; display:;">
									<th style="background-color:#C18626; color:white;">
										<?php echo $jwib_aso['fdianr'].' - '.$jwib_aso['fdiar'].'/'.$jwib_aso['fmesnr']; ?>
									</th>
									<th style="background-color:#C18626; color:white;">PRINCIPAL</th>
									<th style="background-color:#C18626; color:white;">SALA 1</th>
									<th style="background-color:#C18626; color:white;">SALA 2</th>
								</tr>
					<?php } ?>
			
				<tr style="border-bottom:dotted 1px; <?php if($jwib_aso['fsema']==$semaa){echo '';}?>" align="center" valign="center">
					<td align="center" style="font-size:12px;">
						<?php if($jwib_aso['docu']=='VM30'){echo $jwib_aso['jwol_smm0'];} ?>
						<?php if($jwib_aso['docu']=='VM31'){echo $jwib_aso['jwol_smm1'];} ?>
						<?php if($jwib_aso['docu']=='VM32'){echo $jwib_aso['jwol_smm2'];} ?>
						<?php if($jwib_aso['docu']=='VM33'){echo $jwib_aso['jwol_smm3'];} ?>
					</td>

					<?php for ($csala=0;$csala<=2;$csala++) { ?>
					<td align="center" style="font-size:12px;">
								<?php echo (($jwib_aso['nom1sala'.$csala])); ?>
								<br>
								<?php echo ucwords(strtolower($jwib_aso['nom2sala'.$csala])); ?>
						</td>
					<?php } ?>
				</tr>
				<?php } ?>
			
			<tr style="border-top:solid 2px;">
				<td colspan="4" align="right">
				<?php echo 'jwib.vcrxol.com/?'.$_SESSION['cong_codigo']; ?>
				</td>
			</tr>
		</table>

		<?php } ?>

<?php } ?>

<?php if(mb_stristr('VARI',$docu)) { ?>
		<?php if($mobile=='false'){ ?>
		<?php if(($full or $vari==1) ) {?>
			<?php// echo $jwib_sql; ?>
			
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white; " border=0>
			<tr>
			<?php $pcaption='FECHA'; $pidtxt='fecha'; $pobj=2; include('vrgetfec.php'); ?>
			<?php $pcaption='ASUNTO'; $pidtxt='asunto'; $pobj=2; $plong=120; $pdocu='VARI'; $pcolu='concepto'; include('vrgettxt.php'); ?>
			<td width = "1%">
			<?php $pcaption='GRABAR'; $pidtxt='grabar'; $ponclick=''; $ponclick="jwib_graba1('".$pidtxt."','','".$docu."','fecha','asunto')";	include('vrbutton.php'); ?>
			</td>
			<td>
			</td>	
			</tr>
		</table>			
		<br>
		<?php } ?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; include('vrbutton.php');?>
									<?php } ?>

		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>

		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white; "  border=0>
			<?php $lmes=''; ?>
			<?php $linea=1; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fmes']!=$lmes){ ?>
								<tr style="border-top:solid 2px;border-bottom:solid 2px;background: #A9F5F2;font-size:15px;">
									<th width="10%">
										<?php echo ''.$jwib_aso['fmesn'].' /'.$jwib_aso['fanio']; ?>
										<?php $lmes= $jwib_aso['fmes']; ?>
										<?php $linea= 1; ?>
									</th>
									<th width="50%">ASUNTO</th>
									<th>ADJUNTO</th>
									<th>
									</th>
								</tr>
					<?php } ?>
			
				<tr id="<?php echo 'tr_'.$jwib_aso['docu'].$jwib_aso['idnum1'];?>" style="<?php if($linea==4){echo 'border-bottom:dotted 1px;';$linea=1;}else{$linea++;} ?>" align="center" valign="top">
						<td style="">
							<?php echo $jwib_aso['fdia'].'/'.$jwib_aso['fmesn']; ?>
						</td>
						<td style="" align="left">
							<?php echo $jwib_aso['concepto']; ?>
						</td>
						<td align="left" style="font-family:arial; font-size:12px;" >
						<a target="_blank" href="<?php echo '../'.$docu.'/'.$jwib_aso['adjunto1']; ?>" id="<?php echo $jwib_aso['docu'].$jwib_aso['idnum1']?>">
							<?php echo $jwib_aso['adjunto1'];?>
							</a>
						</td>

					<?php if(($full or $vari==1) ) {?>
							<td align="left">
								<div id="adjt_<?php echo $jwib_aso['docu'].$jwib_aso['idnum1']?>" style="display:<?php if($jwib_aso['adjunto1']==''){echo 'block';}else{echo 'none';} ?>;">
								<?php $pcaption='ADJUNTAR'; $pdocu=$jwib_aso['docu'];$pidnum=$jwib_aso['idnum1'];$pidtxt='adjt'.$jwib_aso['idnum1']; $pobj=3; $pmulti=1; $psize=12; $paccept='.pdf'; 
										 include('vrgetfil.php'); ?>
								</div>
								<div id="remo_<?php echo $jwib_aso['docu'].$jwib_aso['idnum1']?>" style="display:<?php if($jwib_aso['adjunto1']!=''){echo 'block';}else{echo 'none';} ?>;">
								<?php 
										$pcaption="Remover Adj."; $pidtxt='remove'.$jwib_aso['idnum1']; 
										$pdocu=$jwib_aso['docu'];$pidnum=$jwib_aso['idnum1'];
										$pdescri=$jwib_aso['adjunto1'];
										$ponclick="remove_adjt1('".$pidtxt."')";
										include('vrbutton.php');
									?>
								</td>
								</div>
					<?php } ?>
	
				</tr>
			<?php } ?>

		</table>			
		<?php } ?>
			
		<?php if($mobile=='true'){ ?>
									<?php if($bmodif) { ?>
									<?php $pcaption='Modificar'; $pidtxt='modificar'; $ponclick="jwib_rpu1('".$docu."','','','1')"; $psize=30;include('vrbutton.php');?>
									<?php } ?>
		<?php if(($full or $vari==1) ) {?>
			<?php// echo $jwib_sql; ?>
			
		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white; font-size:40px;" border=0>
			<tr>
			<?php $pcaption='FECHA'; $pidtxt='fecha'; $pobj=2; $psize=40; include('vrgetfec.php'); ?>
			</tr>
			<tr>
			<?php $pcaption='ASUNTO'; $pidtxt='asunto'; $pobj=2; $psize=40;  $plong=30; $prows=3; $pdocu='VARI'; $pcolu='concepto'; include('vrgettxt.php'); ?>
			</tr>
			<tr>
			<td >
			<br>	
			<?php $pcaption='GRABAR'; $pidtxt='grabar'; $psize=40; $ponclick=''; $ponclick="jwib_graba1('".$pidtxt."','','".$docu."','fecha','asunto')";	include('vrbutton.php'); ?>
			</td>
			</tr>
		</table>			
		<br>
		<?php } ?>
			
		<?php $jwib_res=msql_query($jwib_sql,$link_vcrx); ?>

		<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white; font-size:30px;"  border=0>
			<?php $lmes=''; ?>
			<?php $linea=1; ?>
			<?php while($jwib_aso=msql_fetch_assoc($jwib_res)){	?>  
					<?php if($jwib_aso['fmes']!=$lmes){ ?>
								<tr style="border-top:solid 2px;background: #A9F5F2;font-size:30px;">
									<th align="center" style="" colspan=2>
									</th>
								</tr>
								<tr style="border-bottom:solid 2px;background: #A9F5F2;font-size:30px;">
									<th width="15%">
										<?php echo ''.$jwib_aso['fmesn'].' /'.$jwib_aso['fanio']; ?>
										<?php $lmes= $jwib_aso['fmes']; ?>
										<?php $linea= 1; ?>
									</th>
									<th >ASUNTO</th>
<!-- 									<th>ADJUNTO</th> -->
<!-- 									<th></th> -->
								</tr>
					<?php } ?>
			
				<tr style="<?php if($linea==1){echo 'border-bottom:dotted 1px;';$linea=1;}else{$linea++;} ?>; " align="center" >
						<td valign="top" style="">
							<?php //echo $jwib_aso['fdian'].' /'.$jwib_aso['fdia']; ?>
							<?php echo $jwib_aso['fdia'].'/'.$jwib_aso['fmesn']; ?>		
						</td>
						<td style="" align="left">
							<div>
							<?php echo $jwib_aso['concepto']; ?>
							</div>
<!-- 						</td> -->
<!-- 						<td align="left" style="font-family:arial; font-size:12px;" > -->
							<div>
								
						<a target="_blank" href="<?php echo '../'.$docu.'/'.$jwib_aso['adjunto1']; ?>" id="<?php echo $jwib_aso['docu'].$jwib_aso['idnum1']?>">
							<?php echo $jwib_aso['adjunto1'];?>
							</a>
							</div>
							<br>
<!-- 						</td>
 -->
					<?php if(($full or $vari==1) ) {?>
					<div>
						
<!-- 							<td align="left"> -->
								<div id="adjt_<?php echo $jwib_aso['docu'].$jwib_aso['idnum1']?>" style="display:<?php if($jwib_aso['adjunto1']==''){echo 'block';}else{echo 'none';} ?>;">
								<?php $pcaption='ADJUNTAR'; $pdocu=$jwib_aso['docu'];$pidnum=$jwib_aso['idnum1'];$pidtxt='adjt'.$jwib_aso['idnum1']; $pobj=2; $psize=40; $pmulti=1; $paccept='.pdf'; 
										 include('vrgetfil.php'); ?>
								</div>
								<div id="remo_<?php echo $jwib_aso['docu'].$jwib_aso['idnum1']?>" style="display:<?php if($jwib_aso['adjunto1']!=''){echo 'block';}else{echo 'none';} ?>;">
								<?php 
										$psize=30;
										$pcaption="Remover Adj."; $pidtxt='remove'.$jwib_aso['idnum1']; 
										$pdocu=$jwib_aso['docu'];$pidnum=$jwib_aso['idnum1'];
										$pdescri=$jwib_aso['adjunto1'];
										$ponclick="remove_adjt1('".$pidtxt."')";
										include('vrbutton.php');
									?>
								</div>
<!-- 								</td> -->
					</div>
							<br>
						</td>
					<?php } ?>
	
				</tr>
			<?php } ?>

		</table>			
		<?php } ?>
			
<?php } ?>
			

			
<?php if(mb_stristr('XLSX',$docu)) { ?>
<?php

$xlsfile="../informes.xlsx";
$xlsx = new SimpleXLSX($xlsfile);
echo date("H:i:s");
	
$hojas=	$xlsx->sheetNames();

for( $choja = 0; $choja <= count($hojas); $choja++)
{
	echo $hojas[$choja];
	echo "\n";
	if($hojas[$choja]=='Publicadores')
	{
			$xfila=$xlsx->rows($choja);

			$xcabe= $xfila[0];
			for( $ccolu = 0; $ccolu <= count($xcabe); $ccolu++)
			{
				if($xcabe[$ccolu]=='codigo'){$col_codigo=$ccolu;}
				if($xcabe[$ccolu]=='nombre'){$col_nombre=$ccolu;}
				if($xcabe[$ccolu]=='grupo'){$col_zsub=$ccolu;}
				if($xcabe[$ccolu]=='email'){$col_email=$ccolu;}
				if($xcabe[$ccolu]=='bautismo'){$col_bautismo=$ccolu;}
				if($xcabe[$ccolu]=='cdla'){$col_calle1=$ccolu;}
				if($xcabe[$ccolu]=='direccion'){$col_calle2=$ccolu;}
			}
		
			for( $cfila = 1; $cfila <= count($xfila); $cfila++)
			{
				$xregi= $xfila[$cfila];

				$regi_sql='insert into enti0(enti_codigo)value('.$xregi[$col_codigo].')';
				$regi_res=msql_query($regi_sql,$link_vcrx);
				
				$regi_sql='update enti0 set ';
				$regi_sql.='enti_descri="'.$xregi[$col_nombre].'", ';
				$regi_sql.='enti_zsub="'.$xregi[$col_zsub].'", ';
				$regi_sql.='enti_calle1="'.$xregi[$col_calle1].'", ';
				$regi_sql.='enti_calle2="'.$xregi[$col_calle2].'", ';
				$regi_sql.='enti_status="-" ';
				$regi_sql.='where enti_codigo='.$xregi[$col_codigo];
				$regi_res=msql_query($regi_sql,$link_vcrx);
// 				echo $regi_sql;
				
			}
// 			echo $xcolu[2];

	}
	
	if($hojas[$choja]=='Informes')
	{
			$xfila=$xlsx->rows($choja);

			$xcabe= $xfila[0];
			for( $ccolu = 0; $ccolu <= count($xcabe); $ccolu++)
			{
				if($xcabe[$ccolu]=='idPub'){$col_enti=$ccolu;}
				if($xcabe[$ccolu]=='mes'){$col_fecha=$ccolu;}
				if($xcabe[$ccolu]=='codTp'){$col_tipo=$ccolu;}
				if($xcabe[$ccolu]=='publicaciones'){$col_public=$ccolu;}
				if($xcabe[$ccolu]=='presentaciones'){$col_presen=$ccolu;}
				if($xcabe[$ccolu]=='horas'){$col_horas=$ccolu;}
				if($xcabe[$ccolu]=='revisitas'){$col_revisi=$ccolu;}
				if($xcabe[$ccolu]=='estudios'){$col_cursos=$ccolu;}
				if($xcabe[$ccolu]=='nota'){$col_concepto=$ccolu;}
			}

				$regi_sql='delete from jwrt1';
				$regi_res=msql_query($regi_sql,$link_vcrx);
				
				$regi_sql='alter table jwrt1 AUTO_INCREMENT=1';
				$regi_res=msql_query($regi_sql,$link_vcrx);
		
			for( $cfila = 1; $cfila <= count($xfila); $cfila++)
			{
				$xregi= $xfila[$cfila];

				$regi_sql='insert into jwrt1(docu,status,idate)value("RPC1","-",now())';
				$regi_res=msql_query($regi_sql,$link_vcrx);
				
				$regi_sql='select max(idnum1) as idnum1 from jwrt1';
				$regi_res=msql_query($regi_sql,$link_vcrx);
				$idnum1 = msql_result($regi_res,0,'idnum1');
				
				$regi_sql='update jwrt1 set ';
				$regi_sql.='enti="'.$xregi[$col_enti].'", ';
				$regi_sql.='fecha="'.$xregi[$col_fecha].'01'.'", ';
				$regi_sql.='public="'.$xregi[$col_public].'", ';
				$regi_sql.='presen="'.$xregi[$col_presen].'", ';
				$regi_sql.='horas="'.$xregi[$col_horas].'", ';
				$regi_sql.='revisi="'.$xregi[$col_revisi].'", ';
				$regi_sql.='cursos="'.$xregi[$col_cursos].'", ';
				$regi_sql.='concepto="'.$xregi[$col_concepto].'", ';
				$regi_sql.='status="-" ';
				$regi_sql.='where idnum1='.$idnum1;
				$regi_res=msql_query($regi_sql,$link_vcrx);
				
			}

	}
	
}

	

?> 
			
<?php } ?>
	

<?php if(mb_stristr('RPC1',$docu)) { ?>
			<div id="head1">
			<table cellspacing="0" cellpadding="2" width="100%" style="border-collapse:collapse;border:#000000 solid 2px;background-color:white;">
				<tr>
					<td>
						<?php 	$pidtxt='fecha1'; $pcaption='Desde'; $pdefa='2000-01-01'; include('vrgetfec.php'); ?>
						<?php 	$pidtxt='fecha2'; $pcaption='Hasta'; include('vrgetfec.php'); ?>
						<?php 	$pidtxt='grupo'; $pcaption='Grupo'; $plong=3; include('vrgetnum.php'); ?>
					</td>
				</tr>
			</table>
			</div>
	
			
<?php } ?>			
			
			</div>	

			