public function __construct(AdminTreasurerModel $model) { $this->model = $model; $this->member = $model->getLoggedInMember(); list($amount, $date) = $this->model->getDonationCampaignValues(); $this->amount = $amount; list($year, $month, $day) = preg_split('/[\\/.-]/', $date); $this->date = $day . "." . $month . "." . $year; }
public function __construct(AdminTreasurerModel $model) { $this->model = $model; $this->member = $model->getLoggedInMember(); $this->donations = $model->getRecentDonations(); $stats = $model->getStatForDonations(); $this->donatedInCampaign = $stats->YearDonation; if (!$this->donatedInCampaign) { $this->donatedInCampaign = 0; } // Check if a donation campaign is currently running $this->campaign = $model->getDonationCampaignStatus() == 1; list($amount, $date) = $this->model->getDonationCampaignValues(); $this->neededPerYear = $amount; $this->campaignStartDate = $date; }
public function __construct(AdminTreasurerModel $model, $id) { $this->model = $model; $this->member = $model->getLoggedInMember(); $this->id = $id; if ($id == 0) { $this->username = "******"; $this->amount = ""; $this->date = ""; $this->comment = "Bank transfer"; $this->countrycode = ""; } else { $donation = $this->model->getDonation($id); $m = new Member($donation->IdMember); $this->username = $m->Username; $this->amount = $donation->Amount; $this->date = date('d.m.Y', strtotime($donation->created)); $this->comment = $donation->SystemComment; $this->countrycode = $this->model->getCountryCodeForGeonameId($donation->IdCountry); } }