<?php
$date_fields=array('posted','created','updated');
?>

<?php if ($rows):?>
    <table class="report-table" style="width:100%;">
	    <tr>
		<?php foreach($rows[0] as $key=>$value):?>
        	<th><?php echo $key;?></th>
	    <?php endforeach;?>	
        </tr>
        
		<?php foreach($rows as $row):?>
            <tr>
				<?php foreach($row as $key=>$value):?>
                	<?php if (in_array($key,$date_fields)):?>
                    	<td><?php echo date("m-d-Y",$value);?></td>
                    <?php else:?>
                    	<td><?php echo $value;?></td>
                    <?php endif;?>
                <?php endforeach;?>	
            </tr>
        <?php endforeach;?>
    </table>
<?php else:?>    
No results found
<?php endif;?>