OLDBOY/skin/board/A950_jy_today/view.skin.php
<?php
 if (!defined('_GNUBOARD_')) exit;
 error_reporting(E_ALL); // 에러 출력
 ini_set('display_errors', '1'); // 에러 출력
 error_reporting(0); // 에러 메세지 숨김
 //-----------------------------------------------
 include_once(G5_LIB_PATH.'/thumbnail.lib.php');
 //----------------------------------------------
 ## 죄회수 / 클릭 / 테이블 & 필드
 include_once($jeongyeon_path.'/code.php');
 //----------------------------------------------
 ## 이전 데이터 호출
 if ($wr_id) {
    $pre_num = $write['wr_num'] + 1; // 글 수정 시 : 이전 넘버
 } else {
    $new_board = sql_query("select * from $write_table where wr_id is not null order by wr_datetime desc limit 1"); // 새글 시 : 최근 넘버
    $lat_board = sql_fetch_array($new_board);
    $pre_num = $lat_board['wr_num'];
 }
 $board_pre = sql_fetch(" select * from $write_table where wr_num = $pre_num "); // 이전 데이터
 $board_no1 = sql_fetch(" select * from $write_table where wr_num = '-1' "); // 첫 데이터
 //-------------------------------------------------------------------------------------------------
?>
<!----------| CSS |--------->
 <link rel="stylesheet" href="<?=$board_skin_url;?>/style.css">
