<?php
// (c) 2012 GERSOFT. No se permite su copia partial o total. www.ugestor.com
?>
<?php           $xsphx=getenv('WWW_GERPHX'); if ($xsphx=="1") { unlink($nombre); }  $srootns=''; $saux=getenv('WWW_NS'); if ($saux!='') { $srootns='/'.$saux; }  if ($xsphx=="2") { include_once '../pho/gerweb.ino'; include_once '../pho/u_comun.ino'; } else { if ($xsphx=="0") { include_once '../php/gerweb.inc'; include_once '../php/u_comun.inc'; } else { include_once '../phx/gerweb.ino'; include_once '../phx/u_comun.ino'; } } session_start();  $xmod=$_GET[mod];    if ($xmod=='A') { $xcabecera='Alta noticia'; } else { $xcabecera='Modificacion noticia '; }  $_POST[ROWID]=str_replace(',', '', $_POST[ROWID]); $conn   = new gerdb; if ($conn->ID==-1) { Sin_sesion(); } $conn->ger_entolocal($geraplibd, 'WWW_GERAPLIBD'); if ($geraplibd!='') { $geraplibd=$geraplibd.".dbo."; }   echo "<html>\n"; echo "<head>\n"; echo "<title>Noticias</title>\n";  $xweb=$_POST[GERWEB]; $xempresa=$_POST[GEREMPRESA];  $xgerini=$_POST[GERINI]; $sini=$sinidos=''; if ($xgerini!='') { $sini=$_POST[GERINI] . "/"; $sinidos=$_POST[GERINI]."\\"; }  echo "  <link rel=\"stylesheet\" type=\"text/css\" href=\"".$srootns."/" . $_POST[GERPERFIL] . "/base/pestanas/pesta.css\">\n"; echo "  <link href=\"".$srootns."/" . $_POST['GERPERFIL'] . "/uweb/css/".$sini."". $_POST['GERWEB'] . ".css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\"/>\n";  echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/ckeditor/ckeditor.js"></script>'; echo "\n"; echo '  <script type="text/javascript" src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendario/validafechas.js"></script>'; echo "\n"; echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/js/jscal2.js"></script>';  echo "\n"; echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/js/jscal2.js"></script>'; echo "\n"; echo '  <link rel="stylesheet" type="text/css" href="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/css/jscal2.css" />'; echo "\n"; echo '  <link rel="stylesheet" type="text/css" href="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/css/border-radius.css" />'; echo "\n"; echo '  <link rel="stylesheet" type="text/css" href="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/css/steel/steel.css" />'; echo "\n"; echo '  <!-- you actually only need to load one of these; we put them all here for demo purposes -->'; echo "\n"; if ($_POST[GERIDIOMA]=='ES') { echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/js/lang/es.js"></script>'; echo "\n"; } if ($_POST[GERIDIOMA]=='IN') { echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/js/lang/en.js"></script>'; echo "\n"; } if ($_POST[GERIDIOMA]=='FR') { echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/js/lang/fr.js"></script>'; echo "\n"; } if ($_POST[GERIDIOMA]=='PT') { echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/js/lang/pt.js"></script>'; echo "\n"; } if ($_POST[GERIDIOMA]=='CA') { echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/js/lang/ca.js"></script>'; echo "\n"; } if ($_POST[GERIDIOMA]=='AL') { echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/js/lang/de.js"></script>'; echo "\n"; } if ($_POST[GERIDIOMA]=='IT') { echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/js/lang/it.js"></script>'; echo "\n"; } if ($_POST[GERIDIOMA]=='RU') { echo '  <script src="'.$srootns.'/' . $_POST[GERPERFIL] . '/base/calendar/src/js/lang/ru.js"></script>'; echo "\n"; } /* echo "<style type=\"text/css\">\n"; echo "   textarea { width: 100%; margin: 0; padding: 0; border-width: 0; }\n"; echo "</style>\n"; */  echo '  <script type="text/javascript">';              echo "\n"; echo '     var cal = Calendar.setup({ ';               echo "\n"; echo '     onSelect: function(cal) { cal.hide() }, ';  echo "\n"; echo '     align:"r", ';                           echo "\n"; echo '     showTime: false ';                           echo "\n"; echo '     }); ';                                      echo "\n"; echo '   </script>';                                   echo "\n"; echo "</head>\n";  echo "<body>\n";  Actualizar_tit_cabe($xcabecera);  $tpanta=array(); $buffer='select * from ' . $geraplibd . 'XW_PANTALLA where WEB=\'' . $xweb . '\' and EMPRESA=\''. $xempresa . '\''; $conn->ger_exec  ($cursor1, $buffer); $rc= gerdb_fetch ($cursor1, $tpanta); if ($rc!='') { $tpanta[COLOR_RECUADRO]='#EEEEEE'; }   $geruser =   $_POST[GERUSER]; $gerpass =   $_POST[GERPASS]; $identi=$_POST[ROWID];  $web     = $_POST[GERWEB]; $empresa = $_POST[GEREMPRESA];     $idiomas_arr=array(); $buffer='select IDIOMA, CORTO, LARGO, GRAFICO from ' . $geraplibd . 'XW_IDIOMAS (NOLOCK) where WEB=\''.$web.'\'  and ACTIVO=\'S\' order by IDIOMA ASC'; $conn->ger_exec  ($cursor1, $buffer); $rc= gerdb_fetch ($cursor1, $idiomas_arr);  $idiomas=array(); $i=0; while ($rc==''){ $idiomas[$i][idioma] =$idiomas_arr[IDIOMA]; $idiomas[$i][corto]  =$idiomas_arr[CORTO]; $idiomas[$i][largo]  =$idiomas_arr[LARGO]; $idiomas[$i][grafico]=$idiomas_arr[GRAFICO]; $i++; $rc= gerdb_fetch ($cursor1, $idiomas_arr); }    $conn->ger_tradu($lit_noticia,     '#99999', 'Noticia','','','','Noticia'); $conn->ger_tradu($lit_grupo,       '#99999', 'Grupo','','','','Grup'); $conn->ger_tradu($lit_nuevogrupo,  '#99999', 'Definir nuevo grupo','','','','Definir nou grup'); $conn->ger_tradu($lit_fechaalta,   '#99999', 'Fecha alta','','','','Data alta'); $conn->ger_tradu($lit_fechacaduca, '#99999', 'Fecha caduca','','','','Data caducitat'); $conn->ger_tradu($lit_generales,   '#99999', 'Datos generales', 'Background', 'Des donnes gnrales', 'Fundo', 'Dades generals'); $conn->ger_tradu($lit_descri,      '#99999', 'Descripcin','','','','Descripci'); $conn->ger_tradu($lit_modificar,   '#99999', 'Aceptar','','','','Acceptar'); $conn->ger_tradu($cancelar,        '#99999', 'Cancelar','','','','Cancellar'); $conn->ger_tradu($lit_error1,      '#99999', 'Tiene que introducir un valor para los campos noticia y grupo','','','','T que introduir un valor per els camps noticia i grup');  $lit_tit = $xcabecera . " " . $lit_noticia; $xtitulo=$lit_tit; $modificado=""; $modificar='';     if($_POST[MODIFICAR]=='S' || $_POST[ACTUALIZAR]=='S'){     $sroot=getenv('WWW_ROOT'); $tiempo=microtime(true); if (isset($sroot)) { $dire=$sroot . '\\tmp\\'.$geruser; $ok=mkdir($dire); } else { $dire='c:\\inetpub\\wwwroot\\tmp\\'.$geruser; $ok=mkdir($dire); }  $fiche          = array(); $descri         = array(); $tamany         = array(); for ($ii=1; $ii<=8; $ii++) { $tamany[$ii]=0; } for ($ii=0; $ii<sizeof($idiomas); $ii++) { $jj=$ii+1; $kk=$idiomas[$ii][idioma]; $descri[$kk] = $_POST[Descri. $jj];  if (isset($sroot)) { $fiche[$kk]=$sroot . '\\tmp\\' . $geruser . '\\noticia'.$tiempo.$kk.'.txt'; } else { $fiche[$kk]='c:\\inetpub\\wwwroot\\tmp\\' . $geruser . '\\noticia'.$tiempo.$kk.'.txt'; } if (!$gestor = fopen($fiche[$kk], 'w')) { echo "No se puede abrir el archivo ($fiche[$kk])"; exit; } if (fwrite($gestor, $_POST['elm' . $jj]) === FALSE) { echo "No se puede escribir al archivo ($fiche[$kk])"; exit; } fclose($gestor);  if ($_POST['elm'.$jj]=='<p>&nbsp;</p>'){ $tamany[$kk]=0; } else { $tamany[$kk]=filesize($fiche[$kk]); }  }  $noticia             = $_POST[Noticia]; $fcaduca             = $_POST[fcaduca]; $falta               = $_POST[falta]; $grupo               = $_POST[Grupo]; if ($grupo=='@NUEVO'){ $grupo=$_POST[Grupo_nuevo]; }  if ($descri[1]==''){$descri[1]=$descri[2];} if ($descri[1]==''){$descri[1]=$descri[3];} if ($descri[1]==''){$descri[1]=$descri[4];} if ($descri[1]==''){$descri[1]=$descri[5];} if ($descri[1]==''){$descri[1]=$descri[6];} if ($descri[1]==''){$descri[1]=$descri[7];} if ($descri[1]==''){$descri[1]=$descri[8];}  if ($xmod=='A') { $buffer='insert into ' . $geraplibd . 'XW_NOTICIAS (WEB, EMPRESA, NOTICIA, GRUPO, DESCRIPCION1, DESCRIPCION2, DESCRIPCION3, DESCRIPCION4, DESCRIPCION5, DESCRIPCION6, DESCRIPCION7, DESCRIPCION8, FECHA_ALTA, FECHA_CADUCA,  SIZE1, TEXTO1, SIZE2, TEXTO2, SIZE3, TEXTO3, SIZE4, TEXTO4, SIZE5, TEXTO5, SIZE6, TEXTO6, SIZE7, TEXTO7, SIZE8, TEXTO8) values '; $buffer.='(\''.$web.'\', \''.$empresa.'\', \''.$noticia.'\',  \''.$grupo.'\', \''.str_replace("'","''",$descri[1]).'\', \''.str_replace("'","''",$descri[2]).'\',  \''.str_replace("'","''",$descri[3]).'\',  \''.str_replace("'","''",$descri[4]).'\',  \''.str_replace("'","''",$descri[5]).'\',  \''.str_replace("'","''",$descri[6]).'\',  \''.str_replace("'","''",$descri[7]).'\',  \''.str_replace("'","''",$descri[8]).'\',  \''.$falta.'\',  \''.$fcaduca.'\', '.$tamany[1].', \'0x01\', '.$tamany[2].', \'0x01\', '.$tamany[3].', \'0x01\', '.$tamany[4].', \'0x01\', '.$tamany[5].', \'0x01\', '.$tamany[6].', \'0x01\', '.$tamany[7].', \'0x01\', '.$tamany[8].', \'0x01\')'; } else { $buffer='update ' . $geraplibd . 'XW_NOTICIAS set NOTICIA = \'' . $noticia . '\', GRUPO=\''.$grupo.'\', FECHA_CADUCA=\'' . $fcaduca . '\', DESCRIPCION1=\'' . str_replace("'","''",$descri[1]) . '\', DESCRIPCION2=\'' . str_replace("'","''",$descri[2]) . '\', DESCRIPCION3=\'' . str_replace("'","''",$descri[3]) . '\', DESCRIPCION4=\'' . str_replace("'","''",$descri[4]) . '\', DESCRIPCION5=\'' . str_replace("'","''",$descri[5]) . '\', DESCRIPCION6=\'' . str_replace("'","''",$descri[6]) . '\', DESCRIPCION7=\'' . str_replace("'","''",$descri[7]) . '\', DESCRIPCION8=\'' . str_replace("'","''",$descri[8]) . '\', '; $buffer.= 'SIZE1=' . $tamany[1] . ', SIZE2=' . $tamany[2] . ', SIZE3=' . $tamany[3] . ', SIZE4=' . $tamany[4] . ', SIZE5=' . $tamany[5] . ', SIZE6=' . $tamany[6] . ', SIZE7=' . $tamany[7] . ', SIZE8=' . $tamany[8] . ' where IDENTI = ' . $identi; }  $conn->ger_exec ($cursor1, $buffer); $identificador=array(); $buffer='select IDENTI from ' . $geraplibd. 'XW_NOTICIAS where WEB=\''.$web.'\' and EMPRESA=\''.$empresa.'\' and NOTICIA=\''.$noticia.'\' and DESCRIPCION1=\''.str_replace("'","''",$descri[1]).'\' and SIZE1='.$tamany[1].''; $conn->ger_exec  ($cursor1, $buffer); $rc= gerdb_fetch ($cursor1, $identificador); $identi=$identificador[IDENTI];  if ($identi!='') { $groot  = getenv('WWW_ROOT'); if ($groot=='') { $groot='c:\\inetpub\\wwwroot'; }  $dir=$groot .'\\'.$_POST[GERPERFIL].'\\uweb'; $resul=mkdir($dir);  $dir=$groot .'\\'.$_POST[GERPERFIL].'\\uweb\\noticias'; $resul=mkdir($dir);  $dir=$groot .'\\'.$_POST[GERPERFIL].'\\uweb\\noticias\\'.$web.'_'.$empresa; $resul=mkdir($dir);  for ($ii=0; $ii<sizeof($idiomas); $ii++) { $jj=$ii+1; $kk=$idiomas[$ii][idioma];  $archivo_noticia_r=$groot .'\\'.$_POST[GERPERFIL].'\\uweb\\noticias\\'.$web.'_'.$empresa.'\\N_R_'.$identi.'_'.$kk.'.txt'; $archivo_noticia_d=$groot .'\\'.$_POST[GERPERFIL].'\\uweb\\noticias\\'.$web.'_'.$empresa.'\\N_D_'.$identi.'_'.$kk.'.txt';  unlink ($archivo_noticia_r); unlink ($archivo_noticia_d);  $conn->ger_graba_grafico ($geraplibd ."XW_NOTICIAS", "TEXTO".$kk, $identi, $fiche[$kk]); } } if ($_POST[ACTUALIZAR]!='S'){ $modificado='S'; $modificar='N'; } else { $actualizar='N'; } }     echo "<form name=\"Lista\" method=\"post\" enctype=\"multipart/form-data\">\n"; echo "  <script type=\"text/javascript\" language=\"javascript\" src=\"".$srootns."/" . $_POST[GERPERFIL] . "/base/pestanas/pesta_lista.js\"></script>\n";  if ($modificado!='S'){     echo " <script type=\"text/javascript\" language=\"javascript\"> \n"; echo "  var rows = new Array;\n"; echo "  var num_rows = 1; \n";		 echo "  for ( var x = 1; x <= num_rows; x++ ) { rows[x] = new Array; } \n";  for ($i=0; $i<sizeof($idiomas); $i++) { $j=$i+1; $im="<img src=\"".$srootns."/".$_POST[GERPERFIL]."/graficos/" . $idiomas[$i][grafico] . "\" border=0>"; echo "  rows[1][$j] = '" . $im . "&nbsp;".$idiomas[$i][largo]."&nbsp;';\n"; } echo " </script>\n";     $identi=$noticia_old='';  if ($xmod=='M') { $tb=array(); $buffer='select IDENTI, NOTICIA, GRUPO, FECHA_ALTA, FECHA_CADUCA, DESCRIPCION1, DESCRIPCION2, DESCRIPCION3, DESCRIPCION4, DESCRIPCION5, DESCRIPCION6, DESCRIPCION7, DESCRIPCION8, SIZE1, SIZE2, SIZE3, SIZE4, SIZE5, SIZE6, SIZE7, SIZE8 from ' . $geraplibd . 'XW_NOTICIAS (NOLOCK) where IDENTI='.$_POST[ROWID]; $conn->ger_exec  ($cursor1, $buffer); $rc= gerdb_fetch ($cursor1, $tb); $descri_old        =         array(); $tamany_old        =         array(); $identi            =         $tb[IDENTI]; $noticia_old       =         $tb[NOTICIA]; $falta_old         =         $tb[FECHA_ALTA]; $fcaduca_old       =         $tb[FECHA_CADUCA]; $grupo_old         =         $tb[GRUPO];  for ($ii=1; $ii<=8; $ii++) { $descri_old[$ii]=$tb[DESCRIPCION . $ii]; } for ($ii=1; $ii<=8; $ii++) { $tamany_old[$ii]=$tb[SIZE . $ii]; }  } else { $falta_old         =         date('Y/m/d'); }    $tabinicio=10;       $tabancho=860;        $gendespla=0;        $tabdespla=10;       $pestatop=105;        $pestaalto=25;       $cuerpotop=132;      $tabalto=620;        $botonalto=700;          echo ("<table width=\"99%\" align=\"left\">"); echo ("   <tr>\n"); echo ("      <td>\n");     $ancho_tabla=$gendespla+$tabancho; echo "<table align=\"left\"' border=\"0px\" width=\"100%\">\n";  echo "   <tr>\n"; echo "      <td>\n"; echo('         <table border="0" cellspacing="0" cellpadding="0">'); echo "\n";   echo('  <td class="botontit" width="80px" align="center" nowrap'); echo('    onclick="Realizar_operacion()"'); echo(' style="height:22px;">'); echo("\n"); echo('    <table border="0" cellspacing="0" cellpadding="0"><tr valign="center">'); echo("\n"); echo('       <td class="botontit" title="'.$lit_aceptar.'"><img src="'.$srootns.'/' . $_POST[GERPERFIL] . '/graficos/save.ico" align="absmiddle" style="border:0;">'); echo('&nbsp;'.$lit_modificar); echo ('</td></tr>'); echo("\n"); echo("    </table></td>\n"); $spuesto='N';  echo('  <td class="boton" width="10px" align="center">|</td>'); echo("\n");   echo('  <td class="botontit" width="80px" align="center" nowrap'); echo('    onclick="CancelarAlta()"'); echo(' style="height:22px;">'); echo("\n"); echo('    <table border="0" cellspacing="0" cellpadding="0"><tr valign="center">'); echo("\n"); echo('       <td class="botontit" title="'.$cancelar.'"><img src="'.$srootns.'/' . $_POST[GERPERFIL] . '/graficos/redo.ico" align="absmiddle" style="border:0;">'); echo('&nbsp;'.$cancelar); echo ('</td></tr>'); echo("\n"); echo("    </table></td>\n"); $spuesto='N';  echo('         </table>'); echo "\n"; echo "      </td>\n"; echo "   </tr>\n";   echo "   <tr>\n"; echo "      <td>\n";  echo "    <fieldset style='background-color : ".$tpanta[COLOR_RECUADRO]."'>\n"; echo "    <legend class='literal'>$lit_generales</legend>\n"; echo "    <table align=\"left\" border=\"0\" style=\"margin-left:10px;\">\n";  echo "    <tr>\n"; echo "      <td align= 'left' width='60px' class='literal' nowrap>$lit_noticia: </td>\n"; echo "      <td align= 'left' class='literal' width='145px' nowrap> <input type='text' id='Noticia' name='Noticia' maxlength='20' size='20' class='entrada' value='".$noticia_old."'></td>\n"; echo "      <td align= 'left' width='80px' class='literal' nowrap>".str_replace(' ', '&nbsp;', $lit_fechaalta).": </td>\n"; echo "      <td align= 'left' class='literal'  nowrap><input class='entrada' type='text' name='falta' id='falta' value='" . $falta_old . "' size='10'><img src='".$srootns."/".$_POST[GERPERFIL]."/graficos/calendario.gif' id='cfalta'></td>\n"; echo "      <td align= 'left' width='100px' class='literal' nowrap>".str_replace(' ', '&nbsp;', $lit_fechacaduca).": </td>\n"; echo "      <td align= 'left' class='literal'  nowrap><input class='entrada' type='text' name='fcaduca' id='fcaduca' value='" . $fcaduca_old . "' size='10'><img src='".$srootns."/".$_POST[GERPERFIL]."/graficos/calendario.gif' id='cfcaduca'></td>\n";  $tbele=array(); $buffer='select distinct GRUPO as grupo from ' . $geraplibd . 'XW_NOTICIAS (NOLOCK) where WEB=\''.$xweb.'\' and EMPRESA=\''.$xempresa.'\' order by GRUPO'; $conn->ger_exec  ($cursor1, $buffer); $rc= gerdb_fetch ($cursor1, $tbele);  echo "      <td align= 'left' width='50px' class='literal' nowrap>".str_replace(' ', '&nbsp;', $lit_grupo).": </td>\n"; echo "      <td align= 'left class='literal' width='320px' nowrap>\n"; echo "        <select name='Grupo' class='entrada'  onchange='Javascript:Activar_grupo();'>\n"; $sele=''; if ($xmod=='A') { $sele='selected=\'selected\''; } echo "          <option value='@NUEVO' " . $sele . ">".$lit_nuevogrupo."...</option>\n"; while ($rc=='') { $sele=''; if ($grupo_old==$tbele[grupo]) { $sele='selected=\'selected\''; } echo "          <option value='".$tbele[grupo]."' ".$sele . ">".$tbele[grupo]."</option>\n"; $rc= gerdb_fetch ($cursor1, $tbele); } echo "      </select>\n";  echo "      <input type='text' id='Grupo_nuevo' name='Grupo_nuevo' maxlength='20' size='20' class='entrada_ocultar'/></td>\n"; echo "    </tr>\n";  echo '   <tr><td colspan="8" class="literal_normal">Utilizar el literal "<b>#fin_resumen</b>" para marcar el fin del contenido a visualizar en formato reducido.</td></tr>'; echo "\n";  echo "    </table>";  echo ("   </fieldset>\n");   echo "      </td>\n"; echo "   </tr>\n";   echo "</table>\n";         echo "  <script type='text/javascript' language='javascript'>\n"; echo "    tabs_top=" . $pestatop . ";       tabs_left=" . $tabdespla . "; tabs_width=400;\n"; echo "    tabs_height=" . $pestaalto . ";\n"; echo "    tabs_off=\"silver\"; tabs_on=\"".$tpanta[COLOR_RECUADRO]."\";\n"; echo "  </script>\n"; echo "  <script type=\"text/javascript\" language=\"javascript\"> DrawTabs(); </script>\n";  $_SESSION['userfilepath']=''; $_SESSION['userfilepath']=$srootns.'/'.$_POST[GERPERFIL].'/'.$web.'/';   for ($ii=0; $ii<sizeof($idiomas); $ii++) { $jj=$ii+1; $kk=$idiomas[$ii][idioma];  $saux=$tabalto+60; echo "  <div id=\"T1" . $jj . "\" class=\"tab-body\" style=\"background-color:".$tpanta[COLOR_RECUADRO].";width:97%;height:" . ($saux+70) . "px;left:".($tabdespla-3)."px;top:".$cuerpotop."px;\">\n";  $descri=$descri_old[$kk]; echo "<div style=\"padding-bottom:5px;\">".str_replace(' ', '&nbsp;', $lit_descri).":&nbsp;<input type='text' id='Descri" . $jj . "' name='Descri" . $jj . "' maxlength='80' size='80' class='entrada' value='".$descri."'></div>\n";     if ($xmod=='M') {  $sroot=getenv('WWW_ROOT'); $tiempo=microtime(true);   if (isset($sroot)) { $dire=$sroot . '\\tmp\\'.$geruser; $ok=mkdir($dire); } else { $dire='c:\\inetpub\\wwwroot\\tmp\\'.$geruser; $ok=mkdir($dire); } $tiempo=str_replace('.','',$tiempo); if (isset($sroot)) { $fichero=$sroot . '\\tmp\\' . $geruser . '\\Texto'.$tiempo.'.txt'; } else { $fichero='c:\\inetpub\\wwwroot\\tmp\\' . $geruser . '\\Texto'.$tiempo.'.txt'; } $identi=$_POST['ROWID']; $variable='TEXTO'.$kk; $conn->ger_lee_grafico ($geraplibd."XW_NOTICIAS", $variable, $identi, $fichero);    $oFCKeditor->Value=file_get_contents($fichero);  } echo "<textarea name=\"elm".$jj."\">".file_get_contents($fichero)."</textarea>";  echo "<script>\n"; echo "CKEDITOR.replace('elm".$jj."', {\n"; echo "width:'100%',\n"; echo "height:'".$tabalto."px'\n"; echo "});\n"; echo "</script>\n";  echo "  </div>    <!-- T1" . $jj . "  -->\n"; }            echo '<script type="text/javascript">'; echo "\n"; echo('   cal.manageFields("cfalta", "falta", "%Y/%m/%d");'); echo('   cal.manageFields("cfcaduca", "fcaduca", "%Y/%m/%d");'); echo '</script>'; echo "\n"; }     Poner_hidden_comunes();  echo ("<INPUT TYPE='HIDDEN' SIZE=200  NAME='MODIFICAR'        VALUE='".$modificar."'>");   echo"\n"; echo ("<INPUT TYPE='HIDDEN' SIZE=200  NAME='MODIFICADO'   VALUE='".$modificado."'>");   echo"\n"; echo ("<INPUT TYPE='HIDDEN' SIZE=200  NAME='ACTUALIZAR'   VALUE='".$actualizar. "'>\n"); echo ("<INPUT TYPE='HIDDEN' SIZE=1    NAME='TPESTA'       VALUE='".$_POST['TPESTA']."'>\n"); echo ("<INPUT TYPE='HIDDEN' SIZE=20   NAME='GERXNOMBRE'   VALUE='".$_POST['GERXNOMBRE']."'>\n"); echo "</form>\n";  $xnivel=$_POST[GERNIVEL];  echo("<SCRIPT Language='JavaScript'>\n");  echo "   firstShow=document.Lista.TPESTA.value;\n"; echo "   if ((firstShow==null) || (firstShow=='')) {\n"; echo "      firstShow=\"11\";\n"; echo "   }\n"; echo "   window.onload = IniciaTabs;\n"; echo "   if (document.captureEvents) {\n"; echo "      document.captureEvents(Event.LOAD)\n"; echo "   }\n"; echo "   if (typeof(window.parent.superior)!='undefined'){\n"; echo "      if (typeof(window.parent.superior.document)!='undefined'){\n"; echo "         if (typeof(window.parent.superior.document.Cabecera.titulo)!='undefined'){\n"; echo "            window.parent.superior.document.Cabecera.titulo.value='" .$xtitulo . "';\n"; echo "         } \n"; echo "      } \n"; echo "   } \n";  echo ("   if(document.forms['Lista'].MODIFICADO.value=='S'){ \n"); echo("   document.Lista.action='".Gerurl('genlista.php?pg=' . $_POST['GERNIVEL'.$xnivel.'_PROG'])."';\n"); echo("     document.forms['Lista'].submit();\n"); echo("    } else {\n"); echo("       document.forms['Lista'].Noticia.focus();\n"); echo("       Activar_grupo();\n"); echo("    }\n");   echo("function Realizar_operacion() {\n"); echo("   if (document.forms['Lista'].Noticia.value!='' && document.forms['Lista'].fcaduca.value!='' && document.forms['Lista'].Grupo.value!=''){\n"); echo("         document.Lista.target='_self';");   echo("\n"); echo("         document.forms['Lista'].MODIFICAR.value='S';\n"); echo("   document.Lista.action='".Gerurl('xw_noticias_gestion.php?mod='.$xmod)."';\n"); echo("         document.forms['Lista'].submit();\n"); echo("   } else{ \n"); echo("      alert(\"$lit_error1\");"); echo("   }\n"); echo("}\n");  echo("function CancelarAlta() {\n"); echo("   document.Lista.action='".Gerurl('genlista.php?pg=' . $_POST['GERNIVEL'.$xnivel.'_PROG'] )."';\n"); echo("   document.forms['Lista'].target='_self';\n"); echo("   document.forms['Lista'].submit();\n"); echo("}\n");  echo("function Activar_grupo() {\n"); echo("   if (document.Lista.Grupo.value=='@NUEVO'){ \n"); echo("      var menu = document.getElementById('Grupo_nuevo');\n"); echo('      menu.className = "entrada";'); echo("\n"); echo("   } else {\n"); echo("      var menu = document.getElementById('Grupo_nuevo');\n"); echo('      menu.className = "entrada_ocultar";'); echo("\n"); echo("   } \n"); echo("}\n"); echo("</script>\n");     function Obten_ip_servidor (&$ip_docu) {  $ip_cliente=$_SERVER['REMOTE_HOST']; if (($_SERVER['HTTP_HA']=='1') || ($_SERVER['HTTP_HA_HTTPS']=='1')) { $ip_cliente=$_SERVER['HTTP_CLIENT_IP']; } $punto=0; $ip_rango_cli='';  $ip_servidor=getenv('WWW_SERVWEB'); if ($ip_servidor=="") { $ip_servidor=getenv('WWW_SERVIDOR'); } if ($ip_cliente=='127.0.0.1') { $ip_docu=$ip_servidor; return; } for ($i=0; $i<=strlen($ip_cliente); $i++) { $c=substr($ip_cliente, $i, 1); if ($c=='.') { $punto++; } if ($punto<2) { $ip_rango_cli.=$c; } } $punto=0; $ip_rango_svr=''; for ($i=0; $i<=strlen($ip_servidor); $i++) { $c=substr($ip_servidor, $i, 1); if ($c=='.') { $punto++; } if ($punto<2) { $ip_rango_svr.=$c; } } $ip_docu=$ip_servidor; if ($ip_rango_cli!=$ip_rango_svr) { $saux=getenv('WWW_IP_PUBLICA'); if ($saux!='') { $ip_docu=$saux; } }   }  ?>  </body> </html>