예제 #1
0
$redirect_file = "index.php?file={$file}&view={$view}&iAdminId={$iAdminId}";
$generalobj->checkDuplicate('iAdminId', PRJ_DB_PREFIX . "_administrator", array('vUsername' => $Data['vUsername'], 'vEmail' => $Data['vEmail']), $redirect_file, USER_ALREADY_EXISTS, $iAdminId);
if ($view == "add") {
    $Data['dDate'] = date("Y-m-d H:i:s");
    $Data['vFromIP'] = $_SERVER[REMOTE_ADDR];
    $Data['vPassword'] = $vPassword;
    //prints($Data);exit;
    $adminUserObj->setAllVar($Data);
    $id = $adminUserObj->insert();
    if ($id) {
        $var_msg = "Record Added Successfully.";
        $eml = $Data['vEmail'];
        unset($Data);
        // dpr email for duplication of email in rec
        if ($dupl == 'dpl') {
            $emailArr = $adminUserObj->getDetails('vFirstName,vLastName,vEmail', " AND iAdminID !='" . $iAdminID . "'");
            $link = SITE_URL_DUM . "b2badmin/index.php?file=ge-admin&view=edit&iAdminId=" . $id;
            for ($i = 0; $i < count($emailArr); $i++) {
                $smname = $emailArr[$i]['vFirstName'] . ' ' . $emailArr[$i]['vLastName'];
                $email = $emailArr[$i]['vEmail'];
                //set the values of the body of email format
                $body_arr = array("#NAME#", "#REC#", "#EMAIL#", "#LINK#", "#MAIL_FOOTER#", "#SITE_URL#");
                $post_arr = array($smname, 'Admin', $eml, $link, $MAIL_FOOTER, SITE_URL_DUM);
                //send mail to the Admin
                $sendMail->Send("Email Duplication", "Member", $email, $body_arr, $post_arr);
            }
        }
        // dpr email for duplication of email in rec
    } else {
        $var_msg = "Eror-in Add.";
    }