Eléphanteau du PHP |
48 Messages
11 déc. 2008, 12:55
A priori ca marche.
Cependant j'ai du faire une gaffe car j'ai ce message d'erreur:
Parse error: syntax error, unexpected ';' in C:\wamp\www\blabla\annuaire\annuaire-new2.php on line 141.
La ligne 141 correspondrait à:
<tr bordercolor="#000000" onMouseOver="this.style.backgroundColor=#FFCCCC" onMouseOut="this.style.backgroundColor=#FFFFFF">
Pouvez-vous m'aider parce que là mes yeux fatiguent lol.
<form name="mailall" method="post" action="<?php echo $PHP_SELF."?validform=ok"; ?>">
<a href="javascript:document.mailall.submit()"></a>
<table align="center" width="80%" border="1" cellpadding="2" cellspacing="1" bordercolor="#000000">
<tr bordercolor="#000000">
<td width="120" title="Classer la liste suivant le Nom de l'agent"><a href="?ref=nomagent<?php if (!empty($caisse_origine)) { ?>&caisse_origine=<?php echo $caisse_origine; } ?>" class="Style98">Nom</a></td>
<td width="250" title="Classer la liste suivant le Service de l'agent"><a href="?ref=service<?php if (!empty($caisse_origine)) { ?>&caisse_origine=<?php echo $caisse_origine; } ?>" class="Style98">Service</a></td>
<td width="120" align="center" title="Classer la liste suivant le Numéro de l'agent"><a href="?ref=telephone<?php if (!empty($caisse_origine)) { ?>&caisse_origine=<?php echo $caisse_origine; } ?>" class="Style98">Numéro de Poste</a></td>
</tr>
<?php
$sql = "SELECT idagent, nomagent,prenomagent,service,fonction,portefeuille,telephone,email FROM agent ";
if (!empty($caisse_origine)) {
$sql .= "WHERE caisse_origine = '$caisse_origine' ";
}
$sql .= "ORDER BY $ref";
$resultat = mysql_query ($sql, $connexion);
$string = "";
while ($tabagent = mysql_fetch_array($resultat, MYSQL_ASSOC)) {
$string .= ?>
<tr bordercolor="#000000" onMouseOver="this.style.backgroundColor=#FFCCCC" onMouseOut="this.style.backgroundColor=#FFFFFF"> <td><span class="Style95 Style97">
<?php
$image = "../personnel/".$tabagent[idagent].".jpg";
$image0 = "../personnel/image0.jpg";
if(is_file($image)) $string.=?><img src="<?php $image ?>" border="1" hspace="10" width="50" align="absmiddle" />
<?php else $string.= ?><img src="<?php $image0 ?>" border="1" hspace="10" width="50" align="absmiddle" />
<?php $string .= " ".$tabagent[nomagent]." ".$tabagent[prenomagent]?></span></td>
<?php }
echo $string;
?>
<td><span class="Style95 Style97"><?php echo $tabagent[service]; ?><br>
<?php if (!empty($tabagent[fonction])) {echo " ~ ".$tabagent[fonction];} ?></span></td>
<td width="120" align="center"<?php if (empty($tabagent[telephone])) { ?><?php }?>><span class="Style95 Style97">
<?php $num_interne = "0"; if (strpos($tabagent[telephone], '05010203') !== false or strpos($tabagent[telephone], '05020304') !== false or strpos($tabagent[telephone], '05020304') !== false) { $num_interne = "1";} $telephone = preg_split('//',$tabagent[telephone]); for($i=0;$i<sizeof($telephone);$i++) {echo $telephone[$i]; if ($i%2 == "0") {echo " ";} if ($i == "7" and $num_interne == "1") { echo "<font color='#990000'><b>"; } } ?>
</span>
<span class="Style97">
<?php if ($num_interne == "1") { echo "</b></font>"; }?>
</span></td>
</tr>
</table>
</form>
[/php]