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_placement.php
<? $rs_contract=RS("select * from farm_contract where no='$contract_no' "); $rs_farm=RS("select * from farm where no='{$rs_contract[farm_no]}' "); $arr_jong_type=array("1"=>"육계","2"=>"삼계","3"=>"오리","4"=>"토종닭"); //사육중인 contract_no 골라내기 $rs_parts=RS("select * from farm_contract_parts where contract_no='$contract_no' order by no desc limit 0,1 "); if($rs_parts[no]) { $rs_condong=RS("select GROUP_CONCAT(farm_dong_info_no) as ak from farm_contract_dong where farm_contract_no='$contract_no' "); if($rs_condong[ak]) { $rs_gesa=RS("select GROUP_CONCAT(dong_name) as dong from farm_dong_info where no in ( {$rs_condong[ak]} ) "); $rs_gesa_type=RS("select GROUP_CONCAT(dong_type) as dtype from farm_dong_info where no in ( {$rs_condong[ak]} ) "); } $result_jdate=mysql_query("select * from farm_ipchu_confirm_log where parts_no='{$rs_parts[no]}' group by jdate order by jdate asc ") or die(); $vv_cha=mysql_num_rows($result_jdate); if(!$chasu) { $chasu=1; } $prev_chasu=$chasu-1; if($prev_chasu==0) {$prev_chasu=1;} $next_chasu=$chasu+1; if($next_chasu < $vv_cha) {$next_chasu=$vv_cha;} $arr_cha_date=array(); $arr_cha_date_parts_no=array(); $n=1; while($rs_jdate=mysql_fetch_array($result_jdate)) { $arr_cha_date[$n]=$rs_jdate[jdate]; $n++; } $sdate = new DateTime($arr_cha_date[$chasu]); $edate = new DateTime(date('Y-m-d')); $diff = date_diff($sdate, $edate); $rs_breed_settting_jong=RS("select * from breed_settting_jong where company_no='{$_COOKIE[ucompany_no]}' "); $arr_base_vv=array(); $result_base_vv=mysql_query("select * from breed_settting where company_no='{$_COOKIE[ucompany_no]}' and breed_type='$pbreedtype' and jong_type='$jong_type' and egg_jong_type='{$rs_breed_settting_jong[sel_jong]}' order by day_num asc ") or die(); while($rs_base=mysql_fetch_array($result_base_vv)) { $obj=(object) $c; $obj->dote_rate=$rs_base[day_dote_rate]; $obj->weight=$rs_base[day_weight]; $obj->water=$rs_base[day_water]; $obj->feed=$rs_base[day_feed]; $obj->temp=$rs_base[day_temp]; $obj->humi=$rs_base[day_humi]; $obj->fcr=$rs_base[day_fcr]; $arr_base_vv[$rs_base[day_num]]=$obj; } /* 첫번째 동 받아오는 쿼리 */ $tmpDong = RS("SELECT `no` AS dong FROM farm_dong_info WHERE farm_no = '$_REQUEST[farm_no]' ORDER BY `no` ASC LIMIT 1"); /* 탭마다 연결 그래프 교체를 위한 Type 설정 */ $type = "ipchu"; } else { @$diff->days=-1; $arr_cha_date=array(); } ?> <style> #vertical_header th{ vertical-align: middle; } .invisible-scrollbar::-webkit-scrollbar { display:none; } </style> <div class="row animated fadeInLeft"> <div class="col-lg-12"> <img src="img/icon/close1.png" style="cursor:pointer;position:absolute;right:20px;top:-1px;z-index:1" onclick="changeMode()" alt="접기 버튼"> <div class="ibox-content border-0 pt-3 pb-0 d-flex justify-content-between"> <div><h2><strong><?=$rs_farm[farm_name]?></strong></h2></div> <div class='text-success' style='font-size:14px;font-weight:bold;position:relative;top:-3px;padding-top:10px;'>(<?=$rs_gesa[dong]?>)</div> </div> </div> <!-- col-lg-크기 지정 후 컨텐츠 입력 --> <div class="col-lg-12"> <div class="ibox-content border-top-0 pt-0" style="height:79vh;" > <div class="card animated fadeInRight"> <div class="card-body"> <div class="tabs-container"> <? $tapActive = 3; include_once("control_center_prc_tab_menu.php") ?> <!-- 탭 메뉴 링크 --> <div class="tab-content"> <div role="tabpanel" id="tab-1" class="tab-pane active show"> <div class="panel-body invisible-scrollbar mb-2" style="overflow:scroll; height:68vh;"> <table class=""> <tr> <td class="text-left"> <? foreach($arr_cha_date as $ak => $av){ ?> <a class="btn btn-primary btn-rounded <?if($chasu != $ak) {?>btn-outline<?}?> mr-2" href="javascript:showFarmDongInfo(<?=$_REQUEST[farm_no]?>,0,'<?=$pbreedtype?>','<?=$contract_no?>',2,<?=$ak?>);"><?=$ak?> 차입추</a> <? }?> </td> </tr> </table> <table class="table table-bordered text-center table-hover mt-2"> <thead> <tr id="vertical_header"> <th rowspan="2">일령</th> <th rowspan="2">날짜</th> <th id="dotae">도태</th> <th colspan="2">현재수수</th> <th id="environmental">환경관리</th> <th id="fcr">FCR</th> <th rowspan="2">중량</th> <th rowspan="2" data-dotw="stand">표준</th> </tr> <tr> <th>도태</th> <th>폐사</th> <th>합계</th> <th data-dotw="stand">표준</th> <th>현재수수</th> <th>육성율</th> <th>온도</th> <th data-dotw="stand">표준</th> <th>습도</th> <th data-dotw="stand">표준</th> <th>음수량</th> <th data-dotw="stand">표준</th> <th>사료섭취</th> <th data-dotw="stand">표준</th> <th>FCR</th> <th data-dotw="stand">표준</th> </tr> </thead> <tbody> <? for($n=1;$n<=($diff->days+1);$n++) { $n2=$n-1; $tt_dote=0; $tt_pesa=0; $tt_now_susu=0; $tt_ipchu_susu=0; $arr_rate=array(); $arr_dong=array(); $arr_temp=array(); $arr_humi=array(); $arr_weight=array(); $vv_date=date('Y-m-d', strtotime("+ $n2 day ",strtotime($arr_cha_date[$chasu]))); $result_vv_dong=mysql_query("select min(a.jdate) as jdate, a.dong_no, b.dong_name from farm_ipchu_confirm_log a, farm_dong_info b where a.parts_no='{$rs_parts[no]}' and a.jdate='{$arr_cha_date[$chasu]}' and a.dong_no=b.no group by a.dong_no order by CAST(b.dong_name AS DECIMAL(10,2)) asc ") or die(mysql_error()); while($rs_vv_dong=mysql_fetch_array($result_vv_dong)) { //echo $rs_vv_dong[jdate]."<br>"; $rs_dong_susu=RS("select sum(susu) as cnt from farm_ipchu_confirm_log where parts_no='{$rs_parts[no]}' and dong_no='{$rs_vv_dong[dong_no]}' and jdate='{$arr_cha_date[$chasu]}' "); $vv_date=date('Y-m-d', strtotime("+ $n2 day ",strtotime($rs_vv_dong[jdate]))); $rs_dote_sum=RS("select sum(dote+pesa) as cnt from farm_dote_input_log where parts_no='{$rs_parts[no]}' and dong_no='{$rs_vv_dong[dong_no]}' and jdate <= '$vv_date' "); $vv_rate= ( ($rs_dong_susu[cnt]-$rs_dote_sum[cnt]) / $rs_dong_susu[cnt] ) * 100; $tt_now_susu += ($rs_dong_susu[cnt]-$rs_dote_sum[cnt]); $tt_ipchu_susu += $rs_dong_susu[cnt]; $arr_rate[]=$vv_rate; //echo $vv_date."<br>"; $rs_vv_dote=RS("select * from farm_dote_input_log where parts_no='{$rs_parts[no]}' and dong_no='{$rs_vv_dong[dong_no]}' and jdate='$vv_date' "); $tt_dote+=$rs_vv_dote[dote]; $tt_pesa+=$rs_vv_dote[pesa]; $rs_day_iot=RS("select avg(temp) as vtemp, avg(humi) as vhumi from iot_date where farm_no='$farm_no' and dong_no='{$rs_vv_dong[dong_no]}' and jdate='$vv_date' "); $obj=(object) $c; $obj->dong_name=$rs_vv_dong[dong_name]; $obj->dote=$rs_vv_dote[dote]; $obj->pesa=$rs_vv_dote[pesa]; $obj->rate=$vv_rate; $obj->now_susu=($rs_dong_susu[cnt]-$rs_dote_sum[cnt]); $obj->ipchu_susu=$rs_dong_susu[cnt]; $obj->temp=$rs_day_iot[vtemp]; $obj->humi=$rs_day_iot[vhumi]; $obj->weight=$rs_vv_dote[weight]; $arr_dong[]=$obj; $arr_temp[]=$rs_day_iot[vtemp]; $arr_humi[]=$rs_day_iot[vhumi]; if($rs_vv_dote[weight] > 0) { $arr_weight[]=$rs_vv_dote[weight]; } } if(count($arr_rate) > 0) { $tt_rate=sprintf("%.2f",array_sum($arr_rate)/count($arr_rate)); } else {$tt_rate=0;} if(count($arr_temp) > 0) { $tt_temp=sprintf("%.1f",array_sum($arr_temp)/count($arr_temp)); } else {$tt_temp=0;} if(count($arr_humi) > 0) { $tt_humi=sprintf("%.1f",array_sum($arr_humi)/count($arr_humi)); } else {$tt_humi=0;} if(count($arr_weight) > 0) { $tt_weight=floor(array_sum($arr_weight)/count($arr_weight)); } else {$tt_weight=0;} $base_obj=$arr_base_vv[$n]; ?> <tr onclick="javascript:getAgesData('<?=$n?>');" style="cursor: pointer;"> <td><?=$n?></td> <td><?=$vv_date?></td> <td><?=$tt_dote?></td> <td><?=$tt_pesa?></td> <td><?=number_format($tt_dote+$tt_pesa)?></td> <td data-dotw="stand"><?=floor($tt_ipchu_susu*$base_obj->dote_rate)?></td> <td><?=number_format($tt_now_susu)?></td> <td><?=sprintf("%.2f",$vv_rate)?>%</td> <td><?=$tt_temp?>℃</td> <td data-dotw="stand"><?=$base_obj->temp?>℃</td> <td><?=$tt_humi?>%</td> <td data-dotw="stand"><?=$base_obj->temp?>%</td> <td>0</td> <td data-dotw="stand"><?=$base_obj->water?></td> <td>0</td> <td data-dotw="stand"><?=$base_obj->feed?></td> <td>0</td> <td data-dotw="stand"><?=$base_obj->fcr?></td> <td><?=number_format($tt_weight)?></td> <td data-dotw="stand"><?=$base_obj->weight?></td> </tr> <tr id="preview_<?=$n?>" data-dotw="preview"> <td class="breed_status" style="background: #e7eaec;"> <table class="table table-bordered text-center" style="background: #f5f5f6"> <!-- thead --> <tr> <td>축사</td> <td>입추수수</td> <td>도태</td> <td>폐사</td> <td>합계</td> <td>현재수수</td> <td>육성율</td> <td>온도</td> <td>습도</td> <td>음수량</td> <td>사료섭취</td> <td>FCR</td> <td>중량</td> </tr> <!-- thead --> <!-- tbody --> <? foreach($arr_dong as $akk => $avv) { ?> <tr> <td><?=$avv->dong_name?></td> <td><?=number_format($avv->ipchu_susu)?></td> <td><?=number_format($avv->dote)?></td> <td><?=number_format($avv->pesa)?></td> <td><?=number_format($avv->dote+$avv->pesa)?></td> <td><?=number_format($avv->now_susu)?></td> <td><?=sprintf("%.1f",($avv->rate))?>%</td> <td><?=sprintf("%.1f",($avv->temp))?>℃</td> <td><?=sprintf("%.1f",($avv->humi))?>%</td> <td>0</td> <td>0</td> <td>0</td> <td><?=number_format($avv->weight)?></td> </tr> <?}?> </table> </td> </tr> <?}?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <script> $(document).ready(function() { $('#dotae').attr("colspan","3"); $('#environmental').attr("colspan","3"); $('#fcr').attr("colspan","2"); $('.breed_status').attr("colspan","13"); $('[data-dotw=stand]').hide(); $('[data-dotw=preview]').hide(); $('.i-checks').iCheck({ checkboxClass: 'icheckbox_square-green', radioClass: 'iradio_square-green', }); getStandard(); }); // 사육표준 비교 테이블 변경 함수 function getStandard(){ var changeCheckbox = $('#show_standard'); changeCheckbox.on('ifClicked',function(event){ if(changeCheckbox.prop('checked')) { $('#dotae').attr("colspan","3"); $('#environmental').attr("colspan","3"); $('#fcr').attr("colspan","2"); $('.breed_status').attr("colspan","13"); $('[data-dotw=stand]').hide(); } else { $('#dotae').attr("colspan","4"); $('#environmental').attr("colspan","6"); $('#fcr').attr("colspan","4"); $('.breed_status').attr("colspan","20"); $('[data-dotw=stand]').show(); } }); } // 각 일령 별로 데이터 테이블 tr show hide function getAgesData(n){ var status = $("#preview_"+n).css('display'); if(status == "none"){ $("#preview_"+n).css("display",""); }else{ $("#preview_"+n).css("display","none"); } } </script>