<label for="spouseSurname">Spouse's Surname</label>
        <input type="text" class="form-control" id="spouseSurname" placeholder="spouse's surname" name="spouseSurname" value="<?php 
echo $params['spouseSurname'];
?>
">
      </div>
    </div>
    <p class="text-center"><button type="submit" class="btn btn-primary">Search</button></p>
  </form>

<?php 
// Only search if any of the search params are set
if (!empty($params)) {
    // Print the search parameters; useful for debugging
    echo '<h3>Search Parameters</h3>';
    rawDump($params);
    // Construct the search query using the given parameters
    $query = new Gedcomx\Rs\Client\Util\GedcomxPersonSearchQueryBuilder();
    if (isset($params['givenName'])) {
        $query->givenName($params['givenName']);
    }
    if (isset($params['surname'])) {
        $query->surname($params['surname']);
    }
    if (isset($params['birthDate'])) {
        $query->birthDate($params['birthDate']);
    }
    if (isset($params['birthPlace'])) {
        $query->birthPlace($params['birthPlace']);
    }
    if (isset($params['deathDate'])) {
"></td>
            </tr>
            <?php 
            } elseif ($memory->getMediaType() == "text/plain") {
                ?>
            <tr>
              <th>Title:</th>
              <td><?php 
                echo $memory->getTitles()[0]->getValue();
                ?>
</td>
            </tr>
            <tr>
              <th>Body:</th>
              <td><?php 
                echo $memory->getDescriptions()[0]->getValue();
                ?>
</td>
            </tr>
            <?php 
            }
            ?>
          </table>

        </div>
        <?php 
            rawDump($memory);
        }
    }
}
include '../footer.php';
/**
 * Pretty print a child and parents relationship
 */
function printChildAndParentsRelationship($relationship, $father, $mother, $child)
{
    $fatherId = '';
    if ($father) {
        $fatherId = $father->getId();
    }
    $motherId = '';
    if ($mother) {
        $motherId = $mother->getId();
    }
    $childId = '';
    if ($child) {
        $childId = $child->getId();
    }
    ?>
    <div class="panel panel-default">
      <div class="panel-heading">Child and Parents Relationship</div>
      <table class="table">
        <tr>
          <th>Father</th>
          <th>Mother</th>
          <th>Child</th>
        </tr>
        <tr>
          <td><a href="/examples/ReadPerson.php?personId=<?php 
    echo $fatherId;
    ?>
"><?php 
    echo $fatherId;
    ?>
</a></td>
          <td><a href="/examples/ReadPerson.php?personId=<?php 
    echo $motherId;
    ?>
"><?php 
    echo $motherId;
    ?>
</a></td>
          <td><a href="/examples/ReadPerson.php?personId=<?php 
    echo $childId;
    ?>
"><?php 
    echo $childId;
    ?>
</a></td>
        </tr>
        <tr>
          <td><?php 
    echo $father ? $father->getDisplayExtension()->getName() : '';
    ?>
</td>
          <td><?php 
    echo $mother ? $mother->getDisplayExtension()->getName() : '';
    ?>
</td>
          <td><?php 
    echo $child ? $child->getDisplayExtension()->getName() : '';
    ?>
</td>
        </tr>
        <tr>
          <td><?php 
    echo $father ? $father->getDisplayExtension()->getLifespan() : '';
    ?>
</td>
          <td><?php 
    echo $mother ? $mother->getDisplayExtension()->getLifespan() : '';
    ?>
</td>
          <td><?php 
    echo $child ? $child->getDisplayExtension()->getLifespan() : '';
    ?>
</td>
        </tr>
      </table>
    </div>
    <?php 
    // Father facts
    if (count($relationship->getFatherFacts())) {
        echo '<h4>Father Facts</h4>';
        foreach ($relationship->getFatherFacts() as $fact) {
            printFact($fact);
        }
    }
    // Mother facts
    if (count($relationship->getMotherFacts())) {
        echo '<h4>Mother Facts</h4>';
        foreach ($relationship->getMotherFacts() as $fact) {
            printFact($fact);
        }
    }
    // Raw
    rawDump($relationship->toArray());
}