<script>
    function set_estado(form_ide,esta_ide){
        open_cargar("Espere un momento...");
        param={
            form_ide:form_ide,
            esta_ide:esta_ide
        };
        $.post("<?php echo site_url("admin/set_estado"); ?>",param,function(data){
            open_cargar("Actualizando");
            location.reload();
        });
    }
    function eliminar(form_ide){
        set_estado(form_ide,3);
    }
    function activar(form_ide){
        set_estado(form_ide,1);
    }
</script>
<table class="table table-hover table-bordered">
    <thead>
        <tr>
            <th width="05%">NRO</th>
            <th width="65%">FORMA DE REGISTRO</th>
            <th width="15%">ESTADO</th>
            <th width="15%">OPCIONES</th>
        </tr>
    </thead>
    <tbody>
    <?php $c=1; foreach ($formas as $reg): ?>
        <tr>
            <td><?php echo $c++; ?></td>
            <td><?php echo $reg->form_nombre; ?></td>
            <td style="color:<?php echo $reg->esta_color; ?>"><b><?php echo $reg->esta_nombre; ?></b></td>
            <td>
                <?php if($reg->esta_ide==1){ ?>
                <a href="#" class="red" onclick="eliminar(<?php echo $reg->form_ide; ?>)">
                    <span class="glyphicon glyphicon-trash"></span>
                    Eliminar
                </a>
                <?php }else{ ?>
                <a href="#" class="green" onclick="activar(<?php echo $reg->form_ide; ?>)">
                    <span class="glyphicon glyphicon-ok"></span>
                    Activar
                </a>   
                <?php } ?>
            </td>
        </tr>
    <?php endforeach ?>
    </tbody>
</table>