<H2>Masowa zmiana statusu dokumentów </H2>
<form method="post" action="index.php">
<input type="hidden" value="change_status" name="action">
<input type="hidden" value="EcmSales" name="module">
<?php 
global $app_list_strings;
if(count($_REQUEST['mass'])>0){
	foreach ($_REQUEST['mass'] as $id){
		?>
		<input value="<?php echo $id;?>" type="hidden" name="selected[]">
		<?php 
	}
}
?>
Wybierz status: <select name="status">
<?php 
foreach ($app_list_strings['ecmsales_status_dom'] as $key=>$value){
	?>
	<option value="<?php echo $key;?>"><?php echo $value;?></option>
	<?php 
}
?>
<input type="submit" value="Zmień status">
</select>
</form> 
<?php 
if(count($_REQUEST['selected'])>0){
	$db=$GLOBALS['db'];
	foreach ($_REQUEST['selected'] as $id){
		$db->query("update ecmsales set status='".$_POST['status']."' where id='".$id."'");
	}
	header("Location: index.php?module=EcmSales&action=index");
}
?>