<%set set_focus = 'myform.msg_id'%>
<%set book_mark = 'search_message'%>
<%include include_header.html%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="82%">
  <tr>
    <td rowspan="2" bgcolor="#008000" height="100%" width="1"><img src="<%image_url%>/pics/1pixel.gif" width="1" height="1"></td>
    <td colspan="3" height="3%" bgcolor="#E8EAD0" valign="top"><%include msg_include_menu.html%></td>
    <td rowspan="2" bgcolor="#008000" height="100%" width="1"><img src="<%image_url%>/pics/1pixel.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td height="97%" width="20%" valign="top"><%include msg_include_nav.html%></td></td>
    <td bgcolor="#008000" height="97%" width="1" valign="top"><img src="<%image_url%>/pics/1pixel.gif" width="1" height="1"></td>
    <td height="97%" width="80%" valign="top">
      <table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td><img src="<%image_url%>/pics/1pixel.gif" width="1" height="3"></td>
        </tr>
        <tr bgcolor="#C5E1A3">
          <td>
            <table width="100%" border="0" cellspacing="1" cellpadding="1">
              <tr class="bold_white">
                <td bgcolor="#336600">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr class="bold_white">
                      <td height="20"><img src="<%image_url%>/icons/search.gif" width='16' align="texttop" hspace="2" vspace="0">Find Message</td>
                      <td align="right">
                        <%set iclose = 1%>
                        <%include msg_include_icons.html%>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <form name=myform action="glist.cgi" method="post">
            <table width="100%" border="0" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" align=center>
                <%if msg%><tr class="body"><td align="center"><BR/><ul><%msg%><ul/></td></tr><%endif%>
              <tr>
                <td valign=top>
                  <table border="0" cellspacing="0" cellpadding="3" align="center">
                    <tr>
                      <td class="body" colspan="3"><BR /><li><b>Search Info</b></li></td>
                    </tr>
                    <tr>
                        <td class="body" nowrap>Message ID</td>
                        <td>
                          <input type="text" class="object" name="msg_id" size="10" value="<%if msg_id%><%msg_id%><%endif%>" />
                          <input type="hidden" class="object" name="msg_id-opt" size="10" value="=" />
                          <select name="msg_status" class="object">
                            <option value=''>----</option>
                            <option value="0">Draft</option>
                            <option value="1">Sent</option>
                          </select>
                        </td>
                        <td class="body" align="right">
                          <%if hits%>&nbsp;&nbsp;Folder
                            <select name="msg_cat_id_fk" class="object">
                              <option value=''>All</option>
                               <%loop results%>
                               <option value="<%cms_id%>" <%if msg_cat_id_fk eq $cms_id%>selected<%endif%>><%cms_name%></option>
                               <%endloop%>
                            </select>&nbsp;
                          <%endif%>
                        </td>
                      </tr>
                      <tr>
                        <td class="body">Subject</td>
                        <td colspan="2"><input type="text" class="object" name="msg_subject" size="<%if is_ie or is_mozilla%>45<%else%>20<%endif%>" value="<%if msg_subject%><%msg_subject%><%endif%>" /></td>
                      </tr>
                      <tr>
                        <td class="body">From Name</td>
                        <td colspan="2"><input type="text" class="object" name="msg_from_name" size="<%if is_ie or is_mozilla%>45<%else%>20<%endif%>" value="<%if msg_from_name%><%msg_from_name%><%endif%>" /></td>
                      </tr>
                      <tr>
                        <td class="body">From Email</td>
                        <td colspan="2"><input type="text" class="object" name="msg_from_email" size="<%if is_ie or is_mozilla%>45<%else%>20<%endif%>" value="<%if msg_from_email%><%msg_from_email%><%endif%>" /></td>
                      </tr>
                      <tr class="body">
                        <td valign="top" class="body">Created</td>
                        <td colspan="2">
                          <table cellpadding="0" cellspacing="0">
                            <tr>
                              <td class="body">From:<br /><input class="object" type="text" name="msg_created-ge" maxlength=30  size="<%if is_ie or is_mozilla%>12<%else%>10<%endif%>" value="<%if msg_created-ge%><%msg_created-ge%><%endif%>" /></td>
                              <td class="body">&nbsp;To:<br />&nbsp;<input class="object" type="text" name="msg_created-le" size="<%if is_ie or is_mozilla%>12<%else%>10<%endif%>" maxlength=30 value="<%if msg_created-le%><%msg_created-le%><%endif%>" /> <font size=1><%GList::language('SYS_DATE_FORMAT')%></font></td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr class="body">
                        <td class="body" valign="top">Message TEXT</td>
                        <td colspan="2"><textarea class="object" name="msg_content_text" cols="<%if is_ie or is_mozilla%>42<%else%>30<%endif%>" rows="2"><%if msg_content_text%><%msg_content_text%><%endif%></textarea></td>
                      </tr>
                      <tr class="body">
                        <td class="body" valign="top">Message HTML</td>
                        <td colspan="2"><textarea class="object" name="msg_content_html" cols="<%if is_ie or is_mozilla%>42<%else%>30<%endif%>" rows="2"><%if msg_content_html%><%msg_content_html%><%endif%></textarea></td>
                      </tr>
                      <%if usr_type%>
                      <tr class="body">
                        <td class="body">Username</td>
                        <td colspan="2">
                          <input type="text" class="object" name="msg_user_id_fk" size="<%if is_ie or is_mozilla%>29<%else%>20<%endif%>" value="" />
                          <select name="msg_user_id_fk-opt" class="object">
                            <option value="=">Exact Match</option>
                            <option value="<>">Not Equal</option>
                          </select>
                        </td>
                      </tr>
                      <%endif%>
                    <tr class="body">
                      <td class="body" colspan="3"><li><b>Search Options</b></li></td>
                    </tr>
                    <tr class="body">
                      <td class="body">Keyword search</td>
                      <td colspan=2><input class="object" name=keyword value="" size="<%if is_ie or is_mozilla%>45<%else%>20<%endif%>" /></td>
                    </tr>
                    <tr class="body">
                      <td class="body">Maximum hits</td>
                      <td width="35%"><input class="object" name=mh value="<%if mh%><%mh%><%else%>25<%endif%>" size=1 maxlength=2 /></td>
                      <td class="body" align="left">Match Any <input name="ma" value=1 type=checkbox /></td>
                    </tr>
                    <tr class="body">
                      <td class="body">Sort by</td>
                      <td colspan=2>
                        <select name=sb class="object">
                          <option value="msg_subject">Subject</option>
                          <option value="" selected>Created</option>
                        </select>
                        <select  name="so" class="object">
                          <option value="">---</option>
                          <option value="DESC">Descending</option>
                          <option value="ASC">Ascending</option>
                        </select>
                      </td>
                    </tr>
                    <tr>
                      <td align=center colspan="3">
                        <input name="bsearch" type=submit value=" Search " class="button" />
                        <input name="breset" type=reset value=" Reset " class="button" />
                      </td>
                    </tr>
                  </table>
                  <input type=hidden name="do" value="msg_search" />
                  <%hidden_objects%>
                  </form>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<%include include_footer.html%>
