<?php require_once('Connections/FMKickers_login.php'); ?>
<?php
$registrations_find = $FMKickers_login->newFindCommand('Registrations');
$registrations_findCriterions = array('Users::email'=>'=='.fmsEscape($_SESSION["FMKickers_login_tableLogin"]["user"]),'Users::password'=>'=='.fmsEscape($_SESSION["FMKickers_login_tableLogin"]["pass"]),);
foreach($registrations_findCriterions as $key=>$value) {
    $registrations_find->AddFindCriterion($key,$value);
}

fmsSetPage($registrations_find,'registrations',10); 

$registrations_result = $registrations_find->execute(); 

if(FileMaker::isError($registrations_result)) fmsTrapError($registrations_result,"error.php"); 

fmsSetLastPage($registrations_result,'registrations',10); 

$registrations_row = current($registrations_result->getRecords());

$registrations__Clinics_portal = fmsRelatedRecord($registrations_row, 'Clinics');
$registrations__Users_portal = fmsRelatedRecord($registrations_row, 'Users');
$registrations__PaymentDetails_portal = fmsRelatedRecord($registrations_row, 'Payment Details');
 
 // FMStudio v1.0 - do not remove comment, needed for DreamWeaver support ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>FM Kickers</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table align="CENTER" width="750" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2"><img src="Images/fmkickers.png" width="760" height="152"></td>
  </tr>
  <tr>
    <td width="169" bgcolor="#D1D1D1" valign="TOP"><img src="Images/header1.jpg" width="169" height="140">      <p><a href="index.php">All Clinics<br />
    </a><a href="user_clinics.php">My Registrations  </a></p></td>
    <td class="main_area" width="587" valign="TOP"><h1>Your Registrations </h1>
      <p><a href="<?php echo fmsLogoutLink('FMKickers_login', 'index.php'); ?>">Logout</a></p>
    
    <table name="registrations_table" style="background-color: #000000; " cellspacing="1" width="400">
      <tr>
        <th style="background-color: #66AC63;">Clinic Name</th>
        <th style="background-color: #66AC63;">Child</th>
        <th style="background-color: #66AC63;">Registration Date/Time</th>
        <th style="background-color: #66AC63;">Confirmation #</th>
      </tr>
      <?php foreach($registrations_result->getRecords() as $registrations_row){ ?>
        <tr>
          <td style="background-color: #FFFFFF;"><?php echo $registrations_row->getField('Clinics::clinicName'); ?></td>
          <td style="background-color: #FFFFFF;"><?php echo $registrations_row->getField('childName'); ?></td>
          <td style="background-color: #FFFFFF;"><?php echo $registrations_row->getField('registrationTimestamp'); ?></td>
          <td style="background-color: #FFFFFF;"><a href="registration_detail.php?registrationId=<?php echo $registrations_row->getField('registrationId'); ?>"><?php echo $registrations_row->getField('registrationId'); ?></a></td>
        </tr>
        <?php } ?>
    </table>
    </p></td>
  </tr>
  
  <tr>
    <td colspan="2"><img src="Images/footer.jpg" width="760" height="24"></td>
  </tr>
</table>
</body>
</html>
