<?php 
/***
 * Auth: Vastvikta Nishad
 * Date: 14  Feb 2024
 * Description: Edit IMAP Settings 
 * 
*/
error_reporting(E_ALL);
ini_set('display_errors', 1);
$msg = '';
$id = base64_decode($_GET['id']);
$res = IMAPData($link,$id);
?>
<div id="success"><?php echo $msg; ?></div>
<form id="mastersrcat" method="post" action="">
    <input name="id" id="id" type="hidden" value="<?php echo  $id ?>">
        <span class="breadcrumb_head" style="height:37px;padding:9px 16px">Edit IMAP Setitngs </span>
            <div class="style2-table">
                <div class="table">
                    <table class="tableview tableview-2 main-form">
                        <tbody>
                        <? if($msg!=''){?>
                            <tr>
                                <td colspan="2"
                                    style="color:#ffffff; width:100%; background:#00CC66; padding:5px; border:1px solid #02944b; text-align:center;">
                                    <?php echo $msg?>
                                </td>
                            </tr>
                            <? } ?>
                            <tr>
                                <td class="left">
                                    <label>Connection Name<em>*</em></label>
                                    <div class="log-case">
                                        <input name="v_connectionname" id="v_connectionname" type="text"
                                                class="input-style1" value="<?php echo $res['v_connectionname']?>">
                                    </div>
                                </td>
                                <td class="left">
                                    <label>IMAP Address<em>*</em></label>
                                    <div class="log-case">
                                        <input name="v_ipaddress" id="v_ipaddress" type="text"
                                                class="input-style1" value="<?php echo $res['v_ipaddress']?>">
                                    </div>
                                </td>
                            </tr>
                        
                            <tr>
                                <td class="left">
                                    <label>Username<em>*</em></label>
                                    <div class="log-case">
                                        <input name="v_username" id="v_username" type="text"
                                                class="input-style1" value="<?php echo $res['v_username']?>">
                                    </div>
                                </td>
                                <td class="left">
                                    <label>Password<em>*</em></label>
                                    <div class="log-case">
                                        <textarea name="v_pasowrd" id="v_pasowrd" cols=""
                                        rows="4" class="text-area1"><?php echo $res['v_pasowrd']?></textarea>
                                    </div>
                                </td>
                                
                            </tr>
                            <tr>
                                <td class="left">
                                    <label>Type<em>*</em></label>
                                    <div class="log-case">
                                        <input name="v_type" id="v_type" type="text"
                                                class="input-style1" value="<?php echo $res['v_type']?>">
                                    </div>
                                </td>
                                <td class="left">
                                    <label>CC Mail ID</label>
                                    <div class="log-case">
                                        <input name="cc_mail_id" id="cc_mail_id" type="email"
                                                class="input-style1" value="<?php echo $res['cc_mail_id']?>">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="left">
                                    <label>Client id<em>*</em></label>
                                    <div class="log-case">
                                            <input name="v_client_id" id="v_client_id" type="text"
                                                class="input-style1" value="<?php echo $res['v_client_id']?>">
                                    </div>
                                </td>
                                <td class="left">
                                    <label>Client Secret<em>*</em></label>
                                    <div class="log-case">
                                            <input name="v_client_secret" id="v_client_secret" type="text"
                                                class="input-style1" value="<?php echo $res['v_client_secret']?>">
                                    </div>
                                </td>
                
                            </tr>
                            <tr>
                                <td class="left" colspan="2">
                                    <label>Tenant<em>*</em></label>
                                    <div class="log-case">
                                            <input name="v_tenant" id="v_tenant" type="text"
                                                class="input-style1" value="<?php echo $res['v_tenant']?>">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                        <td colspan="2">
                        <center>
                            <input name="Update" type="submit" value="Update" class="button-orange1" id="submitclkimap" style="float:inherit">
                        </center>
                        </td>                                        
                        </tr>   
                        </tbody>
                    </table>
                </div>
            </div>
</form>