<?/*
Copyright (C) 2003 Media Net Link, Inc. Danville, CA 94526 USA

This file is part of AthenaRMS.

AthenaRMS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

AthenaRMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/?>
<?php
  require 'dd.php';
  require_once 'ticket.php';
  require_once 'person.php';
  require_once 'crypt.php';
  require_once 'config.php';

  $dd->Set_Edit_Flag (0);

  $ticket_p = new Ticket ();
  $person_p = new Person ();
  $crypt = new Crypt ();
  $config = new Config ();

  $params = explode ('/', $PATH_INFO);
  $id = $params[count($params)-1];

  $ticket_id = $crypt->decrypt ($id);

  $ticket = $ticket_p->Info_by_Ticket_ID ($ticket_id);
  $user_pid = $ticket->Get ('user_person_id');
  $person = $person_p->Info_by_Person_ID ($user_pid);

  if (!$ticket->Get ('ticket_id')) {
    print "Invalid ticket\n";
    return;
  }

  $dd->Set_Edit_Flag (0);

  require_once 'attribute.php';
  $att = new Attribute_Value ();
  $attrib = new Attribute ();

  $r = $att->att_val_record ($ticket_id, 203, 206);
  $title = $r[ADDITIONAL_INFO];

  $r = $att->att_val_record ($ticket_id, 204, 206);
  $address = $r[ADDITIONAL_INFO];

  $r = $att->att_val_record ($ticket_id, 205, 206);
  $state = $r[ADDITIONAL_INFO];
?>

<CENTER> 
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"> 
<TR> 
<TD><IMG SRC="/img/elipse-top-corn-left.gif" WIDTH="16" HEIGHT="15"
ALT=""></TD> 
<TD BACKGROUND="/img/elipse-vert-line-top.gif"><IMG SRC="/img/cldot.gif"
WIDTH="1" HEIGHT="15" ALT=""></TD> 
<TD><IMG SRC="/img/elipse-top-corn-right.gif" WIDTH="15" HEIGHT="15"
ALT=""></TD> 
</TR> 
<TR> 
<TD BACKGROUND="/img/elipse-vert-line-left.gif"><IMG
SRC="/img/cldot.gif" WIDTH="16" HEIGHT="1" ALT=""></TD> 
<TD WIDTH="680" ALIGN="left"> 
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="3"> 
<TBODY> 
<TR VALIGN="MIDDLE"> 
<TD ALIGN="CENTER" VALIGN="MIDDLE" NOWRAP="NOWRAP" ROWSPAN="2"
 CLASS="ticket"><FONT COLOR="red"><B>Thanks! You have successfully
subscribed.</B></FONT></TD> 
</TR> 
<TR VALIGN="MIDDLE"> 
</TR> 
</TBODY> 
</TABLE>
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0"> 
<TR> 
<TD ALIGN="center" BACKGROUND="/img/dotline.gif"><IMG ALT=""
SRC="/img/cldot.gif" WIDTH="1" HEIGHT="14"></TD> 
</TR> 
<TR> 
<TD ALIGN="center"> 
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="3" CELLSPACING="0"> 
<TR> 
<TD ALIGN="center" VALIGN="top"> 
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BGCOLOR="#E6F0CE"> 
<TR> 
<TD><IMG ALT="" SRC="/img/elipsefill-top-corn-left.gif" WIDTH="16"
HEIGHT="15"></TD> 
<TD BACKGROUND="/img/elipsefill-vert-line-top.gif"><IMG ALT=""
SRC="/img/cldot.gif" WIDTH="1" HEIGHT="15"></TD> 
<TD>
<IMG ALT="" SRC="/img/elipsefill-top-corn-right.gif" WIDTH="15"
 HEIGHT="15"></TD> 
</TR> 
<TR> 
<TD BACKGROUND="/img/elipsefill-vert-line-left.gif" ROWSPAN="5"><IMG
ALT="" SRC="/img/cldot.gif" WIDTH="16" HEIGHT="1"></TD> 
<TD BGCOLOR="#E6F0CE" CLASS="textsm" ALIGN="left"> 
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="3"> 
<TBODY> 
<TR> 
<TD NOWRAP="nowrap" ALIGN="right" CLASS="textsm"><B>Last Name:</B> </TD> 
<TD NOWRAP="nowrap" ALIGN="left" CLASS="textsm"><?php echo $person->Get ('last_name'); ?></TD> 
</TR> 
<TR> 
<TD NOWRAP="nowrap" ALIGN="right" CLASS="textsm"><B>First Name:</B> </TD> 
<TD NOWRAP="nowrap" ALIGN="left" CLASS="textsm"><?php echo $person->Get ('first_name'); ?></TD> 
</TR> 
<TR>
<TD ALIGN="right" CLASS="textsm" NOWRAP="nowrap"><B>Title:</B></TD>
<TD ALIGN="left" CLASS="textsm" NOWRAP="nowrap"><?php echo $title; ?></TD>
</TR>
<TR> 
<TD ALIGN="right" CLASS="textsm" NOWRAP="nowrap"><B>Company:</B> </TD> 
<TD ALIGN="left" CLASS="textsm" NOWRAP="nowrap"><?php echo $person->Get ('company'); ?></TD> 
</TR> 
<TR> 
<TD ALIGN="right" CLASS="textsm" NOWRAP="nowrap"><B>Address:</B> </TD> 
<TD ALIGN="left" CLASS="textsm" NOWRAP="nowrap"><?php echo $address; ?></TD> 
</TR> 
<TR> 
<TD ALIGN="right" CLASS="textsm" NOWRAP="nowrap"><B>State/Zip:</B> </TD> 
<TD ALIGN="left" CLASS="textsm" NOWRAP="nowrap"><?php echo $state; ?></TD> 
</TR> 
<TR> 
<TD NOWRAP="nowrap" ALIGN="right" CLASS="textsm"><B>Email:</B></TD> 
<TD NOWRAP="nowrap" ALIGN="left" CLASS="textsm"><?php echo $person->Get ('email'); ?></TD> 
</TR> 
</TBODY> 
</TABLE> </TD> 
<TD BACKGROUND="/img/elipsefill-vert-line-right.gif" ROWSPAN="5"><IMG ALT=""
SRC="/img/cldot.gif" WIDTH="15" HEIGHT="1"></TD> 
</TR> 
<!-- remove this? messes up the table -->
<TR> 
<TD CLASS="textsm" ALIGN="left" BACKGROUND="/img/dotline.gif"><IMG ALT=""
SRC="/img/cldot.gif" WIDTH="1" HEIGHT="14"></TD> 
</TR> 
<TR> 
<TD CLASS="textsm" ALIGN="left">Your text here. Your text here. Your text here.
</TD> 
</TR> 
<TR> 
<TD CLASS="textsm" ALIGN="left" BACKGROUND="/img/dotline.gif"><IMG ALT=""
SRC="/img/cldot.gif" WIDTH="1" HEIGHT="14"></TD> 
</TR> 
<TR> 
<TD CLASS="textsm" ALIGN="center"> </TD> 
</TR> 
<!-- end -->
<TR> 
<TD><IMG ALT="" SRC="/img/elipsefill-btm-corn-left.gif" WIDTH="16"
HEIGHT="15"></TD> 
<TD BACKGROUND="/img/elipsefill-vert-line-btm.gif"><IMG ALT=""
SRC="/img/cldot.gif" WIDTH="1" HEIGHT="15"></TD> 
<TD>
<IMG ALT="" SRC="/img/elipsefill-btm-corn-right.gif" WIDTH="15"
 HEIGHT="15"></TD> 
</TR> 
</TABLE>

<!--End Nav-->
</TD> 
<TD ALIGN="center" VALIGN="top"> 
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"> 
<TR> 
<TD><IMG ALT="" SRC="/img/elipse-top-corn-left.gif" WIDTH="16"
HEIGHT="15"></TD> 
<TD BACKGROUND="/img/elipse-vert-line-top.gif"><IMG ALT="" SRC="/img/cldot.gif"
WIDTH="1" HEIGHT="15"></TD> 
<TD><IMG ALT="" SRC="/img/elipse-top-corn-right.gif" WIDTH="15"
HEIGHT="15"></TD> 
</TR> 
<TR> 
<TD BACKGROUND="/img/elipse-vert-line-left.gif" ROWSPAN="3"><IMG ALT=""
SRC="/img/cldot.gif" WIDTH="16" HEIGHT="1"></TD> 
<TD WIDTH="100%"> 
<TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="3"> 
<TBODY> 
<?php
  foreach (array (15, 16, 202) as $att_id) {
    $mems = $att->members_by_id_att ($ticket_id, $att_id);

    if (!count($mems)) continue;

    $name = $attrib->attribute_name ($att_id);
print <<<HERETO
<TR> 
  <TD ALIGN="left" BGCOLOR="#E6F0CE" CLASS="textsm"><B>$name</B></td>
</tr>
HERETO;

    foreach ($mems as $r) {
print <<<HERETO
<TR> 
  <TD ALIGN="left" CLASS="text">&#149; $r[MEMBER_NAME]</td>
</tr>
HERETO;
    }
  }
?>
<!--
<tr>
  <td></td>
</tr>
-->
</TBODY> 
</TABLE></TD> 
<TD BACKGROUND="/img/elipse-vert-line-right.gif" ROWSPAN="3"><IMG ALT=""
SRC="/img/cldot.gif" WIDTH="15" HEIGHT="1"></TD> 
</TR> 
<TR> 
<TD ALIGN="center"></TD> 
</TR> 
<TR> 
<TD CLASS="textsm"> </TD> 
</TR> 
<TR> 
<TD><IMG ALT="" SRC="/img/elipse-btm-corn-left.gif" WIDTH="16"
HEIGHT="15"></TD> 
<TD BACKGROUND="/img/elipse-vert-line-btm.gif"><IMG ALT="" SRC="/img/cldot.gif"
WIDTH="1" HEIGHT="15"></TD> 
<TD><IMG ALT="" SRC="/img/elipse-btm-corn-right.gif" WIDTH="15"
HEIGHT="15"></TD> 
</TR> 
</TABLE> </TD> 
</TR> 
</TABLE> </TD> 
</TR> 
<TR> 
<TD ALIGN="center" BACKGROUND="/img/dotline.gif"><IMG ALT=""
SRC="/img/cldot.gif" WIDTH="1" HEIGHT="14"></TD> 
</TR> 
<TR> 
<TD ALIGN="LEFT" CLASS="textsm">Thank you for your subscription, for your
reference your subscriber number is <?php echo $ticket_id; ?>. To view subscription status at any
time please go to
<?php
  require_once 'server_functions.php';
  $redir = redirect ($_SERVER['PHP_SELF'], 0, 1, 0);
?>
<A HREF="<?php echo $redir; ?>"><?php echo $redir; ?></A>.

<!-- begin footer --> </TD> 
</TR> 
<TR> 
<TD ALIGN="center" BACKGROUND="/img/dotline.gif"><IMG ALT=""
SRC="/img/cldot.gif" WIDTH="1" HEIGHT="14"></TD> 
</TR> 
</TABLE> </TD> 
<TD BACKGROUND="/img/elipse-vert-line-right.gif"><IMG SRC="/img/cldot.gif"
WIDTH="15" HEIGHT="1" ALT=""></TD> 
</TR> 
<TR> 
<TD> <IMG SRC="/img/elipse-btm-corn-left.gif" WIDTH="16" HEIGHT="15"
ALT=""></TD> 
<TD BACKGROUND="/img/elipse-vert-line-btm.gif"><IMG SRC="/img/cldot.gif"
WIDTH="1" HEIGHT="15" ALT=""></TD> 
<TD> <IMG SRC="/img/elipse-btm-corn-right.gif" WIDTH="15" HEIGHT="15"
ALT=""></TD> 
</TR> 
</TABLE> </CENTER>
