| 
									
										
										
										
											2016-01-01 13:42:52 +01:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Node { | 
					
						
							| 
									
										
										
										
											2016-03-13 19:16:51 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-01 13:42:52 +01:00
										 |  |  |    private $Callsign; | 
					
						
							|  |  |  |    private $IP; | 
					
						
							|  |  |  |    private $LinkedModule; | 
					
						
							|  |  |  |    private $Protocol; | 
					
						
							|  |  |  |    private $ConnectTime; | 
					
						
							|  |  |  |    private $LastHeardTime; | 
					
						
							|  |  |  |    private $Suffix; | 
					
						
							| 
									
										
										
										
											2016-03-01 09:28:55 +01:00
										 |  |  |    private $Prefix; | 
					
						
							| 
									
										
										
										
											2017-01-24 08:45:11 +01:00
										 |  |  |    private $RandomID; | 
					
						
							| 
									
										
										
										
											2016-03-13 19:16:51 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-24 08:45:11 +01:00
										 |  |  |    public function __construct($Callsign, $IP, $LinkedModule, $Protocol, $ConnectTime, $LastHeardTime, $RandomID) { | 
					
						
							| 
									
										
										
										
											2016-03-13 19:16:51 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-01 13:42:52 +01:00
										 |  |  |       $this->IP            = $IP; | 
					
						
							| 
									
										
										
										
											2016-03-13 19:16:51 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-01 13:42:52 +01:00
										 |  |  |       $this->Protocol      = $Protocol; | 
					
						
							|  |  |  |       $this->ConnectTime   = ParseTime($ConnectTime); | 
					
						
							|  |  |  |       $this->LastHeardTime = ParseTime($LastHeardTime); | 
					
						
							| 
									
										
										
										
											2016-03-13 19:16:51 +01:00
										 |  |  |     | 
					
						
							|  |  |  |       $this->FullCallsign  = trim(str_replace("   ", "-", $Callsign)); | 
					
						
							|  |  |  |       $this->FullCallsign  = str_replace("  ", "-", $this->FullCallsign); | 
					
						
							|  |  |  |       $this->FullCallsign  = str_replace(" ", "-", $this->FullCallsign);  | 
					
						
							| 
									
										
										
										
											2016-02-11 18:51:12 +01:00
										 |  |  |        | 
					
						
							| 
									
										
										
										
											2016-01-01 13:42:52 +01:00
										 |  |  |       if (strpos($Callsign, " ") !== false) { | 
					
						
							|  |  |  |          $this->Callsign      = trim(substr($Callsign, 0, strpos($Callsign, " "))); | 
					
						
							|  |  |  |          $this->Suffix        = trim(substr($Callsign, strpos($Callsign, " "), strlen($Callsign))); | 
					
						
							| 
									
										
										
										
											2016-03-01 09:28:55 +01:00
										 |  |  |          $this->Prefix        = strtoupper(trim(substr($Callsign, 0, 3))); | 
					
						
							| 
									
										
										
										
											2016-01-01 13:42:52 +01:00
										 |  |  |       } | 
					
						
							|  |  |  |       else { | 
					
						
							|  |  |  |          $this->Callsign      = trim($Callsign); | 
					
						
							|  |  |  |          $this->Suffix        = ""; | 
					
						
							| 
									
										
										
										
											2016-03-01 09:28:55 +01:00
										 |  |  |          $this->Prefix        = ""; | 
					
						
							| 
									
										
										
										
											2016-01-01 13:42:52 +01:00
										 |  |  |       } | 
					
						
							| 
									
										
										
										
											2016-03-13 19:16:51 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-24 08:45:11 +01:00
										 |  |  |       $this->LinkedModule     = trim($LinkedModule); | 
					
						
							|  |  |  |       $this->RandomID         = $RandomID; | 
					
						
							| 
									
										
										
										
											2016-01-01 13:42:52 +01:00
										 |  |  |    } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-13 19:16:51 +01:00
										 |  |  |    public function GetFullCallsign()         { return $this->FullCallsign;   } | 
					
						
							| 
									
										
										
										
											2016-01-01 13:42:52 +01:00
										 |  |  |    public function GetCallsign()             { return $this->Callsign;       } | 
					
						
							|  |  |  |    public function GetIP()                   { return $this->IP;             } | 
					
						
							|  |  |  |    public function GetLinkedModule()         { return $this->LinkedModule;   } | 
					
						
							|  |  |  |    public function GetProtocol()             { return $this->Protocol;       } | 
					
						
							|  |  |  |    public function GetConnectTime()          { return $this->ConnectTime;    } | 
					
						
							|  |  |  |    public function GetLastHeardTime()        { return $this->LastHeardTime;  } | 
					
						
							|  |  |  |    public function GetSuffix()               { return $this->Suffix;         } | 
					
						
							| 
									
										
										
										
											2016-03-01 09:28:55 +01:00
										 |  |  |    public function GetPrefix()               { return $this->Prefix;         } | 
					
						
							| 
									
										
										
										
											2017-01-24 08:45:11 +01:00
										 |  |  |    public function GetRandomID()             { return $this->RandomID;       } | 
					
						
							|  |  |  |     | 
					
						
							| 
									
										
										
										
											2016-01-01 13:42:52 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-13 19:16:51 +01:00
										 |  |  | ?>
 |