当前位置: 首页>>代码示例>>PHP>>正文


PHP QQN::UsState方法代码示例

本文整理汇总了PHP中QQN::UsState方法的典型用法代码示例。如果您正苦于以下问题:PHP QQN::UsState方法的具体用法?PHP QQN::UsState怎么用?PHP QQN::UsState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QQN的用法示例。


在下文中一共展示了QQN::UsState方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: lstState_Create

 /**
  * Create and setup QListBox lstState
  * @param string $strControlId optional ControlId to use
  * @return QListBox
  */
 public function lstState_Create($strControlId = null)
 {
     $this->lstState = new QListBox($this->objParentObject, $strControlId);
     $this->lstState->Name = QApplication::Translate('State');
     $this->lstState->AddItem(QApplication::Translate('- Select One -'), null);
     foreach (UsState::LoadAll(QQ::OrderBy(QQN::UsState()->Name)) as $objUsState) {
         $this->lstState->AddItem($objUsState->Name, $objUsState->Abbreviation, $this->objAddress->State == $objUsState->Abbreviation);
     }
     return $this->lstState;
 }
开发者ID:alcf,项目名称:chms,代码行数:15,代码来源:AddressMetaControl.class.php

示例2: btnAddress_Click

 protected function btnAddress_Click($strFormId, $strControlId, $strParameter)
 {
     if (!$this->txtHomeAddress1) {
         $this->txtHomeAddress1 = new QTextBox($this->dlgAddress);
         $this->txtHomeAddress1->Name = 'Home Address 1';
         $this->txtHomeAddress1->Required = true;
         $this->txtHomeAddress2 = new QTextBox($this->dlgAddress);
         $this->txtHomeAddress2->Name = 'Home Address 2';
         $this->txtHomeCity = new QTextBox($this->dlgAddress);
         $this->txtHomeCity->Name = 'Home City, State, Zip';
         $this->txtHomeCity->Required = true;
         $this->lstHomeState = new QListBox($this->dlgAddress);
         $this->lstHomeState->AddItem(QApplication::Translate('- Select One -'), null);
         $this->lstHomeState->Required = true;
         foreach (UsState::LoadAll(QQ::OrderBy(QQN::UsState()->Name)) as $objUsState) {
             $this->lstHomeState->AddItem($objUsState->Name, $objUsState->Abbreviation);
         }
         $this->txtHomeZipCode = new QTextBox($this->dlgAddress);
         $this->txtHomeZipCode->Required = true;
         $this->txtHomePhone = new PhoneTextBox($this->dlgAddress);
         $this->txtHomePhone->Name = 'Home Phone';
         $this->rblMailingAddress = new QRadioButtonList($this->dlgAddress);
         $this->rblMailingAddress->Name = 'Separate Mailing Address?';
         $this->rblMailingAddress->AddItem('Yes, please use my separate mailing address', true);
         $this->rblMailingAddress->AddItem('No, I do not use a separate mailing address', false);
         $this->rblMailingAddress->AddAction(new QClickEvent(), new QAjaxAction('rblMailingAddress_Refresh'));
         $this->txtMailingAddress1 = new QTextBox($this->dlgAddress);
         $this->txtMailingAddress1->Name = 'Mailing Address 1';
         $this->txtMailingAddress1->Required = true;
         $this->txtMailingAddress2 = new QTextBox($this->dlgAddress);
         $this->txtMailingAddress2->Name = 'Mailing Address 2';
         $this->txtMailingCity = new QTextBox($this->dlgAddress);
         $this->txtMailingCity->Name = 'Mailing City, State, Zip';
         $this->txtMailingCity->Required = true;
         $this->lstMailingState = new QListBox($this->dlgAddress);
         $this->lstMailingState->AddItem(QApplication::Translate('- Select One -'), null);
         $this->lstMailingState->Required = true;
         foreach (UsState::LoadAll(QQ::OrderBy(QQN::UsState()->Name)) as $objUsState) {
             $this->lstMailingState->AddItem($objUsState->Name, $objUsState->Abbreviation);
         }
         $this->txtMailingZipCode = new QTextBox($this->dlgAddress);
         $this->txtMailingZipCode->Required = true;
     }
     $objHouseholdArray = array();
     foreach (QApplication::$PublicLogin->Person->GetHouseholdParticipationArray() as $objParticipation) {
         $objHouseholdArray[] = $objParticipation->Household;
     }
     if (count($objHouseholdArray) > 1) {
         return;
     }
     if (count($objHouseholdArray) == 1) {
         $objAddress = $objHouseholdArray[0]->GetCurrentAddress();
         if (!$objAddress) {
             $objAddress = new Address();
         }
         $this->txtHomeAddress1->Text = $objAddress->Address1;
         $this->txtHomeAddress2->Text = $objAddress->Address2;
         $this->txtHomeCity->Text = $objAddress->City;
         $this->lstHomeState->SelectedValue = $objAddress->State;
         $this->txtHomeZipCode->Text = $objAddress->ZipCode;
         if (count($objPhoneArray = $objAddress->GetPhoneArray())) {
             $this->txtHomePhone->Text = $objPhoneArray[0]->Number;
         }
     }
     if (QApplication::$PublicLogin->Person->MailingAddress && !QApplication::$PublicLogin->Person->MailingAddress->Household) {
         $this->rblMailingAddress->SelectedValue = true;
         $objAddress = QApplication::$PublicLogin->Person->MailingAddress;
         $this->txtMailingAddress1->Text = $objAddress->Address1;
         $this->txtMailingAddress2->Text = $objAddress->Address2;
         $this->txtMailingCity->Text = $objAddress->City;
         $this->lstMailingState->SelectedValue = $objAddress->State;
         $this->txtMailingZipCode->Text = $objAddress->ZipCode;
     } else {
         $this->rblMailingAddress->SelectedValue = false;
     }
     $this->btnAddressUpdate->ActionParameter = 1;
     $this->btnAddressCancel->ActionParameter = 1;
     $this->dlgAddress->ShowDialogBox();
     $this->dlgAddress->Template = dirname(__FILE__) . '/dlgAddress.inc.php';
     $this->rblMailingAddress_Refresh();
 }
