Amélioration de la gestion des encodages.
[auf_paf.git] / index_mdpo.php
1 <?php
2 error_reporting (E_ALL & ~E_NOTICE & ~E_DEPRECATED);
3 session_start();
4 $admin=$_SESSION["adminAUFPPKH"];
5 $UserName=$_SESSION["UserNamePAF"];
6 $Password=$_SESSION["PasswordPAF"];
7
8 ?>
9 <?php
10 header("Content-type: text/html; charset=utf-8");
11 ?>
12 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
13 <html xmlns="http://www.w3.org/1999/xhtml">
14 <head>
15 <title>P A F -- AUF Phnom Penh, Cambodge</title>
16 <link rel="shortcut icon" type="image/ico" href="images/paf.ico" />
17 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
18 <link href="includes/styles/style.css" rel="stylesheet" type="text/css" />
19 </head>
20 <?php
21 include("includes/connection.php");
22 include("includes/functions.php");
23 include("includes/redirect.php");
24 $kompler = "{%#bb^csr%#}";
25 //----------------Sauvegarder les informations-------------------------------
26 if($_REQUEST["cmdSend"]){
27 if($_REQUEST["txtMail"]==""){
28 $ErrorMail = "<img src='./images/error.png' title='Veuillez saisire votre adresse de courriel.'>";
29 $MsgErrors = "<span style='background-color:#F00F00; color:#FFFFFF;'>Erreur, votre mot de passe n'a pas envoy&eacute;.</span>";
30 }elseif(check_email($_REQUEST["txtMail"])==false){
31 $ErrorMail = "<img src='./images/error.png' title='Veuillez v&eacute;rifier votre mail.'>";
32 $MsgErrors = "<span style='background-color:#F00; color:#FFFFFF;'>Erreur, votre mot de passe n'a pas envoy&eacute;.</span>";
33 }else{
34 //----------tirer le mot de passe et login----------
35 $Strs = "Select login, motdepasse, id from tblinscrit where email='".$_REQUEST["txtMail"]."'";
36 $Row = mysql_fetch_row(mysql_query($Strs));
37 if(mysql_num_rows(mysql_query($Strs))>0){
38 //----------Envoyer les informations ---------------
39 $Subject = "PAF : Mot de passe oubli&eacute;";
40 $Today = date("Y-m-d");
41 $Time = date("Y-m-d H:i:s",time());
42 $Body = "<html><head><title></title></head><body>
43 <table width=\"584\" border=\"0\" cellpadding=\"0\" cellspacing=\"6\">
44 <tr>
45 <td colspan=\"2\" align=\"right\" style=\"padding-right:20px; padding-bottom:10px;\">Date : ".$Time."</td>
46 </tr>
47 <tr bgcolor=\"#E2F080\">
48 <td colspan=\"2\">Suject : Mot de passe oubli&eacute;</td>
49 </tr>
50 <tr>
51 <td width=\"30%\">Login : </td>
52 <td width=\"70%\">".$Row['0'].$Row['2']."</td>
53 </tr>
54 <tr>
55 <td>Mot de passe : </td>
56 <td>".decrptPwd($Row['1'],$kompler)."</td>
57 </tr>
58 <tr><td colspan=\"5\"><hr size=\"1\"></td></tr>
59 </table>
60 </body>
61 </html>";
62 $headers = 'MIME-Version: 1.0' . "\r\n";
63 $headers .= 'Content-type: text/html; charset=iso-8859-15;' . "\r\n";
64 //------------to sender-----------------------------------------
65 $Footer = "<br><br>Cordialement,<br><br>&nbsp;&nbsp;&nbsp;&nbsp;PAF<br><br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <br><br>Ce courriel a &eacute;t&eacute; envoy&eacute; par le PAF (".$Time.").<br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br><br>";
66 $headerss .= "Content-type: text/html; charset=iso-8859-1\r\n";
67 $headerss .= "From: PAF\r\n".
68 "Reply-To:" . "\r\n" .
69 "X-Mailer: PHP/" . phpversion();
70 $MailAddressReply = $_REQUEST["txtMail"];
71 $SubjectReply="Cordialement";
72 $BodyReply=$Body."<br />Merci beaucoup pour votre intérêt.";
73 //echo $MailAddressReply."<br>".$SubjectReply."<br>".$BodyReply." ".$Footer,$headerss;
74 //----------Mail infos to mail address---------------------------------
75 //@mail($MailAddressReply,$SubjectReply,$BodyReply." ".$Footer,$headerss) or die("On ne peut pas envoyer à cet adresse de courriel.");
76 $MsgErrors = "<span style='background-color:#000FFF; color:#FFFFFF;'>Votre mot de passe a &eacute;t&eacute; envoy&eacute; &agrave; votre mail.</span>";
77 }else{
78 $MsgErrors = "<span style='background-color:#F00; color:#FFFFFF;'>Erreur, votre adresse de courriel n'est pas correct.</span>";
79 }
80 }
81 }
82
83 //-------------------------------XXXXXXXXXX-------Search-------XXXXXXXXXX------------------
84 if($_REQUEST["cmdSearch"]){
85 $StrSearch = $_REQUEST["txtSearch"];
86 redirect("index_search.php?str_sch=$StrSearch");
87 }
88 ?>
89 <body class="oneColLiqCtrHdr">
90 <form name="PAF" method="post" enctype="application/x-www-form-urlencoded">
91 <div id="container">
92 <div id="header">
93 <table width="100%" cellpadding="0" cellspacing="0">
94 <tr><td colspan="2"><a href="http://www.auf.org/" title="AUF" target="_blank"><img src="images/auf.gif" width="155" height="110" border="0" /></a></td>
95 <td width="39%" align="right"><h1 class="oneColLiqCtrHdr"><a href="index.php" title="Page d'accueil" style="text-decoration:none;">P A F</a></h1></td>
96 <td width="41%" valign="bottom" align="right" style="padding-bottom:15px; padding-right:10px;"></td>
97 </tr>
98 </table>
99 <!-- end #header --></div>
100 <div id="searchContent">
101 <table cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;" width="100%" align="right">
102 <tr><td width="94%" align="right"><!--Hyperlines g&eacute;n&eacute;raux en tête--------------->
103 <a href="index.php" title="Accueil">Accueil</a> > Mot de passe oubli&eacute;
104 &nbsp;&nbsp;&nbsp; Rechercher : <input type="text" name="txtSearch" value="<?php echo $StrSearch; ?>" />
105 </td>
106 <td width="6%" align="left"><input type="submit" name="cmdSearch" value="OK" /></td>
107 </tr>
108 </table>
109 </div>
110 <div id="mainContent">
111 <?php
112 include("forms/mdp_oublie.php");
113 ?>
114 <!-- end #mainContent -->
115 </div>
116 <div id="footer">
117 <table cellpadding="0" cellspacing="0" border="0" height="40" width="100%">
118 <tr><td width="80%">Agence Universitaire de la Francophonie -- Antenne de Phnom Penh, Cambodge</td>
119 <td width="20%" align="center">Administrateur</td>
120 </tr>
121 </table>
122 <!-- end #footer --></div>
123 <!-- end #container --></div>
124 </form>
125 </body>
126 </html>