Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ltms.eemo.co.kr
/
public_html
/
super
/
Or
Select Your Path :
Upload File :
New :
File
Dir
//home/ltms.eemo.co.kr/public_html/super/control_center_prc_cctv_bg.php
<?php /* DB 연결을 위한 세팅 */ include_once("inc_header.php"); switch ($_REQUEST['type']) { case 'view': viewCnt(); break; default: # code... break; } function viewCnt() { // 트랜젝션 시작 mysql_query("SET AUTOCOMMIT=0;"); mysql_query("START TRANSACTION"); $viewCnt = $_REQUEST['viewCnt']; $farm_no = $_REQUEST['farm_no']; $contract_no = $_REQUEST['contract_no']; $sqlQuery = "UPDATE farm_cctv_setting SET view_count = $viewCnt"; $sqlRes = mysql_query($sqlQuery); mysql_query("COMMIT"); // 화면 세팅 $tmpQuery = "SELECT * FROM farm_cctv_setting LIMIT 1"; $objSet = mysql_fetch_object(mysql_query($tmpQuery)); $fullSet = $objSet->is_full; $viewSet = $objSet->view_count; ?> <?php for ($i=1; $i < 26; $i++) { ?> <div class="videoBox" style="order:<?=$i?>; overflow:hidden;"> <!-- 비디오 박스 text 들 --> <?php // 데이터를 담을 배열 변수 $arrData = array(); if($farm_no == 200 ) { // 임시 시연회를 위함 조건 $qryChannel = mysql_query("SELECT * FROM farm_ipcamera FI, farm_contract FC WHERE 1 AND FI.farm_no = FC.farm_no AND FC.`no`= $contract_no AND FC.ltms_status = 100 AND FI.farm_no = $farm_no AND FI.ch_no = $i"); }else { $qryChannel = mysql_query("SELECT * FROM farm_ipcamera FI, farm_contract FC WHERE 1 AND FI.farm_no = FC.farm_no AND FC.`no`= $contract_no AND FC.ltms_status = 5 AND FI.farm_no = $farm_no AND FI.ch_no = $i"); } // 현재 사육중 인지 아닌지 판단 후 .. 농장번호, 동번호를 추출 ( 채널로 비교하는 것이 중요 채널이 업데이트 되면 함께 그 위치에 뿌려준다) // 객체에 담는다 $objChannelInfo = mysql_fetch_object($qryChannel); // 채널이 존제 하지 않을 경우 빈객체 처리 if(empty($objChannelInfo) || $viewCnt > 20) { // 비어있으면 아무런 처리도 하지 않는다. $qryDong = mysql_query("SELECT * FROM farm_ipcamera FI, farm_contract FC WHERE 1 AND FI.farm_no = FC.farm_no AND FC.farm_no = $farm_no AND FI.ch_no = $i "); $objDong = mysql_fetch_object($qryDong); $qryFarm = mysql_query("SELECT * FROM farm WHERE `no` = $farm_no "); $objFarm = mysql_fetch_object($qryFarm); echo "<div class='textBoxs'>"; for ($x=0; $x < 5; $x++) { if($x==2) { $strTemp = str_replace("한국원종","",$objFarm->farm_name); $strTemp = str_replace("농장","",$strTemp); echo "<div class='textBox use_text text-farm' style='order:$x;'><div style='text-shadow: 1px 1px 1px'>$strTemp</div></div>"; }else if($x==3) { echo "<div class='textBox use_text text-dong' style='order:$x;'><div style='text-shadow: 1px 1px 1px'>$objDong->dong_info</div></div>"; }else { echo "<div class='textBox' style='order:$x; visibility: hidden;'><div class='textB'>$x</div></div>"; } } echo "</div>"; }else if($objChannelInfo->dong_no == 0){ // object | 동 정보를 가져오기 $qryFarm = mysql_query("SELECT * FROM farm WHERE `no` = $farm_no "); $objFarm = mysql_fetch_object($qryFarm); echo "<div class='textBoxs'>"; for ($x=0; $x < 5; $x++) { if($x==2) { $strTemp = str_replace("한국원종","",$objFarm->farm_name); echo "<div class='textBox use_text text-farm' style='order:$x;'><div style='text-shadow: 1px 1px 1px'>$strTemp</div></div>"; }else if($x==3) { echo "<div class='textBox use_text text-dong' style='order:$x;'><div style='text-shadow: 1px 1px 1px'></div></div>"; }else { echo "<div class='textBox' style='order:$x; visibility: hidden;'><div class='textB'>$x</div></div>"; } } echo "</div>"; }else{ // 파츠 넘버 $objPartsNo = mysql_fetch_object(mysql_query("SELECT `no` FROM farm_contract_parts WHERE contract_no=$contract_no order by no desc limit 0,1 ")); // 계약 정보 if(empty($objPartsNo->no)){ // 파츠 정보가 없이 넘오오는 농가 에러 방지 $qryDong = mysql_query("SELECT * FROM farm_ipcamera FI, farm_contract FC WHERE 1 AND FI.farm_no = FC.farm_no AND FC.farm_no = $farm_no AND FI.ch_no = $i "); $objDong = mysql_fetch_object($qryDong); $qryFarm = mysql_query("SELECT * FROM farm WHERE `no` = $farm_no "); $objFarm = mysql_fetch_object($qryFarm); echo "<div class='textBoxs'>"; for ($x=0; $x < 5; $x++) { if($x==3) { echo "<div class='textBox use_text text-dong' style='order:$x;'><div style='text-shadow: 1px 1px 1px'>$objDong->dong_info</div></div>"; }else { echo "<div class='textBox' style='order:$x; visibility: hidden;'><div class='textB'>$x</div></div>"; } } echo "</div>"; }else { $parts_no = $objPartsNo->no; // array | 온습도|센서 정보 가져오기 $qryIot = mysql_query("SELECT * FROM iot_raw WHERE 1 AND farm_no = $objChannelInfo->farm_no AND dong_no = $objChannelInfo->dong_no AND SUBSTRING(jtime,1,16) = SUBSTRING(NOW(),1,16) GROUP BY sensor_code "); $arrIot = array(); while($rs = mysql_fetch_array($qryIot)){ $arrIot[] = $rs; } // object | 동 정보를 가져오기 $qryDong = mysql_query("SELECT * FROM farm_dong_info FDI, farm F WHERE 1 AND F.`no` = FDI.farm_no AND FDI.`no`= $objChannelInfo->dong_no "); $objDong = mysql_fetch_object($qryDong); // object | 입추 정보 p::승인 완료 = 1 // $qryIpchu = mysql_query("SELECT * FROM farm_ipchu_confirm_log WHERE 1 AND farm_no = $objChannelInfo->farm_no AND dong_no = $objChannelInfo->dong_no AND is_auth = 1 ORDER BY `no` DESC LIMIT 1"); // $objIpchu = mysql_fetch_object($qryIpchu); $objIpchu=mysql_fetch_object(mysql_query("SELECT sum(susu) AS ipchu_susu FROM farm_ipchu_confirm_log WHERE parts_no=$parts_no AND dong_no=$objChannelInfo->dong_no ")); // 총도태 : 총폐사 $objDP=mysql_fetch_object(mysql_query("SELECT sum(dote+pesa) AS sum_dpesa, sum(dote) AS dote, sum(pesa) AS pesa FROM farm_dote_input_log WHERE parts_no=$parts_no AND dong_no=$objChannelInfo->dong_no ")); // object | 도태|폐사 정보를 가져오기 p::현재 날짜와 같은 날 정보만 //$qryDP = mysql_query("SELECT * FROM farm_dote_input_log WHERE 1 AND farm_no = $objChannelInfo->farm_no AND dong_no = $objChannelInfo->dong_no AND jdate = CURRENT_DATE ORDER BY jdate DESC LIMIT 1"); // object | 일령 $qryDay = mysql_query("SELECT DATEDIFF(CURRENT_DATE,jdate) AS cDay FROM farm_ipchu_confirm_log WHERE 1 AND farm_no = $objChannelInfo->farm_no AND dong_no=$objChannelInfo->dong_no AND is_auth = 1 ORDER BY regdate DESC LIMIT 1"); $objDay = mysql_fetch_object($qryDay); // 육성률 // $qryGrow = mysql_query("SELECT tmp_ipchu_susu, tmp_dopesa_su , ((tmp_ipchu_susu-tmp_dopesa_su)/tmp_ipchu_susu*100) AS grow FROM farm_contract WHERE `no` = $contract_no AND farm_no = $farm_no "); // $objGrow = mysql_fetch_object($qryGrow); $grow = @round((($objIpchu->ipchu_susu - $objDP->sum_dpesa)/$objIpchu->ipchu_susu) * 100,2); ?> <div class="textBoxs"> <?php for ($x=0; $x < 25; $x++) { //if($x==0 || $x==4 || $x==20 || $x==24 ) { if($x==0 ||$farm_no == 203) { $tempA = $arrIot[0]['temp']; $humiA = $arrIot[0]['humi']; echo "<div class='textBox use_text text-th' style='order:$x;'><div style='text-shadow: 1px 1px 1px' >$tempA"."˚ / $humiA%</div></div>"; // }else if($x==2) { // echo "<div class='textBox use_text text-farm' style='order:$x;'><div style='text-shadow: 1px 1px 1px'>$objDong->farm_name</div></div>"; }else if($x==3) { echo "<div class='textBox use_text text-dong' style='order:$x;'><div style='text-shadow: 1px 1px 1px'>$objDong->dong_name</div></div>"; }else if($x==4) { $tempB = $arrIot[1]['temp']; $humiB = $arrIot[1]['humi']; echo "<div class='textBox use_text text-th' style='order:$x;'><div style='text-shadow: 1px 1px 1px' >$tempA"."˚ / $humiA%</div></div>"; }else if($x==5) { echo "<div class='textBox use_text text-day' style='order:$x;'><div style='color: chartreuse; text-shadow: 1px 1px 1px blakc;' >일령 : $objDay->cDay</div></div>"; }else if($x==9) { $growRound = round($objGrow->grow,1); echo "<div class='textBox use_text text-right' style='order:$x;'>"; echo "<div class='text-susu' style='color: gold;text-shadow: 1px 1px 1px black;'>입추 : $objIpchu->ipchu_susu</div><br />"; echo "<div class='text-dote' style='color: gold;text-shadow: 1px 1px 1px black;'>도태 : $objDP->dote</div><br />"; echo "<div class='text-pesa' style='color: gold;text-shadow: 1px 1px 1px black;'>폐사 : $objDP->pesa</div><br />"; echo "<div class='text-grow' style='color: gold;text-shadow: 1px 1px 1px black;'>육성률 : $grow%</div>"; echo "</div>"; }else if($x==15) { echo "<div class='textBox use_text text-fan' style='order:$x;'><div>정전(FAN)</div></div>"; }else if($x==19) { echo "<div class='textBox use_text text-heater' style='order:$x;'><div>정전(HEATER)</div></div>"; }else if($x==20) { $tempA = $arrIot[2]['temp']; $humiA = $arrIot[2]['humi']; echo "<div class='textBox use_text text-th' style='order:$x;'><div style='text-shadow: 1px 1px 1px' >$tempA"."˚ / $humiA%</div></div>"; }else if($x==24) { $tempA = $arrIot[3]['temp']; $humiA = $arrIot[3]['humi']; echo "<div class='textBox use_text text-th' style='order:$x;'><div style='text-shadow: 1px 1px 1px' >$tempA"."˚ / $humiA%</div></div>"; }else { echo "<div class='textBox' style='order:$x; visibility: hidden;'><div class='textB'>$x</div></div>"; } } // 채널이 있을 경우 처리 완료 ?> </div> <!-- End textBoxs --> <?} }?> <? // 채널에 맞는 비디오 출력 // echo "SELECT * FROM farm_ipcamera WHERE farm_no= $farm_no AND ch_no = $i"; $objVideo = mysql_fetch_object(mysql_query("SELECT * FROM farm_ipcamera WHERE farm_no= $farm_no AND ch_no = $i")); ?> <video id="video<?=$i?>" draggable="true" droppable="true" ondragstart="drag(event);" ondrop="drop(event);" ondragover="allowDrop(event);" class="video-js videos " muted data-setup="{}" autoplay preload="none"> <source src="<?=$objVideo->hls_url?>" type="application/x-mpegURL"> </video> </div> <?php }?> <!-- <i class="fa arrow-up fa_angle_double"></i> --> <i class="fa fa-window-close fa_angle_double position-absolute" style="bottom:0;" aria-hidden="true"></i> <!-- rightMenu --> <div class="right_menu"> <ul class="nav nav-pills nav-stacked p-1"> <li class="nav-item"> <a href="#play" class="nav-link active " data-toggle="tab">재생</a> </li> <!-- 저장영상은 웹에서 실행 필요없음 --> <!-- <li class="nav-item"> <a href="#record" class="nav-link" data-toggle="tab">저장영상</a> </li> --> <li class="nav-item"> <a href="#setting" class="nav-link" data-toggle="tab">설정</a> </li> </ul> <div class="tab-content p-2 invisible-scrollbar" style="overflow-y: scroll; height: 110px"> <div class="tab-pane fade show active text-white" id="play"> <div class="m-2 float-left w-25"> <p class="m-0">전체화면</p> <button class="btn btn-outline-light w-25 m-1 fullScreen"> <i class="fa fa-window-maximize" aria-hidden="true"></i> </button> </div> <div class="m-2 float-left w-25"> <p class="m-0">화면분할</p> <button class="btn btn-outline-light view-count videoNo1">1</button> <button class="btn btn-outline-light view-count videoNo4">4</button> <button class="btn btn-outline-light view-count videoNo9">9</button> <button class="btn btn-outline-light view-count videoNo16">16</button> <button class="btn btn-outline-light view-count videoNo25">25</button> <button class="btn btn-outline-light view-count videoNo36">36</button> </div> <div class="m-2 float-left w-25 d-none"> <p class="m-0">자동회전</p> <div class="switchBox"> <input type="checkbox" class="js-switch-small switchery-small sw_spin" /> </div> </div> <div class="m-2 float-left w-25"> <p class="m-0">텍스트</p> <input type="checkbox" class="js-switch-small switchery-small sw_text" checked /> </div> </div><!-- End 재생메뉴--> <div class="tab-pane fade text-white" id="setting"> <div class="m-2"> <p class="m-0">농장</p> <div class="chkBoxs"> <!-- <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_temp" checked> <label class="custom-control-label" for="chk_temp">온도</label> </div> --> <!-- <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input" id="chk_humi" checked> <label class="custom-control-label" for="chk_humi">습도</label> </div> --> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_farm" checked> <label class="custom-control-label" for="chk_farm">농가명</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_dong" checked> <label class="custom-control-label" for="chk_dong">동이름</label> </div> </div> </div> <div class="m-2"> <p class="m-0">사육관리항목</p> <div class="chkBoxs"> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_day" checked> <label class="custom-control-label" for="chk_day">일령</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_count" checked> <label class="custom-control-label" for="chk_count">입추수수</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_dote" checked> <label class="custom-control-label" for="chk_dote">도태</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_pesa" checked> <label class="custom-control-label" for="chk_pesa">폐사</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_grow" checked> <label class="custom-control-label" for="chk_grow">육성률</label> </div> </div> </div> <div class="m-2"> <p class="m-0">IOT항목</p> <div class="chkBoxs"> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_th" checked> <label class="custom-control-label" for="chk_th">온습도</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_power" > <label class="custom-control-label" for="chk_power">전원</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_fan" > <label class="custom-control-label" for="chk_fan">정전(FAN)</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_heater" > <label class="custom-control-label" for="chk_heater">정전(HEATER)</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input chk_check" id="chk_weight"> <label class="custom-control-label" for="chk_weight">체중</label> </div> </div> </div> </div><!-- End 설정 메뉴 --> </div><!-- End Tab --> </div><!-- End RightMenu --> <script> var videos = document.getElementsByTagName('video'); var videosArr = new Array(); // setTimeout(() => { for (var i = 1; i < videos.length; i++) { videosArr[i] = videojs('video'+i); } // }, 2000); // setInterval(() => { // reloadPage(); // }, 5000); // setInterval(() => { // var url="http://ltms.eemo.co.kr/super/farm_cctv_main.php?farm_code=34351059&jong_type=1&pbreedtype=CC&contract_no=36"; // if (url.statusCode === '404'){ // window.location.reload(); // } // }, 10000); /* 에러 받아오기 */ // if(videosArr[i].networkState() == 3 ) { // // console.log(videos[i].parentNode.parentNode); // // videos[i].parentNode.parentNode.setAttribute("style", // // "visibility : hidden; position: relative !important; float:left; width: 50%; height: 50%;"); // } // // videos[i].onerror = function() { // // this.parentNode.setAttribute("style", "visibility:hidden;"); // // }; // } // }, 3000); //전체화면 $(".fullScreen").on('click', function() { if(IsFullScreenCurrently()) GoOutFullscreen(); else GoInFullscreen($("#videos-contents").get(0)); }); function GoInFullscreen(element) { if(element.requestFullscreen){ element.requestFullscreen(); } else if(element.mozRequestFullScreen) { element.mozRequestFullScreen(); } else if(element.webkitRequestFullscreen) { element.webkitRequestFullscreen(); } else if(element.msRequestFullscreen) { element.msRequestFullscreen(); } } /* Get out of full screen */ function GoOutFullscreen() { if(document.exitFullscreen) { document.exitFullscreen(); } else if(document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if(document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if(document.msExitFullscreen) { document.msExitFullscreen(); } } /* Is currently in full screen or not */ function IsFullScreenCurrently() { var full_screen_element = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || null; // If no element is in full-screen if(full_screen_element === null) return false; else return true; } /* 드래그 엔 드롭 기능 */ function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text/plain", ev.target.id); } function drop(ev) { ev.preventDefault(); var data = ev.dataTransfer.getData("text/plain"); var parent = $("#"+data).parent() var videobox = parent.parent(); var one = videobox.css('order'); var test1 = ev.target.id; var parent1 = $("#"+test1).parent(); var videobox1 = parent1.parent(); var two = videobox1.css('order'); setTimeout(() => { videobox1.css('order', one); videobox.css('order', two); }, 500); } // 분할화면 <?php switch ($viewSet) { case 1: ?> $('.videoBox').css({ 'position': 'relative', 'width':'100%', 'height':'100%', 'font-size': '23px' }); <? break; case 4: ?> $('.videoBox').css({ 'position': 'relative', 'width':'50%', 'height':'50%', 'font-size': '18px' }); <? break; case 9: ?> $('.videoBox').css({ 'position': 'relative', 'width':'33.33%', 'height':'33.33%', 'font-size': '15px' }); <? break; case 16: ?> $('.videoBox').css({ 'position': 'relative', 'width':'25%', 'height':'25%', 'font-size': '12px' }); <? break; case 25: ?> $('.videoBox').css({ 'position': 'relative', 'width':'20%', 'height':'20%', 'font-size': '9px' }); <? break; case 36: ?> $('.videoBox').css({ 'position': 'relative', 'width':'16.66%', 'height':'16.66%', 'font-size': '9px' }); <? break; default: ?> <? break; } ?> $('.videoNo1').click(function (e) { $('.videoBox').css({ 'position': 'relative', 'width':'100%', 'height':'100%', 'font-size': '23px' }); }); $('.videoNo4').click(function (e) { $('.videoBox').css({ 'position': 'relative', 'width':'50%', 'height':'50%', 'font-size': '18px' }); }); $('.videoNo9').click(function (e) { $('.videoBox').css({ 'position': 'relative', 'width':'33.33%', 'height':'33.33%', 'font-size': '15px' }); }); $('.videoNo16').click(function (e) { $('.videoBox').css({ 'position': 'relative', 'width':'25%', 'height':'25%', 'font-size': '12px' }); }); $('.videoNo25').click(function (e) { $('.videoBox').css({ 'position': 'relative', 'width':'20%', 'height':'20%', 'font-size': '9px' }); }); $('.videoNo36').click(function (e) { $('.videoBox').css({ 'position': 'relative', 'width':'16.66%', 'height':'16.66%', 'font-size': '9px' }); }); // 자동 페이지 이동 var isStop = false; function stop() { isStop = true; } var startInterval; // 스위치 자동회전 박스 var sw_spin = document.querySelector('.sw_spin'); var switchery = new Switchery(sw_spin, { color: '#1AB394', size: 'small'}); sw_spin.addEventListener('change', function() { if(sw_spin.checked){ isStop = false; startInterval = setInterval(function interval() { if(!isStop){ var videos = $('.videoBox'); for (let index = 0; index < videos.length; index++) { if(videos.eq(index).css('order') == 0) { videos.eq(index).css('order',videos.length); }else { var num = Number(videos.eq(index).css('order')) - 1; videos.eq(index).css('order',num); } } }else { clearInterval(startInterval); } },3000); } else { stop(); } }); /* 스위치 텍스트 박스 */ var sw_text = document.querySelector('.sw_text'); var switchery = new Switchery(sw_text, { color: '#1AB394', size: 'small'}); sw_text.addEventListener('change', function() { if(sw_text.checked){ $('.use_text').css('visibility', 'visible'); $('.chk_check').prop("checked",true); } else { $('.use_text').css('visibility', 'hidden'); var chk = $('.chk_check'); $('.chk_check').prop("checked",false); } }); /* 세팅 체크박스 */ $('#chk_th').change(function (e) { if(this.checked){ $('.text-th').css('visibility', 'visible'); }else { $('.text-th').css('visibility', 'hidden'); } }); /* 농가명 */ $('#chk_farm').change(function (e) { if(this.checked){ $('.text-farm').css('visibility', 'visible'); }else { $('.text-farm').css('visibility', 'hidden'); } }); /* 동명 */ $('#chk_dong').change(function (e) { if(this.checked){ $('.text-dong').css('visibility', 'visible'); }else { $('.text-dong').css('visibility', 'hidden'); } }); /* 일령 */ $('#chk_day').change(function (e) { if(this.checked){ $('.text-day').css('visibility', 'visible'); }else { $('.text-day').css('visibility', 'hidden'); } }); /* 입추 수수 */ $('#chk_count').change(function (e) { if(this.checked){ $('.text-susu').css('visibility', 'visible'); }else { $('.text-susu').css('visibility', 'hidden'); } }); /* 도태 */ $('#chk_dote').change(function (e) { if(this.checked){ $('.text-dote').css('visibility', 'visible'); }else { $('.text-dote').css('visibility', 'hidden'); } }); /* 폐사 */ $('#chk_pesa').change(function (e) { if(this.checked){ $('.text-pesa').css('visibility', 'visible'); }else { $('.text-pesa').css('visibility', 'hidden'); } }); /* 육성률 */ $('#chk_grow').change(function (e) { if(this.checked){ $('.text-grow').css('visibility', 'visible'); }else { $('.text-grow').css('visibility', 'hidden'); } }); /* 정전(FAN) */ $('.text-fan').css('visibility', 'hidden'); $('#chk_fan').change(function (e) { if(this.checked){ $('.text-fan').css('visibility', 'visible'); }else { $('.text-fan').css('visibility', 'hidden'); } }); $('.text-heater').css('visibility', 'hidden'); /* 정전(Heater) */ $('#chk_heater').change(function (e) { if(this.checked){ $('.text-heater').css('visibility', 'visible'); }else { $('.text-heater').css('visibility', 'hidden'); } }); /* 메뉴바 */ $('.fa_angle_double').click(function (e) { if($('.right_menu').css("display") === 'none') { $('.right_menu').slideToggle(); $('.fa_angle_double').removeClass('fa-arrow-down'); $('.fa_angle_double').addClass('fa-arrow-up'); }else { $('.right_menu').slideToggle(); $('.fa_angle_double').removeClass('fa-arrow-up'); $('.fa_angle_double').addClass('fa-arrow-down'); } }); $('.view-count').click(function (e) { for (var i = 1; i < 26; i++) { videosArr[i] = videojs('video'+i); videosArr[i].dispose(); } var viewCnt = $(this).text(); var data = new FormData(); var farm_no = <?=$farm_no?>; var contract_no = <?=$contract_no?>; data.append("viewCnt", viewCnt); data.append("farm_no", farm_no); data.append("contract_no", contract_no); data.append("type", "view"); setTimeout(() => { $.ajax({ type: "POST", url: "control_center_prc_cctv_bg.php", data: data, dataType: "html", cache: false, contentType: false, processData: false, success: function (response) { $('#videos-contents').html(""); $('#videos-contents').html(response); } }); }, 1000); }); /* 로테이션 */ function lotations() { for (var i = 1; i < videos.length; i++) { videosArr[i] = videojs('video'+i); videosArr[i].dispose(); } var viewCnt = $(this).text(); var farm_no = <?=$farm_no?>; var contract_no = <?=$contract_no?>; var data = new FormData(); data.append("viewCnt", viewCnt); data.append("farm_no", farm_no); data.append("contract_no", contract_no); data.append("type", "view"); setTimeout(() => { $.ajax({ type: "POST", url: "control_center_prc_cctv_bg.php", data: data, dataType: "html", cache: false, contentType: false, processData: false, success: function (response) { $('#videos-contents').html(""); $('#videos-contents').html(response); } }); }, 1000); } /* 화면 새로고침 */ function reloadPage() { switch (<?=$viewSet?>) { case 1: $('.videoBox').css({ 'position': 'relative', 'width':'100%', 'height':'100%', 'font-size': '23px' }); break; case 4: $('.videoBox').css({ 'position': 'relative', 'width':'50%', 'height':'50%', 'font-size': '18px' }); break; case 9: $('.videoBox').css({ 'position': 'relative', 'width':'33.33%', 'height':'33.33%', 'font-size': '15px' }); break; case 16: $('.videoBox').css({ 'position': 'relative', 'width':'25%', 'height':'25%', 'font-size': '12px' }); break; case 25: $('.videoBox').css({ 'position': 'relative', 'width':'20%', 'height':'20%', 'font-size': '9px' }); break; case 36: $('.videoBox').css({ 'position': 'relative', 'width':'16.66%', 'height':'16.66%', 'font-size': '9px' }); break; default: break; } } </script> <? } ?>