<?php
if (isset($tpl['status']))
{
	$status = __('status', true);
	switch ($tpl['status'])
	{
		case 2:
			pjUtil::printNotice(NULL, $status[2]);
			break;
	}
} else {
	$titles = __('error_titles', true);
	$bodies = __('error_bodies', true);
	if (isset($_GET['err']))
	{
		pjUtil::printNotice(@$titles[$_GET['err']], @$bodies[$_GET['err']]);
	}
	?>
	<div class="ui-tabs ui-widget ui-widget-content ui-corner-all b10">
		<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
			<li class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a href="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminComments&amp;action=pjActionIndex"><?php __('menuComments'); ?></a></li>
		</ul>
	</div>
	
	<?php pjUtil::printNotice(@$titles['AC10'], @$bodies['AC10']); ?>
	
	<div class="b10">
		<form action="" method="get" class="float_left pj-form frm-filter">
			<input type="text" name="q" class="pj-form-field pj-form-field-search w150" placeholder="<?php __('btnSearch', false, true); ?>" />
			<button type="button" class="pj-button pj-button-detailed"><span class="pj-button-detailed-arrow"></span></button>
		</form>
		<?php
		$rs = __('comment_statuses', true);
		?>
		<div class="float_right t5">
			<a href="#" class="pj-button btn-all"><?php __('lblAll'); ?></a>
			<a href="#" class="pj-button btn-filter btn-status" data-column="status" data-value="Confirmed"><?php echo $rs['Confirmed']; ?></a>
			<a href="#" class="pj-button btn-filter btn-status" data-column="status" data-value="New"><?php echo $rs['New']; ?></a>
		</div>
		<br class="clear_both" />
	</div>
	
	<div class="pj-form-filter-advanced" style="display: none">
		<span class="pj-menu-list-arrow"></span>
		<form action="" method="get" class="form pj-form pj-form-search frm-filter-advanced">
			<div class="float_left w350">
				<p>
					<label class="title"><?php __('lblKeyword'); ?></label>
					<input type="text" name="q" class="pj-form-field w150" placeholder="<?php __('btnSearch', false, true); ?>" />
				</p>
			</div>
			<div class="float_right w350">
				<p>
					<label class="title"><?php __('vk_listing'); ?></label>
					<select name="listing_id" class="pj-form-field w200">
						<option value="">-- <?php __('lblChoosePackage'); ?> --</option>
						<?php
						foreach ($tpl['listing_arr'] as $item)
						{
							?><option value="<?php echo $item['id']; ?>"><?php echo pjSanitize::html($item['title']); ?></option><?php
						}
						?>
					</select>
				</p>
			</div>
			<br class="clear_both" />
			<p>
				<label class="title">&nbsp;</label>
				<input type="submit" value="<?php __('btnSearch', false, true); ?>" class="pj-button" />
				<input type="reset" value="<?php __('btnCancel', false, true); ?>" class="pj-button" />
			</p>
		</form>
	</div>

	<div id="grid"></div>
	<script type="text/javascript">
	var pjGrid = pjGrid || {};
	pjGrid.queryString = "";
	<?php
	if (isset($_GET['listing_id']) && (int) $_GET['listing_id'] > 0)
	{
		?>pjGrid.queryString += "&listing_id=<?php echo (int) $_GET['listing_id']; ?>";<?php
	}
	$statuses = __('comment_statuses', true);
	?>
	var myLabel = myLabel || {};
	myLabel.title = "<?php __('vk_title'); ?>";
	myLabel.datetime = "<?php __('lblPostedDateTime'); ?>";
	myLabel.name = "<?php __('vk_name'); ?>";
	myLabel.listing = "<?php __('vk_listing'); ?>";
	myLabel.export_selected = "<?php __('vk_export_selected'); ?>";
	myLabel.delete_selected = "<?php __('vk_delete_selected'); ?>";
	myLabel.delete_confirmation = "<?php __('vk_delete_confirmation'); ?>";
	myLabel.status = "<?php __('lblStatus'); ?>";
	myLabel.new_stat = "<?php echo $statuses['New']; ?>";
	myLabel.confirmed_stat = "<?php echo $statuses['Confirmed']; ?>";
	myLabel.inactive = "<?php __('vk_inactive'); ?>";
	myLabel.lblEdit = "<?php __('lblEdit', false, true);?>";
	myLabel.lblDelete = "<?php __('lblDelete', false, true);?>";
	</script>
	<?php
}
?>