From 3e49d20baa373e21b90b79ea63ad4acd22d05d7d Mon Sep 17 00:00:00 2001 From: x2000coic Date: Fri, 6 Aug 2004 17:50:22 +0000 Subject: [PATCH] migration de x.php MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit c'est un peu laid mais ca marche à peu près --- htdocs/css/fiche.css | 31 +++++++ htdocs/fiche.php | 217 +++++++++++++++++++++++++++++++++++++++++++ htdocs/fiche_referent.php | 6 +- htdocs/images/mail.png | Bin 0 -> 1183 bytes templates/add_fiche_css.tpl | 1 + templates/fiche.tpl | 132 ++++++++++++++++++++++++++ templates/fiche_referent.tpl | 37 -------- 7 files changed, 382 insertions(+), 42 deletions(-) create mode 100644 htdocs/css/fiche.css create mode 100644 htdocs/fiche.php create mode 100644 htdocs/images/mail.png create mode 100644 templates/add_fiche_css.tpl create mode 100644 templates/fiche.tpl diff --git a/htdocs/css/fiche.css b/htdocs/css/fiche.css new file mode 100644 index 0000000..bf53282 --- /dev/null +++ b/htdocs/css/fiche.css @@ -0,0 +1,31 @@ +div.boite{ + border: 1px solid #5555BB; + background-color: #FFFFC0; + padding: 5px; + margin: 5px; +} + +div.boite div.titre{ + background-color: #9999FF; + margin: 5px; + padding: 5px; + text-align: center; +} + +div.spacer{ + clear: both; +} + +div.boite div.item{ + float: left; + padding: 5px; + margin: 5px; +} + +div.item div.title{ + font-weight: bold; +} + +div.item div.value{ + +} diff --git a/htdocs/fiche.php b/htdocs/fiche.php new file mode 100644 index 0000000..f2afb55 --- /dev/null +++ b/htdocs/fiche.php @@ -0,0 +1,217 @@ +assign('prenom', $prenom); +$page->assign('nom', $nom); +$page->assign('promo', $promo); +$page->assign('cv', $cv); +$page->assign('username', $username); +$page->assign('epouse', $epouse); +$page->assign('nationalite', $nationalite); +$page->assign('user_id', $user_id); +$page->assign('alias', $alias); +$page->assign('matricule', $matricule); +$page->assign('dcd', $dcd); +$page->assign('deces', $deces); +$page->assign('date', $date); +$page->assign('section', $section); +$page->assign('mobile', $mobile); +$page->assign('web', $web); +$page->assign('libre', $libre); + +// reformatage is_contact +$is_contact = (bool) $is_contact; +$page->assign('is_contact', $is_contact); + +// photo + +$photo="getphoto.php?x=".$user_id.(SID == '' ? '' : '&'.SID).($new ? '&modif=new' : ''); +if(!isset($size_y) and !isset($size_x)) list($size_x, $size_y) = getimagesize("none.png"); +if(!isset($size_y) or $size_y < 1) $size_y=1; +if(!isset($size_x) or $size_x < 1) $size_x=1; +if($size_y > 300){ + $size_x = (integer)($size_x*300/$size_y); + $size_y = 300; +} +if($size_x < 180){ + $size_y = (integer)($size_y*180/$size_x); + $size_x = 180; +} +$page->assign('photo_url', $photo); +$page->assign('size_x', $size_x); +$page->assign('size_y', $size_y); + + +mysql_free_result($result); + +//recuperation des infos professionnelles +$reqsql = + "SELECT e.entreprise, s.label as secteur , ss.label as sous_secteur , f.fonction_fr as fonction, + e.poste, e.adr1, e.adr2, e.adr3, e.cp, e.ville, + gp.pays, gr.name, e.tel, e.fax + FROM entreprises AS e + LEFT JOIN emploi_secteur AS s ON(e.secteur = s.id) + LEFT JOIN emploi_ss_secteur AS ss ON(e.ss_secteur = ss.id AND e.secteur = ss.secteur) + LEFT JOIN fonctions_def AS f ON(e.fonction = f.id) + LEFT JOIN geoloc_pays AS gp ON (gp.a2 = e.pays) + LEFT JOIN geoloc_region AS gr ON (gr.a2 = e.pays and gr.region = e.region) + WHERE e.uid = $user_id + ORDER BY e.entrid + "; + +$result = mysql_query($reqsql); + +$i = 0; +while(list($adr_pro[$i]['entreprise'], $adr_pro[$i]['secteur'], $adr_pro[$i]['ss_secteur'], + $adr_pro[$i]['fonction'], $adr_pro[$i]['poste'], + $adr_pro[$i]['adr1'], $adr_pro[$i]['adr2'], $adr_pro[$i]['adr3'], + $adr_pro[$i]['cp'], $adr_pro[$i]['ville'], + $adr_pro[$i]['pays'], $adr_pro[$i]['region'], + $adr_pro[$i]['tel'], $adr_pro[$i]['fax']) = mysql_fetch_row($result)){ + if(!empty($adr_pro[$i]['entreprise']) || !empty($adr_pro[$i]['secteur']) || + !empty($adr_pro[$i]['fonction']) || !empty($adr_pro[$i]['poste']) || + !empty($adr_pro[$i]['adr1']) || !empty($adr_pro[$i]['adr2']) || !empty($adr_pro[$i]['adr3']) || + !empty($adr_pro[$i]['cp']) || !empty($adr_pro[$i]['ville']) || + !empty($adr_pro[$i]['pays']) || !empty($adr_pro[$i]['tel']) || !empty($adr_pro[$i]['fax']) + ){ + $i++; + } +} +unset($adr_pro[$i]); +$nb_infos_pro = $i; +$page->assign('nb_infos_pro', $nb_infos_pro); +$page->assign_by_ref('adr_pro', $adr_pro); +mysql_free_result($result); + +//recuperation des adresses +$reqsql = + "SELECT a.adr1,a.adr2,a.adr3,a.cp,a.ville, + gp.pays,gr.name AS region,a.tel,a.fax, + FIND_IN_SET('active', a.statut), + FIND_IN_SET('res-secondaire', a.statut) + FROM adresses AS a + LEFT JOIN geoloc_pays AS gp ON (gp.a2=a.pays) + LEFT JOIN geoloc_region AS gr ON (gr.a2=a.pays and gr.region=a.region) + WHERE uid=$user_id AND NOT FIND_IN_SET('pro',a.statut) + ORDER BY NOT FIND_IN_SET('active',a.statut), FIND_IN_SET('temporaire',a.statut), FIND_IN_SET('res-secondaire',a.statut)"; + +$result = mysql_query($reqsql); + +$nbadr=mysql_num_rows($result); + +for ($i=0;$row = mysql_fetch_row($result);$i++) { + + list( $adr[$i]['adr1'], $adr[$i]['adr2'], $adr[$i]['adr3'], + $adr[$i]['cp'], $adr[$i]['ville'], + $adr[$i]['pays'], $adr[$i]['region'], + $adr[$i]['tel'], $adr[$i]['fax'], + $adr[$i]['active'], $adr[$i]['secondaire']) = $row; + + if ($adr[$i]['active']) + $adr[$i]['title'] = "Mon adresse actuelle :"; + elseif ($adr[$i]['secondaire']) + $adr[$i]['title'] = "Adresse secondaire :"; + else + $adr[$i]['title'] = "Adresse principale :"; + +} +$page->assign_by_ref('adr', $adr); +mysql_free_result($result); + + +// reformatage binets +$result = mysql_query("SELECT text + FROM binets_ins + LEFT JOIN binets_def + ON binets_ins.binet_id = binets_def.id + WHERE user_id = '$user_id'"); +if (list($binets) = mysql_fetch_row($result)){ + while (list($binet) = mysql_fetch_row($result)) + $binets .= ", $binet"; + } +} +mysql_free_result($result); +$page->assign('binets', $binets); + +// reformatage Groupes X +$result = mysql_query("SELECT text, url + FROM groupesx_ins + LEFT JOIN groupesx_def ON groupesx_ins.gid = groupesx_def.id + WHERE guid = '$user_id'"); +$gxs = ""; +while (list($gxt,$gxu) = mysql_fetch_row($result)) { + if ($gxs) $gxs .= ", "; + if ($gxu) $gxs .= ""; + $gxs .= $gxt; + if ($gxu) $gxs .= ""; +} +mysql_free_result($result); +$page->assign('groupes', $gxs); + +// reformatage appli +$result = mysql_query("SELECT applis_def.text, applis_def.url, applis_ins.type + FROM applis_ins + INNER JOIN applis_def ON applis_def.id = applis_ins.aid + WHERE uid='$user_id' + ORDER by ordre"); +if (list($rapp_txt, $rapp_url, $rapp_type) = mysql_fetch_row($result)) { + $applis = applis_fmt($rapp_type, $rapp_txt, $rapp_url); + while (list($rapp_txt, $rapp_url, $rapp_type) = mysql_fetch_row($result)) { + $applis .=", "; + $applis .= applis_fmt($rapp_type, $rapp_txt, $rapp_url); + } +} +mysql_free_result($result); +$page->assign('applis', $applis); + +$page->run(); + +?> diff --git a/htdocs/fiche_referent.php b/htdocs/fiche_referent.php index 310ed81..4e4946c 100644 --- a/htdocs/fiche_referent.php +++ b/htdocs/fiche_referent.php @@ -1,7 +1,7 @@ assign('nb_infos_pro', $nb_infos_pro); $page->assign_by_ref('adr_pro', $adr_pro); -if ($nb_infos_pro!=0) - $taille_adr_pro=(int)(100/$nb_infos_pro); -else - $taille_adr_pro=100; mysql_free_result($result); ///// recuperations infos referent diff --git a/htdocs/images/mail.png b/htdocs/images/mail.png new file mode 100644 index 0000000000000000000000000000000000000000..d7110f7dfadfebb1a5e452c75f948c583a2eeb64 GIT binary patch literal 1183 zcmeHGT}u>U6n=F>*KLiZw1!PcBcjlx+4jQCK4{%VcPLv|gPav?9jt8p$YvpHE7T@Q zd!rBLB4UV021NEXq~;=Q3KTZ7cB6zLG6tfHf-VZg=1NX)&`;>n1JCmu4(A*W51i3x zV|}s9>p}<>M;bygswEWboDRy2_w6i|(q#B}vhG}GBH7i~Ti(*u(}@Zf))bWF`;P_c zOxjSGj2sEmQsE|7*{iAeX<8~e+t4Z@*9zqTjJ=_xZcsvY)7=~e4#Ih{M zA&zr$oQLBAJdb!jC-yAR!VVDMDmIh^|YzuIRd|>$+iRhCvL2CPpU1WHOX9 zxg0jllxdol<+Lnp+fLi2tlPF}+m>zH06_o|Kmtes$N(5X0Z;)5fDT{)UkI6Fcd8r`7)nadq-X9 zZk`y~Kb^h3)H=I<1rA=#-h7{0%I@3qqoY3&YTL20oT>Tz_}15ry?Nc2u8+Ex#x6Lk z52(4JQw^{4=bEZ(+h$9DTiy>7O($zMR}RlCqQS~-{z+e3`eMg?!N>Elt=rqxqccoo zlFyc>7u(gR%P&R-9@O*geRucHjRhV$s^0jnkftiuU&ig6uDbEuWY4(cFE8iDE&RP` Wi?#dNqienhJs(BFjiIUFiQzx?!)8AK literal 0 HcmV?d00001 diff --git a/templates/add_fiche_css.tpl b/templates/add_fiche_css.tpl new file mode 100644 index 0000000..39084a2 --- /dev/null +++ b/templates/add_fiche_css.tpl @@ -0,0 +1 @@ + diff --git a/templates/fiche.tpl b/templates/fiche.tpl new file mode 100644 index 0000000..d7afff5 --- /dev/null +++ b/templates/fiche.tpl @@ -0,0 +1,132 @@ +{dynamic} +
+
+ {$prenom|htmlentities} {$nom|htmlentities}
+ X {$promo|htmlentities}
+ Fiche mise à jour le {$date|date_format:"%d/%m/%Y"}
+ Afficher la carte de visite  + {if !$is_contact} + Ajouter parmi mes contacts  + {/if} + Envoyer l'URL
+ {$username}@polytechnique.org
+ Section : {$section|htmlentities}
+ Binet(s) : {$binets|htmlentities}
+ Groupe(s) X : {$groupes|htmlentities}
+ {if $mobile}
Mobile : {$mobile|htmlentities}
{/if} + {if $libre}
Commentaires :
{$libre|htmlentities|nl2br}{/if} +
+
+ Photo de {$username} +
+
 
