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/pop_breed_status2.php
<? session_cache_limiter('no-cache, must-revalidate'); session_start(); header("Pragma: no-cache"); header("Cache-Control: no-cache,must-revalidate"); header("Content-Type: text/html; charset=utf-8"); include_once("dbconn.php"); include_once("lib.php"); foreach($_GET as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } foreach($_POST as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } $rs_parts=RS("select * from farm_contract_parts where no='$parts_no' "); $contract_no=$rs_parts[contract_no]; $rs_contract=RS("select * from farm_contract where no='$contract_no' "); $rs_breed_settting_jong=RS("select * from breed_settting_jong where company_no='{$rs_contract[contractor_company_no]}' "); $arr_base_vv=array(); $arr_br=array("육계"=>"1","삼계"=>"2","오리"=>"3","토종닭"=>"4"); $pbreedtype=$rs_contract[gps_type]; $jong_type=$arr_br[$rs_contract[breed_type]]; $result_base_vv=mysql_query("select * from breed_settting where company_no='{$rs_contract[contractor_company_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; } $rs_contract=RS("select * from farm_contract where no='$contract_no' "); $rs_farm=RS("select * from farm where no='{$rs_contract[farm_no]}' "); $farm_no = $rs_farm[farm_no]; $arr_jong_type=array("1"=>"육계","2"=>"삼계","3"=>"오리","4"=>"토종닭"); $rs_parts=RS("select * from farm_contract_parts where no='$parts_no' "); if($rs_parts[no]) { $rs_ipchu=RS("select min(jdate) as vdate, sum(susu) as cnt from farm_ipchu_confirm_log where parts_no='$parts_no' and is_auth='1' "); $rs_chulha=RS("select max(jdate) as maxdate from farm_chulha_plan_input where parts_no='$parts_no' "); $sdate = new DateTime($rs_ipchu[vdate]); if($rs_chulha[maxdate]) { $edate = new DateTime($rs_chulha[maxdate]); } else { $edate = new DateTime(date('Y-m-d')); } $diff = date_diff($sdate, $edate); $tt_ilyung=$diff->days+1; $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]} ) "); } $rs_sday=RS("select min(jdate) as jdate from farm_ipchu_confirm_log where parts_no='$parts_no' "); $sdate = new DateTime($rs_sday[jdate]); $edate = new DateTime(date('Y-m-d')); $diff = date_diff($sdate, $edate); //echo $diff->days; $arr_yo=array("1"=>"월","2"=>"화","3"=>"수","4"=>"목","5"=>"금","6"=>"토","7"=>"일"); /* 첫번째 동 받아오는 쿼리 */ $tmpDong = RS("SELECT `no` AS dong FROM farm_dong_info WHERE farm_no = '$_REQUEST[farm_no]' ORDER BY `no` ASC LIMIT 1"); } else { @$diff->days=-1; } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?=$_TITLE?></title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="font-awesome/css/font-awesome.css" rel="stylesheet"> <link href="css/animate.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <link href="css/plugins/iCheck/custom.css" rel="stylesheet"> <link href="css/messagebox.css" rel="stylesheet"> </head> <style> .table td{white-space: nowrap;} .table th{white-space: nowrap;} <? if($from=='app') {?>.table td {font-size:0.7em} <?} if($from=='app') {?>.table th {font-size:0.7em} <?} ?> </style> <body class="canvas-menu"> <div id="wrapper"> <div id="page-wrapper" class="gray-bg"> <div class="row border-bottom"> </div> <div class="wrapper wrapper-content animated fadeInRight"> <h3 class='ml-2'><?=$rs_parts[jyear]?>년 <?=$rs_parts[seq]?>회차</h3> <div class="ibox "> <div class="ibox-title"> <h5><?=$rs_farm[farm_name]?> 입추내역</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> </div> </div> <div class="ibox-content"> <div class='table-responsive'> <table class="table table-bordered text-center table-hover"> <thead> <tr id="vertical_header"> <th nowrap>동명</th> <th nowrap>날짜</th> <th nowrap>지역</th> <th nowrap>부화장</th> <th nowrap>입추수수</th> <th nowrap>총입추수수</th> </tr> </thead> <tbody> <? $result_condong=mysql_query("select b.* from farm_contract_dong a , farm_dong_info b where a.farm_contract_no='$contract_no' and a.farm_dong_info_no=b.no order by CAST(b.dong_name AS DECIMAL(10,2)) asc ") or die(); while($rs_dong=mysql_fetch_array($result_condong)) { $result_i=mysql_query("select * from farm_ipchu_confirm_log where parts_no='$parts_no' and dong_no='{$rs_dong[no]}' ") or die(); $rs_sum=RS("select sum(susu) as cnt from farm_ipchu_confirm_log where parts_no='$parts_no' and dong_no='{$rs_dong[no]}' "); $tt+=$rs_sum[cnt]; ?> <tr onclick="javascript:getAgesData('<?=$rs_dong[no]?>');" style="cursor: pointer;"> <td <?if(mysql_num_rows($result_i)>0) {?>rowspan='<?=mysql_num_rows($result_i)?>'<?}?> style='vertical-align:middle'><?=$rs_dong[dong_name]?></td> <? $rs_i=mysql_fetch_array($result_i); $rs_hat=RS("select * from hatchery where no='{$rs_i[hatchery_no]}' "); ?> <td><?=$rs_i[jdate]?></td> <td><?=$rs_hat[sido]?> / <?=$rs_hat[sigungu]?></td> <td><?=$rs_hat[name]?></td> <td><?=number_format($rs_i[susu])?></td> <td <?if(mysql_num_rows($result_i)>0) {?>rowspan='<?=mysql_num_rows($result_i)?>'<?}?> style='vertical-align:middle'><?=number_format($rs_sum[cnt])?></td> </tr> <? while($rs_i=mysql_fetch_array($result_i)) { $rs_hat=RS("select * from hatchery where no='{$rs_i[hatchery_no]}' "); ?> <tr> <td><?=$rs_i[jdate]?></td> <td><?=$rs_hat[sido]?> / <?=$rs_hat[sigungu]?></td> <td><?=$rs_hat[name]?></td> <td><?=number_format($rs_i[susu])?></td> </tr> <? } }?> <tr> <td colspan='5' style='text-align:center'><b>합계</td> <td><b><?=number_format($tt)?></td> </tr> </tbody> </table> </div> </div> </div> <div class="ibox "> <div class="ibox-title"> <h5>동별 사육현황</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> </div> </div> <div class="ibox-content"> <div class='table-responsive'> <table class="table table-bordered text-center table-hover"> <thead> <tr id="vertical_header"> <th nowrap>동명</th> <th nowrap>입추수수</th> <th nowrap>도태</th> <th nowrap>폐사</th> <th nowrap>도폐합</th> <th nowrap>현재수수</th> <th nowrap>도폐사율</th> </tr> </thead> <tbody> <? $tt_dote=0; $tt_pesa=0; $tt_now_susu=0; $arr_rate=array(); $result_condong=mysql_query("select b.* from farm_contract_dong a , farm_dong_info b where a.farm_contract_no='$contract_no' and a.farm_dong_info_no=b.no order by CAST(b.dong_name AS DECIMAL(10,2)) asc ") or die(); while($rs_dong=mysql_fetch_array($result_condong)) { $result_i=mysql_query("select * from farm_ipchu_confirm_log where parts_no='$parts_no' and dong_no='{$rs_dong[no]}' ") or die(); $rs_sum=RS("select sum(susu) as cnt from farm_ipchu_confirm_log where parts_no='$parts_no' and dong_no='{$rs_dong[no]}' "); $rs_sum2=RS("select sum(dote) as dt, sum(pesa) as ps from farm_dote_input_log where parts_no='$parts_no' and dong_no='{$rs_dong[no]}' "); $tt+=$rs_sum[cnt]; $tt_dote=$rs_sum2[dt]; $tt_pesa=$rs_sum2[ps]; if($rs_sum[cnt] > 0) { $pesa_rate=sprintf("%.2f",(($rs_sum2[dt]+$rs_sum2[ps])/$rs_sum[cnt])*100); $arr_rate[]=$pesa_rate; } else { $pesa_rate=0; } $tt_now_susu+=($rs_sum[cnt]-($rs_sum2[dt]+$rs_sum2[ps])); ?> <tr> <td><?=$rs_dong[dong_name]?></td> <td><?=number_format($rs_sum[cnt])?></td> <td><?=number_format($rs_sum2[dt])?></td> <td><?=number_format($rs_sum2[ps])?></td> <td><?=number_format($rs_sum2[dt]+$rs_sum2[ps])?></td> <td><?=number_format($rs_sum[cnt]-($rs_sum2[dt]+$rs_sum2[ps]))?></td> <td><?=$pesa_rate?></td> </tr> <? } if(count($arr_rate) > 0) { $tt_rate=sprintf("%.2f",array_sum($arr_rate)/count($arr_rate)); } ?> <tr> <td colspan='2' style='text-align:center'><b>합계</td> <td><b><?=number_format($tt_dote)?></td> <td><b><?=number_format($tt_pesa)?></td> <td><b><?=number_format($tt_dote+$tt_pesa)?></td> <td><b><?=number_format($tt_now_susu)?></td> <td><b><?=$tt_rate?></td> </tr> </tbody> </table> </div> </div> </div> <div class="ibox "> <div class="ibox-title"> <h5><?=$rs_farm[farm_name]?> 출하내역</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> </div> </div> <div class="ibox-content"> <div class='table-responsive'> <table class="table table-bordered text-center table-hover"> <thead> <tr id="vertical_header"> <th>출하차수</th> <th>출하일자</th> <th>출하수수</th> <th>출하총중량(kg)</th> <th>평균체중(kg)</th> <th>보고중량(kg)</th> <th>중량보고편차<!--(보고중량-평균체중)g--></th> <th>중량적중여부(Y,N)</th> </tr> </thead> <tbody> <? $arr_jdate=array(); $n=1; $result_ch=mysql_query("select * from farm_chulha_plan_input where parts_no='$parts_no' and is_ltms_auth='1' group by jdate order by jdate asc ") or die(); while($rs_ch=mysql_fetch_array($result_ch)) { $arr_jdate[$rs_ch[jdate]]=$n; $n++; } $tt_susu=0; $tt_weight=0; //$result_ch=mysql_query("select * from farm_chulha_plan_input where parts_no='$parts_no' and is_ltms_auth='1' order by jdate asc ") or die(); foreach($arr_jdate as $ak => $av) { $rs_dote_weight=RS("select max(weight) as cnt from farm_dote_input_log where parts_no='$parts_no' and weight > 0 and dong_no = '{$rs_ch[dong_no]}' "); //$ch_p=(($rs_dote_weight[cnt]/1000)-($rs_ch[chul_weight]/$rs_ch[chul_su]))*1000; $rs_ch=RS("select sum(chul_su) as su_cnt, sum(chul_weight) as w_cnt from farm_chulha_plan_input where parts_no='$parts_no' and jdate='$ak' and is_ltms_auth='1' "); $tt_susu+=$rs_ch[su_cnt]; $tt_weight+=$rs_ch[w_cnt]; ?> <tr> <td><?=$av?>차</td> <td><?=$ak?></td> <td><?=number_format($rs_ch[su_cnt])?></td> <td><?=number_format($rs_ch[w_cnt])?></td> <td><?=sprintf("%.3f",$rs_ch[w_cnt]/$rs_ch[su_cnt])?></td> <td></td> <td></td> <td></td> </tr> <?}?> <tr> <td colspan='2'><b>합계</td> <td><b><?=number_format($tt_susu)?></td> <td><b><?=number_format($tt_weight)?></td> <td><b><?if($tt_susu > 0) {echo sprintf("%.3f",$tt_weight/$tt_susu);}else {echo "0";}?></td> <td></td> <td></td> <td></td> </tr> </tbody> </table> </div> </div> </div> <div class="ibox "> <div class="ibox-title"> <h5><?=$rs_farm[farm_name]?> 사육성적</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> </div> </div> <div class="ibox-content"> <div class='table-responsive'> <table class="table table-bordered text-center mt-0"> <thead> <tr> <!-- <th>사육년도</th> <th>회차</th>--> <th>입추일</th> <th>입추수수</th> <th>출하일</th> <th>출하수수</th> <th>출하총중량(kg)</th> <th>평균체중(kg)</th> <th>육성율(%)</th> <th>사육일령</th> <!--<th>FCR</th> <th>PI</th>--> <th>사료입고량(kg)</th> <th>사료요구율</th> <th>생산지수</th> </tr> </thead> <tbody> <? $result=mysql_query("select min(year(jdate)) as jyear, GROUP_CONCAT(distinct(jdate)) as ak, sum(chul_su) as chul_su , sum(chul_weight) as chul_weight, parts_no, max(jdate) as maxdate from farm_chulha_plan_input where parts_no='$parts_no' ") or die(); while($rs=mysql_fetch_array($result)) { $rs_parts=RS("select * from farm_contract_parts where no='{$rs[parts_no]}' "); $rs_ipchu=RS("select min(jdate) as vdate, sum(susu) as cnt from farm_ipchu_confirm_log where parts_no='{$rs[parts_no]}' and is_auth='1' "); $arr_chuldate=array(); $exp_jdate=explode(",",$rs[ak]); foreach($exp_jdate as $ak => $av) { $arr_chuldate[]=date('m-d',strtotime($av)); } $str_chuldate=implode(",",$arr_chuldate); $rs_dote_sum=RS("select sum(dote+pesa) as cnt, weight from farm_dote_input_log where parts_no='$parts_no' "); if($rs_ipchu[cnt] > 0) { $vv_dong_rate= ( ($rs_ipchu[cnt]-$rs_dote_sum[cnt]) / $rs_ipchu[cnt] ) * 100; } else { $vv_dong_rate=0; } $sdate = new DateTime($rs_ipchu[vdate]); $edate = new DateTime($rs[maxdate]); $diff = date_diff($sdate, $edate); // 사육 일령 구하기 $arr_ipchu_vv_a=array(); $arr_ipchu_vv_b=array(); $result_ipchu_vv=mysql_query("select * from farm_ipchu_confirm_log where parts_no='{$rs[parts_no]}' and is_auth='1' ") or die(); while($rs_ipchu_vv=mysql_fetch_array($result_ipchu_vv)) { $ipchu_time=strtotime($rs_ipchu_vv[jdate]); $ipchu_vv=$ipchu_time*$rs_ipchu_vv[susu]; $arr_ipchu_vv_a[$rs_ipchu_vv[jdate]]=$ipchu_vv; $arr_ipchu_vv_b[$rs_ipchu_vv[jdate]]=$rs_ipchu_vv[susu]; } $tt_ip_a=array_sum($arr_ipchu_vv_a); $tt_ip_b=array_sum($arr_ipchu_vv_b); if($tt_ip_b > 0) { $tt_ip_vv=$tt_ip_a/$tt_ip_b; } else { $tt_ip_vv=0; } $arr_chulha_vv_a=array(); $arr_chulha_vv_b=array(); $result_chulha_vv=mysql_query("select * from farm_chulha_plan_input where parts_no='{$rs[parts_no]}' ") or die(); while($rs_chulha_vv=mysql_fetch_array($result_chulha_vv)) { $chulha_time=strtotime($rs_chulha_vv[jdate]); $chulha_vv=$chulha_time*$rs_chulha_vv[chul_su]; $arr_chulha_vv_a[$rs_chulha_vv[jdate]]=$chulha_vv; $arr_chulha_vv_b[$rs_chulha_vv[jdate]]=$rs_chulha_vv[chul_su]; } $tt_ch_a=array_sum($arr_chulha_vv_a); $tt_ch_b=array_sum($arr_chulha_vv_b); if($tt_ch_b > 0) { $tt_ch_vv=$tt_ch_a/$tt_ch_b; } else { $tt_ch_vv=0; } $tt_il_su=$tt_ch_vv-$tt_ip_vv; //-- 사육 일령 구하기 //사료입고량 구하기 $rs_feed_tt_ipgo=RS("select sum(ip_su) as cnt from farm_feed_input_log where parts_no='{$rs[parts_no]}' and is_chk='1' "); //echo "select sum(ip_su) as cnt from farm_feed_input_log where parts_no='{$rs[parts_no]}' and is_chk='1' <br>"; //$rs_feed_tt_banpum=RS("select (sum(real_banpum_ton)*1000) as cnt from farm_feed_banpum_log where parts_no='{$rs[parts_no]}' and real_bankpum_chk_date is not null "); $rs_feed_tt_banpum=RS("select (sum(real_banpum_ton)*1000) as cnt from farm_feed_banpum_log where parts_no='{$rs[parts_no]}' "); //echo "select (sum(real_banpum_ton)*1000) as cnt from farm_feed_banpum_log where parts_no='{$rs[parts_no]}' and real_bankpum_chk_date is not null <br>"; $tt_ipgo=$rs_feed_tt_ipgo[cnt]-$rs_feed_tt_banpum[cnt]; //echo $rs_feed_tt_ipgo[cnt]."-".$rs_feed_tt_banpum[cnt]."<br>"; //--사료입고량 구하기 //생산지수구하가 if($rs[chul_su] > 0 && $rs[chul_weight] > 0) { if(( ($tt_il_su/86400) * ($tt_ipgo/$rs[chul_weight]) ) > 0) { $tt_jisu=( ($vv_dong_rate * ($rs[chul_weight]/$rs[chul_su]) ) / ( ($tt_il_su/86400) * ($tt_ipgo/$rs[chul_weight]) ) ) * 100; } else { $tt_jisu=0; } } else { $tt_jisu=0; } // 생산지수 = ( ( 육성률 ) * (평균체중) ) / ( (사육일령) * (사육요구율) ) * 100 // 사료요구율 = 사료입고량 / 총출하중량 //--생산지수구하가 ?> <tr > <!-- <td><?=$rs[jyear]?></td> <td><?=$rs_parts[seq]?></td>--> <td><?=date('m-d',strtotime($rs_ipchu[vdate]))?></td> <td><?=number_format($rs_ipchu[cnt])?></td> <td><?=$str_chuldate?></td> <td><?=number_format($rs[chul_su])?></td> <td><?=number_format($rs[chul_weight])?></td> <td><?if($rs[chul_su] > 0) {echo sprintf("%.3f",$rs[chul_weight]/$rs[chul_su]);}else{echo "0";}?></td> <td><?=sprintf("%.1f",$vv_dong_rate)?></td> <td><?=sprintf("%.1f",($tt_il_su/86400))?></td> <td><b><?=number_format($tt_ipgo)?></b><br>(입고:<?=number_format($rs_feed_tt_ipgo[cnt])?><br>- 실반품:<?=number_format($rs_feed_tt_banpum[cnt])?>)</td> <td><?if($rs[chul_weight] > 0) {echo sprintf("%.3f",($tt_ipgo/$rs[chul_weight]));}else {echo "0";}?></td> <td><?=sprintf("%d",$tt_jisu)?></td> </tr> <?}?> </tbody> </table> </div> </div> </div> <div class="ibox "> <div class="ibox-title"> <h5><?=$rs_farm[farm_name]?> 사육현황 ( 입추일 : <?=$rs_ipchu[vdate]?> )</h5> <div class="ibox-tools"> <a class="collapse-link"> <i class="fa fa-chevron-up"></i> </a> <a class="close-link"> <i class="fa fa-times"></i> </a> </div> </div> <div class="ibox-content"> <div class='table-responsive'> <table class="table table-bordered text-center table-hover"> <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">사료</th> <th rowspan="2">중량</th> <th rowspan="2" data-dotw="stand">표준</th> </tr> <tr> <th>도태</th> <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>FCR</th> <th data-dotw="stand">표준</th> </tr> </thead> <tbody> <? for($n=1;$n<=$tt_ilyung;$n++) { $n2=$n-1; $tt_dote=0; $tt_pesa=0; $tt_now_susu=0; $tt_ipchu_susu=0; $arr_rate=array(); $arr_dope_rate=array(); $arr_dong=array(); $arr_temp=array(); $arr_humi=array(); $arr_weight=array(); //echo "select min(a.jdate) as jdate, a.dong_no, b.dong_name, a.farm_no from farm_ipchu_confirm_log a, farm_dong_info b where a.parts_no='$parts_no' and a.dong_no=b.no group by a.dong_no order by CAST(b.dong_name AS DECIMAL(10,2)) asc <br>"; $result_vv_dong=mysql_query("select min(a.jdate) as jdate, a.dong_no, b.dong_name, a.farm_no from farm_ipchu_confirm_log a, farm_dong_info b where a.parts_no='$parts_no' 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='$parts_no' and dong_no='{$rs_vv_dong[dong_no]}' "); $vv_date=date('Y-m-d', strtotime("+ $n2 day ",strtotime($rs_vv_dong[jdate]))); $rs_dote_sum=RS("select sum(dote+pesa) as cnt, weight from farm_dote_input_log where parts_no='$parts_no' and dong_no='{$rs_vv_dong[dong_no]}' and jdate <= '$vv_date' "); if($rs_dong_susu[cnt]) { $vv_rate= ( ($rs_dong_susu[cnt]-$rs_dote_sum[cnt]) / $rs_dong_susu[cnt] ) * 100; } else { $vv_rate=0; } $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='$parts_no' and dong_no='{$rs_vv_dong[dong_no]}' and jdate='$vv_date' "); //echo "select * from farm_dote_input_log where parts_no='$parts_no' and dong_no='{$rs_vv_dong[dong_no]}' and jdate='$vv_date' <br>"; $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='{$rs_vv_dong[farm_no]}' and dong_no='{$rs_vv_dong[dong_no]}' and jdate='$vv_date' "); //echo $n."/".$rs_vv_dong[dong_name]."<br>"; $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($rs_dong_susu[cnt] > 0) { $pesa_rate=(($rs_vv_dote[dote]+$rs_vv_dote[pesa])/$rs_dong_susu[cnt])*100; $arr_dope_rate[]=$pesa_rate; } else { $pesa_rate=0; } $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]; $obj->dope_rate=$pesa_rate; $arr_dong[]=$obj; } 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;} if(count($arr_dope_rate) > 0) { $tt_pesa_rate=sprintf("%.4f",array_sum($arr_dope_rate)/count($arr_dope_rate)); } else {$tt_pesa_rate=0;} $base_obj=$arr_base_vv[$n]; //echo $arr_base_vv[$n]->dote_rate."<br>"; //echo array_sum($arr_dope_rate)."/".count($arr_dope_rate)."<br>"; ?> <tr onclick="javascript:getAgesData('<?=$n?>');" style="cursor: pointer;"> <td><?=$n?></td> <td><?=number_format($tt_ipchu_susu)?></td> <td><?=number_format($tt_dote)?></td> <td><?=number_format($tt_pesa)?></td> <td <?if( ($tt_dote+$tt_pesa) > floor($tt_ipchu_susu*$base_obj->dote_rate)) {?>class='text-danger'<?}?>><?=number_format($tt_dote+$tt_pesa)?></td> <td><?=$tt_pesa_rate?></td> <td data-dotw="stand"><?=floor($tt_ipchu_susu*$base_obj->dote_rate)?></td> <td><?=number_format($tt_now_susu)?></td> <td><?=$tt_rate?>%</td> <td><?=$tt_temp?> ℃</td> <td data-dotw="stand"><?=$base_obj->temp?> ℃</td> <td><?=$tt_humi?> %</td> <td data-dotw="stand"><?=$base_obj->humi?> %</td> <td>0</td> <td data-dotw="stand"><?=$base_obj->feed?></td> <td>0</td> <td data-dotw="stand"><?=$base_obj->fcr?></td> <td <?if( $tt_weight < $base_obj->weight ) {?>class='text-danger'<?}?>><?=number_format($tt_weight)?></td> <td data-dotw="stand"><?=number_format($base_obj->weight)?></td> </tr> <tr id="preview_<?=$n?>" data-dotw="preview"> <td class="breed_status" style="background: #f5f5f6;"> <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><?=sprintf("%.4f",($avv->dope_rate))?></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><?=floor($avv->weight)?></td> </tr> <?}?> <!-- tbody --> </table> </td> </tr> <?}?> </tbody> </table> </div> <table class="table" style="border-top: hidden;"> <colgroup> <col width="15%"> <col width="70%"> <col width="15%"> </colgroup> <tr> <td class="text-left" nowrap> <div class="i-checks"> <label style="cursor: pointer;"> <input type="checkbox" name="show_standard" id="show_standard" onclick="javascript:getStandard();"> <i></i> 사육표준 비교 </label> </div> </td> <td></td> <td class="text-right"> <? /** 탭마다 연결 그래프 교체를 위한 Type 설정 * ps => all , dong, ipchu * */ if($from != "app") { switch ($_REQUEST['pbreedtype']) { case 'GPSSANRAN': case 'GPSYUK': $type = "gps"; break; case 'PSSANRAN': $type = "pssanran"; break; case 'PSYUK': $type = "ps"; break; default: $type = "all"; break; } ?> <?include_once("inc_breed_status_chart_btn1.php");?> <!-- 돌아가기 버튼 전체/동별/입추별에 따라 url 상이 --> <?}?> </td> </tr> </table> </div> </div> </div> </div> </div> <!-- Mainly scripts --> <script src="js/jquery-3.1.1.min.js"></script> <script src="js/popper.min.js"></script> <script src="js/bootstrap.js"></script> <!-- Custom and plugin javascript --> <script src="js/inspinia.js"></script> <script src="js/plugins/pace/pace.min.js"></script> <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script> <!-- Chosen --> <script src="js/plugins/chosen/chosen.jquery.js"></script> <!-- JSKnob --> <script src="js/plugins/jsKnob/jquery.knob.js"></script> <!-- Input Mask--> <script src="js/plugins/jasny/jasny-bootstrap.min.js"></script> <!-- Data picker --> <script src="js/plugins/datapicker/bootstrap-datepicker.js"></script> <!-- NouSlider --> <script src="js/plugins/nouslider/jquery.nouislider.min.js"></script> <!-- Switchery --> <script src="js/plugins/switchery/switchery.js"></script> <!-- IonRangeSlider --> <script src="js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script> <!-- iCheck --> <script src="js/plugins/iCheck/icheck.min.js"></script> <!-- MENU --> <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> <!-- Color picker --> <script src="js/plugins/colorpicker/bootstrap-colorpicker.min.js"></script> <!-- Clock picker --> <script src="js/plugins/clockpicker/clockpicker.js"></script> <!-- Image cropper --> <script src="js/plugins/cropper/cropper.min.js"></script> <!-- Date range use moment.js same as full calendar plugin --> <script src="js/plugins/fullcalendar/moment.min.js"></script> <!-- Date range picker --> <script src="js/plugins/daterangepicker/daterangepicker.js"></script> <!-- Data picker(Korean) --> <script src="js/ko.js"></script> <!-- Select2 --> <script src="js/plugins/select2/select2.full.min.js"></script> <!-- TouchSpin --> <script src="js/plugins/touchspin/jquery.bootstrap-touchspin.min.js"></script> <!-- Tags Input --> <script src="js/plugins/bootstrap-tagsinput/bootstrap-tagsinput.js"></script> <!-- Dual Listbox --> <script src="js/plugins/dualListbox/jquery.bootstrap-duallistbox.js"></script> <script> $('body.canvas-menu .sidebar-collapse').slimScroll({ height: '100%', railOpacity: 0.9 }); $(document).ready(function(){ $('.i-checks').iCheck({ checkboxClass: 'icheckbox_square-green', radioClass: 'iradio_square-green', }); }); </script> </body> </html> <script> $(document).ready(function() { $('#dotae').attr("colspan","4"); $('#environmental').attr("colspan","2"); $('#fcr').attr("colspan","2"); $('.breed_status').attr("colspan","13"); $('#breed_status_2').attr("colspan","13"); $('[data-dotw=stand]').css('background','#f5f5f6'); $('[data-dotw=stand]').css('font-weight','bold'); $('[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","2"); $('#fcr').attr("colspan","2"); $('.breed_status').attr("colspan","13"); $('[data-dotw=stand]').hide(); } else { $('#dotae').attr("colspan","4"); $('#environmental').attr("colspan","4"); $('#fcr').attr("colspan","4"); $('.breed_status').attr("colspan","20"); $('[data-dotw=stand]').show(); } }); } // 각 일령 별로 데이터 테이블 tr show hide function getAgesData(param){ var status = $("#preview_"+param).css('display'); if(status == "none"){ $("#preview_"+param).css("display",""); }else{ $("#preview_"+param).css("display","none"); } } </script>