출석부 소스 수정부탁드립니다. > 자유 게시판

본문 바로가기

뒤로가기 자유 게시판

출석부 소스 수정부탁드립니다.

페이지 정보

작성자 선장쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 339회 작성일 15-04-11 20:25

본문

100일 개근하면 1000점
200일 개근하면 2000점
300일 개근하면 3000점
400일 개근하면 4000점

이렇게 하려고 하는데 소스수정이 힘드네요
php 소스 수정하실수 있으신 분 도와 주시기 바랍니다

현제는 일일이 직접 포인트를 주고 있는데요 도와주시기 바랍니다.


<?
include_once("./attendance_config.php");

// 비회원
if (!$is_member) {

alert("로그인 후 이용하세요.");

}


// 출석 시간 체크
if (date("H:i:s") < $att['start_time'] || date("H:i:s") > $att['end_time']) {

alert("출석 시간이 아닙니다.");

}


// 오늘 출석했나?
$sql = " select * from $p4[attendance_table] where mb_id = '$member[mb_id]' and substring(datetime,1,10) = '$g4[time_ymd]' ";
$check = sql_fetch($sql);

// 출석했다면.
if ($check['mb_id']) {

alert("이미 출석 하였습니다.");

}


// 1일 뺀다.
$day = date("Y-m-d", $g4['server_time'] - (1 * 86400));

// 어제 출석했나?
$sql = " select * from $p4[attendance_table] where mb_id = '$member[mb_id]' and substring(datetime,1,10) = '$day' ";
$row = sql_fetch($sql);


// 어제 출석했다면.
if ($row['mb_id']) {

// 전체 개근에 오늘 합산.
$sql_day = $row['day'] + 1;

// 지난 개근체크에 오늘 합산.
$reset = $row['reset'] + 1;

// 개근 체크
if ($reset == $att['day']) {

// 개근 초기화
$sql_reset = "0";

// 개근시 포인트
$sql_point = $att['day_point'];

} else {

// 개근 누적
$sql_reset = $reset;

// 일일 포인트
$sql_point = $att['today_point'];

}


} else {
// 출석하지 않았다면.

// 전체 개근 설정
$sql_day = "1";

// 개근 1일 설정
$sql_reset = "1";

// 일일 포인트
$sql_point = $att['today_point'];

}

/*
// 첫출근
$sql = " select count(*) as cnt from $p4[attendance_table] where substring(datetime,1,10) = '$g4[time_ymd]' ";
$first = sql_fetch($sql);

// 아무도 없다면..
if (!$first['cnt']) {

// 1등 포인트
$sql_point = $att['first_point'];

}
*/

// 기록
$sql = " insert into $p4[attendance_table]
set mb_id = '$member[mb_id]',
subject = '".$_POST['subject']."',
day = '$sql_day',
reset = '$sql_reset',
point = '$sql_point',
datetime = '$g4[time_ymdhis]' ";
sql_query($sql);

// 출석 포인트 지급
insert_point($member['mb_id'], (int)($sql_point * 1), "출석체크 추가 포인트", "@attendance", $member['mb_id'], $g4['time_ymd']);

// 완료
alert("출석체크완료", "./attendance.php");
?>


\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


<?
$g4_path = "..";
include_once("$g4_path/common.php");


// 상수 선언
$p4['table_prefix'] = "p4_"; // 테이블명 접두사
$p4['attendance_table'] = $p4['table_prefix'] . "attendance"; // 출석부 테이블


/*------------------------------------------
환경설정 START
------------------------------------------*/

// 출석시작 시간
$att['start_time'] = "00:05:00"; // 시:분:초


// 출석종료 시간
$att['end_time'] = "23:55:00"; // 시:분:초


// 365개근
//$att['year'] = "365"; // 지정한 날짜마다

// 개근시 포인트
//$att['year_point'] = "30";

// 개근
$att['day'] = "4"; // 지정한 날짜마다


// 개근시 포인트
$att['day_point'] = "300";

// 개근시 포인트
$att['day_point_100'] = "1000";

// 개근시 포인트
$att['day_point_200'] = "2000";

// 개근시 포인트
$att['day_point_300'] = "3000";

// 개근시 포인트
$att['day_point_400'] = "4000";

// 개근시 포인트
$att['day_point_500'] = "5000";

// 개근시 포인트
$att['day_point_600'] = "6000";

// 개근시 포인트
$att['day_point_700'] = "7000";

// 개근시 포인트
$att['day_point_800'] = "8000";

// 개근시 포인트
$att['day_point_900'] = "9000";

// 개근시 포인트
$att['day_point_1000'] = "10000";

// 일일 출석 포인트
$att['today_point'] = "80";


// 1등 포인트
$att['first_point'] = "100";


// 출석부 조회 일
$att['check_day'] = "7"; // 몇일까지 출석부 조회 가능한가?

/*------------------------------------------
환경설정 END
------------------------------------------*/
?>
추천0 비추천0

댓글목록

등록된 댓글이 없습니다.

Total 356건 5 페이지
게시물 검색
Copyright © www.sunjang.com. All rights reserved.
PC 버전으로 보기