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/breed_data2.php
<? include_once("inc_header.php"); $on_menu="farm_manager"; $on_sub_menu="farm_manager_".$_GET[jong_type]; $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"=>"토종닭"); $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_contract=RS("select * from farm_contract where no='$contract_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]} ) "); } $arr_jyear=array(); $n=0; $result_jyear=mysql_query("select year(jdate) as cnt from farm_chulha_plan_input where contract_no='$contract_no' group by year(jdate) order by year(jdate) desc ") or die(); while($rs_jyear=mysql_fetch_array($result_jyear)) { $arr_jyear[]=$rs_jyear[cnt]; if(!$sel_jyear) { if($n==0) { $sel_jyear=$rs_jyear[cnt]; } } $n++; } $arr_gigan=array(); $arr_parts=array(); $result_gigan=mysql_query("select * from farm_contract_parts where farm_no='{$rs_contract[farm_no]}' and jyear='$sel_jyear' and seq > 0 order by seq asc ") or die(); //echo "select * from farm_contract_parts where farm_no='{$rs_contract[farm_no]}' and jyear='$sel_jyear' and seq > 0 order by seq asc "; $n=0; while($rs_gigan=mysql_fetch_array($result_gigan)) { $rs_ipchu=RS("select min(jdate) as vdate from farm_ipchu_confirm_log where parts_no='{$rs_gigan[no]}' "); $rs_chulha=RS("select min(jdate) as vdate from farm_chulha_plan_input where parts_no='{$rs_gigan[no]}' "); if($rs_ipchu[vdate] && $rs_chulha[vdate]) { $obj=(object) $c; $obj->seq=$rs_gigan[seq]; $obj->parts_no=$rs_gigan[no]; $obj->sdate=$rs_ipchu[vdate]; $obj->edate=$rs_chulha[vdate]; $arr_gigan[]=$obj; if(!$sel_gigan) { if($n==0) { //$sel_gigan=$rs_gigan[no]; } } $arr_parts[]=$rs_gigan[no]; $n++; } } $str_parts=implode(",",$arr_parts); //echo $str_parts; if($str_parts) { $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 in ( $str_parts ) and year(jdate)='$sel_jyear' group by parts_no order by parts_no asc ") or die(); if($sel_gigan) { $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='$sel_gigan' and year(jdate)='$sel_jyear' group by parts_no order by parts_no asc ") or die(); } } else { $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 farm_no='{$rs_contract[farm_no]}' and year(jdate)='$sel_jyear' group by parts_no order by parts_no asc ") or die(); if($sel_gigan) { $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='$sel_gigan' and year(jdate)='$sel_jyear' group by parts_no order by parts_no asc ") or die(); } } } else { $result=mysql_query("select * from farm where no='0' "); } ?> <!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/plugins/iCheck/custom.css" rel="stylesheet"> <link href="css/animate.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <link href="css/messagebox.css" rel="stylesheet"> </head> <style> #vertical_header th{ vertical-align: middle; } .invisible-scrollbar::-webkit-scrollbar { display:none; } </style> <body class="pace-done mini-navbar"> <div id="wrapper"> <? include_once("inc_sidemenu.php"); ?> <!-- 사이드 메뉴 --> <div id="page-wrapper" class="gray-bg"> <? include_once("inc_top.php"); // include_once("inc_now_position.php"); /* 큰 알림 텍스트 */ include_once("navigation.php"); ?> <!-- 헤더 메뉴 끝 --> <div class="row"> <!-- 사육관리 탭메뉴 --> <? include_once("inc_top_submenu.php"); /* 사육관리전용 탭 그외 주석처리 */ ?> </div> <div class="row wrapper border-bottom white-bg page-heading py-3"> <? include_once("inc_nav_menu.php"); /* 네비게이션 판 */ ?> </div> <!-- 네비 wrapper 끝 --> <div class="wrapper wrapper-content"> <div class="row animated fadeInDown"> <div class="col-lg-12"> <div class="ibox-content border-0 py-0 text-right"> <? include_once("inc_icon_menu.php");/* 농장관련 아이콘 농장 외 주석 */ ?> </div> </div> <!-- col-lg-크기 지정 후 컨텐츠 입력 --> <div class="col-lg-12"> <div class="ibox-content border-top-0 invisible-scrollbar" style="height:74vh; overflow:scroll;" > <div class="card animated fadeInRight mt-3"> <div class="card-body"> <div class="tabs-container"> <? $tapActive = 6; include_once("inc_breed_status.php") ?> <!-- 탭 메뉴 링크 --> <div class="tab-content"> <div role="tabpanel" id="tab-1" class="tab-pane active show"> <div class="panel-body"> <form> <div class="row ml-1"> <div class="col-md-2"> <span class="input-group"> <label for="" class="mt-2 font-bold">사육년도</label> <select class="form-control ml-4" name='sel_jyear' onchange="$('#sel_gigan').val('');this.form.submit();"> <? foreach($arr_jyear as $ak => $av) { ?><option value="<?=$av?>" <?if($sel_jyear==$av) echo "selected";?>><?=$av?></option><? } ?> </select> </span> </div> <div class="col-md-1"></div> <div class="col-md-3"> <span class="input-group"> <label for="" class="mt-2 font-bold">사육기간</label> <select class="form-control ml-4" name='sel_gigan' id='sel_gigan' onchange="this.form.submit()"> <option value="">선택</option> <? foreach($arr_gigan as $ak => $av) { ?><option value="<?=$av->parts_no?>" <?if($sel_gigan==$av->parts_no) echo "selected";?>><?=$av->seq?>차(<?=$av->sdate?> ~ <?=$av->edate?>)</option><? } ?> </select> </span> </div> </div> <input type='hidden' name='pbreedtype' value="<?=$pbreedtype?>"> <input type='hidden' name='jong_type' value="<?=$jong_type?>"> <input type='hidden' name='contract_no' value="<?=$contract_no?>"> <input type='hidden' name='farm_no' value="<?=$rs_contract[farm_no]?>"> </form> <table class="table table-bordered text-center mt-4"> <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> <th>전체사육</th> <th>동별사육</th> <th>입추사육</th> </tr> </thead> <tbody> <? 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='{$rs_parts[no]}' "); $vv_dong_rate= ( ($rs_ipchu[cnt]-$rs_dote_sum[cnt]) / $rs_ipchu[cnt] ) * 100; $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); $tt_ip_vv=$tt_ip_a/$tt_ip_b; $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); $tt_ch_vv=$tt_ch_a/$tt_ch_b; $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>"; //--사료입고량 구하기 //생산지수구하가 $tt_jisu=( ($vv_dong_rate * ($rs[chul_weight]/$rs[chul_su]) ) / ( ($tt_il_su/86400) * ($tt_ipgo/$rs[chul_weight]) ) ) * 100; // 생산지수 = ( ( 육성률 ) * (평균체중) ) / ( (사육일령) * (사육요구율) ) * 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><?=sprintf("%.2f",$rs[chul_weight]/$rs[chul_su])?></td> <td><?=sprintf("%.2f",$vv_dong_rate)?></td> <td><?=sprintf("%.2f",($tt_il_su/86400))?></td> <td><b><?=number_format($tt_ipgo)?></b><br>(입고:<?=number_format($rs_feed_tt_ipgo[cnt])?> - 실반품:<?=number_format($rs_feed_tt_banpum[cnt])?>)</td> <td><?=sprintf("%.2f",($tt_ipgo/$rs[chul_weight]))?></td> <td><?=sprintf("%.2f",$tt_jisu)?></td> <td><a class="btn btn-white btn-bitbucket" onclick="window.open('pop_breed_status.php?parts_no=<?=$rs[parts_no]?>' ,'popForm', 'toolbar=no, width=1280, height=800, directories=no, status=no, scrollorbars=no, resizable=no');" style="padding: 0;padding-left: 5px;padding-right: 5px;"><i class="fa fa-list" style="font-size:10px;"></i></a></td> <td><a class="btn btn-white btn-bitbucket" onclick="window.open('pop_dong_breed_status.php?parts_no=<?=$rs[parts_no]?>' ,'popForm', 'toolbar=no, width=1280, height=800, directories=no, status=no, scrollorbars=no, resizable=no');" style="padding: 0;padding-left: 5px;padding-right: 5px;"><i class="fa fa-list" style="font-size:10px;"></i></a></td> <td><a class="btn btn-white btn-bitbucket" onclick="window.open('pop_placement_breed_status.php?parts_no=<?=$rs[parts_no]?>' ,'popForm', 'toolbar=no, width=1280, height=800, directories=no, status=no, scrollorbars=no, resizable=no'); " style="padding: 0;padding-left: 5px;padding-right: 5px;"><i class="fa fa-list" style="font-size:10px;"></i></a></td> </tr> <?}?> </tbody> <? if($rs_parts[no]) {?> <tfoot style="border-left:hidden;border-right:hidden;border-bottom:hidden;"> <tr> <td colspan="11"> <a href="javascript:alert('준비중입니다.')" class="float-right btn btn-primary btn-w-m btn-rounded mt-3">사육일지</a> <a href="javascript:alert('준비중입니다.')" class="float-right btn btn-primary btn-w-m btn-rounded mr-3 mt-3">사육데이터 비교</a> </td> </tr> </tfoot> <?}?> </table> </div> </div> </div> </div> </div> </div> </div> </div> </div> <? include_once("inc_footer.php"); ?> </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> </body> </html>