<?php
/***
Auth: Vastvikta Nishad
Date: 24 Jan 2024
Description: To Create and Update Province 
*/
$msg = '';
$id = isset($_GET['id']) ? base64_decode($_GET['id']) : '';

//function defined in web_admin_function.php 
$cityData = getCityData($link, $id);
$city = isset($cityData['city']) ? $cityData['city'] : '';
?>
<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"><?php echo(!empty($id) ? "Edit" : "New") ?> PROVINCE</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 for="city">Province Name<em>*</em></label>
                            <div class="log-case">
                                <input name="city" id="city" type="text" value="<?php echo  $city ?>" class="input-style1">
                            </div>
                            <center>
                            <?php if ($id !== false && $id !== '') { ?>
                                <input name="Update" type="submit" value="Update" class="button-orange1" id="submitclkcity" style="float: inherit;" />
                            <?php } else { ?>
                                <input name="Submit" type="submit" value="Create" class="button-orange1" id="submitclkcity" style="float: inherit;" />
                            <?php } ?>
                            </center>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</form>
