Ver Mensaje Individual
  #4 (permalink)  
Antiguo 09/03/2007, 10:37
mellonivn
 
Fecha de Ingreso: marzo-2007
Mensajes: 7
Antigüedad: 17 años, 1 mes
Puntos: 0
Re: Problemas con php

Creí que te había mandado el código pero acá no me lo muestra, así que te lo vuelvo a mandar:

<?include("funciones.php");top_pagina();?>
<div id="precarga" style="display:none">Cargando </div>
<div style="border:0px solid #000000;padding:4" id="todos">
<?
if ($confirmado == "si")
{

foreach($_POST as $key => $valor){
$$key = htmlentities($valor,ENT_QUOTES);
}
$temas = '<li>'.ereg_replace("<br />","</li><li>",nl2br($temas)).'</li>';
$equipamiento = '<li>'.ereg_replace("<br />","</li><li>",nl2br($equipamiento)).'</li>';
$temasen = '<li>'.ereg_replace("<br />","</li><li>",nl2br($temasen)).'</li>';
$equipamientoen = '<li>'.ereg_replace("<br />","</li><li>",nl2br($equipamientoen)).'</li>';



mysql_query("UPDATE ivida_proyectos SET
titulo='$titulo', $documentopdf2
tituloen='$tituloen',
grupo='$grupo',
temas='$temas',
temasen='$temasen'
WHERE id = $id");

/* Borro de la tabla ivida_proyectos_miembros los miembros del proyecto recibido */
$sql = "DELETE FROM ivida_proyectos_miembros
WHERE id_proyecto = ".$_POST['id'];
$r = mysql_query($sql);

/* Inserto en la tabla ivida_proyectos_miembros los nuevos miembros seleccionados */
foreach ($_POST["seleccionados"] as $sel){
$sql = "INSERT INTO ivida_proyectos_miembros (id_proyecto,
id_miembro)
VALUES ('".$_POST['id']."',
'$sel')";
echo $sql;
$r = mysql_query($sql);
//echo '<script>window.location=\'proyectos_index.php\'; </script>';
}
}
include("FCKeditor/fckeditor.php");
?>
<!-- titulo--><span class="titulo">Proyectos</span><br><br>

