<style>
    .form-group input[type="checkbox"] {
        display: none;
    }

    .form-group input[type="checkbox"] + .btn-group > label span {
        width: 20px;
    }

    .form-group input[type="checkbox"] + .btn-group > label span:first-child {
        display: none;
    }
    .form-group input[type="checkbox"] + .btn-group > label span:last-child {
        display: inline-block;   
    }

    .form-group input[type="checkbox"]:checked + .btn-group > label span:first-child {
        display: inline-block;
    }
    .form-group input[type="checkbox"]:checked + .btn-group > label span:last-child {
        display: none;   
    }
    #mira-application-update{
        border: 2px solid #dddddd;
    }
    #mira-application-update > thead > tr > th,
    #mira-application-update > tbody > tr > th,
    #mira-application-update > tfoot > tr > th,
    #mira-application-update > thead > tr > td,
    #mira-application-update > tbody > tr > td,
    #mira-application-update > tfoot > tr > td {
        border: 2px solid #dddddd;

    }
    #mira-application-update{
        width: 100%;
        overflow-x: scroll;
    }
    
    
    
    #mira-application-update{
        border: 2px solid #dddddd;
    }
    #mira-application-update > thead > tr > th,
    #mira-application-update > tbody > tr > th,
    #mira-application-update > tfoot > tr > th,
    #mira-application-update > thead > tr > td,
    #mira-application-update > tbody > tr > td,
    #mira-application-update > tfoot > tr > td {
        border: 2px solid #dddddd;

    }
    #mira-application-update{
        width: 100%;
        overflow-x: scroll;
    }
    #admin-user-right{
        border: 2px solid #dddddd;
    }
    #admin-user-right > thead > tr > th,
    #admin-user-right > tbody > tr > th,
    #admin-user-right > tfoot > tr > th,
    #admin-user-right > thead > tr > td,
    #admin-user-right > tbody > tr > td,
    #admin-user-right > tfoot > tr > td {
        border: 2px solid #dddddd;

    }
    #admin-user-right{
        width: 100%;
        overflow-x: scroll;
    }

</style>
<div class="panel"> 
    <div class="panel-body">
        <form role="form" class="form-horizontal" action="<?= base_url('assign_app_admin'); ?>" method="POST" enctype="multipart/form-data">
            <h2 class="text-center">Mira Application Assign To Admin</h2>  
            <hr class="colorgraph">

            <div class="panel">
                <div class="panel-body">
                    <table id="mira-application-update" class="table table-bordred table-striped">
                        <thead>
                            <tr>
                                <th colspan="4"><h4 class="text-center"> <strong>Application Details</strong></h4></th>
                        </tr>
                        <tr>
                            <th class="text-center">Application Name</th>
                            <th class="text-center">Application ID</th>
                            <th class="text-center">Create Date Time</th>
                            <th class="text-center">Select</th>
                        </tr>
                        </thead>
                        <tbody>
                            <?php if(isset($application) and $application){
                                for($i=0;$i<count($application);$i++){?>
                            <tr>
                                <td class="text-center"><?= $application[$i]['app_name']?></td>
                                <td class="text-center"><?= "ZMQ".$application[$i]['app_id']?></td>
                                <td class="text-center"><?= date('d-m-Y',  strtotime($application[$i]['app_create_date']))?></td>
                                <td class="text-center"><input type="radio" required class="checkthis" name="app_id" value=<?= $application[$i]['app_id']?>></td>
                            </tr>
                            <?php }}?>
                        
                        </tbody>
                    </table>
                    <table id="mira-application-update" class="table table-bordred table-striped">
                        <thead>
                            <tr>
                                <th colspan="5"><h4 class="text-center"> <strong>Admin User Details</strong></h4></th>
                        </tr>
                        <tr>
                            <th class="text-center">Name</th>
                            <th class="text-center">Login Id</th>
                            <th class="text-center">Password</th>
                            <th class="text-center">Mobile</th>
                            <th class="text-center">Select</th>
                        </tr>
                        </thead>
                        <tbody>
                            <?php if(isset($user) and $user){for($i=0;$i<count($user);$i++){?>
                              <tr>
                                <td class="text-center"><?= $user[$i]['admin_name']?></td>
                                <td class="text-center"><?= $user[$i]['admin_login_id']?></td>
                                <td class="text-center"><?= $user[$i]['admin_password']?></td>
                                <td class="text-center"><?= $user[$i]['mobile']?></td>
                                <td class="text-center"> <input type="radio" required class="checkthis" name="user_id" value=<?= $user[$i]['admin_id']?>></td>
                            </tr>  
                            <?php }}?>
                            
                        </tbody>
                    </table>
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <div class="row" style="margin-left: 30px">
                                <input type="hidden" value=<?= count($right)?> name="count_number">                                
                                <?php for ($i = 0; $i < count($right); $i++) { ?>
                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <input type="checkbox" name=<?="right".$i?> id=<?="right".$i?> autocomplete="off" value=<?=$right[$i]['right_id']?>>
                                            <div class="btn-group">
                                                <label for="<?="right".$i?>" class="btn btn-primary btn-sm">
                                                    <span class="glyphicon glyphicon-ok"></span>
                                                    <span> </span>
                                                </label>
                                                <label for="<?="right".$i?>" class="btn btn-default btn-sm active">
                                                    <strong><?=$right[$i]['right_name']?></strong>
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                <?php } ?>
                            </div>        
                        </div>
                    </div>

                </div>
            </div>

            <div class="row">
                <div class="col-md-6 col-md-offset-3">
                    <?php $this->load->view('mira_alert_message'); ?>
                </div>
            </div>
            <hr class="colorgraph">
            <div class="row">
                <div class="col-xs-8 col-md-4 col-md-offset-4 col-xs-offset-2"><input type="submit" value="Assign To Admin" class="btn btn-primary btn-lg btn-block"></div>            
            </div>
        </form>
    </div>
</div>
