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/ViewCheckboxField.php
<?php
class ViewCheckboxField extends ViewControl
{
	public function showDBValue(&$data, $keylink)
	{		
		$result = "<img src=\"";
		$imgSrc = "images/check_";
		
		if( $this->getHostPageDbType() == nDATABASE_PostgreSQL )
			$trueCondition = $data[$this->field] === "t" || $data[$this->field] != 0 && $data[$this->field] != "";
		else
			$trueCondition = $data[$this->field] != 0 && $data[$this->field] != "";
		
		$imgSrc.= $trueCondition ? "yes" : "no";

		$result.= GetRootPathForResources($imgSrc.".gif")."\" border=0";
		if(isEnableSection508())
			$result .= " alt=\" \"";
		$result .=  ">";
		
		return $result;
	}
	
	/**
	 * Get the host page's db connection's type
	 * @return Number
	 */
	protected function getHostPageDbType()
	{
		global $cman;
		return $cman->byTable( $this->container->tName )->dbType;
	}

	/**
	 * Get the field's content that will be exported
	 * @prarm &Array data
	 * @prarm String keylink
	 * @return String
	 */
	public function getExportValue(&$data, $keylink = "")
	{
		return nl2br( $data[ $this->field ] );
	}
}
?>