A Qcodo based CMS/ecommerce framework
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.

101 lines
3.8 KiB

12 years ago
  1. <?php
  2. /**
  3. * AddressView - provides a panel for viewing and modification of an address
  4. *
  5. *@author Erik Winn <erikwinnmail@yahoo.com>
  6. *
  7. *
  8. * $Id: AddressView.class.php 2 2008-07-31 18:55:50Z erikwinn $
  9. *@version 0.1
  10. *
  11. *@copyright (C) 2008 by Erik Winn
  12. *@license GPL v.2
  13. This program is free software; you can redistribute it and/or modify
  14. it under the terms of the GNU General Public License as published by
  15. the Free Software Foundation; either version 2 of the License, or
  16. (at your option) any later version.
  17. This program is distributed in the hope that it will be useful,
  18. but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. GNU General Public License for more details.
  21. You should have received a copy of the GNU General Public License
  22. along with this program; if not, write to the Free Software
  23. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
  24. *
  25. * @package Quasi
  26. * @subpackage Views
  27. */
  28. class AddressView extends QPanel
  29. {
  30. // Local instance of the AddressMetaControl
  31. protected $mctAddress;
  32. protected $objParentObject;
  33. public $lblAddressName;
  34. // Controls that allow the viewing of Address's individual data fields
  35. public $lblTitle;
  36. public $lblPersonId;
  37. public $lblStreet1;
  38. public $lblStreet2;
  39. public $lblSuburb;
  40. public $lblCity;
  41. public $lblCounty;
  42. public $lblZoneId;
  43. public $lblCountryId;
  44. public $lblPostalCode;
  45. public $lblIsCurrent;
  46. public $lblTypeId;
  47. public function __construct($objParentObject,
  48. $intAddressId,
  49. $strAddressName=" Address: ",
  50. $strControlId = null)
  51. {
  52. try {
  53. parent::__construct($objParentObject, $strControlId);
  54. } catch (QCallerException $objExc) {
  55. $objExc->IncrementOffset();
  56. throw $objExc;
  57. }
  58. $this->objParentObject =& $objParentObject;
  59. $this->strTemplate = __QUASI_CORE_TEMPLATES__ . '/AddressView.tpl.php';
  60. $this->mctAddress = AddressMetaControl::Create($this, $intAddressId);
  61. $this->lblAddressName = new QLabel($this);
  62. $this->lblAddressName->Text = $strAddressName;
  63. // Call MetaControl's methods to create qcontrols based on Address's data fields
  64. $this->lblTitle = $this->mctAddress->lblTitle_Create();
  65. $this->lblTitle->Name = 'Address Title: ';
  66. $this->lblPersonId = $this->mctAddress->lblPersonId_Create();
  67. $this->lblPersonId->Name = 'Address for : ';
  68. $this->lblStreet1 = $this->mctAddress->lblStreet1_Create();
  69. $this->lblStreet1->Name = 'Street :';
  70. $this->lblStreet2 = $this->mctAddress->lblStreet2_Create();
  71. $this->lblStreet2->Name = 'Street 2 or Apt.#:';
  72. $this->lblSuburb = $this->mctAddress->lblSuburb_Create();
  73. $this->lblSuburb->Name = 'Suburb :';
  74. $this->lblCity = $this->mctAddress->lblCity_Create();
  75. $this->lblCity->Name = 'City :';
  76. $this->lblCounty = $this->mctAddress->lblCounty_Create();
  77. $this->lblCounty->Name = 'County/District :';
  78. $this->lblZoneId = $this->mctAddress->lblZoneId_Create();
  79. $this->lblZoneId->Name = 'State/Province :';
  80. $this->lblCountryId = $this->mctAddress->lblCountryId_Create();
  81. $this->lblCountryId->Name = 'Country :';
  82. $this->lblPostalCode = $this->mctAddress->lblPostalCode_Create();
  83. $this->lblPostalCode->Name = 'Zip/Postal Code :';
  84. $this->lblTypeId = $this->mctAddress->lblTypeId_Create();
  85. $this->lblTypeId->Name = 'Type of Address :';
  86. }
  87. }
  88. ?>