Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
nongapp.eemo.co.kr
/
public_html
/
www
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/nongapp.eemo.co.kr/public_html/www/parts_report_view.php
<? session_set_cookie_params(86400); 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)); } $arr_dong=array(); $result_dong=mysql_query("select * from farm_dong_info where farm_no='{$_COOKIE[ufarm_no]}' order by CAST(dong_name AS DECIMAL(10,2)) asc ") or die(); while($rs_dong=mysql_fetch_array($result_dong)) { $obj=(object) $c; $obj->no=$rs_dong[no]; $obj->dong_name=$rs_dong[dong_name]; $arr_dong[]=$obj; } $rs=RS("select * from farm_parts where no='$no' "); $arr_vdong=array(); $result_vdong=mysql_query("select b.* from farm_parts_dong a, farm_dong_info b where a.parts_no='{$rs[no]}' and a.dong_no=b.no order by CAST(b.dong_name AS DECIMAL(10,2)) asc") or die(); while($rs_vdong=mysql_fetch_array($result_vdong)) { $obj=(object) $c; $obj->no=$rs_vdong[no]; $obj->dong_name=$rs_vdong[dong_name]; $arr_vdong[]=$obj; } $arr_vdong_name=array(); $arr_vdong_no=array(); $result_vdong=mysql_query("select b.* from farm_parts_dong a, farm_dong_info b where a.parts_no='{$rs[no]}' and a.dong_no=b.no order by CAST(b.dong_name AS DECIMAL(10,2)) asc") or die(); while($rs_vdong=mysql_fetch_array($result_vdong)) { $arr_vdong_name[]=$rs_vdong[dong_name]; $arr_vdong_no[]=$rs_vdong[no]; } $str_vdong=implode(",",$arr_vdong_name); $rs_min=RS("select min(ipchu_date) as jdate from farm_parts_dong where parts_no='{$rs[no]}' and ipchu_date != '0000-00-00' "); $rs_max=RS("select max(chulha_date) as jdate from farm_parts_dong where parts_no='{$rs[no]}' and chulha_date != '0000-00-00' "); $sdate = new DateTime($rs_min[jdate]); if($rs_max[jdate]) { $edate = new DateTime($rs_max[jdate]); } else { $edate = new DateTime(date('Y-m-d')); } $diff = date_diff($sdate, $edate); //echo $diff->days; $tt_il=($diff->days+1); for($n=1;$n<=$tt_il;$n++) { $n2=$n-1; $vv_date=date('Y-m-d', strtotime("+ $n2 day ",strtotime($rs_min[jdate]))); } $rs_sum_ipchu=RS("select sum(ipchu_susu) as cnt, sum(chulha_susu) as cnt2, sum(chulha_weight_kg) as cnt3 from farm_parts_dong where parts_no='{$rs[no]}' and ipchu_date != '0000-00-00' "); $arr_rate=array(); $result_vdong=mysql_query("select * from farm_parts_dong where parts_no='{$rs[no]}' ") or die(); while($rs_vdong=mysql_fetch_array($result_vdong)) { $rs_dote_sum=RS("select sum(dote+pesa) as cnt from farm_parts_dong_dote where parts_no='{$rs[no]}' and dong_no='{$rs_vdong[dong_no]}' "); if($rs_vdong[ipchu_susu] > 0) { $vv_rate= ( ($rs_vdong[ipchu_susu]-$rs_dote_sum[cnt]) / $rs_vdong[ipchu_susu] ) * 100; $arr_rate[]=$vv_rate; } } if(count($arr_rate) > 0) { $tt_rate=sprintf("%.2f",array_sum($arr_rate)/count($arr_rate)); } $rs_sum_feed=RS("select sum(feed_ton) as cnt, sum(jide_su) as cnt2 from farm_parts_feed where parts_no='{$rs[no]}' "); $rs_nu_dote_sum=RS("select sum(dote) as cnt, sum(pesa) as cnt2 from farm_parts_dong_dote where parts_no='{$rs[no]}' "); $arr_il=array(); $result_cc=mysql_query("select * from farm_parts_dong where parts_no='{$rs[no]}' ") or die(); while($rs_cc=mysql_fetch_array($result_cc)) { if($rs_cc[ipchu_date] && $rs_cc[chulha_date]) { $c_sdate = new DateTime($rs_cc[ipchu_date]); $c_edate = new DateTime($rs_cc[chulha_date]); $c_diff = date_diff($c_sdate, $c_edate); //echo $diff->days; $c_now_il=($c_diff->days+1); $arr_il[]=$c_now_il; } } if(count($arr_il) > 0) { $avg_chul_il=sprintf("%.2f",array_sum($arr_il)/count($arr_il)); } ?> <!doctype html> <html lang="ko"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, viewport-fit=cover" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="theme-color" content="#000000"> <title><?=$_TITLE?></title> <meta name="description" content="Mobilekit HTML Mobile UI Kit"> <meta name="keywords" content="bootstrap 4, mobile template, cordova, phonegap, mobile, html" /> <link rel="icon" type="image/png" href="assets/img/favicon.png" sizes="32x32"> <link rel="apple-touch-icon" sizes="180x180" href="assets/img/icon/192x192.png"> <link rel="stylesheet" href="assets/css/style.css"> <link rel="manifest" href="__manifest.json"> <link href="https://fonts.googleapis.com/css?family=Nanum+Gothic" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="assets/js/c3.css"> <script src="https://d3js.org/d3.v5.min.js" charset="utf-8"></script> <script src="assets/js/c3.js"></script> </head> <style> #body {font-family: 'Nanum Gothic', sans-serif;} html { scroll-behavior: smooth; } </style> <body> <!-- loader --> <div id="loader"> <div class="spinner-border text-primary" role="status"></div> </div> <!-- * loader --> <!-- App Header --> <div class="appHeader bg-primary text-light"> <div class="left"> <a href="parts_report.php" class="headerButton goBack"> <ion-icon name="chevron-back-outline"></ion-icon> </a> </div> <div class="pageTitle">사육일지</div> <div class="right"></div> </div> <!-- * App Header --> <!-- App Capsule --> <div id="appCapsule"> <div class="section full mt-2" style='border-top:1px #0066ff solid;border-bottom:1px #0066ff solid;'> <div class="wide-block pt-2 pb-2"> <div class="alert alert-outline-primary alert-dismissible fade show" role="alert" style='border:0;padding:0'> <div class='row'> <div class='col-4'> <div id="countDown" style='margin-left:0'><div><?=$rs[jong_type]?></div></div> </div> <div class='col-8'> <h4 class="alert-title"><?=$rs[rounds]?></h4> <?=$str_vdong?> </div> </div> </div> </div> </div> <div class="section full mt-2" id='dv_total'> <div class="section-title">종합 사육성적</div> <div class="content-header mb-05">종합적인 사육요약정리</div> </div> <div class="blog-post"> <div class="post-header" style='padding-bottom:0;margin-bottom:0;border-bottom:0'> <div> <h4 style='font-weight:700'>입추일자</h4> </div> <?=$rs_min[jdate]?> </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>입추수수</h4> </div> <?=number_format($rs_sum_ipchu[cnt])?>수 </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>누적도/폐사</h4> </div> 도태 : <?=number_format($rs_nu_dote_sum[cnt])?>수 , 폐사 : <?=number_format($rs_nu_dote_sum[cnt2])?>수 , 합계 : <?=number_format($rs_nu_dote_sum[cnt]+$rs_nu_dote_sum[cnt2])?>수 </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>도폐사율</h4> </div> <? if($rs_sum_ipchu[cnt] > 0) { $pesa_rate=sprintf("%.2f",(($rs_nu_dote_sum[cnt]+$rs_nu_dote_sum[cnt2])/$rs_sum_ipchu[cnt])*100); echo $pesa_rate."%"; } ?> </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>최종출하일</h4> </div> <?=$rs_max[jdate]?> </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>출하일령</h4> </div> <?=$avg_chul_il?> </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>출하수수</h4> </div> <?=number_format($rs_sum_ipchu[cnt2])?>수 </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>출하 총중량</h4> </div> <?=number_format($rs_sum_ipchu[cnt3])?>kg </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>출하 평균체중</h4> </div> <?if($rs_sum_ipchu[cnt2] > 0) {echo sprintf("%.3f",$rs_sum_ipchu[cnt3]/$rs_sum_ipchu[cnt2]);}else{}?>kg </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>육성율</h4> </div> <?=$tt_rate?>% </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>사육일령</h4> </div> <?=$tt_il?>일령 </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>총사료입고량</h4> </div> <?=$rs_sum_feed[cnt]?>톤 , <?=$rs_sum_feed[cnt2]?>포대 </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>사료요구율</h4> </div> <?if($rs_sum_ipchu[cnt3] > 0) {echo sprintf("%.3f",(($rs_sum_feed[cnt]*1000)/$rs_sum_ipchu[cnt3]));}?> </div> <div class="post-header" style='padding-bottom:0;margin-top:0;margin-bottom:0;border-bottom:0;'> <div> <h4 style='font-weight:700'>생산지수</h4> </div> 0 </div> </div> <div class="wide-block p-0" id='dv_ipchu'> <div class="section full mt-2"> <div class="section-title">입추내역</div> <div class="content-header mb-05">입추상세내역</div> </div> <div class="blog-post"> <div class="table-responsive"> <table class="table"> <thead> <tr> <th scope="col">동</th> <th scope="col">입추일</th> <th scope="col">부화장</th> <th scope="col">입추수수</th> </tr> </thead> <tbody> <? $result_vdong=mysql_query("select a.*, b.dong_name from farm_parts_dong a, farm_dong_info b where a.parts_no='{$rs[no]}' and a.dong_no=b.no order by CAST(b.dong_name AS DECIMAL(10,2)) asc") or die(); while($rs_vdong=mysql_fetch_array($result_vdong)) { $tt_ipchu+=$rs_vdong[ipchu_susu]; ?> <tr> <th scope="row"><?=$rs_vdong[dong_name]?></th> <td><?=$rs_vdong[ipchu_date]?></td> <td><?=$rs_vdong[buha_jang]?></td> <td><?=number_format($rs_vdong[ipchu_susu])?></td> </tr> <?}?> <tr> <th scope="row" colspan='3'>합계</th> <td><?=number_format($tt_ipchu)?></td> </tr> </tbody> </table> </div> </div> </div> <div class="wide-block p-0" id='dv_chulha'> <div class="section full mt-2"> <div class="section-title">출하내역</div> <div class="content-header mb-05">출하상세내역</div> </div> <div class="blog-post"> <div class="table-responsive"> <table class="table"> <thead> <tr> <th scope="col">동</th> <th scope="col">출하일</th> <th scope="col">출하수수</th> <th scope="col">출하중량</th> </tr> </thead> <tbody> <? $result_vdong=mysql_query("select a.*, b.dong_name from farm_parts_dong a, farm_dong_info b where a.parts_no='{$rs[no]}' and a.dong_no=b.no order by CAST(b.dong_name AS DECIMAL(10,2)) asc") or die(); while($rs_vdong=mysql_fetch_array($result_vdong)) { $tt_chulha+=$rs_vdong[chulha_susu]; $tt_chulweight+=$rs_vdong[chulha_weight_kg]; ?> <tr> <th scope="row"><?=$rs_vdong[dong_name]?></th> <td><?=$rs_vdong[chulha_date]?></td> <td><?=number_format($rs_vdong[chulha_susu])?></td> <td><?=number_format($rs_vdong[chulha_weight_kg])?>kg</td> </tr> <?}?> <tr> <th scope="row" colspan='2'>합계</th> <td><?=number_format($tt_chulha)?></td> <td><?=number_format($tt_chulweight)?>kg</td> </tr> </tbody> </table> </div> </div> </div> <div class="wide-block p-0" id='dv_dong'> <div class="section full mt-2"> <div class="section-title">동별 사육현황</div> <div class="content-header mb-05">동별 상세내역</div> </div> <div class="blog-post"> <div class="table-responsive"> <table class="table"> <tbody> <? $result_vdong=mysql_query("select a.*, b.dong_name from farm_parts_dong a, farm_dong_info b where a.parts_no='{$rs[no]}' and a.dong_no=b.no order by CAST(b.dong_name AS DECIMAL(10,2)) asc") or die(); while($rs_vdong=mysql_fetch_array($result_vdong)) { $rs_dote_sum=RS("select sum(dote) as dt, sum(pesa) as ps, sum(feed) as fd, max(weight) as wt from farm_parts_dong_dote where parts_no='$no' and dong_no='{$rs_vdong[dong_no]}' "); $tt_now_susu += ($rs_vdong[ipchu_susu]-($rs_dote_sum[dt]+$rs_dote_sum[ps])); if($rs_vdong[ipchu_susu]) { $vv_rate=sprintf("%.2f", ( ($rs_vdong[ipchu_susu]-($rs_dote_sum[dt]+$rs_dote_sum[ps])) / $rs_vdong[ipchu_susu] ) * 100 ); } else { $vv_rate=0; } $rs_dote_last=RS("select * from farm_parts_dong_dote where parts_no='$no' and dong_no='{$rs_vdong[dong_no]}' and temper > 0 order by jdate desc limit 0,1 "); ?> <tr > <td scope="row" rowspan='3' style='padding-bottom:0'><div id="countDown" style='font-size:15px;margin-left:0;margin-right:-20px'><div><?=$rs_vdong[dong_name]?></div></div></td> <td style='padding-bottom:0'><small>누적도태</small><br><?=number_format($rs_dote_sum[dt])?></td> <td style='padding-bottom:0'><small>누적폐사</small><br><?=number_format($rs_dote_sum[ps])?></td> <td style='padding-bottom:0'><small>도폐합</small><br><?=number_format($rs_dote_sum[dt]+$rs_dote_sum[ps])?></td> </tr> <tr> <td style='border-top:0 !important;padding-bottom:0'><small>현재수수</small><br><?=number_format($tt_now_susu)?></td> <td style='border-top:0 !important;padding-bottom:0'><small>육성율</small><br><?=$vv_rate?>%</td> <td style='border-top:0 !important;padding-bottom:0'><small>사료섭취량</small><br><?=number_format($rs_dote_sum[fd])?>g</td> </tr> <tr> <td style='border-top:0 !important;'><small>온도</small><br><?=$rs_dote_last[temper]?>℃</td> <td style='border-top:0 !important;'><small>습도</small><br><?=$rs_dote_last[humi]?>%</td> <td style='border-top:0 !important;'><small>중량</small><br><?=number_format($rs_dote_sum[wt])?>g</td> </tr> <? } ?> </tbody> </table> </div> </div> </div> <div class="wide-block p-0" id='dv_il'> <div class="section full mt-2"> <div class="section-title">일령별 사육현황</div> <div class="content-header mb-05">일령별 상세내역</div> </div> <div class="blog-post"> <div class="table-responsive"> <table class="table"> <tbody> <? $arr_chart_il=array(); $arr_chart_weight=array(); $arr_chart_feed=array(); $arr_chart_dopesa=array(); $arr_chart_dote=array(); $arr_chart_pesa=array(); $arr_chart_temp=array(); $arr_chart_humi=array(); $arr_chart_rate=array(); $arr_chart_nudopesa=array(); $arr_chart_nowsusu=array(); $tt_nudopesa=0; $tt_chart_dote=0; $tt_chart_pesa=0; $arr_chart_dong_rate=array(); $result_vdong=mysql_query("select a.*, b.dong_name from farm_parts_dong a, farm_dong_info b where a.parts_no='{$rs[no]}' and a.dong_no=b.no order by CAST(b.dong_name AS DECIMAL(10,2)) asc") or die(); while($rs_vdong=mysql_fetch_array($result_vdong)) { $arr_chart_dong_rate[$rs_vdong[dong_name]]=array(); } for($i=1;$i<=$tt_il;$i++) { $arr_chart_il[]=$i; $n2=$i-1; $vv_date=date('m-d', strtotime("+ $n2 day ",strtotime($rs_min[jdate]))); $tt_dote=0; $tt_pesa=0; $tt_now_susu=0; $arr_weight=array(); $arr_rate=array(); $arr_feed=array(); $arr_temp=array(); $arr_humi=array(); $result_vv_dong=mysql_query("select * from farm_parts_dong where parts_no='$no' ") or die(mysql_error()); while($rs_vv_dong=mysql_fetch_array($result_vv_dong)) { $jj_date=date('Y-m-d', strtotime("+ $n2 day ",strtotime($rs_vv_dong[ipchu_date]))); $rs_vv_dote=RS("select * from farm_parts_dong_dote where parts_no='$no' and dong_no='{$rs_vv_dong[dong_no]}' and jdate='$jj_date' "); $rs_dote_sum=RS("select sum(dote+pesa) as cnt, weight from farm_parts_dong_dote where parts_no='$no' and dong_no='{$rs_vv_dong[dong_no]}' and jdate <= '$jj_date' "); $tt_dote+=$rs_vv_dote[dote]; $tt_pesa+=$rs_vv_dote[pesa]; $tt_now_susu += ($rs_vv_dong[ipchu_susu]-$rs_dote_sum[cnt]); if($rs_vv_dote[weight] > 0) { $arr_weight[]=$rs_vv_dote[weight]; } if($rs_vv_dong[ipchu_susu]) { $vv_rate= ( ($rs_vv_dong[ipchu_susu]-$rs_dote_sum[cnt]) / $rs_vv_dong[ipchu_susu] ) * 100; $arr_rate[]=$vv_rate; } else { $vv_rate=0; } if($rs_vv_dote[feed] > 0) { $arr_feed[]=$rs_vv_dote[feed]; } if($rs_vv_dote[temper] > 0) { $arr_temp[]=$rs_vv_dote[temper]; } if($rs_vv_dote[humi] > 0) { $arr_humi[]=$rs_vv_dote[humi]; } $tt_nudopesa+=($rs_vv_dote[dote]+$rs_vv_dote[pesa]); $tt_chart_dote+=$rs_vv_dote[dote]; $tt_chart_pesa+=$rs_vv_dote[pesa]; $rs_dong=RS("select * from farm_dong_info where no='{$rs_vv_dong[dong_no]}' "); $arr_chart_dong_rate[$rs_dong[dong_name]][]=sprintf("%.2f",$vv_rate); } if(count($arr_weight) > 0) { $tt_weight=floor(array_sum($arr_weight)/count($arr_weight)); } else {$tt_weight=0;} if(count($arr_rate) > 0) { $tt_rate=sprintf("%.2f",array_sum($arr_rate)/count($arr_rate)); } else {$tt_rate=0;} if(count($arr_feed) > 0) { $tt_feed=sprintf("%.1f",array_sum($arr_feed)/count($arr_feed)); } else {$tt_feed=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;} $arr_chart_weight[]=$tt_weight; $arr_chart_feed[]=$tt_feed; $arr_chart_dopesa[]=($tt_dote+$tt_pesa); $arr_chart_dote[]=$tt_dote; $arr_chart_pesa[]=$tt_pesa; $arr_chart_temp[]=$tt_temp; $arr_chart_humi[]=$tt_humi; $arr_chart_rate[]=$tt_rate; $arr_chart_nudopesa[]=$tt_nudopesa; $arr_chart_nowsusu[]=$tt_now_susu; ?> <tr > <td scope="row" rowspan='3' style='padding-bottom:0'><div id="countDown" style='font-size:15px;margin-left:0;margin-right:-20px'><div><?=$i?>일령<span><?=$vv_date?></span></div></div></td> <td style='padding-bottom:0'><small>도태</small><br><?=number_format($tt_dote)?></td> <td style='padding-bottom:0'><small>폐사</small><br><?=number_format($tt_pesa)?></td> <td style='padding-bottom:0'><small>도폐합</small><br><?=number_format($tt_dote+$tt_pesa)?></td> </tr> <tr> <td style='border-top:0 !important;padding-bottom:0'><small>현재수수</small><br><?=number_format($tt_now_susu)?></td> <td style='border-top:0 !important;padding-bottom:0'><small>육성율</small><br><?=$tt_rate?>%</td> <td style='border-top:0 !important;padding-bottom:0'><small>사료섭취량</small><br><?=$tt_feed?>g</td> </tr> <tr> <td style='border-top:0 !important;'><small>온도</small><br><?=$tt_temp?>℃</td> <td style='border-top:0 !important;'><small>습도</small><br><?=$tt_humi?>%</td> <td style='border-top:0 !important;'><small>중량</small><br><?=number_format($tt_weight)?>g</td> </tr> <? } $chart_il=implode(",",$arr_chart_il); $chart_weight=implode(",",$arr_chart_weight); $chat_feed=implode(",",$arr_chart_feed); $chart_dopesa=implode(",",$arr_chart_dopesa); $chart_dote=implode(",",$arr_chart_dote); $chart_pesa=implode(",",$arr_chart_pesa); $chat_temp=implode(",",$arr_chart_temp); $chat_humi=implode(",",$arr_chart_humi); $chat_rate=implode(",",$arr_chart_rate); $chat_nudopesa=implode(",",$arr_chart_nudopesa); $chat_nowsusu=implode(",",$arr_chart_nowsusu); foreach($arr_chart_dong_rate as $ak => $av) { $arr_chart_dong_rate[$ak]=implode(",",$av); } ?> </tbody> </table> </div> </div> </div> <div class="section full mt-1" id='dv_dong_il'> <div class="section full"> <div class="section-title">동별 일령별 사육현황</div> <div class="content-header mb-05">동별 일령별 사육현황 상세내역</div> </div> <div class="wide-block pt-2 pb-2"> <ul class="nav nav-tabs style1" role="tablist"> <? $arr_tab_dong=array(); $i=1; $result_vdong=mysql_query("select a.*, b.dong_name from farm_parts_dong a, farm_dong_info b where a.parts_no='{$rs[no]}' and a.dong_no=b.no order by CAST(b.dong_name AS DECIMAL(10,2)) asc") or die(); while($rs_vdong=mysql_fetch_array($result_vdong)) { $arr_tab_dong[$rs_vdong[dong_no]]=$rs_vdong[dong_name]; if($i==1) {$active_no=$rs_vdong[dong_no];} ?> <li class="nav-item"> <a class="nav-link <?if($i==1) {echo "active";}?>" data-toggle="tab" href="#tab_<?=$rs_vdong[dong_no]?>" role="tab"> <?=$rs_vdong[dong_name]?> </a> </li> <?$i++;}?> </ul> <div class="tab-content mt-2"> <? foreach($arr_tab_dong as $ak => $av) { ?> <div class="tab-pane fade <?if($ak==$active_no) {echo "show active";}?>" id="tab_<?=$ak?>" role="tabpanel"> <div class="table-responsive"> <table class="table"> <tbody> <? for($i=1;$i<=$tt_il;$i++) { $n2=$i-1; $rs_vv_dong=RS("select * from farm_parts_dong where parts_no='$no' and dong_no='$ak' "); $jj_date=date('Y-m-d', strtotime("+ $n2 day ",strtotime($rs_vv_dong[ipchu_date]))); $jj_date2=date('m-d', strtotime("+ $n2 day ",strtotime($rs_vv_dong[ipchu_date]))); $rs_vv_dote=RS("select * from farm_parts_dong_dote where parts_no='$no' and dong_no='{$rs_vv_dong[dong_no]}' and jdate='$jj_date' "); $rs_dote_sum=RS("select sum(dote+pesa) as cnt, weight from farm_parts_dong_dote where parts_no='$no' and dong_no='{$rs_vv_dong[dong_no]}' and jdate <= '$jj_date' "); $now_susu = ($rs_vv_dong[ipchu_susu]-$rs_dote_sum[cnt]); if($rs_vv_dong[ipchu_susu]) { $vv_rate= sprintf("%.2f", ( ($rs_vv_dong[ipchu_susu]-$rs_dote_sum[cnt]) / $rs_vv_dong[ipchu_susu] ) * 100); } else { $vv_rate=0; } ?> <tr > <td scope="row" rowspan='3' style='padding-bottom:0'><div id="countDown" style='font-size:15px;margin-left:0;margin-right:-20px'><div><?=$i?>일령<span><?=$jj_date2?></span></div></div></td> <td style='padding-bottom:0'><small>도태</small><br><?=number_format($rs_vv_dote[dote])?></td> <td style='padding-bottom:0'><small>폐사</small><br><?=number_format($rs_vv_dote[pesa])?></td> <td style='padding-bottom:0'><small>도폐합</small><br><?=number_format($rs_vv_dote[dote]+$rs_vv_dote[pesa])?></td> </tr> <tr> <td style='border-top:0 !important;padding-bottom:0'><small>현재수수</small><br><?=number_format($now_susu)?></td> <td style='border-top:0 !important;padding-bottom:0'><small>육성율</small><br><?=$vv_rate?>%</td> <td style='border-top:0 !important;padding-bottom:0'><small>사료섭취량</small><br><?=$rs_vv_dote[feed]?>g</td> </tr> <tr> <td style='border-top:0 !important;'><small>온도</small><br><?=$rs_vv_dote[temper]?>℃</td> <td style='border-top:0 !important;'><small>습도</small><br><?=$rs_vv_dote[humi]?>%</td> <td style='border-top:0 !important;'><small>중량</small><br><?=number_format($rs_vv_dote[weight])?>g</td> </tr> <? } ?> </tbody> </table> </div> </div> <? } ?> </div> </div> </div> <div class="wide-block p-0" style='background:transparent' id='dv_date'> <div class="section full mt-2"> <div class="section-title">날짜별 사육현황</div> <div class="content-header mb-05">날짜별 상세내역</div> </div> <div class="blog-post"> <div class="table-responsive"> <table class="table"> <tbody> <? //$result_dote=mysql_query("select * from farm_parts_dong_dote where parts_no='{$rs[no]}' order by jdate asc ") or die(); $result_dote=mysql_query("select a.*, b.dong_name from farm_parts_dong_dote a, farm_dong_info b where a.parts_no='{$rs[no]}' and a.dong_no=b.no order by a.jdate asc, CAST(b.dong_name AS DECIMAL(10,2)) asc") or die(); while($rs_dote=mysql_fetch_array($result_dote)) { //$rs_dong=RS("select * from farm_dong_info where no='{$rs_dote[dong_no]}' "); ?> <tr > <td scope="row" style='padding-bottom:0'><small>날짜</small><br><?=$rs_dote[jdate]?></td> <td style='padding-bottom:0'><small>동</small><br><?=$rs_dote[dong_name]?></td> <td style='padding-bottom:0'><small>도태</small><br><?=number_format($rs_dote[dote])?></td> <td style='padding-bottom:0'><small>폐사</small><br><?=number_format($rs_dote[pesa])?></td> </tr> <tr> <td scope="row" style='border-top:0 !important'><small>중량</small><br><?=$rs_dote[weight]?>g</td> <td style='border-top:0 !important'><small>섭취량</small><br><?=$rs_dote[feed]?>g</td> <td style='border-top:0 !important'><small>온도</small><br><?=$rs_dote[temper]?>℃</td> <td style='border-top:0 !important'><small>습도</small><br><?=$rs_dote[humi]?>%</td> </tr> <?}?> </tbody> </table> </div> </div> </div> <div class="wide-block p-0" id='dv_feed'> <div class="section full mt-2"> <div class="section-title">날짜별 사료입고</div> <div class="content-header mb-05">날짜별 사료입고 상세내역</div> </div> <div class="blog-post"> <div class="table-responsive"> <table class="table"> <tbody> <? $result_dote=mysql_query("select * from farm_parts_feed where parts_no='{$rs[no]}' order by jdate asc ") or die(); while($rs_dote=mysql_fetch_array($result_dote)) { ?> <tr > <td scope="row" style='padding-bottom:0'><small>날짜</small><br><?=$rs_dote[jdate]?></td> <td style='padding-bottom:0'><small>사료명</small><br><?=$rs_dote[feed_name]?></td> <td style='padding-bottom:0'><small>주문량</small><br><?=number_format($rs_dote[feed_ton])?>톤</td> <td style='padding-bottom:0'><small>지대</small><br><?=number_format($rs_vdong[jide_su])?>포대</td> </tr> <tr> <td scope="row" style='border-top:0 !important'><small>차량번호</small><br><?=$rs_dote[car_num]?></td> </tr> <?}?> </tbody> </table> </div> </div> </div> <div id="chart" style='margin-top:10px'></div> <div id="chart2" style='margin-top:10px'></div> <div id="chart3" style='margin-top:10px'></div> <div id="chart5" style='margin-top:10px'></div> <div id="chart7" style='margin-top:10px'></div> <div id="chart6" style='margin-top:10px'></div> <!-- bottom right --> <div class="fab-button animate bottom-right dropdown" > <a href="#" class="fab" data-toggle="dropdown"> <ion-icon name="add-outline"></ion-icon> </a> <div class="dropdown-menu"> <a class="dropdown-item" href="#dv_total"> <ion-icon name="book-outline"></ion-icon> <p>종합사육성적</p> </a> <a class="dropdown-item" href="#dv_ipchu"> <ion-icon name="enter"></ion-icon> <p>입추내역</p> </a> <a class="dropdown-item" href="#dv_chulha"> <ion-icon name="exit-outline"></ion-icon> <p>출하내역</p> </a> <a class="dropdown-item" href="#dv_dong"> <ion-icon name="cube-outline"></ion-icon> <p>동별사육현황</p> </a> <a class="dropdown-item" href="#dv_dong_il"> <ion-icon name="layers-outline"></ion-icon> <p>동별 일령별사육현황</p> </a> <a class="dropdown-item" href="#dv_il"> <ion-icon name="receipt-outline"></ion-icon> <p>일령별사육현황</p> </a> <a class="dropdown-item" href="#dv_date"> <ion-icon name="calendar-outline"></ion-icon> <p>날짜별 사육현황</p> </a> <a class="dropdown-item" href="#dv_feed"> <ion-icon name="heart-half-outline"></ion-icon> <p>날짜별 사료입고</p> </a> <a class="dropdown-item" href="#chart"> <ion-icon name="bar-chart-outline"></ion-icon> <p>그래표</p> </a> </div> </div> <!-- * bottom right --> </div> <!-- DialogIconedDanger --> <div class="modal fade dialogbox" id="DialogIconedDanger" data-backdrop="static" tabindex="-1" role="dialog" > <div class="modal-dialog" role="document" > <div class="modal-content"> <div class="modal-icon text-danger"> <ion-icon name="close-circle"></ion-icon> </div> <div class="modal-header"> <h5 class="modal-title">Error</h5> </div> <div class="modal-body" id='DialogIconedDanger_body'> This is a dialog message </div> <div class="modal-footer"> <div class="btn-inline"> <a href="#" class="btn" data-dismiss="modal">확인</a> </div> </div> </div> </div> </div> <!-- * DialogIconedDanger --> <div class="modal fade dialogbox" id="DialogIconedButtonInline" data-backdrop="static" tabindex="-1" role="dialog" > <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id='DialogIconedButtonInline_title'>Dialog title</h5> </div> <div class="modal-body" id='DialogIconedButtonInline_body'> This is a dialog message </div> <div class="modal-footer"> <div class="btn-inline"> <a href="javascript:fn_del_ok()" class="btn btn-text-danger" > 예 </a> <a href="#" class="btn btn-text-primary" data-dismiss="modal"> 아니오 </a> </div> </div> </div> </div> </div> <!-- * Dialog Iconed Inline --> <div class="modal fade dialogbox" id="DialogIconedButtonInline_regok" data-backdrop="static" tabindex="-1" role="dialog" > <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id='DialogIconedButtonInline_title_regok'>파스등록</h5> </div> <div class="modal-body" id='DialogIconedButtonInline_body_regok'> 정말로 등록하시겠습니까? </div> <div class="modal-footer"> <div class="btn-inline"> <a href="javascript:fn_reg_ok()" class="btn btn-text-danger" > 예 </a> <a href="#" class="btn btn-text-primary" data-dismiss="modal"> 아니오 </a> </div> </div> </div> </div> </div> <div class="modal fade dialogbox" id="DialogIconedButtonInline_modyok" data-backdrop="static" tabindex="-1" role="dialog" > <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id='DialogIconedButtonInline_title_modyok'>알림</h5> </div> <div class="modal-body" id='DialogIconedButtonInline_body_modyok'> 이렇게 입력 하시겠습니까? </div> <div class="modal-footer"> <div class="btn-inline"> <a href="javascript:fn_mody_ok()" class="btn btn-text-danger" > 예 </a> <a href="#" class="btn btn-text-primary" data-dismiss="modal"> 아니오 </a> </div> </div> </div> </div> </div> <!-- toast center iconed --> <div id="toast-11" class="toast-box toast-center"> <div class="in"> <ion-icon name="alert-circle" class="text-danger"></ion-icon> <div class="text"> 등록된 축사가 <br>없습니다.<br>동설정을 먼저 하세요. </div> </div> <div class="btn-list"> <button type="button" class="btn btn-sm btn-text-light close-button">CLOSE</button> <a href="dong_set.php" class="btn btn-text-primary btn-block" data-dismiss="modal"> <ion-icon name="share-outline"></ion-icon> 바로가기 </a> </div> </div> <!-- toast center iconed --> </div> <!-- * App Capsule --> <!-- App Bottom Menu --> <?include_once("inc_sidemenu.php");?> <!-- * App Bottom Menu --> <!-- ///////////// Js Files //////////////////// --> <!-- Jquery --> <script src="assets/js/lib/jquery-3.4.1.min.js"></script> <!-- Bootstrap--> <script src="assets/js/lib/popper.min.js"></script> <script src="assets/js/lib/bootstrap.min.js"></script> <!-- Ionicons --> <script src="https://unpkg.com/ionicons@5.0.0/dist/ionicons.js"></script> <!-- Owl Carousel --> <script src="assets/js/plugins/owl-carousel/owl.carousel.min.js"></script> <!-- Base Js File --> <script src="assets/js/base.js"></script> </body> </html> <script> <? if(!mysql_num_rows($result_dong)) { ?>toastbox('toast-11');<? } ?> var vv_no; var vv_date; function fn_mody(no,date) { vv_no=no; vv_date=date; $("#DialogIconedButtonInline_modyok").modal("show"); return; } function fn_mody_ok() { var params = jQuery("#frm_reg_"+vv_no+"_"+vv_date).serialize(); params+="&no="+vv_no+"&jdate="+vv_date; //alert(params);return; jQuery.ajax({ url: 'daily_dote_set_do.php', type: 'POST', data:params, contentType: 'application/x-www-form-urlencoded; charset=UTF-8', dataType: 'html', success: function (result) { if (result){ var json = eval("(" + result + ")"); if(json.rst=='1') { window.location.reload(); } else if(json.rst=='double') { } } } }); } var gl_par; function fn_del(no) { $("#DialogIconedButtonInline_body").html("정말로 삭제하시겠습니까?"); $("#DialogIconedButtonInline_title").html("Alert"); $("#DialogIconedButtonInline").modal("show"); gl_par='?no='+no; } function fn_del_ok() { $.post( "parts_set_del_do.php"+gl_par, function( res ) { //alert(res); var json=eval("("+res+")"); if(json.rst=='1') { window.location.reload(true); } else { } }); } function scrollToAnchor(hash) { var target = $(hash), headerHeight = $(".navbar-fixed-top").height() + 5; // Get fixed header height target = target.length ? target : $('[name=' + hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top - 60 }, 100); return false; } } if(window.location.hash) { scrollToAnchor(window.location.hash); } $("a[href*=\\#]:not([href=\\#])").click(function() { if(this.hash.substr(1,4)=='tab_') { } else { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) { scrollToAnchor(this.hash); } } }); </script> <script> c3.generate({ bindto: '#chart', padding: { right: 20, }, title: { text: '중량 및 섭취량' }, point: { show: true }, color: { pattern: [ '#00BCD4','#607D8B'] }, data: { x: '일령', columns: [ [ '일령', <?=$chart_il?> ], [ '중량', <?=$chart_weight?> ], [ '섭취량', <?=$chat_feed?> ] ], }, axis: { x: { label: '일령' }, y: { label: 'g(그램)' }, rotated : true }, size: { height: 520, }, /* subchart: { show: true } */ }); c3.generate({ bindto: '#chart2', padding: { right: 20, top: 20, }, title: { text: '도폐사 및 온도 습도' }, point: { show: true }, color: { pattern: [ '#00BCD4','#607D8B','#ff0000','#6699ff'] }, data: { x: '일령', columns: [ [ '일령', <?=$chart_il?> ], [ '도태', <?=$chart_dote?> ], [ '폐사', <?=$chart_pesa?> ], [ '온도', <?=$chat_temp?> ], [ '습도', <?=$chat_humi?> ], ], types: { '도태': 'bar', '폐사': 'bar', '온도': 'line', '습도': 'line' }, groups: [ ['도태','폐사'] ], axes: { '도태': 'y', '폐사': 'y', '온도': 'y2', '습도': 'y2' } }, axis: { x: { label: '일령' }, y: { label: '도폐사(수)', show : true }, y2: { label: '온습도', show : true }, rotated : true }, size: { height: 520, }, /* subchart: { show: true } */ }); c3.generate({ bindto: '#chart3', padding: { left: 40, right: 40, top: 20, }, title: { text: '육성률과 도폐사' }, point: { show: true }, color: { pattern: [ '#ff3300','#6699ff'] }, data: { x: '일령', columns: [ [ '일령', <?=$chart_il?> ], [ '도폐사', <?=$chart_dopesa?> ], [ '육성율', <?=$chat_rate?> ] ], types: { '도폐사': 'bar', '육성율': 'line' }, axes: { '도폐사': 'y2' } }, axis: { x: { label: '일령' }, y: { label: '육성률(%)', show : true }, y2: { label: '도폐사(수)', show : true }, rotated : true }, size: { height: 540, } /* subchart: { show: true } */ }); c3.generate({ bindto: '#chart5', padding: { left: 40, right: 40, top: 20, }, title: { text: '누적도폐사 와 현재수수' }, point: { show: true }, color: { pattern: [ '#ff3300','#6699ff'] }, data: { x: '일령', columns: [ [ '일령', <?=$chart_il?> ], [ '누적도폐사', <?=$chat_nudopesa?> ], [ '현재수수', <?=$chat_nowsusu?> ] ], types: { '누적도폐사': 'line', '현재수수': 'line' }, axes: { '현재수수': 'y2' } }, axis: { x: { label: '일령' }, y: { label: '누적도폐사(수)', show : true }, y2: { label: '현재수수(수)', show : true }, rotated : true }, size: { height: 540, } /* subchart: { show: true } */ }); c3.generate({ bindto: '#chart6', padding: { top: 20, }, title: { text: '도태/폐사 비율' }, point: { show: true }, color: { pattern: [ '#ff3300','#6699ff'] }, data: { columns: [ [ '도태', <?=$tt_chart_dote?> ], [ '폐사', <?=$tt_chart_pesa?> ] ], type : 'pie', }, /* subchart: { show: true } */ }); c3.generate({ bindto: '#chart7', padding: { left: 40, right: 40, top: 20, }, title: { text: '동별 육성율' }, point: { show: true }, data: { x: '일령', columns: [ [ '일령', <?=$chart_il?> ], <? foreach($arr_chart_dong_rate as $ak => $av) { ?>['<?=$ak?>' , <?=$av?>],<? } ?> ], types: { <? foreach($arr_chart_dong_rate as $ak => $av) { ?>'<?=$ak?>' : 'line',<? } ?> } }, axis: { x: { label: '일령' }, y: { label: '육성율(%)', show : true }, rotated : true }, size: { height: 540, } /* subchart: { show: true } */ }); </script>