<?php 
/***
Auth: Vastvikta Nishad
Date: 06 Feb 2024
Description:Delete and Update Status
*/
$msg='';
$id = isset($_GET['id']) ? base64_decode($_GET['id']) : '';
$statusData = getStatusData($link, $id);
$status = isset($statusData['ticketstatus']) ? $statusData['ticketstatus'] : '';
?>
<div id="success"><?php echo $msg; ?></div>
<form id="mastersrcat" method="post" action="">
    <input name="id" id="id" type="hidden" value="<?= $id ?>">
        <span class="breadcrumb_head" style="height:37px;padding:9px 16px"><?= (!empty($id) ? "Edit" : "New") ?> STATUS</span>
            <div class="style2-table">
                    <div class="table">
                        <table class="tableview tableview-2 main-form">
                            <tbody>
                            <?php 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>
                            <?php } ?>
                            <tr>
                                <td colspan="2" class="left">
                                    <label>Status Name<em>*</em></label>
                                    <div class="log-case">
                                        <input name="status" id="status" type="text" value="<?=$status?>" class="input-style1">
                                    </div>
                                    <center>
                                    <?php if ($id !== false && $id !== '') { ?>
                                        <input name="Update" type="submit" value="Update" class="button-orange1" id="submitclkstatus" style="float: inherit;" />
                                    <?php } else { ?>
                                        <input name="Submit" type="submit" value="Create" class="button-orange1" id="submitclkstatus" style="float: inherit;" />
                                    <?php } ?>
                                    </center>
                                </td>
                            </tr>
                            </tbody>
                    </table>
            </div>
            </div>
</form>
