<?php // Licence Publique Générale GNU (GNU General Publique License), Copyright 2005-2008 Geffrotin Yann
//choix de la requête éuivalente au POST
//doit être précis et n'afficher l'historique d'un seul titre
if ($connexion){ // si connexion à la base réussi
if( mysql_select_db($base,$connexion) ){
$requete_transferer = "SELECT * FROM freepay_titre_transferer "; //début de requête et fin alternative ci-dessous
if( $courriel != "" && $ISIN != "") {
$requete_transferer .= "WHERE mailcli like '%".$courriel."%' and numtitre like '%".$ISIN."%' order by datet asc;";
}else{
if( $courriel != ""){
$requete_transferer .= "WHERE mailcli like '%".$courriel."%' ORDER BY datet ASC;";
}
if( $ISIN != ""){
$requete_transferer .= "WHERE numtitre like '%".$ISIN."%' ORDER BY datet ASC;";
}
if( $ISIN == "" and $courriel == ""){
$requete_transferer .= "ORDER BY datet ASC;";
}
}
$resultat_transferer = mysql_query($requete_transferer,$connexion); //connexion de la requete
$ligne = @mysql_fetch_assoc($resultat_transferer); //affichage des résultats
if (empty($ligne)){
echo "<p class='erreur'>".$ErrBaseEmpty[$lang]."</p>";
}else{
// echo '<h4 class="titre">'.$MenuHisto[$lang].'</h4>'; // déjà mis plus haut
echo '<table width="100%">
<tr>
<th>'.$Date[$lang].'</th>
<th>'.$ISINi18n[$lang].'</th>
<th>'.$Proprietaire[$lang].'</th>
<th>'.$Achat[$lang].'</th>
<th>'.$ValDevise[$lang].' '.$CodeNomDevise.'</th>
<th>'.$ValPrct[$lang].'</th>
</tr>';
do{
echo '<tr>
<td class="historique"
onmouseover="this.style.backgroundColor=\'white\'"
onmouseout="this.style.backgroundColor=\'#c8d7e3\'" >'.$ligne["datet"].'</td>
<td class="historique"
onmouseover="this.style.backgroundColor=\'white\'"
onmouseout="this.style.backgroundColor=\'#c8d7e3\'" >
<a href="'.$AdresseFreePay.'paiement/titre/titre_acheter.php?ISIN='.$ligne["numtitre"].'">'.$ligne["numtitre"].'</a></td>
<td class="historique"
onmouseover="this.style.backgroundColor=\'white\'"
onmouseout="this.style.backgroundColor=\'#c8d7e3\'" >
<a href="'.$AdresseFreePay.'support/mail.php?destinataire='.$ligne["mailcli"].'">'.$ligne["mailcli"].'</a> </td>
<td class="historique" style="text-align:right"
onmouseover="this.style.backgroundColor=\'white\'"
onmouseout="this.style.backgroundColor=\'#c8d7e3\'" >'.$ligne["achattitre"].' '.$CodeNomDevise.'</td>';
$ProfitEnValeur = $ligne["achattitre"] * $ligne["tauxprofit"] / 100;
$ProfitEnValeur = titre_verif($ProfitEnValeur);
echo '<td class="historique" style="text-align:right;color:green;"
onmouseover="this.style.backgroundColor=\'white\'"
onmouseout="this.style.backgroundColor=\'#c8d7e3\'" >+ '.$ProfitEnValeur.' EUR</td>
<td class="historique" style="text-align:right;color:green;"
onmouseover="this.style.backgroundColor=\'white\'"
onmouseout="this.style.backgroundColor=\'#c8d7e3\'" >+ '.$ligne["tauxprofit"].' %</td>
</tr>';
}while($ligne = mysql_fetch_assoc($resultat_transferer) );
echo '</table>';
}
}else{
echo $ErrBase[$lang];
}
}else{ // si connexion à la base échoué
echo '<p class="erreur">La connexion à la base de donnée à échoué.</p>';
}
?>