git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-239
{
global $page,$globals;
$page->assign('formulaire',1);
- $page->mysql_assign('SELECT a2 AS id,IF(nat=\'\',pays,nat) AS text FROM geoloc_pays ORDER BY text', 'choix_nationalites');
- $page->mysql_assign('SELECT id,fonction_fr FROM fonctions_def ORDER BY fonction_fr', 'choix_postes');
- $page->mysql_assign('SELECT id,text FROM binets_def ORDER BY text', 'choix_binets');
- $page->mysql_assign('SELECT id,text FROM groupesx_def ORDER BY text', 'choix_groupesx');
- $page->mysql_assign('SELECT id,text FROM sections ORDER BY text', 'choix_sections');
- $page->mysql_assign('SELECT id,text FROM applis_def ORDER BY text', 'choix_schools');
- $page->mysql_assign('SELECT id,label FROM emploi_secteur ORDER BY label', 'choix_secteurs');
+ $page->assign('choix_nats', $globals->xdb->iterator('SELECT a2 AS id,IF(nat=\'\',pays,nat) AS text FROM geoloc_pays ORDER BY text'));
+ $page->assign('choix_postes', $globals->xdb->iterator('SELECT id,fonction_fr FROM fonctions_def ORDER BY fonction_fr'));
+ $page->assign('choix_binets', $globals->xdb->iterator('SELECT id,text FROM binets_def ORDER BY text'));
+ $page->assign('choix_groupesx', $globals->xdb->iterator('SELECT id,text FROM groupesx_def ORDER BY text'));
+ $page->assign('choix_sections', $globals->xdb->iterator('SELECT id,text FROM sections ORDER BY text'));
+ $page->assign('choix_schools', $globals->xdb->iterator('SELECT id,text FROM applis_def ORDER BY text'));
+ $page->assign('choix_secteurs', $globals->xdb->iterator('SELECT id,label FROM emploi_secteur ORDER BY label'));
if (Env::has('school')) {
$sql = 'SELECT type FROM applis_def WHERE id='.Env::getInt('school');
// on regarde si on a affaire à un homonyme
$sql = "SELECT alias, (type='a_vie') AS a_vie, FIND_IN_SET('bestalias',flags) AS best, expire
FROM aliases
- WHERE id=$uid AND type!='homonyme'
+ WHERE id = {?} AND type!='homonyme'
ORDER BY LENGTH(alias)";
-$page->mysql_assign($sql, 'aliases');
+$page->assign('aliases', $globals->xdb->iterator($sql, $uid));
$sql = "SELECT email
FROM emails
- WHERE uid = $uid AND FIND_IN_SET('active', flags)";
-$page->mysql_assign($sql, 'mails', 'nb_mails');
+ WHERE uid = {?} AND FIND_IN_SET('active', flags)";
+$page->assign('mails', $globals->xdb->iterator($sql, $uid));
// on regarde si l'utilisateur a un alias et si oui on l'affiche !
INNER JOIN auth_user_md5 AS a ON e.user_id=a.user_id
INNER JOIN aliases AS l ON ( a.user_id=l.id AND l.type='a_vie' )
WHERE FIND_IN_SET(e.flags, 'valide') AND peremption >= NOW()
- AND (e.promo_min = 0 || e.promo_min <= $promo)
- AND (e.promo_max = 0 || e.promo_max >= $promo)
+ AND (e.promo_min = 0 || e.promo_min <= {?})
+ AND (e.promo_max = 0 || e.promo_max >= {?})
ORDER BY (e.promo_min != 0 AND e.promo_max != 0) DESC, e.peremption";
-$page->mysql_assign($sql, 'evenement');
+$page->assign('evenement', $globals->xdb->iterator($sql, $promo, $promo));
$page->assign('toto',"");
$page->assign('tata',"1");
}
$requete.=' ORDER BY (e.promo_min != 0 AND e.promo_max != 0) DESC, e.peremption';
-$page->mysql_assign($requete, 'rss');
+$page->assign('rss', $globals->xdb->iterator($requete));
header('Content-Type: text/xml');
$page->run();
$page->assign_by_ref('cp',$cp);
} else {
$beginning_date = date("Ymd", time() - 3600*24*21) . "000000";
- $sql = "select id, UNIX_TIMESTAMP(debut) as debut, resume, services from coupures where debut > '" . $beginning_date
- . "' order by debut desc";
- $page->mysql_assign($sql, 'coupures');
+ $sql = "select id, UNIX_TIMESTAMP(debut) as debut, resume, services from coupures where debut > '$beginning_date' order by debut desc";
+ $page->assign('coupures', $globals->xdb->iterator($sql));
}
$page->run();
$page->assign('from_solde', solde_until($from_date));
$page->assign('to_solde', solde_until($to_date));
-$page->assign_by_ref('month_arr', $mois_fr);
-
-$sql = "SELECT id,date,label,credit,debit
- FROM money_trezo
- WHERE date >= '$from_date' AND date <= '$to_date'
- ORDER BY date";
-$page->mysql_assign($sql, 'ops');
+$page->assign('month_arr', $mois_fr);
+$page->assign('ops', $globals->xdb->iterator(
+ "SELECT id,date,label,credit,debit FROM money_trezo WHERE date >= {?} and date <= {?} ORDER BY date",
+ $from_date, $to_date));
$page->run();
?>
require_once("xorg.inc.php");
require_once("money/trezo.inc.php");
-new_admin_page('trezo/index.tpl');
+new_skinned_page('trezo/index.tpl', AUTH_COOKIE);
//Table operations :
//+--------+---------------+------+-----+------------+----------------+
$page->assign('mon_sel', $mon_sel);
$page->assign_by_ref('month_arr', $trim_fr);
-$sql = "SELECT date,label,credit,debit FROM money_trezo
- WHERE date >= '$from_date' and date <= '$to_date'
- ORDER BY date";
-$page->mysql_assign($sql,'ops');
+$page->assign('ops', $globals->xdb->iterator(
+ "SELECT date,label,credit,debit FROM money_trezo WHERE date >= {?} and date <= {?} ORDER BY date",
+ $from_date, $to_date));
$page->run();
?>
Tes adresses polytechniciennes sont :<br /><br />
<form method='post' action='{$smarty.server.PHP_SELF}'>
<div>
- {foreach from=$aliases item=a}
+ {iterate from=$aliases item=a}
<input type='radio' {if $a.best}checked="checked"{/if} name='best' value='{$a.alias}' onclick='this.form.submit()' />
{if $a.a_vie}(*){/if} <strong>{$a.alias}</strong>@{#globals.mail.domain#} et @{#globals.mail.domain2#}
{if $a.expire}<span class='erreur'>(expire le {$a.expire|date_format})</span>{/if}
<br />
- {/foreach}
+ {/iterate}
</div>
</form>
<br />
<tr class="pair">
<td>
Actuellement, tout courrier électronique qui t'y est adressé, est envoyé
- {if $nb_mails eq 1} à l'adresse {else} aux adresses {/if}
+ {if $mails->total() eq 1} à l'adresse {else} aux adresses {/if}
<ul>
- {section name=mail loop=$mails}
- <li><strong>{$mails[mail].email}</strong>{if $smarty.section.mail.last}.{else}, {/if}</li>
- {/section}
+ {iterate from=$mails item=m}
+ <li><strong>{$m.email}</strong></li>
+ {/iterate}
</ul>
Si tu souhaites <strong>modifier ce reroutage de ton courrier,</strong>
<a href="{rel}/emails/redirect.php">il te suffit de te rendre ici !</a>
</tr>
</table>
- {foreach item=ev from=$evenement}
+ {iterate item=ev from=$evenement}
<br />
<table class="bicol">
</td>
</tr>
</table>
- {/foreach}
+ {/iterate}
<p class="smaller">
Nota Bene : les informations présentées ici n'engagent que leurs auteurs
<description>L'actualité polytechnicienne...{if $promo} Promotion {$promo}{/if}</description>
<language>fr</language>
-{foreach item=line from=$rss}
+{iterate item=line from=$rss}
<item>
<title>{$line.titre|strip_tags}</title>
<link>http://{$smarty.server.SERVER_NAME}/login.php#newsid{$line.id}</link>
</item>
-{/foreach}
+{/iterate}
</channel>
</rss>
<td>
<select name="poste">
<option value="0"></option>
- {section name=poste loop=$choix_postes}
- <option value="{$choix_postes[poste].id}" {if $smarty.request.poste eq $choix_postes[poste].id}selected{/if}>
- {$choix_postes[poste].fonction_fr}
+ {iterate from=$choix_postes item=cp}
+ <option value="{$cp.id}" {if $smarty.request.poste eq $cp.id}selected{/if}>
+ {$cp.fonction_fr}
</option>
- {/section}
+ {/iterate}
</select>
</td>
</tr>
<td>
<select name="secteur">
<option value="0"></option>
- {section name=secteur loop=$choix_secteurs}
- <option value="{$choix_secteurs[secteur].id}" {if $smarty.request.secteur eq $choix_secteurs[secteur].id}selected{/if}>
- {$choix_secteurs[secteur].label}
+ {iterate item=cs from=$choix_secteurs}
+ <option value="{$cs.id}" {if $smarty.request.secteur eq $cs.id}selected{/if}>
+ {$cs.label}
</option>
- {/section}
+ {/iterate}
</select>
</td>
</tr>
<td>Nationalité</td>
<td>
<select name="nationalite">
- {section name=nationalite loop=$choix_nationalites}
- <option value="{$choix_nationalites[nationalite].id}" {if $smarty.request.nationalite eq
- $choix_nationalites[nationalite].id}selected="selected"{/if}>
- {$choix_nationalites[nationalite].text}
+ {iterate from=$choix_nats item=cn}
+ <option value="{$cn.id}" {if $smarty.request.nationalite eq $cn.id}selected="selected"{/if}>
+ {$cn.text}
</option>
- {/section}
+ {/iterate}
</select>
</td>
</tr>
<td>
<select name="binet">
<option value="0"></option>
- {section name=binet loop=$choix_binets}
- <option value="{$choix_binets[binet].id}" {if $smarty.request.binet eq
- $choix_binets[binet].id}selected="selected"{/if}>
- {$choix_binets[binet].text}
+ {iterate item=cb from=$choix_binets}
+ <option value="{$cb.id}" {if $smarty.request.binet eq $cb.id}selected="selected"{/if}>
+ {$cb.text}
</option>
- {/section}
+ {/iterate}
</select>
</td>
</tr>
<td>
<select name="groupex">
<option value="0"></option>
- {section name=groupex loop=$choix_groupesx}
- <option value="{$choix_groupesx[groupex].id}" {if $smarty.request.groupex eq
- $choix_groupesx[groupex].id}selected="selected"{/if}>
- {$choix_groupesx[groupex].text}
+ {iterate item=cg from=$choix_groupesx}
+ <option value="{$cg.id}" {if $smarty.request.groupex eq $cg.id}selected="selected"{/if}>
+ {$cg.text}
</option>
- {/section}
+ {/iterate}
</select>
</td>
</tr>
<td>Section</td>
<td>
<select name="section">
- {section name=section loop=$choix_sections}
- <option value="{$choix_sections[section].id}" {if $smarty.request.section eq
- $choix_sections[section].id}selected="selected"{/if}>
- {$choix_sections[section].text}
+ {iterate item=cs from=$choix_sections}
+ <option value="{$cs.id}" {if $smarty.request.section eq $cs.id}selected="selected"{/if}>
+ {$cs.text}
</option>
- {/section}
+ {/iterate}
</select>
</td>
</tr>
<td>
<select name="school" onchange="javascript:document.forms.recherche.submit();">
<option value="0"></option>
- {section name=school loop=$choix_schools}
- <option value="{$choix_schools[school].id}" {if $smarty.request.school eq
- $choix_schools[school].id}selected="selected"{/if}>
- {$choix_schools[school].text}
+ {iterate item=cs from=$choix_schools}
+ <option value="{$cs.id}" {if $smarty.request.school eq $cs.id}selected="selected"{/if}>
+ {$cs.text}
</option>
- {/section}
+ {/iterate}
</select>
</td>
</tr>
<th>résumé</th>
<th>services affectés</th>
</tr>
-{foreach item=cp from=$coupures}
+{iterate item=cp from=$coupures}
<tr class="{cycle values="pair,impair"}">
<td>
<span class="smaller">
</span>
</td>
</tr>
-{/foreach}
+{/iterate}
</table>
{/if}
</form>
</td>
</tr>
-{foreach item=op from=$ops}
+{iterate item=op from=$ops}
<tr class="{cycle values="pair,impair"}">
<td>{$op.id}</td>
<td>{$op.date|date_format}</td>
</form>
</td>
</tr>
-{/foreach}
+{/iterate}
</table>
<br />
<th>Dépenses</th>
<th>Recettes</th>
</tr>
-{foreach item=op from=$ops}
+{iterate item=op from=$ops}
<tr class="{cycle values="impair,pair"}">
<td>{$op.date|date_format}</td>
<td>{$op.label}</td>
<td class="right">{$op.debit}</td>
<td class="right">{$op.credit}</td>
</tr>
-{/foreach}
+{/iterate}
</table>
<br />