HEX
Server: Apache
System: Linux darrell.nocdirect.com 4.18.0-513.18.2.el8_9.x86_64 #1 SMP Sat Mar 30 06:10:41 EDT 2024 x86_64
User: joderbya (1358)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/joderbya/wlsa.quick-step-ei.com2/classes/controls/ViewTimeField.php
<?php
class ViewTimeField extends ViewControl
{
	public function showDBValue(&$data, $keylink)
	{	
		$result = $this->getTextValue( $data );
		
		if( !$this->container->forExport || $this->container->forExport != "excel" && $this->container->forExport != "csv" )
			$result = runner_htmlspecialchars( $result );
			
		return $result;
	}
	
	/**
	 * @param &Array data
	 * @return String	 
	 */
	public function getTextValue(&$data)
	{
		$result = "";
		if( IsDateFieldType( $this->fieldType ) )
			return str_format_time( db2time( $data[ $this->field ] ) );
		
		$numbers = parsenumbers( $data[ $this->field ] );
		
		if( !count($numbers) )
			return "";
			
		while( count($numbers) < 3 )
		{
			$numbers[] = 0;
		}
		
		if( count($numbers) == 6 )
			return str_format_time( array(0, 0, 0, $numbers[3], $numbers[4], $numbers[5]) ); // sometimes data is datetime
	 
		return str_format_time( array(0, 0, 0, $numbers[0], $numbers[1], $numbers[2]) );		
	}	
}
?>