<?
//*********************************************************************************
// Original Website By : Niadesain.com Di Jual melalui http://niadesain.com
// Please Call / SMS : 081384745483 (support@niadesain.com)
// Niadesain.com - Jasa Pembuatan Website Paling Murah dan Paling Lengkap
//*********************************************************************************
?>
<p>&nbsp;</p>
<div align="center"><img src="images/jempol.png" border="0"></div>
<?
$admin_email=$db->config("email");

switch($_POST['recover']){ 
    default: 
    include 'login_pwd.htm'; 
    break;
    case "recover": 
    recover_pw($_POST['username']); 
    break; 
} 

function recover_pw($username){ 
	global $db;
    if(!$username){ 
        echo "<p align=center>Masukkan username anda!<br /></p>"; 
        //include 'login_pwd.htm'; 
        //exit(); 
    } 
   $db->select("username", "banner_kanan", "username='$username'");
    if($db->num_rows() == 0){ 
        echo "<p align=center><b>Username $username tidak ditemukan.</b><br /></p>"; 
       // include 'login_pwd.htm'; 
    } else {
	$domain=$db->config("domain");
	$email = $db->dataku("email",$username);
    $random_password = makeRandomPassword();
    $db_password = ($random_password);
	$db->update("banner_kanan", "pass='$db_password'", "username='$username'");
	$admin_email = $db->config("email");
    $subject = "Password Anda di http://$domain"; 
    $message = "
	Hallo ".$db->dataku("nama",$username).", Kami telah mengirimkan password anda.
    User ID : $username
	Password Baru : $random_password 
    Silahkan login di :
	http://$domain/?id=$username&m=login. 
	
    Terima kasih, 
	Pengelola
	Administrator
	
	Ini adalah email otomatis atas pemintaan password anda, mohon jangan di balas!"; 
    @mail($email, $subject, $message, "From: Admininistrator<$admin_email>\n"); 
    echo "<p>&nbsp;</p><p align=center><b>Password baru anda telah dikirim! <br>Silahkan buka mailbox email anda segera!</b><br /></p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>"; 	
	}
} 
?> 