<style>
    #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;
    } 
</style>
<div class="panel"> 
    <div class="panel-body">

        <table id="mira-application-update" class="table table-bordred table-striped">
            <thead>
                <tr>
                    <th colspan="7"><h4 class="text-center"> <strong>Admin User Details</strong></h4></th>
            </tr>
            <tr>
                <th class="text-center">Admin ID</th>
                <th class="text-center">Admin Name</th>
                <th class="text-center">Login ID</th>
                <th class="text-center">Password</th>
                <th class="text-center">Phone</th>
                <th class="text-center">Create Date</th>
                <th class="text-center">Current Status</th>
                
                
            </tr>
            </thead>
            <tbody>
                <?php for ($i = 0; $i < count($application); $i++) {  ?>
                <tr>
                    <td class="text-center"><?= "ZMQ".$application[$i]['admin_id'] ?></td>
                    <td class="text-center"><?= $application[$i]['admin_name'] ?></td>
                    <td class="text-center"><?= $application[$i]['admin_login_id'] ?></td>
                    <td class="text-center"><?= $application[$i]['admin_password'] ?></td>
                    <td class="text-center"><?= $application[$i]['mobile'] ?></td>
                    <td class="text-center"><?= date('d-m-Y',  strtotime($application[$i]['admin_create_date']));?></td>
                    <?php if($application[$i]['admin_mapping_status']){?>
                    <td class="text-center"><span class="label label-success">Assigned</span></td>
                   <?php }  else {?>
                       <td class="text-center"><span class="label label-info">Unassigned</span></td>
                    <?php  }?>
                    
                                      
                </tr>
                    <?php }  ?>

            </tbody>
        </table>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {


        // This script get district.
        $('#state').change(function () {
            $('#district').children('option:not(:first)').remove();
            $('#state_spinner').css('display', 'block');
            $.ajax({
                url: '<?= base_url('getDistrict') ?>',
                data: {
                    state_code: $(this).val()
                },
                type: "POST",
                success: function (json) {
                    var states = $.parseJSON(json);
                    for (var i = 0; i < states['district'].length; i++) {
                        $("#district").append($("<option></option>").val(states['district'][i]['district_code']).html(states['district'][i]['district_name']));
                    }
                    $('#state_spinner').css('display', 'none');
                },
                error: function (xhr, status, errorThrown) {
                    $('#state_spinner').css('display', 'none');
                },
                complete: function (xhr, status) {
                    $('#state_spinner').css('display', 'none');
                }
            });

        });
    });
</script>

