query( $strSQL ); if( $objConn->nf() != 0 ) { $objConn->next_record(); $cnt = $objConn->f(0); } if( $cnt > 0 ) { $objConn->close(); AlertBack( "동일한 ID의 POP이 이미 존재합니다.\n\n다른 ID를 입력하세요." ); exit; } $strSQL_1 = " INSERT INTO t_rms_rc_index " . " (arrange, rcid, rc_name, svc_rcts_url, vol_url_rts, rcacct, reg_datetime ) " . " VALUES " . " ('', '$rcid', '$rc_name', '$rcts_addr', '$fhs_addr', '$rc_acct', now() ); "; $CookieSEED = "skldfhoi40wyrf83yf0hs9efh8943yf9herf"; $crypt = new cast128; $crypt->setkey( $CookieSEED ); //$loginid = $crypt->decrypt( base64_decode($_COOKIE["cookie_admin_id"]) ); $loginid = $_COOKIE["cookie_admin_id"] ; $reg_date = date( "Y-m-d H:i:s", time() ); $update_date = date( "Y-m-d H:i:s", time() ); $remoteaddr = getenv('REMOTE_ADDR'); $alert_msg = "[POP추가] POP ID:" . $rcid ." POP 이름:" . $rc_name; $strSQL_4 = " INSERT INTO t_system_event " . " VALUES " . " ( '', $admin_seq, '$remoteaddr', 'EV01', '$alert_msg', 0, '$reg_date', '$update_date', 'N', '$loginid' ); "; //$strSQL = $strSQL_1 . $strSQL_2 . $strSQL_3 . $strSQL_4; $strSQL = $strSQL_1 . $strSQL_4; $res1 = $objConn->query($strSQL_1); $res4 = $objConn->query($strSQL_4); //if( $objConn->query($strSQL) ) if( $res1 && $res4 ) { //$objConn->commitTrans(); // rcacct.conf 파일 업데이트 $fp = fopen($rcAcctPath, "w"); $strSql = "SELECT rcacct FROM t_rms_rc_index WHERE deleted_yn = 'N' "; $res = $objConn->query($strSql); if( $objConn->nf() != 0 ) { while( $objConn->next_record() ) { $rcacct = $objConn->f("rcacct"); if (!is_null($rcacct) && $rcacct != "") { fwrite($fp, $rcacct."\n"); } } } fclose($fp); $objConn->close(); AlertMsg( "$rc_name 팝이 추가되었습니다." ); echo( "" ); } else { $objConn->rollbackTrans(); $objConn->close(); AlertBack( "error: database query failed" ); } ?>