本文整理汇总了PHP中Address::LoadAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Address::LoadAll方法的具体用法?PHP Address::LoadAll怎么用?PHP Address::LoadAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Address
的用法示例。
在下文中一共展示了Address::LoadAll方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lstCompany_Change
public function lstCompany_Change()
{
// Clear out the items from lstAddress
$this->lstAddress->RemoveAllItems();
if ($this->lstCompany->SelectedValue) {
// Load the selected company
$objCompany = Company::Load($this->lstCompany->SelectedValue);
// Get all available addresses for that company
if ($objCompany) {
$objAddressArray = $objCompany->GetAddressArray();
$this->lstAddress->Enabled = true;
} else {
$objAddressArray = null;
$this->lstAddress->Enabled = false;
}
} else {
// Or load all addresses for all companies
$objAddressArray = Address::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Address()->ShortDescription)));
$this->lstAddress->Enabled = true;
}
$this->lstAddress->AddItem('- Select One -', null);
if ($objAddressArray) {
foreach ($objAddressArray as $objAddress) {
$objListItem = new QListItem($objAddress->__toString(), $objAddress->AddressId);
$this->lstAddress->AddItem($objListItem);
}
}
}
示例2: lstToAddress_Create
protected function lstToAddress_Create()
{
$this->lstToAddress = new QListBox($this);
$this->lstToAddress->Name = QApplication::Translate('To Address');
$this->lstToAddress->Required = true;
if (!$this->blnEditMode) {
$this->lstToAddress->AddItem(QApplication::Translate('- Select One -'), null);
}
$objToAddressArray = Address::LoadAll();
if ($objToAddressArray) {
foreach ($objToAddressArray as $objToAddress) {
$objListItem = new QListItem($objToAddress->__toString(), $objToAddress->AddressId);
if ($this->objShipment->ToAddress && $this->objShipment->ToAddress->AddressId == $objToAddress->AddressId) {
$objListItem->Selected = true;
}
$this->lstToAddress->AddItem($objListItem);
}
}
}
示例3: Refresh
/**
* Refresh this MetaControl with Data from the local Shipment object.
* @param boolean $blnReload reload Shipment from the database
* @return void
*/
public function Refresh($blnReload = false)
{
if ($blnReload) {
$this->objShipment->Reload();
}
if ($this->lblShipmentId) {
if ($this->blnEditMode) {
$this->lblShipmentId->Text = $this->objShipment->ShipmentId;
}
}
if ($this->txtShipmentNumber) {
$this->txtShipmentNumber->Text = $this->objShipment->ShipmentNumber;
}
if ($this->lblShipmentNumber) {
$this->lblShipmentNumber->Text = $this->objShipment->ShipmentNumber;
}
if ($this->lstTransaction) {
$this->lstTransaction->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstTransaction->AddItem(QApplication::Translate('- Select One -'), null);
}
$objTransactionArray = Transaction::LoadAll();
if ($objTransactionArray) {
foreach ($objTransactionArray as $objTransaction) {
$objListItem = new QListItem($objTransaction->__toString(), $objTransaction->TransactionId);
if ($this->objShipment->Transaction && $this->objShipment->Transaction->TransactionId == $objTransaction->TransactionId) {
$objListItem->Selected = true;
}
$this->lstTransaction->AddItem($objListItem);
}
}
}
if ($this->lblTransactionId) {
$this->lblTransactionId->Text = $this->objShipment->Transaction ? $this->objShipment->Transaction->__toString() : null;
}
if ($this->lstFromCompany) {
$this->lstFromCompany->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstFromCompany->AddItem(QApplication::Translate('- Select One -'), null);
}
$objFromCompanyArray = Company::LoadAll();
if ($objFromCompanyArray) {
foreach ($objFromCompanyArray as $objFromCompany) {
$objListItem = new QListItem($objFromCompany->__toString(), $objFromCompany->CompanyId);
if ($this->objShipment->FromCompany && $this->objShipment->FromCompany->CompanyId == $objFromCompany->CompanyId) {
$objListItem->Selected = true;
}
$this->lstFromCompany->AddItem($objListItem);
}
}
}
if ($this->lblFromCompanyId) {
$this->lblFromCompanyId->Text = $this->objShipment->FromCompany ? $this->objShipment->FromCompany->__toString() : null;
}
if ($this->lstFromContact) {
$this->lstFromContact->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstFromContact->AddItem(QApplication::Translate('- Select One -'), null);
}
$objFromContactArray = Contact::LoadAll();
if ($objFromContactArray) {
foreach ($objFromContactArray as $objFromContact) {
$objListItem = new QListItem($objFromContact->__toString(), $objFromContact->ContactId);
if ($this->objShipment->FromContact && $this->objShipment->FromContact->ContactId == $objFromContact->ContactId) {
$objListItem->Selected = true;
}
$this->lstFromContact->AddItem($objListItem);
}
}
}
if ($this->lblFromContactId) {
$this->lblFromContactId->Text = $this->objShipment->FromContact ? $this->objShipment->FromContact->__toString() : null;
}
if ($this->lstFromAddress) {
$this->lstFromAddress->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstFromAddress->AddItem(QApplication::Translate('- Select One -'), null);
}
$objFromAddressArray = Address::LoadAll();
if ($objFromAddressArray) {
foreach ($objFromAddressArray as $objFromAddress) {
$objListItem = new QListItem($objFromAddress->__toString(), $objFromAddress->AddressId);
if ($this->objShipment->FromAddress && $this->objShipment->FromAddress->AddressId == $objFromAddress->AddressId) {
$objListItem->Selected = true;
}
$this->lstFromAddress->AddItem($objListItem);
}
}
}
if ($this->lblFromAddressId) {
$this->lblFromAddressId->Text = $this->objShipment->FromAddress ? $this->objShipment->FromAddress->__toString() : null;
}
if ($this->lstToCompany) {
$this->lstToCompany->RemoveAllItems();
if (!$this->blnEditMode) {
//.........这里部分代码省略.........
示例4: lstAddress_Create
protected function lstAddress_Create()
{
$this->lstAddress = new QListBox($this);
$this->lstAddress->Name = QApplication::Translate('Address');
$this->lstAddress->AddItem(QApplication::Translate('- Select One -'), null);
$objAddressArray = Address::LoadAll();
if ($objAddressArray) {
foreach ($objAddressArray as $objAddress) {
$objListItem = new QListItem($objAddress->__toString(), $objAddress->AddressId);
if ($this->objCompany->Address && $this->objCompany->Address->AddressId == $objAddress->AddressId) {
$objListItem->Selected = true;
}
$this->lstAddress->AddItem($objListItem);
}
}
}
示例5: ini_set
<?php
ini_set('memory_limit', '1024M');
$objMySqli = new mysqli('localhost', 'root', '', 'alcf_address');
QDataGen::DisplayForEachTaskStart('Cleaning Addresses', Address::CountAll());
foreach (Address::LoadAll() as $objAddress) {
QDataGen::DisplayForEachTaskNext('Cleaning Addresses');
$strQuery = sprintf("SELECT id FROM address WHERE address_1 %s AND address_2 %s AND address_3 %s AND city %s AND state %s AND zip_code %s;", is_null($objAddress->Address1) ? 'IS NULL' : "='" . $objMySqli->escape_string($objAddress->Address1) . "'", is_null($objAddress->Address2) ? 'IS NULL' : "='" . $objMySqli->escape_string($objAddress->Address2) . "'", is_null($objAddress->Address3) ? 'IS NULL' : "='" . $objMySqli->escape_string($objAddress->Address3) . "'", is_null($objAddress->City) ? 'IS NULL' : "='" . $objMySqli->escape_string($objAddress->City) . "'", is_null($objAddress->State) ? 'IS NULL' : "='" . $objMySqli->escape_string($objAddress->State) . "'", is_null($objAddress->ZipCode) ? 'IS NULL' : "='" . $objMySqli->escape_string($objAddress->ZipCode) . "'");
$objResult = $objMySqli->Query($strQuery);
if ($objRow = $objResult->fetch_array()) {
$objResult = $objMySqli->Query('SELECT * FROM corrected_address WHERE address_id=' . $objRow['id']);
$objRow = $objResult->fetch_array();
if ($objRow['status_flag'] == 1) {
$objAddress->Address1 = $objRow['address_1'];
$objAddress->Address2 = $objRow['address_2'];
$objAddress->City = $objRow['city'];
$objAddress->State = $objRow['state'];
$objAddress->ZipCode = $objRow['zip_code'];
$objAddress->InvalidFlag = false;
$objAddress->VerificationCheckedFlag = true;
} else {
$objAddress->InvalidFlag = true;
}
$objAddress->Save();
} else {
if (!$objAddress->ValidateUsps()) {
print "NONE FOUND FOR - " . $objAddress->Id . "\r\n";
$objAddress->InvalidFlag = true;
$objAddress->Save();
}
}
示例6: dtgAddress_Bind
protected function dtgAddress_Bind()
{
// Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll()
// Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
$this->dtgAddress->TotalItemCount = Address::CountAll();
// Setup the $objClauses Array
$objClauses = array();
// If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
// the OrderByClause to the $objClauses array
if ($objClause = $this->dtgAddress->OrderByClause) {
array_push($objClauses, $objClause);
}
// Add the LimitClause information, as well
if ($objClause = $this->dtgAddress->LimitClause) {
array_push($objClauses, $objClause);
}
// Set the DataSource to be the array of all Address objects, given the clauses above
$this->dtgAddress->DataSource = Address::LoadAll($objClauses);
}
示例7: Refresh
/**
* Refresh this MetaControl with Data from the local Contact object.
* @param boolean $blnReload reload Contact from the database
* @return void
*/
public function Refresh($blnReload = false)
{
if ($blnReload) {
$this->objContact->Reload();
}
if ($this->lblContactId) {
if ($this->blnEditMode) {
$this->lblContactId->Text = $this->objContact->ContactId;
}
}
if ($this->lstCompany) {
$this->lstCompany->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstCompany->AddItem(QApplication::Translate('- Select One -'), null);
}
$objCompanyArray = Company::LoadAll();
if ($objCompanyArray) {
foreach ($objCompanyArray as $objCompany) {
$objListItem = new QListItem($objCompany->__toString(), $objCompany->CompanyId);
if ($this->objContact->Company && $this->objContact->Company->CompanyId == $objCompany->CompanyId) {
$objListItem->Selected = true;
}
$this->lstCompany->AddItem($objListItem);
}
}
}
if ($this->lblCompanyId) {
$this->lblCompanyId->Text = $this->objContact->Company ? $this->objContact->Company->__toString() : null;
}
if ($this->lstAddress) {
$this->lstAddress->RemoveAllItems();
$this->lstAddress->AddItem(QApplication::Translate('- Select One -'), null);
$objAddressArray = Address::LoadAll();
if ($objAddressArray) {
foreach ($objAddressArray as $objAddress) {
$objListItem = new QListItem($objAddress->__toString(), $objAddress->AddressId);
if ($this->objContact->Address && $this->objContact->Address->AddressId == $objAddress->AddressId) {
$objListItem->Selected = true;
}
$this->lstAddress->AddItem($objListItem);
}
}
}
if ($this->lblAddressId) {
$this->lblAddressId->Text = $this->objContact->Address ? $this->objContact->Address->__toString() : null;
}
if ($this->txtFirstName) {
$this->txtFirstName->Text = $this->objContact->FirstName;
}
if ($this->lblFirstName) {
$this->lblFirstName->Text = $this->objContact->FirstName;
}
if ($this->txtLastName) {
$this->txtLastName->Text = $this->objContact->LastName;
}
if ($this->lblLastName) {
$this->lblLastName->Text = $this->objContact->LastName;
}
if ($this->txtTitle) {
$this->txtTitle->Text = $this->objContact->Title;
}
if ($this->lblTitle) {
$this->lblTitle->Text = $this->objContact->Title;
}
if ($this->txtEmail) {
$this->txtEmail->Text = $this->objContact->Email;
}
if ($this->lblEmail) {
$this->lblEmail->Text = $this->objContact->Email;
}
if ($this->txtPhoneOffice) {
$this->txtPhoneOffice->Text = $this->objContact->PhoneOffice;
}
if ($this->lblPhoneOffice) {
$this->lblPhoneOffice->Text = $this->objContact->PhoneOffice;
}
if ($this->txtPhoneHome) {
$this->txtPhoneHome->Text = $this->objContact->PhoneHome;
}
if ($this->lblPhoneHome) {
$this->lblPhoneHome->Text = $this->objContact->PhoneHome;
}
if ($this->txtPhoneMobile) {
$this->txtPhoneMobile->Text = $this->objContact->PhoneMobile;
}
if ($this->lblPhoneMobile) {
$this->lblPhoneMobile->Text = $this->objContact->PhoneMobile;
}
if ($this->txtFax) {
$this->txtFax->Text = $this->objContact->Fax;
}
if ($this->lblFax) {
$this->lblFax->Text = $this->objContact->Fax;
}
if ($this->txtDescription) {
//.........这里部分代码省略.........
示例8: Refresh
/**
* Refresh this MetaControl with Data from the local FormAnswer object.
* @param boolean $blnReload reload FormAnswer from the database
* @return void
*/
public function Refresh($blnReload = false)
{
if ($blnReload) {
$this->objFormAnswer->Reload();
}
if ($this->lblId) {
if ($this->blnEditMode) {
$this->lblId->Text = $this->objFormAnswer->Id;
}
}
if ($this->lstSignupEntry) {
$this->lstSignupEntry->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstSignupEntry->AddItem(QApplication::Translate('- Select One -'), null);
}
$objSignupEntryArray = SignupEntry::LoadAll();
if ($objSignupEntryArray) {
foreach ($objSignupEntryArray as $objSignupEntry) {
$objListItem = new QListItem($objSignupEntry->__toString(), $objSignupEntry->Id);
if ($this->objFormAnswer->SignupEntry && $this->objFormAnswer->SignupEntry->Id == $objSignupEntry->Id) {
$objListItem->Selected = true;
}
$this->lstSignupEntry->AddItem($objListItem);
}
}
}
if ($this->lblSignupEntryId) {
$this->lblSignupEntryId->Text = $this->objFormAnswer->SignupEntry ? $this->objFormAnswer->SignupEntry->__toString() : null;
}
if ($this->lstFormQuestion) {
$this->lstFormQuestion->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstFormQuestion->AddItem(QApplication::Translate('- Select One -'), null);
}
$objFormQuestionArray = FormQuestion::LoadAll();
if ($objFormQuestionArray) {
foreach ($objFormQuestionArray as $objFormQuestion) {
$objListItem = new QListItem($objFormQuestion->__toString(), $objFormQuestion->Id);
if ($this->objFormAnswer->FormQuestion && $this->objFormAnswer->FormQuestion->Id == $objFormQuestion->Id) {
$objListItem->Selected = true;
}
$this->lstFormQuestion->AddItem($objListItem);
}
}
}
if ($this->lblFormQuestionId) {
$this->lblFormQuestionId->Text = $this->objFormAnswer->FormQuestion ? $this->objFormAnswer->FormQuestion->__toString() : null;
}
if ($this->txtTextValue) {
$this->txtTextValue->Text = $this->objFormAnswer->TextValue;
}
if ($this->lblTextValue) {
$this->lblTextValue->Text = $this->objFormAnswer->TextValue;
}
if ($this->lstAddress) {
$this->lstAddress->RemoveAllItems();
$this->lstAddress->AddItem(QApplication::Translate('- Select One -'), null);
$objAddressArray = Address::LoadAll();
if ($objAddressArray) {
foreach ($objAddressArray as $objAddress) {
$objListItem = new QListItem($objAddress->__toString(), $objAddress->Id);
if ($this->objFormAnswer->Address && $this->objFormAnswer->Address->Id == $objAddress->Id) {
$objListItem->Selected = true;
}
$this->lstAddress->AddItem($objListItem);
}
}
}
if ($this->lblAddressId) {
$this->lblAddressId->Text = $this->objFormAnswer->Address ? $this->objFormAnswer->Address->__toString() : null;
}
if ($this->lstPhone) {
$this->lstPhone->RemoveAllItems();
$this->lstPhone->AddItem(QApplication::Translate('- Select One -'), null);
$objPhoneArray = Phone::LoadAll();
if ($objPhoneArray) {
foreach ($objPhoneArray as $objPhone) {
$objListItem = new QListItem($objPhone->__toString(), $objPhone->Id);
if ($this->objFormAnswer->Phone && $this->objFormAnswer->Phone->Id == $objPhone->Id) {
$objListItem->Selected = true;
}
$this->lstPhone->AddItem($objListItem);
}
}
}
if ($this->lblPhoneId) {
$this->lblPhoneId->Text = $this->objFormAnswer->Phone ? $this->objFormAnswer->Phone->__toString() : null;
}
if ($this->lstEmail) {
$this->lstEmail->RemoveAllItems();
$this->lstEmail->AddItem(QApplication::Translate('- Select One -'), null);
$objEmailArray = Email::LoadAll();
if ($objEmailArray) {
foreach ($objEmailArray as $objEmail) {
$objListItem = new QListItem($objEmail->__toString(), $objEmail->Id);
//.........这里部分代码省略.........
示例9: dtgAddress_Bind
public function dtgAddress_Bind()
{
// Get Total Count b/c of Pagination
$this->dtgAddress->TotalItemCount = Address::CountAll();
$objClauses = array();
if ($objClause = $this->dtgAddress->OrderByClause) {
array_push($objClauses, $objClause);
}
if ($objClause = $this->dtgAddress->LimitClause) {
array_push($objClauses, $objClause);
}
$this->dtgAddress->DataSource = Address::LoadAll($objClauses);
}
示例10: Refresh
//.........这里部分代码省略.........
if ($this->chkDobYearApproximateFlag) {
$this->chkDobYearApproximateFlag->Checked = $this->objPerson->DobYearApproximateFlag;
}
if ($this->lblDobYearApproximateFlag) {
$this->lblDobYearApproximateFlag->Text = $this->objPerson->DobYearApproximateFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
}
if ($this->chkDobGuessedFlag) {
$this->chkDobGuessedFlag->Checked = $this->objPerson->DobGuessedFlag;
}
if ($this->lblDobGuessedFlag) {
$this->lblDobGuessedFlag->Text = $this->objPerson->DobGuessedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
}
if ($this->txtAge) {
$this->txtAge->Text = $this->objPerson->Age;
}
if ($this->lblAge) {
$this->lblAge->Text = $this->objPerson->Age;
}
if ($this->chkDeceasedFlag) {
$this->chkDeceasedFlag->Checked = $this->objPerson->DeceasedFlag;
}
if ($this->lblDeceasedFlag) {
$this->lblDeceasedFlag->Text = $this->objPerson->DeceasedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
}
if ($this->calDateDeceased) {
$this->calDateDeceased->DateTime = $this->objPerson->DateDeceased;
}
if ($this->lblDateDeceased) {
$this->lblDateDeceased->Text = sprintf($this->objPerson->DateDeceased) ? $this->objPerson->__toString($this->strDateDeceasedDateTimeFormat) : null;
}
if ($this->lstCurrentHeadShot) {
$this->lstCurrentHeadShot->RemoveAllItems();
$this->lstCurrentHeadShot->AddItem(QApplication::Translate('- Select One -'), null);
$objCurrentHeadShotArray = HeadShot::LoadAll();
if ($objCurrentHeadShotArray) {
foreach ($objCurrentHeadShotArray as $objCurrentHeadShot) {
$objListItem = new QListItem($objCurrentHeadShot->__toString(), $objCurrentHeadShot->Id);
if ($this->objPerson->CurrentHeadShot && $this->objPerson->CurrentHeadShot->Id == $objCurrentHeadShot->Id) {
$objListItem->Selected = true;
}
$this->lstCurrentHeadShot->AddItem($objListItem);
}
}
}
if ($this->lblCurrentHeadShotId) {
$this->lblCurrentHeadShotId->Text = $this->objPerson->CurrentHeadShot ? $this->objPerson->CurrentHeadShot->__toString() : null;
}
if ($this->lstMailingAddress) {
$this->lstMailingAddress->RemoveAllItems();
$this->lstMailingAddress->AddItem(QApplication::Translate('- Select One -'), null);
$objMailingAddressArray = Address::LoadAll();
if ($objMailingAddressArray) {
foreach ($objMailingAddressArray as $objMailingAddress) {
$objListItem = new QListItem($objMailingAddress->__toString(), $objMailingAddress->Id);
if ($this->objPerson->MailingAddress && $this->objPerson->MailingAddress->Id == $objMailingAddress->Id) {
$objListItem->Selected = true;
}
$this->lstMailingAddress->AddItem($objListItem);
}
}
}
if ($this->lblMailingAddressId) {
$this->lblMailingAddressId->Text = $this->objPerson->MailingAddress ? $this->objPerson->MailingAddress->__toString() : null;
}
if ($this->lstStewardshipAddress) {
$this->lstStewardshipAddress->RemoveAllItems();
示例11: Refresh
/**
* Refresh this MetaControl with Data from the local AddressCustomFieldHelper object.
* @param boolean $blnReload reload AddressCustomFieldHelper from the database
* @return void
*/
public function Refresh($blnReload = false)
{
if ($blnReload) {
$this->objAddressCustomFieldHelper->Reload();
}
if ($this->lstAddress) {
$this->lstAddress->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstAddress->AddItem(QApplication::Translate('- Select One -'), null);
}
$objAddressArray = Address::LoadAll();
if ($objAddressArray) {
foreach ($objAddressArray as $objAddress) {
$objListItem = new QListItem($objAddress->__toString(), $objAddress->AddressId);
if ($this->objAddressCustomFieldHelper->Address && $this->objAddressCustomFieldHelper->Address->AddressId == $objAddress->AddressId) {
$objListItem->Selected = true;
}
$this->lstAddress->AddItem($objListItem);
}
}
}
if ($this->lblAddressId) {
$this->lblAddressId->Text = $this->objAddressCustomFieldHelper->Address ? $this->objAddressCustomFieldHelper->Address->__toString() : null;
}
}
示例12: Refresh
/**
* Refresh this MetaControl with Data from the local Phone object.
* @param boolean $blnReload reload Phone from the database
* @return void
*/
public function Refresh($blnReload = false)
{
if ($blnReload) {
$this->objPhone->Reload();
}
if ($this->lblId) {
if ($this->blnEditMode) {
$this->lblId->Text = $this->objPhone->Id;
}
}
if ($this->lstPhoneType) {
$this->lstPhoneType->SelectedValue = $this->objPhone->PhoneTypeId;
}
if ($this->lblPhoneTypeId) {
$this->lblPhoneTypeId->Text = $this->objPhone->PhoneTypeId ? PhoneType::$NameArray[$this->objPhone->PhoneTypeId] : null;
}
if ($this->lstAddress) {
$this->lstAddress->RemoveAllItems();
$this->lstAddress->AddItem(QApplication::Translate('- Select One -'), null);
$objAddressArray = Address::LoadAll();
if ($objAddressArray) {
foreach ($objAddressArray as $objAddress) {
$objListItem = new QListItem($objAddress->__toString(), $objAddress->Id);
if ($this->objPhone->Address && $this->objPhone->Address->Id == $objAddress->Id) {
$objListItem->Selected = true;
}
$this->lstAddress->AddItem($objListItem);
}
}
}
if ($this->lblAddressId) {
$this->lblAddressId->Text = $this->objPhone->Address ? $this->objPhone->Address->__toString() : null;
}
if ($this->lstPerson) {
$this->lstPerson->RemoveAllItems();
$this->lstPerson->AddItem(QApplication::Translate('- Select One -'), null);
$objPersonArray = Person::LoadAll();
if ($objPersonArray) {
foreach ($objPersonArray as $objPerson) {
$objListItem = new QListItem($objPerson->__toString(), $objPerson->Id);
if ($this->objPhone->Person && $this->objPhone->Person->Id == $objPerson->Id) {
$objListItem->Selected = true;
}
$this->lstPerson->AddItem($objListItem);
}
}
}
if ($this->lblPersonId) {
$this->lblPersonId->Text = $this->objPhone->Person ? $this->objPhone->Person->__toString() : null;
}
if ($this->lstMobileProvider) {
$this->lstMobileProvider->RemoveAllItems();
$this->lstMobileProvider->AddItem(QApplication::Translate('- Select One -'), null);
$objMobileProviderArray = MobileProvider::LoadAll();
if ($objMobileProviderArray) {
foreach ($objMobileProviderArray as $objMobileProvider) {
$objListItem = new QListItem($objMobileProvider->__toString(), $objMobileProvider->Id);
if ($this->objPhone->MobileProvider && $this->objPhone->MobileProvider->Id == $objMobileProvider->Id) {
$objListItem->Selected = true;
}
$this->lstMobileProvider->AddItem($objListItem);
}
}
}
if ($this->lblMobileProviderId) {
$this->lblMobileProviderId->Text = $this->objPhone->MobileProvider ? $this->objPhone->MobileProvider->__toString() : null;
}
if ($this->txtNumber) {
$this->txtNumber->Text = $this->objPhone->Number;
}
if ($this->lblNumber) {
$this->lblNumber->Text = $this->objPhone->Number;
}
}
示例13: sprintf
<div class='text-recherche'>
<h1> Trouvez votre medecin </h1>
<p> Et prenez rendez vous immédiatement </p>
<div class="form-recherche">
<form method="post" action="traitement.php">
<input type="text" name="spe" placeholder="Spécialité">
<input type="text" name="ville" placeholder="Ville">
<input type="text" name="adresse" id="pac-input" placeholder="Adresse" onFocus="geolocate()">
<input type="submit" name="Rechercher" value="Rechercher" /><!--onclick="popupGPS()"-->
</form>
</div>
</div>
<?php
$geocoder = "http://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false";
$arrAddresses = Address::LoadAll();
// Notre collection d'objets Address
foreach ($arrAddresses as $address) {
if (strlen($address->Lat) == 0 && strlen($address->Lng) == 0) {
$adresse = $address->Rue;
$adresse .= ', ' . $address->CodePostal;
$adresse .= ', ' . $address->Ville;
// Requête envoyée à l'API Geocoding
$query = sprintf($geocoder, urlencode(utf8_encode($adresse)));
$result = json_decode(file_get_contents($query));
$json = $result->results[0];
$adress->Lat = (string) $json->geometry->location->lat;
$adress->Lng = (string) $json->geometry->location->lng;
$adress->Save();
}
}