<!-- BEGIN {$smarty.template} -->

<form action="{$FORM_ACTION}" method="POST">

<table class="searchtable" cellspacing="0">
  <tr>
    <th colspan="3"> {t}Search quotations{/t} </th>
  </tr>
  <tr>
    <td class="label">{t}Quotation nr.{/t}: </td>
    <td colspan="2">
      <input type="text" class="tinput" name="quot_number" value="{$quotInfo.quot_number|wash}" size="10" maxlength="10">
    </td>
  </tr>
  <tr>
    <td class="label">{t}Recipient (company){/t}: </td>
    <td colspan="2">
      <select name="cpn_id">
        {html_options options=$select_cpn selected=$quotInfo.cpn_id}
      </select>
    </td>
  </tr>
  <tr>
    <td class="label">{t}Quoted Between{/t}: </td>
    <td colspan="2">
      <input type="text" class="tinput" name="quot_datefrom" value="{$quotInfo.quot_datefrom|wash}" size="10" maxlength="10" id="sdate">
      <input type="image" src="img/phpaga/cal.png" id="btn_sdate">
      <span class="comment">(yyyy-mm-dd)</span>
    </td>
  </tr>
  <tr>
    <td class="label">{t}And{/t}: </td>
    <td>
      <input type="text" class="tinput" name="quot_dateto" value="{$quotInfo.quot_dateto|wash}" size="10" maxlength="10" id="edate">
      <input type="image" src="img/phpaga/cal.png" id="btn_edate">
      <span class="comment">(yyyy-mm-dd)</span>
    </td>
    <td>
      <input type="submit" name="submit" value="{t}Search{/t}">
    </td>
  </tr>
</table>

</form>

<table class="stdtable" cellspacing="0">
  <tr>
    <td class="header"> {t}Quotations{/t} </td>
    <td class="headeraction" colspan="2"> {if $perm_quotations}[ <a href="add_quotation.php">{t}Create quotation{/t}</a> ]{else}&nbsp;{/if} </td>
  </tr>

  {if (count($rows) > 0)}
  <tr>
    <th class="number"> {t}Quotation nr.{/t} </th>
    <th class="time"> {t}Quotation date{/t} </th>
    <th> {t}Recipient (company){/t} </th>
  </tr>

  {section name=quotations loop=$rows}
  <tr class="{cycle values="odd,even"}">
    <td class="number"> <a href="quotation.php?id={$rows[quotations].quot_id}">{$rows[quotations].quot_number|wash}</a> </td>
    <td class="time"> <a href="quotation.php?id={$rows[quotations].quot_id}">{$rows[quotations].quot_date|wash|date_format:$smarty.const.PHPAGA_DATEFORMAT_SHORT}</a> </td>
    <td class="last"> <a href="company.php?id={$rows[quotations].cpn_id}">{$rows[quotations].cpn_name|wash}</a> </td>
  </tr>
  {/section}
  {else}
  <tr>
    <td class="last" colspan="3"> {t}No quotations matching your search criteria were found.{/t} </td>
  </tr>
  {/if}
  {if strlen($BROWSE)}
  <tr>
    <td class="browse" colspan="3"> {$BROWSE} </td>
  </tr>
  {/if}
</table>

{literal}
<script type="text/javascript">
Calendar.setup({
inputField     :    "sdate",                     // id of the input field
ifFormat       :    "%Y-%m-%d",       // format of the input field
showsTime      :    false,                      // will display a time selector
button         :    "btn_sdate",                 // trigger for the calendar (button ID)
singleClick    :    true,                     // double-click mode
showOthers     :    true                       // show overlapping months
});
</script>

<script type="text/javascript">
Calendar.setup({
inputField     :    "edate",                     // id of the input field
ifFormat       :    "%Y-%m-%d",       // format of the input field
showsTime      :    false,                      // will display a time selector
button         :    "btn_edate",                 // trigger for the calendar (button ID)
singleClick    :    true,                     // double-click mode
showOthers     :    true                       // show overlapping months
});
</script>

{/literal}

<!-- END {$smarty.template} -->

