  <!--start main wrapper-->
    <main class="main-wrapper">
        <div class="main-content">

            <h3 class="fmon">Security Information </h3>




            <div class="row">
                <div class="col-md-7">

                    <div class="input-group border-15">
                        <span class="input-group-text  border-15"><img src="<?php echo base_url(); ?>assets/images/serIcon.png" alt=""
                                width="25px"></span>
                        <input type="text" name="" id="" class="form-control form-Search  border-15  py-2"
                            placeholder="search">
                    </div>

                </div>
                <div class="col-md-5 d-flex justify-content-end gap-2">

                    <a href="<?php echo base_url().'site/addsecurity'; ?>" class="btn addBtn d-flex gap-2 align-items-center"><img
                            src="<?php echo base_url(); ?>assets/images/megaIcons/aplu.png" alt="">Add Company</a>


                </div>
            </div>
            <div>
                <div class="table-responsive mt-3 ">
                    <table class="table table-striped table-hover">
                        <thead>
                            <tr>
                                <th scope="col">Name</th>
                                <th scope="col">Primary Contact</th>
                                <th scope="col">Tax ID</th>
                                <th scope="col">Email</th>
                                <th scope="col">Phone</th>
                                <th scope="col">Actions</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php foreach($securitycompanies as $key=>$securitycompany){ ?>
                            <tr>
                                <td><?php echo $securitycompany['name']; ?></td>
                                <td><?php echo $securitycompany['primaryContact']; ?></td>
                                <td><?php echo $securitycompany['taxId']; ?></td>
                                <td><?php echo $securitycompany['email']; ?></td>
                                <td><?php echo $securitycompany['phone']; ?></td>
                                <td>
                                    <div class="d-flex gap-2 align-items-end">
                                        <a href="#" class="" data-bs-toggle="modal" data-bs-target="#editModal<?php echo $key; ?>">
                                            <img src="<?php echo base_url(); ?>assets/images/viedit.png" alt="">
                                        </a>

                                        <a href="#" class="" data-bs-toggle="modal" data-bs-target="#deleteModal<?php echo $key; ?>">
                                            <img src="<?php echo base_url(); ?>assets/images/delr.svg" alt="">
                                        </a>

                                    </div>
                                </td>
                            </tr>
                            <div class="modal fade" id="deleteModal<?php echo $key; ?>" tabindex="-1" aria-labelledby="deleteModalLabel"
                        aria-hidden="true">
                        <div class="modal-dialog modal-dialog-centered">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h5 class="modal-title" id="deleteModalLabel">Confirm
                                        Deletion</h5>
                                    <button type="button" class="btn-close" data-bs-dismiss="modal"
                                        aria-label="Close"></button>
                                </div>
                                <div class="modal-body">
                                    Are you sure you want to delete this item? This action
                                    cannot be undone.
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-secondary"
                                        data-bs-dismiss="modal">Cancel</button>
                                    <a href="<?php echo base_url('site/deletesecurity/'.$key); ?>" class="btn btn-danger" id="confirmDelete">Delete</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- Edit Modal -->
                    <div class="modal fade" id="editModal<?php echo $key; ?>" tabindex="-1" aria-labelledby="editModalLabel"
                        aria-hidden="true">
                        <div class="modal-dialog modal-lg">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h5 class="modal-title" id="editModalLabel">Edit </h5>
                                    <button type="button" class="btn-close" data-bs-dismiss="modal"
                                        aria-label="Close"></button>
                                </div>
                                <form class="row" action="<?php echo base_url('site/updatesecurity/'.$key); ?>" method="post" enctype="multipart/form-data">
                                     <div class="modal-body">
                                    
                                        <div class="mb-3 col-lg-12">
                                            <label class="form-label">Name</label>
                                            <input type="text" class="form-control" required name="name" value="<?php echo $securitycompany['name']; ?>">
                                        </div>
                                        <div class="mb-3 col-lg-12">
                                            <label class="form-label">Legal Name</label>
                                            <input type="text" class="form-control" required name="legalName" value="<?php echo $securitycompany['legalName']; ?>">
                                        </div>
                                        <div class="mb-3 col-lg-12">
                                            <label class="form-label">Primary Contact</label>
                                            <input type="text" class="form-control" required name="primaryContact" value="<?php echo $securitycompany['primaryContact']; ?>">
                                        </div>
                                        <div class="mb-3 col-lg-12">
                                            <label class="form-label">Phone</label>
                                            <input type="text" class="form-control" required name="phone" value="<?php echo $securitycompany['phone']; ?>">
                                        </div>
                                        <div class="mb-3 col-lg-12">
                                            <label class="form-label">Phone 2</label>
                                        <input type="text" class="form-control" name="phone2" value="<?php echo $securitycompany['phone2']; ?>">
                                        </div>
                                        <div class="mb-3 col-lg-12">
                                            <label class="form-label">Tax ID</label>
                                            <input type="text" class="form-control" required name="taxId" value="<?php echo $securitycompany['taxId']; ?>">
                                        </div>
                                        <div class="mb-3 col-lg-12">
                                            <label class="form-label">Email</label>
                                            <input type="email" class="form-control" required   
                                                name="email" value="<?php echo $securitycompany['email']; ?>">
                                        </div>
                                    
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-secondary"
                                            data-bs-dismiss="modal">Close</button>
                                        <button type="submit" class="btn btn-primary">Save Changes</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>

                            <?php } ?>
                        </tbody>
                    </table>
                    <!-- delete modal -->
                  
                  
                </div>
            </div>
        </div>
        </div>
        </div>
        </div>

    </main>
    <!--end main wrapper-->
