'Personnaliser' => Array(
'Mes emails' => 'emails.php' ,
'Mon profil' => '###url###' ,
- 'Mes contacts' => '###url###' ,
+ 'Mes contacts' => 'mescontacts.php' ,
'Mon mot de passe' => 'motdepassemd5.php' ,
'Mes préférences' => 'preferences.php'
),
| emploi_public.php |
| evenements.php |
| index.coupure.php |
- | mescontacts.php |
| mescontacts_pdf.php |
| pg.confirm.php |
| pg.php |
xx | groupex.php | groupex/index.php
xx | index.php | -
xx | login.php | -
+xx | mescontacts.php | -
xx | motdepassemd5.php | -
xx | nbpromo2.php | stats/nb_by_promo.php
xx | newsletter.php | -
I. Styles par défauts. balises sans attributs ou classes sans contexte
II. Styles <p>, <div>, <span> ... <p>, <div>, <span>, <li>, ...
III. Tableaux bicolores Tableaux à lignes alternées, en taille normale, ou tiny
-IV. Tableau de u choix de skins
+IV. Tableau de choix de skins
+V. contacts
..:: Appendices ::..
Choix de la skin
.center { text-align: center; }
.right { text-align: right; }
.middle { vertical-align: middle; }
+.smaller { font-size: smaller; font-style: italic; }
+
/**: II. :**/
text-align: justify;
}
-p.smaller, div.smaller {
- font-size: smaller;
- font-style: italic;
-}
-
td.half { width: 50%; padding: 4px; }
/**: III. :**/
}
#skin td.skidroite { padding: 0; }
+/**: V. :**/
+div.contact-list {
+ width: 98%;
+ margin-left: 1%;
+}
+
+div.contact-list div.contact {
+ width: 100%;
+ text-align: left;
+ border-top: 1px solid #003399;
+ background: #F4D09C;
+ color: inherit;
+}
+
+div.contact div.nom {
+ font-weight: bold;
+ width: 35%;
+ float: left;
+}
+
+div.contact div.appli {
+ width: 50%;
+ float: left;
+}
+
+div.contact div.bits {
+ text-align: right;
+ width: 15%;
+ float: left;
+}
+
+div.bits .smaller { display: none; }
+div.contact:hover div.bits .smaller { display: inline; }
+
+div.contact div.long {
+ width: 100%;
+ clear: both;
+ background: white;
+ color: inherit;
+ padding-top: 1px;
+ padding-bottom: 1px;
+}
+
+div.long table { width: 100%; }
+div.long td.lt { width: 35%; }
+div.long td.rt { width: 65%; }
+
/*************************/
/* ..:: Apendices ::.. */
/*************************/
vertical-align: top;
}
/* vim: set et ts=4 sts=4 sw=4: */
-/* $Id: default.css,v 1.19 2004-02-15 15:45:29 x2000habouzit Exp $ */
+/* $Id: default.css,v 1.20 2004-02-16 11:06:49 x2000habouzit Exp $ */
--- /dev/null
+<?php
+require("auto.prepend.inc.php");
+new_skinned_page("mescontacts.tpl",AUTH_COOKIE,true);
+require("applis.func.inc.php");
+
+// si l'utilisateur demande le retrait de qqun de sa liste
+if (isset($_REQUEST['action'])) {
+ if($_REQUEST['action']=='retirer') {
+
+ if (($res = mysql_query("SELECT user_id FROM auth_user_md5 WHERE username='{$_REQUEST['user']}'")) && mysql_num_rows($res)==1) {
+ list($cont_user_id) = mysql_fetch_row($res);
+ if (mysql_query("DELETE FROM contacts WHERE uid = '{$_SESSION['uid']}' AND contact='$cont_user_id'"))
+ $page->assign('erreur', "<p class='normal'><strong>Contact {$_REQUEST['user']} retiré !</strong></p>\n");
+ }
+
+ // si l'utilisateur demande l'ajout de qqun à sa liste
+ } elseif ($_REQUEST["action"]=="ajouter") {
+
+ if (($res = mysql_query("SELECT user_id FROM auth_user_md5 WHERE username='".$_REQUEST["user"]."'")) && mysql_num_rows($res)==1) {
+ list($cont_user_id) = mysql_fetch_row($res);
+ if (mysql_query("INSERT INTO contacts set uid = '{$_SESSION['uid']}', contact = '$cont_user_id'")) {
+ $page->assign('erreur', '<p class="normal"><strong>Contact ajouté !</strong></p>');
+ } else
+ $page->assign('erreur', '<p class="erreur">Contact déjà dans la liste !</p>');
+ } else {
+ $page->assign('erreur', '<p class="erreur">Utilisateur inexistant ou non inscrit !</p>');
+ }
+ }
+}
+
+$sql = "SELECT contact AS id,
+ a.*,
+ i.deces != 0 AS dcd, i.matricule_ax,
+ e.entreprise, es.label AS secteur, ef.label AS fonction,
+ n.text AS nat,
+ ad0.text AS app0text, ad0.url AS app0url, ai0.type AS app0type,
+ ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type,
+ adr.ville, gp.pays, gr.name AS region
+ FROM contacts AS c
+ INNER JOIN auth_user_md5 AS a ON (a.user_id = c.contact)
+ INNER JOIN identification AS i ON (a.matricule = i.matricule)
+ LEFT JOIN entreprises AS e ON (e.entrid = 1 AND e.uid = a.user_id)
+ LEFT JOIN emploi_secteur AS es ON (e.secteur = es.id)
+ LEFT JOIN emploi_naf AS ef ON (e.fonction = ef.id)
+ LEFT JOIN nationalites AS n ON (a.nationalite = n.id)
+ LEFT JOIN applis_ins AS ai0 ON (a.user_id = ai0.uid AND ai0.ordre = 0)
+ LEFT JOIN applis_def AS ad0 ON (ad0.id = ai0.aid)
+ LEFT JOIN applis_ins AS ai1 ON (a.user_id = ai1.uid AND ai1.ordre = 1)
+ LEFT JOIN applis_def AS ad1 ON (ad1.id = ai1.aid)
+ LEFT JOIN adresses AS adr ON (a.user_id = adr.uid AND FIND_IN_SET('active', adr.statut))
+ LEFT JOIN geoloc_pays AS gp ON (adr.pays = gp.a2)
+ LEFT JOIN geoloc_region AS gr ON (adr.pays = gr.a2 AND adr.region = gr.region)
+ WHERE c.uid = {$_SESSION['uid']}
+ ORDER BY a.nom, a.prenom";
+mysql_query($sql);
+echo mysql_error();
+
+$page->mysql_assign($sql,'contacts','nb_contacts');
+
+$page->display();
+?>
* On y ajoute les infos d'adresses
*/
$req = mysql_query(
- "SELECT c.contact AS id, adr1, adr2, adr3, cp, ville, gp.pays, gr.name, tel, fax,
- FIND_IN_SET('courrier', a.statut) AS courrier
+ "SELECT c.contact AS id, adr1, adr2, adr3, cp, ville, gp.pays, gr.name, tel, fax
FROM contacts AS c
- INNER JOIN adresses AS a ON (a.uid = c.contact)
+ INNER JOIN adresses AS a ON (a.uid = c.contact AND FIND_IN_SET('active', a.statut))
LEFT JOIN geoloc_pays AS gp ON (a.pays = gp.a2)
LEFT JOIN geoloc_region AS gr ON (a.pays = gr.a2 AND a.region = gr.region)
- WHERE c.uid = {$_SESSION['uid']} AND FIND_IN_SET('active', a.statut)
- AND NOT FIND_IN_SET('res-secondaire', a.statut)
- ORDER BY c.contact
- "
-);
+ WHERE c.uid = {$_SESSION['uid']}
+ ORDER BY c.contact");
echo mysql_error();
while($line = mysql_fetch_assoc($req))
$contacts[$line['id']]['home'] = ensure_adr($line);
--- /dev/null
+<?php
+
+/** donne la liste déroulante des ecoles d'appli
+ * @param $current application actuellement selectionnée
+ * @return echo
+ * @see include/form_data.inc.php
+ * @see include/form_data_maj.inc.php
+ * @see include/form_profil.inc.php
+ * @see include/form_rech_av.inc.php
+function applis_options($current=0) {
+ echo '<option value="-1"></option>';
+ $res=mysql_query("select * from applis_def order by text");
+ while ($arr_appli=mysql_fetch_array($res)) {
+ echo '<option value="'.$arr_appli["id"].'"';
+ if ($arr_appli["id"]==$current) echo " selected";
+ echo '>'.$arr_appli["text"]."</option>\n";
+ }
+}
+ */
+
+/** formatte une ecole d'appli pour l'affichage
+ */
+function applis_fmt($params, &$smarty) {
+ extract($params);
+ $txt="";
+ if (($type!="Ingénieur")&&($type!="Diplôme"))
+ $txt .= $type;
+ if ($text!="Université") {
+ if ($txt) $txt .= " ";
+ if ($url)
+ $txt .= "<a target=\"_blank\" href=\"$url\">$text</a>";
+ else
+ $txt .= $text;
+ }
+ return $txt;
+}
+$page->register_function('applis_fmt','applis_fmt');
+
+?>
return $content;
}
-function function_dyn($params) { return stripslashes(htmlentities(implode(' ',$params))); }
+function function_implode($params) {
+ $sep = ' ';
+ if(isset($params['sep'])) {
+ $sep = $params['sep'];
+ unset($params['sep']);
+ }
+ foreach($params as $key=>$val)
+ if(empty($params[$key]))
+ unset($params[$key]);
+
+ return stripslashes(htmlentities(implode($sep,$params)));
+}
+
+function function_dyn($params) {
+ return stripslashes(htmlentities(implode(' ',$params)));
+}
class XorgPage extends DiogenesCorePage {
var $_page_type;
$this->DiogenesCorePage();
$this->register_block('dynamic', 'block_dynamic', false);
$this->register_function('dyn', 'function_dyn', false);
+ $this->register_function('implode', 'function_implode');
// if necessary, construct new session
if (empty($_SESSION['session']))
--- /dev/null
+{* $Id: x_inscrit.tpl,v 1.1 2004-02-16 11:06:51 x2000habouzit Exp $ *}
+
+<div class="contact">
+ <div class="nom">
+ {$c.nom} {$c.prenom}
+ {if $c.epouse}<br />({$c.epouse} {$c.nom}){/if}
+ {if $c.dcd}(décédé){/if}
+ </div>
+ <div class="appli">
+ {strip}
+ (
+ X{$c.promo}{if $c.app0text},
+ {applis_fmt type=$c.app0type text=$c.app0text url=$c.app0url}
+ {/if}{if $c.app1text},
+ {applis_fmt type=$c.app1type text=$c.app1text url=$c.app1url}
+ {/if}
+ )
+ {/strip}
+ </div>
+ <div class="bits">
+ <a href="javascript:x()" onclick="popWin('x.php?x={$c.username}')"><img src="images/loupe.gif" alt="Afficher les détails"></a>
+ <a href="vcard.php/{$c.username}.vcf?x={$c.username}"><img src="images/vcard.png" alt="Afficher la carte de visite"></a>
+ <a href="mescontacts.php?action={$show_action}&user={$c.username}">
+ <img src="images/{$show_action}.gif" alt="{$show_action} aux/des contacts">
+ </a>
+ {perms level='admin'}
+ <a href="http://www.polytechniciens.com/index.php?page=AX_FICHE_ANCIEN&anc_id={$c.matricule_ax}" target="new">AX</a>
+ {/perms}
+ <span class="smaller"><strong>{$c.date|date_format:"%d-%m-%Y"}</strong></span>
+ </div>
+ <div class="long">
+ <table cellspacing="0" cellpadding="0">
+ {if $c.nat}
+ <tr>
+ <td class="lt">Nationalité:</td>
+ <td class="rt">{$c.nat}</td>
+ </tr>
+ {/if}
+ {if $c.web}
+ <tr>
+ <td class="lt">Page web:</td>
+ <td class="rt"><a href="{$c.web}">{$c.web}</a></td>
+ </tr>
+ {/if}
+ {if $c.pays || $c.ville || $c.pays}
+ <tr>
+ <td class="lt">Géographie:</td>
+ <td class="rt">{implode sep=", " s1=$c.ville s2=$c.region s3=$c.pays}</td>
+ </tr>
+ {/if}
+ {if $c.mobile}
+ <tr>
+ <td class="lt">Mobile:</td>
+ <td class="rt">{$c.mobile}</td>
+ </tr>
+ {/if}
+ {if $c.entreprise}
+ <tr>
+ <td class="lt">Profession:</td>
+ <td class="rt">
+ {$c.entreprise|escape:"html"}
+ {if $c.secteur}( {$c.secteur|escape:"html"} ){/if}
+ {if $c.fonction}<br />{$c.fonction|escape:"html"} ){/if}
+ </td>
+ </tr>
+ {/if}
+ {if $c.libre}
+ <tr>
+ <td class="lt">Commentaire:</td>
+ <td class="rt">{$c.libre|escape:"html"|nl2br}</td>
+ </tr>
+ {/if}
+ </table>
+ </div>
+</div>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
--- /dev/null
+{* $Id: mescontacts.tpl,v 1.1 2004-02-16 11:06:50 x2000habouzit Exp $ *}
+
+{dyn s=$erreur}
+
+<div class="rubrique">
+ Ma liste personnelle de contacts
+</div>
+
+<form action="{$smarty.server.PHP_SELF}" method="post">
+<input type="hidden" name="action" value="ajouter" />
+<p class="normal">
+ Ajouter la personne suivante à ma liste de contacts (prenom.nom) :
+ <input type="text" name="user" size="20" maxlength="70" />
+ <input type="submit" value="Ajouter" />
+</p>
+</form>
+<p class="normal">
+ Tu peux également rajouter des camarades dans tes contacts lors d'une recherche dans l'annuaire :
+ il te suffit de cliquer sur l'icône <img src="images/ajouter.gif" alt="ajout contact"> en face de son nom dans les résultats !
+</p>
+
+{dynamic}
+{if $nb_contacts}
+<p class="normal">
+ Pour récupérer ta liste de contacts dans un PDF imprimable :<br />
+ [<a href="mescontacts_pdf.php/mes_contacts.pdf?order=promo" target="blank"><b>Triée par promo</b></a>]
+ [<a href="mescontacts_pdf.php/mes_contacts.pdf" target="blank"><b>Triée par noms</b></a>]
+</p>
+
+<br />
+
+<div class="contact-list">
+{foreach item=contact from=$contacts}
+{include file=include/x_inscrit.tpl c=$contact show_action="retirer"}
+{/foreach}
+</div>
+
+{else}
+<p class="normal">Actuellement ta liste de contacts est vide...</p>
+{/if}
+{/dynamic}
+
+{* vim:set et sw=2 sts=2 sws=2: *}