<div class="mb-3 input-container">
    <label class="form-label">Category Name</label>
    <select class="form-control" type="text" name="cat_id">
        <option value="">----Select----</option>
        <?php

        foreach($categories as $c)
        {
        ?>
            <option value="<?php echo $c['cl_id'];?>" 
                    <?php
                    if(isset($data['cl_cat_id']) && $data['cl_cat_id'] == $c['cl_id'])
                    {
                        echo ' selected="selected" ';
                    }
                    ?>
                    
                    ><?php echo $c['cl_name'];?></option>
        <?php
        }
        ?>
    </select>
     <div class="error-input"></div>
</div>
<div class="mb-3 input-container">
    <label class="form-label">Type</label>
    <select class="form-control"  name="type">
        <option value="">----Select----</option>
        <option value="Food"  
                <?php 
                if(isset($data['cl_type']) &&  $data['cl_type'] == 'Food')
                {
                    echo 'selected="selected"';
                }
                ?>
                >Food</option>
        <option value="Drinks"
                <?php 
                if(isset($data['cl_type']) &&  $data['cl_type'] == 'Drinks')
                {
                    echo 'selected="selected"';
                }
                ?>
                >Drinks</option>
    </select>
     <div class="error-input"></div>
</div>
<div class="mb-3 input-container">
    <label class="form-label">Item Name</label>
    <input class="form-control" type="text" name="name" placeholder="Item Name" value="<?php if(isset($data['cl_name'])){echo $data['cl_name'];} ?>" />
     <div class="error-input"></div>
</div>
<div class="mb-3 input-container">
    <label class="form-label">Price</label>
    <input class="form-control" type="text" name="price" placeholder="Item Price" value="<?php if(isset($data['cl_price'])){echo $data['cl_price'];} ?>" />
     <div class="error-input"></div>
</div>
<div class="col-md-12 botm-cont">
    <button type="submit" class="track-btn btn btn-primary">Submit</button>
</div>