단순 관리자 접속표시 정보
단순 관리자 접속표시
본문
출근부 소스를 수정해서 만들려고 했는데, 쿼리문은 하나도 몰라서 딱 막혀버리는군요.
단순히 관리자가 접속하면, 현재 관리자님은 접속 상태입니다.
라고 뜨고 관리자가 접속해 있지 않으면 현재관리자님은 비접속 상태입니다.
요렇게 만들려고 하는데, 어떻게 해야할지 자문을 구합니다.
아래 소스는 출근부 소스입니다. 어떻게 고쳐야 할가요?
<?
include_once("./_common.php");
include_once("./_common.php");
$g4[title] = "최근 게시물";
include_once("./_head.php");
include_once("./_head.php");
$today = $g4[time_ymd];
// 총 출석자 확인
$sql = " select count(*) as cnt from $g4[member_table] where mb_today_login like '$today%' and mb_id != '$config[cf_admin]' order by mb_today_login"; $row = sql_fetch($sql);
$today_visit = $row[cnt];
$sql = " select count(*) as cnt from $g4[member_table] where mb_today_login like '$today%' and mb_id != '$config[cf_admin]' order by mb_today_login"; $row = sql_fetch($sql);
$today_visit = $row[cnt];
//#########--------- 출석회원중 현재 로그인상태인 회원은 '접속중' 으로 표시
function dev_online($mb_id)
{
global $g4;
if ($mb_id) {
$sql = "select mb_id, lo_location from $g4[login_table] where mb_id='$mb_id'";
$result = @sql_fetch($sql);
if($result[mb_id]) {
$online_message="접속중";
}
else {
$online_message="";
}
return $online_message;
}
}
//#########---------- END (위부분은 developer.lib.php에 삽입해도 됨)
?>
<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>
<table align=center cellpadding="0" cellspacing="0" width="98%">
<tr>
<td height=30 align=right valign=bottom>Total <?=$today_visit?> 명 </td>
</tr>
</table>
<tr>
<td height=30 align=right valign=bottom>Total <?=$today_visit?> 명 </td>
</tr>
</table>
<table width=98% align=center>
<tr height=32 align=center>
<td width="40" background="<?=$g4[path]?>/img/board_tit_bg1.gif">순서</td>
<td width="70" background="<?=$g4[path]?>/img/board_tit_bg1.gif">출근시간</td>
<td width="60" background="<?=$g4[path]?>/img/board_tit_bg1.gif">레벨</td>
<td width="80" background="<?=$g4[path]?>/img/board_tit_bg1.gif">이 름</td>
<td width="80" background="<?=$g4[path]?>/img/board_tit_bg1.gif">접속여부</td>
<td width="" background="<?=$g4[path]?>/img/board_tit_bg1.gif">아이디</td>
<td width="80" background="<?=$g4[path]?>/img/board_tit_bg1.gif">포인트</td>
</tr>
<?
$mb_level = $mb[mb_level];
$sql = " select mb_id, mb_name, mb_nick, mb_level, mb_email, mb_homepage, mb_open, mb_today_login, mb_point
from $g4[member_table]
where SUBSTRING(mb_today_login,1,10) = '$today'
and mb_level < '10'
order by mb_today_login asc ";
$result = sql_query($sql);
$mb_level = $mb[mb_level];
$sql = " select mb_id, mb_name, mb_nick, mb_level, mb_email, mb_homepage, mb_open, mb_today_login, mb_point
from $g4[member_table]
where SUBSTRING(mb_today_login,1,10) = '$today'
and mb_level < '10'
order by mb_today_login asc ";
$result = sql_query($sql);
$k=0;
$save_time = "";
for ($i=1; $row=sql_fetch_array($result); $i++)
{
$save_time = "";
for ($i=1; $row=sql_fetch_array($result); $i++)
{
$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]);
$online_now = dev_online($row[mb_id]); //---------############## 로그인상태임을 나타내는 함수불러옴
$bgcolor = ($i%2) ? "#FFFDF7" : "#FFFFFF";
$bgcolor = ($i%2) ? "#FFFDF7" : "#FFFFFF";
if ($row[mb_id] == $member[mb_id])
$bgcolor = "#FCECBC";
$bgcolor = "#FCECBC";
if ($save_time != substr($row[mb_today_login],11,8))
{
$save_time = substr($row[mb_today_login],11,8);
$k = $i;
}
?>
{
$save_time = substr($row[mb_today_login],11,8);
$k = $i;
}
?>
<tr bgcolor='<?=$bgcolor?>' onmouseout=this.bgColor='<?=$bgcolor?>' onmouseover=this.bgColor='#FFF3E7'>
<td align=center height=25><?=$k?></td>
<td align=center><?=$save_time?></td>
<td align=center><?=$row[mb_level];?></td>
<td align=center><?=$mb_name ?></td>
<td align=center><?=$online_now?></td>
<td align=center><?=$row[mb_id]?></td>
<td align=right><?=number_format($row[mb_point])?>점 </td>
</tr>
<tr><td colspan=10 height=1 bgcolor='#E0E0E0'></td></tr>
<? } ?>
<tr><td colspan=10 height=7 background="<?=$g4[path]?>/img/board_bottom_bar.gif"></td></tr>
</table>
<td align=center height=25><?=$k?></td>
<td align=center><?=$save_time?></td>
<td align=center><?=$row[mb_level];?></td>
<td align=center><?=$mb_name ?></td>
<td align=center><?=$online_now?></td>
<td align=center><?=$row[mb_id]?></td>
<td align=right><?=number_format($row[mb_point])?>점 </td>
</tr>
<tr><td colspan=10 height=1 bgcolor='#E0E0E0'></td></tr>
<? } ?>
<tr><td colspan=10 height=7 background="<?=$g4[path]?>/img/board_bottom_bar.gif"></td></tr>
</table>
<?
include_once ("$g4[path]/tail.php");
?>
include_once ("$g4[path]/tail.php");
?>
댓글 전체
감사합니다.