<?php
// die();
if(empty($znombre1)){return;}


if(empty($zsala)){$zsala='PRINCIPAL';}

     $domd0 = new DOMDocument();
          $domd0->encoding = 'utf-8';
          $domd0->xmlVersion = '1.0';
          $domd0->formatOutput = true;
     $elem0=$domd0;




     if(!empty($zdom)){$domd0=$zdom;}
     if(!empty($zele)){$elem0=$zele;}



     $div=$elem0->appendChild($domd0->createElement("div",''));
          $xstyle0='';
          $xstyle0.='width:9cm;';
          $xstyle0.='height:13cm; ';
          $xstyle0.='float:left;';
          $xstyle0.='margin-right:0.1cm;';
          $xstyle0.='margin-bottom:0.1cm;';
          $xstyle0.='border:double 4px;';
          $xstyle0.='font-family:arial;';
          $xstyle0.='page-break-inside: avoid;';
          $xstyle0.='line-height: normal;';
          $xstyle0.='vertical-align:top !important;';


          $div->setAttribute('style',$xstyle0);

     $table=$div->appendChild($domd0->createElement("table",''));
//           $table->setAttribute('border','1');
          $table->setAttribute('width','100%');

     $trow=$table->appendChild($domd0->createElement("tr",''));
     $tcol=$trow->appendChild($domd0->createElement("td",""));
          $div=$tcol->appendChild($domd0->createElement("div","ASIGNACION PARA LA REUNION"));
          $div=$tcol->appendChild($domd0->createElement("div","VIDA Y MINISTERIO CRISTIANOS"));
          $tcol->setAttribute('bold','');
          $tcol->setAttribute('align-c','');
          $tcol->setAttribute('colspan','10');
          $tcol->setAttribute('style','padding:15px;');

     $trow=$table->appendChild($domd0->createElement("tr",''));
     $tcol=$trow->appendChild($domd0->createElement("td",""));
          $tcol->setAttribute('style','width:2.3cm;');


     $trow=$table->appendChild($domd0->createElement("tr",''));
     $tcol=$trow->appendChild($domd0->createElement("td","Nombre :"));
          $tcol->setAttribute('style','height:2.0em;');
          $tcol->setAttribute('bold','');
     $tcol=$trow->appendChild($domd0->createElement("td",$znombre1));
          $tcol->setAttribute('bold','');

     $trow=$table->appendChild($domd0->createElement("tr",''));
     $tcol=$trow->appendChild($domd0->createElement("td","Ayudante :"));
          $tcol->setAttribute('style','height:2.0em;');
          $tcol->setAttribute('bold','');
     $tcol=$trow->appendChild($domd0->createElement("td",$znombre2));

     $trow=$table->appendChild($domd0->createElement("tr",''));
     $tcol=$trow->appendChild($domd0->createElement("td","Fecha :"));
          $tcol->setAttribute('style','height:2.0em;');
          $tcol->setAttribute('bold','');
     $tcol=$trow->appendChild($domd0->createElement("td",$zfecha));


     {
     $jwol_smm=str_replace('<a','<b',$jwol_smm);
     $jwol_smm=str_replace('</a','</b',$jwol_smm);
     $jwol_smm=str_replace('<p','<x',$jwol_smm);
     $jwol_smm=str_replace('</p','</x',$jwol_smm);
     $jwol='';
     $jwol=$domd0->createDocumentFragment();
     $aa=$jwol->appendXML($jwol_smm);               
     }

     $trow=$table->appendChild($domd0->createElement("tr",''));
          $trow->setAttribute('size80','');
//      $tcol=$trow->appendChild($domd0->createElement("td","Intervención :"));
     $tcol=$trow->appendChild($domd0->createElement("td","Asignación :"));
//           $tcol->setAttribute('size80','');
          $tcol->setAttribute('style','height:2.0em;');
          $tcol->setAttribute('bold','');
          $tcol->setAttribute('style','vertical-align:top;');
     $tcol=$trow->appendChild($domd0->createElement("td",''));
          $tcol->appendChild($jwol);


     $trow=$table->appendChild($domd0->createElement("tr",''));
     $tcol=$trow->appendChild($domd0->createElement("td","Sala :"));
//           $tcol->setAttribute('style','padding:0 0 20px 10px;');
          $tcol->setAttribute('bold','');
     $tcol=$trow->appendChild($domd0->createElement("td",$zsala));
          $tcol->setAttribute('style','height:2.0em;');
