Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
cts.eemo.co.kr
/
public_html
/
src
/
web
/
view
/
doc
/
edits
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/cts.eemo.co.kr/public_html/src/web/view/doc/edits/doc_insert.php
<?php $board = $_REQUEST['board']; switch ($board) { case 1: $type = 'serum'; $title = '혈청 검사' ; break; case 2: $type = 'medicine'; $title = '농장 약품 사용 내역' ; break; case 3: $type = 'vaccination'; $title = '백신 접종프로그램' ; break; case 4: $type = 'house_salmonella'; $title = '농장 계사 환경 살모넬라 검사' ; break; case 5: $type = 'hatchery_salmonella'; $title = '부화장 환경 살모넬라 검사' ; break; case 6: $type = 'hatchery_inspection'; $title = '부화장 환경, 차량 위생검사' ; break; case 7: $type = 'chick_salmonella'; $title = '초생추 살모넬라' ; break; case 8: $type = 'sale'; $title = '초생추 분양 내역' ; break; case 9: $type = 'hygiene'; $title = '위생 관리' ; break; } ?> <link rel="stylesheet" href="/web/assets/vendor/libs/dropzone/dropzone.css"> <link rel="stylesheet" href="/web/assets/vendor/libs/flow-js/flow.css"> <script src="/web/assets/vendor/libs/dropzone/dropzone.js"></script> <script src="/web/assets/vendor/libs/flow-js/flow.js"></script> <script src="/web/assets/js/forms_file-upload.js"></script> <div class="card-box"> <div class="row"> <div class="col-md"> <div class="card mb-3"> <h5 class="card-header"> <button type="button" class="btn btn-lg "><i class="far fa-file d-block"> 검사파일 신규등록</i></button> </h5> <div class="card-body"><h4 class="card-title"></h4> <form enctype="multipart/form-data" action="./process/doc_process.php" method="post" id="frm_process" name="frm_process"> <table class="table table-borderless"> <tr> <td class=""> <div class="form-row"> <div class="col-auto"> <div class="input-group"> <div class="input-group-prepend"> <span class="input-group-text">파일 등록</span> </div> <label class="custom-file"> <input type="file" name="upload_file" id="upload_file" class="custom-file-input" onchange="sendFile('', this);"> <span class="custom-file-label" id="filename_view"></span> </label> </div> </div> <div class="col-auto"> <!--input type="file" name="upload_file" id="upload_file" /--> <input type="hidden" name="division" id="division" value="insert" /> <input type="hidden" name="board" id="board" value="<?php echo $board;?>" /> <input type="hidden" name="select_type" id="select_type" value="<?php echo $type;?>" /> </div> <input type="button" name="other<?php if($board == 6 || $board == 7) { echo '5'; }else { echo $board; } ?>" id="other<?php if($board == 6 || $board == 7) { echo 5; }else { echo $board; } ?>" class="btn btn-primary btn-md" value="<?php echo ('데이터 입력');?>" /> <div class="col-auto"> <a href="javascript:goList()" class="btn btn-primary btn-md"><i class="ion-navicon-round"></i><?php echo (" 목 록")?></a> </div> </div> </td> </tr> </table> </form> </div> </div> </div> </div> </div> <script> function sendFile(idx, obj) { if($(obj).val() != "" && $(obj).val() != null){ var arrFileTmp = $(obj).val().split('\\'); var fileTmp = arrFileTmp[arrFileTmp.length-1]; //console.log($(obj).val()); //console.log(fileTmp); $('#filename_view'+idx).text(fileTmp); } } var board = '<?php echo $board;?>'; //혈청검사 $('#other1').click(function() { // 파일이 선택되었는지 체크 var str = $('#upload_file').prop('files')[0]; // 미등록시 모달 if( str == undefined){ var obj = { "types" : "alert", "title" : "엑셀데이터 일괄등록 실패", "content" : "엑셀파일을 선택해주세요." }; alertModals(obj); return; } var data = new FormData(); data.append("mode","serum"); data.append("upload_file", $("input[id=upload_file]")[0].files[0]); data.append("division", $('#division').val()); data.append("board", $('#board').val()); data.append("select_type", $('#select_type').val()); $.ajax({ data: data, type: 'post', url: "../process/doc_process.php", cache: false, contentType: false, processData: false, dataType: 'json', success: function(data) { switch(data['msg']) { case "the file don't match" : var obj = { "types" : "alert", "title" : "잘못된 엑셀파일 등록", "content" : "혈청 검사 문서를 등록해주세요" }; alertModals(obj); break; case 'farm registration failed': var obj = { "types" : "alert", "title" : "존재하지 않는 농장", "content" : "농장 명에 맞는 농장을 먼저 등록해주세요" }; alertModals(obj); break; case 'farm and code mismatch': var obj = { "types" : "alert", "title" : "농장과 계군코드 불일치", "content" : "다른 농장에 계군 코드가 등록되어 있습니다" }; alertModals(obj); break; case 'flock_code registration failed': var obj = { "types" : "alert", "title" : "계군 코드 등록 실패", "content" : "계군 코드 등록에 실패 하였습니다" }; alertModals(obj); break; case 'f001': var obj = { "types" : "alert", "title" : "파일 첨부 실패", "content" : "파일첨부에 실패 하였습니다" }; alertModals(obj); break; case 'f002': var obj = { "types" : "alert", "title" : "파일 확장자 불일치", "content" : "엑셀 파일 확장자가 압니다." }; alertModals(obj); break; case 'f002': var obj = { "types" : "alert", "title" : "파일 확장자 불일치", "content" : "엑셀 파일 확장자가 압니다." }; alertModals(obj); break; case 'insert_success': alert("파일등록 성공"); location.href = '/doc/view/serum_view.php?idx='+ data['idx'] + '&parm_weeks=' + data['weeks'] + '#home' + data['weeks']; break; } }, error: function(error,request) { console.log('code:' + request.status+'\n'+'message: '+request.responseText+'\n'+'error: '+error); } }); }); // 농장 약품 사용 내역 $('#other2').click(function() { // 파일이 선택되었는지 체크 var str = $('#upload_file').prop('files')[0]; // 미등록시 모달 if( str == undefined){ var obj = { "types" : "alert", "title" : "엑셀데이터 일괄등록 실패", "content" : "엑셀파일을 선택해주세요." }; alertModals(obj); return; } var data = new FormData(); data.append("mode","medicine"); data.append("upload_file", $("input[id=upload_file]")[0].files[0]); data.append("division", $('#division').val()); data.append("board", $('#board').val()); data.append("select_type", $('#select_type').val()); $.ajax({ data: data, type: 'post', url: "../process/doc_process.php", cache: false, contentType: false, processData: false, dataType: 'json', success: function(data) { switch(data['msg']) { case "the file don't match" : var obj = { "types" : "alert", "title" : "잘못된 엑셀파일 등록", "content" : "농장 약품 사용 내역 문서를 등록해주세요" }; alertModals(obj); break; case 'farm registration failed': var obj = { "types" : "alert", "title" : "존재하지 않는 농장", "content" : "농장 명에 맞는 농장을 먼저 등록해주세요" }; alertModals(obj); break; case 'farm and code mismatch': var obj = { "types" : "alert", "title" : "농장과 계군코드 불일치", "content" : "다른 농장에 계군 코드가 등록되어 있습니다" }; alertModals(obj); break; case 'insert_success': location.href = '/doc/view/medicine_view.php?idx='+ data['idx']+'&farm_code='+data['farm_code']; break; } }, error: function(error,request) { console.log('code:' + request.status+'\n'+'message: '+request.responseText+'\n'+'error: '+error); } }); }); // 백신 접종프로그램 $('#other3').click(function() { // 파일이 선택되었는지 체크 var str = $('#upload_file').prop('files')[0]; // 미등록시 모달 if( str == undefined){ var obj = { "types" : "alert", "title" : "엑셀데이터 일괄등록 실패", "content" : "엑셀파일을 선택해주세요." }; alertModals(obj); return; } var data = new FormData(); data.append("mode","vaccination"); data.append("upload_file", $("input[id=upload_file]")[0].files[0]); data.append("division", $('#division').val()); data.append("board", $('#board').val()); data.append("select_type", $('#select_type').val()); $.ajax({ data: data, type: 'post', url: "../process/doc_process.php", cache: false, contentType: false, processData: false, dataType: 'json', success: function(data) { switch(data['msg']) { case "the file don't match" : var obj = { "types" : "alert", "title" : "잘못된 엑셀파일 등록", "content" : "백신 접종프로그램 문서를 등록해주세요" }; alertModals(obj); break; case 'farm registration failed': var obj = { "types" : "alert", "title" : "존재하지 않는 농장", "content" : "농장 명에 맞는 농장을 먼저 등록해주세요" }; alertModals(obj); break; case 'farm and code mismatch': var obj = { "types" : "alert", "title" : "농장과 계군코드 불일치", "content" : "다른 농장에 계군 코드가 등록되어 있습니다" }; alertModals(obj); break; case 'flock code is empty': var obj = { "types" : "alert", "title" : "계군코드 없음", "content" : "문서명에 계군코드를 확인해주세요." }; alertModals(obj); break; case 'insert_success': location.href = '/doc/view/vaccination_view.php?idx='+ data['idx']+'&farm_code='+data['farm_code']; break; } }, error: function(error,request) { console.log('code:' + request.status+'\n'+'message: '+request.responseText+'\n'+'error: '+error); } }); }); // 농장 계사 환경 살모넬라 검사 $('#other4').click(function() { // 파일이 선택되었는지 체크 var str = $('#upload_file').prop('files')[0]; // 미등록시 모달 if( str == undefined){ var obj = { "types" : "alert", "title" : "엑셀데이터 일괄등록 실패", "content" : "엑셀파일을 선택해주세요." }; alertModals(obj); return; } var data = new FormData(); data.append("mode","house_salmonella"); data.append("upload_file", $("input[id=upload_file]")[0].files[0]); data.append("division", $('#division').val()); data.append("board", $('#board').val()); data.append("select_type", $('#select_type').val()); $.ajax({ data: data, type: 'post', url: "../process/doc_process.php", cache: false, contentType: false, processData: false, dataType: 'json', success: function(data) { switch(data['msg']) { case "the file don't match" : var obj = { "types" : "alert", "title" : "잘못된 엑셀파일 등록", "content" : "농장 계사 환경 살모넬라 검사 문서를 등록해주세요" }; alertModals(obj); break; case 'farm registration failed': var obj = { "types" : "alert", "title" : "존재하지 않는 농장", "content" : "농장 명에 맞는 농장을 먼저 등록해주세요" }; alertModals(obj); break; case 'farm and code mismatch': var obj = { "types" : "alert", "title" : "농장과 계군코드 불일치", "content" : "다른 농장에 계군 코드가 등록되어 있습니다" }; alertModals(obj); break; case 'form is invalid': var obj = { "types" : "alert", "title" : "샘플 채취자 폼 이상", "content" : "신 양식으로 수정 바랍니다" }; alertModals(obj); break; case 'insert_success': location.href = '/doc/view/house_salmonella_view.php?idx='+ data['idx'] + "&parm_weeks=" +data['weeks']; break; } }, error: function(error,request) { console.log('code:' + request.status+'\n'+'message: '+request.responseText+'\n'+'error: '+error); } }); }); // 부화장 환경 검사 $('#other5').click(function() { // 파일이 선택되었는지 체크 var str = $('#upload_file').prop('files')[0]; // 미등록시 모달 if( str == undefined){ var obj = { "types" : "alert", "title" : "엑셀데이터 일괄등록 실패", "content" : "엑셀파일을 선택해주세요." }; alertModals(obj); return; } var data = new FormData(); data.append("mode","hatchery"); data.append("upload_file", $("input[id=upload_file]")[0].files[0]); data.append("division", $('#division').val()); data.append("board", $('#board').val()); data.append("select_type", $('#select_type').val()); $.ajax({ data: data, type: 'post', url: "/doc/process/doc_process.php", cache: false, contentType: false, processData: false, dataType: 'json', success: function(data) { switch(data['msg']) { case "the file don't match" : var obj = { "types" : "alert", "title" : "잘못된 엑셀파일 등록", "content" : "부화장 환경 검사 문서를 등록해주세요" }; alertModals(obj); break; case 'farm registration failed': var obj = { "types" : "alert", "title" : "존재하지 않는 부화장", "content" : "부화장을 먼저 등록해주세요" }; alertModals(obj); break; case 'invalid sheet': var obj = { "types" : "alert", "title" : "잘못된 시트 포함", "content" : data['filename'] + " 시트가 포함되어 있습니다" }; alertModals(obj); break; case 'farm and code mismatch': var obj = { "types" : "alert", "title" : "농장과 계군코드 불일치", "content" : "다른 농장에 계군 코드가 등록되어 있습니다" }; alertModals(obj); break; case 'form is invalid': var obj = { "types" : "alert", "title" : "샘플 채취자 폼 이상", "content" : "시트 중 샘플 채취자 폼이 잘못 되었습니다." }; alertModals(obj); break; case 'insert_success': location.href = '/doc/hatcheryList/hatchery_sanitation_list.php?page=1'; break; } }, error: function(error,request) { console.log('code:' + request.status+'\n'+'message: '+request.responseText+'\n'+'error: '+error); } }); }); // 초생추 분양내역 $('#other8').click(function() { // 파일이 선택되었는지 체크 var str = $('#upload_file').prop('files')[0]; // 미등록시 모달 if( str == undefined){ var obj = { "types" : "alert", "title" : "엑셀데이터 일괄등록 실패", "content" : "엑셀파일을 선택해주세요." }; alertModals(obj); return; } var data = new FormData(); data.append("mode","sale"); data.append("upload_file", $("input[id=upload_file]")[0].files[0]); data.append("division", $('#division').val()); data.append("board", $('#board').val()); data.append("select_type", $('#select_type').val()); $.ajax({ data: data, type: 'post', url: "../process/doc_process.php", cache: false, contentType: false, processData: false, dataType: 'json', success: function(data) { switch(data['msg']) { case "the file don't match" : var obj = { "types" : "alert", "title" : "잘못된 엑셀파일 등록", "content" : "초생추 분양내역 문서를 등록해주세요" }; alertModals(obj); break; case 'insert_success': location.href = '/doc/view/sale_view.php?idx='+data['idx']+'&sheet_name=월'; break; } }, error: function(error,request) { console.log('code:' + request.status+'\n'+'message: '+request.responseText+'\n'+'error: '+error); } }); }); // 위생관리 $('#other9').click(function() { // 파일이 선택되었는지 체크 var str = $('#upload_file').prop('files')[0]; // 미등록시 모달 if( str == undefined){ var obj = { "types" : "alert", "title" : "엑셀데이터 일괄등록 실패", "content" : "엑셀파일을 선택해주세요." }; alertModals(obj); return; } var data = new FormData(); data.append("mode","hygiene"); data.append("upload_file", $("input[id=upload_file]")[0].files[0]); data.append("division", $('#division').val()); data.append("board", $('#board').val()); data.append("select_type", $('#select_type').val()); $.ajax({ data: data, type: 'post', url: "../process/doc_process.php", cache: false, contentType: false, processData: false, dataType: 'json', success: function(data) { switch(data['msg']) { case "the file don't match" : var obj = { "types" : "alert", "title" : "잘못된 엑셀파일 등록", "content" : "위생관리 문서를 등록해주세요." }; alertModals(obj); break; case 'insert_success': location.href = '/doc/view/hygiene_view.php?idx='+data['idx']+'&reception_number='+data['reception_number']; break; } }, error: function(error,request) { console.log('code:' + request.status+'\n'+'message: '+request.responseText+'\n'+'error: '+error); } }); }); function goList() { history.go(-1); } </script>