?
Path : /home/admin/domains/happytokorea.com/public_html_bk/promice/Admin/ |
Current File : /home/admin/domains/happytokorea.com/public_html_bk/promice/Admin/ResetPassword.php |
<? @session_start(); ob_start(); $useradmin = $_SESSION["useradmin"]; if(empty($useradmin)) { echo "<script>alert('หน้านี้จำกัดเฉพาะ Admin เท่านั้น');history.back();</script>"; exit(); } require_once "../include/tdate.php"; require_once "../include/connect.php"; require_once "../include/connectdb.php"; $sql="select * from useradmin where useradmin='$useradmin'"; $db_query=mysql_db_query($db,$sql); $result=mysql_fetch_array($db_query); $id=$result[id]; $adminname=$result[name]; $user_admin=$result[useradmin]; $pass_admin=$result[passadmin]; $sqlforget="select * from member where email='$_POST[email]'"; $db_query=mysql_db_query($db,$sqlforget); $resultfg=mysql_fetch_array($db_query); $usermember=$resultfg[usermem]; $passmember=$resultfg[passmem]; $newpass = rand(12345,99999); $newpassmd5 = md5($newpass); //เอารหัสใหม่ไปใส่ในตาราง member $sql_passmember = "update member set passmem='$newpassmd5' where email = '$_POST[email]'"; mysql_query($sql_passmember); $sql_updatestatus = "update forgetpass set status='11111' where email = '$_POST[email]'"; mysql_query($sql_updatestatus); $sql_updatelogtime = "update member set logintime=0 where email = '$_POST[email]'"; mysql_query($sql_updatelogtime); // ส่ง Email $MailTo = $_POST[email]; $MailFrom = "wichai_5272@hotmail.com"; $MailSubject = "ส่ง Password (กรณีลืม Password)"; $MailMessage = " <b>Username : </b>$usermember<br> <b>Password : </b>$newpass<br> "; $Headers = "MIME-Version: 1.0\r\n" ; $Headers .= "Content-type: text/html; charset=tis-620\r\n" ; // ส่งข้อความเป็นภาษาไทย ใช้ "windows-874" $Headers .= "From: ".$MailFrom." <".$MailFrom.">\r\n" ; $Headers .= "Reply-to: ".$MailFrom." <".$MailFrom.">\r\n" ; $Headers .= "X-Priority: 3\r\n" ; $Headers .= "X-Mailer: PHP mailer\r\n" ; if(mail($MailTo, $MailSubject , $MailMessage, $Headers, $MailFrom)) { //echo "Send Mail True" ; //ส่งเรียบร้อย }else{ //echo "Send Mail False" ; //ไม่สามารถส่งเมล์ได้ } mail($to, $subject, $msg, $headers); ?> <html> <head> <title>:: บริษัท Jebsen & Jessen (ประเทศไทย) จำกัด - ยินดีต้อนรับ ::</title> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <!-- Fireworks MX Dreamweaver MX target. Created Sat Apr 02 10:29:23 GMT+0700 (SE Asia Standard Time) 2011--> <link href="../css/instyle.css" rel="stylesheet" type="text/css"> <link href="../css/instyle.css" rel="stylesheet" type="text/css"> <script type="text/javascript"> function showAndHide(idShow, this_checked) { if(this_checked==true){ document.getElementById(idShow).style.display = ''; }else{ document.getElementById(idShow).style.display = 'none'; } } </script> </head> <body bgcolor="#ffffff"> <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0"> <!-- fwtable fwsrc="Untitled" fwbase="de_inx.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" --> <tr> <td><img src="../images/spacer.gif" width="145" height="1" border="0" alt=""></td> <td><img src="../images/spacer.gif" width="98" height="1" border="0" alt=""></td> <td><img src="../images/spacer.gif" width="110" height="1" border="0" alt=""></td> <td><img src="../images/spacer.gif" width="109" height="1" border="0" alt=""></td> <td><img src="../images/spacer.gif" width="103" height="1" border="0" alt=""></td> <td><img src="../images/spacer.gif" width="127" height="1" border="0" alt=""></td> <td><img src="../images/spacer.gif" width="129" height="1" border="0" alt=""></td> <td><img src="../images/spacer.gif" width="97" height="1" border="0" alt=""></td> <td><img src="../images/spacer.gif" width="82" height="1" border="0" alt=""></td> <td><img src="../images/spacer.gif" width="1" height="1" border="0" alt=""></td> </tr> <tr> <td rowspan="2" colspan="4"><img name="de_inx_r2_c1" src="../images/de_inx_r2_c1-1.jpg" width="462" height="48" border="0" alt=""></td> <td colspan="5" background="../images/de_inx_r2_c5.jpg"><div align="center">ยินดีต้อนรับคุณ <? echo "<u>$adminname</u>"; ?> เข้าใช้งานในระบบ ระดับสิทธิการเข้าใช้งาน Administrator <br> [ <a href="ChangePass.php">เปลี่ยนรหัสผ่าน</a> ] [ <a href="logout.php">ออกจากระบบ</a> ] </div></td> <td><img src="../images/spacer.gif" width="1" height="43" border="0" alt=""></td> </tr> <tr> <td colspan="5"><img name="de_inx_r3_c5" src="../images/de_inx_r3_c5-1.jpg" width="538" height="5" border="0" alt=""></td> <td><img src="../images/spacer.gif" width="1" height="5" border="0" alt=""></td> </tr> <tr> <td colspan="9"> <div align="center"> <table width="91%" border="0" align="center" cellpadding="1" cellspacing="1"> <tr> <td><div align="center"> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td height="20" bgcolor=<? echo "$bgcolor"; ?>> <div align="left"> <input type="checkbox" id=check_type1 value="1" onClick="showAndHide('target1',this.checked)" name=check_type1 /> คลิกเพื่อแสดงเมนู </div></td> </tr> <tr> <td height="5" bgcolor=<? echo "$bgcolor"; ?>> <div align="left" id=target1 style="display: none;"> <? require_once "Menu.php"; ?> </div> <div align="left"> </div> <div id="target1" style="display: none;"></div> <div align="left"> <div align="center"> </div> </div></td> </tr> </table> </div></td> </tr> <tr> <td><div align="center"><br> <br> <br> <img src="../images/loading.gif" width="32" height="32"><br> ได้ำการ Reset รหัสผ่านใหม่ไปยัง<br> <? echo "<u>$_POST[email]<u>"; ?> เรียบร้อยแล้วค่ะ<br> ขอบคุณค่ะ<br> <br> </div></td> </tr> <tr> <td> </td> </tr> </table> </div></td> <td><img src="../images/spacer.gif" width="1" height="13" border="0" alt=""></td> </tr> <tr> <td colspan="9" background="../images/de_inx_r6_c1.jpg"><div align="center"><? echo "$buttomweb"; ?></div></td> <td><img src="../images/spacer.gif" width="1" height="19" border="0" alt=""></td> </tr> </table> </body> </html>