채택완료

출석부 레벨출력 문의드립니다.

빨간색 부분처럼하니까.. 레벨이 다 동일하게 출력이됩니다... 포인트 점수에따라 출력되야되는데요...

<?php
include_once('./_common.php');
if($day && $month){
  $day = date('Y')."-".sprintf("%02d",$_GET['month'])."-".sprintf("%02d",$_GET['day']);
}else{
  $day = G5_TIME_YMD;
}
$atsql = " select count(*) as cnt from g5_attendance where substring(datetime,1,10) = '$day' ";
$atrow = sql_fetch($atsql);

$at_total = $atrow[cnt];
$result = sql_query(" select * from g5_attendance where substring(datetime,1,10) = '$day' order by datetime desc ");
?>
  <table summary="출석부 입니다.">
    <caption>출석부</caption>
    <colgroup>
      <col width="60px">
      <col width="160px">
      <col>
      <col width="90px">
      <col width="50px">
      <col width="60px">
      <col width="60px">
    </colgroup>
    <thead>
    <tr>
      <th scope="col" class="side1">순위</th>
      <th>닉네임</th>
      <th>인삿말</th>
      <th>시간</th>
      <th>포인트</th>
      <th>개근일</th>
      <th scope="col" class="side2">출석일</th>
    </tr>
    </thead>
    <tbody>
<?php
// 출석 테이블 연결
for ($i=0; $data=sql_fetch_array($result); $i++) {
   $datetime = substr($data[datetime], 11, 8);
    // 회원 테이블 연결
    $check = get_member($data['mb_id']);
    // 닉네임
    $name = get_sideview($check['mb_id'], $check['mb_nick'], $check['mb_email'], $check['mb_homepage']);
    // 랭킹
    $rank = $at_total-$i;
    $rank_checked = $rank.'등';

    $list = ($i%2);

    $label_point = $data[mb_point];

$mb_ps_path = G5_DATA_PATH.'/member/'.substr($check['mb_id'],0,2).'/'.$check['mb_id'].'_ps.gif';
$mb_ps_url  = G5_DATA_URL.'/member/'.substr($check['mb_id'],0,2).'/'.$check['mb_id'].'_ps.gif';
?>
      <tr>
        <td class="rank"><?php echo $rank_checked ?></td>
        <td class="info_n"><?php include_once G5_LIB_PATH."/level_icon.lib.php"; echo get_level_icon($list[$i]['mb_id']); ?> <?php echo $name ?>님</td>
        <td class="info_m"><span class="contentsText" style="color: #888"><?php echo get_text($data[subject]) ?></span></td>
        <td class="time"><?php echo $datetime ?></td>
        <td class="point"><?php echo $label_point ?> 점</td>
        <td class="absent"><?php echo $data[day] ?> 일</td>
        <td class="absent"><?php echo $data[reset] ?> 일</td>
      </tr>
<?php }if(!$i){ ?>
      <tr>
        <td class="nonum" colspan="7">출석한 회원이 없습니다.</td>
      </tr>
<? } ?>
    </tbody>
  </table> 

|

답변 4개 / 댓글 6개

채택된 답변
+20 포인트

될지 모르겠지만 

echo get_level_icon($list[$i]['mb_id']); 

여기를 이렇게 해보세요.

echo get_level_icon($check['mb_id']);

플러그인을 작업한 제가 답변을 드리고는 싶었지만.. 이미.. 답변을 다드리셔서....

일단 해결 되셨다니 다행입니다. !!

답변에 대한 댓글 6개

아흠 그러고 보니.. 출석부 mysqli 작업겸 ... ajax post 형식으로 새로 짜야되는데...

그이유가... 이용자수 많은 사이트에선 mysql 쓰면 mysqli 랑 로딩 속도가 묘하게 차이나서.. mysqli 가 로딩속도 더 빠르다는 외국 어떤 개발자 사이트에서 결론내려서 그걸로 갈아탈아타야되는데 ..

지금 제작중인.. 아이콘상점 2.0 때문에 .. 정신이..
아 아이콘상점 유료인가여?
그렇죠 뭐 ㅠ_ㅠ..
아이콘상점.. 그누 5 지원 되나여?
당연히 지원되죠 ㅎㅎ 그누보드 5 로 만들어졌어요 ㅎㅎ

echo get_level_icon($check['mb_id']);  이렇게해도 되고

echo get_level_icon($data['mb_id']);   이렇게해도 되네요 두분 감사합니다..~!! 

echo get_level_icon($data['mb_id']); 이거일거 같네요...... 

답변을 작성하려면 로그인이 필요합니다.