//           $tcol->setAttribute('style','padding:0 0 20px 10px;');


     $trow=$table->appendChild($domd0->createElement("tr",''));
     $tcol=$trow->appendChild($domd0->createElement("td",""));
          $tcol->setAttribute('colspan','10');
          $tcol->setAttribute('size80','');
          $tcol->setAttribute('style','text-align:justify; line-height: normal; padding:15px;');
//           $tcol->setAttribute('style','padding:0 0 20px 10px;');

          $span=$tcol->appendChild($domd0->createElement("span","Nota al estudiante:"));
               $span->setAttribute('bold','');
          $span=$tcol->appendChild($domd0->createElement("span","En la Guía de actividades encontrará la información que necesita para su intervención."));
          $span=$tcol->appendChild($domd0->createElement("div","Prepare con la ayuda del libro Benefíciese el aspecto de la oratoria que se le indica en esta hoja."));
//           $span=$tcol->appendChild($domd0->createElement("div",""));
          $span=$tcol->appendChild($domd0->createElement("div","No olvide llevar su libro a la reunión Vida y Ministerio."));
               $span->setAttribute('bold','');




     $trow=$table->appendChild($domd0->createElement("tr",''));
     $tcol=$trow->appendChild($domd0->createElement("td","jwib.vcrxol.com/?11569"));
          $tcol->setAttribute('colspan','10');
          $tcol->setAttribute('size80','');
          $tcol->setAttribute('style','text-align:right; line-height: normal; padding:15px;');


//      if(empty($idnum))
     {
          $linka='';
          $linka.=$_SERVER['HTTP_HOST'];
          $linka.='?scri=jwib_asig4';
          $linka.='&cong='.$cong_codigo;
          $linka.='&idnum='.$zidnum;
          
          $domj = new DOMDocument();
          $domj->loadHTML($jwol_smm, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
          $b = $domj->getElementsByTagName('b')->item(0);          

          $zintervencion=$b->textContent;          

          $atributos = [];
          foreach ($b->attributes as $attr)
          {$atributos[$attr->nodeName] = $attr->nodeValue;}
          $linkb=$atributos['href'];
          $linkb=str_replace(' ','%20',$linkb);
                    
          $eol="\r\n";
          $texto='';
          $texto.='*== ASIGNACION MEJORES MAESTROS ==*'.$eol;
          $texto.=$eol;
          $texto.='😀 Nombre       : '.$znombre1.$eol;
          if(!empty($znombre2))
          {$texto.='🙂 Ayudante     : '.$znombre2.$eol;}
          $texto.='📆 Fecha        : '.$zfecha .$eol;
          $texto.='📃 Asignación   : '.$zintervencion.$eol;
          $texto.='🪑 Sala             : '.$zsala.$eol;
          $texto.='🔗 Asignación   : '.$linka.$eol;
          $texto.='🔗 JW.ORG       : '.$linkb.$eol;
          $texto=urlencode($texto);
          

          
          $trow=$table->appendChild($domd0->createElement("tr",''));
               $trow->setAttribute('noprint',' ');
          
          $tcol=$trow->appendChild($domd0->createElement("td",""));
               $tcol->setAttribute('colspan','10');
               $tcol->setAttribute('size120','');
               $tcol->setAttribute('style','text-align:center; line-height: normal; padding:15px;');

          
          
               $href='';
               $href.='https://api.whatsapp.com/send/';
     //           $href.='&phone=';
               $href.='?text='.$texto;
               
          
               $ref=$tcol->appendChild($domd0->createElement("a","WhatsApp"));
                    $ref->setAttribute('float-l','');
                    $ref->setAttribute('href',$href);
                    $ref->setAttribute('target','_blank');
          
               
               $href="_doc/".$zdocu.'_'.str_pad($zidnum,9,'0',STR_PAD_LEFT).".ics";
               $ref=$tcol->appendChild($domd0->createElement("a","Recordar"));
                    $ref->setAttribute('float-r','');
                    $ref->setAttribute('href',$href);
                    $ref->setAttribute('target','_blank');
          
          
//                                         $ahref=$div->appendChild($domd->createElement("a",$nombre1." "));
//                                         $ahref->setAttribute("href","_doc/".$aso_jwib['docu'].'_'.str_pad($id_sala,9,'0',STR_PAD_LEFT).".ics");
//                                         $ahref->setAttribute("target","_blank");
          
          
          
          
     }





     

     if(empty($zdom))
     {
          if($zxml==1){$zxml=$domd0->saveXML();}
          else{echo $domd0->saveXML();}
     }     



include ('ele_reset.php');

?>



