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/myfarm_wifi_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) { if($key == 'vcode' || $key == 'vname') { } else { ${$key}=mysql_real_escape_string(trim($value)); } } $arr_tmp=array(); foreach ($_REQUEST['vcode'] as $value) { if(trim($value)) { $vv=trim($value); $arr_tmp[]=$vv; $rs_is=RS("select * from wifi_device where farm_no != '$no' and vcode='$vv' "); if($rs_is[no]) { $rs_isfarm=RS("select * from farm where no='{$rs_is[farm_no]}' "); echo "<script>alert('".$vv." WIFI 모듈 ID 가 ".$rs_isfarm[farm_name]." 에서 이미 사용중입니다.');history.back();</script>"; exit; } } } $arr_tmp2=array_count_values($arr_tmp); foreach($arr_tmp2 as $ak => $av) { if($av > 1) { echo "<script>alert('".$ak." WIFI 모듈 ID 가 중복됩니다.');history.back();</script>"; exit; } } $rs_farm=RS("select * from farm where no='$no' "); mysql_query("delete from wifi_device where farm_no='$no' ") or die(); foreach ($_REQUEST['vcode'] as $kk => $value) { if(trim($value)) { $vv=trim($value); $vv2=trim($_REQUEST['vname'][$kk]); $wifi_code=$vv; mysql_query("insert into wifi_device set wifi_code='$wifi_code', farm_no='$no' , farm_code='{$rs_farm[farm_code]}', vcode='$vv' , vname='$vv2', regmem_no='{$_COOKIE[umemno]}', regdate=now() ") or die(); } } echo "<meta http-equiv='refresh' content='0;url=myfarm.php?no={$no}'>"; ?>