<div class="main-content">
    <!--breadcrumb-->
    <h3 class="fmon">Patients</h3>
    <div class="my-2">
        <div class="table-responsive">
            <table id="example" class="table tableStriped">
                <thead>
                    <tr>
                        <th scope="col fColorred">
                            <p class="fColorred mb-0">Name</p>
                        </th>
                        <th scope="col fColorred">
                            <p class="fColorred mb-0">Email</p>
                        </th>
                        <th scope="col fColorred">
                            <p class="fColorred mb-0">Phone</p>
                        </th>
                        <th scope="col fColorred">
                            <p class="fColorred mb-0">Cage ID</p>
                        </th>
                        <th scope="col fColorred">
                            <p class="fColorred mb-0">Observations</p>
                        </th>
                        <th scope="col fColorred">
                            <p class="fColorred mb-0">Next Treatment</p>
                        </th>
                        <th scope="col fColorred">
                            <p class="fColorred mb-0">Status</p>
                        </th>
                        <th scope="col fColorred">
                            <p class="fColorred mb-0">Actions</p>
                        </th>
                    </tr>
                </thead>
                <tbody>
                 <?php foreach($patient as $p=>$data){ 
                    //echo "<pre>";
                    //print_r($data);
                    //echo "</pre>";
                    
                    ?>
                    <!-- Add table rows with data here -->
                 
                    <tr>
                        <td><?php echo $data['customerinfo']['firstName']." ".$data['customerinfo']['lastName']; ?></td>
                        <td><?php echo $data['customerinfo']['email']; ?></td>
                        <td><?php echo $data['customerinfo']['phoneNumber']; ?></td>
                        <td><?php echo $p; ?></td>
                        <td>
                            <p class="card oCard fColorred px-2">Dystocia +2</p>
                        </td>
                        <td>Next Treatment...</td>
                        <td>
                            <p class="card oCard fColorred px-2"><?php echo $data['status']; ?></p>
                        </td>
                        </td>
                        <td>
                            <div class="dropdown">
                                <button class="btn " type="button" id="dropdownMenuButton" data-bs-toggle="dropdown"
                                    aria-expanded="false">
                                    <i class="fa-solid fa-ellipsis-vertical"></i>
                                </button>
                                <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                                   <?php if($data['status']=="pending"){ ?> 
                                <li><a class="dropdown-item" href="<?php echo base_url().'patient/accept/'.$p; ?>">Approve</a></li>
                                
                                    <?php }else if($data['status']=="approved"){?>
                                <li><a class="dropdown-item" href="#">Approved</a></li>
                                   <?php  }else{} ?>
                                    <li><a class="dropdown-item" href="<?php echo base_url().'patient/delete/'.$p; ?>">Delete</a></li>
                                </ul>
                            </div>

                        </td>
                    </tr>
                    <!-- Add more rows as needed -->
                 <?php } ?>
                </tbody>
            </table>
        </div>
    </div>

</div>