Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
nonga.eemo.co.kr
/
public_html
/
www
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/nonga.eemo.co.kr/public_html/www/farm_iot_list_day_append_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)); } $arr_rst=array(); $arr_rst['data']=array(); $arr_chk=array(); $bl_chk=false; foreach($_POST as $ak => $av) { if($ak=="chk_all") { } else { if(strpos($ak,"chk_")!==false) { $chk_all==0; $bl_chk=true; $exp_chk=explode("_",$ak); $arr_chk[]="sensor_no=".$exp_chk[1]; } } } if($bl_chk==false) { $chk_all="a1"; } else { $str_sensor="( ".implode(" or ",$arr_chk)." )"; } if(!is_numeric($last_id)) { $query="select * from iot_date where 1 and dong_no='$sel_dong_no' "; } else { $query="select * from iot_date where no < '$last_id' and dong_no='$sel_dong_no' "; } if($search) { $sub_query.=" and jdate = '$search' "; } if($str_sensor) { $sub_query.=" and $str_sensor "; } if($sel_alarm=="on") { $sub_query.=" and is_alarm='1' "; } if($sub_query) {$query.=$sub_query;} $query.=" order by no desc limit 0, 10 "; $result=mysql_query($query) or die(); while($rs=mysql_fetch_array($result)) { $rs_sens=RS("select * from farm_sensor where no='{$rs[sensor_no]}' "); $obj=(object) $c; $obj->jdate=$rs[jdate]; $obj->v1=sprintf("%.1f",$rs[temp]); $obj->v2=sprintf("%.1f",$rs[himi]); $obj->v3=sprintf("%.1f",$rs[anal]); $obj->v4=number_format($rs[bat]); $obj->pos_no=urlencode($rs_sens[pos_no]); $obj->alarm=urlencode($rs[is_alarm]); $obj->no=$rs[no]; array_push($arr_rst['data'],$obj); } echo urldecode(json_encode($arr_rst)); ?>