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_profile2_dong_add_to.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_farm=RS("select * from farm where no='$farm_no' "); $is_rs=RS("select * from farm_dong_info where farm_no='$farm_no' and dong_name='$dong_name' "); if($is_rs[no]) { $arr_rst['rst']='double'; echo json_encode($arr_rst); exit; } $rs_max=RS("select MAX( RIGHT( dong_code, 2 ) ) as cnt from farm_dong_info where farm_no='$farm_no' "); $dong_code=$rs_farm[farm_code]."_D".sprintf("%02d",($rs_max[cnt]+1)); $query="insert into farm_dong_info set dong_code='$dong_code', farm_no='$farm_no', farm_code='{$rs_farm[farm_code]}', dong_name='$dong_name', regdate=now() "; mysql_query($query) or die(mysql_error()); $rs_cnt=RS("select count(no) as cnt from farm_dong_info where farm_no='$farm_no' "); mysql_query("update farm set house_num='{$rs_cnt[cnt]}' where no='$farm_no' ") or die(); $arr_rst['rst']='1'; $arr_rst['code']=$rs[farm_code]; echo json_encode($arr_rst); ?>