".$mode; echo "
"; echo "arrange-->".$parrange; echo "
"; echo "rcid-->".$prcid; echo "
"; echo "size : ".sizeof($pname); echo "
"; for ($i=0; $i < sizeof($pname); $i++) { echo "seq -->".$prcseq[$i]; echo "name -->".$pname[$i]; echo " ip-->".$pip[$i]; echo " port-->".$pport[$i]; echo " type-->".$ptype[$i]; echo " monitor-->".$pmonitor[$i]; echo "
"; } exit; */ // DB connection $objConn = new DB_Sql; // 기존에 동일한 server명이 존재하면, 추가 금지 조치. for ($i=0; $i < sizeof($pname); $i++) { if ($mode == "mod" && $pname[$i] != $old_pname[$i]) { echo "$pname[$i] | $old_pname[$i]"; $strSQL = " SELECT COUNT(name) FROM t_rms_rc_server_index "; $strSQL .= " WHERE rcid = '$prcid' AND name = '$pname[$i]' AND deleted_yn = 'N'"; $objConn->query( $strSQL ); if( $objConn->nf() != 0 ) { $objConn->next_record(); $cnt = $objConn->f(0); } if( $cnt > 0 ) { $objConn->close(); AlertBack( "$cnt 동일한 서버이름이 존재합니다.\n\n다른 서버이름을 입력하세요." ); exit; } } } /* decision server type */ for ($i=0; $i < sizeof($pname); $i++) { switch($ptype[$i]) { case "RC" : $servType[$i] = "0"; $to_align[$i] = "A"; break; case "STAT" : $servType[$i] = "1"; $to_align[$i] = "B"; break; case "RTS" : $servType[$i] = "2"; $to_align[$i] = "C"; break; case "RCTS" : $servType[$i] = "3"; $to_align[$i] = "D"; break; case "RCDB" : $servType[$i] = "4"; $to_align[$i] = "E"; break; case "CACHE" : $servType[$i] = "5"; $to_align[$i] = "AB"; break; case "TIMED" : $servType[$i] = "9"; $to_aign[$i] = "K"; default : break; } } if ($mode == "mod") { $sql = " START TRANSACTION "; $objConn->query( $sql ); $sql = ""; for ($i=0; $i < sizeof($pname); $i++) { $title = "수정"; $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 ID:" . $prcid ." 서버 이름:" . $pname; $sql = " UPDATE t_rms_rc_server_index SET "; $sql .= " name='$pname[$i]', ip='$pip[$i]', port='$pport[$i]', type='$ptype[$i]', etc1='$to_align[$i]', update_datetime=now() "; $sql .= " , monitor_yn='$pmonitor[$i]' "; $sql .= " WHERE rcid = '$prcid' AND rc_server_seq = '$prcseq[$i]' AND deleted_yn = 'N' "; if ($objConn->query( $sql )) { $sql = " COMMIT "; $objConn->query( $sql ); } else { $sql = " ROLLBACK "; $objConn->query( $sql ); echo "
"; } } } $objConn->close(); echo "
"; ?>