<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
<style type="text/css">
<!--
h4{
	font:
}

td{
	font: 8pt "Arial";
    color: black;
}

th{
	font: 8pt "Arial";
    color: black;
}

a{
	font: 8pt "Arial";
    color: black;
}
//-->
</style>

<title>Seaching EMail Messages</title>

<script type="text/javascript">
<!--
function printwin(url){
	var str = "width=" + 750 + ",height=" + 550 + ",toolbar=0,location=0,directories=0,status=0,menubar=yes,scrollbars=yes,resizable=1,left=100,top=100";
	||ifinstr||user_agent||msie||
		var win = open(url, "", str, 'POPUP');
	||else||
		var win = open(url, "", str, 'POPUP');
		win.focus();
	||endif||
}

function setTitle(){
	||ifequal||top||_top||
		window.top.document.title = "||message_text||cust_title|| - ||message_text||current_user|| - Search Messages";
	||endif||
}
//-->
</script>
</head>

<body background="||cust_panel_background||" bgcolor="||cust_panel_bgcolor||" onload="setTitle();">

||ifdef||error||
	<center>
	<table border="1">
		<tr>
			<td><img src="||nwimg||/attention.gif" alt="Attention" /></td>
			<td bgcolor="ffffff">||error||</td>
		</tr>
	</table>
	</center>
||endif||


||ifequal||connection_type||mpop||
	||define||connection_type||pop||
||endif||
||ifequal||use_imap_local_search||true||
	||define||connection_type||pop||
||endif||

<form method="post" action="||action||">
	<input type="hidden" name="utoken" value="||utoken||" />
	<input type="hidden" name="cmd" value="" />
	<input type="hidden" name="attach_id" value="||attach_id||" />
	
	<table border="0">
	<tr>
		<td>
			<h4>EMail Search</h4>
			<select name="multi_sel_fld" size="7" multiple="multiple">
			||begin_fld_short||
				<option value="||fld_name||" ||ifinstr||multi_sel_fld||fld_name||selected="selected"||endif||>||fld_name||</option>
			||end_fld_short||
			</select>
		</td>
		<td>
			<table>
			<tr>
				<td align="right">From:</td>
				<td><input type="text" size="24" name="search_from" value="||html_text||search_from||" /></td>
				<td>eg. lynden</td>
			</tr>
			<tr>
				<td align="right">Subject:</td>
				<td><input type="text" size="24" name="search_subject" value="||html_text||search_subject||" /></td>
			||ifequal||connection_type||pop||
				<td>eg. wor?ers</td>
			||else||
				<td>eg. workers</td>
			||endif||
			</tr>

			<tr>
				<td align="right">Message Body:</td>
				<td><input type="text" size="24" name="search_body" value="||html_text||search_body||" /></td>
				<td>eg. test message</td>
			</tr>
			||ifnequal||connection_type||pop||
			<tr>	<td align="right">&nbsp;</td>
				<td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="imap_search_whole_body" value="on" checked>
					Match the Body words as is. <br>
					When ticked it will search for 'test message'<br />
					When unticked it will search for 'test' and 'message'.

				</td>
				<td>&nbsp;</td>
			</tr>
			||endif||

			<tr>
				<td align="right">To:</td>
				<td><input type="text" size="24" name="search_to" value="||html_text||search_to||" /></td>
				<td>eg. lynden</td>
			</tr>
			||ifnequal||connection_type||pop||
			<tr>
				<td align="right">Charset:</td>
				<td>	<select name="charset">
						<option value="US-ASCII">US-ASCII (Default)</option>
						<option value="UTF-8">UTF-8</option>
						<option value="BIG5">BIG5</option>
						<option value="iso-2022-jp">iso-2022-jp</option>
					</select>
				</td>
				<td>&nbsp;</td>
			</tr>

			||endif||
			<tr>
			||ifequal||connection_type||pop||
				<td align="right">Max Search Size:</td>
				<td>
					<select name="search_body_size" size="1">
						<option value="0">All</option>
						<option value="1">1k</option>
						<option value="2">2k</option>
						<option value="4" selected="selected">4k</option>
						<option value="8">8k</option>
						<option value="16">16k</option>
						<option value="32">32k</option>
					</select>
				</td>
			||else||
				<td colspan="2">&nbsp;</td>
			||endif||
				<td colspan="3"><input type="submit" name="dosearch" value="search" /></td>
			</tr>
			||ifequal||connection_type||pop||
				<tr>
				<td align="right"><input type="checkbox" name="search_mode" ||ifnempty||search_mode||checked="checked"||endif|| /></td>
				<td>Or Search Mode</td>
				</tr>
			||else||
				<td colspan="2">&nbsp;</td>
			||endif||
			<tr>
				<td colspan="3"><b>Note:</b> When searching the body of Email messages, searching my take longer.</td>
			</tr>
			</table>
		</td>
	</tr>
	</table>

</form>


	<table border="0" bgcolor="ffffff" width="100%">
	<tr bgcolor="#D6D6CE">
		<th>Folder</th>
		<th>Subject</th>
		<th>From</th>
		<th>Date</th>
		<th>Time</th>
		<th>Bytes</th>
		<th>Attach</th>
	</tr>

||define||max_line_count||2||
		||begin_search||
		<tr bgcolor="#ffffff">
			<td><a href="||action||?cmd=||ifdef||_nopreview||list||else||show||endif||&amp;page=framelist&amp;listcmd=list&amp;folder=||h_folder||&amp;utoken=||utoken||&amp;&amp;">||h_folder||</a></td>
			<td nowrap="nowrap">
				<a href="javascript:printwin('||action||?cmd=item-||h_uidl||&amp;utoken=||utoken||&amp;folder=||h_folder||&amp;&amp;')" >||lchop||h_subject||40||</a>
				<img src="||nwimg||/iunseen||h_isunseen||.gif" alt="" />
			</td>
			<td>||h_from_personal||</td>
			<td>||h_date_day||</td>
			<td nowrap="nowrap">||h_date_time||</td>
			<td>||h_bytes||</td>
			<td>||h_attach||</td>
		</tr>
		||end_search||
	</table>
</body>
</html>
