Example #1
0
 protected function Form_Create()
 {
     // Attempt to load by Token and then by ID
     $this->objSignupForm = SignupForm::LoadByToken(QApplication::PathInfo(0));
     if (!$this->objSignupForm) {
         $this->objSignupForm = SignupForm::Load(QApplication::PathInfo(0));
     }
     // Ensure it is the correct type and it exists
     if (!$this->objSignupForm) {
         $this->strHtmlIncludeFilePath = '_notfound.tpl.php';
         return;
     }
     $this->strPageTitle = $this->objSignupForm->Name . ' - Confirmation';
     // Ensure it is Active
     if (!$this->objSignupForm->ActiveFlag) {
         $this->strHtmlIncludeFilePath = '_notactive.tpl.php';
         return;
     }
     // Get the SignupEntry
     $this->objSignupEntry = SignupEntry::Load(QApplication::PathInfo(1));
     // Ensure it is correct for the form and the signup person
     if ($this->objSignupEntry->SignupByPersonId) {
         if (!$this->objSignupEntry || $this->objSignupEntry->SignupFormId != $this->objSignupForm->Id || $this->objSignupEntry->SignupByPersonId != QApplication::$PublicLogin->PersonId || $this->objSignupEntry->SignupEntryStatusTypeId != SignupEntryStatusType::Complete) {
             $this->strHtmlIncludeFilePath = '_notfound.tpl.php';
             return;
         }
     } else {
         if (!$this->objSignupEntry || $this->objSignupEntry->SignupFormId != $this->objSignupForm->Id || !$this->objSignupEntry->CommunicationsEntryId || $this->objSignupEntry->SignupEntryStatusTypeId != SignupEntryStatusType::Complete) {
             $this->strHtmlIncludeFilePath = '_notfound.tpl.php';
             return;
         }
     }
 }
