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/bunyang_plan_do_overok.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)); } $arr_rst=array(); $rs_parts=RS("select * from farm_contract_parts where no='$parts_no' "); $rs_hat_pdate=RS("select * from hatchery_jucha_plan_date where no='$hatchery_jucha_plan_date_no' "); $is_rs=RS("select * from hatchery_plan_log where contract_parts_no='$parts_no' and contract_no='{$rs_parts[contract_no]}' and dong_no='$dong_no' and hatchery_no='{$rs_hat_pdate[hatchery_no]}' and jong_type='{$rs_hat_pdate[jong_type]}' and breedtype='{$rs_hat_pdate[breedtype]}' and gegun_name='{$rs_hat_pdate[gegun_name]}' "); if($is_rs[no]) { $arr_rst['rst']='double'; echo json_encode($arr_rst); exit; } $rs_dong=RS("select * from farm_dong_info where no='$dong_no' "); $rs_cont_dong_out=RS("select sum(susu) as cnt from hatchery_plan_log where contract_parts_no='$parts_no' and dong_no='$dong_no' and jong_type='{$rs_hat_pdate[jong_type]}' and breedtype='{$rs_hat_pdate[breedtype]}' "); if($rs_dong[max_chick_limit] < ($rs_cont_dong_out[cnt]+$susu) ) { /* $arr_rst['rst']='over'; $arr_rst['max']=($rs_dong[max_chick_limit]-$rs_cont_dong_out[cnt]); echo json_encode($arr_rst); exit; */ } $arr_jongtype=array("1"=>"육계","2"=>"삼계","3"=>"오리","4"=>"토종닭"); $vv_breed_type=$arr_jongtype[$rs_hat_pdate[jong_type]]; $result_last_parts=mysql_query("select max(a.no) as ak from farm_contract_parts a, farm_contract b where b.contract_status='1' and b.no=a.contract_no and b.gps_type='{$rs_hat_pdate[breedtype]}' and b.breed_type='$vv_breed_type' and b.contractor_company_no='{$_COOKIE[ucompany_no]}' group by a.contract_no ") or die(); $arr_last_parts=array(); while($rs_last_parts=mysql_fetch_array($result_last_parts)) { $arr_last_parts[]=$rs_last_parts[ak]; } $str_last_parts=implode(",",$arr_last_parts); $rs_hat_pdate=RS("select * from hatchery_jucha_plan_date where no='$hatchery_jucha_plan_date_no' "); if($str_last_parts) { $rs_out=RS("select sum(susu) as cnt from hatchery_plan_log where hatchery_jucha_plan_date_no='$hatchery_jucha_plan_date_no' and contract_parts_no in ( $str_last_parts ) "); } else { $rs_out=RS("select sum(susu) as cnt from hatchery_plan_log where hatchery_jucha_plan_date_no='$hatchery_jucha_plan_date_no' "); } if($rs_hat_pdate[susu] < ($rs_out[cnt]+$susu) ) { $arr_rst['rst']='over_buha'; $arr_rst['max']=($rs_hat_pdate[susu]-$rs_out[cnt]); echo json_encode($arr_rst); exit; } $query="insert into hatchery_plan_log set contract_parts_no='$parts_no', hatchery_jucha_plan_date_no='{$rs_hat_pdate[no]}', hatchery_no='{$rs_hat_pdate[hatchery_no]}', jdate='$jdate', company_no='{$_COOKIE[ucompany_no]}', contract_no='{$rs_parts[contract_no]}', farm_no='{$rs_parts[farm_no]}', dong_no='$dong_no', susu='$susu', jong_type='{$rs_hat_pdate[jong_type]}', breedtype='{$rs_hat_pdate[breedtype]}', gegun_name='{$rs_hat_pdate[gegun_name]}', regdate=now() "; mysql_query($query) or die(mysql_error()); $arr_rst['rst']='1'; $arr_rst['contract_no']=$rs_parts[contract_no]; $arr_rst['dong_no']=$dong_no; echo json_encode($arr_rst); ?>