/** * TODO * admin sentEmail * @param id, uid */ function sentEmailAction() { $guid = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $formater = new Pandamp_Core_Hol_User(); $obj = new Pandamp_Crypt_Password(); $aclMan = Pandamp_Acl::manager(); $tblUser = new Pandamp_Modules_Identity_User_Model_User(); $rowUser = $tblUser->find($guid)->current(); if ($rowUser->packageId == 26) { // Get disc promo $disc = $formater->checkPromoValidation('Disc', $aclMan->getGroupIds('member_individual'), $rowUser->promotionId, $rowUser->paymentId); // Get total promo $total = $formater->checkPromoValidation('Total', $aclMan->getGroupIds('member_individual'), $rowUser->promotionId, $rowUser->paymentId); // get mail content $mailcontent = $formater->getMailContent('konfirmasi-email-individual'); // write confirm individual email $formater->_writeConfirmIndividualEmail($mailcontent, $rowUser->fullName, $rowUser->username, $obj->decryptPassword($rowUser->password), $rowUser->paymentId, $disc, $total, base64_encode(Pandamp_Lib_Formater::get_user_id($rowUser->username)), $rowUser->email); } elseif ($rowUser->packageId == 27) { // Get disc promo $disc = $formater->checkPromoValidation('Disc', $aclMan->getGroupIds('member_corporate'), $rowUser->promotionId, $rowUser->paymentId); // Get total promo $total = $formater->checkPromoValidation('Total', $aclMan->getGroupIds('member_corporate'), $rowUser->promotionId, $rowUser->paymentId); // get mail content $mailcontent = $formater->getMailContent('konfirmasi-email-korporasi'); // write confirm korporasi email $formater->_writeConfirmCorporateEmail($mailcontent, $rowUser->fullName, $rowUser->company, $rowUser->paymentId, $disc, $total, $rowUser->username, base64_encode(Pandamp_Lib_Formater::get_user_id($rowUser->username)), $rowUser->email); } else { // get mail content $mailcontent = $formater->getMailContent('konfirmasi email gratis'); // write confirm free email $aReturn = $aclMan->getGroupData($rowUser->packageId); $formater->_writeConfirmFreeEmail($mailcontent, $rowUser->fullName, $rowUser->username, $obj->decryptPassword($rowUser->password), base64_encode(Pandamp_Lib_Formater::get_user_id($rowUser->username)), $rowUser->email, $aReturn[2]); } }
function signupAction() { $this->_helper->layout->setLayout('layout-hukumonlineid-daftar'); $r = $this->getRequest(); if ($r->isPost()) { $id = $r->getParam('id') ? $r->getParam('id') : ''; $promotionCode = $r->getParam('promotionCode') ? $r->getParam('promotionCode') : ''; $package = $r->getParam('paket') ? $r->getParam('paket') : ''; $fullName = $r->getParam('fullName') ? $r->getParam('fullName') : ''; $gender = $r->getParam('chkGender') ? $r->getParam('chkGender') : ''; $month = $r->getParam('month') ? $r->getParam('month') : ''; $day = $r->getParam('day') ? $r->getParam('day') : ''; $year = $r->getParam('year') ? $r->getParam('year') : ''; $education = $r->getParam('education') ? $r->getParam('education') : ''; $expense = $r->getParam('expense') ? $r->getParam('expense') : ''; $company = $r->getParam('company') ? $r->getParam('company') : ''; $businessType = $r->getParam('businessType') ? $r->getParam('businessType') : ''; $phone = $r->getParam('phone') ? $r->getParam('phone') : ''; $fax = $r->getParam('fax') ? $r->getParam('fax') : ''; $payment = $r->getParam('payment') ? $r->getParam('payment') : ''; $email = $r->getParam('email') ? $r->getParam('email') : ''; $newArtikel = $r->getParam('newArtikel') ? $r->getParam('newArtikel') : ''; $newRegulation = $r->getParam('newRegulation') ? $r->getParam('newRegulation') : ''; $newWRegulation = $r->getParam('newWeeklyRegulation') ? $r->getParam('newWeeklyRegulation') : ''; $iscontact = $r->getParam('iscontact') ? $r->getParam('iscontact') : ''; $obj = new Pandamp_Crypt_Password(); $formater = new Pandamp_Core_Hol_User(); $aclMan = Pandamp_Acl::manager(); try { for ($x = 1; $x <= $id; $x++) { $username = $r->getParam('username' . $x) ? $r->getParam('username' . $x) : ''; $password = $r->getParam('password' . $x) ? $r->getParam('password' . $x) : ''; $tblUser = new Pandamp_Modules_Identity_User_Model_User(); Zend_Db_Table::getDefaultAdapter()->beginTransaction(); $rowUser = $tblUser->fetchNew(); $rowUser->username = $username; $rowUser->password = $obj->encryptPassword($password); $rowUser->fullName = $fullName; $rowUser->gender = $gender == 1 ? 'L' : 'P'; $rowUser->birthday = $year . '-' . $month . '-' . $day; $rowUser->indexCol = $x; $rowUser->phone = $phone; $rowUser->fax = $fax; $rowUser->email = $email; $rowUser->company = $company; $rowUser->newArticle = $newArtikel == 1 ? 'Y' : 'N'; $rowUser->weeklyList = $newWRegulation == "1" ? 'Y' : 'N'; $rowUser->monthlyList = $newRegulation == 1 ? 'Y' : 'N'; $rowUser->isContact = $iscontact == $x ? 'Y' : 'N'; $rowUser->packageId = $package; $rowUser->promotionId = $promotionCode; $rowUser->educationId = $education; $rowUser->expenseId = $expense; $rowUser->paymentId = $payment; $rowUser->businessTypeId = $businessType; $tblNumber = new Pandamp_Modules_Misc_Number_Model_GenerateNumber(); $rowset = $tblNumber->fetchRow(); $num = $rowset->user; $totdigit = 5; $num = strval($num); $jumdigit = strlen($num); $noinvoice = str_repeat("0", $totdigit - $jumdigit) . $num; $rowset->user = $rowset->user += 1; $tblNumber->update(array('user' => $rowset->user)); $rowUser->kopel = $noinvoice; $rowUser->save(); Zend_Db_Table::getDefaultAdapter()->commit(); $aclMan->addUser($username, 'member_gratis'); } switch ($package) { case 25: $mailcontent = $formater->getMailContent('konfirmasi email gratis'); $m = $formater->_writeConfirmFreeEmail($mailcontent, $fullName, $r->getParam('username1'), $r->getParam('password1'), base64_encode(Pandamp_Lib_Formater::get_user_id($r->getParam('username1'))), $email, 'gratis'); break; case 26: $disc = $formater->checkPromoValidation('Disc', $aclMan->getGroupIds('member_individual'), $promotionCode, $payment); $total = $formater->checkPromoValidation('Total', $aclMan->getGroupIds('member_individual'), $promotionCode, $payment); $mailcontent = $formater->getMailContent('konfirmasi-email-individual'); $m = $formater->_writeConfirmIndividualEmail($mailcontent, $fullName, $r->getParam('username1'), $r->getParam('password1'), $payment, $disc, $total, base64_encode(Pandamp_Lib_Formater::get_user_id($r->getParam('username1'))), $email); break; case 27: $disc = $formater->checkPromoValidation('Disc', $aclMan->getGroupIds('member_corporate'), $promotionCode, $payment); $total = $formater->checkPromoValidation('Total', $aclMan->getGroupIds('member_corporate'), $promotionCode, $payment); $mailcontent = $formater->getMailContent('konfirmasi-email-korporasi'); $m = $formater->_writeConfirmCorporateEmail($mailcontent, $fullName, $company, $payment, $disc, $total, $r->getParam('username1'), base64_encode(Pandamp_Lib_Formater::get_user_id($r->getParam('username1'))), $email); break; } $this->view->message = $m; } catch (Zend_Exception $e) { Zend_Db_Table::getDefaultAdapter()->rollBack(); $this->view->message = $e->getMessage(); } } }