<?php
/***
 * Auth: Vastvikta Nishad
 * Date: 13 Feb 2024
 * Description: Display IMAP and SMTP Settings
 * 
*/
?>
<div class="style2-table">
    <div class="style-title">
        <h3>View IMAP Settings </h3>
    </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">S.No.</td>
                                <td align="left">Connection Name</td>
                                <td align="left">IMAP Address</td>
                                <td align="left">Username</td>
                                <td align="left">Type</td>
                                <td align="left">CC Mail ID</td>
                                <td align="left">Modify</td>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $result= getIMAPData();
                            $no = 0;
                            while ($res = mysqli_fetch_array($result)) {
                                $new_imap = base64_encode('new_imap');
                                $id = base64_encode($res['I_ID']);
                                $no++;
                            ?>
                                <tr>
                                    <td align="left"><?php echo  $no ?></td>
                                    <td align="left"><?php echo  $res['v_connectionname'] ?></td>
                                    <td align="left"><?php echo  $res['v_ipaddress'] ?></td>
                                    <td align="left"><?php echo  $res['v_username'] ?></td>
                                    <td align="left"><?php echo  $res['v_type'] ?></td>
                                    <td align="left"><?php echo  $res['cc_mail_id'] ?></td>
                                    <td>
                                    <a href='javascript:void(0)' onclick="window.location.href='admin_index.php?token=<?php echo $new_imap ;?>&id=<?php echo $id ?>';">
                                                <img src="<?php echo$SiteURL?>public/images/edit-icon.png" border="0" alt="Edit" />
                                            </a>
                                    </td>
                                </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </form>

<div class="style2-table">
    <div class="style-title">
        <h3>View SMTP Settings </h3>
    </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_table2">
                        <thead>
                            <tr class="background">
                                <td align="left">S.No.</td>
                                <td align="left">Port No.</td>
                                <td align="left">Username</td>
                                <td align="left">Server</td>
                                <td align="left">TLS</td>
                                <td align="left">Debug</td>
                                <td align="left">Modify</td>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $result = getSMTPData();
                            $no = 0;
                            while ($res = mysqli_fetch_array($result)) {
                                $new_smtp = base64_encode('new_smtp');
                                $id = base64_encode($res['id']);
                                $no++;
                            ?>
                                <tr>
                                    <td align="left"><?php echo  $no ?></td>
                                    <td align="left"><?php echo  $res['i_port'] ?></td>
                                    <td align="left"><?php echo  $res['v_username'] ?></td>
                                    <td align="left"><?php echo  $res['v_server'] ?></td>
                                    <td align="left"><?php echo  $res['i_tls'] ?></td>
                                    <td align="left"><?php echo  $res['i_debug'] ?></td>
                                    <td>
                                    <a href='javascript:void(0)' onclick="window.location.href='admin_index.php?token=<?php echo $new_smtp ;?>&id=<?php echo $id ?>';">
                                                <img src="<?php echo$SiteURL?>public/images/edit-icon.png" border="0" alt="Edit" />
                                            </a>
                                    </td>
                                </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </form>
</div>
                            </div>
