Hola,
tengo el siguiente codigo:
Código php:
Ver original<?php
/**
* index.php modulo cuenta
*/
include('includes/header.php');
include('includes/breadcrumbs.php');
include('includes/sidebar.php');
include('Cuenta.php');
function index(){
$detalle=detalle($_SESSION['id_user']);
?>
<div id="main">
<h3>Detalles de su Cuenta </h3>
<form action="index.php?modules=cuenta&opcion=actualizar" method="post" class="jNice">
<table cellpadding="0" cellspacing="0" summary="">
<tr>
<td>Proyecto: </td>
<td><? echo $detalle['project']['name'];?></td>
</tr>
<tr class="odd">
<td>Comienzo: </td>
<td><? echo cambiarFecha($detalle['project']['created_on'],1);?></td>
</tr>
<tr>
<td>Estado: </td>
<td><? echo $detalle['project']['status'];?></td>
</tr>
<tr class="odd">
<td>Empresa: </td>
<td><? echo $detalle['company']['name'];?></td>
</tr>
<tr>
<td>Nombre y Apellido: </td>
<td><? echo $detalle['user']['first_name']." ".$detalle['user']['last_name'];?></td>
</tr>
<tr class="odd">
<td>Email: </td>
<td><? echo $detalle['user']['email'];?></td>
</tr>
<tr>
<td>Ultima Visita: </td>
<td><? echo cambiarFecha($detalle['user']['last_visit_on']);?></td>
</tr>
</table>
<fieldset>
<input type="submit" value="Editar Detalles"/>
</fieldset>
</form>
</div>
<?php
}
function formActualizar(){
$detalle=detalle($_SESSION['id_user']);
?>
<div id="main">
<div id="mensaje"></div>
<h3>Editar su Cuenta</h3>
<form action="index.php?modules=cuenta&opcion=guardar" method="post" class="jNice">
<fieldset>
<p>
<label>Empresa:</label>
<input type="text" class="text-long" name="empresa" value="<? echo $detalle['company']['name'];?>"/>
</p>
<p>
<label>Nombre: </label>
<input type="text" class="text-long" name="nombre" value="<? echo $detalle['user']['first_name'];?>"/>
</p>
<p>
<label>Apellido: </label>
<input type="text" class="text-long" name="apellido" value="<? echo $detalle['user']['last_name'];?>"/>
</p>
<p>
<label>Email: </label>
<input type="text" class="text-long" name="email" value="<? echo $detalle['user']['email'];?>"/>
</p>
<input type="hidden" name="id_user" value="<? echo $detalle['user']['id'];?>"/>
<input type="hidden" name="id_company" value="<? echo $detalle['company']['id_company'];?>"/>
<input type="submit" value="Guardar Cambios"/> <!--<input type="button" value="Volver" name="volver" onclick="location.href='index.php?modules=cuenta'"/>-->
</fieldset>
</form>
</div>
<!-- // #main -->
<?php
}
function guardarCuenta(){?>
<div id="main">
<?
$msg=actualizarDetalle($_REQUEST);
if($msg[0]!=1){
$texto='bien \n';
?>
<script type="text/javascript">
jQuery('#mensaje').html('<? echo $texto;?>')
</script>
<?
}
else{
$texto='mal \n';
?>
<script type="text/javascript">
jQuery('#mensaje').html('<? echo $texto;?>')
</script>
<?
}
?>
</div>
<!-- // #main -->
<?
}
switch ($_REQUEST['opcion']){
case 'actualizar':
formActualizar();
break;
case 'guardar':
guardarCuenta();
break;
default:index();
break;
}
include('includes/footer.php');
?>
lo que me esta costando resolver es, que el mensaje que genero en la funcion guardarCuenta ($msg=actualizarDetalle($_REQUEST);) me lo muestre en la funcion formactualizar, como puedo hacer esto?
desde ya muchas gracias