Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
egg.eemo.co.kr
/
public_html
/
super5
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/egg.eemo.co.kr/public_html/super5/farm_sensor_mody_do.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)); } $rs_is=RS("select * from farm_sensor where no != '$sensor_no' and vcode='$vcode' "); if($rs_is[no]) { $rs_isfarm=RS("select * from farm where no='{$rs_is[farm_no]}' "); //echo "<script>alert('".$vcode." 센서가 ".$rs_isfarm[farm_name]." 농가에 이미 등록되어있습니다.');history.back();</script>"; //exit; $err=$vcode." 센서가 ".$rs_isfarm[farm_name]." 농가에 이미 등록되어있습니다."; $rst['rst']='-1'; $rst['msg']=urlencode($err); echo urldecode(json_encode($rst)); exit; } $rs_is2=RS("select * from farm_sensor where no != '$sensor_no' and farm_no='$no' and dong_no='$dong_no' and pos_no='$pos_no' "); if($rs_is2[no]) { //echo "<script>alert('".$house_no." 동 ".$pos_no." 번 위치에 ".$rs_is2[vcode]." 센서가 이미 사용중입니다.');history.back();</script>"; //exit; $err="같은 동에 동일한 센서위치 정보가 존재합니다. "; $rst['rst']='-2'; $rst['msg']=urlencode($err); echo urldecode(json_encode($rst)); exit; } $rs_dong=RS("select * from farm_dong_info where no='$dong_no' "); mysql_query("update farm_sensor set vcode='$vcode' , dong_no='$dong_no' , dong_code='{$rs_dong[dong_code]}' , pos_no='$pos_no' , sensor_type='$sensor_type', regmem_no='{$_COOKIE[umemno]}' where no='$sensor_no' ") or die(); $rs=RS("select * from farm_sensor where no='$sensor_no' "); //mysql_query("update wifi_device set chk_send='1' where vcode='{$rs[wifi_vcode]}' ") or die(); $rst['rst']='1'; echo json_encode($rst); ?>