<?php
$remark_id="";
$remark_category="";
$quote="";
$remark_table="exam_quote_list";

$title="";
if(isset($id)){
    // echo $id;
    $get_remark_data=$this->NewExamModel->get_item_data($id,$remark_table);
    if($get_remark_data){
        foreach($get_remark_data as $remark_data){
            $remark_id=$remark_data['id'];
            $remark_category=$remark_data['quote_type'];
            $quote=$remark_data['quote'];
            $title="Update Remark Data";
        }
    }else{
        $title="Add New Remark";
    }
    
}else{
    $title="Add New Remark";
}
?>

<style>
    .main-heading{font-size:26px;font-weight:600;}
    form{box-shadow:0 0 4px silver;padding:15px;margin-bottom:15px;}
</style>
<div class="container mt-3 bg-white">
    <div class="row">
        <div class="col-sm-12">
            
            <ul class="breadcrumb mt-3">
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>">Home</a></li>
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Examination">Exam</a></li>
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Examination/remarks">Remarks</a></li>
                <li class="breadcrumb-item"><?php echo $title; ?></li>
            </ul>
            
            
            <form method="post" action="#">
                <div class="text-center"><h1 class="main-heading"><?php echo $title; ?></h1><hr></div>
                <?php 
                if($success){
                ?>
                <div class="alert alert-success"><?php echo $success; ?></div>
                <?php
                }
                if($error){
                ?>
                <div class="alert alert-danger"><?php echo $error; ?></div>
                <?php
                }
                ?>
                <div class="form-group">
                    <label>Remark Category</label>
                    <select class="form-control" name="remark_category" required>
                        <option value="">-- Select Remark Category --</option>
                        <option value="Improvement" <?php if($remark_category == "Improvement"){ echo "selected"; }?>>Improvement</option>
                        <option value="Excellent" <?php if($remark_category == "Excellent"){ echo "selected"; }?>>Excellent</option>
                    </select>
                </div>
                <input type="hidden" name="remark_id" value="<?php echo $remark_id; ?>">
                <div class="form-group">
                    <label>Remark Quote</label>
                    <input type="text" class="form-control" name="remark" placeholder="Enter remark quote" value="<?php echo $quote; ?>" required>
                </div>
                
                <div class="form-group">
                    <button type="submit" name="add_remark" class="btn btn-sm btn-success">Submit</button>
                </div>
                
            </form>
            
        </div>
    </div>
</div>