Exemple #1
0
 /**
  * @brief returns poll infomation
  */
 function getPollinfo()
 {
     $args = new stdClass();
     $poll_srl = Context::get('poll_srl');
     $logged_info = Context::get('logged_info');
     if (!$poll_srl || $poll_srl == '') {
         return new Object(-1, "poll_no_poll_srl");
     }
     $args->poll_srl = $poll_srl;
     // Get the information related to the survey
     $columnList = array('poll_count', 'stop_date', 'poll_type', 'member_srl');
     $output = executeQuery('poll.getPoll', $args, $columnList);
     $poll_member_srl = $output->data->member_srl;
     if (!$output->data) {
         return new Object(-1, "poll_no_poll_or_deleted_poll");
     }
     $poll = new stdClass();
     $poll->is_polled = 0;
     if ($output->data->stop_date < date("Ymd")) {
         $poll->is_polled = 1;
     }
     $poll->poll_count = (int) $output->data->poll_count;
     $poll->poll_type = (int) $output->data->poll_type;
     $poll->stop_date = zdate($output->data->stop_date, "Y-m-d");
     $columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count');
     $output = executeQueryArray('poll.getPollTitle', $args, $columnList);
     if (!$output->data) {
         return;
     }
     $poll->poll = array();
     foreach ($output->data as $key => $val) {
         $poll->poll[$val->poll_index_srl] = new stdClass();
         $poll->poll[$val->poll_index_srl]->poll_index_srl = $val->poll_index_srl;
         $poll->poll[$val->poll_index_srl]->title = $val->title;
         $poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount;
         $poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count;
     }
     $output = executeQueryArray('poll.getPollItem', $args);
     foreach ($output->data as $key => $val) {
         unset($val->upload_target_srl);
         unset($val->poll_srl);
         $val->my_item = false;
         if (($val->add_user_srl == $logged_info->member_srl || $poll_member_srl == $logged_info->member_srl) && $val->add_user_srl != 0) {
             $val->my_item = true;
         }
         $poll->poll[$val->poll_index_srl]->item[] = $val;
     }
     $poll->poll_srl = $poll_srl;
     $caniadditem = $this->isAbletoAddItem($poll->poll_type) && !!$logged_info->member_srl;
     $oPollModel = getModel('poll');
     if ($oPollModel->isPolled($poll_srl)) {
         $poll->is_polled = 1;
     }
     $this->add('poll', $poll);
     $this->add('caniadditem', $caniadditem);
 }
Exemple #2
0
 /**
  * Log-in
  *
  * @param string $user_id
  * @param string $password
  * @param boolean $keep_signed
  *
  * @return Object
  */
 function doLogin($user_id, $password = '', $keep_signed = false)
 {
     $user_id = strtolower($user_id);
     if (!$user_id) {
         return new Object(-1, 'null_user_id');
     }
     // Call a trigger before log-in (before)
     $trigger_obj = new stdClass();
     $trigger_obj->user_id = $user_id;
     $trigger_obj->password = $password;
     $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
     if (!$trigger_output->toBool()) {
         return $trigger_output;
     }
     // Create a member model object
     $oMemberModel = getModel('member');
     // check IP access count.
     $config = $oMemberModel->getMemberConfig();
     $args = new stdClass();
     $args->ipaddress = $_SERVER['REMOTE_ADDR'];
     // check identifier
     if ($config->identifier == 'email_address' || strpos($user_id, '@') !== false) {
         // Get user_id information
         $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
         // Set an invalid user if no value returned
         if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
             return $this->recordLoginError(-1, 'invalid_email_address');
         }
     } else {
         // Get user_id information
         $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
         // Set an invalid user if no value returned
         if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
             return $this->recordLoginError(-1, 'invalid_user_id');
         }
     }
     $output = executeQuery('member.getLoginCountByIp', $args);
     $errorCount = $output->data->count;
     if ($errorCount >= $config->max_error_count) {
         $last_update = strtotime($output->data->last_update);
         $term = intval($_SERVER['REQUEST_TIME'] - $last_update);
         if ($term < $config->max_error_count_time) {
             $term = $config->max_error_count_time - $term;
             if ($term < 60) {
                 $term = intval($term) . lang('unit_sec');
             } elseif (60 <= $term && $term < 3600) {
                 $term = intval($term / 60) . lang('unit_min');
             } elseif (3600 <= $term && $term < 86400) {
                 $term = intval($term / 3600) . lang('unit_hour');
             } else {
                 $term = intval($term / 86400) . lang('unit_day');
             }
             return new Object(-1, sprintf(lang('excess_ip_access_count'), $term));
         } else {
             $args->ipaddress = $_SERVER['REMOTE_ADDR'];
             $output = executeQuery('member.deleteLoginCountByIp', $args);
         }
     }
     // Password Check
     if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) {
         return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
     }
     // If denied == 'Y', notify
     if ($this->memberInfo->denied == 'Y') {
         $args->member_srl = $this->memberInfo->member_srl;
         $output = executeQuery('member.chkAuthMail', $args);
         if ($output->toBool() && $output->data->count != '0') {
             $_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
             $redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
             return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
         }
         $refused_reason = $this->memberInfo->refused_reason ? '<br>' . lang('refused_reason') . ': ' . $this->memberInfo->refused_reason : '';
         return new Object(-1, lang('msg_user_denied') . $refused_reason);
     }
     // Notify if user is limited
     if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) {
         $limited_reason = $this->memberInfo->limited_reason ? '<br>' . lang('refused_reason') . ': ' . $this->memberInfo->limited_reason : '';
         return new Object(-9, sprintf(lang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d")) . $limited_reason);
     }
     // Do not allow login as admin if not in allowed IP list
     if ($this->memberInfo->is_admin === 'Y' && $this->act === 'procMemberLogin') {
         $oMemberAdminModel = getAdminModel('member');
         if (!$oMemberAdminModel->getMemberAdminIPCheck()) {
             return new Object(-1, 'msg_admin_ip_not_allowed');
         }
     }
     // Update the latest login time
     $args->member_srl = $this->memberInfo->member_srl;
     $output = executeQuery('member.updateLastLogin', $args);
     $site_module_info = Context::get('site_module_info');
     $this->_clearMemberCache($args->member_srl, $site_module_info->site_srl);
     // Check if there is recoding table.
     $oDB =& DB::getInstance();
     if ($oDB->isTableExists('member_count_history') && $config->enable_login_fail_report != 'N') {
         // check if there is login fail records.
         $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
         if ($output->data && $output->data->content) {
             $title = lang('login_fail_report');
             $message = '<ul>';
             $content = unserialize($output->data->content);
             if (count($content) > $config->max_error_count) {
                 foreach ($content as $val) {
                     $message .= '<li>' . lang('regdate') . ': ' . date('Y-m-d h:i:sa', $val[2]) . '<ul><li>' . lang('ipaddress') . ': ' . $val[0] . '</li><li>' . lang('message') . ': ' . $val[1] . '</li></ul></li>';
                 }
                 $message .= '</ul>';
                 $content = sprintf(lang('login_fail_report_contents'), $message, date('Y-m-d h:i:sa'));
                 //send message
                 $oCommunicationController = getController('communication');
                 $oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
                 if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') {
                     $view_url = Context::getRequestUri();
                     $content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>", $content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
                     $oMail = new Mail();
                     $oMail->setTitle($title);
                     $oMail->setContent($content);
                     $oMail->setSender($config->webmaster_name ? $config->webmaster_name : 'webmaster', $config->webmaster_email);
                     $oMail->setReceiptor($this->memberInfo->email_id . '(' . $this->memberInfo->nick_name . ')', $this->memberInfo->email_address);
                     $oMail->send();
                 }
                 $output = executeQuery('member.deleteLoginCountHistoryByMemberSrl', $args);
             }
         }
     }
     // Call a trigger after successfully log-in (after)
     ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
     // When user checked to use auto-login
     if ($keep_signed) {
         // Key generate for auto login
         $random_key = Rhymix\Framework\Security::getRandom(32, 'hex');
         $extra_key = strtolower($user_id) . $this->memberInfo->password . $_SERVER['HTTP_USER_AGENT'];
         $extra_key = substr(hash_hmac('sha256', $extra_key, $random_key), 0, 32);
         $autologin_args = new stdClass();
         $autologin_args->autologin_key = $random_key . $extra_key;
         $autologin_args->member_srl = $this->memberInfo->member_srl;
         executeQuery('member.deleteAutologin', $autologin_args);
         $autologin_output = executeQuery('member.insertAutologin', $autologin_args);
         if ($autologin_output->toBool()) {
             setCookie('xeak', $autologin_args->autologin_key, $_SERVER['REQUEST_TIME'] + 31536000, '/');
         }
     }
     $this->setSessionInfo();
     return $output;
 }
            ?>
)
						<?php 
        }
    }
    ?>
					</div>
				</div>
				<div class="x_control-group">
					<label class="x_control-label"><?php 
    echo $__Context->lang->regdate;
    ?>
