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/depletion_breed_data.php
<? include_once("inc_header.php"); $on_menu="farm_manager"; $on_sub_menu="farm_manager_".$_GET[jong_type]; $tabActive = 10; ?> <!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/plugins/chosen/bootstrap-chosen.css" rel="stylesheet"> <link href="css/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet"> <link href="css/plugins/colorpicker/bootstrap-colorpicker.min.css" rel="stylesheet"> <link href="css/plugins/cropper/cropper.min.css" rel="stylesheet"> <link href="css/plugins/switchery/switchery.css" rel="stylesheet"> <link href="css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet"> <link href="css/plugins/nouslider/jquery.nouislider.css" rel="stylesheet"> <link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet"> <link href="css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet"> <link href="css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet"> <link href="css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet"> <link href="css/plugins/clockpicker/clockpicker.css" rel="stylesheet"> <link href="css/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet"> <link href="css/plugins/select2/select2.min.css" rel="stylesheet"> <link href="css/plugins/touchspin/jquery.bootstrap-touchspin.min.css" rel="stylesheet"> <link href="css/plugins/dualListbox/bootstrap-duallistbox.min.css" rel="stylesheet"> <link href="css/plugins/footable/footable.core.css" rel="stylesheet"> <link href="css/plugins/dataTables/datatables.min.css" rel="stylesheet"> <link href="css/animate.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet"> </head> <style> .table tbody tr td{ vertical-align: middle; } .table thead tr th{ vertical-align: middle; } </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_top_submenu.php"); include_once("inc_now_position.php"); include_once("navigation.php"); ?> <div class="card mt-3 animated fadeInRight"> <div class="card-body"> <? if(!$v_num) { $v_num=10; } $arr_jongtype=array("1"=>"육계","2"=>"삼계","3"=>"오리","4"=>"토종닭"); $arr_gigan=array(); $arr_parts=array(); $result_gigan=mysql_query("select a.* from farm_chulha_plan_input a, farm_contract b where a.company_no='{$_COOKIE[ucompany_no]}' and b.gps_type='$pbreedtype' and b.breed_type='{$arr_jongtype[$jong_type]}' and a.is_ltms_auth='1' and a.contract_no=b.no and b.contract_status='1' ") 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 is_ltms_auth='1' group by parts_no order by max(jdate) desc ") 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 is_ltms_auth='1' group by parts_no order by max(jdate) desc ") 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 is_ltms_auth='1' group by parts_no order by max(jdate) desc ") 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 is_ltms_auth='1' group by parts_no order by max(jdate) desc ") or die(); } } ?> <div class="tabs-container"> <? // tab 메뉴 include_once("inc_ship.php"); ?> <div class="tab-content"> <div role="tabpanel" id="tab-1" class="tab-pane active show"> <div class="panel-body"> <!--검색기능--> <style> td, th {white-space: nowrap} </style> <!--검색기능--> <!--내용표시--> <div class="col-lg-12"> <div class="ibox "> <div class="ibox-title" style='border:0'> <h5>Total : <?=number_format(mysql_num_rows($result))?> records</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"> <table class="table table-bordered text-center mt-4"> <thead> <tr> <th>사육년도</th> <th>회차</th> <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_farm=RS("select * from farm where no='{$rs_parts[farm_no]}' "); $rs_farm_ju=RS("select * from member where farm_no='{$rs_parts[farm_no]}' and mtype='1' "); $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)); } $max_ch_date=max($exp_jdate); $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); 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_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><?=$rs_farm[farm_name]?></td> <td><?=$rs_farm_ju[name]?></td> <td><?=date('m-d',strtotime($rs_ipchu[vdate]))?></td> <td><?=number_format($rs_ipchu[cnt])?></td> <td><?=date('m-d',strtotime($max_ch_date))?></td> <td><?=number_format($rs[chul_su])?></td> <td><?=number_format($rs[chul_weight])?></td> <td><?=sprintf("%.3f",$rs[chul_weight]/$rs[chul_su])?></td> <td><?=sprintf("%.1f",$vv_dong_rate)?></td> <td><?=sprintf("%.1f",($tt_il_su/86400))?></td> <td><b><?=number_format($tt_ipgo)?></b> (입고:<?=number_format($rs_feed_tt_ipgo[cnt])?> - 실반품:<?=number_format($rs_feed_tt_banpum[cnt])?>)</td> <td> <? if($rs[chul_weight] > 0) { ?><?=sprintf("%.3f",($tt_ipgo/$rs[chul_weight]))?><? } else { } ?> </td> <td><?=sprintf("%d",$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="18"> <!--<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> <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> <script src="js/plugins/slimscroll/jquery.slimscroll.min.js"></script> <!-- Peity --> <script src="js/plugins/peity/jquery.peity.min.js"></script> <!-- Custom and plugin javascript --> <script src="js/inspinia.js"></script> <script src="js/plugins/pace/pace.min.js"></script> <!-- iCheck --> <script src="js/plugins/iCheck/icheck.min.js"></script> <!-- Peity --> <script src="js/demo/peity-demo.js"></script> <script src="css/messagebox.js"></script> <script src="js/bootbox.js"></script> <!-- Data picker --> <script src="js/plugins/datapicker/bootstrap-datepicker.js"></script> </body> </html> <script> $(document).ready(function(){ $('.i-checks').iCheck({ checkboxClass: 'icheckbox_square-green', radioClass: 'iradio_square-green', }); $(document.body).on("click",".client-link",function(e){ e.preventDefault() $(".selected .tab-pane").removeClass('active'); $($(this).attr('href')).addClass("active"); }); $('#data_5 .input-daterange').datepicker({ keyboardNavigation: false, forceParse: false, autoclose: true, format: 'yyyy-mm-dd', }); }); function list_view(contract_no){ var status = $("#list_view_ex"+contract_no).css('display'); if(status == "none"){ $("#list_view_ex"+contract_no).css('display',''); }else{ $("#list_view_ex"+contract_no).css('display','none'); } } </script>