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