<?php
/*
###################################################################################
  Bigware Shop 2.3
  Release Datum: 23.08.2015
  
  Bigware Shop
  http://www.bigware.de

  Copyright (c) 2015 Bigware LTD
  (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
  (c) 2015	Bigware LTD

  Copyrightvermerke duerfen nicht entfernt werden.
  ------------------------------------------------------------------------
  Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
  der GNU General Public License, wie von der Free Software Foundation
  veroeffentlicht, weitergeben und/oder modifizieren, entweder gemaess Version 2 
  der Lizenz oder (nach Ihrer Option) jeder spaeteren Version.
  Die Veroeffentlichung dieses Programms erfolgt in der Hoffnung, dass es Ihnen
  von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die
  implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT FUER EINEN
  BESTIMMTEN ZWECK. Details finden Sie in der GNU General Public License.
  
  Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
  Programm erhalten haben. Falls nicht, schreiben Sie an die Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

  Infos:
  ------------------------------------------------------------------------
  Der Bigware Shop wurde vor vielen Jahren bereits aus dem bekannten Shopsystem osCommerce
  weiter- und neuentwickelt.
  Der Bigware Shop legt im hohen Masse Wert auf Bedienerfreundlichkeit, beinhaltet eine leichte
  Installation, viele neue professionelle Werkzeuge und zeichnet sich aus durch eine grosse 
  Community, die bei Problemen weiterhelfen kann.
  
  Der Bigware Shop ist auf jedem System lauffaehig, welches eine PHP Umgebung
  (ab PHP 4.1.3) und mySQL zur Verfuegung stellt und auf Linux basiert.
 
  Hilfe erhalten Sie im Forum auf www.bigware.de 
  
  -----------------------------------------------------------------------
  
 ##################################################################################




*/
?>
    <table border="0" style="width:100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" style="width:100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageGeneralsign"></td>
            <td class="pageGeneralsign" align="right"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
<?php
  if ($messageStack->size('addressbook') > 0) {
?>
      <tr>
        <td><?php echo $messageStack->output('addressbook'); ?></td>
      </tr>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
<?php
  }
?>
      <tr>
        <td class="main"><b><?php echo PRIMARY_ADDRESS_TITLE; ?></b></td>
      </tr>
      <tr>
        <td><table border="0" style="width:100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoFrameInsides">
            <td><table border="0" style="width:100%" cellspacing="0" cellpadding="2">
              <tr>
                <td><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                <td class="main" style="width:50%" valign="top"><?php echo PRIMARY_ADDRESS_DESCRIPTION; ?></td>
                <td align="right" style="width:50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="main" align="center" valign="top"><b><?php echo PRIMARY_ADDRESS_TITLE; ?></b><br><?php echo go_picture(FOLDER_RELATIV_PIC_SYSTEM_TEMPLATES . 'arrow_south_east.gif'); ?></td>
                    <td><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                    <td class="main" valign="top"><?php echo go_address_label($attendee_id, $attendee_default_address_id, true, ' ', '<br>'); ?></td>
                    <td><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td class="main"><b><?php echo DIRECTORY_TO_ADDRESS_TITLE; ?></b></td>
      </tr>
      <tr>
        <td><table border="0" style="width:100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoFrameInsides">
            <td><table border="0" style="width:100%" cellspacing="0" cellpadding="2">
<?php 
  $addresses_query = go_db_query("select directory_to_address_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_piva as piva, entry_cf as cf, entry_street_address as street_address, entry_street_address2 as street_address2, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_land_id as land_id from " . DB_TBL_DIRECTORY_TO_ADDRESS . " where attendees_id = '" . (int)$attendee_id . "' order by firstname, lastname");
  while ($addresses = go_db_fetch_array($addresses_query)) {
    $format_id = go_get_form_of_address_id($addresses['land_id']);
?>
              <tr>
                <td><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                <td><table border="0" style="width:100%" cellspacing="0" cellpadding="2">
                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onClick="document.location.href='<?php echo go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_16], 'change=' . $addresses['directory_to_address_id'], 'SSL'); ?>'">
                    <td class="main"><b><?php echo go_output_string_protected($addresses['firstname'] . ' ' . $addresses['lastname']); ?></b><?php if ($addresses['directory_to_address_id'] == $attendee_default_address_id) echo '&nbsp;<small><i>' . PRIMARY_ADDRESS . '</i></small>'; ?></td>
                    <td class="main" align="right"><?php echo '<a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_16], 'change=' . $addresses['directory_to_address_id'], 'SSL') . '">' . go_picture_button('small_change.gif', SMALL_PICTURE_BUTTON_CHANGE) . '</a> <a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_16], 'delete=' . $addresses['directory_to_address_id'], 'SSL') . '">' . go_picture_button('small_delete.gif', SMALL_PICTURE_BUTTON_DELETE) . '</a>'; ?></td>
                  </tr>
                  <tr>
                    <td colspan="2"><table border="0" cellspacing="0" cellpadding="2">
                      <tr>
                        <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                        <td class="main"><?php echo go_form_of_address($format_id, $addresses, true, ' ', '<br>'); ?></td>
                        <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
                <td><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
              </tr>
<?php
  }
?>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" style="width:100%" cellspacing="1" cellpadding="2" class="infoBox">
          <tr class="infoFrameInsides">
            <td><table border="0" style="width:100%" cellspacing="0" cellpadding="2">
              <tr>
                <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                <td class="smallText"><?php echo '<a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_42], '', 'SSL') . '">' . go_picture_button('button_back.gif', PICTURE_BUTTON_BACK) . '</a>'; ?></td>
<?php
  if (go_count_attendee_directory_to_address_entries() < MAX_DIRECTORY_TO_ADDRESS_ENTRIES) {
?>
                <td class="smallText" align="right"><?php echo '<a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_16], '', 'SSL') . '">' . go_picture_button('button_add_address.gif', PICTURE_BUTTON_ADD_ADDRESS) . '</a>'; ?></td>
<?php
  }
?>
                <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td class="smallText"><?php echo sprintf(TEXT_MAX_ENTRIES, MAX_DIRECTORY_TO_ADDRESS_ENTRIES); ?></td>
      </tr>
    </table>
