weed | malgré la longueur du source, je vous le mets au cas ou ca peut aider à trouver cette foutu ft qui empeche mail():
Code :
- <?php
- $separator = 'prix=';
- include("../../include/ma_config.php" );
- mysql_connect($hostname,$mysqluser,$mysqlpswd);
- mysql_selectdb($database) or die($diemessage);
- $tva /= 100;
- $msghtml = $msghtml_tmp;
- $msghtml_admin = $msghtml_tmp;
- $msghtml_admin .= "
- <th width='95px'>
- Prix coutant € HT
- </th>
- <th width='95px'>
- Marge
- </th>
- ";
- $msghtml_tmp = "<th width='95px'>
- Prix € HT
- </th>
- <th width='95px'>
- Prix € TTC
- </th>
- <th width='95px'>
- Prix FF TTC
- </th>
- </tr>";
- $msghtml .= $msghtml_tmp;
- $msghtml_admin .= $msghtml_tmp;
- $msg = "Entreprise :\n$nom_entreprise\n$adresse\n$cp $ville\n\n\nArticle choisi :\n";
- $totaleuroht =0;
- $totalmarge =0;
- $totalcoutant=0;
- //session_start();
- while(list($cle,$val) = each($article_choisi))
- {
- if ($val != $separator)
- { list( $valeur, $tprix, $toto ) = split( $separator, $val);
- $req1 = mysql_query("SELECT col1, col7 FROM fichier WHERE col2='$valeur' " ) ;
- if (!$req1) echo "Selection impossible";
- while ($menu = mysql_fetch_object($req1))
- {
- if ($menu->col7 != "" )
- {
- //prix coutant
- $msg .="\n$menu->col1 (prix coutant $menu->col7 euros HT )";
- $msghtml_tmp="<tr>
- <td>
- $menu->col1
- <td>
- $valeur
- </td>
- ";
- $msghtml .= $msghtml_tmp;
- $msghtml_admin .= $msghtml_tmp;
- //prix coutant par article
- $msghtml_admin .= "<td align=right>".sprintf("%.2f",$menu->col7)."</td>";
- $totalcoutant +=$menu->col7;
- //la marge par produit en euros ...
- $tmp_marge = $menu->col7*$stx;
- $totalmarge +=$tmp_prix;
- $msghtml_admin .= "<td align=right>".sprintf("%.2f",$tmp_marge)."</td>";
- //prix euro ht marge comprise
- $tmp_prix = $menu->col7+ ($menu->col7*$stx);
- $totaleuroht += $tmp_prix;
- $msghtml_tmp ="<td align=right>".sprintf("%.2f",$tmp_prix)."</td> ";
- $msghtml_admin .= $msghtml_tmp;
- $msghtml .= $msghtml_tmp;
- $msg .= "$tmp_prix euros HT";
- //prix ttc
- $tmp_prix += $tmp_prix * $tva ;
- $msg .= " $tmp_prix euros TTC";
- $msghtml_tmp = "<td align=right>".sprintf("%.2f",$tmp_prix)."</td>";
- $msghtml .= $msghtml_tmp;
- $msghtml_admin .= $msghtml_tmp;
- //pric ttc ff
- $tmp_prix *= 6.55957;
- $msghtml_tmp ="<td align=right>".sprintf("%.2f",$tmp_prix)."
- </td>
- </tr>
- ";
- $msghtml .= $msghtml_tmp;
- $msghtml_admin .= $msghtml_tmp;
- }
- }
- }
- }
- $msghtml_tmp =" <tr height=25>
- <td></td><td></td><td></td>
- </tr>
- <tr>
- <td>
- <b>Total</b>
- </td>
- <td></td>
- ";
- $msghtml .= $msghtml_tmp;
- $msghtml_admin .= $msghtml_tmp;
- //total prix coutant & total de la marge faite
- $msghtml_admin .= "<td align=right>
- ".sprintf("%.2f",$totalcoutant)."
- </td>
- <td align=right>
- ".sprintf("%.2f",$totalcoutant*$stx)."
- </td>
- ";
- //total euro HT
- $msghtml_tmp ="<td align=right>".sprintf("%.2f",$totaleuroht)."
- </td>
- <td></td>
- </tr>
- ";
- $msghtml .= $msghtml_tmp;
- $msghtml_admin .= $msghtml_tmp;
- //affiche du taux de la TVA
- $msghtml_tmp ="<tr>
- <td><b>TVA a ".sprintf("%.2f",$tva*100)."%</b></td>
- <td></td>
- ";
- $msghtml .= $msghtml_tmp;
- $msghtml_admin .= $msghtml_tmp;
- $msghtml_admin .= " <td></td>
- <td></td>
- ";
- $msghtml_tmp = " <td align=right>".sprintf("%.2f",$totaleuroht*$tva)."</td>
- </tr>
- ";
- $msghtml .= $msghtml_tmp;
- $msghtml_admin .= $msghtml_tmp;
- $msghtml_tmp = "<tr>
- <td><b>TOTAL TTC</b></td>
- <td></td>
- ";
- $msghtml .= $msghtml_tmp;
- $msghtml_admin .= $msghtml_tmp;
- $msghtml_admin .= " <td></td>
- <td></td>
- ";
- $msghtml_tmp = "<td align=right>".sprintf("%.2f",$totaleuroht*$tva+$totaleuroht)."</td>
- </tr>
- </table>
- </div>";
- $msghtml .= $msghtml_tmp;
- $msghtml_admin .= $msghtml_tmp;
- echo "$msghtml";
- echo "<br><br><br><br>subjet $subjet<br><br> msg $msg";
- mail ( 'mt.hood@freesbee.fr','subjet','msg');
- //include ("mail_html.php" );
- //mail_html('mt.hd@freesbee.fr', 'Votre configuration' , '', $msghtml , 'j.hube@caramail.com')
- //mail ( '$mail','$subjet','$msg');
- ?>
|
le source fonctionne bien biensur sans la fonction mail();.... Message édité par weed le 22-05-2003 à 22:09:28
|