/** * Create and setup QListBox lstRecurringPayment * @param string $strControlId optional ControlId to use * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return QListBox */ public function lstRecurringPayment_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstRecurringPayment = new QListBox($this->objParentObject, $strControlId); $this->lstRecurringPayment->Name = QApplication::Translate('Recurring Payment'); $this->lstRecurringPayment->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objRecurringPaymentCursor = RecurringPayments::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objRecurringPayment = RecurringPayments::InstantiateCursor($objRecurringPaymentCursor)) { $objListItem = new QListItem($objRecurringPayment->__toString(), $objRecurringPayment->Id); if ($this->objOnlineDonation->RecurringPayment && $this->objOnlineDonation->RecurringPayment->Id == $objRecurringPayment->Id) { $objListItem->Selected = true; } $this->lstRecurringPayment->AddItem($objListItem); } // Return the QListBox return $this->lstRecurringPayment; }
<?php QCryptography::$Key = CRYPTO_KEY; $objCrypto = new QCryptography(null, false); // iterate through all recurring payments within the time period. $objRecurringPaymentCursor = RecurringPayments::QueryCursor(QQ::AndCondition(QQ::LessOrEqual(QQN::RecurringPayments()->StartDate, date('Y-m-d')), QQ::GreaterOrEqual(QQN::RecurringPayments()->EndDate, date('Y-m-d')))); while ($objRecurringPayment = RecurringPayments::InstantiateCursor($objRecurringPaymentCursor)) { // display information.. print sprintf("Payment of: %s within time period: %s - %s\n", $objRecurringPayment->Amount, $objRecurringPayment->StartDate, $objRecurringPayment->EndDate); print sprintf("name : %s\nAddress: %s %s\n City: %s\nState: %s\nZip: %s\n", $objCrypto->Decrypt($objRecurringPayment->CardHolderName), $objCrypto->Decrypt($objRecurringPayment->Address1), $objCrypto->Decrypt($objRecurringPayment->Address2), $objCrypto->Decrypt($objRecurringPayment->City), $objRecurringPayment->State, $objCrypto->Decrypt($objRecurringPayment->Zip)); print sprintf("Account Number: %s\nExpiration Date: %s\nSecurity code: %s\n", $objCrypto->Decrypt($objRecurringPayment->AccountNumber), $objRecurringPayment->ExpirationDate, $objCrypto->Decrypt($objRecurringPayment->SecurityCode)); print sprintf("CreditCard Type: %d\n", $objRecurringPayment->CreditCardTypeId); // identify if any are due today $startDate = $objRecurringPayment->StartDate; $timePeriod = 0; switch ($objRecurringPayment->PaymentPeriod->Id) { case 1: // weekly $timePeriod = 7 * 24 * 60 * 60; break; case 2: // bi-weekly $timePeriod = 2 * 7 * 24 * 60 * 60; break; case 3: // monthly $timePeriod = 30 * 24 * 60 * 60; break; case 4: // quarterly $timePeriod = 4 * 30 * 24 * 60 * 60;