Example #1
0
 public function setDateOfficeLeft($n)
 {
     if (is_null($n)) {
         $this->dateOfficeLeft = null;
     }
     if (strpos($n, '/') !== false) {
         if (!ZP::isDate($n) || strtotime(explode('/', trim($n))[0] . explode('/', trim($n))[1] . explode('/', trim($n))[2]) < strtotime($this->getDateOfficeAssumed())) {
             // check if date left is after date assumed
             parent::setError('dateOfficeLeft');
             parent::setError('dateOfficeAssumed');
         } else {
             $arr = explode('/', trim($n));
             $this->dateOfficeLeft = $arr[0] . $arr[1] . $arr[2];
         }
     } else {
         if (!ZP::isDate($n, 'Y-m-d')) {
             parent::setError('dateOfficeLeft');
         } else {
             $arr = explode('-', $n);
             $this->dateOfficeLeft = $arr[0] . '/' . $arr[1] . '/' . $arr[2];
         }
     }
 }
Example #2
0
 public function setStockExchange($n)
 {
     if (strcmp(parent::getId(), 'grz') == 0 || strcmp(parent::getId(), 'zccm') == 0 || strcmp($this->getBeneficialOwner(), 'Government of Zambia (GRZ)') == 0 || strcmp($this->getBeneficialOwner(), 'ZCCM-IH') == 0) {
         $this->stockExchange = null;
     } else {
         if (!is_string($n)) {
             parent::setError('stockExchange');
         } else {
             $this->stockExchange = trim($n);
         }
     }
 }
Example #3
0
 public function setCollectingAgency($n)
 {
     if (!is_string($n)) {
         parent::setError('CollectingAgency');
     } else {
         $this->CollectingAgency = trim($n);
     }
 }
Example #4
0
 public function setAmountReimbursed($n)
 {
     if (!is_numeric($n)) {
         parent::setError('amountPayedInYear');
     } else {
         $this->amountPayedInYear = $n;
     }
 }