+
+ +{foreach from=$adr item="address" key="i"} +
+
{$address.title}
+ {if $address.adr1 || $address.pays || $address.ville} +
+
Adresse :
+
+ {if $address.adr1}{$address.adr1|htmlentities}
{/if} + {if $address.adr2}{$address.adr2|htmlentities}
{/if} + {if $address.adr3}{$address.adr3|htmlentities}
{/if} + {if $address.ville}{$address.cp|htmlentities} {$address.ville|htmlentities}
{/if} + {if $address.pays} + {$address.pays|htmlentities}{if $address.region} ({$address.region|htmlentities}){/if} + {/if} +
+
+ {/if} +
 
+ + {if $address.tel} +
+
Tél :
+
{$address.tel|htmlentities}
+
+ {/if} + + {if $address.fax} +
+
Fax :
+
{$address.fax|htmlentities}
+
+ {/if} +
 
+
+{/foreach} + +{foreach from=$adr_pro item="address" key="i"} +
+
Infos professionnelles - Entreprise n°{$i+1}
+ {if $address.entreprise} +
+
Entreprise/Organisme :
+
{$address.entreprise|htmlentities}
+
+ {/if} + {if $address.secteur} +
+
Secteur :
+
{$address.secteur|htmlentities}{if $address.ss_secteur} ({$address.ss_secteur|htmlentities}){/if}
+
+ {/if} +
 