开发者ID:alcf,项目名称:chms,代码行数:81,代码来源:index.php

示例3: ResolveContentItem

 /**
  * Used internally by the Meta-based Add Column tools.
  *
  * Given a QQNode or a Text String, this will return a UsState-based QQNode.
  * It will also verify that it is a proper UsState-based QQNode, and will throw an exception otherwise.
  *
  * @param mixed $mixContent
  * @return QQNode
  */
 protected function ResolveContentItem($mixContent)
 {
     if ($mixContent instanceof QQNode) {
         if (!$mixContent->_ParentNode) {
             throw new QCallerException('Content QQNode cannot be a Top Level Node');
         }
         if ($mixContent->_RootTableName == 'us_state') {
             if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             }
             $objCurrentNode = $mixContent;
             while ($objCurrentNode = $objCurrentNode->_ParentNode) {
                 if (!$objCurrentNode instanceof QQNode) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
                 if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
                     throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
                 }
             }
             return $mixContent;
         } else {
             throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "us_state".');
         }
     } else {
         if (is_string($mixContent)) {
             switch ($mixContent) {
                 case 'Id':
                     return QQN::UsState()->Id;
                 case 'Name':
                     return QQN::UsState()->Name;
                 case 'Abbreviation':
                     return QQN::UsState()->Abbreviation;
                 default:
                     throw new QCallerException('Simple Property not found in UsStateDataGrid content: ' . $mixContent);
             }
         } else {
             if ($mixContent instanceof QQAssociationNode) {
                 throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
             } else {
                 throw new QCallerException('Invalid Content type');
             }
         }
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:53,代码来源:UsStateDataGridGen.class.php

示例4: LoadByAbbreviation

 /**
  * Load a single UsState object,
  * by Abbreviation Index(es)
  * @param string $strAbbreviation
  * @return UsState
  */
 public static function LoadByAbbreviation($strAbbreviation, $objOptionalClauses = null)
 {
     return UsState::QuerySingle(QQ::Equal(QQN::UsState()->Abbreviation, $strAbbreviation), $objOptionalClauses);
 }
开发者ID:alcf,项目名称:chms,代码行数:10,代码来源:UsStateGen.class.php

示例5: pnlDetailsMain_Setup

 protected function pnlDetailsMain_Setup()
 {
     $this->lblUsername = new QLabel($this->pnlDetailsMain);
     $this->lblUsername->Name = 'Username';
     $this->lblUsername->Text = QApplication::$PublicLogin->Username;
     $this->lblName = new QLabel($this->pnlDetailsMain);
     $this->lblName->Name = 'Name';
     $this->lblName->Text = QApplication::$PublicLogin->ProvisionalPublicLogin->FirstName . ' ' . QApplication::$PublicLogin->ProvisionalPublicLogin->LastName;
     $this->lblEmail = new QLabel($this->pnlDetailsMain);
     $this->lblEmail->Name = 'Email Address';
     $this->lblEmail->Text = QApplication::$PublicLogin->ProvisionalPublicLogin->EmailAddress;
     $this->txtPassword = new QTextBox($this->pnlDetailsMain);
     $this->txtPassword->Name = 'Select a Password';
     $this->txtPassword->Required = true;
     $this->txtPassword->TextMode = QTextMode::Password;
     $this->txtPassword->Instructions = 'At least 6 characters long';
     $this->txtConfirmPassword = new QTextBox($this->pnlDetailsMain);
     $this->txtConfirmPassword->Name = 'Confirm Password';
     $this->txtConfirmPassword->Instructions = 'Must match above';
     $this->txtConfirmPassword->Required = true;
     $this->txtConfirmPassword->TextMode = QTextMode::Password;
     $this->lstQuestion = new QListBox($this->pnlDetailsMain);
     $this->lstQuestion->Name = '"Forgot Password" Question';
     $this->lstQuestion->AddItem('- Select One -', null);
     $this->lstQuestion->AddItem('What city were you born in?', 'What city were you born in?');
     $this->lstQuestion->AddItem('What is the name of your elementary school?', 'What is the name of your elementary school?');
     $this->lstQuestion->AddItem('What street did you grow up on?', 'What street did you grow up on?');
     $this->lstQuestion->AddItem('What is the name of your pet?', 'What is the name of your pet?');
     $this->lstQuestion->AddItem('What was the make and model of your first car?', 'What was the make and model of your first car?');
     $this->lstQuestion->AddItem('- Other... -', false);
     $this->lstQuestion->Required = true;
     $this->lstQuestion->AddAction(new QChangeEvent(), new QAjaxAction('lstQuestion_Refresh'));
     $this->txtQuestion = new QTextBox($this->pnlDetailsMain);
     $this->txtAnswer = new QTextBox($this->pnlDetailsMain);
     $this->txtAnswer->Name = 'Your Answer';
     $this->txtAnswer->Required = true;
     $this->lstQuestion_Refresh();
     $this->txtHomeAddress1 = new QTextBox($this->pnlDetailsMain);
     $this->txtHomeAddress1->Name = 'Home Address 1';
     $this->txtHomeAddress1->Required = true;
     $this->txtHomeAddress2 = new QTextBox($this->pnlDetailsMain);
     $this->txtHomeAddress2->Name = 'Home Address 2';
     $this->txtHomeCity = new QTextBox($this->pnlDetailsMain);
     $this->txtHomeCity->Name = 'Home City, State, Zip';
     $this->txtHomeCity->Required = true;
     $this->lstHomeState = new QListBox($this->pnlDetailsMain);
     $this->lstHomeState->AddItem(QApplication::Translate('- Select One -'), null);
     $this->lstHomeState->Required = true;
     foreach (UsState::LoadAll(QQ::OrderBy(QQN::UsState()->Name)) as $objUsState) {
         $this->lstHomeState->AddItem($objUsState->Name, $objUsState->Abbreviation);
     }
     $this->txtHomeZipCode = new QTextBox($this->pnlDetailsMain);
     $this->txtHomeZipCode->Required = true;
     $this->rblMailingAddress = new QRadioButtonList($this->pnlDetailsMain);
     $this->rblMailingAddress->Name = 'Separate Mailing Address?';
     $this->rblMailingAddress->AddItem('Yes, please use my separate mailing address', true);
     $this->rblMailingAddress->AddItem('No, I do not use a separate mailing address', false, true);
     $this->rblMailingAddress->AddAction(new QClickEvent(), new QAjaxAction('rblMailingAddress_Refresh'));
     $this->txtMailingAddress1 = new QTextBox($this->pnlDetailsMain);
     $this->txtMailingAddress1->Name = 'Mailing Address 1';
     $this->txtMailingAddress1->Required = true;
     $this->txtMailingAddress2 = new QTextBox($this->pnlDetailsMain);
     $this->txtMailingAddress2->Name = 'Mailing Address 2';
     $this->txtMailingCity = new QTextBox($this->pnlDetailsMain);
     $this->txtMailingCity->Name = 'Mailing City, State, Zip';
     $this->txtMailingCity->Required = true;
     $this->lstMailingState = new QListBox($this->pnlDetailsMain);
     $this->lstMailingState->AddItem(QApplication::Translate('- Select One -'), null);
     $this->lstMailingState->Required = true;
     foreach (UsState::LoadAll(QQ::OrderBy(QQN::UsState()->Name)) as $objUsState) {
         $this->lstMailingState->AddItem($objUsState->Name, $objUsState->Abbreviation);
     }
     $this->txtMailingZipCode = new QTextBox($this->pnlDetailsMain);
     $this->txtMailingZipCode->Required = true;
     $this->rblMailingAddress_Refresh();
     $this->dtxDateOfBirth = new QDateTimeTextBox($this->pnlDetailsMain);
     $this->dtxDateOfBirth->Name = 'Date of Birth';
     $this->calDateOfBirth = new QCalendar($this->dtxDateOfBirth, $this->dtxDateOfBirth);
     $this->dtxDateOfBirth->RemoveAllActions(QClickEvent::EventName);
     $this->rblGender = new QRadioButtonList($this->pnlDetailsMain);
     $this->rblGender->AddItem('Male', 'M');
     $this->rblGender->AddItem('Female', 'F');
     $this->rblGender->Name = 'Gender';
     $this->rblGender->RepeatColumns = 2;
     $this->chkBulkEmail = new QCheckBox($this->pnlDetailsMain);
     $this->chkBulkEmail->Name = 'ALCF Email Announcements';
     $this->chkBulkEmail->Text = 'Check to be included on any general ALCF or church-wide email announcements';
     $this->chkBulkEmail->HtmlEntities = false;
     $this->chkBulkEmail->Checked = true;
     $this->txtHomePhone = new PhoneTextBox($this->pnlDetailsMain);
     $this->txtHomePhone->Name = 'Home Phone';
     $this->txtMobilePhone = new PhoneTextBox($this->pnlDetailsMain);
     $this->txtMobilePhone->Name = 'Mobile Phone';
     $this->btnConfirm = new QButton($this->pnlDetailsMain);
     $this->btnConfirm->Text = 'Confirm Registration';
     $this->btnConfirm->CausesValidation = true;
     $this->btnConfirm->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnConfirm));
     $this->btnConfirm->AddAction(new QClickEvent(), new QAjaxAction('btnConfirm_Click'));
     $this->btnCancel = new QLinkButton($this->pnlDetailsMain);
     $this->btnCancel->Text = 'Cancel';