Example #2
0
 /**
  * Override method to perform a property "Get"
  * This will get the value of $strName
  *
  * @param string $strName Name of the property to get
  * @return mixed
  */
 public function __get($strName)
 {
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         case 'Id':
             // Gets the value for intId (Read-Only PK)
             // @return integer
             return $this->intId;
         case 'SignupEntryId':
             // Gets the value for intSignupEntryId (Not Null)
             // @return integer
             return $this->intSignupEntryId;
         case 'SignupPaymentTypeId':
             // Gets the value for intSignupPaymentTypeId (Not Null)
             // @return integer
             return $this->intSignupPaymentTypeId;
         case 'TransactionDate':
             // Gets the value for dttTransactionDate
             // @return QDateTime
             return $this->dttTransactionDate;
         case 'TransactionDescription':
             // Gets the value for strTransactionDescription
             // @return string
             return $this->strTransactionDescription;
         case 'Amount':
             // Gets the value for fltAmount
             // @return double
             return $this->fltAmount;
         case 'FundingAccount':
             // Gets the value for strFundingAccount
             // @return string
             return $this->strFundingAccount;
         case 'DonationStewardshipFundId':
             // Gets the value for intDonationStewardshipFundId
             // @return integer
             return $this->intDonationStewardshipFundId;
         case 'AmountDonation':
             // Gets the value for fltAmountDonation
             // @return double
             return $this->fltAmountDonation;
         case 'AmountNonDonation':
             // Gets the value for fltAmountNonDonation
             // @return double
             return $this->fltAmountNonDonation;
         case 'CreditCardPaymentId':
             // Gets the value for intCreditCardPaymentId (Unique)
             // @return integer
             return $this->intCreditCardPaymentId;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'SignupEntry':
             // Gets the value for the SignupEntry object referenced by intSignupEntryId (Not Null)
             // @return SignupEntry
             try {
                 if (!$this->objSignupEntry && !is_null($this->intSignupEntryId)) {
                     $this->objSignupEntry = SignupEntry::Load($this->intSignupEntryId);
                 }
                 return $this->objSignupEntry;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'DonationStewardshipFund':
             // Gets the value for the StewardshipFund object referenced by intDonationStewardshipFundId
             // @return StewardshipFund
             try {
                 if (!$this->objDonationStewardshipFund && !is_null($this->intDonationStewardshipFundId)) {
                     $this->objDonationStewardshipFund = StewardshipFund::Load($this->intDonationStewardshipFundId);
                 }
                 return $this->objDonationStewardshipFund;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'CreditCardPayment':
             // Gets the value for the CreditCardPayment object referenced by intCreditCardPaymentId (Unique)
             // @return CreditCardPayment
             try {
                 if (!$this->objCreditCardPayment && !is_null($this->intCreditCardPaymentId)) {
                     $this->objCreditCardPayment = CreditCardPayment::Load($this->intCreditCardPaymentId);
                 }
                 return $this->objCreditCardPayment;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             ////////////////////////////
             // Virtual Object References (Many to Many and Reverse References)
             // (If restored via a "Many-to" expansion)
             ////////////////////////////
         ////////////////////////////
         // Virtual Object References (Many to Many and Reverse References)
         // (If restored via a "Many-to" expansion)
         ////////////////////////////
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Example #3
0
 protected function Form_Create()
 {
     // Attempt to load by Token and then by ID
     $this->objSignupForm = SignupForm::LoadByToken(QApplication::PathInfo(0));
     if (!$this->objSignupForm) {
         $this->objSignupForm = SignupForm::Load(QApplication::PathInfo(0));
     }
     // Ensure it is the correct type and it exists
     if (!$this->objSignupForm) {
         $this->strHtmlIncludeFilePath = '_notfound.tpl.php';
         return;
     }
     $this->strPageTitle = $this->objSignupForm->Name . ' - Payment';
     // Ensure it is Active
     if (!$this->objSignupForm->ActiveFlag) {
         $this->strHtmlIncludeFilePath = '_notactive.tpl.php';
         return;
     }
     // Ensure we have Products that require some kind of payment
     if (!$this->objSignupForm->CountFormProducts()) {
         $this->strHtmlIncludeFilePath = '_notfound.tpl.php';
         return;
     }
     // Get the SignupEntry
     $this->objSignupEntry = SignupEntry::Load(QApplication::PathInfo(1));
     // Ensure it is correct for the form and the signup person
     if (!$this->objSignupEntry || $this->objSignupEntry->SignupFormId != $this->objSignupForm->Id || $this->objSignupEntry->SignupByPersonId != QApplication::$PublicLogin->PersonId || $this->objSignupEntry->SignupEntryStatusTypeId != SignupEntryStatusType::Incomplete) {
         $this->strHtmlIncludeFilePath = '_notfound.tpl.php';
         return;
     }
     switch ($this->objSignupForm->SignupFormTypeId) {
         case SignupFormType::Event:
             $this->objChild = $this->objSignupForm->EventSignupForm;
             break;
         case SignupFormType::Course:
             $this->objChild = $this->objSignupForm->ClassMeeting;
             break;
     }
     $this->dtgProducts = new QDataGrid($this);
     $this->dtgProducts->AddColumn(new QDataGridColumn('Product / Item', '<?= $_FORM->RenderProduct($_ITEM); ?>', 'HtmlEntities=false', 'Width=550px'));
     $this->dtgProducts->AddColumn(new QDataGridColumn('Quantity', '<?= $_FORM->RenderQuantity($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px'));
     $this->dtgProducts->AddColumn(new QDataGridColumn('Cost', '<?= $_FORM->RenderCost($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px'));
     $this->dtgProducts->AddColumn(new QDataGridColumn('Total', '<?= $_FORM->RenderTotal($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px'));
     $this->dtgProducts->SetDataBinder('dtgProducts_Bind');
     // Remove All Product Selections
     $this->objSignupEntry->DeleteAllSignupProducts();
     // Add Required Products
     foreach ($this->objSignupForm->GetFormProductArrayByType(FormProductType::Required, QQ::OrderBy(QQN::FormProduct()->OrderNumber)) as $objProduct) {
         if ($objProduct->IsAvailableRightNow()) {
             $objSignupProduct = SignupProduct::LoadBySignupEntryIdFormProductId($this->objSignupEntry->Id, $objProduct->Id);
             if (!$objSignupProduct) {
                 $this->objSignupEntry->AddProduct($objProduct);
             }
         }
     }
     // Deposit vs. Full Amount Choice
     $this->rblDeposit = new QRadioButtonList($this);
     $this->rblDeposit->Name = 'Payment Option';
     $this->rblDeposit->AddItem('Pay in Full', 1);
     $this->rblDeposit->AddItem('Deposit', 2);
     $this->rblDeposit->AddAction(new QClickEvent(), new QAjaxAction('rblDeposit_Click'));
     $this->btnRegister = new QButton($this);
     $this->btnRegister->CssClass = 'primary';
     $this->btnRegister->Text = 'Submit Registration';
     $this->btnRegister->AddAction(new QClickEvent(), new QAjaxAction('btnRegister_Click'));
     $this->btnRegister->CausesValidation = true;
     // Figure out which address to use
     $objAddress = $this->objSignupEntry->RetrieveAnyValidAddressObject();
     if (!$objAddress) {
         $objAddress = QApplication::$PublicLogin->Person->DeducePrimaryAddress();
     }
     // Create the Payment Panel
     $this->pnlPayment = new PaymentPanel($this, null, $objAddress, QApplication::$PublicLogin->Person->FirstName, QApplication::$PublicLogin->Person->LastName);
     $this->pnlPayment->SetButtonText('Submit Payment');
     $this->objSignupEntry->RefreshAmounts();
     $this->RefreshForm();
 }
Example #4
0
 /**
  * Reload this SignupEntry from the database.
  * @return void
  */
 public function Reload()
 {
     // Make sure we are actually Restored from the database
     if (!$this->__blnRestored) {
         throw new QCallerException('Cannot call Reload() on a new, unsaved SignupEntry object.');
     }
     // Reload the Object
     $objReloaded = SignupEntry::Load($this->intId);
     // Update $this's local variables to match
     $this->SignupFormId = $objReloaded->SignupFormId;
     $this->PersonId = $objReloaded->PersonId;
     $this->SignupByPersonId = $objReloaded->SignupByPersonId;
     $this->SignupEntryStatusTypeId = $objReloaded->SignupEntryStatusTypeId;
     $this->dttDateCreated = $objReloaded->dttDateCreated;
     $this->dttDateSubmitted = $objReloaded->dttDateSubmitted;
     $this->fltAmountTotal = $objReloaded->fltAmountTotal;
     $this->fltAmountPaid = $objReloaded->fltAmountPaid;
     $this->fltAmountBalance = $objReloaded->fltAmountBalance;
     $this->strInternalNotes = $objReloaded->strInternalNotes;
     $this->CommunicationsEntryId = $objReloaded->CommunicationsEntryId;
 }
Example #5
0
 /**
  * Override method to perform a property "Get"
  * This will get the value of $strName
  *
  * @param string $strName Name of the property to get
  * @return mixed
  */
 public function __get($strName)
 {
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         case 'SignupEntryId':
             // Gets the value for intSignupEntryId (PK)
             // @return integer
             return $this->intSignupEntryId;
         case 'ClassMeetingId':
             // Gets the value for intClassMeetingId (Not Null)
             // @return integer
             return $this->intClassMeetingId;
         case 'PersonId':
             // Gets the value for intPersonId (Not Null)
             // @return integer
             return $this->intPersonId;
         case 'ClassGradeId':
             // Gets the value for intClassGradeId
             // @return integer
             return $this->intClassGradeId;
         case 'ChildcareNotes':
             // Gets the value for strChildcareNotes
             // @return string
             return $this->strChildcareNotes;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'SignupEntry':
             // Gets the value for the SignupEntry object referenced by intSignupEntryId (PK)
             // @return SignupEntry
             try {
                 if (!$this->objSignupEntry && !is_null($this->intSignupEntryId)) {
                     $this->objSignupEntry = SignupEntry::Load($this->intSignupEntryId);
                 }
                 return $this->objSignupEntry;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ClassMeeting':
             // Gets the value for the ClassMeeting object referenced by intClassMeetingId (Not Null)
             // @return ClassMeeting
             try {
                 if (!$this->objClassMeeting && !is_null($this->intClassMeetingId)) {
                     $this->objClassMeeting = ClassMeeting::Load($this->intClassMeetingId);
                 }
                 return $this->objClassMeeting;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Person':
             // Gets the value for the Person object referenced by intPersonId (Not Null)
             // @return Person
             try {
                 if (!$this->objPerson && !is_null($this->intPersonId)) {
                     $this->objPerson = Person::Load($this->intPersonId);
                 }
                 return $this->objPerson;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'ClassGrade':
             // Gets the value for the ClassGrade object referenced by intClassGradeId
             // @return ClassGrade
             try {
                 if (!$this->objClassGrade && !is_null($this->intClassGradeId)) {
                     $this->objClassGrade = ClassGrade::Load($this->intClassGradeId);
                 }
                 return $this->objClassGrade;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             ////////////////////////////
             // Virtual Object References (Many to Many and Reverse References)
             // (If restored via a "Many-to" expansion)
             ////////////////////////////
         ////////////////////////////
         // Virtual Object References (Many to Many and Reverse References)
         // (If restored via a "Many-to" expansion)
         ////////////////////////////
         case '_ClassAttendence':
             // Gets the value for the private _objClassAttendence (Read-Only)
             // if set due to an expansion on the class_attendence.class_registration_id reverse relationship
             // @return ClassAttendence
             return $this->_objClassAttendence;
         case '_ClassAttendenceArray':
             // Gets the value for the private _objClassAttendenceArray (Read-Only)
             // if set due to an ExpandAsArray on the class_attendence.class_registration_id reverse relationship
             // @return ClassAttendence[]
             return (array) $this->_objClassAttendenceArray;
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Example #6
0
 /**
  * Override method to perform a property "Get"
  * This will get the value of $strName
  *
  * @param string $strName Name of the property to get
  * @return mixed
  */
 public function __get($strName)
 {
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         case 'Id':
             // Gets the value for intId (Read-Only PK)
             // @return integer
             return $this->intId;
         case 'SignupEntryId':
             // Gets the value for intSignupEntryId (Not Null)
             // @return integer
             return $this->intSignupEntryId;
         case 'FormQuestionId':
             // Gets the value for intFormQuestionId (Not Null)
             // @return integer
             return $this->intFormQuestionId;
         case 'TextValue':
             // Gets the value for strTextValue
             // @return string
             return $this->strTextValue;
         case 'AddressId':
             // Gets the value for intAddressId
             // @return integer
             return $this->intAddressId;
         case 'PhoneId':
             // Gets the value for intPhoneId
             // @return integer
             return $this->intPhoneId;
         case 'EmailId':
             // Gets the value for intEmailId
             // @return integer
             return $this->intEmailId;
         case 'IntegerValue':
             // Gets the value for intIntegerValue
             // @return integer
             return $this->intIntegerValue;
         case 'BooleanValue':
             // Gets the value for blnBooleanValue
             // @return boolean
             return $this->blnBooleanValue;
         case 'DateValue':
             // Gets the value for dttDateValue
             // @return QDateTime
             return $this->dttDateValue;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'SignupEntry':
             // Gets the value for the SignupEntry object referenced by intSignupEntryId (Not Null)
             // @return SignupEntry
             try {
                 if (!$this->objSignupEntry && !is_null($this->intSignupEntryId)) {
                     $this->objSignupEntry = SignupEntry::Load($this->intSignupEntryId);
                 }
                 return $this->objSignupEntry;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'FormQuestion':
             // Gets the value for the FormQuestion object referenced by intFormQuestionId (Not Null)
             // @return FormQuestion
             try {
                 if (!$this->objFormQuestion && !is_null($this->intFormQuestionId)) {
                     $this->objFormQuestion = FormQuestion::Load($this->intFormQuestionId);
                 }
                 return $this->objFormQuestion;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Address':
             // Gets the value for the Address object referenced by intAddressId
             // @return Address
             try {
                 if (!$this->objAddress && !is_null($this->intAddressId)) {
                     $this->objAddress = Address::Load($this->intAddressId);
                 }
                 return $this->objAddress;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Phone':
             // Gets the value for the Phone object referenced by intPhoneId
             // @return Phone
             try {
                 if (!$this->objPhone && !is_null($this->intPhoneId)) {
                     $this->objPhone = Phone::Load($this->intPhoneId);
                 }
                 return $this->objPhone;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Email':
             // Gets the value for the Email object referenced by intEmailId
             // @return Email
             try {
                 if (!$this->objEmail && !is_null($this->intEmailId)) {
                     $this->objEmail = Email::Load($this->intEmailId);
                 }
                 return $this->objEmail;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             ////////////////////////////
             // Virtual Object References (Many to Many and Reverse References)
             // (If restored via a "Many-to" expansion)
             ////////////////////////////
         ////////////////////////////
         // Virtual Object References (Many to Many and Reverse References)
         // (If restored via a "Many-to" expansion)
         ////////////////////////////
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Example #7
0
File: result.php Project: alcf/chms
 protected function Form_Create()
 {
     $this->objSignupForm = SignupForm::Load(QApplication::PathInfo(0));
     if (!$this->objSignupForm) {
         QApplication::Redirect('/events/');
     }
     // Check for view *and* admin permissions on this ministry
     if (!$this->objSignupForm->IsLoginCanView(QApplication::$Login)) {
         QApplication::Redirect('/events/');
     }
     if (!$this->objSignupForm->Ministry->IsLoginCanAdminMinistry(QApplication::$Login)) {
         QApplication::Redirect('/events/');
     }
     switch ($this->objSignupForm->SignupFormTypeId) {
         case SignupFormType::Event:
             $this->strPageTitle .= $this->objSignupForm->Name;
             break;
         case SignupFormType::Course:
             $this->strPageTitle = 'Class Registration - ' . $this->objSignupForm->Name;
             break;
         default:
             throw new Exception('Invalid SignupFormTypeId for SignupForm: ' . $this->objSignupForm->Id);
     }
     // Check for the SignupEntry
     if (QApplication::PathInfo(1)) {
         $objSignupEntry = SignupEntry::Load(QApplication::PathInfo(1));
         if (!$objSignupEntry) {
             QApplication::Redirect('/events/');
         }
         if ($objSignupEntry->SignupFormId != $this->objSignupForm->Id) {
             QApplication::Redirect('/events/');
         }
     } else {
         QApplication::Redirect('/events/results.php/' . $this->objSignupForm->Id);
     }
     $this->mctSignupEntry = new SignupEntryMetaControl($this, $objSignupEntry);
     $this->lblPerson = new QLabel($this);
     $this->lblPerson->Name = 'Person';
     $this->lblPerson->HtmlEntities = false;
     $this->lblPersonName = new QLabel($this);
     $this->lblPersonName->Name = 'Person Name';
     $this->lblPersonName->HtmlEntities = true;
     if ($this->mctSignupEntry->SignupEntry->Person) {
         $this->lblPerson->Text = $this->mctSignupEntry->SignupEntry->Person->LinkHtml;
         $this->lblPersonName->Text = $this->mctSignupEntry->SignupEntry->Person->Name;
     } else {
         $this->lblPerson->Text = sprintf("%s %s", $objSignupEntry->CommunicationsEntry->FirstName, $objSignupEntry->CommunicationsEntry->LastName);
         $this->lblPersonName->Text = $this->lblPerson->Text;
     }
     $this->lblSignupEntryStatusType = $this->mctSignupEntry->lblSignupEntryStatusTypeId_Create();
     $this->lblDateCreated = $this->mctSignupEntry->lblDateCreated_Create();
     $this->lblDateSubmitted = $this->mctSignupEntry->lblDateSubmitted_Create();
     if ($this->mctSignupEntry->SignupEntry->PersonId != $this->mctSignupEntry->SignupEntry->SignupByPersonId && $this->mctSignupEntry->SignupEntry->SignupByPersonId) {
         $this->lblSignupByPerson = new QLabel($this);
         $this->lblSignupByPerson->HtmlEntities = false;
         $this->lblSignupByPerson->Text = $this->mctSignupEntry->SignupEntry->SignupByPerson->LinkHtml;
     }
     $this->lblInternalNotes = $this->mctSignupEntry->lblInternalNotes_Create();
     $this->btnEditNote = new QButton($this);
     $this->btnEditNote->Text = 'Edit Internal Note';
     $this->btnEditNote->AddAction(new QClickEvent(), new QAjaxAction('btnEditNote_Click'));
     $this->btnEditNote->CssClass = 'alternate';
     $this->btnToggleStatus = new QButton($this);
     $this->btnToggleStatus->Text = 'Change Registration Status';
     $this->btnToggleStatus->CssClass = 'alternate';
     $this->btnToggleStatus->AddAction(new QClickEvent(), new QAjaxAction('btnToggleStatus_Click'));
     $this->dtgFormQuestions = new QDataGrid($this);
     $this->dtgFormQuestions->AddColumn(new QDataGridColumn('Question', '<?= $_ITEM->ShortDescriptionBoldIfRequiredHtml; ?>', 'Width=300px', 'HtmlEntities=false'));
     $this->dtgFormQuestions->AddColumn(new QDataGridColumn('Response', '<?= $_FORM->RenderResponse($_ITEM); ?>', 'Width=640px', 'HtmlEntities=false'));
     $this->dtgFormQuestions->SetDataBinder('dtgFormQuestions_Bind');
     $this->pxyEditFormQuestion = new QControlProxy($this);
     $this->pxyEditFormQuestion->AddAction(new QClickEvent(), new QAjaxAction('pxyEditFormQuestion_Click'));
     $this->pxyEditFormQuestion->AddAction(new QClickEvent(), new QTerminateAction());
     $this->dtgFormProducts = new QDataGrid($this);
     $this->dtgFormProducts->AddColumn(new QDataGridColumn('Product Name', '<?= $_FORM->RenderProductName($_ITEM); ?>', 'Width=300px', 'HtmlEntities=false'));
     $this->dtgFormProducts->AddColumn(new QDataGridColumn('Purchased / Quantity', '<?= $_FORM->RenderProductQuantity($_ITEM); ?>', 'Width=475px', 'HtmlEntities=false'));
     $this->dtgFormProducts->AddColumn(new QDataGridColumn('Total Cost', '<?= $_FORM->RenderProductCost($_ITEM); ?>', 'Width=150px', 'HtmlEntities=false'));
     $this->dtgFormProducts->SetDataBinder('dtgFormProducts_Bind');
     $this->pxyEditFormProduct = new QControlProxy($this);
     $this->pxyEditFormProduct->AddAction(new QClickEvent(), new QAjaxAction('pxyEditFormProduct_Click'));
     $this->pxyEditFormProduct->AddAction(new QClickEvent(), new QTerminateAction());
     $this->dtgPayments = new SignupPaymentDataGrid($this);
     $this->dtgPayments->MetaAddColumn('TransactionDate', 'Width=160px');
     $this->dtgPayments->MetaAddTypeColumn('SignupPaymentTypeId', 'SignupPaymentType', 'Name=Type', 'Width=160px');
     $this->dtgPayments->MetaAddColumn('TransactionDescription', 'Name=Description', 'Width=445px', 'Html=<?= $_FORM->RenderPaymentCode($_ITEM); ?>', 'HtmlEntities=false');
     $this->dtgPayments->MetaAddColumn('Amount', 'Width=150px', 'Html=<?= $_FORM->RenderPaymentAmount($_ITEM); ?>', 'HtmlEntities=false', 'FontBold=true');
     $this->dtgPayments->SetDataBinder('dtgPayments_Bind');
     $this->dtgPayments->SortColumnIndex = 0;
     $this->lstAddPayment = new QListBox($this);
     $this->lstAddPayment->AddItem('- Add Payment -');
     foreach (SignupPaymentType::$NameArray as $intId => $strName) {
         if ($intId != SignupPaymentType::CreditCard) {
             $this->lstAddPayment->AddItem($strName, $intId);
         }
     }
     $this->lstAddPayment->AddAction(new QChangeEvent(), new QAjaxAction('lstAddPayment_Change'));
     $this->dlgEdit_Create();
     // Child Object
     switch ($this->objSignupForm->SignupFormTypeId) {
         case SignupFormType::Event:
             break;
         case SignupFormType::Course:
             $this->mctClassRegistration = new ClassRegistrationMetaControl($this->dlgEdit, $objSignupEntry->ClassRegistration);
             break;
         default:
             throw new Exception('Invalid SignupFormTypeId for SignupForm: ' . $this->objSignupForm->Id);
     }
     // Specifically for class registrations
     if ($this->mctClassRegistration) {
         $this->dtgClassAttendance = new QDataGrid($this);
         $this->dtgClassAttendance->AddColumn(new QDataGridColumn('Class Meeting', '<?= $_FORM->dttClassMeetingArrayForIndex[$_ITEM->MeetingNumber - 1]->ToString("DDDD, MMMM D, YYYY"); ?>', 'Width=300px'));
         $this->dtgClassAttendance->AddColumn(new QDataGridColumn('Attendance', '<?= $_FORM->RenderAttendance($_ITEM); ?>', 'Width=640px', 'HtmlEntities=false'));
         $this->dtgClassAttendance->SetDataBinder('dtgClassAttendance_Bind');
         $this->pxyEditClassAttendance = new QControlProxy($this);
         $this->pxyEditClassAttendance->AddAction(new QClickEvent(), new QAjaxAction('pxyEditClassAttendance_Click'));
         $this->pxyEditClassAttendance->AddAction(new QClickEvent(), new QTerminateAction());
         $this->dtgClassGrade = new QDataGrid($this);
         $this->dtgClassGrade->AddColumn(new QDataGridColumn('Class Grade', 'Final Class Grade', 'Width=300px'));
         $this->dtgClassGrade->AddColumn(new QDataGridColumn('Grade', '<?= $_FORM->RenderClassGrade(); ?>', 'Width=640px', 'HtmlEntities=false'));
         $this->dtgClassGrade->SetDataBinder('dtgClassGrade_Bind');
         $this->pxyEditClassGrade = new QControlProxy($this);
         $this->pxyEditClassGrade->AddAction(new QClickEvent(), new QAjaxAction('pxyEditClassGrade_Click'));
         $this->pxyEditClassGrade->AddAction(new QClickEvent(), new QTerminateAction());
     }
 }
 /**
  * Static Helper Method to Create using PK arguments
  * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
  * edit, or if we are also allowed to create a new one, etc.
  * 
  * @param mixed $objParentObject QForm or QPanel which will be using this SignupEntryMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing SignupEntry object creation - defaults to CreateOrEdit
  * @return SignupEntryMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objSignupEntry = SignupEntry::Load($intId);
         // SignupEntry was found -- return it!
         if ($objSignupEntry) {
             return new SignupEntryMetaControl($objParentObject, $objSignupEntry);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a SignupEntry object with PK arguments: ' . $intId);
             }
         }
         // If EditOnly is specified, throw an exception
     } else {
         if ($intCreateType == QMetaControlCreateType::EditOnly) {
             throw new QCallerException('No PK arguments specified');
         }
     }
     // If we are here, then we need to create a new record
     return new SignupEntryMetaControl($objParentObject, new SignupEntry());
 }