</label>
					<div class="x_controls">
						<?php 
    echo zdate($__Context->widgetstyle_info->date, 'Y-m-d');
    ?>
					</div>
				</div>
	
				<?php 
    if ($__Context->widgetstyle_info->extra_var && count($__Context->widgetstyle_info->extra_var)) {
        foreach ($__Context->widgetstyle_info->extra_var as $__Context->id => $__Context->var) {
            ?>
					<?php 
            $__Context->suggestion_id++;
            ?>
					<?php 
            if (!$__Context->not_first && !$__Context->var->group) {
                ?>
<section class="section"><?php 
Exemple #4
0
 function procWAP(&$oMobile)
 {
     $content = '';
     // 플래닛의 기본 단위인 날짜를 미리 계산 모듈에 있는 동작인데... 애드온이 모듈보다 일찍 실행된다;
     $last_date = $this->planet->getContentLastDay();
     $date = Context::get('date');
     if (!$date || $date > $last_date) {
         $date = $last_date;
     }
     Context::set('date', $date);
     Context::set('prev_date', $this->planet->getPrevDate($date));
     Context::set('next_date', $this->planet->getNextDate($date));
     $type = Context::get('type');
     if (!$type) {
         $type = 'all';
     }
     Context::set('type', $type);
     $tagtab = null;
     switch ($type) {
         case 'wantyou':
             $sort_index = 'documents.voted_count';
             $order = 'desc';
             break;
         case 'best':
             $sort_index = 'documents.comment_count';
             $order = 'desc';
             break;
         case 'all':
             $sort_index = 'documents.list_order';
             $order = 'asc';
             break;
     }
     $page = Context::get('page');
     $oPlanetModel =& getModel('planet');
     $output = $oPlanetModel->getNewestContentList(null, $date, $page, 9, $sort_index, $order, $tagtab);
     $title = Context::getBrowserTitle() . ' [' . zdate($date, 'Y') . Context::getLang('unit_year') . zdate($date, 'm') . Context::getLang('unit_month') . zdate($date, 'd') . Context::getLang('unit_day') . ']';
     // 댓글 보기 일 경우
     if ($this->act == 'dispPlanetContentCommentList') {
         $page = Context::get('page');
         $document_srl = Context::get('document_srl');
         $oPlanetModel =& getModel('planet');
         $output = $oPlanetModel->getReplyList($document_srl, $page);
         $reply_list = $output->data;
         $title .= ' - ' . Context::getLang('comment');
         if (is_array($reply_list)) {
             foreach ($reply_list as $key => $reply) {
                 $content .= '[<strong>' . $reply->nick_name . '</strong>] ';
                 $content .= $reply->content;
             }
         }
         // 상위 페이지를 목록으로 돌아가기로 지정
         $oMobile->setUpperUrl(getUrl('act', ''), Context::getLang('cmd_go_upper'));
     } else {
         if ($output->page_navigation->total_page > 1) {
             if ($output->page_navigation->cur_page < $output->page_navigation->last_page) {
                 // next/prevUrl 지정
                 $oMobile->setPrevUrl(getUrl('page', $output->page_navigation->cur_page + 1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $output->page_navigation->cur_page + 1, $output->page_navigation->total_page));
             }
             if ($output->page_navigation->cur_page > 1) {
                 $oMobile->setNextUrl(getUrl('page', $output->page_navigation->cur_page - 1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $output->page_navigation->cur_page - 1, $output->page_navigation->total_page));
             }
         }
         if (!$output->data || !count($output->data)) {
             $content .= Context::getLang('no_documents');
         }
         foreach ($output->data as $no => $item) {
             $obj = null;
             $obj['href'] = getUrl('mid', $_GET['mid'], 'document_srl', $item->get('document_srl'), 'act', 'dispPlanetContentCommentList');
             $obj['link'] = '[' . htmlspecialchars($item->getNickName()) . '] ' . "\n";
             $obj['link'] .= htmlspecialchars(strip_tags($item->getContent()));
             if ($item->getPostScript()) {
                 $obj['extra'] = Context::getLang('planet_postscript') . htmlspecialchars($item->getPostScript());
             }
             if (is_array($item->getArrTags())) {
                 $obj['extra'] .= '<br />TAG:';
                 $obj['extra'] .= implode(', ', $item->getArrTags());
             }
             $obj['link'] = $obj['text'] = $obj['link'];
             $childs[] = $obj;
         }
         $oMobile->setChilds($childs);
         $prev_date = Context::get('prev_date');
         if ($prev_date) {
             $oMobile->setEtcBtn(getUrl('date', $prev_date, 'document_srl', ''), '<');
         }
         $next_date = Context::get('next_date');
         if ($next_date) {
             $oMobile->setEtcBtn(getUrl('date', $next_date, 'document_srl', ''), '>');
         }
     }
     $oMobile->setTitle($title);
     $oMobile->setContent($content);
 }
 /**
  * Get tags by the member info type 
  *
  * @param object $memberInfo
  * @param boolean $isAdmin (true : admin, false : not admin)
  *
  * @return array
  */
 function _getMemberInputTag($memberInfo, $isAdmin = false)
 {
     $oMemberModel = getModel('member');
     $extend_form_list = $oMemberModel->getCombineJoinForm($memberInfo);
     $security = new Security($extend_form_list);
     $security->encodeHTML('..column_title', '..description', '..default_value.');
     if ($memberInfo) {
         $memberInfo = get_object_vars($memberInfo);
     }
     $member_config = $this->memberConfig;
     if (!$this->memberConfig) {
         $member_config = $this->memberConfig = $oMemberModel->getMemberConfig();
     }
     $formTags = array();
     global $lang;
     foreach ($member_config->signupForm as $no => $formInfo) {
         if (!$formInfo->isUse) {
             continue;
         }
         if ($formInfo->name == $member_config->identifier || $formInfo->name == 'password') {
             continue;
         }
         $formTag = new stdClass();
         $inputTag = '';
         $formTag->title = $formInfo->isDefaultForm ? $lang->{$formInfo->name} : $formInfo->title;
         if ($isAdmin) {
             if ($formInfo->mustRequired) {
                 $formTag->title = '<em style="color:red">*</em> ' . $formTag->title;
             }
         } else {
             if ($formInfo->required && $formInfo->name != 'password') {
                 $formTag->title = '<em style="color:red">*</em> ' . $formTag->title;
             }
         }
         $formTag->name = $formInfo->name;
         if ($formInfo->isDefaultForm) {
             if ($formInfo->imageType) {
                 $formTag->type = 'image';
                 if ($formInfo->name == 'profile_image') {
                     $target = $memberInfo['profile_image'];
                     $functionName = 'doDeleteProfileImage';
                 } else {
                     if ($formInfo->name == 'image_name') {
                         $target = $memberInfo['image_name'];
                         $functionName = 'doDeleteImageName';
                     } else {
                         if ($formInfo->name == 'image_mark') {
                             $target = $memberInfo['image_mark'];
                             $functionName = 'doDeleteImageMark';
                         }
                     }
                 }
                 if ($target->src) {
                     $inputTag = sprintf('<input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" onclick="%s(%d);return false;">%s</button></span>', $formInfo->name, $formInfo->name . 'tag', $target->src, $formInfo->title, $functionName, $memberInfo['member_srl'], $lang->cmd_delete);
                 } else {
                     $inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
                 }
                 $inputTag .= sprintf('<input type="file" name="%s" id="%s" value="" accept="image/*" /><p class="help-block">%s: %dpx, %s: %dpx</p>', $formInfo->name, $formInfo->name, $lang->{$formInfo->name . '_max_width'}, $member_config->{$formInfo->name . '_max_width'}, $lang->{$formInfo->name . '_max_height'}, $member_config->{$formInfo->name . '_max_height'});
             } else {
                 if ($formInfo->name == 'birthday') {
                     $formTag->type = 'date';
                     $inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="text" placeholder="YYYY-MM-DD" name="birthday_ui" class="inputDate" id="birthday" value="%s" readonly="readonly" /> <input type="button" value="%s" class="btn dateRemover" />', $memberInfo['birthday'], zdate($memberInfo['birthday'], 'Y-m-d', false), $lang->cmd_delete);
                 } else {
                     if ($formInfo->name == 'find_account_question') {
                         $formTag->type = 'select';
                         $inputTag = '<select name="find_account_question" id="find_account_question" style="display:block;margin:0 0 8px 0">%s</select>';
                         $optionTag = array();
                         foreach ($lang->find_account_question_items as $key => $val) {
                             if ($key == $memberInfo['find_account_question']) {
                                 $selected = 'selected="selected"';
                             } else {
                                 $selected = '';
                             }
                             $optionTag[] = sprintf('<option value="%s" %s >%s</option>', $key, $selected, $val);
                         }
                         $inputTag = sprintf($inputTag, implode('', $optionTag));
                         $inputTag .= '<input type="text" name="find_account_answer" id="find_account_answer" title="' . Context::getLang('find_account_answer') . '" value="' . $memberInfo['find_account_answer'] . '" />';
                     } else {
                         if ($formInfo->name == 'email_address') {
                             $formTag->type = 'email';
                             $inputTag = '<input type="email" name="email_address" id="email_address" value="' . $memberInfo['email_address'] . '" />';
                         } else {
                             if ($formInfo->name == 'homepage') {
                                 $formTag->type = 'url';
                                 $inputTag = '<input type="url" name="homepage" id="homepage" value="' . $memberInfo['homepage'] . '" />';
                             } else {
                                 if ($formInfo->name == 'blog') {
                                     $formTag->type = 'url';
                                     $inputTag = '<input type="url" name="blog" id="blog" value="' . $memberInfo['blog'] . '" />';
                                 } else {
                                     $formTag->type = 'text';
                                     $inputTag = sprintf('<input type="text" name="%s" id="%s" value="%s" />', $formInfo->name, $formInfo->name, $memberInfo[$formInfo->name]);
                                 }
                             }
                         }
                     }
                 }
             }
         } else {
             $extendForm = $extend_form_list[$formInfo->member_join_form_srl];
             $replace = array('column_name' => $extendForm->column_name, 'value' => $extendForm->value);
             $extentionReplace = array();
             $formTag->type = $extendForm->column_type;
             if ($extendForm->column_type == 'text') {
                 $template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
             } else {
                 if ($extendForm->column_type == 'homepage') {
                     $template = '<input type="url" name="%column_name%" id="%column_name%" value="%value%" />';
                 } else {
                     if ($extendForm->column_type == 'email_address') {
                         $template = '<input type="email" name="%column_name%" id="%column_name%" value="%value%" />';
                     } else {
                         if ($extendForm->column_type == 'tel') {
                             $extentionReplace = array('tel_0' => $extendForm->value[0], 'tel_1' => $extendForm->value[1], 'tel_2' => $extendForm->value[2]);
                             $template = '<input type="tel" name="%column_name%[]" id="%column_name%" value="%tel_0%" size="4" maxlength="4" style="width:30px" title="First Number" /> - <input type="tel" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:30px" title="Second Number" /> - <input type="tel" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:30px" title="Third Number" />';
                         } else {
                             if ($extendForm->column_type == 'textarea') {
                                 $template = '<textarea name="%column_name%" id="%column_name%" rows="4" cols="42">%value%</textarea>';
                             } else {
                                 if ($extendForm->column_type == 'checkbox') {
                                     $template = '';
                                     if ($extendForm->default_value) {
                                         $template = '<div style="padding-top:5px">%s</div>';
                                         $__i = 0;
                                         $optionTag = array();
                                         foreach ($extendForm->default_value as $v) {
                                             $checked = '';
                                             if (is_array($extendForm->value) && in_array($v, $extendForm->value)) {
                                                 $checked = 'checked="checked"';
                                             }
                                             $optionTag[] = '<label for="%column_name%' . $__i . '"><input type="checkbox" id="%column_name%' . $__i . '" name="%column_name%[]" value="' . $v . '" ' . $checked . ' /> ' . $v . '</label>';
                                             $__i++;
                                         }
                                         $template = sprintf($template, implode('', $optionTag));
                                     }
                                 } else {
                                     if ($extendForm->column_type == 'radio') {
                                         $template = '';
                                         if ($extendForm->default_value) {
                                             $template = '<div style="padding-top:5px">%s</div>';
                                             $optionTag = array();
                                             foreach ($extendForm->default_value as $v) {
                                                 if ($extendForm->value == $v) {
                                                     $checked = 'checked="checked"';
                                                 } else {
                                                     $checked = '';
                                                 }
                                                 $optionTag[] = '<label><input type="radio" name="%column_name%" value="' . $v . '" ' . $checked . ' /> ' . $v . '</label>';
                                             }
                                             $template = sprintf($template, implode('', $optionTag));
                                         }
                                     } else {
                                         if ($extendForm->column_type == 'select') {
                                             $template = '<select name="' . $formInfo->name . '" id="' . $formInfo->name . '">%s</select>';
                                             $optionTag = array();
                                             if ($extendForm->default_value) {
                                                 foreach ($extendForm->default_value as $v) {
                                                     if ($v == $extendForm->value) {
                                                         $selected = 'selected="selected"';
                                                     } else {
                                                         $selected = '';
                                                     }
                                                     $optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
                                                 }
                                             }
                                             $template = sprintf($template, implode('', $optionTag));
                                         } else {
                                             if ($extendForm->column_type == 'kr_zip') {
                                                 $krzipModel = getModel('krzip');
                                                 if ($krzipModel && method_exists($krzipModel, 'getKrzipCodeSearchHtml')) {
                                                     $template = $krzipModel->getKrzipCodeSearchHtml($extendForm->column_name, $extendForm->value);
                                                 }
                                             } else {
                                                 if ($extendForm->column_type == 'jp_zip') {
                                                     $template = '<input type="text" name="%column_name%" id="%column_name%" value="%value%" />';
                                                 } else {
                                                     if ($extendForm->column_type == 'date') {
                                                         $extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
                                                         $template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="btn dateRemover" />';
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             $replace = array_merge($extentionReplace, $replace);
             $inputTag = preg_replace('@%(\\w+)%@e', '$replace[$1]', $template);
             if ($extendForm->description) {
                 $inputTag .= '<p class="help-block">' . $extendForm->description . '</p>';
             }
         }
         $formTag->inputTag = $inputTag;
         $formTags[] = $formTag;
     }
     return $formTags;
 }
Exemple #6
0
 function getUpdateDT()
 {
     return zdate($this->get('last_update'), 'c', false);
 }
 function getRegdate($format = 'Y.m.d H:i:s')
 {
     return zdate($this->get('regdate'), $format);
 }
Exemple #8
0
    /**
     * Get tags by the member info type 
     *
     * @param object $memberInfo
     * @param boolean $isAdmin (true : admin, false : not admin)
     *
     * @return array
     **/
    function _getMemberInputTag($memberInfo, $isAdmin = false)
    {
        $oMemberModel =& getModel('member');
        $extend_form_list = $oMemberModel->getCombineJoinForm($memberInfo);
        if ($memberInfo) {
            $memberInfo = get_object_vars($memberInfo);
        }
        $member_config = $oMemberModel->getMemberConfig();
        $formTags = array();
        global $lang;
        foreach ($member_config->signupForm as $no => $formInfo) {
            if (!$formInfo->isUse) {
                continue;
            }
            if ($formInfo->name == $member_config->identifier || $formInfo->name == 'password') {
                continue;
            }
            unset($formTag);
            $inputTag = '';
            $formTag->title = $formInfo->isDefaultForm ? $lang->{$formInfo->name} : $formInfo->title;
            if ($isAdmin) {
                if ($formInfo->mustRequired) {
                    $formTag->title = $formTag->title . ' <em style="color:red">*</em>';
                }
            } else {
                if ($formInfo->required && $formInfo->name != 'password') {
                    $formTag->title = $formTag->title . ' <em style="color:red">*</em>';
                }
            }
            $formTag->name = $formInfo->name;
            if ($formInfo->isDefaultForm) {
                if ($formInfo->imageType) {
                    if ($formInfo->name == 'profile_image') {
                        $target = $memberInfo['profile_image'];
                        $functionName = 'doDeleteProfileImage';
                    } elseif ($formInfo->name == 'image_name') {
                        $target = $memberInfo['image_name'];
                        $functionName = 'doDeleteImageName';
                    } elseif ($formInfo->name == 'image_mark') {
                        $target = $memberInfo['image_mark'];
                        $functionName = 'doDeleteImageMark';
                    }
                    if ($target->src) {
                        $inputTag = sprintf('<p class="a"><input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" class="text" onclick="%s(%d);return false;">%s</button></span></p>', $formInfo->name, $formInfo->name . 'tag', $target->src, $formInfo->title, $functionName, $memberInfo['member_srl'], $lang->cmd_delete);
                    } else {
                        $inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
                    }
                    $inputTag .= sprintf('<p class="a"><input type="file" name="%s" id="%s" value="" /></p><p><span class="desc">%s : %dpx, %s : %dpx</span></p>', $formInfo->name, $formInfo->name, $lang->{$formInfo->name . '_max_width'}, $member_config->{$formInfo->name . '_max_width'}, $lang->{$formInfo->name . '_max_height'}, $member_config->{$formInfo->name . '_max_height'});
                } elseif ($formInfo->name == 'birthday') {
                    $inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="text" class="inputDate" id="birthday" value="%s" /> <input type="button" value="%s" class="dateRemover" />', $memberInfo['birthday'], zdate($memberInfo['birthday'], 'Y-m-d', false), $lang->cmd_delete);
                } elseif ($formInfo->name == 'find_account_question') {
                    $inputTag = '<select name="find_account_question" style="width:290px; display:block;">%s</select>';
                    $optionTag = array();
                    foreach ($lang->find_account_question_items as $key => $val) {
                        if ($key == $memberInfo['find_account_question']) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        $optionTag[] = sprintf('<option value="%s" %s >%s</option>', $key, $selected, $val);
                    }
                    $inputTag = sprintf($inputTag, implode('', $optionTag));
                    $inputTag .= '<input type="text" name="find_account_answer" title="' . Context::getLang('find_account_answer') . '" value="' . $memberInfo['find_account_answer'] . '" class="inputText long tall" />';
                } else {
                    $inputTag = sprintf('<input type="text" name="%s" value="%s" class="inputText long tall" />', $formInfo->name, $memberInfo[$formInfo->name]);
                }
            } else {
                $extendForm = $extend_form_list[$formInfo->member_join_form_srl];
                $replace = array('column_name' => $extendForm->column_name, 'value' => $extendForm->value);
                $extentionReplace = array();
                if ($extendForm->column_type == 'text' || $extendForm->column_type == 'homepage' || $extendForm->column_type == 'email_address') {
                    $template = '<input type="text" name="%column_name%" value="%value%" />';
                } elseif ($extendForm->column_type == 'tel') {
                    $extentionReplace = array('tel_0' => $extendForm->value[0], 'tel_1' => $extendForm->value[1], 'tel_2' => $extendForm->value[2]);
                    $template = '<input type="text" name="%column_name%[]" value="%tel_0%" size="4" maxlength="4" style="width:30px" />-<input type="text" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:30px" />-<input type="text" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:30px" />';
                } elseif ($extendForm->column_type == 'textarea') {
                    $template = '<textarea name="%column_name%" rows="8" cols="42">%value%</textarea>';
                } elseif ($extendForm->column_type == 'checkbox') {
                    $template = '';
                    if ($extendForm->default_value) {
                        $__i = 0;
                        foreach ($extendForm->default_value as $v) {
                            $checked = '';
                            if (is_array($extendForm->value) && in_array($v, $extendForm->value)) {
                                $checked = 'checked="checked"';
                            }
                            $template .= '<input type="checkbox" id="%column_name%' . $__i . '" name="%column_name%[]" value="' . htmlspecialchars($v) . '" ' . $checked . ' /><label for="%column_name%' . $__i . '">' . $v . '</label>';
                            $__i++;
                        }
                    }
                } elseif ($extendForm->column_type == 'radio') {
                    $template = '';
                    if ($extendForm->default_value) {
                        $template = '<ul class="radio">%s</ul>';
                        $optionTag = array();
                        foreach ($extendForm->default_value as $v) {
                            if ($extendForm->value == $v) {
                                $checked = 'checked="checked"';
                            } else {
                                $checked = '';
                            }
                            $optionTag[] = '<li><input type="radio" name="%column_name%" value="' . $v . '" ' . $checked . ' />' . $v . '</li>';
                        }
                        $template = sprintf($template, implode('', $optionTag));
                    }
                } elseif ($extendForm->column_type == 'select') {
                    $template = '<select name="' . $formInfo->name . '">%s</select>';
                    $optionTag = array();
                    if ($extendForm->default_value) {
                        foreach ($extendForm->default_value as $v) {
                            if ($v == $extendForm->value) {
                                $selected = 'selected="selected"';
                            } else {
                                $selected = '';
                            }
                            $optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
                        }
                    }
                    $template = sprintf($template, implode('', $optionTag));
                } elseif ($extendForm->column_type == 'kr_zip') {
                    Context::loadFile(array('./modules/member/tpl/js/krzip_search.js', 'body'), true);
                    $extentionReplace = array('msg_kr_address' => $lang->msg_kr_address, 'msg_kr_address_etc' => $lang->msg_kr_address_etc, 'cmd_search' => $lang->cmd_search, 'cmd_search_again' => $lang->cmd_search_again, 'addr_0' => $extendForm->value[0], 'addr_1' => $extendForm->value[1]);
                    $replace = array_merge($extentionReplace, $replace);
                    $template = <<<EOD
\t\t\t\t\t\t<div class="krZip">
\t\t\t\t\t\t\t<div class="a" id="zone_address_search_%column_name%" >
\t\t\t\t\t\t\t\t<label for="krzip_address1_%column_name%">%msg_kr_address%</label><br />
\t\t\t\t\t\t\t\t<input type="text" id="krzip_address1_%column_name%" value="%addr_0%" />
\t\t\t\t\t\t\t\t<button type="button">%cmd_search%</button>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t<div class="a" id="zone_address_list_%column_name%" style="display:none">
\t\t\t\t\t\t\t\t<select name="%column_name%[]" id="address_list_%column_name%"><option value="%addr_0%">%addr_0%</select>
\t\t\t\t\t\t\t\t<button type="button">%cmd_search_again%</button>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t<div class="a address2">
\t\t\t\t\t\t\t\t<label for="krzip_address2_%column_name%">%msg_kr_address_etc%</label><br />
\t\t\t\t\t\t\t\t<input type="text" name="%column_name%[]" id="krzip_address2_%column_name%" value="%addr_1%" />
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t<script type="text/javascript">jQuery(function(\$){ \$.krzip('%column_name%') });</script>
EOD;
                } elseif ($extendForm->column_type == 'jp_zip') {
                    $template = '<input type="text" name="%column_name%" value="%value%" />';
                } elseif ($extendForm->column_type == 'date') {
                    $extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
                    $template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="dateRemover" />';
                }
                $replace = array_merge($extentionReplace, $replace);
                $inputTag = preg_replace('@%(\\w+)%@e', '$replace[$1]', $template);
                if ($extendForm->description) {
                    $inputTag .= '<p style="color:#999;">' . htmlspecialchars($extendForm->description) . '</p>';
                }
            }
            $formTag->inputTag = $inputTag;
            $formTags[] = $formTag;
        }
        return $formTags;
    }
Exemple #9
0
/**
 * If the recent post within a day, output format of YmdHis is "min/hours ago from now". If not within a day, it return format string.
 *
 * @param string $date Time value in format of YYYYMMDDHHIISS
 * @param string $format If gap is within a day, returns this format.
 * @return string
 */
function getTimeGap($date, $format = 'Y.m.d')
{
    $timestamp = ztime($date);
    $gap = RX_TIME - $timestamp;
    if ($gap < 60 * 60 * 24) {
        return Rhymix\Framework\DateTime::getRelativeTimestamp($gap >= 60 ? $timestamp : RX_TIME - 60);
    } else {
        return zdate($date, $format);
    }
}
						<td class="nowr"><?php 
            echo $__Context->val->setting;
            ?>
</td>
						<td class="nowr">						
							<span class="masked"><?php 
            echo getEncodeEmailAddress($__Context->member_info->email_address);
            ?>
</span>
						</td>
						<td class="nowr"><?php 
            echo zdate($__Context->val->regdate, 'Y-m-d');
            ?>
</td>
						<td class="nowr"><?php 
            echo zdate($__Context->val->last_login, 'Y-m-d');
            ?>
</td>
						<td><input type="checkbox" name="user" value='<?php 
            echo $__Context->val->reg_id . "\t" . $__Context->val->sort . "\t" . $__Context->member_info->user_name . "\t" . $__Context->member_info->nick_name;
            ?>
' /></td>
						
					</tr>
					<?php 
        }
    }
    ?>
				</tbody>
			</table>
			<div class="btnArea">
Exemple #11
0
 /**
  * Log-in
  *
  * @param string $user_id
  * @param string $password
  * @param boolean $keep_signed
  *
  * @return Object
  **/
 function doLogin($user_id, $password = '', $keep_signed = false)
 {
     $user_id = strtolower($user_id);
     if (!$user_id) {
         return new Object(-1, 'null_user_id');
     }
     // Call a trigger before log-in (before)
     $trigger_obj->user_id = $user_id;
     $trigger_obj->password = $password;
     $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
     if (!$trigger_output->toBool()) {
         return $trigger_output;
     }
     // Create a member model object
     $oMemberModel =& getModel('member');
     // check IP access count.
     $config = $oMemberModel->getMemberConfig();
     $args->ipaddress = $_SERVER['REMOTE_ADDR'];
     $output = executeQuery('member.getLoginCountByIp', $args);
     $count = (int) $output->data->count;
     if ($config->max_error_count < $count) {
         $last_update = strtotime($output->data->last_update);
         $term = intval(time() - $last_update);
         if ($term < $config->max_error_count_time) {
             $term = $config->max_error_count_time - $term;
             if ($term < 60) {
                 $term = intval($term) . Context::getLang('unit_sec');
             } elseif (60 <= $term && $term < 3600) {
                 $term = intval($term / 60) . Context::getLang('unit_min');
             } elseif (3600 <= $term && $term < 86400) {
                 $term = intval($term / 3600) . Context::getLang('unit_hour');
             } else {
                 $term = intval($term / 86400) . Context::getLang('unit_day');
             }
             return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'), $term));
         } else {
             $args->ipaddress = $_SERVER['REMOTE_ADDR'];
             $output = executeQuery('member.deleteLoginCountByIp', $args);
         }
     }
     // check identifier
     if ($config->identifier == 'email_address') {
         // Get user_id information
         $this->memberInfo = $oMemberModel->getMemberInfoByEmailAddress($user_id);
         // Set an invalid user if no value returned
         if (!$user_id || strtolower($this->memberInfo->email_address) != strtolower($user_id)) {
             return $this->recordLoginError(-1, 'invalid_email_address');
         }
     } else {
         // Get user_id information
         $this->memberInfo = $oMemberModel->getMemberInfoByUserID($user_id);
         // Set an invalid user if no value returned
         if (!$user_id || strtolower($this->memberInfo->user_id) != strtolower($user_id)) {
             return $this->recordLoginError(-1, 'invalid_user_id');
         }
     }
     // Password Check
     if ($password && !$oMemberModel->isValidPassword($this->memberInfo->password, $password, $this->memberInfo->member_srl)) {
         return $this->recordMemberLoginError(-1, 'invalid_password', $this->memberInfo);
     }
     // If denied == 'Y', notify
     if ($this->memberInfo->denied == 'Y') {
         $args->member_srl = $this->memberInfo->member_srl;
         $output = executeQuery('member.chkAuthMail', $args);
         if ($output->toBool() && $output->data->count != '0') {
             $_SESSION['auth_member_srl'] = $this->memberInfo->member_srl;
             $redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail');
             return $this->setRedirectUrl($redirectUrl, new Object(-1, 'msg_user_not_confirmed'));
         }
         return new Object(-1, 'msg_user_denied');
     }
     // Notify if denied_date is less than the current time
     if ($this->memberInfo->limit_date && substr($this->memberInfo->limit_date, 0, 8) >= date("Ymd")) {
         return new Object(-1, sprintf(Context::getLang('msg_user_limited'), zdate($this->memberInfo->limit_date, "Y-m-d")));
     }
     // Update the latest login time
     $args->member_srl = $this->memberInfo->member_srl;
     $output = executeQuery('member.updateLastLogin', $args);
     // check if there is login fail records.
     $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args);
     if ($output->data && $output->data->content) {
         $title = Context::getLang('login_fail_report');
         $message = '<ul>';
         $content = unserialize($output->data->content);
         foreach ($content as $val) {
             $message .= '<li>' . date('Y-m-d H:i:s P', $val[2]) . '<br /> Access IP: ' . $val[0] . '<br /> Message: ' . $val[1] . '</li>';
         }
         $message .= '</ul>';
         $content = sprintf(Context::getLang('login_fail_report_contents'), $message, date('Y-m-d H:i:s P'));
         //send message
         $oCommunicationController =& getController('communication');
         $oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
         if ($this->memberInfo->email_address && $this->memberInfo->allow_mailing == 'Y') {
             $view_url = Context::getRequestUri();
             $title = sprintf("%s @ %s", $title, $view_url);
             $content = sprintf("%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>", $content, $view_url, $view_url, $this->memberInfo->nick_name, $this->memberInfo->email_id);
             $oMail = new Mail();
             $oMail->setTitle($title);
             $oMail->setContent($content);
             $oMail->setSender($this->memberInfo->email_id . '(' . $this->memberInfo->nick_name . ')', $this->memberInfo->email_address);
             $oMail->setReceiptor($this->memberInfo->email_id . '(' . $this->memberInfo->nick_name . ')', $this->memberInfo->email_address);
             $oMail->send();
         }
         $output = executeQuery('member.deleteLoginCountHistoryByMemberSrl', $args);
     }
     // Call a trigger after successfully log-in (after)
     $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $this->memberInfo);
     if (!$trigger_output->toBool()) {
         return $trigger_output;
     }
     // When user checked to use auto-login
     if ($keep_signed) {
         // Key generate for auto login
         $autologin_args->autologin_key = md5(strtolower($user_id) . $this->memberInfo->password . $_SERVER['HTTP_USER_AGENT']);
         $autologin_args->member_srl = $this->memberInfo->member_srl;
         executeQuery('member.deleteAutologin', $autologin_args);
         $autologin_output = executeQuery('member.insertAutologin', $autologin_args);
         if ($autologin_output->toBool()) {
             setCookie('xeak', $autologin_args->autologin_key, time() + 31536000, '/');
         }
     }
     if ($this->memberInfo->is_admin == 'Y') {
         $oMemberAdminModel =& getAdminModel('member');
         if (!$oMemberAdminModel->getMemberAdminIPCheck()) {
             $_SESSION['denied_admin'] = 'Y';
         }
     }
     $this->setSessionInfo();
     return $output;
 }
					<th scope="col" style="width:300px;">결과값</th>					
				</tr>
			</thead>
			<tbody>
				<?php 
    if ($__Context->androidpushapp_list && count($__Context->androidpushapp_list)) {
        foreach ($__Context->androidpushapp_list as $__Context->no => $__Context->val) {
            ?>
				
				<tr>
					<td><?php 
            echo zdate($__Context->val->push_date, "Y-m-d");
            ?>
						</br>
						<?php 
            echo zdate($__Context->val->push_date, "H:i:s");
            ?>
</td>
					<td><?php 
            echo $__Context->val->type;
            ?>
</td>
					<td><?php 
            if ($__Context->val->type == "Message" || $__Context->val->type == "Test") {
                ?>
[<?php 
                echo $__Context->val->target_browser;
                ?>
] <?php 
                echo $__Context->val->target_title;
            } else {
Exemple #13
0
 /**
  * @brief 주어진 시간이 얼마 전 인지 반환
  * @param string YmdHis
  * @return string
  **/
 function getAgo($datetime)
 {
     global $lang;
     $lang_type = Context::getLangType();
     $display = $lang->ncenterlite_date;
     $ago = $lang->ncenterlite_ago;
     $date = getdate(strtotime(zdate($datetime, 'Y-m-d H:i:s')));
     $current = getdate();
     $p = array('year', 'mon', 'mday', 'hours', 'minutes', 'seconds');
     $factor = array(0, 12, 30, 24, 60, 60);
     for ($i = 0; $i < 6; $i++) {
         if ($i > 0) {
             $current[$p[$i]] += $current[$p[$i - 1]] * $factor[$i];
             $date[$p[$i]] += $date[$p[$i - 1]] * $factor[$i];
         }
         if ($current[$p[$i]] - $date[$p[$i]] > 1) {
             $value = $current[$p[$i]] - $date[$p[$i]];
             if ($lang_type == 'en') {
                 return $value . ' ' . $display[$i] . ($value != 1 ? 's' : '') . ' ' . $ago;
             }
             return $value . $display[$i] . ' ' . $ago;
         }
     }
     return zdate($datetime, 'Y-m-d');
 }
Exemple #14
0
 /**
  * Returns a form based on its type
  *
  * @return string Returns a html form.
  */
 function getFormHTML($include_desc = TRUE)
 {
     static $id_num = 1000;
     $type = $this->type;
     $value = $this->_getTypeValue($this->type, $this->value);
     $default = $this->_getTypeValue($this->type, $this->default);
     $column_name = $this->name;
     $tmp_id = $column_name . '-' . $id_num++;
     $buff = '';
     switch ($type) {
         // Homepage
         case 'homepage':
             $buff .= '<input type="text" name="' . $column_name . '" value="' . $value . '" class="homepage" />';
             break;
             // Email Address
         // Email Address
         case 'email_address':
             $buff .= '<input type="text" name="' . $column_name . '" value="' . $value . '" class="email_address" />';
             break;
             // Phone Number
         // Phone Number
         case 'tel':
             $buff .= '<input type="text" name="' . $column_name . '[]" value="' . $value[0] . '" size="4" maxlength="4" class="tel" />' . '<input type="text" name="' . $column_name . '[]" value="' . $value[1] . '" size="4" maxlength="4" class="tel" />' . '<input type="text" name="' . $column_name . '[]" value="' . $value[2] . '" size="4" maxlength="4" class="tel" />';
             break;
             // textarea
         // textarea
         case 'textarea':
             $buff .= '<textarea name="' . $column_name . '" rows="8" cols="42">' . $value . '</textarea>';
             break;
             // multiple choice
         // multiple choice
         case 'checkbox':
             $buff .= '<ul>';
             foreach ($default as $v) {
                 if ($value && in_array(trim($v), $value)) {
                     $checked = ' checked="checked"';
                 } else {
                     $checked = '';
                 }
                 // Temporary ID for labeling
                 $tmp_id = $column_name . '-' . $id_num++;
                 $buff .= '<li><label for="' . $tmp_id . '"><input type="checkbox" name="' . $column_name . '[]" id="' . $tmp_id . '" value="' . htmlspecialchars($v) . '" ' . $checked . ' />' . $v . '</label></li>';
             }
             $buff .= '</ul>';
             break;
             // single choice
         // single choice
         case 'select':
             $buff .= '<select name="' . $column_name . '" class="select">';
             foreach ($default as $v) {
                 if ($value && in_array(trim($v), $value)) {
                     $selected = ' selected="selected"';
                 } else {
                     $selected = '';
                 }
                 $buff .= '<option value="' . $v . '" ' . $selected . '>' . $v . '</option>';
             }
             $buff .= '</select>';
             break;
             // radio
         // radio
         case 'radio':
             $buff .= '<ul>';
             foreach ($default as $v) {
                 if ($value && in_array(trim($v), $value)) {
                     $checked = ' checked="checked"';
                 } else {
                     $checked = '';
                 }
                 // Temporary ID for labeling
                 $tmp_id = $column_name . '-' . $id_num++;
                 $buff .= '<li><input type="radio" name="' . $column_name . '" id="' . $tmp_id . '" ' . $checked . ' value="' . $v . '"  class="radio" /><label for="' . $tmp_id . '">' . $v . '</label></li>';
             }
             $buff .= '</ul>';
             break;
             // date
         // date
         case 'date':
             // datepicker javascript plugin load
             Context::loadJavascriptPlugin('ui.datepicker');
             $buff .= '<input type="hidden" name="' . $column_name . '" value="' . $value . '" />' . '<input type="text" id="date_' . $column_name . '" value="' . zdate($value, 'Y-m-d') . '" class="date" /> <input type="button" value="' . Context::getLang('cmd_delete') . '" id="dateRemover_' . $column_name . '" />' . "\n" . '<script>' . "\n" . '(function($){' . "\n" . '    $(function(){' . "\n" . '        var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent: false,yearRange:\'-100:+10\', onSelect:function(){' . "\n" . '            $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}' . "\n" . '        };' . "\n" . '        $.extend(option,$.datepicker.regional[\'' . Context::getLangType() . '\']);' . "\n" . '        $("#date_' . $column_name . '").datepicker(option);' . "\n" . '		$("#dateRemover_' . $column_name . '").click(function(){' . "\n" . '			$(this).siblings("input").val("");' . "\n" . '			return false;' . "\n" . '		})' . "\n" . '    });' . "\n" . '})(jQuery);' . "\n" . '</script>';
             break;
             // address
         // address
         case "kr_zip":
             // krzip address javascript plugin load
             Context::loadJavascriptPlugin('ui.krzip');
             $buff .= '<div id="addr_searched_' . $column_name . '" style="display:' . ($value[0] ? 'block' : 'none') . ';">' . '<input type="text" readonly="readonly" name="' . $column_name . '[]" value="' . $value[0] . '" class="address" />' . '<a href="#" onclick="doShowKrZipSearch(this, \'' . $column_name . '\'); return false;" class="button red"><span>' . Context::getLang('cmd_cancel') . '</span></a>' . '</div>' . '<div id="addr_list_' . $column_name . '" style="display:none;">' . '<select name="addr_list_' . $column_name . '"></select>' . '<a href="#" onclick="doSelectKrZip(this, \'' . $column_name . '\'); return false;" class="button blue"><span>' . Context::getLang('cmd_select') . '</span></a>' . '<a href="#" onclick="doHideKrZipList(this, \'' . $column_name . '\'); return false;" class="button red"><span>' . Context::getLang('cmd_cancel') . '</span></a>' . '</div>' . '<div id="addr_search_' . $column_name . '" style="display:' . ($value[0] ? 'none' : 'block') . '">' . '<input type="text" name="addr_search_' . $column_name . '" class="address" value="" />' . '<a href="#" onclick="doSearchKrZip(this, \'' . $column_name . '\'); return false;" class="button green"><span>' . Context::getLang('cmd_search') . '</span></a>' . '</div>' . '<input type="text" name="' . $column_name . '[]" value="' . htmlspecialchars($value[1]) . '" class="address" />' . '';
             break;
             // General text
         // General text
         default:
             $buff .= ' <input type="text" name="' . $column_name . '" value="' . ($value !== NULL ? $value : $default) . '" class="text" />';
             break;
     }
     if ($this->desc && $include_desc) {
         $buff .= '<p>' . htmlspecialchars($this->desc) . '</p>';
     }
     return $buff;
 }
        		<span class="mblst_date"><?php 
            echo zdate($__Context->val->regdate, "Y-m-d");
            ?>
</span>
        		<a class="mblst_link" href="<?php 
            echo getUrl('act', 'dispMobileexMessageView', 'message_srl', $__Context->val->message_srl, 'message_type', '');
            ?>
">
        			<span class="mblst_username"><?php 
            echo $__Context->val->nick_name;
            ?>
</span><?php 
            if ($__Context->val->readed == "Y") {
                ?>
<span class="mblst_read_date"><?php 
                echo zdate($__Context->val->readed_date, "Y-m-d H:i:s");
                ?>
 [읽음]</span><?php 
            }
            ?>
        			<span class="mblst_subject"><?php 
            echo $__Context->val->title;
            ?>
</span>
        		</a>
        		<button type="button" class="mblst_delete" onclick="doDeleteMessages(<?php 
            echo $__Context->val->message_srl;
            ?>
,'<?php 
            echo $__Context->lang->confirm_delete;
            ?>
Exemple #16
0
 function getUpdate($format = 'Y.m.d H:i:s', $conversion = TRUE)
 {
     return zdate($this->get('last_update'), $format, $conversion);
 }
<h2><?php 
echo $__Context->addon_info->title;
?>
</h2>
<table class="x_table">
	<tbody>
		<tr>
			<th class="nowr"><?php 
echo $__Context->lang->version;
?>
</th>
			<td><?php 
echo $__Context->addon_info->version;
?>
 (<?php 
echo zdate($__Context->addon_info->date, 'Y-m-d');
?>
)</td>
		</tr>
		<tr>
			<th class="nowr"><?php 
echo $__Context->lang->author;
?>
</th>
			<td>
				<?php 
if ($__Context->addon_info->author && count($__Context->addon_info->author)) {
    foreach ($__Context->addon_info->author as $__Context->author) {
        ?>
					<?php 
        echo $__Context->author->name;
<div class="mbmsg_in" style="border-top: 1px solid #CDCDCD">
     	 <dl class="msg_info">
     	 	 <dt>보낸이</dt>
     	    <dd>내게 보낸 견적입니다.</dd>
     	</dl>
     </div><?php 
}
?>
     <div class="mbmsg_in">
     	 <dl class="msg_info">
     	 	 <dt><?php 
echo $__Context->msg_name;
?>
 시간</dt>
     	    <dd><?php 
echo zdate($__Context->message->regdate, "Y-m-d");
?>
</dd>
     	</dl>
     </div>
     <div class="mbmsg_cont">
         <?php 
echo $__Context->message->sender_name;
?>
님의 견적
         <br><br>
         
         <?php 
if ($__Context->message->message_type != 'T') {
    ?>
         <div class="pl">
Exemple #19
0
/**
 * If the recent post within a day, output format of YmdHis is "min/hours ago from now". If not within a day, it return format string.
 *
 * @param string $date Time value in format of YYYYMMDDHHIISS
 * @param string $format If gap is within a day, returns this format.
 * @return string
 */
function getTimeGap($date, $format = 'Y.m.d')
{
    $gap = $_SERVER['REQUEST_TIME'] + zgap() - ztime($date);
    $lang_time_gap = Context::getLang('time_gap');
    if ($gap < 60) {
        $buff = sprintf($lang_time_gap['min'], (int) ($gap / 60) + 1);
    } elseif ($gap < 60 * 60) {
        $buff = sprintf($lang_time_gap['mins'], (int) ($gap / 60) + 1);
    } elseif ($gap < 60 * 60 * 2) {
        $buff = sprintf($lang_time_gap['hour'], (int) ($gap / 60 / 60) + 1);
    } elseif ($gap < 60 * 60 * 24) {
        $buff = sprintf($lang_time_gap['hours'], (int) ($gap / 60 / 60) + 1);
    } else {
        $buff = zdate($date, $format);
    }
    return $buff;
}
					<?php 
        if ((int) $__Context->item->package_voter <= 0) {
            ?>
						<span class="starRating"><span style="width:0%">0</span></span>
						<span class="x_badge">0/0</span>
					<?php 
        }
        ?>
					<?php 
        echo $__Context->lang->package_update;
        ?>
: <time title="<?php 
        echo zdate($__Context->item->item_regdate, "Y-m-d H:i");
        ?>
"><?php 
        echo zdate($__Context->item->item_regdate, "Y-m-d");
        ?>
</time> 
					<i>|</i>
					<?php 
        echo $__Context->lang->package_downloaded_count;
        ?>
: <?php 
        echo number_format($__Context->item->package_downloaded);
        ?>
					<i>|</i>
				</p>
				<?php 
        if ($__Context->item->deps) {
            ?>
<p><?php 
</td><?php 
                    }
                    ?>
				<?php 
                    if ($__Context->val->type == 'last_post' && $__Context->val->idx == -1) {
                        ?>
<td class="lastReply">
					<?php 
                        if ((int) $__Context->document->get('comment_count') > 0) {
                            ?>
						<a href="<?php 
                            echo $__Context->document->getPermanentUrl();
                            ?>
#comment" title="Last Reply">
							<?php 
                            echo zdate($__Context->document->get('last_update'), 'Y.m.d');
                            ?>
						</a>
						<?php 
                            if ($__Context->document->getLastUpdater()) {
                                ?>
<span>
							<sub>by</sub>
							<?php 
                                echo $__Context->document->getLastUpdater();
                                ?>
						</span><?php 
                            }
                            ?>
					<?php 
                        }
echo $__Context->lang->nick_name;
?>
</th>
			<th><?php 
echo $__Context->lang->mileage;
?>
</th>
		</thead>
		<tbody>
			<?php 
if ($__Context->list && count($__Context->list)) {
    foreach ($__Context->list as $__Context->key => $__Context->val) {
        ?>
<tr>
				<td><?php 
        echo zdate($__Context->val->regdate);
        ?>
</td> 
				<td><?php 
        echo $__Context->val->user_id;
        ?>
</td> 
				<td><?php 
        echo $__Context->val->nick_name;
        ?>
</td> 
				<td><a href="<?php 
        echo getUrl('act', 'dispNmileageAdminMileageHistory', 'member_srl', $__Context->val->member_srl);
        ?>
"><?php 
        if ($__Context->config->mileage_method == 'nmileage') {
 /**
  * @brief type에 따른 form을 리턴
  **/
 function getFormHTML()
 {
     $type = $this->type;
     $name = $this->name;
     $value = $this->_getTypeValue($this->type, $this->value);
     $default = $this->_getTypeValue($this->type, $this->default);
     $column_name = 'extra_vars' . $this->idx;
     $buff = '';
     switch ($type) {
         // 홈페이지 주소
         case 'homepage':
             $buff .= '<input type="text" name="' . $column_name . '" value="' . $value . '" class="homepage" />';
             break;
             // Email 주소
         // Email 주소
         case 'email_address':
             $buff .= '<input type="text" name="' . $column_name . '" value="' . $value . '" class="email_address" />';
             break;
             // 전화번호
         // 전화번호
         case 'tel':
             $buff .= '<input type="text" name="' . $column_name . '" value="' . $value[0] . '" size="4" class="tel" />' . '<input type="text" name="' . $column_name . '" value="' . $value[1] . '" size="4" class="tel" />' . '<input type="text" name="' . $column_name . '" value="' . $value[2] . '" size="4" class="tel" />';
             break;
             // textarea
         // textarea
         case 'textarea':
             $buff .= '<textarea name="' . $column_name . '" class="textarea">' . $value . '</textarea>';
             break;
             // 다중 선택
         // 다중 선택
         case 'checkbox':
             $buff .= '<ul>';
             foreach ($default as $v) {
                 if ($value && in_array($v, $value)) {
                     $checked = ' checked="checked"';
                 } else {
                     $checked = '';
                 }
                 $buff .= '<li><input type="checkbox" name="' . $column_name . '" value="' . htmlspecialchars($v) . '" ' . $checked . ' />' . $v . '</li>';
             }
             $buff .= '</ul>';
             break;
             // 단일 선택
         // 단일 선택
         case 'select':
             $buff .= '<select name="' . $column_name . '" class="select">';
             foreach ($default as $v) {
                 if ($value && in_array($v, $value)) {
                     $selected = ' selected="selected"';
                 } else {
                     $selected = '';
                 }
                 $buff .= '<option value="' . $v . '" ' . $selected . '>' . $v . '</option>';
             }
             $buff .= '</select>';
             break;
             // radio
         // radio
         case 'radio':
             $buff .= '<ul>';
             foreach ($default as $v) {
                 if ($value && in_array($v, $value)) {
                     $checked = ' checked="checked"';
                 } else {
                     $checked = '';
                 }
                 $buff .= '<li><input type="radio" name="' . $column_name . '" ' . $checked . ' value="' . $v . '"  class="radio" />' . $v . '</li>';
             }
             $buff .= '</ul>';
             break;
             // 날짜 입력
         // 날짜 입력
         case 'date':
             // datepicker javascript plugin load
             Context::loadJavascriptPlugin('ui.datepicker');
             $buff .= '<input type="hidden" name="' . $column_name . '" value="' . $value . '" />' . '<input type="text" id="date_' . $column_name . '" value="' . zdate($value, 'Y-m-d') . '" readonly="readonly" class="date" />' . "\n" . '<script type="text/javascript">' . "\n" . '(function($){' . "\n" . '    $(function(){' . "\n" . '        var option = { gotoCurrent: false,yearRange:\'-100:+10\', onSelect:function(){' . "\n" . '            $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}' . "\n" . '        };' . "\n" . '        $.extend(option,$.datepicker.regional[\'' . Context::getLangType() . '\']);' . "\n" . '        $("#date_' . $column_name . '").datepicker(option);' . "\n" . '    });' . "\n" . '})(jQuery);' . "\n" . '</script>';
             break;
             // 주소 입력
         // 주소 입력
         case "kr_zip":
             // krzip address javascript plugin load
             Context::loadJavascriptPlugin('ui.krzip');
             $buff .= '<div id="addr_searched_' . $column_name . '" style="display:' . ($value[0] ? 'block' : 'none') . ';">' . '<input type="text" readonly="readonly" name="' . $column_name . '" value="' . $value[0] . '" class="address" />' . '<a href="#" onclick="doShowKrZipSearch(this, \'' . $column_name . '\'); return false;" class="button red"><span>' . Context::getLang('cmd_cancel') . '</span></a>' . '</div>' . '<div id="addr_list_' . $column_name . '" style="display:none;">' . '<select name="addr_list_' . $column_name . '"></select>' . '<a href="#" onclick="doSelectKrZip(this, \'' . $column_name . '\'); return false;" class="button blue"><span>' . Context::getLang('cmd_select') . '</span></a>' . '<a href="#" onclick="doHideKrZipList(this, \'' . $column_name . '\'); return false;" class="button red"><span>' . Context::getLang('cmd_cancel') . '</span></a>' . '</div>' . '<div id="addr_search_' . $column_name . '" style="display:' . ($value[0] ? 'none' : 'block') . '">' . '<input type="text" name="addr_search_' . $column_name . '" class="address" value="" />' . '<a href="#" onclick="doSearchKrZip(this, \'' . $column_name . '\'); return false;" class="button green"><span>' . Context::getLang('cmd_search') . '</span></a>' . '</div>' . '<input type="text" name="' . $column_name . '" value="' . htmlspecialchars($value[1]) . '" class="address" />' . '';
             break;
             // 일반 text
         // 일반 text
         default:
             $buff .= ' <input type="text" name="' . $column_name . '" value="' . $value . '" class="text" />';
             break;
     }
     if ($this->desc) {
         $buff .= '<p>' . $this->desc . '</p>';
     }
     return $buff;
 }
 /**
  * @brief get input extra vars
  */
 function getNproductInputExtraVars($extra_info)
 {
     $extend_form_list = $extra_info;
     $formTags = array();
     if (!$extend_form_list) {
         return $formTags;
     }
     foreach ($extend_form_list as $no => $formInfo) {
         unset($formTag);
         $inputTag = '';
         $formTag = $formInfo;
         $formTag->title = $formInfo->column_title;
         if ($formInfo->required == 'Y') {
             $formTag->title = $formTag->title . ' <em style="color:red">*</em>';
         }
         $extendForm = $formInfo;
         $replace = array('column_name' => $extendForm->column_name, 'value' => $extendForm->value);
         $extentionReplace = array();
         if ($extendForm->column_type == 'text' || $extendForm->column_type == 'homepage' || $extendForm->column_type == 'email_address') {
             $template = '<input type="text" name="%column_name%" value="%value%" />';
         } else {
             if ($extendForm->column_type == 'tel') {
                 $extentionReplace = array('tel_0' => $extendForm->value[0], 'tel_1' => $extendForm->value[1], 'tel_2' => $extendForm->value[2]);
                 $template = '<input type="text" name="%column_name%[]" value="%tel_0%" size="4" />-<input type="text" name="%column_name%[]" value="%tel_1%" size="4" />-<input type="text" name="%column_name%" value="%tel_2%" size="4" />';
             } else {
                 if ($extendForm->column_type == 'textarea') {
                     $template = '<textarea name="%column_name%">%value%</textarea>';
                 } else {
                     if ($extendForm->column_type == 'checkbox') {
                         $template = '';
                         if ($extendForm->default_value) {
                             $__i = 0;
                             foreach ($extendForm->default_value as $v) {
                                 $checked = '';
                                 if (is_array($extendForm->value) && in_array($v, $extendForm->value)) {
                                     $checked = 'checked="checked"';
                                 }
                                 $template .= '<input type="checkbox" id="%column_name%' . $__i . '" name="%column_name%[]" value="' . htmlspecialchars($v) . '" ' . $checked . ' /><label for="%column_name%' . $__i . '">' . $v . '</label>';
                                 $__i++;
                             }
                         }
                     } else {
                         if ($extendForm->column_type == 'radio') {
                             $template = '';
                             if ($extendForm->default_value) {
                                 $template = '<ul class="radio">%s</ul>';
                                 $optionTag = array();
                                 foreach ($extendForm->default_value as $v) {
                                     if ($extendForm->value == $v) {
                                         $checked = 'checked="checked"';
                                     } else {
                                         $checked = '';
                                     }
                                     $optionTag[] = '<li><input type="radio" name="%column_name%" value="' . $v . '" ' . $checked . ' />' . $v . '</li>';
                                 }
                                 $template = sprintf($template, implode('', $optionTag));
                             }
                         } else {
                             if ($extendForm->column_type == 'select') {
                                 $template = '<select name="' . $formInfo->column_name . '">%s</select>';
                                 $optionTag = array();
                                 if ($extendForm->default_value) {
                                     foreach ($extendForm->default_value as $v) {
                                         if ($v == $extendForm->value) {
                                             $selected = 'selected="selected"';
                                         } else {
                                             $selected = '';
                                         }
                                         $optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
                                     }
                                 }
                                 $template = sprintf($template, implode('', $optionTag));
                             } else {
                                 if ($extendForm->column_type == 'date') {
                                     $extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
                                     $template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="dateRemover" />';
                                 } else {
                                     if ($extendForm->column_type == 'file') {
                                         $oFileModel =& getModel('file');
                                         if ($extendForm->value) {
                                             $file = $oFileModel->getFile($extendForm->value);
                                             $template = '<p><a href="' . $file->download_url . '">' . $file->source_filename . '</a> (' . FileHandler::filesize($file->file_size) . ')</p>';
                                         }
                                         $template .= '<input type="file" name="%column_name%" />';
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         $replace = array_merge($extentionReplace, $replace);
         $inputTag = preg_replace('@%(\\w+)%@e', '$replace[$1]', $template);
         $formTag->inputTag = $inputTag;
         $formTags[] = $formTag;
     }
     return $formTags;
 }
Exemple #25
0
 function getUpdate($format = 'Y.m.d H:i:s')
 {
     return zdate($this->get('last_update'), $format);
 }
 /**
  * @brief 로그인 시킴
  **/
 function doLogin($user_id, $password = '', $keep_signed = false)
 {
     $user_id = strtolower($user_id);
     // 로그인 이전에 trigger 호출 (before)
     $trigger_obj->user_id = $user_id;
     $trigger_obj->password = $password;
     $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
     if (!$trigger_output->toBool()) {
         return $trigger_output;
     }
     // member model 객체 생성
     $oMemberModel =& getModel('member');
     // user_id 에 따른 정보 가져옴
     $member_info = $oMemberModel->getMemberInfoByUserID($user_id);
     // return 값이 없으면 존재하지 않는 사용자로 지정
     if (!$user_id || $member_info->user_id != $user_id) {
         return new Object(-1, 'invalid_user_id');
     }
     // 비밀번호 검사
     if ($password && !$oMemberModel->isValidPassword($member_info->password, $password)) {
         return new Object(-1, 'invalid_password');
     }
     // denied == 'Y' 이면 알림
     if ($member_info->denied == 'Y') {
         $args->member_srl = $member_info->member_srl;
         $output = executeQuery('member.chkAuthMail', $args);
         if ($output->toBool() && $output->data->count != '0') {
             return new Object(-1, 'msg_user_not_confirmed');
         }
         return new Object(-1, 'msg_user_denied');
     }
     // denied_date가 현 시간보다 적으면 알림
     if ($member_info->limit_date && substr($member_info->limit_date, 0, 8) >= date("Ymd")) {
         return new Object(-1, sprintf(Context::getLang('msg_user_limited'), zdate($member_info->limit_date, "Y-m-d")));
     }
     // 사용자 정보의 최근 로그인 시간을 기록
     $args->member_srl = $member_info->member_srl;
     $output = executeQuery('member.updateLastLogin', $args);
     // 로그인 성공후 trigger 호출 (after)
     $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $member_info);
     if (!$trigger_output->toBool()) {
         return $trigger_output;
     }
     // 자동 로그인 사용시 정보 처리
     if ($keep_signed) {
         // 자동 로그인 키 생성
         $autologin_args->autologin_key = md5($user_id . $member_info->password . $_SERVER['REMOTE_ADDR']);
         $autologin_args->member_srl = $member_info->member_srl;
         executeQuery('member.deleteAutologin', $autologin_args);
         $autologin_output = executeQuery('member.insertAutologin', $autologin_args);
         if ($autologin_output->toBool()) {
             setCookie('xeak', $autologin_args->autologin_key, time() + 60 * 60 * 24 * 365, '/');
         }
     }
     $this->setSessionInfo($member_info);
     return $output;
 }
 function _getDisplayedMemberInfo($memberInfo, $extendFormInfo, $memberConfig)
 {
     $logged_info = Context::get('logged_info');
     $displayDatas = array();
     foreach ($memberConfig->signupForm as $no => $formInfo) {
         if (!$formInfo->isUse) {
             continue;
         }
         if ($formInfo->name == 'password' || $formInfo->name == 'find_account_question') {
             continue;
         }
         if ($logged_info->is_admin != 'Y' && $memberInfo->member_srl != $logged_info->member_srl && $formInfo->isPublic != 'Y') {
             continue;
         }
         $item = $formInfo;
         if ($formInfo->isDefaultForm) {
             $item->title = Context::getLang($formInfo->name);
             $item->value = $memberInfo->{$formInfo->name};
             if ($formInfo->name == 'profile_image' && $memberInfo->profile_image) {
                 $target = $memberInfo->profile_image;
                 $item->value = '<img src="' . $target->src . '" />';
             } elseif ($formInfo->name == 'image_name' && $memberInfo->image_name) {
                 $target = $memberInfo->image_name;
                 $item->value = '<img src="' . $target->src . '" />';
             } elseif ($formInfo->name == 'image_mark' && $memberInfo->image_mark) {
                 $target = $memberInfo->image_mark;
                 $item->value = '<img src="' . $target->src . '" />';
             } elseif ($formInfo->name == 'birthday' && $memberInfo->birthday) {
                 $item->value = zdate($item->value, 'Y-m-d');
             }
         } else {
             $item->title = $extendFormInfo[$formInfo->member_join_form_srl]->column_title;
             $orgValue = $extendFormInfo[$formInfo->member_join_form_srl]->value;
             if ($formInfo->type == 'tel' && is_array($orgValue)) {
                 $item->value = implode('-', $orgValue);
             } elseif ($formInfo->type == 'kr_zip' && is_array($orgValue)) {
                 $item->value = implode(' ', $orgValue);
             } elseif ($formInfo->type == 'checkbox' && is_array($orgValue)) {
                 $item->value = implode(", ", $orgValue);
             } elseif ($formInfo->type == 'date') {
                 $item->value = zdate($orgValue, "Y-m-d");
             } else {
                 $item->value = nl2br($orgValue);
             }
         }
         $displayDatas[] = $item;
     }
     Context::set('displayDatas', $displayDatas);
     $oSecurity = new Security();
     $oSecurity->encodeHTML('displayDatas..title', 'displayDatas..description');
     return $displayDatas;
 }
?>
	<?php 
if ($__Context->member_srl) {
    ?>
<div class="x_control-group">
		<label class="x_control-label" for="until"><?php 
    echo $__Context->lang->limit_date;
    ?>
</label>
		<div class="x_controls">
			<input type="hidden" name="limit_date" id="date_limit_date" value="<?php 
    echo $__Context->member_info->limit_date;
    ?>
" />
			<input type="text" readonly placeholder="YYYY-MM-DD" class="inputDate" id="until" value="<?php 
    echo zdate($__Context->member_info->limit_date, 'Y-m-d', false);
    ?>
" />
			<input type="button" value="<?php 
    echo $__Context->lang->cmd_delete;
    ?>
" class="x_btn dateRemover" />
			<span class="x_help-inline"><?php 
    echo $__Context->lang->about_limit_date;
    ?>
</span>
		</div>
	</div><?php 
}
?>
	<div class="x_control-group">
					<?php 
        } else {
            ?>
					<a href="#popup_menu_area" class="member_<?php 
            echo $__Context->val->member_srl;
            ?>
"><?php 
            echo $__Context->val->nick_name;
            ?>
</a>
					<?php 
        }
        ?>
				</td>
				<td class="nowr"><?php 
        echo zdate($__Context->val->regdate, "Y-m-d H:i");
        ?>
</td>
				<td class="nowr"><a href="<?php 
        echo getUrl('search_target', 'ipaddress', 'search_keyword', $__Context->val->ipaddress);
        ?>
"><?php 
        echo $__Context->val->ipaddress;
        ?>
</a></td>
				<td class="nowr"><?php 
        if ($__Context->val->isvalid == 'Y') {
            echo $__Context->lang->is_valid;
        } else {
            echo $__Context->lang->is_stand_by;
        }
Exemple #30
0
 /**
  * Returns a form based on its type
  *
  * @return string Returns a form html.
  */
 function getFormHTML()
 {
     static $id_num = 1000;
     $type = $this->type;
     $name = $this->name;
     $value = $this->_getTypeValue($this->type, $this->value);
     $default = $this->_getTypeValue($this->type, $this->default);
     $column_name = 'extra_vars' . $this->idx;
     $tmp_id = $column_name . '-' . $id_num++;
     $buff = array();
     switch ($type) {
         // Homepage
         case 'homepage':
             $buff[] = '<input type="text" name="' . $column_name . '" value="' . $value . '" class="homepage" />';
             break;
             // Email Address
         // Email Address
         case 'email_address':
             $buff[] = '<input type="text" name="' . $column_name . '" value="' . $value . '" class="email_address" />';
             break;
             // Phone Number
         // Phone Number
         case 'tel':
             $buff[] = '<input type="text" name="' . $column_name . '[]" value="' . $value[0] . '" size="4" maxlength="4" class="tel" />';
             $buff[] = '<input type="text" name="' . $column_name . '[]" value="' . $value[1] . '" size="4" maxlength="4" class="tel" />';
             $buff[] = '<input type="text" name="' . $column_name . '[]" value="' . $value[2] . '" size="4" maxlength="4" class="tel" />';
             break;
             // textarea
         // textarea
         case 'textarea':
             $buff[] = '<textarea name="' . $column_name . '" rows="8" cols="42">' . $value . '</textarea>';
             break;
             // multiple choice
         // multiple choice
         case 'checkbox':
             $buff[] = '<ul>';
             foreach ($default as $v) {
                 $checked = '';
                 if ($value && in_array(trim($v), $value)) {
                     $checked = ' checked="checked"';
                 }
                 // Temporary ID for labeling
                 $tmp_id = $column_name . '-' . $id_num++;
                 $buff[] = '  <li><input type="checkbox" name="' . $column_name . '[]" id="' . $tmp_id . '" value="' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '" ' . $checked . ' /><label for="' . $tmp_id . '">' . $v . '</label></li>';
             }
             $buff[] = '</ul>';
             break;
             // single choice
         // single choice
         case 'select':
             $buff[] = '<select name="' . $column_name . '" class="select">';
             foreach ($default as $v) {
                 $selected = '';
                 if ($value && in_array(trim($v), $value)) {
                     $selected = ' selected="selected"';
                 }
                 $buff[] = '  <option value="' . $v . '" ' . $selected . '>' . $v . '</option>';
             }
             $buff[] = '</select>';
             break;
             // radio
         // radio
         case 'radio':
             $buff[] = '<ul>';
             foreach ($default as $v) {
                 $checked = '';
                 if ($value && in_array(trim($v), $value)) {
                     $checked = ' checked="checked"';
                 }
                 // Temporary ID for labeling
                 $tmp_id = $column_name . '-' . $id_num++;
                 $buff[] = '<li><input type="radio" name="' . $column_name . '" id="' . $tmp_id . '" ' . $checked . ' value="' . $v . '"  class="radio" /><label for="' . $tmp_id . '">' . $v . '</label></li>';
             }
             $buff[] = '</ul>';
             break;
             // date
         // date
         case 'date':
             // datepicker javascript plugin load
             Context::loadJavascriptPlugin('ui.datepicker');
             $buff[] = '<input type="hidden" name="' . $column_name . '" value="' . $value . '" />';
             $buff[] = '<input type="text" id="date_' . $column_name . '" value="' . zdate($value, 'Y-m-d') . '" class="date" />';
             $buff[] = '<input type="button" value="' . Context::getLang('cmd_delete') . '" class="btn" id="dateRemover_' . $column_name . '" />';
             $buff[] = '<script type="text/javascript">';
             $buff[] = '//<![CDATA[';
             $buff[] = '(function($){';
             $buff[] = '$(function(){';
             $buff[] = '  var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\'-100:+10\', onSelect:function(){';
             $buff[] = '    $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}';
             $buff[] = '  };';
             $buff[] = '  $.extend(option,$.datepicker.regional[\'' . Context::getLangType() . '\']);';
             $buff[] = '  $("#date_' . $column_name . '").datepicker(option);';
             $buff[] = '  $("#dateRemover_' . $column_name . '").click(function(){';
             $buff[] = '    $(this).siblings("input").val("");';
             $buff[] = '    return false;';
             $buff[] = '  })';
             $buff[] = '});';
             $buff[] = '})(jQuery);';
             $buff[] = '//]]>';
             $buff[] = '</script>';
             break;
             // address
         // address
         case "kr_zip":
             if (($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel, 'getKrzipCodeSearchHtml')) {
                 $buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value);
             }
             break;
             // General text
         // General text
         default:
             $buff[] = ' <input type="text" name="' . $column_name . '" value="' . ($value ? $value : $default) . '" class="text" />';
     }
     if ($this->desc) {
         $oModuleController = getController('module');
         $oModuleController->replaceDefinedLangCode($this->desc);
         $buff[] = '<p>' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '</p>';
     }
     return join(PHP_EOL, $buff);
 }