출석체크 에서요 7일 마다 점수 28일 마다 점수를 주려고 하는데 정보
출석체크 에서요 7일 마다 점수 28일 마다 점수를 주려고 하는데본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : /plugin/attendance/attendance.php
이거 배추빌더 제작자가 만드신 건가요?
암튼 흔하게 쓰여지는 출석체크. 인사말 쓰고 출석 확인하고 포인트 주는거.
7일마다 포인트 주는건 되는데.
28일 주기 혹은 30일 주기
이걸로 포인트를 주고 싶은데 설정을 못하겠네요.
_common.php
<?
$g4_path = "../..";
include_once("$g4_path/common.php");
// 상수 선언
$p4['table_prefix'] = "p4_"; // 테이블명 접두사
$p4['attendance_table'] = $p4['table_prefix'] . "attendance"; // 출석부 테이블
/*------------------------------------------
환경설정 START
------------------------------------------*/
// 출석시작 시간
$att['start_time'] = "09:35:00"; // 시:분:초
// 출석종료 시간
$att['end_time'] = "23:59:59"; // 시:분:초
// 개근
$att['day'] = "7"; // 지정한 날짜마다
// 개근
$att['day2'] = "28"; // 지정한 날짜마다
// 개근시 포인트
$att['day_point'] = "500";
// 장기 개근시 포인트
$att['day_point2'] = "1000";
// 일일 출석 포인트
$att['today_point'] = "100";
// 1등 포인트
$att['first_point'] = "500";
// 출석부 조회 일
$att['check_day'] = "7"; // 몇일까지 출석부 조회 가능한가?
/*------------------------------------------
환경설정 END
------------------------------------------*/
?>
attendance.php
<?
include_once("./_common.php");
$g4['title'] = "출석부";
include_once("$g4[path]/head.sub.php");
include_once("./head.php");
$colspan = "13";
echo "<script language=\"javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";
/*---------------------------------
## 달력 ##
---------------------------------*/
$datetime = $d;
if (!$datetime) {
$datetime = $g4['time_ymd'];
}
// 현재 시각 지정.
//$datetime = "2008-12-01";
//$datetime = $g4['time_ymd'];
// 현재 시각에서 월을 구한다.
$dateT1 = date("Y-m", strtotime($datetime));
// 현재 월의 1일의 요일 값을 구한다.
$dateT2 = date("w", strtotime($dateT1."-01"));
// 현재 월의 1일에서 요일 값을 뺀다.
$dateT3 = date("Y-m-d", strtotime($dateT1."-01") - (86400 * $dateT2));
// 현재 월의 1일에서 31일을 더한다.
$dateN1 = date("Y-m-d", strtotime($dateT1."-01") + (86400 * 31));
// 다음 달의 월을 구한다.
$dateN2 = date("Y-m", strtotime($dateN1));
// 다음 달 1일을 구한다.
$dateN3 = date("Y-m-d", strtotime($dateN2."-01"));
// 다음 달 1일에서 1일을 뺀다. 그럼 이번 달 마지막일
$dateN4 = date("d", strtotime($dateN3) - (86400 * 1));
// 6 뺀다. 현재 달 마지막 일 요일을 구해서.
$dateN5 = 6 - date("w", strtotime($dateT1."-".$dateN4));
// 현재 월의 1일에서 1일을 뺀다.
$dateP1 = date("Y-m-d", strtotime($dateT1."-01") - (86400 * 1));
/*---------------------------------
## 리스트 ##
---------------------------------*/
// 날짜가 있다면.
if ($d) {
$sql_common = "substring(datetime,1,10) = '$datetime'";
} else {
// 오늘
$sql_common = "substring(datetime,1,10) = '$g4[time_ymd]'";
}
?>
<style type="text/css">
ul, li {list-style:none outside;}
A {text-decoration:none;}
/* date */
#date_layer {text-align:left;;}
#date_layer #box {width:120px;}
#date_layer #box .top {width:20px; float:left;}
#date_layer #box .day {width:80px; float:left;}
#date_layer .w {font-weight:bold; line-height:20px; color:#333333; font-size:15px; font-family:굴림,돋움;}
#date_layer .title {color:#565656; font-size:12px; font-family:굴림,돋움; padding:0 0 0 1px;}
#date_layer .sun1 {color:#ff0000; font-size:12px; font-family:굴림,돋움;}
#date_layer .sat1 {color:#0000ff; font-size:12px; font-family:굴림,돋움;}
#date_layer .day1 {color:#333333; font-size:12px; font-family:굴림,돋움;}
#date_layer .sun2 {font-weight:bold; line-height:20px; color:#ff0000; font-size:15px; font-family:굴림,돋움;}
#date_layer .sat2 {font-weight:bold; line-height:20px; color:#0000ff; font-size:15px; font-family:굴림,돋움;}
#date_layer .day2 {font-weight:bold; line-height:20px; color:#333333; font-size:15px; font-family:굴림,돋움;}
#date_layer .sun3 {color:#ffbebe; font-size:11px; font-family:굴림,돋움;}
#date_layer .sat3 {color:#b8b8ff; font-size:11px; font-family:굴림,돋움;}
#date_layer .day3 {color:#999999; font-size:11px; font-family:굴림,돋움;}
#date_layer .dot {color:#000000; font-size:12px; font-family:굴림,돋움;}
#date_layer .check {color:#126420; font-size:11px; font-family:굴림,돋움;}
#date_layer .check2 {color:#999999; font-size:11px; font-family:굴림,돋움;}
/* list */
#list_layer .input {width:300px; height:21px; background-color:#f3f3f3; border:0px; padding:5px 2px 2px 2px; font-weight:bold; color:#333333; font-family:굴림,돋움; font-size:13px;}
#list_layer .msg {padding:5px 0 0 3px; float:left;}
#list_layer .sub {float:left;}
#list_layer .submit {padding:3px 0 0 5px; float:left;}
#list_layer #info li {line-height:18px; color:#898989; font-family:굴림,돋움; font-size:11px;}
#list_layer .title {font-weight:bold; color:#333333; font-family:굴림,돋움; font-size:12px;}
#list_layer .list {line-height:20px; color:#898989; font-family:굴림,돋움; font-size:11px;}
#list_layer .no {line-height:25px; font-size:12px; color:#898989;}
#list_layer .bgcolor0 {background-color:#ffffff;}
#list_layer .bgcolor1 {background-color:#f1f1f1;}
#list_layer .bgcolor2 {background-color:#ffffff;}
.style1 {color: #000000}
.style2 {
font-size: 14px;
font-weight: bold;
color: #FF0000;
}
.style4 {font-size: 14px; font-weight: bold; color: #0000FF; }
</style>
<div id="BoardText">
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td width="6" valign="top"></td>
<td width="961" valign="top">
<!-- LEFT start //-->
<div id="list_layer">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr height="30">
<td colspan="4"><b>교민생활에 힘이되는 인삿말 한 마디와 함께, 출석체크하고 받아가는 이벤트 뽀나스 100 포인트!!</b></td>
</tr>
<tr>
<td colspan="4" valign="middle" style="height:32px; border:0px solid #cccccc;">
<form name="fattendance" method="post" action="javascript:fattendance_submit(document.fattendance);" style="margin:0px;">
<div id="title">
<li class="msg">출석 한마디 : </li>
<li class="sub"><input type="text" id="subject" name="subject" class="input" value="뽀대나는 한 마디를 입력해 주세요" onmouseover="if(!this.value || this.value == '뽀대나는 한 마디를 입력해 주세요.')this.value='';" ></li>
<li class="submit"><input type="image" src="./img/btn_ok.gif" border="0"></li>
</div>
</form>
<script type="text/javascript">
function fattendance_submit(f)
{
var ChkSubject = document.getElementById("subject").value;
if (!ChkSubject || ChkSubject == '한마디를 입력해 주세요.') {
alert("한마디를 입력하세요.");
return;
}
f.action = "./update.php";
f.submit();
}
</script> </td>
</tr>
<tr><td height="10" colspan="4"></td></tr>
<tr>
<td height="50" colspan="3">
<table width="263%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="1"></td>
<td width="52"><img src="./img/image.gif" align="absmiddle"></td>
<td width="1"></td>
<td width="712">부지런한 꿀벌이 근심할 겨를도 없이 포인트 왕창 긁어 모은다!!
<div id="info">
<li class="style1">→ 출석시간 :
<?=date("a h시 i분 s초", strtotime($att['start_time']))?>
~
<?=date("a h시 i분 s초", strtotime($att['end_time']))?>
</li>
<li class="style1">→ 출석포인트 :
<?=number_format($att['today_point'])?>
점 (개근상 :
<?=$att['day']?>
일 마다
<?=number_format($att['day_point'])?>
점)
<?=$att['day2']?>
일 마다
<?=number_format($att['day_point2'])?>
점)</li>
<li class="style1">→ 1등 포인트 :
<?=number_format($att['first_point'])?>
점</li>
</div></td>
<td width="10"> </td>
</tr>
</table></td>
<td width="19%" rowspan="3" valign="bottom"><img src="img/chock.gif" width="139" height="75" align="right" /></td>
</tr>
<tr><td height="10" colspan="3"></td>
</tr>
<tr>
<td width="19%" height="40" valign="bottom"><span style="font-family:굴림,돋움; font-size:12px; color:#898989;">[<?=$datetime?>]</span></td>
<td width="3%" valign="bottom"><span style="font-family:굴림,돋움; font-size:12px; color:#898989;"><img src="img/pig.jpg" width="30" height="31" /></span></td>
<td width="59%" valign="middle"><span style="font-family:굴림,돋움; font-size:12px; color:#898989;">
<?=mw_latest_rand("mw.index.scroll", "04_05", 5, 124, 5, $mw[config][cf_index_cache])?>
</span></td>
</tr>
<tr><td height="5" colspan="4"></td></tr>
<tr>
<td colspan="4">
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" valign="top">
<tr><td colspan="<?=$colspan?>" height="3" bgcolor="#F2F2F2"></td></tr>
<tr><td colspan="<?=$colspan?>" height="1" bgcolor="#D9D9D9"></td></tr>
<tr height="30">
<td width="50" align="center" class="title">등수</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td width="72" align="center" class="title">출석시간</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td width="90" align="center" class="title">닉네임</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td align="center" class="title">한마디</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td width="45" align="center" class="title">접속중</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td width="45" align="center" class="title">포인트</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td width="45" align="center" class="title">개근</td>
</tr>
<tr><td colspan="<?=$colspan?>" height="1" bgcolor="#D9D9D9"></td></tr>
<tr><td colspan="<?=$colspan?>" height="3" bgcolor="#F2F2F2"></td></tr>
<?
// 출석 테이블 연결
$sql = " select * from $p4[attendance_table] where $sql_common order by datetime asc, day desc ";
$result = sql_query($sql);
for ($i=0; $data=sql_fetch_array($result); $i++) {
// 접속자테이블 연결
$sql = " select mb_id from $g4[login_table] where mb_id = '$data[mb_id]' ";
$ing = sql_fetch($sql);
// 접속상태
if ($ing['mb_id']) {
$on = "접속중";
} else {
$on = "";
}
// 회원 테이블 연결
$check = get_member($data['mb_id']);
// 닉네임
$name = get_sideview($check['mb_id'], $check['mb_nick'], $check['mb_email'], $check['mb_homepage']);
// 랭킹
$rank = $i + 1;
/*
// 색상
if ($member['mb_id'] == $data['mb_id']) {
$list = "2";
} else {
$list = ($i%2);
}
*/
$list = ($i%2);
?>
<tr height="30">
<td align="center" class="bgcolor<?=$list?> list"><?=$rank?> 등</td>
<td></td>
<td align="center" class="bgcolor<?=$list?> list"><?=date("a h:i:s", strtotime($data['datetime']))?><?//=substr($data['datetime'],10,16);?></td>
<td></td>
<td align="center" class="bgcolor<?=$list?> list"><?=$name?></td>
<td></td>
<td style="padding:0 0 0 20px;" class="bgcolor<?=$list?> list"><?=get_text($data['subject'])?></td>
<td></td>
<td align="center" class="bgcolor<?=$list?> list"><?=$on?></td>
<td></td>
<td align="right" style="padding:0 5 0 0px;" class="bgcolor<?=$list?> list"><?=number_format($data['point']);?> 점</td>
<td></td>
<td align="center" class="bgcolor<?=$list?> list"><?=$data['day']?> 일째</td>
</tr>
<tr><td bgcolor="#EEEEEE" colspan="<?=$colspan?>" height="1"></td></tr>
<? } ?>
<? if (!$i) { ?>
<tr><td height="100" colspan="<?=$colspan?>" align="center"><span class="no">출석한 사람이 없습니다.<br>출석시간 : <?=date("a h시 i분 s초", strtotime($att['start_time']))?> ~ <?=date("a h시 i분 s초", strtotime($att['end_time']))?></span></td></tr>
<tr><td colspan="<?=$colspan?>" height="1" bgcolor="#eeeeee"></td></tr>
<? } ?>
</table></td>
</tr>
</table>
</div>
<!-- LEFT end //--></td>
<td width="14"></td>
<td width="243" valign="top"><!-- left start //-->
<div id="date_layer">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top:10px; border:1px solid #e4e4e4;">
<tr height="30">
<td colspan="7" align="center"><div id="box">
<li class="top"><a href="?d=<?=$dateP1?>&mode=<?=$mode?>" class="dot">◀</a></li>
<li class="day"><span class="w">
<?=$dateT1?>
</span></li>
<li class="top"><a href="?d=<?=$dateN3?>&mode=<?=$mode?>" class="dot">▶</a></li>
</div></td>
</tr>
<tr>
<td colspan="7" height="1" bgcolor="#e4e4e4"></td>
</tr>
<tr height='30'>
<td width="55" align="center" class="title">일</td>
<td width="55" align="center" class="title">월</td>
<td width="55" align="center" class="title">화</td>
<td width="55" align="center" class="title">수</td>
<td width="55" align="center" class="title">목</td>
<td width="55" align="center" class="title">금</td>
<td width="55" align="center" class="title">토</td>
</tr>
<tr height='55'>
<?
// 7셀만 출력. 다음 셀로 자동 변경.
$mod = "7";
// 돌리고 돌리고~ 마지막 일에서 이번 달 1일의 요일 값 만큼 더한다.
for ($i=0; $i<($dateN4 + $dateT2 + $dateN5); $i++) {
// 6일 뺀 날짜부터 돌린다.
$dateT4 = date("Y-m-d", strtotime($dateT3) + (86400 * $i));
// 해당 날짜의 요일을 구한다.
$dateT5 = date("w", strtotime($dateT3) + (86400 * $i));
if ($i && $i%$mod == '0') {
echo "</tr>\n<tr height='55'>\n";
}
// 일요일 제외
if ($dateT5 != '0') {
$dateLine = "border-left:1px solid #e4e4e4;";
} else {
$dateLine = "";
}
echo "<td align='center' style='" . $dateLine . " border-top:1px solid #e4e4e4;'>";
// 현재 월과 돌린 월이 일치할 때만.
if ($dateT1 == substr($dateT4,0,7)) {
// 찍은 날짜면
if ($datetime == $dateT4) {
// 0은 일요일.
if ($dateT5 == '0') {
// 빨강색
$dateClassName = "sun2";
}
// 6은 토요일
else if ($dateT5 == '6') {
// 파랑색
$dateClassName = "sat2";
} else {
// 기타
$dateClassName = "day2";
}
}
// 오늘 날짜면
else if ($g4['time_ymd'] == $dateT4) {
// 0은 일요일.
if ($dateT5 == '0') {
// 빨강색
$dateClassName = "sun2";
}
// 6은 토요일
else if ($dateT5 == '6') {
// 파랑색
$dateClassName = "sat2";
} else {
// 기타
$dateClassName = "day2";
}
} else {
// 0은 일요일.
if ($dateT5 == '0') {
// 빨강색
$dateClassName = "sun1";
}
// 6은 토요일
else if ($dateT5 == '6') {
// 파랑색
$dateClassName = "sat1";
} else {
// 기타
$dateClassName = "day1";
}
}
echo "<div style='height:20px;'>";
echo "<a href=\"javascript:dateGo('".$dateT4."')\">";
echo "<span class='" . $dateClassName . "'>";
echo substr($dateT4,8,2);
echo "</span>";
echo "</a>";
echo "</div>";
// 출석했나?
$sql = " select id from $p4[attendance_table] where mb_id = '$member[mb_id]' and substring(datetime,1,10) = '$dateT4' ";
$check = sql_fetch($sql);
// 출석
if ($check['id']) {
echo "<div style='margin-top:3px;'>";
echo "<span class='check'>[O]</apan>";
echo "</div>";
} else {
echo "<div style='margin-top:3px;'>";
echo "<span class='check2'>[X]</apan>";
echo "</div>";
}
} else {
// 다른 달
// 0은 일요일.
if ($dateT5 == '0') {
// 빨강색
$dateClassName = "sun3";
}
// 6은 토요일
else if ($dateT5 == '6') {
// 파랑색
$dateClassName = "sat3";
} else {
// 기타
$dateClassName = "day3";
}
//echo "<a href=\"javascript:dateGo('".substr($dateT4,5,5)."')\">";
echo "<span class='" . $dateClassName . "'>";
echo substr($dateT4,5,5);
echo "</span>";
//echo "</a>";
}
echo "</td>\n";
}
// 나머지 셀을 채운다.
$cnt = $i%$mod;
if ($cnt) {
for ($i=$cnt; $i<$mod; $i++) {
echo "<td> </td>\n";
}
}
?>
</tr>
</table>
</div>
<script type="text/javascript">
function dateGo(day)
{
document.location.href = "?d="+day;
}
</script>
<!-- left end //-->
</td>
</tr>
</table>
</div>
<br>
<!-- 추가로 포인트 더 얻기 게임 -->
<?
include_once("./_common.php");
include_once("$g4[path]/_head.php");
$game_point = 10; // 게임포인트 설정
$game_besu1 = 100; // 퍼펙트 게임포인트 배수 설정
$game_besu2 = 40; // ±1 게임포인트 배수 설정
$game_besu3 = 30; // ±3 게임포인트 배수 설정
$game_range1 = 1; // ±1 게임 점수 설정
$game_range2 = 3; // ±3 게임 점수 설정
$game_minus = 30; // ±30 게임 감점점수 설정
// 게임 평균
function mb_average($mb_id,$agelevel)
{
global $g4;
$sql = "select count(po_id) as cnt from $g4[point_table] where mb_id='$mb_id' and po_rel_table = '@attendances' and SUBSTRING(po_rel_action,1,1) = '$agelevel' ";
$row = sql_fetch($sql);
$game_average = $row[cnt];
return $game_average;
}
//로그인 테이블기준 로그인 여부 체크
function mb_loginchk($mb_id)
{
global $g4;
if ($mb_id) {
$sql = "select mb_id from $g4[login_table] where mb_id='$mb_id'";
$mb = sql_fetch($sql);
if($mb[mb_id])
$message = "접속중";
else
$message = "";
return $message;
}
}
//게임점수
function mb_gamechk($mb_id)
{
global $g4;
$tmp = array();
if ($mb_id) {
$sql = "select po_point, SUBSTRING(po_rel_action,1,1) as agelevel from $g4[point_table] where mb_id='$mb_id' and SUBSTRING(po_datetime,1,10) = '$g4[time_ymd]' and po_rel_table = '@attendances' ";
$po = sql_fetch($sql);
if($po[po_point])
$tmp[point] = "$po[po_point]";
else
$tmp[point] = "";
if($po[agelevel])
$tmp[agelevel] = "$po[agelevel]";
else
$tmp[agelevel] = "";
return $tmp;
}
}
// 총 인원 수
$sql = " select count(*) as cnt from $g4[member_table] where mb_today_login like '$g4[time_ymd]%' and mb_id != '$config[cf_admin]' order by mb_today_login";
$cnt = sql_fetch($sql);
$total_count = $cnt[cnt];
$rows = 14;
$total_page = ceil($total_count / $rows);
if ($page == "") { $page = 1; }
$from_record = ($page - 1) * $rows;
// 총인원수를 구한다음
$sql = " select mb_id, mb_name, mb_nick, mb_level, mb_email, mb_homepage, mb_today_login, mb_point from $g4[member_table] where SUBSTRING(mb_today_login,1,10) = '$g4[time_ymd]' and mb_level < '10' order by mb_today_login DESC
limit $from_record, $rows";
$page = get_paging($config[cf_write_pages], $page, $total_page, "?$qstr&page=");
?>
<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>
<script LANGUAGE="JavaScript">
function Title() {document.title="STOP ON 1o0 By Nolan Gendron"; window.setTimeout("Title1();",1);}
function Title1() {document.title="STOP ON 10o By Nolan Gendron"; window.setTimeout("Title();",1);}
counter=0;
function Counter1() {
window.status="Counter: " + counter;
document.game.number.value=counter;
counter++;
Time=window.setTimeout("Counter1();",1);
if (counter==201) {
counter=0;
}
}
function Results() {
window.clearTimeout(Time);
document.game.number.value=counter;
document.game.submit();
}
</script>
<style type="text/css">
<!--
#attendance_font td{
color: #FFFFFF;
}
.tt1 { font-family: verdana,돋음; font-size: 11px; color: #555555; line-height: 170%; }
.test11 { background-color:#222222; border:0px; }
-->
</style>
<table align=center cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height=30 align=right valign=bottom><span class="style2">왕왕</span>!!! <span class="style4">뽀놔수</span>!!! 100점에 정확히 맞추면 또 추가 포인트 <span class="style2">1000</span>점을 드립니다!! 도전해 보세요!! 오늘게임참여Total <strong><?=$cnt[cnt]?></strong> 명 </td>
</tr>
<tr>
<td height=5 align=right valign=bottom></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="<?=$g4[path]?>/img/att_base.png" class="tt1">
<tr>
<td width="281" height="170"></td>
<td width="565">
<span class="tt1"><br>
Start 클릭하고 숫자가 100이 되는 순간 Stop 클릭!<br>
[1] 100점에 정확히 맞힐 경우 : <?=number_format($game_point * $game_besu1);?>포인트<br>
[2] ±1점에 맞힐 경우 : <?=number_format($game_point * $game_besu2);?>포인트<br>
[3] ±3점에 맞힐 경우 : <?=number_format($game_point * $game_besu3);?>포인트<br>
(감점 : ±30점 초과해 맞힐 경우 : -<?=number_format($game_point * $game_besu3);?>포인트)</span></td>
<td width="168" valign="top">
<form name="game" action="attendances_update.php" method="post">
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="15"></td>
</tr>
<tr>
<td align="center" height="75">
<input type="hidden" name="point" VALUE="<?=$game_point;?>">
<input type="hidden" name="besu1" VALUE="<?=$game_besu1;?>">
<input type="hidden" name="besu2" VALUE="<?=$game_besu2;?>">
<input type="hidden" name="besu3" VALUE="<?=$game_besu3;?>">
<input type="hidden" name="range1" VALUE="<?=$game_range1;?>">
<input type="hidden" name="range2" VALUE="<?=$game_range2;?>">
<input type="hidden" name="minus" VALUE="<?=$game_minus;?>">
<input class="test11" type="text" name="number" VALUE="0" onFocus="this.blur();" style="font-size: 45;font-family:arial black;width:100;color:white">
</td>
</tr>
<tr>
<td height="30" align="center">
<img id="Start" src="<?=$g4[path]?>/img/_start.png" border=0 onClick="Counter1(); counter=0;" style="cursor:hand;"> <img id="Stop" src="<?=$g4[path]?>/img/_stop.png" border=0 onClick="Results(); counter=0;" style="cursor:hand;">
</td>
</tr>
<tr>
<td height="45"></td>
</tr>
</table>
</form>
</td>
<td width="132" valign="top"><table width="34" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="34" height="69"> </td>
</tr>
<tr>
<td height="20" align="right"><?=mb_average($member[mb_id],"a");?></td>
</tr>
<tr>
<td height="20" align="right"><?=mb_average($member[mb_id],"b");?></td>
</tr>
<tr>
<td height="20" align="right"><?=mb_average($member[mb_id],"c");?></td>
</tr>
<tr>
<td height="20" align="right"><?=mb_average($member[mb_id],"e");?></td>
</tr>
</table></td>
<td width="68"></td>
</tr>
</table>
<br />
<!-- 전체 회원 보이므로 감추기 설정
<table width=100% align=center cellpadding="0" cellspacing="0">
<tr height=25 align=center id="attendances_font">
<td width="40" background="<?=$g4[path]?>/img/count_bg.gif"><div style="margin-left:5px;">순서</div></td>
<td width="7"><img src="<?=$g4[path]?>/img/count_bg._shodow.gif" width="7" /></td>
<td width="80" background="<?=$g4[path]?>/img/board_image_bg.gif">로그인시간</td>
<td width="30" background="<?=$g4[path]?>/img/board_image_bg.gif">레벨</td>
<td width="100" background="<?=$g4[path]?>/img/board_image_bg.gif">닉네임</td>
<td width="" background="<?=$g4[path]?>/img/board_image_bg.gif">접속여부</td>
<td width="30" background="<?=$g4[path]?>/img/board_image_bg.gif">오늘</td>
<td width="70" background="<?=$g4[path]?>/img/board_image_bg.gif">겜포인트</td>
<td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">금</td>
<td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">은</td>
<td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">동</td>
<td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">-</td>
<td width="9"><img src="<?=$g4[path]?>/img/point_bg_shodow.gif" alt="" width="9" /></td>
<td width="80" background="<?=$g4[path]?>/img/point_image.gif">총포인트</td>
</tr>
<tr>
<td height="6" colspan="14" background="<?=$g4[path]?>/img/board_shodow.gif"></td>
</tr>
<?
$sql = " select mb_id, mb_name, mb_nick, mb_level, mb_email, mb_homepage, mb_today_login, mb_point
from $g4[member_table]
where SUBSTRING(mb_today_login,1,10) = '$g4[time_ymd]'
and mb_level < '10'
order by mb_today_login ";
$result = sql_query($sql);
for ($i=1; $row=sql_fetch_array($result); $i++)
{
// 자신이라면 체크
if ($row[mb_id] == $member[mb_id])
$bgcolor = "#FFFFFF";
$mb_nick = get_sideview($row[mb_id], $row[mb_nick], $row[mb_email], $row[mb_homepage]);
// 본명사용시 사용 $mb_name = get_sideview($row[mb_id], $row[mb_name], $row[mb_email], $row[mb_homepage]);
$mb_loginchk = mb_loginchk($row[mb_id]);
$mb_gamechk = mb_gamechk($row[mb_id]);
?>
<tr bgcolor='<?=$bgcolor?>' onmouseout=this.bgColor='<?=$bgcolor?>' onmouseover=this.bgColor='#f1f1f1'>
<td align="center" height=25><div style="margin-left:5px;"><?=$i?></div></td>
<td width="7"></td>
<td align="center"><?=substr($row[mb_today_login],11,8)?></td>
<td align="center"><?=$row[mb_level];?></td>
<td align="center"><?=$mb_nick ?></td>
<td align="center"><?=$mb_loginchk?></td>
<td align="center"><img src="<?=$g4[path]?>/img/ico_medal_<?=$mb_gamechk[agelevel];?>.png"></td>
<td align="right"><div style="margin-right:15px;"><?=$mb_gamechk[point]?>P</div></td>
<td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"a");?></div></td>
<td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"b");?></div></td>
<td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"c");?></div></td>
<td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"e");?></div></td>
<td width="9"></td>
<td align="right"><div style="margin-right:15px;"><?=number_format($row[mb_point])?>P</div></td>
</tr>
<tr><td colspan=14 height=1 bgcolor='#E0E0E0'></td></tr>
<? } ?>
</table>
-->
<?
include_once("./tail.php");
include_once("$g4[path]/tail.sub.php");
?>
오류 주소 : /plugin/attendance/attendance.php
이거 배추빌더 제작자가 만드신 건가요?
암튼 흔하게 쓰여지는 출석체크. 인사말 쓰고 출석 확인하고 포인트 주는거.
7일마다 포인트 주는건 되는데.
28일 주기 혹은 30일 주기
이걸로 포인트를 주고 싶은데 설정을 못하겠네요.
_common.php
<?
$g4_path = "../..";
include_once("$g4_path/common.php");
// 상수 선언
$p4['table_prefix'] = "p4_"; // 테이블명 접두사
$p4['attendance_table'] = $p4['table_prefix'] . "attendance"; // 출석부 테이블
/*------------------------------------------
환경설정 START
------------------------------------------*/
// 출석시작 시간
$att['start_time'] = "09:35:00"; // 시:분:초
// 출석종료 시간
$att['end_time'] = "23:59:59"; // 시:분:초
// 개근
$att['day'] = "7"; // 지정한 날짜마다
// 개근
$att['day2'] = "28"; // 지정한 날짜마다
// 개근시 포인트
$att['day_point'] = "500";
// 장기 개근시 포인트
$att['day_point2'] = "1000";
// 일일 출석 포인트
$att['today_point'] = "100";
// 1등 포인트
$att['first_point'] = "500";
// 출석부 조회 일
$att['check_day'] = "7"; // 몇일까지 출석부 조회 가능한가?
/*------------------------------------------
환경설정 END
------------------------------------------*/
?>
attendance.php
<?
include_once("./_common.php");
$g4['title'] = "출석부";
include_once("$g4[path]/head.sub.php");
include_once("./head.php");
$colspan = "13";
echo "<script language=\"javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";
/*---------------------------------
## 달력 ##
---------------------------------*/
$datetime = $d;
if (!$datetime) {
$datetime = $g4['time_ymd'];
}
// 현재 시각 지정.
//$datetime = "2008-12-01";
//$datetime = $g4['time_ymd'];
// 현재 시각에서 월을 구한다.
$dateT1 = date("Y-m", strtotime($datetime));
// 현재 월의 1일의 요일 값을 구한다.
$dateT2 = date("w", strtotime($dateT1."-01"));
// 현재 월의 1일에서 요일 값을 뺀다.
$dateT3 = date("Y-m-d", strtotime($dateT1."-01") - (86400 * $dateT2));
// 현재 월의 1일에서 31일을 더한다.
$dateN1 = date("Y-m-d", strtotime($dateT1."-01") + (86400 * 31));
// 다음 달의 월을 구한다.
$dateN2 = date("Y-m", strtotime($dateN1));
// 다음 달 1일을 구한다.
$dateN3 = date("Y-m-d", strtotime($dateN2."-01"));
// 다음 달 1일에서 1일을 뺀다. 그럼 이번 달 마지막일
$dateN4 = date("d", strtotime($dateN3) - (86400 * 1));
// 6 뺀다. 현재 달 마지막 일 요일을 구해서.
$dateN5 = 6 - date("w", strtotime($dateT1."-".$dateN4));
// 현재 월의 1일에서 1일을 뺀다.
$dateP1 = date("Y-m-d", strtotime($dateT1."-01") - (86400 * 1));
/*---------------------------------
## 리스트 ##
---------------------------------*/
// 날짜가 있다면.
if ($d) {
$sql_common = "substring(datetime,1,10) = '$datetime'";
} else {
// 오늘
$sql_common = "substring(datetime,1,10) = '$g4[time_ymd]'";
}
?>
<style type="text/css">
ul, li {list-style:none outside;}
A {text-decoration:none;}
/* date */
#date_layer {text-align:left;;}
#date_layer #box {width:120px;}
#date_layer #box .top {width:20px; float:left;}
#date_layer #box .day {width:80px; float:left;}
#date_layer .w {font-weight:bold; line-height:20px; color:#333333; font-size:15px; font-family:굴림,돋움;}
#date_layer .title {color:#565656; font-size:12px; font-family:굴림,돋움; padding:0 0 0 1px;}
#date_layer .sun1 {color:#ff0000; font-size:12px; font-family:굴림,돋움;}
#date_layer .sat1 {color:#0000ff; font-size:12px; font-family:굴림,돋움;}
#date_layer .day1 {color:#333333; font-size:12px; font-family:굴림,돋움;}
#date_layer .sun2 {font-weight:bold; line-height:20px; color:#ff0000; font-size:15px; font-family:굴림,돋움;}
#date_layer .sat2 {font-weight:bold; line-height:20px; color:#0000ff; font-size:15px; font-family:굴림,돋움;}
#date_layer .day2 {font-weight:bold; line-height:20px; color:#333333; font-size:15px; font-family:굴림,돋움;}
#date_layer .sun3 {color:#ffbebe; font-size:11px; font-family:굴림,돋움;}
#date_layer .sat3 {color:#b8b8ff; font-size:11px; font-family:굴림,돋움;}
#date_layer .day3 {color:#999999; font-size:11px; font-family:굴림,돋움;}
#date_layer .dot {color:#000000; font-size:12px; font-family:굴림,돋움;}
#date_layer .check {color:#126420; font-size:11px; font-family:굴림,돋움;}
#date_layer .check2 {color:#999999; font-size:11px; font-family:굴림,돋움;}
/* list */
#list_layer .input {width:300px; height:21px; background-color:#f3f3f3; border:0px; padding:5px 2px 2px 2px; font-weight:bold; color:#333333; font-family:굴림,돋움; font-size:13px;}
#list_layer .msg {padding:5px 0 0 3px; float:left;}
#list_layer .sub {float:left;}
#list_layer .submit {padding:3px 0 0 5px; float:left;}
#list_layer #info li {line-height:18px; color:#898989; font-family:굴림,돋움; font-size:11px;}
#list_layer .title {font-weight:bold; color:#333333; font-family:굴림,돋움; font-size:12px;}
#list_layer .list {line-height:20px; color:#898989; font-family:굴림,돋움; font-size:11px;}
#list_layer .no {line-height:25px; font-size:12px; color:#898989;}
#list_layer .bgcolor0 {background-color:#ffffff;}
#list_layer .bgcolor1 {background-color:#f1f1f1;}
#list_layer .bgcolor2 {background-color:#ffffff;}
.style1 {color: #000000}
.style2 {
font-size: 14px;
font-weight: bold;
color: #FF0000;
}
.style4 {font-size: 14px; font-weight: bold; color: #0000FF; }
</style>
<div id="BoardText">
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td width="6" valign="top"></td>
<td width="961" valign="top">
<!-- LEFT start //-->
<div id="list_layer">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr height="30">
<td colspan="4"><b>교민생활에 힘이되는 인삿말 한 마디와 함께, 출석체크하고 받아가는 이벤트 뽀나스 100 포인트!!</b></td>
</tr>
<tr>
<td colspan="4" valign="middle" style="height:32px; border:0px solid #cccccc;">
<form name="fattendance" method="post" action="javascript:fattendance_submit(document.fattendance);" style="margin:0px;">
<div id="title">
<li class="msg">출석 한마디 : </li>
<li class="sub"><input type="text" id="subject" name="subject" class="input" value="뽀대나는 한 마디를 입력해 주세요" onmouseover="if(!this.value || this.value == '뽀대나는 한 마디를 입력해 주세요.')this.value='';" ></li>
<li class="submit"><input type="image" src="./img/btn_ok.gif" border="0"></li>
</div>
</form>
<script type="text/javascript">
function fattendance_submit(f)
{
var ChkSubject = document.getElementById("subject").value;
if (!ChkSubject || ChkSubject == '한마디를 입력해 주세요.') {
alert("한마디를 입력하세요.");
return;
}
f.action = "./update.php";
f.submit();
}
</script> </td>
</tr>
<tr><td height="10" colspan="4"></td></tr>
<tr>
<td height="50" colspan="3">
<table width="263%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="1"></td>
<td width="52"><img src="./img/image.gif" align="absmiddle"></td>
<td width="1"></td>
<td width="712">부지런한 꿀벌이 근심할 겨를도 없이 포인트 왕창 긁어 모은다!!
<div id="info">
<li class="style1">→ 출석시간 :
<?=date("a h시 i분 s초", strtotime($att['start_time']))?>
~
<?=date("a h시 i분 s초", strtotime($att['end_time']))?>
</li>
<li class="style1">→ 출석포인트 :
<?=number_format($att['today_point'])?>
점 (개근상 :
<?=$att['day']?>
일 마다
<?=number_format($att['day_point'])?>
점)
<?=$att['day2']?>
일 마다
<?=number_format($att['day_point2'])?>
점)</li>
<li class="style1">→ 1등 포인트 :
<?=number_format($att['first_point'])?>
점</li>
</div></td>
<td width="10"> </td>
</tr>
</table></td>
<td width="19%" rowspan="3" valign="bottom"><img src="img/chock.gif" width="139" height="75" align="right" /></td>
</tr>
<tr><td height="10" colspan="3"></td>
</tr>
<tr>
<td width="19%" height="40" valign="bottom"><span style="font-family:굴림,돋움; font-size:12px; color:#898989;">[<?=$datetime?>]</span></td>
<td width="3%" valign="bottom"><span style="font-family:굴림,돋움; font-size:12px; color:#898989;"><img src="img/pig.jpg" width="30" height="31" /></span></td>
<td width="59%" valign="middle"><span style="font-family:굴림,돋움; font-size:12px; color:#898989;">
<?=mw_latest_rand("mw.index.scroll", "04_05", 5, 124, 5, $mw[config][cf_index_cache])?>
</span></td>
</tr>
<tr><td height="5" colspan="4"></td></tr>
<tr>
<td colspan="4">
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" valign="top">
<tr><td colspan="<?=$colspan?>" height="3" bgcolor="#F2F2F2"></td></tr>
<tr><td colspan="<?=$colspan?>" height="1" bgcolor="#D9D9D9"></td></tr>
<tr height="30">
<td width="50" align="center" class="title">등수</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td width="72" align="center" class="title">출석시간</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td width="90" align="center" class="title">닉네임</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td align="center" class="title">한마디</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td width="45" align="center" class="title">접속중</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td width="45" align="center" class="title">포인트</td>
<td width="1"><img src="./img/line_01.gif" width="1" height="13"></td>
<td width="45" align="center" class="title">개근</td>
</tr>
<tr><td colspan="<?=$colspan?>" height="1" bgcolor="#D9D9D9"></td></tr>
<tr><td colspan="<?=$colspan?>" height="3" bgcolor="#F2F2F2"></td></tr>
<?
// 출석 테이블 연결
$sql = " select * from $p4[attendance_table] where $sql_common order by datetime asc, day desc ";
$result = sql_query($sql);
for ($i=0; $data=sql_fetch_array($result); $i++) {
// 접속자테이블 연결
$sql = " select mb_id from $g4[login_table] where mb_id = '$data[mb_id]' ";
$ing = sql_fetch($sql);
// 접속상태
if ($ing['mb_id']) {
$on = "접속중";
} else {
$on = "";
}
// 회원 테이블 연결
$check = get_member($data['mb_id']);
// 닉네임
$name = get_sideview($check['mb_id'], $check['mb_nick'], $check['mb_email'], $check['mb_homepage']);
// 랭킹
$rank = $i + 1;
/*
// 색상
if ($member['mb_id'] == $data['mb_id']) {
$list = "2";
} else {
$list = ($i%2);
}
*/
$list = ($i%2);
?>
<tr height="30">
<td align="center" class="bgcolor<?=$list?> list"><?=$rank?> 등</td>
<td></td>
<td align="center" class="bgcolor<?=$list?> list"><?=date("a h:i:s", strtotime($data['datetime']))?><?//=substr($data['datetime'],10,16);?></td>
<td></td>
<td align="center" class="bgcolor<?=$list?> list"><?=$name?></td>
<td></td>
<td style="padding:0 0 0 20px;" class="bgcolor<?=$list?> list"><?=get_text($data['subject'])?></td>
<td></td>
<td align="center" class="bgcolor<?=$list?> list"><?=$on?></td>
<td></td>
<td align="right" style="padding:0 5 0 0px;" class="bgcolor<?=$list?> list"><?=number_format($data['point']);?> 점</td>
<td></td>
<td align="center" class="bgcolor<?=$list?> list"><?=$data['day']?> 일째</td>
</tr>
<tr><td bgcolor="#EEEEEE" colspan="<?=$colspan?>" height="1"></td></tr>
<? } ?>
<? if (!$i) { ?>
<tr><td height="100" colspan="<?=$colspan?>" align="center"><span class="no">출석한 사람이 없습니다.<br>출석시간 : <?=date("a h시 i분 s초", strtotime($att['start_time']))?> ~ <?=date("a h시 i분 s초", strtotime($att['end_time']))?></span></td></tr>
<tr><td colspan="<?=$colspan?>" height="1" bgcolor="#eeeeee"></td></tr>
<? } ?>
</table></td>
</tr>
</table>
</div>
<!-- LEFT end //--></td>
<td width="14"></td>
<td width="243" valign="top"><!-- left start //-->
<div id="date_layer">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top:10px; border:1px solid #e4e4e4;">
<tr height="30">
<td colspan="7" align="center"><div id="box">
<li class="top"><a href="?d=<?=$dateP1?>&mode=<?=$mode?>" class="dot">◀</a></li>
<li class="day"><span class="w">
<?=$dateT1?>
</span></li>
<li class="top"><a href="?d=<?=$dateN3?>&mode=<?=$mode?>" class="dot">▶</a></li>
</div></td>
</tr>
<tr>
<td colspan="7" height="1" bgcolor="#e4e4e4"></td>
</tr>
<tr height='30'>
<td width="55" align="center" class="title">일</td>
<td width="55" align="center" class="title">월</td>
<td width="55" align="center" class="title">화</td>
<td width="55" align="center" class="title">수</td>
<td width="55" align="center" class="title">목</td>
<td width="55" align="center" class="title">금</td>
<td width="55" align="center" class="title">토</td>
</tr>
<tr height='55'>
<?
// 7셀만 출력. 다음 셀로 자동 변경.
$mod = "7";
// 돌리고 돌리고~ 마지막 일에서 이번 달 1일의 요일 값 만큼 더한다.
for ($i=0; $i<($dateN4 + $dateT2 + $dateN5); $i++) {
// 6일 뺀 날짜부터 돌린다.
$dateT4 = date("Y-m-d", strtotime($dateT3) + (86400 * $i));
// 해당 날짜의 요일을 구한다.
$dateT5 = date("w", strtotime($dateT3) + (86400 * $i));
if ($i && $i%$mod == '0') {
echo "</tr>\n<tr height='55'>\n";
}
// 일요일 제외
if ($dateT5 != '0') {
$dateLine = "border-left:1px solid #e4e4e4;";
} else {
$dateLine = "";
}
echo "<td align='center' style='" . $dateLine . " border-top:1px solid #e4e4e4;'>";
// 현재 월과 돌린 월이 일치할 때만.
if ($dateT1 == substr($dateT4,0,7)) {
// 찍은 날짜면
if ($datetime == $dateT4) {
// 0은 일요일.
if ($dateT5 == '0') {
// 빨강색
$dateClassName = "sun2";
}
// 6은 토요일
else if ($dateT5 == '6') {
// 파랑색
$dateClassName = "sat2";
} else {
// 기타
$dateClassName = "day2";
}
}
// 오늘 날짜면
else if ($g4['time_ymd'] == $dateT4) {
// 0은 일요일.
if ($dateT5 == '0') {
// 빨강색
$dateClassName = "sun2";
}
// 6은 토요일
else if ($dateT5 == '6') {
// 파랑색
$dateClassName = "sat2";
} else {
// 기타
$dateClassName = "day2";
}
} else {
// 0은 일요일.
if ($dateT5 == '0') {
// 빨강색
$dateClassName = "sun1";
}
// 6은 토요일
else if ($dateT5 == '6') {
// 파랑색
$dateClassName = "sat1";
} else {
// 기타
$dateClassName = "day1";
}
}
echo "<div style='height:20px;'>";
echo "<a href=\"javascript:dateGo('".$dateT4."')\">";
echo "<span class='" . $dateClassName . "'>";
echo substr($dateT4,8,2);
echo "</span>";
echo "</a>";
echo "</div>";
// 출석했나?
$sql = " select id from $p4[attendance_table] where mb_id = '$member[mb_id]' and substring(datetime,1,10) = '$dateT4' ";
$check = sql_fetch($sql);
// 출석
if ($check['id']) {
echo "<div style='margin-top:3px;'>";
echo "<span class='check'>[O]</apan>";
echo "</div>";
} else {
echo "<div style='margin-top:3px;'>";
echo "<span class='check2'>[X]</apan>";
echo "</div>";
}
} else {
// 다른 달
// 0은 일요일.
if ($dateT5 == '0') {
// 빨강색
$dateClassName = "sun3";
}
// 6은 토요일
else if ($dateT5 == '6') {
// 파랑색
$dateClassName = "sat3";
} else {
// 기타
$dateClassName = "day3";
}
//echo "<a href=\"javascript:dateGo('".substr($dateT4,5,5)."')\">";
echo "<span class='" . $dateClassName . "'>";
echo substr($dateT4,5,5);
echo "</span>";
//echo "</a>";
}
echo "</td>\n";
}
// 나머지 셀을 채운다.
$cnt = $i%$mod;
if ($cnt) {
for ($i=$cnt; $i<$mod; $i++) {
echo "<td> </td>\n";
}
}
?>
</tr>
</table>
</div>
<script type="text/javascript">
function dateGo(day)
{
document.location.href = "?d="+day;
}
</script>
<!-- left end //-->
</td>
</tr>
</table>
</div>
<br>
<!-- 추가로 포인트 더 얻기 게임 -->
<?
include_once("./_common.php");
include_once("$g4[path]/_head.php");
$game_point = 10; // 게임포인트 설정
$game_besu1 = 100; // 퍼펙트 게임포인트 배수 설정
$game_besu2 = 40; // ±1 게임포인트 배수 설정
$game_besu3 = 30; // ±3 게임포인트 배수 설정
$game_range1 = 1; // ±1 게임 점수 설정
$game_range2 = 3; // ±3 게임 점수 설정
$game_minus = 30; // ±30 게임 감점점수 설정
// 게임 평균
function mb_average($mb_id,$agelevel)
{
global $g4;
$sql = "select count(po_id) as cnt from $g4[point_table] where mb_id='$mb_id' and po_rel_table = '@attendances' and SUBSTRING(po_rel_action,1,1) = '$agelevel' ";
$row = sql_fetch($sql);
$game_average = $row[cnt];
return $game_average;
}
//로그인 테이블기준 로그인 여부 체크
function mb_loginchk($mb_id)
{
global $g4;
if ($mb_id) {
$sql = "select mb_id from $g4[login_table] where mb_id='$mb_id'";
$mb = sql_fetch($sql);
if($mb[mb_id])
$message = "접속중";
else
$message = "";
return $message;
}
}
//게임점수
function mb_gamechk($mb_id)
{
global $g4;
$tmp = array();
if ($mb_id) {
$sql = "select po_point, SUBSTRING(po_rel_action,1,1) as agelevel from $g4[point_table] where mb_id='$mb_id' and SUBSTRING(po_datetime,1,10) = '$g4[time_ymd]' and po_rel_table = '@attendances' ";
$po = sql_fetch($sql);
if($po[po_point])
$tmp[point] = "$po[po_point]";
else
$tmp[point] = "";
if($po[agelevel])
$tmp[agelevel] = "$po[agelevel]";
else
$tmp[agelevel] = "";
return $tmp;
}
}
// 총 인원 수
$sql = " select count(*) as cnt from $g4[member_table] where mb_today_login like '$g4[time_ymd]%' and mb_id != '$config[cf_admin]' order by mb_today_login";
$cnt = sql_fetch($sql);
$total_count = $cnt[cnt];
$rows = 14;
$total_page = ceil($total_count / $rows);
if ($page == "") { $page = 1; }
$from_record = ($page - 1) * $rows;
// 총인원수를 구한다음
$sql = " select mb_id, mb_name, mb_nick, mb_level, mb_email, mb_homepage, mb_today_login, mb_point from $g4[member_table] where SUBSTRING(mb_today_login,1,10) = '$g4[time_ymd]' and mb_level < '10' order by mb_today_login DESC
limit $from_record, $rows";
$page = get_paging($config[cf_write_pages], $page, $total_page, "?$qstr&page=");
?>
<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>
<script LANGUAGE="JavaScript">
function Title() {document.title="STOP ON 1o0 By Nolan Gendron"; window.setTimeout("Title1();",1);}
function Title1() {document.title="STOP ON 10o By Nolan Gendron"; window.setTimeout("Title();",1);}
counter=0;
function Counter1() {
window.status="Counter: " + counter;
document.game.number.value=counter;
counter++;
Time=window.setTimeout("Counter1();",1);
if (counter==201) {
counter=0;
}
}
function Results() {
window.clearTimeout(Time);
document.game.number.value=counter;
document.game.submit();
}
</script>
<style type="text/css">
<!--
#attendance_font td{
color: #FFFFFF;
}
.tt1 { font-family: verdana,돋음; font-size: 11px; color: #555555; line-height: 170%; }
.test11 { background-color:#222222; border:0px; }
-->
</style>
<table align=center cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height=30 align=right valign=bottom><span class="style2">왕왕</span>!!! <span class="style4">뽀놔수</span>!!! 100점에 정확히 맞추면 또 추가 포인트 <span class="style2">1000</span>점을 드립니다!! 도전해 보세요!! 오늘게임참여Total <strong><?=$cnt[cnt]?></strong> 명 </td>
</tr>
<tr>
<td height=5 align=right valign=bottom></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="<?=$g4[path]?>/img/att_base.png" class="tt1">
<tr>
<td width="281" height="170"></td>
<td width="565">
<span class="tt1"><br>
Start 클릭하고 숫자가 100이 되는 순간 Stop 클릭!<br>
[1] 100점에 정확히 맞힐 경우 : <?=number_format($game_point * $game_besu1);?>포인트<br>
[2] ±1점에 맞힐 경우 : <?=number_format($game_point * $game_besu2);?>포인트<br>
[3] ±3점에 맞힐 경우 : <?=number_format($game_point * $game_besu3);?>포인트<br>
(감점 : ±30점 초과해 맞힐 경우 : -<?=number_format($game_point * $game_besu3);?>포인트)</span></td>
<td width="168" valign="top">
<form name="game" action="attendances_update.php" method="post">
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="15"></td>
</tr>
<tr>
<td align="center" height="75">
<input type="hidden" name="point" VALUE="<?=$game_point;?>">
<input type="hidden" name="besu1" VALUE="<?=$game_besu1;?>">
<input type="hidden" name="besu2" VALUE="<?=$game_besu2;?>">
<input type="hidden" name="besu3" VALUE="<?=$game_besu3;?>">
<input type="hidden" name="range1" VALUE="<?=$game_range1;?>">
<input type="hidden" name="range2" VALUE="<?=$game_range2;?>">
<input type="hidden" name="minus" VALUE="<?=$game_minus;?>">
<input class="test11" type="text" name="number" VALUE="0" onFocus="this.blur();" style="font-size: 45;font-family:arial black;width:100;color:white">
</td>
</tr>
<tr>
<td height="30" align="center">
<img id="Start" src="<?=$g4[path]?>/img/_start.png" border=0 onClick="Counter1(); counter=0;" style="cursor:hand;"> <img id="Stop" src="<?=$g4[path]?>/img/_stop.png" border=0 onClick="Results(); counter=0;" style="cursor:hand;">
</td>
</tr>
<tr>
<td height="45"></td>
</tr>
</table>
</form>
</td>
<td width="132" valign="top"><table width="34" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="34" height="69"> </td>
</tr>
<tr>
<td height="20" align="right"><?=mb_average($member[mb_id],"a");?></td>
</tr>
<tr>
<td height="20" align="right"><?=mb_average($member[mb_id],"b");?></td>
</tr>
<tr>
<td height="20" align="right"><?=mb_average($member[mb_id],"c");?></td>
</tr>
<tr>
<td height="20" align="right"><?=mb_average($member[mb_id],"e");?></td>
</tr>
</table></td>
<td width="68"></td>
</tr>
</table>
<br />
<!-- 전체 회원 보이므로 감추기 설정
<table width=100% align=center cellpadding="0" cellspacing="0">
<tr height=25 align=center id="attendances_font">
<td width="40" background="<?=$g4[path]?>/img/count_bg.gif"><div style="margin-left:5px;">순서</div></td>
<td width="7"><img src="<?=$g4[path]?>/img/count_bg._shodow.gif" width="7" /></td>
<td width="80" background="<?=$g4[path]?>/img/board_image_bg.gif">로그인시간</td>
<td width="30" background="<?=$g4[path]?>/img/board_image_bg.gif">레벨</td>
<td width="100" background="<?=$g4[path]?>/img/board_image_bg.gif">닉네임</td>
<td width="" background="<?=$g4[path]?>/img/board_image_bg.gif">접속여부</td>
<td width="30" background="<?=$g4[path]?>/img/board_image_bg.gif">오늘</td>
<td width="70" background="<?=$g4[path]?>/img/board_image_bg.gif">겜포인트</td>
<td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">금</td>
<td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">은</td>
<td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">동</td>
<td width="35" background="<?=$g4[path]?>/img/board_image_bg.gif">-</td>
<td width="9"><img src="<?=$g4[path]?>/img/point_bg_shodow.gif" alt="" width="9" /></td>
<td width="80" background="<?=$g4[path]?>/img/point_image.gif">총포인트</td>
</tr>
<tr>
<td height="6" colspan="14" background="<?=$g4[path]?>/img/board_shodow.gif"></td>
</tr>
<?
$sql = " select mb_id, mb_name, mb_nick, mb_level, mb_email, mb_homepage, mb_today_login, mb_point
from $g4[member_table]
where SUBSTRING(mb_today_login,1,10) = '$g4[time_ymd]'
and mb_level < '10'
order by mb_today_login ";
$result = sql_query($sql);
for ($i=1; $row=sql_fetch_array($result); $i++)
{
// 자신이라면 체크
if ($row[mb_id] == $member[mb_id])
$bgcolor = "#FFFFFF";
$mb_nick = get_sideview($row[mb_id], $row[mb_nick], $row[mb_email], $row[mb_homepage]);
// 본명사용시 사용 $mb_name = get_sideview($row[mb_id], $row[mb_name], $row[mb_email], $row[mb_homepage]);
$mb_loginchk = mb_loginchk($row[mb_id]);
$mb_gamechk = mb_gamechk($row[mb_id]);
?>
<tr bgcolor='<?=$bgcolor?>' onmouseout=this.bgColor='<?=$bgcolor?>' onmouseover=this.bgColor='#f1f1f1'>
<td align="center" height=25><div style="margin-left:5px;"><?=$i?></div></td>
<td width="7"></td>
<td align="center"><?=substr($row[mb_today_login],11,8)?></td>
<td align="center"><?=$row[mb_level];?></td>
<td align="center"><?=$mb_nick ?></td>
<td align="center"><?=$mb_loginchk?></td>
<td align="center"><img src="<?=$g4[path]?>/img/ico_medal_<?=$mb_gamechk[agelevel];?>.png"></td>
<td align="right"><div style="margin-right:15px;"><?=$mb_gamechk[point]?>P</div></td>
<td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"a");?></div></td>
<td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"b");?></div></td>
<td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"c");?></div></td>
<td align="right"><div style="margin-right:10px;"><?=mb_average($row[mb_id],"e");?></div></td>
<td width="9"></td>
<td align="right"><div style="margin-right:15px;"><?=number_format($row[mb_point])?>P</div></td>
</tr>
<tr><td colspan=14 height=1 bgcolor='#E0E0E0'></td></tr>
<? } ?>
</table>
-->
<?
include_once("./tail.php");
include_once("$g4[path]/tail.sub.php");
?>
댓글 전체