* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: profil.php,v 1.5 2004-08-31 13:59:42 x2000habouzit Exp $
+ $Id: profil.php,v 1.6 2004-08-31 14:48:56 x2000habouzit Exp $
***************************************************************************/
require("auto.prepend.inc.php");
//on met a jour $opened_tab et $new_tab qui sont le tab du POST et le tab demande
// Tout d'abord, quel est le tab actuel ?
// si on vient d'un POST, old_tab etait le tab courant
-if(isset($_REQUEST['old_tab']))
- if(isset($tabname_array[$_REQUEST['old_tab']])) // on verifie que la valeur postee existe bien
- $opened_tab = $_REQUEST['old_tab'];
-
-$new_tab = $opened_tab;
-
-if(isset($_REQUEST['new_tab'])){
- if(isset($tabname_array[$_REQUEST['new_tab']]))
- $new_tab = $_REQUEST['new_tab'];
- else
- $new_tab = $opened_tab;
-} else
- $new_tab = $opened_tab;
-
-//echo "opening profil_{$opened_tab}.inc.php<br>";
-require_once("profil/profil_{$opened_tab}.inc.php");
+if(isset($_REQUEST['old_tab']) && isset($tabname_array[$_REQUEST['old_tab']])) // on verifie que la valeur postee existe bien
+ $opened_tab = $_REQUEST['old_tab'];
+$new_tab = isset($_REQUEST['suivant']) ? get_next_tab($opened_tab) : $opened_tab;
// pour tous les tabs, on recupere les bits car on a besoin de tous les bits pour en mettre a jour un, la date d naissance pour verifier
// quelle est bien rentree et la date.
naissance, DATE_FORMAT(date,'%d.%m.%Y')
FROM auth_user_md5
WHERE user_id=".$_SESSION['uid'];
-
$result = $globals->db->query($sql);
-list($mobile_public, $mobile_ax,
-$web_public, $libre_public,
-$naissance, $date_modif_profil) = mysql_fetch_row($result);
-
-if(mysql_errno($conn) !=0) echo mysql_errno($conn).": ".mysql_error($conn);
-
-//en cas de modifications
-if(isset($_REQUEST['modifier']) && ($opened_tab == 'general')){
- $mobile_public = (isset($_REQUEST['mobile_public']));
- $mobile_ax = (isset($_REQUEST['mobile_ax']));
- $libre_public = (isset($_REQUEST['libre_public']));
- $web_public = (isset($_REQUEST['web_public']));
-}
-
+list($mobile_public, $mobile_ax,$web_public, $libre_public, $naissance, $date_modif_profil) = mysql_fetch_row($result);
// lorsqu'on n'a pas la date de naissance en base de données
if (!$naissance) {
-
// la date de naissance n'existait pas et vient d'être soumise dans la variable
// $_REQUEST['birth']
if (isset($_REQUEST['birth'])) {
$page->run();//on affiche le formulaire pour naissance
}
-// inclure tous les tests sur les champs du formulaire
-require_once("profil/verif_{$opened_tab}.inc.php");
-
-if(isset($_REQUEST['suivant']))
- $new_tab = get_next_tab($opened_tab);
-
//doit-on faire un update ?
if (isset($_REQUEST['modifier']) || isset($_REQUEST['suivant'])) {
+ require_once("profil/profil_{$opened_tab}.inc.php");
+ require_once("profil/verif_{$opened_tab}.inc.php");
$date=date("Y-m-j");//nouvelle date de mise a jour
-
//On sauvegarde l'uid pour l'AX
/* on sauvegarde les changements dans user_changes :
* on a juste besoin d'insérer le user_id de la personne dans la table
*/
- $sql="insert into user_changes ('{$_SESSION['uid']}')";
- /* l'insertion ne se fait que s'il n'existe pas un enregistrement avec le même
- * user_id car user_id est la clé primaire.
- */
- $globals->db->query($sql);
+ $globals->db->query("replace into user_changes set user_id='{$_SESSION['uid']}'");
//Mise a jour des bits
// bits : set('mobile_public','mobile_ax','web_public','libre_public')
// mise a jour des champs relatifs au tab ouvert
require_once("profil/update_{$opened_tab}.inc.php");
- //Warning : ca ne marche que si update_<tab>.inc.php contient bien une requete mysql qui mettra errno a 0
$_SESSION['log']->log("profil");
$page->assign('etat_update','ok');
}
require_once("profil/verif_{$new_tab}.inc.php");
$page->assign('onglet',$new_tab);
-$page->assign('onglet_last', get_last_tab());
+$page->assign('onglet_last',get_last_tab());
$page->assign('onglet_tpl',"profil/$new_tab.tpl");
$page->run();
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: profil_adresses.inc.php,v 1.3 2004-08-31 13:59:43 x2000habouzit Exp $
+ $Id: profil_adresses.inc.php,v 1.4 2004-08-31 14:48:57 x2000habouzit Exp $
***************************************************************************/
$i++;
}
-$page->assign_by_ref('adresses', $adresses);
+$page->assign('adresses', $adresses);
//recuperation des donnees de la bd
$res = $globals->db->query(
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: profil_general.inc.php,v 1.3 2004-08-31 13:59:43 x2000habouzit Exp $
+ $Id: profil_general.inc.php,v 1.4 2004-08-31 14:48:57 x2000habouzit Exp $
***************************************************************************/
// on ramène les données du profil connecté (uid paramètre de session)
mysql_free_result($result);
-$page->assign_by_ref('nom', $nom);
-$page->assign_by_ref('prenom', $prenom);
-$page->assign_by_ref('promo', $promo);
-$page->assign_by_ref('epouse', $epouse);
-$page->assign_by_ref('femme', $femme);
-$page->assign_by_ref('alias', $alias);
-
+$page->assign('mobile_public',$mobile_public);
+$page->assign('mobile_ax',$mobile_ax);
+$page->assign('libre_public',$libre_public);
+$page->assign('web_public',$web_public);
+$page->assign('nom', $nom);
+$page->assign('prenom', $prenom);
+$page->assign('promo', $promo);
+$page->assign('epouse', $epouse);
+$page->assign('femme', $femme);
+$page->assign('alias', $alias);
replace_ifset($nationalite,'nationalite');
-$page->assign_by_ref('nationalite',$nationalite);
+$page->assign('nationalite',$nationalite);
replace_ifset($mobile,'mobile');
-$page->assign_by_ref('mobile',$mobile);
+$page->assign('mobile',$mobile);
replace_ifset($web,"web");
-$page->assign_by_ref('web',$web);
+$page->assign('web',$web);
replace_ifset($libre,"libre");
-$page->assign_by_ref('libre',$libre);
+$page->assign('libre',$libre);
replace_ifset($appli_id1,"appli_id1");
replace_ifset($appli_id2,"appli_id2");
-$page->assign_by_ref('appli_id1',$appli_id1);
-$page->assign_by_ref('appli_id2',$appli_id2);
+$page->assign('appli_id1',$appli_id1);
+$page->assign('appli_id2',$appli_id2);
replace_ifset($appli_type1,"appli_type1");
replace_ifset($appli_type2,"appli_type2");
-$page->assign_by_ref('appli_type1',$appli_type1);
-$page->assign_by_ref('appli_type2',$appli_type2);
+$page->assign('appli_type1',$appli_type1);
+$page->assign('appli_type2',$appli_type2);
?>
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: verif_general.inc.php,v 1.2 2004-08-31 11:16:48 x2000habouzit Exp $
+ $Id: verif_general.inc.php,v 1.3 2004-08-31 14:48:57 x2000habouzit Exp $
***************************************************************************/
$str_error = $str_error."Le champ 'Complément libre' contient un caractère interdit.<BR />";
}
+$mobile_public = (isset($_REQUEST['mobile_public']));
+$mobile_ax = (isset($_REQUEST['mobile_ax']));
+$libre_public = (isset($_REQUEST['libre_public']));
+$web_public = (isset($_REQUEST['web_public']));
+
?>
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: general.tpl,v 1.9 2004-08-31 11:25:42 x2000habouzit Exp $
+ $Id: general.tpl,v 1.10 2004-08-31 14:48:57 x2000habouzit Exp $
***************************************************************************}
<table class="flags" summary="Flags" cellpadding="0" cellspacing="0">
<tr>
<td class="vert">
- <input type="checkbox" name="mobile_public" value="V"
- {if $mobile_public}checked="checked"{/if} />
+ <input type="checkbox" name="mobile_public" {if $mobile_public}checked="checked"{/if} />
</td>
<td class="texte">
site public
</td>
<td class="orange">
- <input type="checkbox" name="mobile_ax" value="O"
- {if $mobile_ax}checked="checked"{/if} />
+ <input type="checkbox" name="mobile_ax" {if $mobile_ax}checked="checked"{/if} />
</td>
<td class="texte">
transmis à l'AX
<table class="flags" summary="Flags" cellpadding="0" cellspacing="0">
<tr>
<td class="vert">
- <input type="checkbox" name="web_public" value="V"
- {if $web_public}checked="checked"{/if} />
+ <input type="checkbox" name="web_public" {if $web_public}checked="checked"{/if} />
</td>
<td class="texte">
site public
<table class="flags" summary="Flags" cellpadding="0" cellspacing="0">
<tr>
<td class="vert">
- <input type="checkbox" name="libre_public" value="1"
- {if $libre_public}checked="checked"{/if} />
+ <input type="checkbox" name="libre_public" {if $libre_public}checked="checked"{/if} />
</td>
<td class="texte">
site public