<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/

  if (!isset($process)) $process = false;

?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td>
		<fieldset>
		<legend>
            <?php
            if (isset($HTTP_GET_VARS['edit'])) { echo HEADING_TITLE_MODIFY_ENTRY; } else { echo HEADING_TITLE_ADD_ENTRY; } ?>
        </legend>

		<table border="0" cellspacing="2" cellpadding="2">
			<tr>
			  <td align="left" colspan="2">
				<span class="inputRequirement"><?php echo POLA_OBOWIAZKOWE; ?>&nbsp;<br>&nbsp;</span>
			  </td>
			</tr>
          
          <?php if (tep_not_null($entry['entry_company']) || !isset($HTTP_GET_VARS['edit'])) { ?>
          <tr>
            <td class="main" width="37%"><?php echo ENTRY_COMPANY; ?></td>
            <td class="main" width="63%" align="left"><?php echo tep_draw_input_field('company', $entry['entry_company'], 'size="35"') . '&nbsp;' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td>
          </tr>
          <tr>
            <td class="main" width="37%"><?php echo ENTRY_NIP; ?></td>
            <td class="main" width="63%" align="left"><?php echo tep_draw_input_field('nip', $entry['entry_nip'], 'size="35"') . '&nbsp;' . (tep_not_null(ENTRY_NIP_TEXT) ? '<span class="inputRequirement">' . ENTRY_NIP_TEXT . '</span>': ''); ?></td>
          </tr>
          <?php } ?>
          
          <tr>
            <td class="main" width="37%"><?php echo ENTRY_FIRST_NAME; ?></td>
            <td class="main" width="63%" align="left"><?php echo tep_draw_input_field('firstname', $entry['entry_firstname'], 'size="35"') . '&nbsp;' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
          </tr>
          <tr>
            <td class="main" width="37%"><?php echo ENTRY_LAST_NAME; ?></td>
            <td class="main" width="63%" align="left"><?php echo tep_draw_input_field('lastname', $entry['entry_lastname'], 'size="35"') . '&nbsp;' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
          </tr>
          <tr>
            <td class="main" width="37%"><?php echo ENTRY_STREET_ADDRESS; ?></td>
            <td class="main" width="63%" align="left"><?php echo tep_draw_input_field('street_address', $entry['entry_street_address'], 'size="35"') . '&nbsp;' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>
          </tr>
          <?php
          if ( !isset($HTTP_GET_VARS['edit']) ) {
          ?>
               <tr>
                <td class="main" width="37%"><?php echo ENTRY_STREET_ADDRESS_DOM; ?></td>
                <td class="main" width="63%" align="left"><?php echo tep_draw_input_field('street_address_dom', '', 'size="5"'); ?>&nbsp;&nbsp;<?php echo ENTRY_STREET_ADDRESS_MIESZKANIE; ?>&nbsp;&nbsp;<?php echo tep_draw_input_field('street_address_mieszkanie', '', 'size="5"'); ?></td>
               </tr>
          <?php
                }
          ?>
        <?php
          if (ACCOUNT_SUBURB == 'true') {
        ?>
          <tr>
            <td class="main" width="37%"><?php echo ENTRY_SUBURB; ?></td>
            <td class="main" width="63%" align="left"><?php echo tep_draw_input_field('suburb', $entry['entry_suburb']); ?></td>
          </tr>
        <?php
          }
        ?>
          <tr>
            <td class="main" width="37%"><?php echo ENTRY_POST_CODE; ?></td>
            <td class="main" width="63%" align="left"><?php echo tep_draw_input_field('postcode', $entry['entry_postcode'], 'size="35"') . '&nbsp;' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
          </tr>
          <tr>
            <td class="main" width="37%"><?php echo ENTRY_CITY; ?></td>
            <td class="main" width="63%" align="left"><?php echo tep_draw_input_field('city', $entry['entry_city'], 'size="35"') . '&nbsp;' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>
          </tr>
<?php
  if (ACCOUNT_STATE == 'true') {
?>
          <tr>
            <td class="main" width="37%"><?php echo ENTRY_STATE; ?></td>
            <td class="main" width="63%" align="left">
<?php
// +Country-State Selector
     $zones_array = array();
     $zones_query = tep_db_query("select zone_name, zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$entry['entry_country_id'] . "' order by zone_name");
     while ($zones_values = tep_db_fetch_array($zones_query)) {
       $zones_array[] = array('id' => $zones_values['zone_id'], 'text' => $zones_values['zone_name']);
       }
     if (count($zones_array) > 0) {
       echo tep_draw_pull_down_menu('zone_id', $zones_array, $entry['entry_zone_id']);
       echo tep_draw_hidden_field('state', '');
     } else {
       echo tep_draw_input_field('state', $entry['entry_state']);
     }
// -Country-State Selector
?></td>

          </tr>
<?php
  }
?>
          <tr>
            <td class="main"><?php echo ENTRY_COUNTRY; ?></td>
            <?php // +Country-State Selector ?>
            <td class="main"><?php echo tep_get_country_list('country', $entry['entry_country_id'],'onChange="return refresh_form(addressbook);"') . '&nbsp;' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
            <?php // -Country-State Selector ?>
		  </tr>
<?php
  if ((isset($HTTP_GET_VARS['edit']) && ($customer_default_address_id != $HTTP_GET_VARS['edit'])) || (isset($HTTP_GET_VARS['edit']) == false) ) {
?>
          <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
          </tr>
          <tr>
            <td colspan="2" class="main"><?php echo tep_draw_checkbox_field('primary', 'on', false, 'id="primary"') . ' ' . SET_AS_PRIMARY; ?></td>
          </tr>
<?php
  }
?>
        </table>
			</fieldset>
		</td>
  </tr>
</table>
