".$mode; echo "
"; echo "arrange-->".$parrange; echo "
"; for ($i=0; $i < sizeof($pname); $i++) { echo "name -->".$pname[$i]; echo "domain -->".$pdomain[$i]; echo " ip-->".$pip[$i]; echo " port-->".$pport[$i]; echo " type-->".$ptype[$i]; echo " monitor-->".$pmonitor[$i]; echo "
"; } */ // 성공 플래그 $success_flag = 0; $objConn = new DB_Sql; // 기존에 동일한 server명이 존재하면, 추가 금지 조치. for ($i=0; $i < sizeof($pname); $i++) { if ($mode == "add") { $strSQL = " SELECT COUNT(name) FROM t_neo_server_index "; $strSQL .= " WHERE neo_type = '$ptype[$i]' 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( "동일한 서버이름이 존재합니다.\n\n다른 서버이름을 입력하세요." ); exit; } } else if ($mode == "mod") { $strSQL = " SELECT COUNT(name) FROM t_neo_server_index "; $strSQL .= " WHERE neo_type = '$ptype[$i]' AND name = '$pname[$i]' "; $strSQL .= " AND neo_seq != $neo_seq AND deleted_yn = 'N'"; $objConn->query( $strSQL ); if( $objConn->nf() != 0 ) { $objConn->next_record(); $cnt = $objConn->f(0); } if( $cnt > 0 ) { $objConn->close(); AlertBack( "동일한 서버이름이 존재합니다.\n\n다른 서버이름을 입력하세요." ); exit; } } } /* decision server type */ for ($i=0; $i < sizeof($pname); $i++) { switch($ptype[$i]) { case "ICS10" : $servType[$i] = "0"; $to_align[$i] = "A"; break; case "ICS15" : $servType[$i] = "1"; $to_align[$i] = "B"; break; case "ICS20" : $servType[$i] = "2"; $to_align[$i] = "C"; break; case "SL" : $servType[$i] = "3"; $to_align[$i] = "D"; break; default : break; } } $sql = " START TRANSACTION "; $objConn->query( $sql ); $sql = ""; for ($i=0; $i < sizeof($pname); $i++) { if ($mode == "add") { $title = "등록"; $update_date = date( "Y-m-d H:i:s", time() ); $alert_msg = "[서버등록] NEO_TYPE:" . $ptype[$i] ." 서버 이름:" . $pname[$i]; $servicetype = "INSERT"; $sql = " INSERT INTO t_neo_server_index "; $sql .= " (neo_seq, neo_type, name, ip, domain, dig_domain, port, monitor_yn, to_align, update_datetime) "; $sql .= " VALUES ('', '$ptype[$i]', '$pname[$i]', '$pip[$i]', '$pdomain[$i]', '$pdigdomain[$i]', '$pport[$i]', '$pmonitor[$i]', '$to_align[$i]', now()) "; $res_sql[$i] = $objConn->query( $sql ); } else if ($mode == "mod") { $title = "수정"; $servicetype = "UPDATE"; $sql = "UPDATE t_neo_server_index "; $sql .= "SET neo_type = '$ptype[$i]', name = '$pname[$i]', ip = '$pip[$i]', dig_domain = '$pdigdomain[$i]', "; $sql .= "domain = '$pdomain[$i]', port = '$pport[$i]', monitor_yn = '$pmonitor[$i]', update_datetime = now() "; $sql .= "WHERE neo_seq = $neo_seq"; $res_sql[$i] = $objConn->query( $sql ); } } for ($i=0; $i < sizeof($res_sql); $i++) { if ($res_sql[$i]) $succ = 1; else $succ = 0; } if ($succ == 1) { $sql = " COMMIT "; $objConn->query( $sql ); $success_flag = 1; } else { $sql = " ROLLBACK "; $objConn->query( $sql ); $success_flag = 0; } $objConn->close(); // mod 가 실패할 경우.. if ($success_flag == 0) { echo "
"; } switch($ptype) { case "ICS10" : $ptype = "ICS10"; break; case "ICS15" : $ptype = "ICS15"; break; case "ICS20" : $ptype = "ICS20"; break; case "SL" : $ptype = "SL"; break; default : break; } ?>

서버 완료

서버명 | 도메인 | IP | port | 서버타입 | 서버감시