//.........这里部分代码省略.........
开发者ID:alcf,项目名称:chms,代码行数:101,代码来源:details.php

示例6: CreateFormItemControls


//.........这里部分代码省略.........
                         if (count($objHouseholdArray) == 1) {
                             $objAddress = $objHouseholdArray[0]->GetCurrentAddress();
                             $rblAddress = new QRadioButtonList($this, $strControlId . 'switch');
                             $rblAddress->Name = $objFormQuestion->Question;
                             $rblAddress->RenderMethod = 'RenderWithName';
                             $rblAddress->AddItem('Use Home Address Below', $objAddress->Id, true);
                             $rblAddress->AddItem('Edit Home Address', false, false);
                             $rblAddress->RepeatColumns = 2;
                             $rblAddress->AddAction(new QClickEvent(), new QAjaxAction('rblAddress_Change'));
                             $this->objFormQuestionControlArray[] = $rblAddress;
                         } else {
                             $objAddress = new Address();
                             $rblAddress = null;
                         }
                     }
                 }
                 $txtAddress1 = new QTextBox($this, $strControlId . 'address1');
                 $txtAddress1->Name = 'Address 1';
                 $txtAddress1->RenderMethod = 'RenderWithName';
                 $txtAddress1->Text = $objPerson != null ? $objAddress->Address1 : '';
                 $txtAddress2 = new QTextBox($this, $strControlId . 'address2');
                 $txtAddress2->Name = 'Address 2';
                 $txtAddress2->RenderMethod = 'RenderWithName';
                 $txtAddress2->Text = $objPerson != null ? $objAddress->Address2 : '';
                 $txtCity = new QTextBox($this, $strControlId . 'city');
                 $txtCity->Name = 'City, State and Zip';
                 $txtCity->RenderMethod = 'RenderWithName';
                 $txtCity->Text = $objPerson != null ? $objAddress->City : '';
                 $lstState = new QListBox($this, $strControlId . 'state');
                 $lstState->ActionParameter = '_' . $strControlId . 'city';
                 $lstState->Name = QApplication::Translate('State');
                 $lstState->RenderMethod = 'RenderWithError';
                 $lstState->AddItem(QApplication::Translate('- Select One -'), null);
                 foreach (UsState::LoadAll(QQ::OrderBy(QQN::UsState()->Name)) as $objUsState) {
                     if ($objPerson != null) {
                         $lstState->AddItem($objUsState->Name, $objUsState->Abbreviation, $objAddress->State == $objUsState->Abbreviation);
                     } else {
                         $lstState->AddItem($objUsState->Name, $objUsState->Abbreviation, false);
                     }
                 }
                 $txtZipCode = new QTextBox($this, $strControlId . 'zipcode');
                 $txtZipCode->ActionParameter = '_' . $strControlId . 'city';
                 $txtZipCode->Name = 'Zip Code';
                 $txtZipCode->RenderMethod = 'RenderWithError';
                 $txtZipCode->Text = $objPerson != null ? $objAddress->ZipCode : '';
                 $txtZipCode->Width = '80px';
                 if ($objFormQuestion->RequiredFlag) {
                     $txtAddress1->Required = true;
                     $txtCity->Required = true;
                     $lstState->Required = true;
                     $txtZipCode->Required = true;
                 }
                 $this->objFormQuestionControlArray[] = $txtAddress1;
                 $this->objFormQuestionControlArray[] = $txtAddress2;
                 $this->objFormQuestionControlArray[] = $txtCity;
                 $this->objFormQuestionControlArray[] = $lstState;
                 $this->objFormQuestionControlArray[] = $txtZipCode;
                 // Final configuration based on whether or not we've got a household record for this person
                 // (in which case we have defined a rblAddress)
                 if ($objPerson != null) {
                     if ($rblAddress) {
                         // Check to see if the question has been answered before
                         if ($objFormAnswer && strlen($objFormAnswer->TextValue)) {
                             // If it
                             $objAddress = Address::DeduceAddressFromFullLine($objFormAnswer->TextValue);
                             if ($objFormAnswer->AddressId == $rblAddress->SelectedValue || !$objAddress) {
开发者ID:alcf,项目名称:chms,代码行数:67,代码来源:SignupQForm.class.php

示例7: __construct

 public function __construct($objParentObject, $strControlId = null, Address $objAddress = null, $strFirstName = null, $strLastName = null)
 {
     parent::__construct($objParentObject, $strControlId);
     $this->strTemplate = dirname(__FILE__) . '/PaymentPanel.tpl.php';
     if (!$objAddress) {
         $objAddress = new Address();
     }
     $this->txtFirstName = new QTextBox($this);
     $this->txtFirstName->Name = 'Cardholder Name';
     $this->txtFirstName->Required = true;
     $this->txtFirstName->Text = $strFirstName;
     $this->txtFirstName->Width = '120px';
     $this->txtLastName = new QTextBox($this);
     $this->txtLastName->Name = 'Cardholder Last Name';
     $this->txtLastName->Required = true;
     $this->txtLastName->Text = $strLastName;
     $this->txtLastName->Width = '120px';
     $this->txtAddress1 = new QTextBox($this);
     $this->txtAddress1->Name = 'Address 1';
     $this->txtAddress1->Text = $objAddress->Address1;
     $this->txtAddress1->Required = true;
     $this->txtAddress2 = new QTextBox($this);
     $this->txtAddress2->Name = 'Address 2';
     $this->txtAddress2->Text = $objAddress->Address2;
     $this->txtCity = new QTextBox($this);
     $this->txtCity->Name = 'City, State and Zip';
     $this->txtCity->Text = $objAddress->City;
     $this->txtCity->Required = true;
     $this->lstState = new QListBox($this);
     $this->lstState->Name = QApplication::Translate('State');
     $this->lstState->AddItem(QApplication::Translate('- Select One -'), null);
     foreach (UsState::LoadAll(QQ::OrderBy(QQN::UsState()->Name)) as $objUsState) {
         $this->lstState->AddItem($objUsState->Name, $objUsState->Abbreviation, $objAddress->State == $objUsState->Abbreviation);
     }
     $this->lstState->Required = true;
     $this->txtZipCode = new QTextBox($this);
     $this->txtZipCode->Name = 'Zip Code';
     $this->txtZipCode->Text = $objAddress->ZipCode;
     $this->txtZipCode->Width = '80px';
     $this->txtZipCode->Required = true;
     $this->lstCcType = new QListBox($this);
     $this->lstCcType->Name = 'Credit Card';
     $this->lstCcType->Required = true;
     $this->lstCcType->AddItem('- Select One -');
     foreach (CreditCardType::$NameArray as $intId => $strName) {
         $this->lstCcType->AddItem($strName, $intId);
     }
     $this->txtCcNumber = new QTextBox($this);
     $this->txtCcNumber->Name = 'Account Number';
     $this->txtCcNumber->Required = true;
     $this->txtCcNumber->MaxLength = 16;
     $this->lstCcExpMonth = new QListBox($this);
     $this->lstCcExpMonth->Name = 'Expiration Date';
     $this->lstCcExpMonth->Required = true;
     $this->lstCcExpMonth->AddItem('- Select One -');
     for ($intMonth = 1; $intMonth <= 12; $intMonth++) {
         $strMonth = date('F', mktime(0, 0, 0, $intMonth, 1, 2000));
         $this->lstCcExpMonth->AddItem(sprintf('%02s - %s', $intMonth, $strMonth), $intMonth);
     }
     $this->lstCcExpYear = new QListBox($this);
     $this->lstCcExpYear->Required = true;
     $this->lstCcExpYear->AddItem('---');
     for ($intYear = 0; $intYear <= 11; $intYear++) {
         $intYearToUse = date('Y') + $intYear;
         $this->lstCcExpYear->AddItem($intYearToUse, $intYearToUse);
     }
     $this->txtCcCsc = new QTextBox($this);
     $this->txtCcCsc->Name = 'Security Code (CSC/CVV2)';
     $this->txtCcCsc->Required = true;
     $this->txtCcCsc->Width = '80px';
     $this->txtCcCsc->MinLength = 3;
     $this->txtCcCsc->MaxLength = 4;
     $this->dlgDialogBox = new QDialogBox($this);
     $this->dlgDialogBox->MatteClickable = false;
     $this->dlgDialogBox->Display = false;
     $this->dlgDialogBox->Template = dirname(__FILE__) . '/PaymentPanel_DialogBox.tpl.php';
     $this->btnDialogBoxOkay = new QButton($this->dlgDialogBox);
     $this->btnDialogBoxOkay->Text = 'Try Again';
     $this->btnDialogBoxOkay->CssClass = 'primary';
     $this->btnDialogBoxOkay->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDialogBoxOkay_Click'));
     $this->btnDialogBoxOkay->Visible = false;
     $this->lblDialogBoxMessage = new QLabel($this->dlgDialogBox);
     $this->lblDialogBoxMessage->HtmlEntities = false;
     $this->lblDialogBoxMessage->Text = '<h4>Please Wait...</h4>We are processing your credit card.  We appreciate your patience!<br/><br/><img src="/assets/images/cc_processing.gif"/>';
     $this->btnSubmit = new QButton($this);
     $this->btnSubmit->CausesValidation = true;
     $this->btnSubmit->CssClass = 'primary';
     $this->btnSubmit->Text = 'Submit';
     $this->btnSubmit->AddAction(new QClickEvent(), new QConfirmAction('By proceeding, your credit card will be charged for the amount shown.  Are you SURE you wish to proceed?'));
     $this->btnSubmit->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnSubmit));
     $this->btnSubmit->AddAction(new QClickEvent(), new QShowDialogBox($this->dlgDialogBox));
     $this->btnSubmit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSubmit_Click'));
 }
开发者ID:alcf,项目名称:chms,代码行数:93,代码来源:PaymentPanel.class.php

示例8: __construct

 public function __construct($objParentObject, $strControlId = null, Address $objAddress = null, $strFirstName = null, $strLastName = null, RecurringPayments $objRecurringPayment = null)
 {
     parent::__construct($objParentObject, $strControlId);
     $this->strTemplate = dirname(__FILE__) . '/RecurringPaymentPanel.tpl.php';
     if (!$objAddress) {
         $objAddress = new Address();
     }
     $this->txtFirstName = new QTextBox($this);
     $this->txtFirstName->Name = 'Cardholder Name';
     $this->txtFirstName->Required = true;
     $this->txtFirstName->Text = $strFirstName;
     $this->txtFirstName->Width = '120px';
     $this->txtLastName = new QTextBox($this);
     $this->txtLastName->Name = 'Cardholder Last Name';
     $this->txtLastName->Required = true;
     $this->txtLastName->Text = $strLastName;
     $this->txtLastName->Width = '120px';
     QCryptography::$Key = CRYPTO_KEY;
     $objCrypto = new QCryptography(null, false);
     if ($objRecurringPayment) {
         $strOriginal = $objCrypto->Decrypt($objRecurringPayment->CardHolderName);
         $nameArray = explode(' ', $strOriginal);
         $this->txtFirstName->Text = $nameArray[0];
         $this->txtLastName->Text = $nameArray[1];
     }
     $this->txtAddress1 = new QTextBox($this);
     $this->txtAddress1->Name = 'Address 1';
     if (!$objRecurringPayment) {
         $this->txtAddress1->Text = $objAddress->Address1;
     } else {
         $this->txtAddress1->Text = $objCrypto->Decrypt($objRecurringPayment->Address1);
     }
     $this->txtAddress1->Required = true;
     $this->txtAddress2 = new QTextBox($this);
     $this->txtAddress2->Name = 'Address 2';
     if (!$objRecurringPayment) {
         $this->txtAddress2->Text = $objAddress->Address2;
     } else {
         $this->txtAddress2->Text = $objCrypto->Decrypt($objRecurringPayment->Address2);
     }
     $this->txtCity = new QTextBox($this);
     $this->txtCity->Name = 'City, State and Zip';
     if (!$objRecurringPayment) {
         $this->txtCity->Text = $objAddress->City;
     } else {
         $this->txtCity->Text = $objCrypto->Decrypt($objRecurringPayment->City);
     }
     $this->txtCity->Required = true;
     $this->lstState = new QListBox($this);
     $this->lstState->Name = QApplication::Translate('State');
     $this->lstState->AddItem(QApplication::Translate('- Select One -'), null);
     foreach (UsState::LoadAll(QQ::OrderBy(QQN::UsState()->Name)) as $objUsState) {
         $this->lstState->AddItem($objUsState->Name, $objUsState->Abbreviation, $objAddress->State == $objUsState->Abbreviation);
     }
     $this->lstState->Required = true;
     $this->txtZipCode = new QTextBox($this);
     $this->txtZipCode->Name = 'Zip Code';
     if (!$objRecurringPayment) {
         $this->txtZipCode->Text = $objAddress->ZipCode;
     } else {
         $this->txtZipCode->Text = $objCrypto->Decrypt($objRecurringPayment->Zip);
     }
     $this->txtZipCode->Width = '80px';
     $this->txtZipCode->Required = true;
     $this->lstCcType = new QListBox($this);
     $this->lstCcType->Name = 'Credit Card';
     $this->lstCcType->Required = true;
     $this->lstCcType->AddItem('- Select One -');
     foreach (CreditCardType::$NameArray as $intId => $strName) {
         if ($objRecurringPayment) {
             $this->lstCcType->AddItem($strName, $intId, $objRecurringPayment->CreditCardTypeId == $intId);
         } else {
             $this->lstCcType->AddItem($strName, $intId);
         }
     }
     $this->txtCcNumber = new QTextBox($this);
     $this->txtCcNumber->Name = 'Account Number';
     $this->txtCcNumber->Required = true;
     $this->txtCcNumber->MaxLength = 16;
     if ($objRecurringPayment) {
         $this->txtCcNumber->Text = $objCrypto->Decrypt($objRecurringPayment->AccountNumber);
         $objExpirationDate = $objRecurringPayment->ExpirationDate;
         //$objCrypto->Decrypt($objRecurringPayment->ExpirationDate);
         $intSelectedMonth = substr($objExpirationDate, 0, 2);
         $intSelectedYear = substr($objExpirationDate, 2, 2);
     }
     $this->lstCcExpMonth = new QListBox($this);
     $this->lstCcExpMonth->Name = 'Expiration Date';
     $this->lstCcExpMonth->Required = true;
     $this->lstCcExpMonth->AddItem('- Select One -');
     for ($intMonth = 1; $intMonth <= 12; $intMonth++) {
         $strMonth = date('F', mktime(0, 0, 0, $intMonth, 1, 2000));
         if (!$objRecurringPayment) {
             $this->lstCcExpMonth->AddItem(sprintf('%02s - %s', $intMonth, $strMonth), $intMonth);
         } else {
             $this->lstCcExpMonth->AddItem(sprintf('%02s - %s', $intMonth, $strMonth), $intMonth, $intSelectedMonth == $intMonth);
         }
     }
     $this->lstCcExpYear = new QListBox($this);
     $this->lstCcExpYear->Required = true;
//.........这里部分代码省略.........
开发者ID:alcf,项目名称:chms,代码行数:101,代码来源:RecurringPaymentPanel.class.php


注:本文中的QQN::UsState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。