A QCodo powered CMS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.6 KiB

  1. <?php
  2. /**
  3. * AddressController - provides a panel for viewing and modification of an address
  4. *
  5. *@author Erik Winn <sidewalksoftware@gmail.com>
  6. *
  7. *@version 0.3
  8. *
  9. * @package Quinta
  10. * @subpackage Controllers
  11. */
  12. class AddressController extends QPanel{
  13. // Local instance of the AddressMetaControl
  14. protected $mctAddress;
  15. protected $objParentObject;
  16. public $lblAddressName;
  17. // Controls that allow the viewing of Address's individual data fields
  18. public $lblTitle;
  19. public $lblPersonId;
  20. public $lblStreet1;
  21. public $lblStreet2;
  22. public $lblSuburb;
  23. public $lblCity;
  24. public $lblCounty;
  25. public $lblZoneId;
  26. public $lblCountryId;
  27. public $lblPostalCode;
  28. public $lblIsCurrent;
  29. public $lblTypeId;
  30. public function __construct($objParentObject,
  31. $intAddressId,
  32. $strAddressName=" Address: ",
  33. $strControlId = null)
  34. {
  35. try {
  36. parent::__construct($objParentObject, $strControlId);
  37. } catch (QCallerException $objExc) {
  38. $objExc->IncrementOffset();
  39. throw $objExc;
  40. }
  41. $this->objParentObject =& $objParentObject;
  42. $this->strTemplate = __QUINTA_CORE_VIEWS__ . '/AddressView.tpl.php';
  43. $this->mctAddress = AddressMetaControl::Create($this, $intAddressId);
  44. $this->lblAddressName = new QLabel($this);
  45. $this->lblAddressName->Text = $strAddressName;
  46. // Call MetaControl's methods to create qcontrols based on Address's data fields
  47. $this->lblTitle = $this->mctAddress->lblTitle_Create();
  48. $this->lblTitle->Name = 'Address Title: ';
  49. $this->lblPersonId = $this->mctAddress->lblPersonId_Create();
  50. $this->lblPersonId->Name = 'Address for : ';
  51. $this->lblStreet1 = $this->mctAddress->lblStreet1_Create();
  52. $this->lblStreet1->Name = 'Street :';
  53. $this->lblStreet2 = $this->mctAddress->lblStreet2_Create();
  54. $this->lblStreet2->Name = 'Street 2 or Apt.#:';
  55. $this->lblSuburb = $this->mctAddress->lblSuburb_Create();
  56. $this->lblSuburb->Name = 'Suburb :';
  57. $this->lblCity = $this->mctAddress->lblCity_Create();
  58. $this->lblCity->Name = 'City :';
  59. $this->lblCounty = $this->mctAddress->lblCounty_Create();
  60. $this->lblCounty->Name = 'County/District :';
  61. $this->lblZoneId = $this->mctAddress->lblZoneId_Create();
  62. $this->lblZoneId->Name = 'State/Province :';
  63. $this->lblCountryId = $this->mctAddress->lblCountryId_Create();
  64. $this->lblCountryId->Name = 'Country :';
  65. $this->lblPostalCode = $this->mctAddress->lblPostalCode_Create();
  66. $this->lblPostalCode->Name = 'Zip/Postal Code :';
  67. $this->lblTypeId = $this->mctAddress->lblTypeId_Create();
  68. $this->lblTypeId->Name = 'Type of Address :';
  69. }
  70. }
  71. ?>