<!----------| SCRIPT |--------->
 <script src="<?=G5_JS_URL;?>/viewimageresize.js"></script>
 <article id='VIEW'>
   <!----------| BUTTON : WRITE : POP |--------->
    <div class='Write'>
        <? if ($write_href) { ?> <button type='button' onclick="location.href='<?=$write_href.$x2url;?>'" tooltip="쓰기" flow="down">WRITE</button><? } ?>
        <? if ($update_href) { ?> <button type='button' onclick="location.href='<?=$update_href;?>'" tooltip="수정" flow="down">UPDATE</button><? } ?>
        <button type='button' onclick="location.href='<?=$list_href.$x2url;?>'" tooltip="목록" flow="down">LIST</button>
    </div>
   <!----------| SUBJECT |--------->
    <section class='Subject'>
        <p><?=cut_str(get_text($view['wr_subject']), 100);?></p>
        <?
        if ($view['x2_datetime']) {
            $x2_datetime = $view['x2_datetime'];
            $x2_datetime = explode(" ", $x2_datetime);
            $x2_end_day = explode(":", $x2_datetime[1]);
            $x2_end_day = $x2_end_day[0].":".$x2_end_day[1];
            $x2_end = " ~ ".$x2_datetime[0];
        } else {
            $x2_end = "";
        }
        ?>
        <span tooltip="<?=date("Y.m.d h:i", strtotime($view['wr_datetime']))." ~ ".$x2_datetime[0]." ".$x2_end_day;?>" flow="right"><?=date("Y.m.d", strtotime($view['wr_datetime'])).$x2_end;?></span>
    </section>
   <!----------| DOWNLOAD & IMAGE |--------->
    <?
    ## FILE : DOWNLOAD
    include_once("{$board_skin_path}/view/view.file.php");
    ?>
   <!----------| CONTENT & LINK |--------->
   <!----------| CONTENT |--------->
    <? if($view['content']) { ?>
        <table cellpadding="0" cellspacing="0" align="center" class="Table">
            <tr>
                <td colspan="2" class="Content">
                   <!----------| DAY MENU |--------->
                    <?
                    $jy_week_x = str_replace('|','',$view['jy_week']); // 요일 별 구분자 제거
                    if ($view['jy_target']||$view['jy_day']||$$jy_week_x||$view['jy_month']) {
                    ?>
                        <ul class="DayMenu">
                            <li>DAY MENU :</li>
                            <? if ($view['jy_target']) { ?>
                                <a href="#"><li onclick="document.getElementById('TARGET').style.display=(document.getElementById('TARGET').style.display=='none')?'block':'none';" tooltip="목표" flow="up">TARGET</li></a>
                            <? } ?>
                            <? if ($view['jy_day']) { ?>
                                <a href="#"><li onclick="document.getElementById('TODAY').style.display=(document.getElementById('TODAY').style.display=='none')?'block':'none';" tooltip="일일 계획" flow="up">DAY PLAN</li></a>
                            <? } ?>
                            <? if ($view['jy_week']) { ?>
                                <a href="#"><li onclick="document.getElementById('WEEK').style.display=(document.getElementById('WEEK').style.display=='none')?'block':'none';" tooltip="주 계획" flow="up">WEEK PLAN</li></a>
                            <? } ?>
                            <? if ($view['jy_month']) { ?>
                                <a href="#"><li onclick="document.getElementById('MONTH').style.display=(document.getElementById('MONTH').style.display=='none')?'block':'none';" tooltip="월 계획" flow="up">MONTH PLAN</li></a>
                            <? } ?>
                        </ul>
                    <? } ?>
                   <!----------| TARGET |--------->
                    <? if ($view['jy_target']) { ?>
                        <ul id="TARGET" class="Target" style="display:none;">
                            <div>JY . TARGET</div>
                            <?
                            $target = explode(",", $view['jy_target']);
                            for ($i=0; $i<count($target); $i++) {
                                if ($target[$i]) { echo "<li>".$target[$i]."</li>"; }
                            }
                            ?>
                        </ul>
                    <? } ?>
                   <!----------| WEEK PLAN |--------->
                    <?
                    $yoil = array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY");
                    $target_yoil = $yoil[date('w', strtotime(date('Y-m-d')))];	// 현재 2022-05-31 (화요일)
                    $jy_week = str_replace('|','',$view['jy_week']);
                    if ($jy_week) {
                    ?>
                    <ul id="WEEK" class="Week" style="display:none;">
                        <?
                        $week = explode("|", $view['jy_week']);
                        for ($i=0; $i<count($week); $i++) {
                            if ($i == date('w')) { echo "<li>".$target_yoil."</li><li>".$week[$i]."</li>"; }
                        }
                        ?>
                        <li class="More" onclick="document.getElementById('MORE').style.display=(document.getElementById('MORE').style.display=='none')?'block':'none';" tooltip="월 계획 : 더보기" flow="right">더보기</li>
                        </ul>
                    <? } ?>
                    <ul id="MORE" class="Mone" style="display:none;"">
                        <?
                        $Wname = array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY");
                        $week = explode("|", $view['jy_week']);
                        for ($i=0; $i<count($week); $i++) {
                            echo "<li><span>".$Wname[$i]."</span><span>".$week[$i]."</span></li>"; 
                        }
                        ?>
                    </ul>
                   <!----------| DAY PLAN |--------->
                    <? if ($view['jy_day']) { ?>
                        <ul id="TODAY" class="Week Today" style="display:none;">
                            <li>TODAY</li>
                            <?
                            $today = explode(",", $view['jy_day']);
                            for ($i=0; $i<count($today); $i++) {
                                if ($today[$i]) { echo "<li>".$today[$i]."</li>"; }
                            }
                            ?>
                        </ul>
                    <? } ?>
                   <!----------| MONTH PLAN |--------->
                    <? if ($view['jy_month']) { ?>
                        <ul id="MONTH" class="Week Today" style="display:none;">
                            <li>MONTH</li>
                            <?
                            $month = explode(",", $view['jy_month']);
                            for ($i=0; $i<count($month); $i++) {
                                if ($month[$i]) { echo "<li>".$month[$i]."</li>"; }
                            }
                            ?>
                        </ul>
                    <? } ?>
                   <!----------| MY LIFT |--------->
                    <?
                    if ($view['jy_1']||$view['jy_2']||$view['jy_3']||$view['jy_4']||$view['jy_5']||$view['jy_6']||$view['jy_7']||$view['jy_8']||$view['jy_9']||$view['jy_10']||$view['jy_11']||$view['jy_12']||$view['jy_13']||$view['jy_14']||$view['jy_15']) { $jy_life = 1;}
                    if ($jy_life) { 
                    ?>
                        <ul class="Life">
                            <div>MY LIFT</div>
                            <? if ($view['jy_1']) { ?><li>약 복용</li><? } ?>
                            <? if ($view['jy_2']) { ?><li>건강 관리</li><? } ?>
                            <? if ($view['jy_3']) { ?><li>면역력 강화</li><? } ?>
                            <? if ($view['jy_4']) { ?><li>청결</li><? } ?>
                            <? if ($view['jy_5']) { ?><li>산책/운동</li><? } ?>
                            <? if ($view['jy_6']) { ?><li>명상</li><? } ?>
                            <? if ($view['jy_7']) { ?><li>집 청소</li><? } ?>
                            <? if ($view['jy_8']) { ?><li>집 정리</li><? } ?>
                            <? if ($view['jy_9']) { ?><li>고양이 청소</li><? } ?>
                            <? if ($view['jy_10']) { ?><li>자산 관리</li><? } ?>
                            <? if ($view['jy_11']) { ?><li>쇼핑</li><? } ?>
                            <? if ($view['jy_12']) { ?><li>공부/학습</li><? } ?>
                            <? if ($view['jy_13']) { ?><li>드라이브</li><? } ?>
                            <? if ($view['jy_14']) { ?><li>여행</li><? } ?>
                            <? if ($view['jy_15']) { ?><li>투자</li><? } ?>
                            <? if ($view['jy_16']) { ?><li>미디어</li><? } ?>
                            <? if ($view['jy_17']) { ?><li>미용</li><? } ?>
                            <? if ($view['jy_18']) { ?><li>자전거</li><? } ?>
                        </ul>
                    <? } ?>
                   <!----------| ESSENTIAL WORK |--------->
                    <?
                    if ($view['jy_1']||$view['jy_2']||$view['jy_3']||$view['jy_4']||$view['jy_8']||$view['jy_9']) { $jy_work = 1;}
                    if ($jy_work) { 
                    ?>
                        <ul class="Work">
                            <div>ESSENTIAL WORK</div>
                            <? if ($view['jy_1']) { ?><li class="On">약 복용</li><? } else { ?><li class="Off">약 복용</li><? } ?> | 
                            <? if ($view['jy_2']) { ?><li class="On">건강 관리</li><? } else { ?><li class="Off">건강 관리</li><? } ?> | 
                            <? if ($view['jy_3']) { ?><li class="On">면역력 강화</li><? } else { ?><li class="Off">면역력 강화</li><? } ?> | 
                            <? if ($view['jy_4']) { ?><li class="On">청결</li><? } else { ?><li class="Off">청결</li><? } ?> | 
                            <? if ($view['jy_8']) { ?><li class="On">집 정리</li><? } else { ?><li class="Off">집 정리</li><? } ?> | 
                            <? if ($view['jy_9']) { ?><li class="On">고양이 청소</li><? } else { ?><li class="Off">고양이 청소</li><? } ?>

                        </ul>
                    <? } ?>
                   <!----------| BICYCLE |--------->
                    <?
                    if ($view['jy_19']||$view['jy_20']||$view['jy_21']||$view['jy_22']||$view['jy_23']) { $jy_bicycle = 1;}
                    if ($jy_bicycle) { 
                    ?>
                        <ul class="Life Bicycle">
                            <div>BICYCLE WALK</div>
                            <li class="B">출발</li>
                            <li class="N">→</li>
                            <? if ($view['jy_19']) { ?><li>편의점</li><? } ?>
                            <? if ($view['jy_19']) { ?><li class="N">→</li><? } ?>
                            <? if ($view['jy_20']) { ?><li>빼뽀</li><? } ?>
                            <? if ($view['jy_20']) { ?><li class="N">→</li><? } ?>
                            <? if ($view['jy_21']) { ?><li>홍동</li><? } ?>
                            <? if ($view['jy_21']) { ?><li class="N">→</li><? } ?>
                            <? if ($view['jy_22']) { ?><li>하나로마트</li><? } ?>
                            <? if ($view['jy_22']) { ?><li class="N">→</li><? } ?>
                            <? if ($view['jy_23']) { ?><li>장곡</li><? } ?>
                            <li class="N">→</li>
                            <li class="B">도착</li>
                        </ul>
                    <? } ?>
                   <!----------| REQUIRED PLAN |--------->
                    <? if ($board_pre['jy_required_b']||$board_pre['jy_required_s']||$board_pre['jy_required_u']) { ?>
                        <ul class="Plan Required">
                            <div>REQUIRED PLAN</div>
                            <?
                            if ($board_pre['jy_required_b']) {
                                $required_b = explode(":", $board_pre['jy_required_b']);
                            ?>
                                <li>
                                    <label><b>·</b> <?=$required_b[0];?></label>
                                    <?
                                    if ($required_b[1]) {
                                        $r_link = G5_BBS_URL."/board.php?bo_table=".$required_b[1];
                                    ?>
                                        <label><a href="<?=$r_link;?>" target="_blank"><button type="button"><?=$required_b[0];?> : 관련 페이지 이동</button></a></label>
                                    <? } ?>
                                </li>
                            <? } ?>
                            <? if ($board_pre['jy_required_s']) { ?>
                                <li>
                                    <label><b>·</b> <?=$board_pre['jy_required_s'];?></label>
                                    <label>
                                        <?
                                        $required_s = str_replace('http://','',$board_pre['jy_required_u']);
                                        $required_s = str_replace('https://','',$required_s);
                                        $required_s = "http://".$required_s;
                                        ?>
                                        <a href="<?=$required_s;?>" target="_blank"><button type="button"><?=$board_pre['jy_required_s'];?> : 관련 페이지 이동</button></a>
                                    </label>
                                </li>
                            <? } ?>
                        </ul>
                    <? } ?>
                   <!----------| TODAY'S PLAN |--------->
                    <? if ($view['jy_plan']) { ?>
                        <ul class="Plan">
                            <div>TODAY'S PLAN</div>
                            <?
                            $jy_plan = str_replace("(","<span>",$view['jy_plan']);
                            $jy_plan = str_replace(")","</span><label> : 완료</label>",$jy_plan);
                            ?>
                            <li><?=nl2br(stripslashes($jy_plan));?></li>
                        </ul>
                    <? } ?>
                   <!----------| CONTENT |--------->
                    <?
                    $vc = str_replace("%[","<span class='VcSpan'>",$view['content']);
                    $vc = str_replace("]%","</span>",$vc);
                    $vc = str_replace("[Table]","<div class='VcDiv'>",$vc);
                    $vc = str_replace("[/Table]","</div>",$vc);
                    $vc = str_replace("[Title]","<span class='VcTitle'>",$vc);
                    $vc = str_replace("[/Title]","</span>",$vc);
                    $vc = str_replace("[Sub]","<span class='VcSub'>",$vc);
                    $vc = str_replace("[/Sub]","</span>",$vc);
                    $vc = str_replace("[Box]\r<br/>","<div class='VcBox'>",$vc);
                    $vc = str_replace("[Line]","<div class='Line'>",$vc);
                    $vc = str_replace("[/Line]","</div>",$vc);
                    $vc = str_replace("[Clean]","<a href='{$jy_board}/jy_cleaning&p_menu={$p_menu}' target='_blank'><button type='button'><label>청소</label><label> | 상세보기</label>",$vc);
                    $vc = str_replace("[/Clean]","</button></a>",$vc);
                    $vc = str_replace("[/Box]","</div>",$vc);
                    $vc = str_replace("^[","<span class='VcTime'>",$vc);
                    $vc = str_replace("]^","</span>",$vc);
                    echo $vc;
                    ?>
                    <? if ($view['x2_end']) { ?>
                        <div class="TodayEnd">
                            <span>하루 끝 : <?=$view['x2_datetime'];?></span>
                        </div>
                    <? } ?>
                </td>
            </tr>
        </table>
    <? } ?>
   <!----------| CODE |--------->
    <? if($view['jy_code']) { ?>
        <table cellpadding="0" cellspacing="0" align="center" class="Code">
            <tr>
                <td class="Code">
                    <div class="Title">TODAY CODE</div>
                    <div class="Text"><?=nl2br(stripslashes($view["jy_code"]));?></div>
                </td>
            </tr>
        </table>
    <? } ?>
   <!----------| BTC |--------->
    <div class="Btc">
        <? 
        $to_btc = str_replace(',','',$view['jy_btc']);
        $pr_btc = str_replace(',','',$board_pre['jy_btc']);
        $ma_btc = number_format($to_btc-$pr_btc,2);
        ?>
        오늘 BTC : <?=$to_btc;?> USD | 이전 BTC : <?=$pr_btc;?> USD | 대비 변동 BTC : <?=$ma_btc;?> USD
    </div>
    <?
    ## FILE : IMAGE
    include_once("{$board_skin_path}/view/view.image.php");
    ?>
   <!----------| LINK |--------->
    <? if ($view['link'][1] || $view['link'][2]) { ?>
        <table cellpadding="0" cellspacing="0" align="center" class="Link">
            <?
            $cnt = 0;
            for ($i=1; $i<=count($view['link']); $i++) {
                if ($view['link'][$i]) {
                    $cnt++;
                    $link = cut_str($view['link'][$i], 100);
                    $view['link_href'][$i] = str_replace('127.0.0.1',$_SERVER['HTTP_HOST'],$view['link_href'][$i]); // 관리자 도메인을 사용자 도메인으로 치환
            ?>
                    <tr>
                        <td class="Left" onclick="window.open('<?=$view['link_href'][$i];?>')" tooltip="관련 링크 : 이동" flow="left">
                            관련 링크
                        </td>
                        <td class="Right">
                            <?=$link?>
                        </td>
                    </tr>
            <?
                }
            }
            ?>
        </table>
    <? } ?>
   <!----------| TAG |--------->
    <table cellpadding="0" cellspacing="0" align="center" class="Tag">
            <tr>
                <td class="Left">
                    태그
                </td>
                <td class="Right">
                    <?
                    $x2_tag = explode(",", $view['x2_tag']);
                    for ($i=0; $i<count($x2_tag); $i++) {
                    ?>
                        <div onclick="location.href='?bo_table=<?=$bo_table;?>&sfl=x2_tag&stx=<?=$x2_tag[$i];?>'">#<?=$x2_tag[$i];?></div>
                    <? } ?>
                </td>
            </tr>
    </table>
   <!----------| COMMENT |--------->
    <?//include_once(G5_BBS_PATH.'/view_comment.php');?>
   <!----------| PREV & NEXT |--------->
    <? if ($prev_href || $next_href) { ?>
    <section class='Next'>
        <? if ($prev_href) { ?>
            <button type='button' class='Left' onclick="location.href='<?=$prev_href;?>'" tooltip="다음 : 게시물 보기" flow="right"><label>다음</label><label><?=cut_str($prev_wr_subject,40,"…");?></label></button>
        <? } ?>
        <? if ($next_href) { ?>
            <button type='button' class='Right' onclick="location.href='<?=$next_href;?>'" tooltip="이전 : 게시물 보기" flow="left"><label><?=cut_str($next_wr_subject,40,"…");?></label><label>이전</label></button>
        <? } ?>
    </section>
    <? } ?>
   <!----------| COMMENT |--------->
    <? //include_once(G5_BBS_PATH.'/view_comment.php'); ## COMMENT ?>
   <!----------| BUTTON |--------->
    <section class='Button'>
        <div>
            <? if ($delete_href) { ?> <button type='button' onclick="location.href='<?=$delete_href;?>'" tooltip="삭제" flow="up">DELETE</button><? } ?>
            <? if ($copy_href) { ?> <button type='button' onclick="location.href='<?=$copy_href;?>'" tooltip="복사" flow="up">COPY</button><? } ?>
            <? if ($move_href) { ?> <button type='button' onclick="location.href='<?=$move_href;?>'" tooltip="이동" flow="up">MOVE</button><? } ?>
        &nbsp;</div>
        <div>
            <? if (!$code) { ?><span><button type='button' onclick="location.href='<?=$list_href;?>'" tooltip="목록" flow="up">LIST</button><? } ?>
            <? if ($search_href) { ?> <button type='button' onclick="location.href='<?=$search_href;?>'" tooltip="검색 목룍" flow="up"><? if (!$code) { echo "SEARCH LIST"; } ?></button><? } ?>
            </span>
        </div>
        <div>&nbsp;</div>
    </section>
    <!-- SCRIPT -->
    <? include_once("{$board_skin_path}/view/view.script.php"); ?>
 </article>
<!----------| HIDDEN : HEAD & TAIL & LocalPage|--------->
 <? if ($code == "no") { ?><style type="text/css">.HEAD, .TAIL, .LocalPage, #ADD-BOTTOM-BUTTON, #ADD-RIGHT-BUTTON, #top_btn { display:none; }</style><? } ?>