public function index($_page = 0) { $user = $this->checkLogin(); //########==paging==########// $rec_limit = 50; $count = OpenSms::callModelStaticMethod('OpenSms_Model_BulkSms', 'GetBulkSMSCount', [0 => $user->LoginId]); $no = $count / $rec_limit; if ($count % $rec_limit == 0) { $no -= 1; } $link = '<ul class="pagination">'; for ($i = 0; $i <= $no; $i++) { if ($i == $_page - 1 || $i == 0 && $_page == 0) { $link .= '<li class="active"><a href="#">Page ' . ($i + 1) . '</a></li>'; } else { $link .= '<li><a href="' . OpenSms::getActionUrl('index', 'sent', 'sms', [0 => $i + 1]) . '">Page ' . ($i + 1) . '</a></li>'; } } $link .= '</ul>'; $this->data['link'] = $link; if ($_page != 0) { $page = stripslashes($_page) - 1; $offset = $page * $rec_limit; } else { $page = 0; $offset = 0; } $this->data['bulkSmsList'] = OpenSms::callModelStaticMethod('OpenSms_Model_BulkSms', 'GetBulkSMS', [0 => $user->LoginId, 1 => $offset, 2 => $rec_limit]); $this->data['pageTitle'] = 'Sent Messages | ' . OpenSms::getSystemSetting(OpenSms::SITE_NAME); $this->data['user'] = $user; $this->renderTemplate(); }
public function Index() { $this->data['pageTitle'] = 'Mange Voucher'; $this->data['user'] = $this->checkLogin(OpenSms::OPEN_ROLE_ADMIN); if (isset($_REQUEST['no'])) { $this->data['cards'] = OpenSms::callModelStaticMethod('OpenSms_Model_Card', 'GenerateCard', [$_REQUEST['no'], $_REQUEST['unit']]); } $this->renderTemplate(); }
public function GetLastTransaction() { $trans = array(); if (empty($this->LoginId)) { return $trans; } $sql = "select * from " . OpenSms::getTableName('transactions') . " where loginId =\r\n '" . StringMethods::MakeSave($this->LoginId) . "' and id = (select MAX(id) from " . OpenSms::getTableName('transactions') . "\r\n where loginId = '" . StringMethods::MakeSave($this->LoginId) . "')"; $result = OpenSms_Helper_Db::executeReader($sql); foreach ($result as $tran) { return OpenSms::callModelStaticMethod('OpenSms_Model_Transaction', 'copyFromPDO', [0 => $tran]); } return OpenSms::loadModel('OpenSms_Model_Transaction'); }
public function callModelStaticMethod($model, $method, array $param = null) { return OpenSms::callModelStaticMethod($model, $method, $param); }