Skip to content

출석시 과거 특정날짜 자동출석 인정하는 방법

점검 또는 기타사정으로 인해 사이트접속이 원활하지 않은날
회원들에게 출석인정을 해줘야 하는 상황이 발생합니다.

아래는 특정날짜 출석을 위한 정규식입니다.

([^\/]*\/([^\|]*\|){8}\d{26})\d{1}(.*)

2011년 8월 27일의 출석을 인정하고 싶다면, 빨간색 숫자자리에 8(월)과 26(날짜-1)이 들어가면 됩니다.
일(day)은 -1해줘야합니다. 

이 정규식을 활용해 실제 적용할때는 아래 예를 참고하세요.

2011년 8월28일~9월3일까지 하루라도 출석을 한다면 8월27일의 출석을 인정하려고 할때,
../jy.plugin/attend/write.php 62줄 부근에 아래의 소스를 추가하시면 됩니다.

// 오늘 출석
$add_str .= 1;

// 이벤트
$event_term = str_replace("-", "", $g4[time_ymd]);
if($event_term >= 20110828 || $event_term <= 20110903) {
    $add_str = preg_replace("/([^\/]*\/([^\|]*\|){8}\d{26})\d{1}(.*)/", "\${1}1\${3}", $add_str);
}

// 개근날짜
$not_absent_count = get_not_absent($add_str);
$total_attend = get_sum_attend($add_str);
profile

I see no changes, wake up in the morning and I ask myself

Is life worth living should I blast myself

Things would never be the same.

엮인글 :
http://adminplay.com/80350/abe/trackback
List of Articles
번호 제목 글쓴이 날짜 조회 수sort

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234