<?php if ($this->_vars['base']['account']['status'] != STATUS_GUEST): ?>
<?php include VIEW_DIR.'mobile/common/menu/private.tpl'; ?><?php else : ?>
<?php include VIEW_DIR.'mobile/common/menu/public.tpl'; ?><?php endif; ?>

<?php if (empty($this->_vars['v_com_community'])):?>
	<?php _e('Sorry, no results found.'); ?><br>
	<img src="<?php e(BASE_URL); ?>resource/img/icons/group_edit.gif" width="16" height="16" alt="&gt;">&nbsp;<a href="<?php e(HTTP_ACTION);?>community/setting/community/0/"><?php e('Create new Community'); ?></a><br><br>
	<?php loadPlugin::callFunc('hitsuji_banner', POSITION_MOBILE); ?><br>
<?php else: ?>
<?php HTML::mobilePager($this->_vars['p_com_community']); ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
<?php foreach ($this->_vars['v_com_community'] as $_row): ?>
	<tr><td width="90" bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center"><font size="<?php Theme::exec()->fontSize(); ?>">
		<?php loadPlugin::callFunc('hitsuji_community', $_row['id'], 'vSmall,community'); ?>
		[&nbsp;<?php e($this->_vars['reference']['com_category'][$_row['ref_category']]); ?>&nbsp;]</font>
	<br></td><td bgcolor="<?php Theme::exec()->bgColor(); ?>"><font size="<?php Theme::exec()->fontSize(); ?>">
		<?php HTML::strimWidth($_row['comment']); ?><br>
		<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Members'); ?></font>:&nbsp;<?php e(number_format($_row['member_num'])); ?>
		&lt;<a href="<?php e(HTTP_ACTION); ?>community/view/community/<?php e($_row['id']); ?>/"><?php _e('View'); ?></a>&gt;</font>
	<hr color="<?php Theme::exec()->bgColor(); ?>" noshade="noshade"></td></tr>
<?php endforeach; ?>
</table>
<?php HTML::mobilePager($this->_vars['p_com_community']); ?>
<?php endif; ?>
<hr color="<?php Theme::exec()->borderColor(); ?>" noshade="noshade">

<?php if ($this->_vars['base']['account']['status'] != STATUS_GUEST): ?>
<font size="<?php Theme::exec()->fontSize(); ?>"><img src="<?php e(BASE_URL); ?>resource/img/icons/group_edit.gif" width="16" height="16" alt="&gt;"><a title="<?php _e('Setting Community'); ?>" style="width:16px; display:inline;" href="<?php e(HTTP_ACTION);?>community/setting/community/0/"><?php e('Create Community'); ?></a></font><br>
<?php endif; ?>
<font size="<?php Theme::exec()->fontSize(); ?>">
<img src="<?php e(BASE_URL); ?>resource/img/icons/bulletin_find.gif" width="16" height="16" align="absmiddle" /><a href="<?php e(HTTP_ACTION);?>community/forum/search/"><?php _e('Search for Topic'); ?></a><br>
<img src="<?php e(BASE_URL); ?>resource/img/icons/event_find.gif" width="16" height="16" align="absmiddle" /><a href="<?php e(HTTP_ACTION);?>community/event/search/"><?php _e('Search for Event'); ?></a><br>
<img src="<?php e(BASE_URL); ?>resource/img/icons/page_find.gif" width="16" height="16" align="absmiddle"><a href="<?php e(HTTP_ACTION);?>community/article/search/"><?php _e('Search for Article'); ?></a><br></font>


<form method="post" action="<?php e(HTTP_ACTION); ?>community/view/search/"><?php HTML::requires(); ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
<ul class="sideList">
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Community Name');?>:<br></td></tr>
	<tr><td><input type="text" name="community" value="<?php e($this->_vars['r_com_community']['community']); ?>"><br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Keyword');?>:<br></td></tr>
	<tr><td><input type="text" name="keyword" value="<?php e($this->_vars['r_com_community']['keyword']); ?>"><br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Category');?>:<br></td></tr>
	<tr><td><select name="ref_category"><option value=""><?php _e('- Select One -'); ?></option><?php HTML::options($this->_vars['reference']['com_category'], $this->_vars['r_com_community']['ref_category']); ?></select><br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Region');?>:<br></td></tr>
	<tr><td><select name="ref_region"><option value=""><?php _e('- Select One -'); ?></option><?php HTML::options($this->_vars['reference']['ara_region'], $this->_vars['r_com_community']['ref_region']); ?></select><br></td></tr>
<?php if (!empty($this->_vars['order_label'])): ?>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Sort by');?>:<br></td></tr>
	<tr><td><?php HTML::radio('order', $this->_vars['order_label'], $this->_vars['r_com_community']['order'], '<br>'); ?><br></td></tr>
<?php endif; ?>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center"><input type="submit" name="search" value="<?php _e('Search');?>"><br></td></tr>
</table>
</form>
