<?php

function status($status_id)
{
	switch($status_id)
	{
		case 10:
			return 'new';
			break;
		
		case 20:
			return 'feedback';
			break;
		
		case 30:
			return 'acknowledged';
			break;
		
		case 40:
			return 'confirmed';
			break;
		
		case 50:
			return 'assigned';
			break;
		
		case 80:
			return 'resolved';
			break;
		
		case 90:
			return 'closed';
			break;
	}
}


function priority($status_id)
{
	switch($status_id)
	{
		case 10:
			return '-';
			break;
		
		case 20:
			return 'L';
			break;
		
		case 30:
			return 'N';
			break;
		
		case 40:
			return '<b>H</b>';
			break;
		
		case 50:
			return '<b>U</b>';
			break;
		
		case 60:
			return '<b>I</b>';
			break;
	}
}


function severity($severity_id)
{
	switch($severity_id)
	{
		case 70:
			return 'crash';
			break;
	
		case 50:
			return 'minor';
			break;
		
		case 60:
			return '<b>major</b>';
			break;
		
		case 80:
			return '<b>block</b>';
			break;
			
		default:
			return 'other';
	}
	
	$sor = 0;
}
?>

<form name="dropform" action="/partners/bugtracker" method="POST">

<?=form_dropdown('project',$dropdown,$project,"onchange='dropdown_go()'")?>

</form>

<div style="float:right;width:200px">
<form name="idselect" action="/partners/bugtracker" method="POST">

Search: <?=form_input(array('name'=>'id','size'=>10))?><?=form_submit('ok','ok')?>

</form>
</div>



	<?if($sorok):?>
		<table width="100%" cellpadding="2" cellspacing="0" border="0">
			<tr>
				<th width="40">ID</td>
				<th width="60">Status</td>
				<th width="20">P</td>
				<th width="60">Severity</td>
				<th width="auto">Short Description</td>
			</tr>
			<?foreach($sorok as $s):?>
				
				<?if($sorok++%2 == 0):?>
					<tr valign="top">
				<?else:?>
					<tr valign="top">
				<?endif;?>
			
				<tr valign="top">
					<td><?=$s->id?></td>
					<td><?=status($s->status)?></td>
					<td><?=priority($s->priority)?></td>
					<td><?=severity($s->severity)?></td>
					<td><?=$s->summary?></td>
				</tr>
			<?endforeach;?>
		</table>
	<?endif;?>



















<script type="text/javascript">
	function dropdown_go()
	{
		document.dropform.submit();
	}
</script>