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/set_control_center.php
<?php include_once("dbconn.php"); $pmode = $_REQUEST["pmode"]; //방역설정 if($pmode == "get_pattern_1"){ $query = "select * from control_center_setting "; $result = mysql_query($query); while($rsRow=mysql_fetch_assoc($result)) { $arr[] = $rsRow; } echo json_encode($arr); }else if($pmode == "setting_save"){ //초기화 한번 시켜주고, 업데이트 한다. $query2 = "UPDATE `egg`.`control_center_setting` SET `pattern_type` = '4' , `pattern_type_time` = '5' , `pattern_type_breed` = 'ALL' , `breed_type1` = 'off' , `breed_type2` = 'off' , `breed_type3` = 'off' , `breed_type4` = 'off' , `gps_type` = 'all'; "; mysql_query($query2); $pparam = $_REQUEST["pparam"]; $addSql = ""; if(count($pparam) > 0){ for($i=0; $i<count($pparam); $i++){ $addSql .= "".$pparam[$i]["name"]." = '".$pparam[$i]["value"]."',"; } } //$addSql = substr($addSql, 0, -1); $update_date = date("Y-m-d H:i"); $addSql = $addSql." register_date= '{$update_date}' ; "; $query = "UPDATE `egg`.`control_center_setting` SET ".$addSql."; "; $rs = mysql_query($query); if($rs){ $arr_rst['rs'] = 0; $arr_rst['msg'] = "Success"; }else{ $arr_rst['rs'] = -1; $arr_rst['msg'] = "Sql Error"; } echo json_encode($arr_rst); }else if($pmode == "setting_save_type4"){ $update_date = date("Y-m-d H:i"); $query2 = "UPDATE control_center_setting SET `pattern_type` = '4' , `pattern_type_time` = '5', `register_date`= '{$update_date}' ;"; $rs = mysql_query($query2); if($rs){ $arr_rst['rs'] = 0; $arr_rst['msg'] = "Success"; }else{ $arr_rst['rs'] = -1; $arr_rst['msg'] = "Sql Error"; } echo json_encode($arr_rst); }else{//mode가 없다면 오류로 판단 $arr_rst['rs'] = -1; $arr_rst['msg'] = "Param Error"; echo json_encode($arr_rst); } ?>