function dropshippingAction() { if (!is_object($_SESSION['jCart'])) { $this->_redirect(ROOT_URL . '/checkout/cartempty'); } if (count($_SESSION['jCart']->items) == 0) { $this->_redirect(ROOT_URL . '/checkout/cartempty'); } $cart =& $_SESSION['jCart']; if (!is_object($cart)) { $cart = new jCart(); } $this->view->cart = $cart; $modelUser = new App_Model_Db_Table_User(); $userDetailInfo = $modelUser->find($this->_user->kopel)->current(); $this->view->userDetailInfo = $userDetailInfo; $modelUserFinance = new App_Model_Db_Table_UserFinance(); $userFinanceInfo = $modelUserFinance->find($this->_user->kopel)->current(); if (empty($userFinanceInfo)) { $finance = $modelUserFinance->fetchNew(); $finance->userId = $this->_user->kopel; $finance->taxCompany = $userDetailInfo->company; $finance->taxAddress = $userDetailInfo->address; $finance->taxProvince = $userDetailInfo->state; $finance->taxCountryId = $userDetailInfo->countryId; $finance->taxZip = $userDetailInfo->zip; $finance->taxPhone = $userDetailInfo->phone; $finance->taxFax = $userDetailInfo->fax; $finance->save(); } }
public function invoiceAction() { $this->_helper->layout->disableLayout(); $this->_helper->getHelper('viewRenderer')->setNoRender(TRUE); $tblUser = new App_Model_Db_Table_User(); $rowUser = $tblUser->fetchRow("kopel='00015'"); $temptime = strtotime($rowUser->createdDate); //$temptime = time(); $temptime = Pandamp_Lib_Formater::DateAdd('d', 5, $temptime); $rowInvoice = strftime('%Y-%m-%d', $temptime); Pandamp_Debug::manager($rowInvoice); }
public function sendReceiptToUser($orderId, $paymentMethod = '') { $config = new Zend_Config_Ini(CONFIG_PATH . '/mail.ini', 'mail'); $siteOwner = "Hukumonline"; $siteName = $config->mail->sender->support->name; $contactEmail = $config->mail->sender->support->email; $tblOrder = new App_Model_Db_Table_Order(); $rowOrder = $tblOrder->find($orderId)->current(); $userId = $rowOrder->userId; //first check if orderId status is PAID, then send the email. switch ($rowOrder->orderStatus) { case 1: die('ORDER STATUS IS NOT YET PAID. CAN NOT SEND RECEIPT!.'); break; case 3: $orderStatus = "PAID"; break; case 5: $orderStatus = "POSTPAID PENDING"; break; case 6: $orderStatus = "PAYMENT REJECTED"; break; case 7: $orderStatus = "PAYMENT ERROR"; break; default: $orderStatus = "PAYMENT ERROR"; break; } $tblUser = new App_Model_Db_Table_User(); $rowUser = $tblUser->find($userId)->current(); $userEmail = $rowUser->email; $userFullname = $rowUser->fullName; $registry = Zend_Registry::getInstance(); $config = $registry->get(Pandamp_Keys::REGISTRY_APP_OBJECT); $store = $config->getOption('store'); $cEmail = new Zend_Config_Ini(CONFIG_PATH . '/mail.ini', 'mail'); $holConfig = Pandamp_Config::getConfig(); switch (strtolower($rowOrder->paymentMethod)) { case 'paypal': case 'manual': case 'bank': case 'postpaid': default: $message = "\t\t\t\t\t\nDear {$userFullname},\n\nThis is a payment receipt for Invoice # {$rowOrder->invoiceNumber}\n\nTotal Amount: IDR {$rowOrder->orderTotal}\nTransaction #:\nTotal Paid: IDR {$rowOrder->orderTotal}\nStatus: {$orderStatus}\nYour payment method is: {$paymentMethod}\n\nYou may review your invoice history at any time by logging in to your account " . $holConfig->cdn->id->url . "/user/payment/list\n\nNote: This email will serve as an official receipt for this payment.\n\nSalam,\n\nHUKUMONLINE\n\n=============================="; } $this->send($cEmail->mail->sender->support->email, $cEmail->mail->sender->support->name, $userEmail, $userFullname, "[HUKUMONLINE] Receipt Invoice# " . $rowOrder->invoiceNumber, $message); }
public function sendReceiptToUser($orderId, $paymentMethod = '', $statusText = '') { $config = new Zend_Config_Ini(ROOT_DIR . '/app/configs/mail.ini', 'general'); $siteOwner = "Hukumonline"; $siteName = $config->mail->sender->support->name; $contactEmail = $config->mail->sender->support->email; $tblOrder = new App_Model_Db_Table_Order(); $rowOrder = $tblOrder->find($orderId)->current(); $userId = $rowOrder->userId; //first check if orderId status is PAID, then send the email. switch ($rowOrder->orderStatus) { case 1: die('ORDER STATUS IS NOT YET PAID. CAN NOT SEND RECEIPT!.'); break; case 3: $orderStatus = "PAID"; break; case 5: $orderStatus = "POSTPAID PENDING"; break; case 6: $orderStatus = "PAYMENT REJECTED"; break; case 7: $orderStatus = "PAYMENT ERROR"; break; default: $orderStatus = "PAYMENT ERROR"; break; } $tblUser = new App_Model_Db_Table_User(); $rowUser = $tblUser->find($userId)->current(); $userEmail = $rowUser->email; $userFullname = $rowUser->fullName; switch (strtolower($paymentMethod)) { case 'paypal': case 'manual': case 'bank': case 'postpaid': default: $message = "\nDear {$userFullname},\n\nThis is a payment receipt for Invoice # {$rowOrder->invoiceNumber}\n\nTotal Amount: USD {$rowOrder->orderTotal}\nTransaction #:\nTotal Paid: USD {$rowOrder->orderTotal}\nStatus: {$orderStatus}\nYour payment method is: {$paymentMethod}\n\nYou may review your invoice history at any time by logging in to your account " . ROOT_URL . "/store/payment/list\n\nNote: This email will serve as an official receipt for this payment.\n\nSalam,\n\nHukumonline\n\n=============================="; } $this->send($config->mail->sender->support->email, $config->mail->sender->support->name, $userEmail, '', "Hukumonline Receipt Invoice# " . $rowOrder->invoiceNumber, $message); }
public function sendReceiptToUser($orderId, $paymentMethod = '', $statusText = '') { $config = new Zend_Config_Ini(CONFIG_PATH . '/mail.ini', 'general'); $siteOwner = "Hukumonline"; $siteName = $config->mail->sender->support->name; $contactEmail = $config->mail->sender->support->email; $tblOrder = new App_Model_Db_Table_Order(); $rowOrder = $tblOrder->find($orderId)->current(); $userId = $rowOrder->userId; //first check if orderId status is PAID, then send the email. switch ($rowOrder->orderStatus) { case 1: die('ORDER STATUS IS NOT YET PAID. CAN NOT SEND RECEIPT!.'); break; case 3: $orderStatus = "PAID"; break; case 5: $orderStatus = "POSTPAID PENDING"; break; case 6: $orderStatus = "PAYMENT REJECTED"; break; case 7: $orderStatus = "PAYMENT ERROR"; break; default: $orderStatus = "PAYMENT ERROR"; break; } $tblUser = new App_Model_Db_Table_User(); $rowUser = $tblUser->find($userId)->current(); $userEmail = $rowUser->email; $userFullname = $rowUser->fullName; switch (strtolower($paymentMethod)) { case 'paypal': case 'manual': case 'bank': case 'postpaid': default: $message = "Kepada Yth, \r\n{$userFullname},\r\n\r\nIni adalah bukti pembayaran untuk faktur # {$rowOrder->invoiceNumber}\r\n\r\nTotal Jumlah: Rp {$rowOrder->orderTotal}\r\nTransaksi #:\r\nJumlah Dibayar: Rp {$rowOrder->orderTotal}\r\nStatus: {$orderStatus}\r\nMetode Pembayaran: {$paymentMethod}\r\n\r\nAnda dapat meninjau riwayat faktur Anda setiap saat dengan log in ke account Anda " . ROOT_URL . "/shop/payment/list\r\n\r\nCatatan: Email ini akan berfungsi sebagai tanda terima resmi untuk pembayaran ini.\r\n\r\nSalam,\r\n\r\nHukumonline\r\n\r\n=============================="; } $this->send($config->mail->sender->support->email, $config->mail->sender->support->name, $userEmail, '', "Hukumonline Receipt Invoice# " . $rowOrder->invoiceNumber, $message); }
function processAction() { $formater = new Pandamp_Core_Hol_User(); $orderId = $this->_request->getParam('orderId'); $packageId = $this->_request->getParam('packageId'); $paymentSubscription = $this->_request->getParam('paymentSubscription'); $this->_orderIdNumber = $orderId; if (empty($orderId)) { echo "kosong"; die; } include_once ROOT_DIR . '/app/models/Store.php'; $modelAppStore = new App_Model_Store(); if ($modelAppStore->isOrderPaid($orderId)) { //forward to error page $this->_helper->redirector->gotoSimple('error', 'store', 'hol-site', array('view' => 'orderalreadypaid')); die; } //$tblOrder = new App_Model_Db_Table_Order(); $items = App_Model_Show_Order::show()->getOrderDetail($orderId); $tmpMethod = $this->_request->getParam('method'); if (!empty($tmpMethod)) { $items[0]['paymentMethod'] = $tmpMethod; } $tblUser = new App_Model_Db_Table_User(); $rowUser = $tblUser->find($items[0]['userId'])->current(); $total = $formater->checkPromoValidation('Total', $packageId, $rowUser->promotionId, $paymentSubscription); switch ($items[0]['paymentMethod']) { case 'nsiapay': require_once 'PaymentGateway/Nsiapay.php'; // include the class file $paymentObject = new Nsiapay(); // initiate an instance of the class if ($this->_testMode) { $paymentObject->enableTestMode(); } $paymentObject->addField('TYPE', "IMMEDIATE"); $subTotal = 0; for ($iCart = 0; $iCart < count($items); $iCart++) { $i = $iCart + 1; $basket[] = $items[$iCart]['documentName'] . "," . $items[$iCart]['price'] . ".00" . "," . $items[$iCart]['qty'] . "," . $items[$iCart]['finalPrice'] . ".00"; $subTotal += $items[$iCart]['price'] * $items[$iCart]['qty']; } $ca = implode(";", $basket); $merchantId = "000100090000028"; $paymentObject->addField("BASKET", $ca); $paymentObject->addField("MERCHANTID", $merchantId); $paymentObject->addField("CHAINNUM", "NA"); $paymentObject->addField("TRANSIDMERCHANT", $items[0]['invoiceNumber']); $paymentObject->addField("AMOUNT", $subTotal); $paymentObject->addField("CURRENCY", "360"); $paymentObject->addField("PurchaseCurrency", "360"); $paymentObject->addField("acquirerBIN", "360"); $paymentObject->addField("password", "123456"); $paymentObject->addField("URL", "http://hukumonline.pl"); $paymentObject->addField("MALLID", "199"); $paymentObject->addField("SESSIONID", Zend_Session::getId()); $sha1 = sha1($subTotal . ".00" . $merchantId . "08iIWbWvO16w" . $items[0]['invoiceNumber']); // echo $subTotal.".00".$merchantId."08iIWbWvO16w".$items[0]['invoiceNumber']."<br>"; // echo $sha1;die; $paymentObject->addField("WORDS", $sha1); //$paymentObject->dumpFields(); $this->_helper->layout->disableLayout(); $paymentObject->submitPayment(); break; case 'manual': case 'bank': /* 1. update order status 2. redirect to instruction page */ //setting payment and status as pending (1), notify = 0, notes = 'paid with...' $this->updateInvoiceMethod($orderId, 'bank', 1, 0, 'paid with manual method'); // HAP: i think we should send this notification when user were on page "Complete Order" and after confirmation made by user is approved; //$this->Mailer($orderId, 'admin-order', 'admin'); //$this->Mailer($orderId, 'user-order', 'user'); $this->_helper->redirector('instruction', 'payment', 'membership', array('orderId' => $orderId)); break; } }
public function payconfirmyesAction() { $this->_helper->viewRenderer->setNoRender(TRUE); //print_r($this->_request->getParams()); $id = $this->_request->getParam('orderId'); $tblOrder = new App_Model_Db_Table_Order(); $tblHistory = new App_Model_Db_Table_OrderHistory(); $tblConfirm = new App_Model_Db_Table_PaymentConfirmation(); $rowOrder = $tblOrder->find($id)->current(); if ($rowOrder->paymentMethodNote == 'membership') { $oldUser = App_Model_Show_User::show()->getUserById($rowOrder->userId); $oldpackage = App_Model_Show_AroGroup::show()->getUserGroup($oldUser['packageId']); $newGroup = App_Model_Show_AroGroup::show()->getUserGroup($rowOrder->note); $notes = date("Y-m-d h:i:s") . " - Changed package " . $oldpackage['name'] . " TO " . $newGroup['name']; $notes = $oldUser['notes'] ? $oldUser['notes'] . "\n" . $notes : $notes; $dataUser = array('packageId' => $rowOrder->note, 'notes' => $notes, 'modifiedDate' => date("Y-m-d h:i:s"), 'modifiedBy' => Zend_Auth::getInstance()->getIdentity()->username); $modelUser = new App_Model_Db_Table_User(); $dataUserDetail = array('userId' => $oldUser['kopel'], 'packageId' => $oldUser['packageId'], 'promotionId' => $oldUser['promotionId'], 'educationId' => $oldUser['educationId'], 'expenseId' => $oldUser['expenseId'], 'paymentId' => $oldUser['paymentId'], 'businessTypeId' => $oldUser['businessTypeId'], 'periodeId' => $oldUser['periodeId'], 'activationDate' => $oldUser['activationDate'], 'createdDate' => $oldUser['createdDate'], 'createdBy' => $oldUser['createdBy'], 'modifiedDate' => $oldUser['modifiedDate'], 'modifiedBy' => $oldUser['modifiedBy'], 'isActive' => $oldUser['isActive'], 'isContact' => $oldUser['isContact']); $modelUserDetail = new App_Model_Db_Table_UserDetail(); $modelUserDetail->insert($dataUserDetail); $acl = Pandamp_Acl::manager(); $acl->deleteUser($oldUser['username']); $acl->addUser($oldUser['username'], $newGroup['name']); $tblInvoice = new App_Model_Db_Table_Invoice(); $where = $tblInvoice->getAdapter()->quoteInto("uid=?", $rowOrder->userId); $rowInvoice = $tblInvoice->fetchRow($where); if ($rowInvoice) { $rowInvoice->invoiceConfirmDate = date("Y-m-d"); $rowInvoice->isPaid = 'Y'; // get expiration date $temptime = time(); $temptime = Pandamp_Lib_Formater::DateAdd('m', $oldUser['paymentId'], $temptime); $rowInvoice->expirationDate = strftime('%Y-%m-%d', $temptime); $rowInvoice->save(); $dataUser['periodeId'] = 3; } $modelUser->update($dataUser, "kopel='" . $rowOrder->userId . "'"); } //select payment date from paymentconfirmation $date = $tblConfirm->fetchAll("orderId = " . $id . " AND confirmed = 0"); $data['paymentDate'] = $date[0]->paymentDate; //update order $data['orderStatus'] = 3; $tblOrder->update($data, "orderId = " . $id); //update paymentconfirmation $dataConfirm['confirmed'] = 1; $tblConfirm->update($dataConfirm, "orderId = " . $id); //add history $dataHistory = $tblHistory->fetchNew(); //history data $dataHistory['orderId'] = $id; $dataHistory['orderStatusId'] = 3; $dataHistory['dateCreated'] = date('Y-m-d'); $dataHistory['userNotified'] = 1; $dataHistory['note'] = 'confirmed'; $dataHistory->save(); //mailer //$this->Mailer($id, 'user-confirm', 'user'); $mod = new App_Model_Store_Mailer(); $mod->sendReceiptToUser($id, ucwords($date[0]->paymentMethod)); //redirect to confirmation page $this->_redirect($this->view->serverUrl() . '/' . $this->view->getLanguage() . '/store/confirm'); }
/** * _writeConfirmFreeEmail * @return JSON */ function _writeConfirmFreeEmail($mailcontent, $fullname, $username, $password, $guid, $email, $package = '') { $obj = new Pandamp_Crypt_Password(); $aclMan = Pandamp_Acl::manager(); $mailcontent = str_replace('$fullname', $fullname, $mailcontent); $mailcontent = str_replace('$username', $username, $mailcontent); $mailcontent = str_replace('$password', $password, $mailcontent); $mailcontent = str_replace('$guid', $guid, $mailcontent); $mailcontent = str_replace('$package', $package, $mailcontent); $mail_body = $mailcontent; // parse ini_file $config = new Zend_Config_Ini(CONFIG_PATH . '/mail.ini', 'mail'); $mailAttempt = $this->add_mail($config->mail->sender->support->email, $email, $username, $config->mail->sender->support->name, $mail_body); // try to save mail before send if ($mailAttempt) { $sendAttempt = $this->send_mail(); if ($sendAttempt) { $message = "Please check your email at {$email}!"; // update user $tblUser = new App_Model_Db_Table_User(); $rowUser = $tblUser->find($obj->decryptPassword($guid))->current(); if ($rowUser) { $rowUser->isEmailSent = 'Y'; $rowUser->save(); } } else { $message = "Error send mail but register user successfully!<br>Please contact our customer service for more information"; } } else { $message = "Error saving mail!"; } return $message; }
function copydataAction() { $this->_helper->layout->setLayout('layout-customer-migration'); $this->_helper->viewRenderer->setNoRender(TRUE); $modelUserCopy = new App_Model_Db_Table_Copy_User(); $rowset = $modelUserCopy->fetchAll(); foreach ($rowset as $row) { $modelUser = new App_Model_Db_Table_User(); $rowUser = $modelUser->fetchNew(); $rowUser->kopel = $row->kopel; $rowUser->username = $row->username; $rowUser->password = $row->password; $rowUser->fullName = $row->fullName; $rowUser->birthday = $row->birthday; $rowUser->phone = $row->phone; $rowUser->fax = $row->fax; $rowUser->gender = $row->gender; $rowUser->email = $row->email; $rowUser->openId = $row->openId; $rowUser->company = $row->company; $rowUser->address = $row->address; $rowUser->city = $row->city; $rowUser->state = $row->state; $rowUser->countryId = $row->countryId; $rowUser->zip = $row->zip; $rowUser->indexCol = $row->indexCol; $rowUser->picture = $row->picture; $rowUser->newArticle = $row->newArticle; $rowUser->weeklyList = $row->weeklyList; $rowUser->monthlyList = $row->monthlyList; $rowUser->packageId = $row->packageId; $rowUser->promotionId = $row->promotionId; $rowUser->educationId = $row->educationId; $rowUser->expenseId = $row->expenseId; $rowUser->paymentId = $row->paymentId; $rowUser->businessTypeId = $row->businessTypeId; $rowUser->periodeId = $row->periodeId; $rowUser->activationDate = $row->activationDate; $rowUser->isEmailSent = $row->isEmailSent; $rowUser->isEmailSentOver = $row->isEmailSentOver; $rowUser->createdDate = $row->createdDate; $rowUser->createdBy = $row->createdBy; $rowUser->modifiedDate = $row->modifiedDate; $rowUser->modifiedBy = $row->modifiedBy; $rowUser->isActive = $row->isActive; $rowUser->isContact = $row->isContact; $id = $rowUser->save(); } }
function checkusernameAction() { $this->_helper->viewRenderer->setNoRender(TRUE); $username = $this->_getParam('username') ? $this->_getParam('username') : ''; $modelUser = new App_Model_Db_Table_User(); $rowset = $modelUser->fetchRow("username='******'"); if ($rowset) { $valid = 'false'; } else { $valid = 'true'; } echo $valid; die; }
function inaAction() { /* get GroupName echo $this->getUserGroupName('enisetiati'); * */ /* get Group Name Id $getGroupId = $this->getUserGroupId($this->getUserGroupName('enisetiati')); echo $getGroupId; * */ /* * Hukumonline Indonesia * 11 = admin * 41 = klinik_admin * 39 = marketing * 36 = member_admin * 34 = news_admin * 40 = holproject * 20 = dc_admin * 25 = member_gratis * 26 = member_individual * 27 = member_corporate */ $title = "<h4>MIGRASI HUKUMONLINE INDONESIA</h4><hr/>"; echo $title . '<br>'; $groupId = 36; require_once CONFIG_PATH . '/master-status.php'; $aroMap = App_Model_Show_Migration_AroGroupMapIn::show()->getObjectsByGroup($groupId); /* echo '<pre>'; print_r($aroMap); echo '</pre>'; * */ foreach ($aroMap as $value) { // $modelUser = new App_Model_Db_Table_User(); // $rowUser = $modelUser->fetchRow("username='******'name']."'"); // if (!$rowUser) { $ignoredUser = MasterStatus::ignoreUserMigration(); if (!in_array($value['name'], $ignoredUser)) { //echo $id.' - '.$value['name'].'<br>'; $rowUser = App_Model_Show_Migration_UserIn::show()->getUser($value['name']); //echo $id.' - '.$rowUser['fullName'].'<br>'; /* $groupName = $this->getUserGroupName($rowUser['username']); $getGroupId = $this->getUserGroupId($groupName); * */ if ($rowUser) { $rowUser['packageId'] = $groupId; //list($ret, $body) = Pandamp_Lib_Remote::serverCmd('migrationUser', $rowUser); $modelUser = new App_Model_Db_Table_User(); $dUser = $modelUser->fetchRow("username='******'username'] . "'"); $groupName = $this->getGroupName($groupId); if (!$dUser) { $data = $this->transformMigrationUser($rowUser); $result = $modelUser->insert($data); if ($result) { $this->updateKopel(); $groupName = $this->getGroupName($groupId); //$acl = new Kutu_Acl_Adapter_Local(); $acl = Pandamp_Acl::manager(); //$acl->addUser($_POST['username'],$groupName); $acl->addUserToGroup($rowUser['username'], $groupName); $message = "\n <div class='box box-info closeable'>\n User : <abbr>" . $rowUser['username'] . "</abbr> data has been successfully saved to local.\n </div><br>"; } else { $message = "\n <div class='box box-error'>ERROR</div> \n <div class='box box-error-msg'>\n <ol>\n <li>User : <abbr>" . $rowUser['username'] . "</abbr> data has failed saved to local.</li>\n </ol>\n </div><br>"; } echo $message; } /* echo '<pre>'; print_r($body); echo '</pre>'; die; * */ /* switch ($ret) { case 200: $message = " <div class='box box-info closeable'> User : <abbr>".$rowUser['username']."</abbr> data has been successfully saved to local. </div><br>"; break; default: $message = " <div class='box box-error'>ERROR</div> <div class='box box-error-msg'> <ol> <li>User : <abbr>".$rowUser['username']."</abbr> data has failed saved to local.</li> </ol> </div><br>"; } */ // echo $message; } /* else { echo " <div class='box box-error'>ERROR</div> <div class='box box-error-msg'> <ol> <li>User : <abbr>".$value['name']."</abbr> not active.</li> </ol> </div><br>"; } */ } // } } }
/** * Kick all user * */ function kickallAction() { $this->_helper->getHelper('layout')->disableLayout(); $this->_helper->getHelper('viewRenderer')->setNoRender(); $request = $this->getRequest(); $result = 'RESULT_ERROR'; if (Pandamp_Controller_Action_Helper_IsAllowed::isAllowed('membership', 'all')) { if ($request->isPost()) { $id = $request->getPost('id'); $ids = array(); $ids = Zend_Json::decode($id); foreach ($ids as $id) { $modelUser = new App_Model_Db_Table_User(); $modelUser->update(array('ses' => '*'), array('kopel = ?' => $id)); $modelSession = new App_Model_Db_Table_Session(); $rowSession = $modelSession->fetchRow("sessionData LIKE '%{$id}%'"); if ($rowSession) { /** * Destroy any active session identified by sessionId */ try { session_id($rowSession->sessionId); session_destroy(); } catch (Exception $e) { } } } } $result = 'RESULT_OK'; } $this->getResponse()->setBody($result); }
public function editAction() { if (!Pandamp_Controller_Action_Helper_IsAllowed::isAllowed('membership', 'all')) { $this->_redirect(ROOT_URL . '/' . $this->_zl->getLanguage() . '/error/restricted'); } $this->_helper->layout->setLayout('layout-customer-credential'); $id = $this->_getParam("id"); $tblInvoice = new App_Model_Db_Table_Invoice(); $rowset = $tblInvoice->find($id)->current(); $this->view->row = $rowset; if ($this->getRequest()->isPost()) { $rowset->price = $this->getRequest()->getPost('price'); $rowset->discount = $this->getRequest()->getPost('disc'); $rowset->invoiceOutDate = $this->getRequest()->getPost('invoiceOutDate'); $rowset->invoiceConfirmDate = $this->getRequest()->getPost('invoiceConfirmDate'); $rowset->clientBankAccount = $this->getRequest()->getPost('clientBankAccount'); $rowset->isPaid = $this->getRequest()->getPost('isPaid'); $rowset->expirationDate = $this->getRequest()->getPost('expirationDate'); $rowset->save(); $notes = date("Y-m-d h:i:s") . ' ' . $this->_user->username . " - Modify invoice:" . $id; $data = array('notes' => new Zend_Db_Expr("CONCAT(ifnull(notes,''),' \n{$notes}')")); $modelUser = new App_Model_Db_Table_User(); $modelUser->update($data, "kopel='" . $this->getRequest()->getPost('uid') . "'"); $this->_redirect(ROOT_URL . '/' . $this->_zl->getLanguage() . '/customer/user/invoicelist/id/' . $this->getRequest()->getPost('uid')); } }
public function getappuserAction() { $this->_helper->layout()->disableLayout(); $r = $this->getRequest(); $start = $r->getParam('start') ? $r->getParam('start') : 0; $limit = $r->getParam('limit') ? $r->getParam('limit') : 0; $orderBy = $r->getParam('orderBy') ? $r->getParam('sortBy') : 'firstname'; $sortOrder = $r->getParam('sortOrder') ? $r->getParam('sortOrder') : ' asc'; $a = array(); $tblUser = new App_Model_Db_Table_User(); $rowset = $tblUser->fetchAll("isActive = 0 AND periodeId IN (1,2)", 'createdDate DESC', $limit, $start); if (count($rowset) == 0) { $a['users'][0]['kopel'] = 'XXX'; $a['users'][0]['username'] = "******"; $a['users'][0]['company'] = ""; $a['users'][0]['group'] = ''; $a['users'][0]['status'] = ''; } else { $ii = 0; foreach ($rowset as $row) { $a['users'][$ii]['kopel'] = $row->kopel; $a['users'][$ii]['username'] = $row->username; $a['users'][$ii]['company'] = $row->company; $a['users'][$ii]['group'] = Pandamp_Controller_Action_Helper_UserGroup::userGroup($row->packageId); $a['users'][$ii]['status'] = Pandamp_Controller_Action_Helper_UserStatus::userStatus($row->periodeId); $a['users'][$ii]['checkbox'] = "<input type='checkbox' name='kopel[]' id='kopel' value='{$row->kopel}' class='check_me'>"; $ii++; } } echo Zend_Json::encode($a); die; }
function registerAction() { if ($this->getRequest()->getPost()) { $value = $this->getRequest()->getPost(); $this->view->value = $value; /* list($ret, $body) = Pandamp_Lib_Remote::serverCmd('register', $value); switch ($ret) { case 200: $this->view->message = "User : <abbr>".$value['username']."</abbr> data has been successfully saved."; break; default: $this->view->error_message = "failure"; } */ $data = $this->transformRegister($value); $modelUser = new App_Model_Db_Table_User(); $id = $modelUser->insert($data); $this->updateKopel(); /** * SELECT id, parent_id, value, name, lft, rgt * eg. $aReturn = $acl->getGroupData(15) * print_r($aReturn); * output: Array ( [0] => 15 [1] => 10 [2] => Super Administrator [3] => super_admin [4] => 10 [5] => 11 ) */ $acl = Pandamp_Acl::manager(); //$aReturn = $acl->getGroupData($value['aro_groups']); $aReturn = App_Model_Show_AroGroup::show()->getUserGroup($value['aro_groups']); //echo '<pre>'; //print_r($aReturn); //echo '</pre>'; //$acl->addUser($value['username'],$aReturn[3]); $acl->addUserToGroup($value['username'], $aReturn['name']); $formater = new Pandamp_Core_Hol_User(); // Do you want Email Confirmation send? if (isset($value['ec']) == 1) { //echo 'y'; $payment = $value['payment'] ? $value['payment'] : 0; $promotionCode = $value['promotioncode'] ? $value['promotioncode'] : ''; switch ($value['aro_groups']) { /** * @modifiedDate: December 07, 2012 * @modifiedDate-2: January 29, 2013 */ case 14: // individual $mailcontent = $formater->getMailContent('konfirmasi-email-individual'); //$disc = $formater->checkPromoValidation('Disc',$value['aro_groups'],$promotionCode,$payment); //$total = $formater->checkPromoValidation('Total',$value['aro_groups'],$promotionCode,$payment); $total = $formater->checkPromoValidation('Total', $value['aro_groups'], $payment); $disc = $formater->checkPromoValidation('Disc', $value['aro_groups'], $payment); //$m = $formater->_writeConfirmIndividualEmail($mailcontent,$value['fullname'],$value['username'],$value['password'],$payment,$disc,$total,base64_encode($id),$value['email']); $m = $formater->_writeConfirmIndividualEmail($mailcontent, $value['aro_groups'], $value['fullname'], $value['username'], $value['password'], $payment, $disc, $total, base64_encode($id), $value['email']); break; case 15: // corporate/basic // corporate/basic case 16: // standard // standard case 18: // professional $mailcontent = $formater->getMailContent('konfirmasi-email-korporasi'); //$disc = $formater->checkPromoValidation('Disc',$value['aro_groups'],$promotionCode,$payment); //$total = $formater->checkPromoValidation('Total',$value['aro_groups'],$promotionCode,$payment); $total = $formater->checkPromoValidation('Total', $value['aro_groups'], $payment); $disc = $formater->checkPromoValidation('Disc', $value['aro_groups'], $payment); //$m = $formater->_writeConfirmCorporateEmail($mailcontent,$value['fullname'],$value['company'],$payment,$disc,$total,$value['username'],base64_encode($id),$value['email']); $m = $formater->_writeConfirmCorporateEmail($mailcontent, $value['aro_groups'], $value['fullname'], $value['company'], $payment, $disc, $total, $value['username'], base64_encode($id), $value['email']); break; default: $mailcontent = $formater->getMailContent('konfirmasi email gratis'); $m = $formater->_writeConfirmFreeEmail($mailcontent, $value['fullname'], $value['username'], $value['password'], base64_encode($id), $value['email'], $aReturn['name']); break; } $this->view->message = $m; } else { //echo 't'; } } }
function register() { $data = $this->transformRegister($_POST); $modelUser = new App_Model_Db_Table_User(); $modelUser->insert($data); $this->updateKopel(); /** * SELECT id, parent_id, value, name, lft, rgt * eg. $aReturn = $acl->getGroupData(15) * print_r($aReturn); * output: Array ( [0] => 15 [1] => 10 [2] => Super Administrator [3] => super_admin [4] => 10 [5] => 11 ) */ $acl = Glis_Acl::manager(); $aReturn = $acl->getGroupData($_POST['aro_groups']); //print_r($aReturn); $acl->addUser($_POST['username'], $aReturn[3]); // Do you want Email Confirmation send? if ($_POST['ec'] == 1) { //echo 'y'; } else { //echo 't'; } }