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_plan_write2.php
<? include_once("inc_header.php"); $on_menu="farm_manager"; $on_sub_menu="farm_manager_".$_GET[jong_type]; $arr_jongtype=array("1"=>"육계","2"=>"삼계","3"=>"오리","4"=>"토종닭"); if(!$sel_date) {$sel_date=date('Y-m-d');} $tabActive = 6; ?> <!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; } </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"> <div class="tabs-container"> <?include_once("inc_ship.php");?> <div class="tab-content"> <div role="tabpanel" id="tab-1" class="tab-pane active show"> <div class="panel-body"> <form name='frm_search' method='get'> <table class="table"> <tr style="border-top: hidden;"> <td> <div class="row mt-2 ml-2"> <div class="form-group row" id="data_1"> <label class="col-sm-4 col-form-label font-bold">출하일 선택</label> <div class="input-group date col-sm-8"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span><input type="text" class="form-control" name='sel_date' id='sel_date' value="<?=$sel_date?>" onchange="this.form.submit()" autocomplete="off" placeholder="출하일자"> </div> </div> <div class="col-sm-4 m-b-xs"> <!--<button type="button" class="btn btn-primary">분양확정</button>--> </div> </div> </td> </tr> </table> <input type='hidden' name='pbreedtype' value="<?=$pbreedtype?>"> <input type='hidden' name='jong_type' value="<?=$jong_type?>"> </form> <table class="table table-bordered text-center"> <thead> <tr> <th>구분</th> <th>1.00~1.09</th> <th>1.10~1.19</th> <th>1.20~1.29</th> <th>1.30~1.39</th> <th>1.40~1.49</th> <th>1.50~1.59</th> <th>1.60~1.69</th> <th>1.70~1.79</th> <th>1.80~1.89</th> <th>합계</th> </tr> </thead> <tbody> <? $today_week = date("w",strtotime($sel_date)); $today_jucha = date("W",strtotime($sel_date)); $today_year = date("Y",strtotime($sel_date)); $arr_yo=array("0"=>"sun","1"=>"mon","2"=>"tue","3"=>"wed","4"=>"thu","5"=>"fri","6"=>"sat"); $db_col="susu_".$arr_yo[$today_week]; //echo "select sum( $db_col ) as cnt from doge_yejun_plan where company_no='{$_COOKIE[ucompany_no]}' and breedtype='$pbreedtype' and jong_type='$jong_type' and weight >= 1000 and weight < 1100 and jyear='$today_year' and jucha='$today_jucha' "; $rs_1=RS("select sum( $db_col ) as cnt from doge_yejun_plan where company_no='{$_COOKIE[ucompany_no]}' and breedtype='$pbreedtype' and jong_type='$jong_type' and weight >= 1000 and weight < 1100 and jyear='$today_year' and jucha='$today_jucha' "); $rs_2=RS("select sum( $db_col ) as cnt from doge_yejun_plan where company_no='{$_COOKIE[ucompany_no]}' and breedtype='$pbreedtype' and jong_type='$jong_type' and weight >= 1100 and weight < 1200 and jyear='$today_year' and jucha='$today_jucha' "); $rs_3=RS("select sum( $db_col ) as cnt from doge_yejun_plan where company_no='{$_COOKIE[ucompany_no]}' and breedtype='$pbreedtype' and jong_type='$jong_type' and weight >= 1200 and weight < 1300 and jyear='$today_year' and jucha='$today_jucha' "); $rs_4=RS("select sum( $db_col ) as cnt from doge_yejun_plan where company_no='{$_COOKIE[ucompany_no]}' and breedtype='$pbreedtype' and jong_type='$jong_type' and weight >= 1300 and weight < 1400 and jyear='$today_year' and jucha='$today_jucha' "); $rs_5=RS("select sum( $db_col ) as cnt from doge_yejun_plan where company_no='{$_COOKIE[ucompany_no]}' and breedtype='$pbreedtype' and jong_type='$jong_type' and weight >= 1400 and weight < 1500 and jyear='$today_year' and jucha='$today_jucha' "); $rs_6=RS("select sum( $db_col ) as cnt from doge_yejun_plan where company_no='{$_COOKIE[ucompany_no]}' and breedtype='$pbreedtype' and jong_type='$jong_type' and weight >= 1500 and weight < 1600 and jyear='$today_year' and jucha='$today_jucha' "); $rs_7=RS("select sum( $db_col ) as cnt from doge_yejun_plan where company_no='{$_COOKIE[ucompany_no]}' and breedtype='$pbreedtype' and jong_type='$jong_type' and weight >= 1600 and weight < 1700 and jyear='$today_year' and jucha='$today_jucha' "); $rs_8=RS("select sum( $db_col ) as cnt from doge_yejun_plan where company_no='{$_COOKIE[ucompany_no]}' and breedtype='$pbreedtype' and jong_type='$jong_type' and weight >= 1700 and weight < 1800 and jyear='$today_year' and jucha='$today_jucha' "); $rs_9=RS("select sum( $db_col ) as cnt from doge_yejun_plan where company_no='{$_COOKIE[ucompany_no]}' and breedtype='$pbreedtype' and jong_type='$jong_type' and weight >= 1800 and weight < 1900 and jyear='$today_year' and jucha='$today_jucha' "); ?> <tr> <td>도계계획</td> <td id='dd_1' ddv_1='<?=$rs_1[cnt]?>'><?=number_format($rs_1[cnt])?></td> <td id='dd_2' ddv_2='<?=$rs_2[cnt]?>'><?=number_format($rs_2[cnt])?></td> <td id='dd_3' ddv_3='<?=$rs_3[cnt]?>'><?=number_format($rs_3[cnt])?></td> <td id='dd_4' ddv_4='<?=$rs_4[cnt]?>'><?=number_format($rs_4[cnt])?></td> <td id='dd_5' ddv_5='<?=$rs_5[cnt]?>'><?=number_format($rs_5[cnt])?></td> <td id='dd_6' ddv_6='<?=$rs_6[cnt]?>'><?=number_format($rs_6[cnt])?></td> <td id='dd_7' ddv_7='<?=$rs_7[cnt]?>'><?=number_format($rs_7[cnt])?></td> <td id='dd_8' ddv_8='<?=$rs_8[cnt]?>'><?=number_format($rs_8[cnt])?></td> <td id='dd_9' ddv_9='<?=$rs_9[cnt]?>'><?=number_format($rs_9[cnt])?></td> <td id='dd_10' ddv_10='<?=($rs_1[cnt]+$rs_2[cnt]+$rs_3[cnt]+$rs_4[cnt]+$rs_5[cnt]+$rs_6[cnt]+$rs_7[cnt]+$rs_8[cnt]+$rs_9[cnt])?>'><?=number_format($rs_1[cnt]+$rs_2[cnt]+$rs_3[cnt]+$rs_4[cnt]+$rs_5[cnt]+$rs_6[cnt]+$rs_7[cnt]+$rs_8[cnt]+$rs_9[cnt])?></td> </tr> <tr> <td>출하계획</td> <td id='dv_1'>0</td> <td id='dv_2'>0</td> <td id='dv_3'>0</td> <td id='dv_4'>0</td> <td id='dv_5'>0</td> <td id='dv_6'>0</td> <td id='dv_7'>0</td> <td id='dv_8'>0</td> <td id='dv_9'>0</td> <td id='dv_10'>0</td> </tr> </tbody> <tfoot style="background-color: #F5F5F6;" class="font-bold"> <tr> <td>필요수량</td> <td id='dt_1'>0</td> <td id='dt_2'>0</td> <td id='dt_3'>0</td> <td id='dt_4'>0</td> <td id='dt_5'>0</td> <td id='dt_6'>0</td> <td id='dt_7'>0</td> <td id='dt_8'>0</td> <td id='dt_9'>0</td> <td id='dt_10'>0</td> </tr> </tfoot> </table> <hr> <div class="row"> <div class="col-md-8"> <div class="widget-head-color-box navy-bg p-sm text-center"> <div> <span>출하예정명단</span> </div> </div> <div class="widget-text-box" style="width:100%; height:400px; overflow-y:scroll"> <style> .tableFixHead { overflow-y: auto; height: 400px; } .tableFixHead thead th { position: sticky; top: 0; } /* Just common table stuff. Really. */ table { border-collapse: collapse; width: 100%; } th, td { padding: 8px 16px; } th { background:#eee; } </style> <div class="tableFixHead"> <table class="table table-bordered table-sm text-center"> <thead> <tr> <th>구분</th> <th>출하차수</th> <th>농가명</th> <th>일령</th> <th>입추수수</th> <th>현재수수</th> <th>육성율</th> <th>중량</th> <th>잔여수수</th> <th>출하수수(당일)</th> <th>외부출하</th> <th>작성</th> </tr> </thead> <tbody> <? $arr_chul_weight=array(); $result=mysql_query("select * from farm_contract where contractor_company_no = '{$_COOKIE[ucompany_no]}' and breed_type='{$arr_jongtype[$jong_type]}' and gps_type='$pbreedtype' and chulha_status >= '3' "); while($rs=mysql_fetch_array($result)) { $rs_parts=RS("select * from farm_contract_parts where contract_no='{$rs[no]}' order by no desc limit 0,1 "); $result_cdong=mysql_query("select * from farm_contract_dong where farm_contract_no='{$rs[no]}' ") or die(); while($rs_cdong=mysql_fetch_array($result_cdong)) { $rs_dote=RS("select * from farm_dote_input_log where parts_no='{$rs_parts[no]}' and dong_no='{$rs_cdong[farm_dong_info_no]}' and weight > 0 order by weight desc limit 0,1 "); $rs_chulha=RS("select * from farm_chulha_plan where parts_no='{$rs_parts[no]}' and dong_no='{$rs_cdong[farm_dong_info_no]}' and jdate='$sel_date' "); $arr_chul_weight[$rs_dote[weight]]=$arr_chul_weight[$rs_dote[weight]]+$rs_chulha[chul_su]; } } $result=mysql_query("select * from farm_contract where contractor_company_no = '{$_COOKIE[ucompany_no]}' and breed_type='{$arr_jongtype[$jong_type]}' and gps_type='$pbreedtype' and chulha_status >='3' "); $ttt_ipchu_susu=0; $ttt_now_susu=0; $ttt_chul_su=0; $ttt_webu_su=0; $ttt_chul_remain_su=0; while($rs=mysql_fetch_array($result)) { $rs_parts=RS("select * from farm_contract_parts where contract_no='{$rs[no]}' order by no desc limit 0,1 "); $rs_farm=RS("select * from farm where no='{$rs[farm_no]}' "); //일령 구하기 $rs_last_ipchu=RS("select min(jdate) as vjdate from farm_ipchu_confirm_log where parts_no='{$rs_parts[no]}' "); $sdate = new DateTime($rs_last_ipchu[vjdate]); $edate = new DateTime($sel_date); $diff = date_diff($sdate, $edate); //--일령 구하기 //출하차수 구하기 $rs_chasu=RS("select count(distinct(jdate)) as cnt from farm_chulha_plan where parts_no='{$rs_parts[no]}' "); //--출하차수 구하기 //입추수수구하기 $rs_sum_susu=RS("select sum(susu) as cnt from farm_ipchu_confirm_log where parts_no='{$rs_parts[no]}' "); //--입추수수구하기 //현재수수구하기 $rs_dote_sum=RS("select sum(dote+pesa) as cnt from farm_dote_input_log where parts_no='{$rs_parts[no]}' "); $now_susu=$rs_sum_susu[cnt]-$rs_dote_sum[cnt]; //--현재수수구하기 //육성률구하기 if($rs_sum_susu[cnt] > 0) { $vv_rate=( ($rs_sum_susu[cnt]-$rs_dote_sum[cnt]) / $rs_sum_susu[cnt] ) * 100; } else { $vv_rate=0; } //--육성률구하기 //평균중량 구하기 $rs_avg_weight=RS("select avg(weight) as cnt from farm_dote_input_log where parts_no='{$rs_parts[no]}' and weight > 0 "); //평균중량 구하기 //출하수수 구하기 $rs_chul_susu=RS("select sum(chul_su) as cnt from farm_chulha_plan where parts_no='{$rs_parts[no]}' "); //--출하수수 구하기 //해당일 출하수수 구하기 $rs_chul_susu_seldate=RS("select sum(chul_su) as cnt from farm_chulha_plan where parts_no='{$rs_parts[no]}' and jdate='$sel_date' "); //--해당일 출하수수 구하기 //외부 출하수수 구하기 $rs_chul_susu_webu=RS("select sum(webu_susu) as cnt from farm_chulha_plan where parts_no='{$rs_parts[no]}' "); //--외부 출하수수 구하기 //입추된 모든동에 플랜이 있는지 판단 $rs_condong=RS("select GROUP_CONCAT(distinct(dong_no)) as ak from farm_chulha_plan where parts_no='{$rs_parts[no]}' order by dong_no asc "); $rs_plan_okdong=RS("select GROUP_CONCAT(distinct(dong_no)) as ak from farm_ipchu_confirm_log where parts_no='{$rs_parts[no]}' order by dong_no asc "); //echo "select GROUP_CONCAT(distinct(dong_no)) as ak from farm_chulha_plan where parts_no='{$rs_parts[no]}' order by dong_no asc <br>"; //echo "select GROUP_CONCAT(distinct(dong_no)) as ak from farm_ipchu_confirm_log where parts_no='{$rs_parts[no]}' order by dong_no asc <br>"; $exp1=explode(",",$rs_condong[ak]); $exp2=explode(",",$rs_plan_okdong[ak]); $arr_diff = array_diff($exp2,$exp1); if(sizeof($arr_diff)==0) { $bl_all_dong=true; } else { $bl_all_dong=false; } $rs_lout=RS("select sum(chul_su) as cnt from farm_chulha_plan where parts_no='{$rs_parts[no]}' and jdate='$sel_date' "); //--입추된 모든동에 플랜이 있는지 판단 $ttt_ipchu_susu+=$rs_sum_susu[cnt]; $ttt_now_susu+=$now_susu; $ttt_chul_su+=$rs_chul_susu[cnt]; $ttt_webu_su+=$rs_chul_susu_webu[cnt]; $ttt_chul_remain_su+=($now_susu-$rs_chul_susu[cnt]); ?> <tr onclick="javascript:list_view('<?=$rs[no]?>');" style="cursor: pointer;"> <td> <? if($bl_all_dong==true) { echo "<span class='text-primary'>전체</span>"; } else { if($rs_lout[cnt] != 0) { echo "<span class='text-success'>부분</span>"; } else { echo "<span class='text-default'>해당없음</span>"; } } ?> </td> <td><?=$rs_chasu[cnt]?></td> <td><?=$rs_farm[farm_name]?></td> <td><?=($diff->days+1)?></td> <td><?=number_format($rs_sum_susu[cnt])?></td> <td><?=number_format($now_susu)?></td> <td><?=sprintf("%.2f",$vv_rate)?>%</td> <td><?=number_format($rs_avg_weight[cnt])?>g</td> <td><?=number_format($now_susu-$rs_chul_susu[cnt])?></td> <td><?=number_format($rs_chul_susu[cnt])?></td> <td><?=number_format($rs_chul_susu_webu[cnt])?></td> <td> <? if($rs_chul_susu_seldate[cnt]>0) { ?><i class="fa fa-check"></i><? } ?> </td> </tr> <tr id="list_view_ex<?=$rs[no]?>" style="display: none;"> <td colspan="12"> <table class="table table-bordered text-center"> <colgroup> </colgroup> <thead> <tr> <th>축사</th> <th>일령</th> <th>입추수수</th> <th>육성율</th> <th>현재수수</th> <th>중량</th> <th>출하차수</th> <th>잔여수수</th> <th>출하수수(당일)</th> <th>외부출하</th> <th>입력</th> <th>info</th> </tr> </thead> <tbody> <? $result_jdong=mysql_query("select a.*, b.dong_name from farm_ipchu_confirm_log a, farm_dong_info b where a.parts_no='{$rs_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(); while($rs_jdong=mysql_fetch_array($result_jdong)) { $rs_dong=RS("select * from farm_dong_info where no='{$rs_jdong[dong_no]}' "); //일령 구하기 $rs_last_ipchu=RS("select min(jdate) as vjdate from farm_ipchu_confirm_log where parts_no='{$rs_parts[no]}' and dong_no='{$rs_jdong[dong_no]}' "); $sdate = new DateTime($rs_last_ipchu[vjdate]); $edate = new DateTime($sel_date); $diff = date_diff($sdate, $edate); //--일령 구하기 //입추수수구하기 $rs_sum_susu=RS("select sum(susu) as cnt from farm_ipchu_confirm_log where parts_no='{$rs_parts[no]}' and dong_no='{$rs_jdong[dong_no]}' "); //--입추수수구하기 //현재수수구하기 $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_jdong[dong_no]}' "); $now_susu=$rs_sum_susu[cnt]-$rs_dote_sum[cnt]; //--현재수수구하기 //육성률구하기 if($rs_sum_susu[cnt] > 0) { $vv_rate=( ($rs_sum_susu[cnt]-$rs_dote_sum[cnt]) / $rs_sum_susu[cnt] ) * 100; } else { $vv_rate=0; } //--육성률구하기 //평균중량 구하기 $rs_avg_weight=RS("select avg(weight) as cnt from farm_dote_input_log where parts_no='{$rs_parts[no]}' and weight > 0 and dong_no='{$rs_jdong[dong_no]}' "); //평균중량 구하기 //출하차수 구하기 $rs_chulha_chasu=RS("select count(distinct(jdate)) as cnt from farm_chulha_plan where parts_no='{$rs_parts[no]}' and dong_no='{$rs_jdong[dong_no]}' and jdate <= '$sel_date' "); //--출하차수 구하기 //출하수수 구하기 $rs_chul_susu=RS("select sum(chul_su) as cnt from farm_chulha_plan where parts_no='{$rs_parts[no]}' and dong_no='{$rs_jdong[dong_no]}' "); //--출하수수 구하기 //해당일 출하수수 구하기 $rs_chul_susu_today=RS("select sum(chul_su) as cnt from farm_chulha_plan where parts_no='{$rs_parts[no]}' and dong_no='{$rs_jdong[dong_no]}' and jdate='$sel_date' "); //--해당일 출하수수 구하기 //외부 출하수수 구하기 $rs_chul_susu_webu=RS("select sum(webu_susu) as cnt from farm_chulha_plan where parts_no='{$rs_parts[no]}' and dong_no='{$rs_jdong[dong_no]}' "); //--외부 출하수수 구하기 ?> <tr> <td><?=$rs_dong[dong_name]?></td> <td><?=($diff->days+1)?></td> <td><?=number_format($rs_sum_susu[cnt])?></td> <td><?=sprintf("%.2f",$vv_rate)?>%</td> <td><?=number_format($now_susu)?></td> <td><?=number_format($rs_avg_weight[cnt])?></td> <td><?=$rs_chulha_chasu[cnt]?></td> <td><?=number_format($now_susu-$rs_chul_susu[cnt])?></td> <td><?=number_format($rs_chul_susu_today[cnt])?></td> <td><?=number_format($rs_chul_susu_webu[cnt])?></td> <td><a class="btn btn-success btn-xs" href="javascript:fn_mody('<?=$rs_jdong[dong_no]?>')">입력</a></td> <td><i class="fa fa-info-circle" onclick="if(document.getElementById('td2_<?=$rs_jdong[dong_no]?>').style.display=='none') {document.getElementById('td2_<?=$rs_jdong[dong_no]?>').style.display='table-cell';}else {document.getElementById('td2_<?=$rs_jdong[dong_no]?>').style.display='none';}" style='corsor:pointer'></i></td> </tr> <tr> <td colspan='20' id='td2_<?=$rs_jdong[dong_no]?>' style='display:none;text-align:left'> <table class="table table-bordered"> <thead> <tr> <th>일자</th> <th>출하차수</th> <th>출하수수</th> <th>외부출하</th> <th>삭제</th> </tr> </thead> <tbody> <? $result_i=mysql_query("select * from farm_chulha_plan where parts_no='{$rs_parts[no]}' and dong_no='{$rs_jdong[dong_no]}' order by jdate asc, no asc ") or die(mysql_error()); while($rs_i=mysql_fetch_array($result_i)) { //출하차수 구하기 $rs_chulha_chasu=RS("select count(distinct(jdate)) as cnt from farm_chulha_plan where parts_no='{$rs_i[parts_no]}' and dong_no='{$rs_jdong[dong_no]}' and jdate <= '{$rs_i[jdate]}' "); //--출하차수 구하기 ?> <tr> <td><?=$rs_i[jdate]?></td> <td><?=$rs_chulha_chasu[cnt]?></td> <td><?=number_format($rs_i[chul_su])?></td> <td><?=number_format($rs_i[webu_susu])?></td> <td><a class="btn btn-danger btn-xs" href="javascript:fn_plan_del_left('<?=$rs_i[no]?>')">삭제</a></td> </tr> <?}?> </tbody> </table> </td> </tr> <div id="myModal<?=$rs_jdong[dong_no]?>" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title"><?=$rs_dong[dong_name]?></h4> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> <form id='frm_modal<?=$rs_jdong[dong_no]?>'> <div class="input-group mb-2"> <div class="input-group-prepend"> <span class="input-group-text" style='width:100px'>출하수수</span> </div> <input placeholder="출하수수 입력" type="number" name='frm_susu' class="form-control" value="<?=$rs_chulha[chul_su]?>"> <div class="input-group-append"> <span class="input-group-addon">수</span> </div> </div> <div class="float-right mb-2"> <input type="checkbox" name='chk_all' id='chk_all' value="1" > 전체 </div> <!-- <div class="row mt-6"> <div class="col"><hr></div> <div class="col-auto">외부판매</div> <div class="col"><hr></div> </div> --> <div class="input-group mb-2"> <div class="input-group-prepend"> <span class="input-group-text" style='width:100px'>외부판매</span> </div> <input placeholder="출하수수 입력" type="number" name='webu_susu' class="form-control" value="<?=$rs_chulha[webu_susu]?>"> <div class="input-group-append"> <span class="input-group-addon">수</span> </div> </div> <div class="alert alert-danger" style='text-align:left'> 외부판매는 출하수수 중 외부 판매할 수수를 입력하시기 바랍니다.<br>Ex) 출하수수 10,000수 / 외부판매 4,000수일 시 자체 도계는 6,000수이며, 판매수수는 4,000수입니다. </div> <!-- <div class="input-group mb-2"> <div class="input-group-prepend"> <span class="input-group-text" style='width:100px'>출하순서</span> </div> <input placeholder="출하순서 입력" type="number" name='frm_seq' class="form-control" value="<?=$rs_chulha[chul_seq]?>"> <div class="input-group-append"> <span class="input-group-addon">번째</span> </div> </div> --> <input type='hidden' name='contract_no' value="<?=$rs[no]?>"> <input type='hidden' name='parts_no' value="<?=$rs_parts[no]?>"> <input type='hidden' name='jdate' value="<?=$sel_date?>"> <input type='hidden' name='dong_no' value="<?=$rs_jdong[dong_no]?>"> <input type='hidden' name='ipchu_chasu' value="<?=$n?>"> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">닫기</button> <button type="button" class="btn btn-primary" onclick="fn_mody_ok('<?=$rs_jdong[dong_no]?>')">저장</button> </div> </div> </div> </div> <!-- <div id="myModal_info_<?=$rs_jdong[dong_no]?>" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title"><?=$rs_dong[dong_name]?></h4> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> <table class='table table-bordered'> <tbody> <? $result_i=mysql_query("select * from farm_chulha_plan where parts_no='{$rs_parts[no]}' and dong_no='{$rs_jdong[dong_no]}' order by jdate asc "); while($rs_i=mysql_fetch_array($result_i)) { ?> <tr> <td></td> </tr> <? } ?> </tbody> </table> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">닫기</button> </div> </div> </div> </div> --> <?}?> </tbody> </table> </td> </tr> <?$n++;}?> </tbody> <tfoot style="background-color: #F5F5F6;" class="font-bold"> <tr> <td colspan="4">합계</td> <td><?=number_format($ttt_ipchu_susu)?></td> <td><?=number_format($ttt_now_susu)?></td> <td></td> <td></td> <td><?=number_format($ttt_chul_su)?></td> <td><?=number_format($ttt_webu_su)?></td> <td><?=number_format($ttt_chul_remain_su)?></td> <td></td> </tr> </tfoot> </table> </div> </div> </div> <div class="col-md-4"> <div class="widget-head-color-box navy-bg p-sm text-center" style="background-color: #c761a3!important;"> <div> <span>출하계획</span> </div> </div> <div class="widget-text-box" style="width:100%; height:400px; overflow-y:scroll"> <table class="table table-bordered text-center"> <thead> <tr> <th>농가명</th> <th>축사</th> <th>중량</th> <th>일령</th> <th>출하수수</th> <th>외부수수</th> <th>삭제</th> </tr> </thead> <tbody> <? $arr_plan_no=array(); $tt_sum=0; $tt_sum2=0; $result=mysql_query("select * from farm_chulha_plan where company_no='{$_COOKIE[ucompany_no]}' and jdate='$sel_date' order by farm_no asc, no asc ") or die(mysql_error()); while($rs=mysql_fetch_array($result)) { $rs_farm=RS("select * from farm where no='{$rs[farm_no]}' "); $rs_dong=RS("select * from farm_dong_info where no='{$rs[dong_no]}' "); $rs_ipchu=RS("select min(jdate) as vdate from farm_ipchu_confirm_log where parts_no='{$rs[parts_no]}' and dong_no='{$rs[dong_no]}' "); $sdate = new DateTime($rs_ipchu[vdate]); $edate = new DateTime($rs[jdate]); $diff = date_diff($sdate, $edate); $rs_dote_weight=RS("select * from farm_dote_input_log where parts_no='{$rs[parts_no]}' and dong_no='{$rs[dong_no]}' and weight > 0 order by weight desc limit 0,1 "); $tt_sum+=$rs[chul_su]; $tt_sum2+=$rs[webu_susu]; $arr_plan_no[]=$rs[no]; ?> <tr> <td><?=$rs_farm[farm_name]?></td> <td><?=$rs_dong[dong_name]?></td> <td><?=number_format($rs_dote_weight[weight])?></td> <td><?=($diff->days+1)?></td> <td><?=number_format($rs[chul_su])?></td> <td><?=number_format($rs[webu_susu])?></td> <td><a class="btn btn-danger btn-xs" href="javascript:fn_plan_del('<?=$rs_dong[dong_name]?>','<?=$rs[no]?>')">삭제</a></td> </tr> <?}?> </tbody> <tfoot style="background-color: #F5F5F6;" class="font-bold"> <tr> <td colspan="4" class="text-left">합계</td> <td><?=number_format($tt_sum)?></td> <td><?=number_format($tt_sum2)?></td> <td></td> </tr> </tfoot> </table> </div> </div> </div> <table class="table" style="border-top: hidden;"> <colgroup> <col width="10%"> <col width="10%"> <col width="10%"> <col width="10%"> <col width="10%"> <col width="10%"> <col width="10%"> <col width="10%"> <col width="10%"> <col width="10%"> </colgroup> <tbody> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td colspan="2" class="text-right"> <a href="javascript:fn_ok()" class="btn btn-danger btn-rounded mt-3">출하확정</a> </td> </tr> </tbody> </table> <? $arr_tale_weight=array(); foreach($arr_chul_weight as $ak => $av) { if($ak && $av > 0) { if($ak >= 1000 && $ak < 1100) { $arr_tale_weight[1]=$av; } else if($ak >= 1100 && $ak < 1200) { $arr_tale_weight[2]=$av; } else if($ak >= 1200 && $ak < 1300) { $arr_tale_weight[3]=$av; } else if($ak >= 1300 && $ak < 1400) { $arr_tale_weight[4]=$av; } else if($ak >= 1400 && $ak < 1500) { $arr_tale_weight[5]=$av; } else if($ak >= 1500 && $ak < 1600) { $arr_tale_weight[6]=$av; } else if($ak >= 1600 && $ak < 1700) { $arr_tale_weight[7]=$av; } else if($ak >= 1700 && $ak < 1800) { $arr_tale_weight[8]=$av; } else if($ak >= 1800 && $ak < 1900) { $arr_tale_weight[9]=$av; } } //echo $ak."=>".$av."<br>"; } $arr_tale_weight[10]=array_sum($arr_tale_weight); $str_plan_no=implode(",",$arr_plan_no); ?> </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> <script src="js/jquery.number.js"></script> </body> </html> <script> $('#data_1 .input-group.date').datepicker({ todayBtn: "linked", keyboardNavigation: false, forceParse: false, calendarWeeks: true, autoclose: true, language: "kr" }); $(document).ready(function(){ $('.i-checks').iCheck({ checkboxClass: 'icheckbox_square-green', radioClass: 'iradio_square-green', }); $('#sel_date').datepicker({ keyboardNavigation: false, forceParse: false, autoclose: true, format: 'yyyy-mm-dd', }); <? for($n=1;$n<=10;$n++) { ?>$('#dv_<?=$n?>').html("<?=number_format($arr_tale_weight[$n])?>");<? } ?> for(var n=1;n<=10;n++) { var vv=$('#dd_'+n).attr("ddv_"+n); var vv2=$('#dv_'+n).text(); vv2=vv2.replace(",",""); $('#dt_'+n).text( $.number(parseInt(vv)-parseInt(vv2)) ); } }); function list_view(no){ var status = $("#list_view_ex"+no).css("display"); if(status == "none"){ $("#list_view_ex"+no).css('display',''); }else{ $("#list_view_ex"+no).css('display','none'); } } function fn_mody(dong_no) { $('#myModal'+dong_no).modal('show'); } function fn_mody_ok(dong_no) { var form=$("#frm_modal"+dong_no)[0]; /* if(!form.frm_susu.value) { alert('출하수수를 입력하세요'); return; } */ /* if(!form.frm_seq.value) { alert('출하순서를 입력하세요'); return; } */ if(form.frm_susu.value) { if(form.webu_susu.value) { if(parseInt(form.frm_susu.value) < parseInt(form.webu_susu.value)) { alert('출하수수보다 외부판매가 많을수 없습니다.'); return; } } } var par=$('#frm_modal'+dong_no).serialize(); //alert(par); bootbox.confirm("이대로 수정하시겠습니까?", function(result){ if(result==true) { $('#myModal'+dong_no).modal('hide'); jQuery.ajax({ url: "doge_plan_mody_do.php", type: "POST", data: par, processData: false, contentType: 'application/x-www-form-urlencoded; charset=UTF-8', success: function (res) { //var json = jQuery.parseJSON(res); var json = eval("(" + res + ")"); if(json.rst=='1') { window.location.reload(true); } else if(json.rst=='over') { alert('해당동의 현재수수를 오버할수 없습니다.\n입력가능한 최대수수는'+json.remain+'입니다'); } else if(json.rst=='over2') { alert('해당동의 외부판매 출하수수가 남은 출하수수보다 클수 없습니다.'); } } }); } else { $('#myModal'+dong_no).modal('hide'); } console.log('This was logged in the callback: ' + result); }); } function fn_plan_del(dong_name,no) { if(confirm("<?=$sel_date?> , "+dong_name+" 출하 계획을 삭제하시겠습니까?")) { var par="?no="+no; $.post( "doge_plan_del_do.php"+par, function( res ) { var json=eval("("+res+")"); if(json.rst=='1') { window.location.reload(true); } else { } }); } } function fn_plan_del_left(no) { if(confirm("해당 출하 계획을 삭제하시겠습니까?")) { var par="?no="+no; $.post( "doge_plan_del_do.php"+par, function( res ) { var json=eval("("+res+")"); if(json.rst=='1') { window.location.reload(true); } else { } }); } } function fn_ok() { if(confirm('이대로 계획을 확정하시겠습니까?')) { var par="?str_plan_no=<?=$str_plan_no?>"; $.post( "doge_plan_whakjung_do.php"+par, function( res ) { var json=eval("("+res+")"); if(json.rst=='1') { window.location.reload(true); } else { } }); } } </script>