<?
//--畫面設定排序時使用
if ($SortType == "")  $SortType ="DESC";
//--預設排序方式,由小到大排
$sortDate         = "ASC";
$sortIP			  = "ASC";
$sortName		  = "ASC";
$sortUser		  = "ASC";
$sortDir		  = "ASC";
$sortSite		  = "ASC";
$sortSize         = "ASC";
$sortFrom		  = "ASC";
$sortTO			  = "ASC";
$sortCC			  = "ASC";
$sortBCC		  = "ASC";
$sortTag		  = "ASC";
$sortHost		  = "ASC";
$sortTime		  = "ASC";
$sorRemark        = "ASC";
$sortGroup		  = "ASC";
$sortWhom         = "ASC";
$sortOwner        = "ASC";
$sortServer		  = "ASC";
$sortStatus		  = "ASC";
$sortInform		  = "ASC";
$sortMode		  = "ASC";
$sortForward	  = "ASC";
$sortAccount	  = "ASC";
$sortISP  			  = "ASC";
$sortTools		  = "ASC";	
$sortFile			 ="ASC";
//--IDS
$sortSmac="ASC";
$sortDmac="ASC";
$sortSip="ASC";
$sortDip="ASC";
$sortSport="ASC";
$sortDport="ASC";
$sortType="ASC";
$sortStart="ASC";
$sortStop="ASC";
$sortSite="ASC";
//--預設排序的圖形
$imgDate          = "";
$imgIP			  = "";
$imgName		  = "";
$imgUser		  = "";
$imgDir			  = "";
$imgSite		  = "";
$imgSize          = "";
$imgFrom		  = "";
$imgTO			  = "";
$imgCC			  = "";
$imgBCC			  = "";
$imgTag			  = "";
$imgHost		  = "";
$imgTime		  = "";
$imgRemark		  = "";
$imgGroup		  = "";
$imgWhom          = "";
$imgOwner         = "";
$imgServer        = "";
$imgStatus        = "";
$imgInform        = "";
$imgMode          = "";
$imgForward       = "";
$imgAccount       = "";
$imgISP           = "";
$imgTools      ="";
$imgFile		="";
//--設定變數 這次排序的圖形,下次排序方式
$imgAsc = "<img src=\"../".$DIR_IMAGE.$PIC_SORT."\" border=0 alt=\"".$LA_SORT."\">";
$imgDesc= "<img src=\"../".$DIR_IMAGE.$PIC_RSORT."\" border=0 alt=\"".$LA_RSORT."\">";
	
//--排序設定
if ($SortType== "ASC"){
	$nextSortType = "DESC";
	$nowimg       = $imgDesc;
}
else{
	$nextSortType = "ASC";
	$nowimg       = $imgAsc;
}//End : if (-排序設定)

