<?php
/**
 * OpenMage
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available at https://opensource.org/license/afl-3-0-php
 *
 * @category    design
 * @package     default_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
 * @copyright   Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php if($this->canDisplayGiftmessage()): ?>
<?php $_required = $this->getMessage()->getMessage() != ''?>
<div id="<?php echo $this->getHtmlId() ?>" class="box-left giftmessage-whole-order-container">
    <div class="entry-edit">
        <div><?php echo Mage::helper('sales')->__('Gift Message for the Entire Order') ?></div><br />
        <form id="<?php echo $this->getFieldId('form') ?>" action="<?php echo $this->getSaveUrl() ?>">
          <fieldset>
              <input type="hidden" id="<?php echo $this->getFieldId('type') ?>" name="<?php echo $this->getFieldName('type') ?>" value="order" />
              <table width="100%" cellspacing="0">
                <tbody>
                  <tr>
                      <td class="label"><label><?php echo Mage::helper('sales')->__('From Name') ?><?php echo $_required ? '&nbsp;<span class="required">*</span>' : ''?></label></td>
                      <td class="input-ele"><input class="input-text" type="text" id="<?php echo $this->getFieldId('sender') ?>" name="<?php echo $this->getFieldName('sender') ?>" value="<?php echo $this->escapeHtml($this->getMessage()->getSender()) ?>" /></td>
                      <td>&nbsp;</td>
                      <td class="label"><label><?php echo Mage::helper('sales')->__('To Name') ?><?php echo $_required ? '&nbsp;<span class="required">*</span>' : ''?></label></td>
                      <td class="input-ele"><input class="input-text" type="text" id="<?php echo $this->getFieldId('recipient') ?>" name="<?php echo $this->getFieldName('recipient') ?>"  value="<?php echo $this->escapeHtml($this->getMessage()->getRecipient()) ?>" /></td>
                  </tr>
                  <tr>
                      <td class="label" colspan="6"><label for="<?php echo $this->getFieldId('message') ?>"><?php echo Mage::helper('sales')->__('Gift Message') ?></label></td>
                  </tr>
                  <tr>
                      <td colspan="5"><textarea style="height:8em;" id="<?php echo $this->getFieldId('message') ?>" name="<?php echo $this->getFieldName('message') ?>" rows="2" cols="15"><?php echo $this->escapeHtml($this->getMessage()->getMessage()) ?></textarea></td>
                  </tr>
                  <tr>
                      <td colspan="5" class="a-right" style="padding-top:5px;"><?php echo $this->getSaveButtonHtml(); ?></td>
                  </tr>
                </tbody>
              </table>
          </fieldset>
        </form>
    </div>
</div>
<?php endif ?>
