https://github.com/ForPeople/attendance/blob/master/attendance.model.php 참고하여,
/**
* @brief 총 출석횟수 계산
**/
function getTotalAttendance($member_srl){
$args->member_srl=$member_srl;
$output = executeQuery('attendance.getTotalAttendance', $args);
return (int)$output->data->total_count;
* @brief 총 출석횟수 계산
**/
function getTotalAttendance($member_srl){
$args->member_srl=$member_srl;
$output = executeQuery('attendance.getTotalAttendance', $args);
return (int)$output->data->total_count;
총 출석횟수 계산의 함수가 위의 값임을 확인 한 뒤 ' index.html ' 이라는 HTML 문서에 그 계산 값을 표기하기 위하여
최대한 여러 방법을 시도해봤으나 제대로 된 값이 나오질 않습니다. ;;
방법1.
맨 윗 상단.
{@
$TotalA=$oAttendanceModel->getTotalAttendance($member->member_srl)
}
정의 후, 원하는 위치에
{$TotalA}
방법2. 원하는 위치에
{$oAttendanceModel->getTotalAttendance($member->member_srl)}
방법3. 원하는 위치에
{$oAttendanceModel->getTotalAttendance($member_srl)}
등등.. 하여도 이상한 값만 뜨네요..;;;
제가 혼자 HTMl 등을 공부한데다가 php 나 함수까지 만지는건 처음이라 사실 뭐가 뭔지 모르겠습니다.
도움 부탁드립니다. 새벽에 신경 쓰여도 잠도 안오고 죽겠네요. ㅋㅋ
하나 매달리면 해결 방법 알 때 까지 못자는 성격이라.. ㅜㅜ 아래는 총 출석 일수를 출력하고 싶은 HTML 입니다.
<!--#include("_header.html")-->
<!--%import("js/at.js")-->
<!--%import("filter/insert_attendance.xml")-->
<!--%import("filter/fix_attendance_data.xml")-->
{@$year=substr($selected_date,0,4)}
{@$month=substr($selected_date,4,2)}
{@$day=substr($selected_date,6,2)}
{@$week=$oAttendanceModel->getWeek($selected_date)}
<script type="text/javascript">
var warn_msg = '{$lang->attend_warn}';
</script>
<div class="navi">
<!--@if($module_info->calendar != 'Y')-->
<a href="#" onclick="toggle_object('calendar'); return false;" >
<strong>{$year}년 {$month}월 {$day}일</strong></a>
<!--@else-->
<strong>{$year}년 {$month}월 {$day}일</strong>
<!--@end-->
<!--@if($logged_info->is_admin=='Y')-->
<span style="margin-left:20px;">
<!--@if($module_info->display_setup_button!="N" && ($logged_info->is_admin=="Y" || $grant->manager == 1) )-->
› <a href="{getUrl('module','','mid','attendance','document','','act','dispAttendanceAdminBoardConfig')}">{$lang->cmd_setup}</a>
<!--@end-->
<!--@if($logged_info->is_admin=='Y')-->
› <a href="{getUrl('module','admin','act','dispAdminAttendanceList','mid','')}" onclick="window.open(this.href);return false;" alt="{$lang->attendance_module}{$lang->cmd_management}" >{$lang->cmd_management}</a>
<!--@end-->
</span>
<!--@end-->
<!--@if($is_logged)-->
<span style="float:right; margin-right:10px; font-weight:none;">
<a href="{getUrl('document_srl','','selected_date',zDate(date('YmdHis',mktime(0,0,0,$month-1, $day, $year)),'Ymd'))}" >‹ 이전달</a> <a href="{getUrl('document_srl','','selected_date',zDate(date('YmdHis'),"Ymd"))}">↑ 이번달</a> <a href="{getUrl('document_srl','','selected_date',zDate(date('YmdHis',mktime(0,0,0,$month+1, $day, $year)),'Ymd'))}" >다음달 ›</a></span>
<!--@end-->
</div>
<!--@if($is_logged)-->
<!--@if($module_info->calendar != 'Y')-->
<div id="calendar" style="display:none">
<include target="calendar.html" />
</div>
<!--@else-->
<include target="calendar.html" />
<!--@end-->
<!--//도장버튼 노출-->
<div class="cal">
<!--@if(!$oAttendanceModel->getIsChecked($logged_info->member_srl) == 0 && $is_available == 0 )--><!--출석완료-->
출석이 완료되었습니다.<br/>
<font style="font-weight:normal">출석은 하루 1회만 참여하실 수 있습니다. 내일 다시 출석해 주세요.^^</font>
<!--@end-->
<!--//출석을 하지 않았고, 출석 가능한 시간대라면--><!--시작1-->
<!--@if($oAttendanceModel->getIsChecked($logged_info->member_srl) == 0 && $is_available == 0 )-->
<div class="at_header">
<!--@if($config->about_admin_check!='no')-->
<include target="att.html" />
<!--@else--><!--시작2-->
<!--@if($logged_info->is_admin != 'Y')-->
<include target="att.html" />
<!--@end-->
<div class="sat" style="margin:10px 1px" cond="$logged_info->is_admin == 'Y'">
<div class="alert alert-admin"><h4>{$lang->attend_banned_admin}</h4></div>
</div>
<!--@end-->
</div>
<!--@end-->
</div>
<!--@end-->
<!--//지금 출석하시면 받을 수 있는 포인트 목록-->
<div class="point_list_body">
<table width="100%" border="0" cellpadding="0" cellspacing="0" border="0" class="point_list">
<tr>
<td class="title">{$lang->attendance_add_point}</td>
<td><!--@if($config->add_point > 0)-->{$config->add_point}<!--@elseif($config->add_point == 0)--> {$lang->attend_none}<!--@end--></td>
<Td class="title">{$lang->attendance_yearly_point}</Td>
<td><!--@if($config->yearly_point > 0)-->{$config->yearly_point}<!--@elseif($config->yearly_point == 0)--> {$lang->attend_none}<!--@end--></Td>
<td class="title">{$lang->attendance_monthly_point}</td>
<td><!--@if($config->monthly_point > 0)-->{$config->monthly_point}<!--@elseif($config->monthly_point == 0)--> {$lang->attend_none}<!--@end--></td>
<td class="title">{$lang->attendance_weekly_point}</td>
<td><!--@if($config->weekly_point > 0)-->{$config->weekly_point}<!--@elseif($config->weekly_point == 0)--> {$lang->attend_none}<!--@end--></td>
</tr>
<tr>
<td class="title">{$lang->attendance_first_point}</td>
<td><!--@if($config->first_point > 0)-->{$config->first_point}<!--@elseif($config->first_point == 0)--> {$lang->attend_none}<!--@end--></td>
<td class="title">{$lang->attendance_second_point}</td>
<td><!--@if($config->second_point > 0)-->{$config->second_point}<!--@elseif($config->second_point == 0)--> {$lang->attend_none}<!--@end--></td>
<td class="title">{$lang->attendance_third_point}</td>
<td><!--@if($config->third_point > 0)-->{$config->third_point}<!--@elseif($config->third_point == 0)--> {$lang->attend_none}<!--@end--></td>
<td class="title">{$lang->attendance_perfect} {$lang->category}</td>
<td><span class="per">※여기에 총 출석 일수를 출력하고 싶습니다.</span> <span class="perm">{$lang->monthly_perfect}</span> <span class="pery">{$lang->yearly_perfect}</span></td>
</tr>
</table>
</div>
<!--끝-->
<!--회원 목록 보여주는 거야. -->
<include target="board.html" />
</div>
<!--%import("js/at.js")-->
<!--%import("filter/insert_attendance.xml")-->
<!--%import("filter/fix_attendance_data.xml")-->
{@$year=substr($selected_date,0,4)}
{@$month=substr($selected_date,4,2)}
{@$day=substr($selected_date,6,2)}
{@$week=$oAttendanceModel->getWeek($selected_date)}
<script type="text/javascript">
var warn_msg = '{$lang->attend_warn}';
</script>
<div class="navi">
<!--@if($module_info->calendar != 'Y')-->
<a href="#" onclick="toggle_object('calendar'); return false;" >
<strong>{$year}년 {$month}월 {$day}일</strong></a>
<!--@else-->
<strong>{$year}년 {$month}월 {$day}일</strong>
<!--@end-->
<!--@if($logged_info->is_admin=='Y')-->
<span style="margin-left:20px;">
<!--@if($module_info->display_setup_button!="N" && ($logged_info->is_admin=="Y" || $grant->manager == 1) )-->
› <a href="{getUrl('module','','mid','attendance','document','','act','dispAttendanceAdminBoardConfig')}">{$lang->cmd_setup}</a>
<!--@end-->
<!--@if($logged_info->is_admin=='Y')-->
› <a href="{getUrl('module','admin','act','dispAdminAttendanceList','mid','')}" onclick="window.open(this.href);return false;" alt="{$lang->attendance_module}{$lang->cmd_management}" >{$lang->cmd_management}</a>
<!--@end-->
</span>
<!--@end-->
<!--@if($is_logged)-->
<span style="float:right; margin-right:10px; font-weight:none;">
<a href="{getUrl('document_srl','','selected_date',zDate(date('YmdHis',mktime(0,0,0,$month-1, $day, $year)),'Ymd'))}" >‹ 이전달</a> <a href="{getUrl('document_srl','','selected_date',zDate(date('YmdHis'),"Ymd"))}">↑ 이번달</a> <a href="{getUrl('document_srl','','selected_date',zDate(date('YmdHis',mktime(0,0,0,$month+1, $day, $year)),'Ymd'))}" >다음달 ›</a></span>
<!--@end-->
</div>
<!--@if($is_logged)-->
<!--@if($module_info->calendar != 'Y')-->
<div id="calendar" style="display:none">
<include target="calendar.html" />
</div>
<!--@else-->
<include target="calendar.html" />
<!--@end-->
<!--//도장버튼 노출-->
<div class="cal">
<!--@if(!$oAttendanceModel->getIsChecked($logged_info->member_srl) == 0 && $is_available == 0 )--><!--출석완료-->
출석이 완료되었습니다.<br/>
<font style="font-weight:normal">출석은 하루 1회만 참여하실 수 있습니다. 내일 다시 출석해 주세요.^^</font>
<!--@end-->
<!--//출석을 하지 않았고, 출석 가능한 시간대라면--><!--시작1-->
<!--@if($oAttendanceModel->getIsChecked($logged_info->member_srl) == 0 && $is_available == 0 )-->
<div class="at_header">
<!--@if($config->about_admin_check!='no')-->
<include target="att.html" />
<!--@else--><!--시작2-->
<!--@if($logged_info->is_admin != 'Y')-->
<include target="att.html" />
<!--@end-->
<div class="sat" style="margin:10px 1px" cond="$logged_info->is_admin == 'Y'">
<div class="alert alert-admin"><h4>{$lang->attend_banned_admin}</h4></div>
</div>
<!--@end-->
</div>
<!--@end-->
</div>
<!--@end-->
<!--//지금 출석하시면 받을 수 있는 포인트 목록-->
<div class="point_list_body">
<table width="100%" border="0" cellpadding="0" cellspacing="0" border="0" class="point_list">
<tr>
<td class="title">{$lang->attendance_add_point}</td>
<td><!--@if($config->add_point > 0)-->{$config->add_point}<!--@elseif($config->add_point == 0)--> {$lang->attend_none}<!--@end--></td>
<Td class="title">{$lang->attendance_yearly_point}</Td>
<td><!--@if($config->yearly_point > 0)-->{$config->yearly_point}<!--@elseif($config->yearly_point == 0)--> {$lang->attend_none}<!--@end--></Td>
<td class="title">{$lang->attendance_monthly_point}</td>
<td><!--@if($config->monthly_point > 0)-->{$config->monthly_point}<!--@elseif($config->monthly_point == 0)--> {$lang->attend_none}<!--@end--></td>
<td class="title">{$lang->attendance_weekly_point}</td>
<td><!--@if($config->weekly_point > 0)-->{$config->weekly_point}<!--@elseif($config->weekly_point == 0)--> {$lang->attend_none}<!--@end--></td>
</tr>
<tr>
<td class="title">{$lang->attendance_first_point}</td>
<td><!--@if($config->first_point > 0)-->{$config->first_point}<!--@elseif($config->first_point == 0)--> {$lang->attend_none}<!--@end--></td>
<td class="title">{$lang->attendance_second_point}</td>
<td><!--@if($config->second_point > 0)-->{$config->second_point}<!--@elseif($config->second_point == 0)--> {$lang->attend_none}<!--@end--></td>
<td class="title">{$lang->attendance_third_point}</td>
<td><!--@if($config->third_point > 0)-->{$config->third_point}<!--@elseif($config->third_point == 0)--> {$lang->attend_none}<!--@end--></td>
<td class="title">{$lang->attendance_perfect} {$lang->category}</td>
<td><span class="per">※여기에 총 출석 일수를 출력하고 싶습니다.</span> <span class="perm">{$lang->monthly_perfect}</span> <span class="pery">{$lang->yearly_perfect}</span></td>
</tr>
</table>
</div>
<!--끝-->
<!--회원 목록 보여주는 거야. -->
<include target="board.html" />
</div>
댓글 2
이거 답변 선택같은건..없나요?? 아 어째든 감사합니다..ㅠㅠ