//--設定這次排序的圖形, 及下次排序方式
switch ($SortField){
	Case "exist_time":
	Case "login_time":
	Case "_DB_DATETIME":
	Case "_TIMESTAMP":  
		$sortDate  = $nextSortType;
		$imgDate   = $nowimg;
		$colDate   = "class=\"Tr_Ts\"";
		break;
	Case "_ACCOUNT":  
		$sortAccount  = $nextSortType;
		$imgAccount      = $nowimg;
		$colAccount      = "class=\"Tr_Ts\"";
		break;
	Case "_FORWARD":  
		$sortForward  = $nextSortType;
		$imgForward   = $nowimg;
		$colForward   = "class=\"Tr_Ts\"";
		break;
	Case "_INFORM":  
		$sortInform  = $nextSortType;
		$imgInform   = $nowimg;
		$colInform   = "class=\"Tr_Ts\"";
		break;
	Case "_MODE":  
		$sortMode  = $nextSortType;
		$imgMode   = $nowimg;
		$colMode   = "class=\"Tr_Ts\"";
		break;
	Case "_DATETIME":  
		$sortDate  = $nextSortType;
		$imgDate   = $nowimg;
		$colDate   = "class=\"Tr_Ts\"";
		break;
	Case "_DATE":
		$sortDate  = $nextSortType;
		$imgDate   = $nowimg;
		$colDate   = "class=\"Tr_Ts\"";
		break;
	Case "_OWNER":
		$sortOwner  = $nextSortType;
		$imgOwner   = $nowimg;
		$colOwner   = "class=\"Tr_Ts\"";
		break;
	Case "_WHOM":
		$sortWhom  = $nextSortType;
		$imgWhom   = $nowimg;
		$colWhom   = "class=\"Tr_Ts\"";
		break;
	Case "ip":
	Case "login_ip":
	Case "_IP":
		$sortIP  = $nextSortType;
		$imgIP   = $nowimg;
		$colIP   = "class=\"Tr_Ts\"";
		break;
	Case "_NAME":
		$sortName = $nextSortType;
		$imgName  = $nowimg;
		$colName  = "class=\"Tr_Ts\"";
		break;
	Case "username":
	Case "loginid":
	Case "_USER":
		$sortUser = $nextSortType;
		$imgUser  = $nowimg;
		$colUser  = "class=\"Tr_Ts\"";
		break;
	Case "_DIR":
		$sortDir  = $nextSortType;
		$imgDir   = $nowimg;
		$colDIR   = "class=\"Tr_Ts\"";
		break;
	Case "_SITE":
		$sortSite = $nextSortType;
		$imgSite  = $nowimg;
		$colSite  = "class=\"Tr_Ts\"";
		break;
	Case "_SIZE":   
		$sortSize  = $nextSortType;
		$imgSize   = $nowimg;
		$colSize   = "class=\"Tr_Ts\"";
		break;
	Case "_FROM":
		$sortFrom = $nextSortType;
		$imgFrom  = $nowimg;
		$colFrom  = "class=\"Tr_Ts\"";
		break;
	Case "_TO":
		$sortTO = $nextSortType;
		$imgTO  = $nowimg;
		$colTO  = "class=\"Tr_Ts\"";
		break;
	Case "_CC":
		$sortCC = $nextSortType;
		$imgCC  = $nowimg;
		$colCC  = "class=\"Tr_Ts\"";
		break;
	Case "_BCC":
		$sortBCC = $nextSortType;
		$imgBCC  = $nowimg;
		$colBCC  = "class=\"Tr_Ts\"";
		break;
	Case "_HOST":   
		$sortHost  = $nextSortType;
		$imgHost   = $nowimg;
		$colHost   = "class=\"Tr_Ts\"";
		break;
	Case "_SENDER":
		$sortSENDER = $nextSortType;
		$imgSENDER  = $nowimg;
		$colSENDER  = "class=\"Tr_Ts\"";
		break;
	Case "_TAG":
		$sortTag = $nextSortType;
		$imgTag  = $nowimg;
		$colTag  = "class=\"Tr_Ts\"";
		break;
	Case "remark":
		$sortRemark = $nextSortType;
		$imgRemark  = $nowimg;
		$colRemark  = "class=\"Tr_Ts\"";
		break;
	Case "groupno":
		$sortGroup = $nextSortType;
		$imgGroup  = $nowimg;
		$colGroup  = "class=\"Tr_Ts\"";
		break;
	Case "_SERVER":
		$sortServer = $nextSortType;
		$imgServer  = $nowimg;
		$colServer  = "class=\"Tr_Ts\"";
		break;
	Case "status":
		$sortStatus = $nextSortType;
		$imgStatus  = $nowimg;
		$colStatus  = "class=\"Tr_Ts\"";
		break;
	Case "_ISP":
		$sortISP = $nextSortType;
		$imgISP  = $nowimg;
		$colISP  = "class=\"Tr_Ts\"";
		break;
	Case "_SMAC":
	Case "_MAC":
		$sortSmac = $nextSortType;
		$imgSmac  = $nowimg;
		$colSmac  = "class=\"Tr_Ts\"";
		break;
	Case "_DMAC":
	Case "_SRC_MAC":
		$sortDmac = $nextSortType;
		$imgDmac  = $nowimg;
		$colDmac  = "class=\"Tr_Ts\"";
		break;
	Case "_SIP":
		$sortSip = $nextSortType;
		$imgSip  = $nowimg;
		$colSip  = "class=\"Tr_Ts\"";
		break;
	Case "_DIP":
	Case "_SRC_IP":
		$sortDip = $nextSortType;
		$imgDip  = $nowimg;
		$colDip  = "class=\"Tr_Ts\"";
		break;
	Case "_PPORT":
	Case "_PORT":
		$sortSport = $nextSortType;
		$imgSport  = $nowimg;
		$colSport  = "class=\"Tr_Ts\"";
		break;
	Case "_DPORT":
	Case 	"_SRC_PORT";
		$sortDport = $nextSortType;
		$imgDport  = $nowimg;
		$colDport  = "class=\"Tr_Ts\"";
		break;		
	Case "_TYPE":
		$sortType = $nextSortType;
		$imgType  = $nowimg;
		$colType = "class=\"Tr_Ts\"";
		break;
	Case "_START":
		$sortStop = $nextSortType;
		$imgStart  = $nowimg;
		$colStart = "class=\"Tr_Ts\"";
		break;
	Case "_STOP":
		$sortStop = $nextSortType;
		$imgStop  = $nowimg;
		$colStop = "class=\"Tr_Ts\"";
		break;
	Case "_PKT":
		$sortPkt = $nextSortType;
		$imgPkt= $nowimg;
		$colPkt = "class=\"Tr_Ts\"";
		break;		
	Case "_BYTE":
		$sortByte = $nextSortType;
		$imgByte  = $nowimg;
		$colByte = "class=\"Tr_Ts\"";
		break;		
	Case "_TOOLS":
		$sortTools = $nextSortType;
		$imgTools  = $nowimg;
		$colTools = "class=\"Tr_Ts\"";
		break;	
	Case "_FILENAME":
		$sortFile = $nextSortType;
		$imgFile = $nowimg;
		$colFile = "class=\"Tr_Ts\"";
		break;				
}//End : switch (設定這次排序的圖形, 及下次排序方式)
?>
