<?php 
$ssctg=$db->query('select *from tbl_categ_su where ctg_id ="'.$_REQUEST['s'].'"');
$ffctgr=$ssctg->fetch();
?>
<form id="" action="gate?b=ssctg" method="POST" enctype="multipart/form-data" autocomplete="off">
 <div class="row">
    <div class="col-md-10" style="background-image: url(../img/placeholders/inner-texture-bg.png); border-radius: 8px;">
      <div style='border-radius: 8px;border: 2px solid #7E9350;width:100%;margin-top:1%;margin-bottom:1%;'>
        <br/>
        <center>
           <b style="font-family: century gothic;font-size: 23px;"><i class="fa fa-info-circle"></i> update.</b>
        </center>
        <br/>

        <div class="row">
        <div class="col-md-1"></div>
            <input type="hidden" name="ctg_id" value="<?php echo $ffctgr['ctg_id'];?>">
            <label class="col-form-label col-3 col-lg-3 form-label text-lg-right">Category Name<span class="required" style="color:red">*</span></label>
            <div class="col-sm-6">
            <textarea type="text" name="categName" rows="2" class="form-control" placeholder="Write here..." required><?php echo $ffctgr['ctg_name'];?></textarea>
            </div>
        </div>
        <br>

        <div class="row">
        <div class="col-md-1"></div>
            <label class="col-form-label col-3 col-lg-3 form-label text-lg-right">S/S Type<span class="required" style="color:red">*</span></label>
            <div class="col-sm-6">
                <select class="select2 form-control w-100" name="stype" id="stype" data-placeholder="-select type-" required>
                    <option></option>
                    <?php
                    $stmt = $db->query('SELECT *FROM tbl_s_s');
                    try
                    {
                        while ($rrr = $stmt->fetch(PDO::FETCH_ASSOC)) {
                            if($ffctgr['ss_type']==$rrr['ss_id']){
                        ?>
                           <option value="<?php echo $ffctgr['ss_type']; ?>" selected><?php echo $rrr['namesu']; ?></option>
                        <?php }else{ ?>
                            <option value="<?php echo $rrr['ss_id']; ?>"><?php echo $rrr['namesu']; ?></option>
                        <?php
                        }
                        }
                    }
                        catch (PDOException $ex) {
                        //Something went wrong rollback!
                        echo $ex->getMessage();
                    }
                    ?>	
                </select>
            </div>
        </div>
        <br>
        
        <hr>
        <center>
            <button type="reset" class="btn btn-default btn-sm" style="border-radius: 4px;">Reset</button>
            <button class="btn btn-primary btn-sm" name="updateSctg" style="border-radius: 4px;" type="submit" id="">Update</button>
        </center>
         <br>
    </div> <!--border -->
    </div>
  </div>
</form>