function dispTextmessageAdminUsageStatement()
 {
     $config = textmessageModel::getModuleConfig();
     $sms = textmessageModel::getCoolSMS();
     $count = Context::get('page_no');
     $search_code = Context::get('search_code');
     $msg_type = Context::get('msg_type');
     $rcpt_no = Context::get('rcpt_no');
     if (!$count) {
         $count = 20;
     }
     $options = new stdClass();
     if ($msg_type != 'all') {
         $options->type = $msg_type;
     }
     if (is_numeric($search_code)) {
         $options->s_resultcode = $search_code;
     }
     if ($rcpt_no) {
         $options->rcpt = $rcpt_no;
     }
     $options->count = $count;
     $options->page = Context::get('page');
     $output = $sms::sent($options);
     $output->total_page = ceil($output->total_count / $count);
     $page = new PageHandler($output->total_count, $output->total_page, 1, $count);
     $output->page_navigation = $page;
     // 템플릿에 쓰기 위해서 context::set
     Context::set('page_no', $count);
     Context::set('total_count', $output->total_count);
     Context::set('total_page', $output->total_page);
     Context::set('page', $output->page);
     Context::set('list_count', $output->list_count);
     Context::set('message_list', $output->data);
     Context::set('page_navigation', $output->page_navigation);
     require_once 'textmessage.utility.php';
     $csutil = new CSUtility();
     Context::set('csutil', $csutil);
     Context::set('config', $config);
     $this->setTemplateFile('usagestatement_list');
 }
 /**
  * @brief 문자취소(그룹)
  **/
 function cancelGroupMessages($grpid, $basecamp = FALSE)
 {
     $sms = textmessageModel::getCoolSMS($basecamp);
     $options = new stdClass();
     $options->gid = $grpid;
     $result = $sms::cancel($options);
     if ($result->code) {
         return new Object(-1, $result->code);
     }
     return new Object();
 }
Beispiel #3
0
 /**
  * @brief 환경값 읽어오기
  */
 public static function getConfig()
 {
     if (self::$config !== NULL) {
         return self::$config;
     }
     $config = self::getModuleConfig();
     if (!$config) {
         $config = new stdClass();
     }
     if (!$config->api_key || !$config->api_secret) {
         return false;
     }
     $config->cs_cash = 0;
     $config->cs_point = 0;
     $config->cs_mdrop = 0;
     $sms = self::getCoolSMS();
     if ($sms::balance()) {
         $remain = $sms::balance();
         $config->cs_cash = $remain->cash;
         $config->cs_point = $remain->point;
         $config->sms_price = 20;
         $config->lms_price = 50;
         $config->mms_price = 200;
         $config->ata_price = 15;
         $config->cta_price = 25;
         $config->sms_volume = (int) $config->cs_cash / (int) $config->sms_price + (int) $config->cs_point / (int) $config->sms_price;
         $config->lms_volume = (int) $config->cs_cash / (int) $config->lms_price + (int) $config->cs_point / (int) $config->lms_price;
         $config->mms_volume = (int) $config->cs_cash / (int) $config->mms_price + (int) $config->cs_point / (int) $config->mms_price;
         $config->ata_volume = (int) $config->cs_cash / (int) $config->ata_price + (int) $config->cs_point / (int) $config->ata_price;
         $config->cta_volume = (int) $config->cs_cash / (int) $config->cta_price + (int) $config->cs_point / (int) $config->cta_price;
         if ($remain->code) {
             Context::set('cs_is_logged', false);
             switch ($remain->code) {
                 case '20':
                     Context::set('cs_error_message', '<font color="red">존재하지 않는 아이디이거나 패스워드가 틀립니다.</font><br /><a href="' . getUrl('act', 'dispTextmessageAdminConfig') . '">설정변경</a>');
                     break;
                 case '30':
                     Context::set('cs_error_message', '<font color="red">사용가능한 SMS 건수가 없습니다.</font>');
                     break;
                 default:
                     Context::set('cs_error_message', '<font color="red">오류코드:' . $remain->code . '</font>');
             }
         } else {
             Context::set('cs_is_logged', true);
         }
     } else {
         Context::set('cs_is_logged', false);
         Context::set('cs_error_message', '<font color="red">서비스 서버에 연결할 수 없습니다.<br />일부 웹호스팅에서 외부로 나가는 포트 접속을 허용하지 않고 있습니다.<br /></font>');
     }
     Context::set('cs_cash', $config->cs_cash);
     Context::set('cs_point', $config->cs_point);
     Context::set('cs_mdrop', $config->cs_mdrop);
     Context::set('sms_price', $config->sms_price);
     Context::set('lms_price', $config->lms_price);
     Context::set('mms_price', $config->mms_price);
     Context::set('sms_volume', $config->sms_volume);
     self::$config = $config;
     return self::$config;
 }