<?php
if (isset($tpl['status']))
{
	$status = __('status', true);
	switch ($tpl['status'])
	{
		case 2:
			pjUtil::printNotice(NULL, $status[2]);
			break;
	}
} else {
	if (isset($_GET['err']))
	{
		$titles = __('error_titles', true);
		$bodies = __('error_bodies', true);
		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>
	
	<div class="b10">
		<form action="" method="get" class="float_left pj-form frm-filter">
			<select name="listing_id" id="listing_id" class="pj-form-field w300">
				<option value="">-- <?php __('lblChoosePackage'); ?> --</option>
				<?php
				foreach ($tpl['listing_arr'] as $item)
				{
					?><option value="<?php echo $item['id']; ?>"><?php echo pjMultibyte::substr(stripslashes($item['title'] . sprintf(" (%s)", $item['listing_refid'])), 0, 50); ?></option><?php
				}
				?>
			</select>
		</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-confirmed"><?php echo $rs['Confirmed']; ?></a>
			<a href="#" class="pj-button btn-new"><?php echo $rs['New']; ?></a>
		</div>
		<br class="clear_both" />
	</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.csrf_token = "<?php echo pjAppController::getCsrfToken(); ?>";
	</script>
	<?php
}
?>