<?php
/***
 * Auth: Vastvikta Nishad
 * Date:  18 Feb 2024
 * Description: To Display and Delete Disposition
 * 
*/
?>
<div class="style2-table">
<div class="style-title">
<h3>Disposition</h3>
<div class="row">
<?php $new_disposition = base64_encode('new_disposition');?>
    <div class="col-sm-3" style="text-align: end;">
    <a href="admin_index.php?token=<?php echo $new_disposition;?>" class="button-orange1">New Disposition </a>
    </div>
    </div>  
    <div id="success"></div>
    <form name="frmService" action="" method="post">
        <div class="table" id="SRallview"> 
            <div class="">
                <div class="div2">
                    <table class="tableview tableview-2" id="admin_table">
                        <thead>
                        <tr class="background">
                            <td align="left" width="10%">S.No.</td>
                            <td align="left">Disposition</td>
                            <td align="left" width="10%">Action</td>
                        </tr>
                        </thead>
                        <tbody>
                            <?php 
                       
                            $res = getDisposition();
                           
                            if (mysqli_num_rows($res) == 0) {
                                echo '<tr><td colspan="3" align="center" class="contentred">No records found!</td></tr>';
                             } else {
                                $count = 1;
                            while ($row_doc = mysqli_fetch_array($res))
                            {
                                $new_disposition = base64_encode('new_disposition');
                                $id = base64_encode($row_doc['I_ID']);
                               
                                ?>
                            <tr>
                            <td align="left"><?php echo  $count ?></td>
                            <td align="left"><?php echo $row_doc['V_DISPO'];?></td>
                            <td align="left">
                            <a href='javascript:void(0)' onclick="window.location.href='admin_index.php?token=<?php echo $new_disposition ;?>&id=<?php echo $id ?>';">

                            <img src="<?php echo$SiteURL?>public/images/edit-icon.png" border="0" alt="Edit" />
                            </a>
                            <a href='javascript:void(0);' data-id="<?php echo $row_doc['I_ID'] ?>" class="disposition_delete">
                                <img src="<?php echo $SiteURL?>public/images/delete-icon.png" border="0"  alt="delete">
                            </a>
                            </td>
                            </tr>
                            <?
                            $count++;
                            } }
                            ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </form>
</div>