+ + {if $address.adr1 || $address.pays || $address.ville} +
+
Adresse :
+
+ {if $address.adr1}{$address.adr1|htmlentities}
{/if} + {if $address.adr2}{$address.adr2|htmlentities}
{/if} + {if $address.adr3}{$address.adr3|htmlentities}
{/if} + {if $address.ville}{$address.cp|htmlentities} {$address.ville|htmlentities}
{/if} + {if $address.pays} + {$address.pays|htmlentities}{if $address.region} ({$address.region|htmlentities}){/if} + {/if} +
+
+ {/if} +
 
+ + {if $address.fonction} +
+
Fonction :
+
{$address.fonction|htmlentities}
+
+ {/if} + {if $address.poste} +
+
Poste :
+
{$address.poste|htmlentities}
+
+ {/if} +
 
+ + {if $address.tel} +
+
Tél :
+
{$address.tel|htmlentities}
+
+ {/if} + + {if $address.fax} +
+
Fax :
+
{$address.fax|htmlentities}
+
+ {/if} +
 
+
+{/foreach} + +{if $cv} +
+
CV
+
{$cv|htmlentities|nl2br}
+
 
+
+{/if} +{/dynamic} diff --git a/templates/fiche_referent.tpl b/templates/fiche_referent.tpl index 3c2b24f..63c9f2e 100644 --- a/templates/fiche_referent.tpl +++ b/templates/fiche_referent.tpl @@ -1,41 +1,4 @@ {dynamic} -{literal} - -{/literal} -
{$prenom} {$nom}
X{$promo} -  -- 2.1.4