<div class="col-sm-10 form-group">
    <div class="row">
        <input type="hidden" id="baseUrl" value="<?php echo base_url() ?>">
    </div>

    <div class="row gray_ttc">
        <div class="col-sm-12 form-group" style="padding: 0">
            <div class="col-sm-12 white form-group" >
                <div class="col-sm-12 gray_ttc" style="margin-left: 5px">
                    <div class="col-sm-12 form-group" style="border-bottom: 1px solid #80c12c; display: block">
                        <span class=" col-sm-6  form-group">
                            <h3 id="branchHeaderName" style="margin: 0">Add Bank Branch Name</h3>
                        </span> 
                        <span class=" col-sm-6 form-group text-right" id="add_bank_name_button" style="padding-top: 8px">
                            <a href="javascript:void(0)" class="btn btn-success text-right" id="addBankBranchForm"><i class="fa fa-plus-circle" title="Add Forbidden"></i></a>
                        </span>
                    </div>

                    <div class="col-sm-12 form-group" id="viewBankBranchForm" style="display: none">
                        <?php
                        $url = 'admin/save-bank-branch'; //formID4
                        echo form_open($url, 'id="formID4" name="bankBranchFORM"');
                        ?>
                        <div class="col-sm-12 padding-zero">
                            <div class="form-group col-sm-6">
                                <div class="input-group ">
                                    <select data-errormessage-value-missing="Bank name is required!"  
                                            class="form-control validate[required]" 
                                            name="bank_id" 
                                            id="bank_id">
                                        <option value="">Select Bank Name</option>
                                        <?php
                                        foreach ($all_bank as $value) {
                                            echo '<option value="' . $value->bank_id . '">' . $value->bank_name . '</option>';
                                        }
                                        ?>
                                    </select>
                                    <span class="input-group-addon" id="basic-addon1" title="Please Select Menu"><i class="fa fa-book"></i></span>
                                </div>
                                <div class="col-sm-12" id="bank_name_error" style="color: red;display: none;"></div>
                            </div>
                            <div class="form-group col-sm-6">
                                <div class="input-group">
                                    <input type="text"
                                           id="bank_branch_name"
                                           name="bank_branch_name" 
                                           class="form-control validate[required,custom[bankBranchNameExistence]]"
                                           placeholder="Enter Bank Branch Name...."
                                           value=""
                                           aria-describedby="basic-addon1">
                                    <span class="input-group-addon" id="basic-addon1"><i class="fa  fa-link"></i></span>
                                </div>
                                <input type="hidden" id="bank_branch_name_exists" value="">
                            </div>
                        </div>

                        <div class="col-sm-12 padding-zero">
                            <div class="form-group col-sm-6">
                                <label class="col-sm-2 text-left padding-zero" for="bank_status"> Status : &nbsp;</label>
                                <div class="radio radio-success col-sm-10 margin-zero" >
                                    <input type="radio"
                                           data-errormessage-value-missing="Please Select Bank Branch Status" 
                                           class="validate[required]" 
                                           name="bank_branch_status" 
                                           id="active" 
                                           value="1">
                                    <label for="Active">Active</label>
                                    <span style="margin-right: 30px"></span>
                                    <input type="radio" 
                                           data-errormessage-value-missing="Please Select Bank Branch Status" 
                                           class="validate[required]" 
                                           name="bank_branch_status" 
                                           id="pending" 
                                           value="2">
                                    <label for="Pending">Pending</label>
                                </div>
                            </div>
                            <div class="form-group col-sm-2 ">
                                <a href="javascript:void(0)" class="btn btn-success" id="cancelBankBranchForm"><i class="fa fa-times"></i></a>
                                <button type="submit" class="btn btn-success"><i class="fa fa-save"></i></button>
                            </div>
                        </div>
                        <?php echo form_close(); ?>

                        <div class="form-group col-sm-12"><br></div>
                    </div>
                </div>




                <!--Update Bank form start-->
                <div class="col-sm-12 gray_ttc" style="margin-left: 5px;display: none" id="updateBankBranchForm">    
                    <?php
                    $url1 = 'admin/update-bank-branch'; //formID4
                    echo form_open($url1, 'id="formID2" name="updateBankBranchForm"');
                    ?>
                    <input type="hidden" id="bankBranchId" name="bank_branch_id" value="">
                    <div class="col-sm-12 padding-zero">
                        <div class="form-group col-sm-6">
                            <div class="input-group ">
                                <select data-errormessage-value-missing="Bank name is required!"  
                                        class="form-control validate[required]" 
                                        name="edit_bank_id" 
                                        id="edit_bank_id">
                                    <option value="">Select Bank Name</option>
                                    <?php
                                    foreach ($all_bank as $value) {
                                        echo '<option value="' . $value->bank_id . '">' . $value->bank_name . '</option>';
                                    }
                                    ?>
                                </select>
                                <span class="input-group-addon" id="basic-addon1" title="Please Select Menu"><i class="fa fa-book"></i></span>
                            </div>
                        </div>
                        <div class="form-group col-sm-6">
                            <div class="input-group">
                                <input type="text"
                                       id="edit_bank_branch_name"
                                       name="edit_bank_branch_name" 
                                       class="form-control validate[required,custom[editBankBranchNameExistence]]"
                                       placeholder="Enter Bank Branch Name...."
                                       value=""
                                       aria-describedby="basic-addon1">
                                <span class="input-group-addon" id="basic-addon1"><i class="fa  fa-link"></i></span>
                            </div>
                            <input type="hidden" id="edit_bank_branch_name_exists" value="">
                        </div>
                    </div>

                    <div class="col-sm-12 padding-zero">
                        <div class="form-group col-sm-6">
                            <label class="col-sm-2 text-left padding-zero" for="bank_status"> Status : &nbsp;</label>
                            <div class="radio radio-success col-sm-10 margin-zero" >
                                <input type="radio"
                                       data-errormessage-value-missing="Please Select Bank Branch Status" 
                                       class="validate[required]" 
                                       name="edit_bank_branch_status" 
                                       id="active" 
                                       value="1">
                                <label for="Active">Active</label>
                                <span style="margin-right: 30px"></span>
                                <input type="radio" 
                                       data-errormessage-value-missing="Please Select Bank Branch Status" 
                                       class="validate[required]" 
                                       name="edit_bank_branch_status" 
                                       id="pending" 
                                       value="2">
                                <label for="Pending">Pending</label>
                            </div>
                        </div>
                        <div class="form-group col-sm-2 ">
                            <a href="javascript:void(0)" class="btn btn-success" id="cancelBankBranchForm"><i class="fa fa-times"></i></a>
                            <button type="submit" class="btn btn-success"><i class="fa fa-save"></i></button>
                        </div>
                    </div>
                    <?php echo form_close(); ?>

                    <div class="form-group col-sm-12"><br></div>
                </div>
                <!--Update Bank form end-->


            </div>




            <div class="col-sm-12 white form-group">
                <div class="col-sm-12 gray_ttc" style="margin-left: 5px" >
                    <div class="col-sm-12 form-group" style="border-bottom: 1px solid #80c12c;">
                        <span class=" col-sm-12  form-group">
                            <h3 style="margin: 0">Manage Bank</h3>
                        </span> 
                    </div>

                    <div class="col-sm-12 form-group white" id="editManage">
                        <div class="col-sm-12 gray_ttc form-group" style="margin-left: 5px;border-bottom: 1px solid #80c12c">
                            <div class="form-group col-sm-5">
                                <strong>Bank Name</strong>
                            </div>
                            <div class="form-group col-sm-4">
                                <strong>Bank Branch Name</strong>
                            </div>
                            <div class="form-group col-sm-3">
                                <strong> Action</strong>
                            </div>
                        </div>
                        <span class="col-sm-12 text-center text-danger" id="message">
                            <?php
                            if (isset($message)) {
                                echo $message;
                                $this->session_unset_userdata('message');
                            }
                            ?>
                        </span>
                        <div class="col-sm-12  form-group"> </div>
                        <div id="manageBankBranchView" class="col-sm-12 padding-zero">
                            <?php
                            foreach ($all_bank_branchs as $value) {
                                ?>
                                <div id="singleBankBranchView<?php echo $value->bank_branch_id; ?>" class="col-sm-12  form-group" style="margin-left: 5px;background: #ededed;">
                                    <div class="col-sm-5" id="bankName<?php echo $value->bank_id; ?>" style="padding-top: 5px;padding-bottom: 5px; color: #80c12c; cursor: pointer;">
                                        <?php echo $bank_name[$value->bank_branch_id]->bank_name ?>
                                    </div>
                                    <div class="col-sm-4 " style="padding-top: 5px;padding-bottom: 5px">
                                        <?php echo $value->bank_branch_name ?>
                                    </div>
                                    <div class="col-sm-3 " style="padding-top: 5px;padding-bottom: 5px">
                                        <a href="javascript:void(0)" id="editBankBranceName<?php echo $value->bank_branch_id; ?>">
                                            <i class="fa fa-edit" title="Edit"></i>
                                        </a>
                                        <span>&nbsp;&nbsp;</span>

                                        <span id="statusBranchAction<?php echo $value->bank_branch_id; ?>" class="padding-zero">
                                            <?php
                                            if ($value->bank_branch_status == 1) {
                                                ?>
                                                <a href="javascript:void(0)"  id="pendingBankBranchName<?php echo $value->bank_branch_id; ?>" >
                                                    <i class="fa fa-user-times" title="Pending"></i>
                                                </a><span>&nbsp;&nbsp;</span>       
                                                <?php
                                            } else {
                                                ?>
                                                <a href="javascript:void(0)"  id="activeBankBranchName<?php echo $value->bank_branch_id; ?>" >
                                                    <i class="fa fa-user-plus" title="Acitve"></i>
                                                </a><span>&nbsp;&nbsp;</span>   
                                                <?php
                                            }
                                            ?>
                                        </span>
                                        <a href="javascript:void(0)"  id="deleteBankBranchName<?php echo $value->bank_branch_id; ?>" >
                                            <i class="fa fa-trash" title="Delete"></i>
                                        </a>                                           
                                    </div>
                                </div>

                                <div class="modal fade" style="" id="viewActiveBankBranchModal<?php echo $value->bank_branch_id; ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                                    <?php
                                    $message = '<span style="text-align:center">Are you sure you want to active Bank Branch?</span>';
                                    $this->cf->view_modal('branchActive' . $value->bank_branch_id, $message);
                                    ?>
                                </div>
                                <div class="modal fade" style="" id="viewPendingBankBranchModal<?php echo $value->bank_branch_id; ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                                    <?php
                                    $message1 = '<span style="text-align:center">Are you sure you want to pending Bank Branch?</span>';
                                    $this->cf->view_modal('branchPending' . $value->bank_branch_id, $message1);
                                    ?>
                                </div>
                                <div class="modal fade" style="" id="viewDeleteBankBranchModal<?php echo $value->bank_branch_id; ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                                    <?php
                                    $message2 = '<span style="text-align:center">Are you sure you want to delete Bank Branch?</span>';
                                    $this->cf->view_modal('branchDelete' . $value->bank_branch_id, $message2);
                                    ?>
                                </div>
                                <?php
                            }
                            echo $pagination_link;
                            ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="col-sm-10 form-group ">
    <div class="col-sm-12 gray">
        <label>&nbsp;&nbsp;<a href="<?php echo base_url() ?>">Dashboard </a>->> Forbidden</label>
    </div>
</div>


<script type="text/javascript" src="<?php echo base_url() ?>back_end_resource/payment/bank.js"></script>