<?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 
  
  -----------------------------------------------------------------------
  
 ##################################################################################




*/
?>
    <?php echo go_fetch_form('checkout_address', go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_50], '', 'SSL'), 'post', 'onSubmit="return check_form_optional(checkout_address);"'); ?><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('checkout_address') > 0) {
?>
      <tr>
        <td><?php echo $messageStack->output('checkout_address'); ?></td>
      </tr>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
<?php
  }
  if ($process == false) {
?>
      <tr>
        <td><table border="0" style="width:100%" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main"><b><?php echo DB_TBL_ABOVE_PAYMENT_ADDRESS; ?></b></td>
          </tr>
        </table></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 TEXT_SELECTED_PAYMENT_DESTINATION; ?></td>
                <td align="right" style="width:50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="main" align="center" valign="top"><?php echo '<b>' . TITLE_PAYMENT_ADDRESS . '</b><br>' . 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, $billto, 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>
<?php
    if ($addresses_count > 1) {
?>
      <tr>
        <td><table border="0" style="width:100%" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main"><b><?php echo DB_TBL_ABOVE_DIRECTORY_TO_ADDRESS_ENTRIES; ?></b></td>
          </tr>
        </table></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 TEXT_SELECT_OTHER_PAYMENT_DESTINATION; ?></td>
                <td class="main" style="width:50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . go_picture(FOLDER_RELATIV_PIC_SYSTEM_TEMPLATES . 'arrow_east_south.gif'); ?></td>
                <td><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
              </tr>
<?php
      $radio_buttons = 0;
      $addresses_query = go_db_query("select directory_to_address_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, 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 = '" . $attendee_id . "'");
      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 colspan="2"><table border="0" style="width:100%" cellspacing="0" cellpadding="2">
<?php
       if ($addresses['directory_to_address_id'] == $billto) {
          echo '                  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
        } else {
          echo '                  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
        }
?>
                    <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                    <td class="main" colspan="2"><b><?php echo $addresses['firstname'] . ' ' . $addresses['lastname']; ?></b></td>
                    <td class="main" align="right"><?php echo go_fetch_radio_field('address', $addresses['directory_to_address_id'], ($addresses['directory_to_address_id'] == $billto)); ?></td>
                    <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                  </tr>
                  <tr>
                    <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                    <td colspan="3"><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, ' ', ', '); ?></td>
                        <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                      </tr>
                    </table></td>
                    <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                  </tr>
                </table></td>
                <td><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
              </tr>
<?php
        $radio_buttons++;
      }
?>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
<?php
    }
  }
  if ($addresses_count < MAX_DIRECTORY_TO_ADDRESS_ENTRIES) {
?>
      <tr>
        <td><table border="0" style="width:100%" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main"><b><?php echo DB_TBL_ABOVE_NEW_PAYMENT_ADDRESS; ?></b></td>
          </tr>
        </table></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:100%" valign="top"><?php echo TEXT_CREATE_NEW_PAYMENT_ADDRESS; ?></td>
                <td><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
              </tr>
              <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>
                    <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                    <td><?php require(FOLDER_RELATIV_MODULES . 'mods_bigware_4.php'); ?></td>
                    <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
                  </tr>
                </table></td>
                <td><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  }
?>
      <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="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>
                <td class="main" align="right"><?php echo go_fetch_hidden_field('action', 'submit') . go_picture_submit('button_continue.gif', PICTURE_BUTTON_CONTINUE); ?></td>
                <td style="width:10px"><?php echo go_fetch_dividing_up('tranparentes.gif', '10', '1'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
<?php
  if ($process == true) {
?>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><?php echo '<a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_50], '', 'SSL') . '">' . go_picture_button('button_back.gif', PICTURE_BUTTON_BACK) . '</a>'; ?></td>
      </tr>
<?php
  }
?>
      <tr>
        <td><?php echo go_fetch_dividing_up('tranparentes.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td><table border="0" style="width:100%" cellspacing="0" cellpadding="0">
          <tr>
            <td style="width:25%"><table border="0" style="width:100%" cellspacing="0" cellpadding="0">
              <tr>
                <td style="width:50%" align="right"><?php echo go_fetch_dividing_up('pixel_silver.gif', '1', '5'); ?></td>
                <td style="width:50%"><?php echo go_fetch_dividing_up('pixel_silver.gif', '100%', '1'); ?></td>
              </tr>
            </table></td>
            <td style="width:25%"><table border="0" style="width:100%" cellspacing="0" cellpadding="0">
              <tr>
                <td style="width:50%"><?php echo go_fetch_dividing_up('pixel_silver.gif', '100%', '1'); ?></td>
                <td><?php echo go_picture(FOLDER_RELATIV_PIC_SYSTEM_TEMPLATES . 'checkout_bullet.gif'); ?></td>
                <td style="width:50%"><?php echo go_fetch_dividing_up('pixel_silver.gif', '100%', '1'); ?></td>
              </tr>
            </table></td>
            <td style="width:25%"><?php echo go_fetch_dividing_up('pixel_silver.gif', '100%', '1'); ?></td>
            <td style="width:25%"><table border="0" style="width:100%" cellspacing="0" cellpadding="0">
              <tr>
                <td style="width:50%"><?php echo go_fetch_dividing_up('pixel_silver.gif', '100%', '1'); ?></td>
                <td style="width:50%"><?php echo go_fetch_dividing_up('pixel_silver.gif', '1', '5'); ?></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td align="center" style="width:25%" class="checkoutBarFrom"><?php echo '<a href="' . go_href_link($GLOBALS[CONFIG_NAME_FILE][main_bigware_66], '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>
            <td align="center" style="width:25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
            <td align="center" style="width:25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
            <td align="center" style="width:25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
          </tr>
        </table></td>
      </tr>
    </table></form>
