base
This commit is contained in:
@@ -0,0 +1,581 @@
|
||||
<?
|
||||
$explain['222.122.19.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
|
||||
$explain['222.122.69.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
|
||||
$explain['222.122.69.17']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
|
||||
$explain['222.122.69.148']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
|
||||
$explain['222.122.181.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
|
||||
$explain['125.141.215.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
|
||||
$explain['121.254.146.5']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
|
||||
$explain['125.141.243.7']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
|
||||
$explain['121.189.28.5']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
|
||||
$explain['121.189.28.10']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
|
||||
$explain['121.189.28.140']['40004'] = '[스트리밍]FHS error event를 GTS로 전달';
|
||||
$explain['175.117.147.8']['30000'] = '기동중인 서버의 Active/Standby 상태값을 결정함.';
|
||||
|
||||
$serviceType = isset($_GET['service_type']) ? $_GET['service_type'] : $_POST['service_type'];
|
||||
if($serviceType == "") $serviceType = 3;
|
||||
//serviceType : the order described in conf file. --_-;
|
||||
|
||||
$width = isset($_GET['width']) ? $_GET['width'] : $_POST['width'];
|
||||
if ( $width == "" ) $width=800;
|
||||
|
||||
header("Content-type: text/html; charset=euc-kr");
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>######## SYSTEM-HOSTING SERVICE STATUS ######## </title>
|
||||
<STYLE type=text/css>
|
||||
TD { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; }
|
||||
TR { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; }
|
||||
TABLE { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; line-height : 120%}
|
||||
INPUT { FONT-SIZE: 9pt; COLOR: #000000; FONT-FAMILY: 'ARIAL,굴림체'; TEXT-DECORATION: none; line-height : 120%}
|
||||
</STYLE>
|
||||
<meta http-equiv="Cache-Control" content="no-cache"/>
|
||||
<meta http-equiv="Expires" content="0"/>
|
||||
<meta http-equiv="Pragma" content="no-cache"/>
|
||||
<link rel="stylesheet" href="clockstyle.css" type="text/css">
|
||||
<style type="text/css">
|
||||
#tooltip {position:absolute;
|
||||
top:5;
|
||||
left:5;
|
||||
border:solid 3 ffccff;
|
||||
background:ffffcc;
|
||||
color:660066;
|
||||
font-size:9pt;
|
||||
width:580;
|
||||
height:20;
|
||||
padding:2;
|
||||
overflow:hidden;
|
||||
z-index:10;
|
||||
display:none;
|
||||
}
|
||||
</style>
|
||||
<? require "layer.js";?>
|
||||
<!-- <script language="javascript1.2" type="text/javascript" src="clock.js" ></script> -->
|
||||
</head>
|
||||
|
||||
<!-- <body onLoad="UpdateClocks()"> -->
|
||||
<body>
|
||||
<form name="frm" action=<?=$_SERVER['PHP_SELF']?> method=POST>
|
||||
<input type="hidden" name="service_type" value="<?= $serviceType ?>">
|
||||
<!--
|
||||
<table border="0" cellspacing="0" width="100%">
|
||||
<tr bgcolor=#003366 class="ratNavText">
|
||||
<td ID="Clock0" width="25%" > </td>
|
||||
<td ID="Clock1" width="25%" > </td>
|
||||
<td ID="Clock2" width="25%" > </td>
|
||||
<td ID="Clock3" width="25%" > </td>
|
||||
</tr>
|
||||
<tr bgcolor=#003366 class="ratNavText">
|
||||
<td ID="Clock4" width="25%" > </td>
|
||||
<td ID="Clock5" width="25%" > </td>
|
||||
<td ID="Clock6" width="25%" > </td>
|
||||
<td ID="Clock7" width="25%" > </td>
|
||||
</tr>
|
||||
</table>
|
||||
//-->
|
||||
<br>
|
||||
<table border="0" cellspacing="1" width="530" align="center">
|
||||
<tr align="center" valign="center">
|
||||
<td> <h3>######## 제어 서버 모니터링 ########</h3></td>
|
||||
<td>
|
||||
<!--
|
||||
<img src="images/bu14.gif" width=11 height=11>norm
|
||||
<img src="images/bu77.gif" width=11 height=11>nomon
|
||||
<img src="images/bu15.gif" width=11 height=11>fail
|
||||
//-->
|
||||
<button onclick=marqueeObj.start()>START</button>
|
||||
<button onclick=marqueeObj.stop()>STOP</button>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="tooltip" name="tooltip" width=530></div>
|
||||
<?
|
||||
/* <marquee id="tooltip" name="tooltip"></marquee>*/
|
||||
$server_addr[0][0] = "127.0.0.1";
|
||||
$server_addr[0][1] = "30002";
|
||||
$server_addr[0][2] = "KT-IDC";
|
||||
|
||||
$tot = count($server_addr);
|
||||
for($i=0; $i < $tot; $i++){
|
||||
|
||||
if($i%3 == 0) echo "<table align=\"center\"><tr>";
|
||||
|
||||
$fp = @fsockopen("udp://{$server_addr[$i][0]}", $server_addr[$i][1], $errno, $errstr);
|
||||
if (!$fp) {
|
||||
echo "ERROR: $errno - $errstr<br>\n";
|
||||
continue;
|
||||
} else {
|
||||
fwrite($fp,"GET_SERVSTATUS", 15);
|
||||
while(1) {
|
||||
$test2 = fread($fp, 2048);
|
||||
$test .= trim($test2);
|
||||
$j = strlen($test2);
|
||||
if($j < 1024) break;
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
//echo "\n<!-- TEST:\n$test\n-->\n";
|
||||
?>
|
||||
<td valign=top>
|
||||
<?
|
||||
$pt = new parsePipe();
|
||||
$test = $pt->nullTrim($test);
|
||||
$tmpArr = $pt->textArr($test);
|
||||
$serviceName = $pt->serviceName($test);
|
||||
$result = $pt->parseIt($tmpArr[$serviceType]);
|
||||
$tot_tr = $pt->countIt();
|
||||
|
||||
?>
|
||||
<!-- <marquee direction=up infinite behavior="scroll" width="800" height="650"> //-->
|
||||
<marquee id="marqueeObj" behavior="alternate" scrolldelay=200 width=<?=$width?> height=650>
|
||||
<table border=0>
|
||||
<tr>
|
||||
<td>
|
||||
<table border=0 width=100%>
|
||||
<tr>
|
||||
<td>
|
||||
<table border=0 cellspacing=0 width=100%>
|
||||
<tr>
|
||||
<td bgcolor='618FFC' align='center'>0%</td>
|
||||
<td bgcolor='ADC900' align='center'>10%</td>
|
||||
<td bgcolor='FEBC00' align='center'>20%</td>
|
||||
<td bgcolor='F2685E' align='center'>30%</td>
|
||||
<td bgcolor='618FFC' align='center'>40%</td>
|
||||
<td bgcolor='ADC900' align='center'>50%</td>
|
||||
<td bgcolor='FEBC00' align='center'>60%</td>
|
||||
<td bgcolor='F2685E' align='center'>70%</td>
|
||||
<td bgcolor='618FFC' align='center'>80%</td>
|
||||
<td bgcolor='ADC900' align='center'>90%</td>
|
||||
<td bgcolor='FEBC00' align='center'>100%</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table border=0 blcolor=yellow>
|
||||
<tr>
|
||||
<td>
|
||||
<table border=0>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?
|
||||
|
||||
for($j=0; $j<$tot_tr; $j++){
|
||||
|
||||
if (strrpos($pt->tailer($result[$j][2]), "^") == false)
|
||||
$servName = $pt->tailer($result[$j][2]);
|
||||
else
|
||||
$servName = substr($pt->tailer($result[$j][2]), 0, strrpos($pt->tailer($result[$j][2]), "^"));
|
||||
|
||||
|
||||
|
||||
$partrc=explode("-", $servName);
|
||||
$rcname="$partrc[0]$partrc[1]";
|
||||
#echo "rcname = $rcname | rcname1 = $rcname1";
|
||||
if ( $rcname != $rcname1 ) { ## 절반 나누어서 옆테이블로 구성
|
||||
echo "</table>";
|
||||
echo "</td>";
|
||||
echo "<td valign=top>";
|
||||
echo "<table border=0 cellpadding=3 cellspacing=1 bgcolor='b2b2b2'>";
|
||||
echo "<tr>";
|
||||
echo "<td bgcolor='efefef'><center><b><font color='#000066'>Name</font></b></center></td>";
|
||||
echo "<td bgcolor='efefef'><center><b><font color='#000066'>Server IP</font></b></center></td>";
|
||||
echo "<td bgcolor='efefef'><center><b><font color='#000066'>Port</font></b></center></td>";
|
||||
#echo "<td bgcolor='efefef'><center><b><font color='#000066'>Etc</font></b></center</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
$rcname1=$rcname;
|
||||
?>
|
||||
|
||||
<!-- <span onmouseover="showtip('<?=$alt_str?>');" onmouseout="hidetip();"> //-->
|
||||
<tr>
|
||||
<?
|
||||
switch($result[$j][0])
|
||||
{
|
||||
case 2 :
|
||||
$bgcolor = 'red';
|
||||
/*
|
||||
$font_servName = "<font color='red'><b>".$servName."</b></font>";
|
||||
$font_servIp = "<font color='red'><b>".$result[$j][3]."</b></font>";
|
||||
$font_servPort = "<font color='red'><b>".$pt->translateIt($result[$j][4],4)."</b></font>";
|
||||
*/
|
||||
break;
|
||||
case 1 :
|
||||
$bgcolor = 'white';
|
||||
/*
|
||||
$font_servName = $servName;
|
||||
$font_servIp = $result[$j][3];
|
||||
$font_servPort = $pt->translateIt($result[$j][4],4);
|
||||
*/
|
||||
break;
|
||||
default :
|
||||
$bgcolor = 'white';
|
||||
/*
|
||||
$font_servName = $servName;
|
||||
$font_servIp = $result[$j][3];
|
||||
$font_servPort = $pt->translateIt($result[$j][4],4);
|
||||
*/
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<td bgcolor=<?=$bgcolor?> nowrap><?=$pt->translateIt($result[$j][0],1)?> <?=$servName?></td>
|
||||
<td bgcolor=<?=$bgcolor?> align="center"><?=$result[$j][3]?></td>
|
||||
<td bgcolor=<?=$bgcolor?> align="center"><?=$pt->translateIt($result[$j][4],4)?></td>
|
||||
<!-- Etc
|
||||
<td bgcolor=<?=$bgcolor?>><?=$explain[$result[$j][3]][$pt->translateIt($result[$j][4],4)]?></td>
|
||||
//-->
|
||||
</tr>
|
||||
<!-- </span> //-->
|
||||
|
||||
<?
|
||||
}
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
</marquee>
|
||||
</td>
|
||||
<?
|
||||
if($i%3 == 2) echo "</table></tr>"; //
|
||||
}
|
||||
?>
|
||||
<table>
|
||||
</table>
|
||||
|
||||
<?
|
||||
|
||||
////////////////////
|
||||
//Print REFRESHER
|
||||
////////////////////
|
||||
|
||||
extract($_POST);
|
||||
|
||||
$refresh_rate = $_REQUEST['refresh_rate'];
|
||||
$width = $_REQUEST['width'];
|
||||
|
||||
if($refresh_rate<1 || $refresh_rate>1000)
|
||||
$refresh_rate = 60;
|
||||
|
||||
if ( $width == '')
|
||||
$width = 800;
|
||||
|
||||
?>
|
||||
<br>
|
||||
<table align="center">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
Refresh Rate(1~1000) :
|
||||
<input type=text name=refresh_rate width=100 value=<?=$refresh_rate?>>
|
||||
Roll Size(default:800) :
|
||||
<input type=text name=width value=<?=$width?>>
|
||||
<input type=submit value=SET>
|
||||
<input type="hidden" name="chk" value="0">
|
||||
</form>
|
||||
</td>
|
||||
<td align=right>
|
||||
<form action=<?=$_SERVER['PHP_SELF']?> method=POST>
|
||||
<input type="hidden" name="service_type" value="<?= $serviceType?>">
|
||||
<input type=hidden name=refresh_rate value=60>
|
||||
<input type=hidden name=width value=800>
|
||||
<input type=submit value='RESET(60sec, 800px)'>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script language="javascript" type="text/javascript" src="tooltip.js" ></script>
|
||||
<script language=javascript>
|
||||
function showtip(text) {
|
||||
tooltip.innerText=text;
|
||||
tooltip.style.display="inline";
|
||||
}
|
||||
function hidetip() {
|
||||
tooltip.style.display="none";
|
||||
}
|
||||
function movetip() {
|
||||
tooltip.style.pixelTop=event.y+document.body.scrollTop;
|
||||
tooltip.style.pixelLeft=event.x+document.body.scrollLeft + 10;
|
||||
}
|
||||
document.onmousemove=movetip;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<META http-equiv="refresh" content="<?=$refresh_rate?>; url=<?=$PHP_SELF?>?refresh_rate=<?=$refresh_rate?>&service_type=<?=$serviceType?>&width=<?=$width?>">
|
||||
<?
|
||||
########
|
||||
#CLASSES
|
||||
########
|
||||
class parsePipe {
|
||||
var $tot_line;
|
||||
|
||||
function parseIt($givenText){
|
||||
$cnt = 0;
|
||||
$minValue = 0;
|
||||
$maxValue = 0;
|
||||
$minLevel = 1000;
|
||||
$tmp_arr = array();
|
||||
$temp_arr = explode("\r\n", $givenText);
|
||||
$result_arr[$i][9] = "";
|
||||
$this->tot_line = count($temp_arr) == 1 ? 0 : count($temp_arr) - 1;
|
||||
for($i=0; $i < $this->tot_line; $i++){
|
||||
if($temp_arr[$i]!='') {
|
||||
$result_arr[$i] = explode("|", $temp_arr[$i]);
|
||||
$result_arr[$i][20] = "";
|
||||
$tmp_arr[$i] = ($result_arr[$i][9] == '' || $result_arr[$i][9] == '-') ? 0 : $this->nullTrim($result_arr[$i][9]);
|
||||
$result_arr[$i][8] = $this->nullTrim($result_arr[$i][8]);
|
||||
$result_arr[$i][9] = $this->nullTrim($result_arr[$i][9]);
|
||||
$result_arr[$i][10] = $this->nullTrim($result_arr[$i][10]);
|
||||
|
||||
/*
|
||||
if($result_arr[$i][9] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0) {
|
||||
if($cnt == 0) {
|
||||
$minValue = $result_arr[$i][9];
|
||||
$cnt++;
|
||||
}
|
||||
if($minValue > $result_arr[$i][9]) {
|
||||
$minValue = $result_arr[$i][9];
|
||||
}
|
||||
}
|
||||
*/
|
||||
if ($result_arr[$i][11] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0) {
|
||||
if ($minLevel > $result_arr[$i][11]) {
|
||||
$minLevel = $result_arr[$i][11];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $tot_tr; $i++) {
|
||||
if ($result_arr[$i][11] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0 && $result_arr[$i][11] <= $minLevel) {
|
||||
if($result_arr[$i][9] != '-' && $result_arr[$i] != '' && $result_arr[$i] != 0) {
|
||||
if($cnt == 0) {
|
||||
$minValue = $result_arr[$i][9];
|
||||
$cnt++;
|
||||
}
|
||||
if($minValue > $result_arr[$i][9]) {
|
||||
$minValue = $result_arr[$i][9];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//echo "minLevel $minLevel minValue $minValue<br>";
|
||||
$cnt = 0;
|
||||
arsort($tmp_arr);
|
||||
reset($tmp_arr);
|
||||
|
||||
while (list ($key, $val) = each ($tmp_arr)) {
|
||||
//echo "$key = $val<br>";
|
||||
if($val != 0) {
|
||||
if($cnt == 0) {
|
||||
if ($minLevel < $result_arr[$key][11] ||
|
||||
$result_arr[$key][10] > 0) {
|
||||
$result_arr[$key][20] = "yellow";//$maxValue;
|
||||
} else {
|
||||
//echo "11 ".$result_arr[$key][11]." 10 ".$result_arr[$key][10]."<br>";
|
||||
$maxValue = $val;
|
||||
$result_arr[$key][20] = "99FFFF";
|
||||
$cnt++;
|
||||
}
|
||||
} else {
|
||||
//if($minValue == $val) {
|
||||
if($val < (2 * 1024 * 1024 * 1024 * 10)) {
|
||||
$result_arr[$key][20] = "red";
|
||||
} else if(($maxValue - $val) < (1024 * 1024 * 1024) &&
|
||||
$minLevel == $result_arr[$key][11]) {
|
||||
//echo "1GB Highed<br>";
|
||||
//echo "minLevel $minLevel maxValue $maxValue<br>";
|
||||
$result_arr[$key][20] = "99FFFF";
|
||||
} else {
|
||||
//echo "1GB Lowed<br>";
|
||||
$result_arr[$key][20] = "yellow";//$maxValue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result_arr[$key][20] = "white";
|
||||
}
|
||||
}
|
||||
return $result_arr;
|
||||
}
|
||||
|
||||
function countIt(){
|
||||
return $this->tot_line;
|
||||
}
|
||||
|
||||
function translateIt($parsedText, $type){
|
||||
if($parsedText == '') return;
|
||||
|
||||
$eServerType = array('WWW', 'RTS', 'RC', 'CCDB', 'RCTS', 'GTS', "RCDB");
|
||||
|
||||
$eStatus = array('<img src=images/bu16_1.gif width=11 height=11>',
|
||||
'<img src=images/bu14.gif width=11 height=11>',
|
||||
'<img src=images/bu15.gif width=11 height=11>',
|
||||
'<img src=images/bu77.gif width=11 height=11>');
|
||||
$eStatusUP = array('<img src=images/bu14.gif width=11 height=11>',
|
||||
'<img src=images/bu16_1.gif width=11 height=11>',
|
||||
'<img src=images/bu15.gif width=11 height=11>');
|
||||
$eStatusChar = array('UNKNOWN', 'ALIVE', 'DEAD', 'NO MONITORING');
|
||||
switch($type){
|
||||
case 0:
|
||||
return $eServerType[$parsedText];
|
||||
return '';
|
||||
case 1:
|
||||
return $eStatus[$parsedText];
|
||||
case 2:
|
||||
return $eStatusChar[$parsedText];
|
||||
case 3:
|
||||
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
|
||||
else {
|
||||
if (trim($parsedText) / 1024 / 1024 > 1024) {
|
||||
return sprintf("<b>%.2fGB</b>",
|
||||
trim($parsedText) / 1024 / 1024 / 1024 );
|
||||
} else {
|
||||
if (trim($parsedText) / 1024 > 1024) {
|
||||
if (trim($parsedText) / 1024 / 1024 > 10) {
|
||||
return sprintf("<font color=\"blue\"><b>%.2fMB</b></font>",
|
||||
trim($parsedText) / 1024 / 1024 );
|
||||
} else {
|
||||
return sprintf("<b>%.2fMB</b>",
|
||||
trim($parsedText) / 1024 / 1024 );
|
||||
}
|
||||
} else {
|
||||
if (trim($parsedText) > 1024) {
|
||||
return sprintf("%.2fKB",
|
||||
trim($parsedText) / 1024 );
|
||||
} else {
|
||||
return sprintf("%dB",
|
||||
trim($parsedText));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case 8:
|
||||
if(trim($parsedText) == "-" || $parsedText == "") return "-";
|
||||
else return sprintf("%.2lfG", (trim($parsedText) / 1024) / 1024 / 1024);
|
||||
case 9:
|
||||
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
|
||||
else {
|
||||
if (trim($parsedText) / 1024 / 1024 / 1024 > 1024) {
|
||||
return sprintf("%.2fT", trim($parsedText) / 1024 / 1024 / 1024 / 1024);
|
||||
} else
|
||||
return sprintf("%.2fG", trim($parsedText) / 1024 / 1024 / 1024);
|
||||
}
|
||||
case 10:
|
||||
return $eStatusUP[$parsedText];
|
||||
case 30:
|
||||
if(trim($parsedText) == "-" || $parsedText == "" ) return "-";
|
||||
else {
|
||||
if (trim($parsedText) / 1024 / 1024 > 1024) {
|
||||
return sprintf("%.2fG",
|
||||
trim($parsedText) / 1024 / 1024 / 1024 );
|
||||
} else {
|
||||
if (trim($parsedText) / 1024 > 1024) {
|
||||
return sprintf("%.2fM",
|
||||
trim($parsedText) / 1024 / 1024 );
|
||||
} else {
|
||||
if (trim($parsedText) > 1024) {
|
||||
return sprintf("%.2fK",
|
||||
trim($parsedText) / 1024 );
|
||||
} else {
|
||||
return sprintf("%d",
|
||||
trim($parsedText));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
return $parsedText;
|
||||
}
|
||||
}
|
||||
|
||||
function nullTrim($tmp_str)
|
||||
{
|
||||
$return_str = "";
|
||||
$maxLength = strlen($tmp_str);
|
||||
|
||||
for($i=0 ; $i < $maxLength ; $i++) {
|
||||
if(ord(substr($tmp_str, $i, 1)) != 0 || $tmp_str != " ") {
|
||||
$return_str .= substr($tmp_str, $i, 1);
|
||||
}
|
||||
}
|
||||
return $return_str;
|
||||
}
|
||||
|
||||
function textArr($text)
|
||||
{
|
||||
$cnt = -1;
|
||||
$tmp_cnt = 0;
|
||||
$str_arr = array();
|
||||
$tmp_search_str = "";
|
||||
$temp_arr = explode("\r\n", $text);
|
||||
|
||||
for($i=0; $i<sizeof($temp_arr); $i++) {
|
||||
$split_str = explode("|", $temp_arr[$i]);
|
||||
$search_str = explode("_", $split_str[2]);
|
||||
if($tmp_search_str != $search_str[0]) {
|
||||
$tmp_search_str = $search_str[0];
|
||||
//$str_arr[$cnt][30] = $search_str[0];
|
||||
//echo $str_arr[$cnt][0]."<br>".$tmp_search_str."->".$cnt."<-"."<br>";
|
||||
$cnt++;
|
||||
}
|
||||
$str_arr[$cnt] .= $temp_arr[$i]."\r\n";
|
||||
|
||||
}
|
||||
return $str_arr;
|
||||
}
|
||||
|
||||
function serviceName($text)
|
||||
{
|
||||
$cnt = -1;
|
||||
$tmp_cnt = 0;
|
||||
$str_arr = array();
|
||||
$tmp_search_str = "";
|
||||
$temp_arr = explode("\r\n", $text);
|
||||
|
||||
for($i=0; $i<sizeof($temp_arr); $i++) {
|
||||
$split_str = explode("|", $temp_arr[$i]);
|
||||
$search_str = explode("_", $split_str[2]);
|
||||
//echo $split_str[0]."<br>";
|
||||
if($tmp_search_str != $search_str[0]) {
|
||||
$tmp_search_str = $search_str[0];
|
||||
$cnt++;
|
||||
}
|
||||
$str_arr[$cnt][0] = $tmp_search_str;
|
||||
if($split_str[0] == 2) {
|
||||
$str_arr[$cnt][1] = "dead";
|
||||
}
|
||||
// $str_arr[4][1] = "dead";
|
||||
// $str_arr[1][1] = "dead";
|
||||
}
|
||||
return $str_arr;
|
||||
}
|
||||
|
||||
function tailer($name)
|
||||
{
|
||||
$temp_arr = explode("_", $name);
|
||||
$temp_arr2 = substr($name, strlen($temp_arr[0]) + 1, strlen($name));
|
||||
return $temp_arr2;
|
||||
}
|
||||
|
||||
function noYear($date)
|
||||
{
|
||||
$date = substr($date, 5, 14);
|
||||
|
||||
return $date;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user