$emailpost = addslashes($_POST['email']);
        $inputdata = " `nama`,`email` ";
        $wheres = " `email` = '" . $emailpost . "' limit 1 ";
        $cekquery = $i->ambilDetail($inputdata, 'user', $wheres);
        if (!empty($cekquery[0]->email)) {
            $email = $cekquery[0]->email;
            $f = new fungsi();
            $random = $f->random_text();
            $bodyemail = $cekquery[0]->nama . " Anda meminta reset password untuk akun anda pada " . WEBSITE . "<br> silakan klik link berikut atau copy paste pada browser kode untuk mereset password anda. <br>\n\t\t\t\t\t\t\thttp://" . SITE_URL . "?reset=" . $random . "<br> <br> Bila anda tidak merasa melakukan reset password abaikan email ini <br>\n\t\t\t\t\t\t\t<br>Terima Kasih <br> Admin";
            $e = new sendEmail();
            $kirimP = $e->setToEmail($email);
            $kirimP = $e->setFromName("Admin hiluniplo.com");
            $kirimP = $e->setFromEmail("*****@*****.**");
            $kirimP = $e->setEmailSubject("Konfirmasi Reset Password " . $cekquery[0]->email . " pada " . WEBSITE);
            $kirimP = $e->setEmailBody($bodyemail);
            $kirimP = $e->send();
            //echo $kirimP;
            $ndbase = " user ";
            $tdbase = " resetpasswd = '{$random}' ";
            $wheres = " email = '{$email}' ";
            $hasil = $i->updateDB($tdbase, $ndbase, $wheres);
        } else {
            $helpers->setAlert('alert-danger', ' Email Tidak terdaftar  !! ');
            //echo 'Email Tidak terdaftar.';
        }
    }
}
/*
 * If we have set the printAlert method then assign to the template variable message
 */
if (isset($_SESSION['alertMessage'])) {
Exemple #2
0
         if ($_POST['update'] == 'false') {
             $utdbase = " nama, email ";
             $undbase = " user ";
             $udetailquery = "  WHERE hak <= 22";
             $uemail = $i->ambil($utdbase, $undbase, $udetailquery);
             //$helpers->printArray($$uemail);
             $e = new sendEmail();
             foreach ($uemail as $key => $value) {
                 echo $value->email;
                 $bodyemail = " Dear Admin {$value->nama}, <br>\n\t\t\t\t\t\t\t\t\t\tAda artikel baru yang di Posting oleh " . $_POST['userposting'] . ", <br>\n\t\t\t\t\t\t\t\t\t\tdengan Judul {$judul} <br>\n\t\t\t\t\t\t\t\t\t\tdan memerlukan persetujuan Admin untuk hal tersebut.<br>\n\n\t\t\t\t\t\t\t\t\t\tSilakan login dan approve posting tersebut pada link <br>" . SITE_URL . "?l=posting&s=listpost\n\n\t\t\t\t\t\t\t\t\t\t<br><br>\n\t\t\t\t\t\t\t\t\t\tTerima Kasih.\n\t\t\t\t\t\t\t\t\t\t";
                 $kirimE = $e->setToEmail($value->email);
                 $kirimE = $e->setFromName("Admin hiluniplo.com");
                 $kirimE = $e->setFromEmail("*****@*****.**");
                 $kirimE = $e->setEmailSubject("Ada artikel baru yang perlu persetujuan pada " . WEBSITE);
                 $kirimE = $e->setEmailBody($bodyemail);
                 $kirimE = $e->send();
                 //echo $kirimE;
             }
         }
         if ($_SESSION['HAK'] <= 22) {
             $helpers->setAlert('alert-success', 'Posting Berhasil');
         } else {
             $helpers->setAlert('alert-success', 'Posting Menunggu Persetujan Admin');
         }
     }
 }
 #edit posting
 if (isset($_GET['editid'])) {
     $edtdbase = " * ";
     $edndbase = " berita ";
     $eddetailquery = " WHERE id='" . $_GET['editid'] . "'";