<script type="text/javascript">
	$(document).ready(function () {
		<?php $this->load->view('partials/script_list.php'); ?>
	});
</script>

<div id="page-title" class="clearfix">
	<span style="font-size:24px;font-weight:bold;float:left;margin-top:5px;"><?php echo $nom; ?></span>
</div> <!-- /.page-title -->

<div class="row">
    <div class="span12">
        <div class="widget widget-table">
            <div class="widget-content">
                <div id="example_wrapper" class="dataTables_wrapper form-inline" role="grid">
                	<?php // if(isset($message)) echo $message;?>
                    <table id="list" class="table table-bordered table-striped table-highlight">
                        <thead>
                        	<?php foreach ($fields as $field_name => $field_display): ?>
                            	<th><?php echo $field_display; ?></th>
                            <?php endforeach; ?>
                        </thead>
                        <?php if($totalizador != 0): ?>
                            <tfoot>
                            	<tr>
                            		<th>Total</th>
                            		<th></th>
                            		<th><?php echo $totalizador; ?></th>
                            	</tr>
                            </tfoot>
                    	<?php endif; ?>
                        <form action="<?php echo base_url('admin/' . $dir . '/delete/'); ?>" id="delete-form" method="POST" class="form-horizontal">
                            <tbody>
                            	<?php foreach ($rows as $row): ?>
                            		<?php if ($this->session->userdata('ubicacion') != 'usuarios' || $row->id != 1): ?>
	                                	<tr>
	                                		<?php foreach ($fields as $field_name => $field_display): ?>
	                                			<?php if ($field_display == 'Total'): ?>
		                                        	<td><?php echo $row->$field_name; ?></td>
		                                    	<?php else: ?>
		                                        	<td><?php echo character_limiter($row->$field_name, 120); ?></td>
		                                        <?php endif; ?>
		                                    <?php endforeach; ?>
	                                	</tr>
                            		<?php endif; ?>
                            	<?php endforeach; ?>
                            </tbody>
                        </form>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>