. */ include_once("./include/Fee.php"); class PersonsFeeCheck extends Persons { private $showshort = false; private $fee; public function __construct($dummy=0) { $this->name = "FeeCheck"; $this->fee = new Fee(); } public function get_print_name() { return "Fee check"; } public function get_print_name_short() { $this->showshort = true; return "Fee check"; } public function get_access($dummy=0) { if( isset($_SESSION['sess_functions']) && in_array("application_editfee", $_SESSION['sess_functions']) ) return self::ACCESS_RW; elseif( isset($_SESSION['sess_functions']) && in_array("application_viewfee", $_SESSION['sess_functions']) ) return self::ACCESS_R; else return self::ACCESS_NO; } public function display($value, $applicationID=0, &$allvalues="") { if( $matches = preg_split("/;/", $value) ) { if( $matches[0]>=0 ) { $fee = $matches[0]; }else { if( ($fee=$this->fee->get_fee($matches[1], $matches[2], $matches[0]))===false ) return "\"Unknown"; } if( $matches[3]>=0 ) $feepaid = $matches[3]; else return "\"No"; if( $fee>=0 and $feepaid>=0 ) { if( $fee==$feepaid ) return "\"Fee"; elseif( $fee>$feepaid ) return "\"Too"; elseif( $fee<$feepaid ) return "\"Too"; else return "\"Unknown"; }else { return "\"Unknown"; } }else { return "\"Unknown"; } } public function displaytext($value, $applicationID=0, &$allvalues="") { if( $matches = preg_split("/;/", $value) ) { if( $matches[0]>=0 ) { $fee = $matches[0]; }else { if( ($fee=$this->fee->get_fee($matches[1], $matches[2], $matches[0]))===false ) return "Unknown fee"; } if( $matches[3]>=0 ) $feepaid = $matches[3]; else return "No fee paid"; if( $fee>=0 and $feepaid>=0 ) { if( $fee==$feepaid ) return "Fee paid"; elseif( $fee>$feepaid ) return "Too little fee paid"; elseif( $fee<$feepaid ) return "Too much fee paid"; else return "Unknown fee or fee paid"; }else { return "Unknown fee or fee paid"; } }else { return "Unknown fee"; } } public function displayoptions($applicationID=0) { return " align=\"center\" id=\"FeeCheck_".$applicationID."\""; } public function sql_columnname() { return "CONCAT(`applications`.`Fee`, ';', `applications`.`BodyCode`, ';', `applications`.`ParticipantType`, ';', `applications`.`FeePaid`) AS `FeeCheck`"; } } ?>