<?
//Id_cancha cancha ubicacion telefono localidad provincia mapa servmeteo canthoyos pardecancha record
$query = mysql_query("SELECT * FROM ivida_proyectos
WHERE id = $id");

while($row=mysql_fetch_array($query))
{
$titulo = ereg_replace("<br>","\n",$row["titulo"]);
$tituloen = ereg_replace("<br>","\n",$row["tituloen"]);
$grupo = $row["grupo"];

$temas = ereg_replace("<li>","",$row["temas"]);
$temasen = ereg_replace("<li>","",$row["temasen"]);
$temas = ereg_replace("</li>","",$temas);
$temasen = ereg_replace("</li>","",$temasen);

$resumen = ereg_replace('<br>',"\n",$row["resumen"]);
$resumenen = ereg_replace("<br>","\n",$row["resumenen"]);
$objetivos = ereg_replace("<br>","\n",$row["objetivos"]);
$objetivosen = ereg_replace("<br>","\n",$row["objetivosen"]);
$objestudio = ereg_replace("<br>","\n",$row["objestudio"]);
$objestudioen = ereg_replace("<br>","\n",$row["objestudioen"]);
$aplicaciones = ereg_replace("<br>","\n",$row["aplicaciones"]);
$aplicacionesen = ereg_replace("<br>","\n",$row["aplicacionesen"]);
$lineastrabajos = ereg_replace("<br>","\n",$row["lineastrabajos"]);
$lineastrabajosen = ereg_replace("<br>","\n",$row["lineastrabajosen"]);
$infraestructura = ereg_replace("<br>","\n",$row["infraestructura"]);
$infraestructuraen = ereg_replace("<br>","\n",$row["infraestructuraen"]);
$observaciones = ereg_replace("<br>","\n",$row["observaciones"]);
$observacionesen = ereg_replace("<br>","\n",$row["observacionesen"]);

$equipamiento = ereg_replace("<li>","",ereg_replace('<br>',"\n",$r ow["equipamiento"]));
$equipamientoen = ereg_replace("<li>","",ereg_replace('<br>',"\n",$r ow["equipamientoen"]));
$equipamiento = ereg_replace("</li>","",ereg_replace('<br>',"\n",$equipamiento));
$equipamientoen = ereg_replace("</li>","",ereg_replace('<br>',"\n",$equipamientoen)) ;
$pdf = $row["pdf"];
}
?>



<script>
function checkpdf()
{
variable = document.getElementById('pdf').value.substr(docume nt.getElementById('pdf').value.length-3).toLowerCase();
if (variable == "pdf"){precar();return true;}else{
if(document.getElementById('cambiarimagen').checke d != true){document.getElementById('pdf').disabled = true;precar();return true;}
return false;

}
}
function errorpdf()
{
variable = document.getElementById('pdf').value.substr(docume nt.getElementById('pdf').value.length-3).toLowerCase();
if (variable == "pdf"){document.getElementById('capaerror').innerH TML='<a>Archivo Correcto</a>';}else
{document.getElementById('capaerror').innerHTML='< a style="color:#FF0000">Archivo Incorrecto</a>';}
}

function precar()
{
document.getElementById('precarga').style.display= 'block';
document.getElementById('todos').style.display='no ne';
setInterval("precarga2()",300);
}
function precarga2()
{
document.getElementById('precarga').innerHTML = document.getElementById('precarga').innerHTML+' . ';
}

</script>
<!-- Formulario -->
<form action="proyectos_editar.php?id=<?=$_GET['id']?>" method="post" onsubmit="return checkpdf();" id="formulario" name="formulario" enctype="multipart/form-data">
<input type="hidden" id="confirmado" name="confirmado" value='si'>
<input type="hidden" name="id" value="<?=$id?>">

<div>

<table border="0" cellspacing="10" cellpadding="0">

<tr>
<td align="left" colspan="2"><div>Grupo:<div class="espacio"> </div></div><select class="input_select" name="grupo" onchange="document.formulario.submit();">
<?
$query = mysql_query("SELECT * FROM ivida_grupos
ORDER BY nombre");

while($row = mysql_fetch_array($query))
{
if($grupo == $row["id"]){
$sele = "selected";
}
else{
$sele = "";
}
echo '<option '.$sele.' value="'.$row["id"].'">'.htmlentities($row["nombre"],ENT_QUOTES).'</option>';}
?></select>
</td>
</tr>

<!-- MIEMBROS DEL GRUPO -->
<tr>
<td>
<div id="miembros">
<?if (isset($grupo)){
$sql = "SELECT * FROM ivida_miembros
WHERE grupo = ".$grupo."
ORDER BY orden";
$r = mysql_query($sql);

echo '<table width="100%">';
echo '<tr><td colspan="3" style="color:#000000;font-size:12px;font-weight:bold">Miembros</td></tr>';

if (mysql_affected_rows()){
while ($miembro = mysql_fetch_assoc($r)){
$sql2 = "SELECT * FROM ivida_proyectos_miembros
WHERE(id_miembro = ".$miembro['id'].")AND(id_proyecto = ".$_POST['id'].")";

$r2 = mysql_query($sql2);
echo '<tr style="color:#000000">';
if (mysql_num_rows($r2) > 0){
echo '<td><input type="checkbox" value="'.$miembro["id"].'" name="seleccionados[]" checked></td>';
}
else{
echo '<td><input type="checkbox" value="'.$miembro["id"].'" name="seleccionados[]"> </td>';
}
echo '<td>'.htmlentities($miembro["nombre"],ENT_QUOTES).'</td>';
echo '<td>('.htmlentities($miembro["cargo"],ENT_QUOTES).')</td>';
echo '</tr>';
}
}
echo '</table>';
}
?>
</div>
</td>
</tr>
<!-- MIEMBROS DEL GRUPO -->

<tr>
<td align="left" colspan="2">
<div><input type="checkbox" name="cambiarimagen" id="cambiarimagen" value="ok" onclick="flipearmenu('capaloca');">Cambiar <?if (!empty($pdf)){echo '<a href="'.$pdf.'" target="_new">Documento PDF</a>';}else{echo 'Documento PDF';}?></div>

<div style="display:none" id="capaloca">
<input type="file" id="pdf" class="input_text" onchange="errorpdf()" name="pdf">
<div style="display:inline" id="capaerror"></div>
</div>
</td>
</tr>

<tr>
<td align="left"><!-- titulo --><div>Titulo:<div class="espacio"> </div><input value="<?=$titulo?>" style="width:200" type="text" class="input_text" name="titulo"></div><!-- titulo --></td>
<td align="left"><!-- titulo --><div>Titulo Ingles:<div class="espacio"> </div><input value="<?=$tituloen?>" style="width:200" type="text" class="input_text" name="tituloen"></div><!- titulo --></td>
</tr>
<tr>
<td align="left" colspan="2"><div>Temas:<div class="espacio"> </div></div>
<?
// Creamos El Area de Texto description_art
$oFCKeditor = new FCKeditor('temas') ; // es el id y name del campo de texto
$oFCKeditor->BasePath = 'FCKeditor/'; // ruta al script fckeditor
$oFCKeditor->Width = '450' ; // ancho del formulario
$oFCKeditor->Height = '150' ; // alto del formulario
$oFCKeditor->Value = html_entity_decode($temas,ENT_QUOTES);
$oFCKeditor->Create() ; // ordena se cree el textarea
?>
<br></td>
</tr>
<tr>
<td align="left" colspan="2"><div>Temas Ingles:<div class="espacio"> </div></div>
<?
// Creamos El Area de Texto description_art
$o2FCKeditor = new FCKeditor('temasen') ; // es el id y name del campo de texto
$o2FCKeditor->BasePath = 'FCKeditor/'; // ruta al script fckeditor
$o2FCKeditor->Width = '450' ; // ancho del formulario
$o2FCKeditor->Height = '150' ; // alto del formulario
$o2FCKeditor->Value = html_entity_decode($temasen,ENT_QUOTES);
$o2FCKeditor->Create() ; // ordena se cree el textarea
?>
<br></td>
</tr>
</table>
</div>

<br>
<!--Send-->
<div style="display:inline"><input type="submit" class="input_submit" onclick="document.formulario.confirmado.value = 'si'; document.formulario.action = 'proyectos_editar.php'; document.formulario.target = '_self';" value="Guardar"></div>

<div style="display:inline"><input type="submit" class="input_submit" onclick="document.formulario.action = '../previaproyectos.php';document.formulario.target = '_new';" value="Vista Previa en Español"></div>
<div style="display:inline"><input type="submit" class="input_submit" onclick="document.formulario.action = '../previaproyectosen.php';document.formulario.target = '_new';" value="Vista Previa en Ingles"></div>
<!--Send-->
</form>

<!-- Formulario -->


</div>
<?bottom_pagina();?>