Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
cts.eemo.co.kr
/
public_html
/
src
/
web
/
view
/
doc
/
view
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/cts.eemo.co.kr/public_html/src/web/view/doc/view/farm_view.php
<div id="view-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="CenterModalLabel" style="display:;" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-header"> <h5 class="title"><?php echo ("농장이미지 수정"); ?></h5> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> <div id="thumnailList" name="thumnailList"></div> </div> <div class="modal-footer"> <div class="fileupload btn btn-primary btn-sm waves-effect waves-light"> <span><?php echo ("새 이미지 등록")?></span> <input type="file" class="upload" id="FileBox" name="FileBox" onchange="sendFile();"> </div> </div> </div> </div> </div> <a class="btn btn-primary" id="img_mng" name="img_mng" data-toggle="modal" data-target="#view-modal">농장이미지 수정</a> <div class="card-box" > <div class="tab-content card-block"> <div class="tab-pane active" id="tab_card_default" role="tabpanel"> <div class="row"> <div class="col-sm-3"> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel" data-interval="3000"> <ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-slide-to="0" class=""></li> <li data-target="#carouselExampleIndicators" data-slide-to="1" class="active"></li> </ol> <div class="carousel-inner"> <div class="carousel-item active"> <img class="d-block w-100" style="width:400px;height:250px;" src="/files/farm/닭농장1.jpg" alt="First slide"> </div> <div class="carousel-item"> <img class="d-block w-100" style="width:400px;height:250px;" src="/files/farm/소1.jpg" alt="Second slide"> </div> </div> <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </div> <div class="col-sm-9"> <div class="table-responsive"> <table class="table table-bordered"> <thead class="thead-light text-center"> <tr class=""> <th>농장코드</th> <th>농장이름</th> <th>농장주</th> <th>연세</th> <th>핸드폰번호</th> <th>농장 전화번호</th> </tr> </thead> <tbody> <tr > <td ></td> <div class="col-sm-3"> <td><input type="text" class="input_set form-control" id="farm_name" name="farm_name" placeholder="농장명 입력 "/></td> <td><input type="text" class="input_set form-control" id="farm_admin" name="farm_admin" placeholder="농장주 입력"/></td> <td><input type="text" class="input_set form-control" id="farm_admin_age" name="farm_admin_age" placeholder="농장주연세"/></td> <td><input type="text" class="input_set form-control" id="farm_phone" name="farm_phone" placeholder="핸드폰번호 입력"/></td> </tr></tbody> </table> </div> <div class="table-responsive"> <table class="table table-bordered"> <thead class="thead-light text-center"> <tr> <th>농장주소</th> <th>HACCP</th> </tr> </thead> <tbody> <tr> <td> <!--input type="text" class="form-control" id="farm_address" name="farm_address" value="58232 undefined undefined" /--> <div class="row"> <div class="col-sm-2"> <a class="btn btn-primary" href="javascript:viewPostCode('farm_postcode','farm_address_1','farm_address_2');">우편번호 검색</a> </div> <div class="col-sm-2"> <input type="text" class="form-control" id="farm_postcode" name="farm_postcode" onclick="javascript:viewPostCode('farm_postcode','farm_address_1','farm_address_2');" readonly=""> </div> <div class="col-sm-5"> <input type="text" class="form-control" id="farm_address_1" name="farm_address_1" onclick="javascript:viewPostCode('farm_postcode','farm_address_1','farm_address_2');" readonly=""> </div> <div class="col-sm-3"> <input type="text" class="form-control input_set" id="farm_address_2" name="farm_address_2" placeholder="상세 주소"> </div> </div> </td> <td class="text-center"><label class="label label-success">YES</label></td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <style> .input_set { width:100%; height:100%; font-size:15px; text-align:center; } </style> <script src="http://dmaps.daum.net/map_js_init/postcode.v2.js"></script> <script charset="UTF-8" type="text/javascript" src="http://t1.daumcdn.net/postcode/api/core/190107/1546836247227/190107.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.2.2/jquery.form.min.js" integrity="sha384-FzT3vTVGXqf7wRfy8k4BiyzvbNfeYjK+frTVqZeNDFl8woCbF0CYG6g2fMEFFo/i" crossorigin="anonymous"></script> <script> function viewPostCode($postCode,$addr1,$addr2) { new daum.Postcode({ oncomplete: function(data) { // 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분. // 각 주소의 노출 규칙에 따라 주소를 조합한다. // 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다. var fullAddr = ''; // 최종 주소 변수 var extraAddr = ''; // 조합형 주소 변수 // 사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다. if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우 fullAddr = data.roadAddress; } else { // 사용자가 지번 주소를 선택했을 경우(J) fullAddr = data.jibunAddress; } // 사용자가 선택한 주소가 도로명 타입일때 조합한다. if(data.userSelectedType === 'R'){ //법정동명이 있을 경우 추가한다. if(data.bname !== ''){ extraAddr += data.bname; } // 건물명이 있을 경우 추가한다. if(data.buildingName !== ''){ extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName); } // 조합형주소의 유무에 따라 양쪽에 괄호를 추가하여 최종 주소를 만든다. fullAddr += (extraAddr !== '' ? ' ('+ extraAddr +')' : ''); } // 우편번호와 주소 정보를 해당 필드에 넣는다. document.getElementById($postCode).value = data.zonecode; //5자리 새우편번호 사용 document.getElementById($addr1).value = fullAddr; // 커서를 상세주소 필드로 이동한다. document.getElementById($addr2).focus(); } }).open(); } function sendFile() { var data = new FormData(); data.append("mode", "upload-file"); data.append("upload_file", $('input[id=FileBox]')[0].files[0]); // data.append("fileCntUpdateYn", "N");//게시판 테이블에 cnt_files +1 update 유무 $.ajax({ data: data, type: 'POST', url: "img_process.php", cache: false, contentType: false, processData: false, dataType: 'json', success: function(json) { console.log(json); var result = json.result; var msg = json.msg; if(result == "1"){//파일업로드 성공시 getFiles(); var obj = { "types" : "alert", "title" : "MessageBox", "content" : "파일을 등록하였습니다." }; alertModals(obj); }else{//실패시 실패 메세지를 띄어준다. var obj = { "types" : "alert", "title" : "MessageBox", "content" : "첨부파일 등록을 실패하였습니다." }; alertModals(obj); } } }); } function delFileProcess(paramIdx, paramJoinCode, bool){ if(bool){ $.post("img_process.php?mode=delFile", { idx: paramIdx, joinCode: paramJoinCode, mode: "delFile"}, function(data) { var tmp = JSON.parse(data); if(tmp.delFileResult==1){ getFiles(); } else{ var obj = { "types" : "alert", "title" : "MessageBox", "content" : "삭제를 실패하였습니다.", }; alertModals(obj); } }); } } function delFile(paramIdx, paramJoinCode){ var obj = { "types" : "confirm", "title" : "MessageBox", "content" : "삭제하시겠습니까? 삭제된 파일은 복구할 수 없습니다.", "lbFunction" : "delFileProcess('"+paramIdx+"', '"+paramJoinCode+"', true)", "rbFunction" : "delFileProcess('"+paramIdx+"', '"+paramJoinCode+"', false)" }; alertModals(obj); } function getFiles(){ var joinCode = $('#paramFarmCode').val(); $('#thumnailList').empty(); $.getJSON("img_process.php", {paramJoinCode: joinCode, mode: "getFiles"}, function(json) { $.each(json.data, function(k, row) { console.log(row); var htmlTmp = "<div class=\"form-group row\">"; htmlTmp += " <div class=\"col-auto\">"; htmlTmp += " <img style=\"width:120px;height:80px;\" src=\"/files/farm/"+row.system_filename+"\" class=\"img-fluid img-thumbnail\">"; htmlTmp += " </div>"; htmlTmp += " <div class=\"col-auto\">"; htmlTmp += " <span class=\"align-middle\">파일명 : "+row.real_filename+"</span><br/>"; htmlTmp += " <a href=\"javascript:delFile('"+row.idx+"','"+row.join_code+"')\" class=\"btn btn-primary w-md\" id=\"img_mng_del\" name=\"img_mng_del\"><?php echo (" 삭 제 "); ?></a>"; htmlTmp += " </div>"; htmlTmp += "</div>"; $("#thumnailList").append(htmlTmp); }); }); } $(document).ready(function() {//초기에 모달창 오픈 // getFiles(); }); </script>