public function getContactById() { $person = new PersonPDO(); $this->nameDOB = $person->readById($this->personId); $address = new AddressPDO(); $this->address = $address->readAllByPersonId($this->personId); $phoneNumber = new PhoneNumberPDO(); $this->phoneNumber = $phoneNumber->readAllByPersonId($this->personId); $emailAddress = new EmailAddressPDO(); $this->emailAddress = $emailAddress->readAllByPersonId($this->personId); $image = new ImagePDO(); $this->avatar = $image->getAvatarImageByPersonId($this->personId); $this->image = $image->readAllByPersonId($this->personId); }
<?php ob_start(); require "../models/Address.php"; $address = new AddressPDO(); $country = urlencode($_GET['country']); $qStates = $address->getStatesByCountry($country); ?> <select id="stateSelect" class="input_text" name="state" style="width:245px; background-color:#B8F5B1; "> <?php while ($row = $qStates->fetch(PDO::FETCH_OBJ)) { ?> <option value="<?php echo $row->subdivision; ?> "><?php echo $row->subdivision; ?> </option> <?php } ?> </select><br />
$model->create($cAddress); header("Location: ../profile.php?id=" . $_POST['personId']); } if (isset($_GET['action']) && $_GET['action'] === 'update') { $model->updateById($cAddress); header("Location: ../profile.php?id=" . $_POST['personId']); } } elseif ($_GET['action'] === 'update') { header("Location: ../email.php?id={$_POST['personId']}&action=update&validate=error&update={$_POST['id']}"); } else { header("Location: ../email.php?id={$_POST['personId']}&validate=error"); } } if (isset($_GET['action']) && $_GET['action'] == 'delete') { $deleteId = (int) $_GET['id']; $cAddress = new AddressPDO(); $cAddress->deleteById($deleteId); header("Location: ../profile.php?id=" . $_GET['personId']); } /* echo "getId ". $cAddress->getId(); echo "<br />"; echo "getPersonId ". $cAddress->getPersonId(); echo "<br />"; echo "getAddressType ". $cAddress->getAddressType(); echo "<br />"; echo "getCountryIso ". $cAddress->getCountryIso(); echo "<br />"; echo "getState ". $cAddress->getState(); echo "<br />"; echo "getStreet ". $cAddress->getStreet();
<?php ob_start(); require "../models/Address.php"; $address = new AddressPDO(); //$city = new City(); //$state = getUSStateAbbreviation($_GET['state']); $state = $address->getStateAbbr($_GET['state']); $qCities = $address->getAllCityByState($state); ?> <?php if ($state === "notOnList") { ?> <div class="form-block"> <span class="form-label">City</span> <input style="width:245px;" class="input_text" type="text" name="city" maxlength="40" value="" /><br /> </div> <?php } ?> <?php if ($state != "notOnList") { ?> <span class="form-label">City</span> <select style="width:245px;" id="country" class="input_text" name="city" > <?php while ($row = $qCities->fetch(PDO::FETCH_OBJ)) {
<?php require "controllers/LoginController.php"; require "models/Contact.php"; if (isset($_GET['id'])) { $id = (int) $_GET['id']; } elseif (!isset($_GET['id'])) { header("Location: listcontacts.php"); } ob_start(); require "phoneEmailAddress.php"; $phoneEmailAddress = ob_get_contents(); ob_end_clean(); require_once 'models/Address.php'; $address = new AddressPDO(); $qCountries = $address->getAllCountry(); $addressData = null; $action = null; if (isset($_GET['update'])) { $action = "update"; $updateId = (int) $_GET['update']; $addressData = $address->readById($updateId); if ($addressData == null) { header("Location: profile.php?id=" . $_GET["id"]); } } else { $action = "create"; $_GET['update'] = null; } $contact = new Contact($id); $contact->getContactById();