<style>
    .required{
        color: #bf5050;
       }
    
</style>
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Query Board</h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">

                      <?php
                        if(!empty($records))
                        {
                            foreach($records as $row)
                            {?>
                              <div class="item form-group">
                       
                                <div class="col-md-10 col-sm-10 col-xs-12">
                                 
                                <div class="row">
                                    <div class="col-md-1">
                                        <img width="70px" height="70px" src="<?php echo base_url();?>assets/images/user.png">
                                    </div>
                                    <div class="col-md-11">
                                        
                                         <h4><b><?php echo $row['first_name'];?></b> <small><?php echo date('d-m-Y H:m:s',strtotime($row['insert_log']));?></small></h4>   
                                         <h4><?php echo $row['description'];?></h4>
                                    </div>
                                    
                                </div>    
                                 
                                </div>
                                
                              </div> 
                              <br><br><br><br>
                       <?php }
                       } ?>
                       <br><br><br><br><br>
                      <div class="item form-group">
                       
                        <div class="col-md-8 col-sm-8 col-xs-12">
                          <textarea name="query" placeholder="Leave question here" rows="5" id="query" class="form-control"></textarea>
                        </div>
                         <input style="margin-top:7%" id="save_query" type="button" class="btn btn-success" value="Submit">
                      </div>
                      
                 
                  </div>
                </div>
              </div>
          </div>
        </div>
        </div>
  
<script>
$(document).ready(function(){

$("#save_query").on('click',function(e){
    var query=$("#query").val();
    if(query!="")
    {
         $.ajax({
            type: "POST",
            data:{query:query,user_id:<?php echo $user_id;?>,lec_id:<?php echo $lec_id;?>},
            url: "<?php echo base_url();?>Syllabus/save_query",
            success: function(msg){
               location.reload(true);
            }
        });
    }else{
        $.notify("Please enter your query", "danger");
    }
   
 });
});
</script> 
  </body>
</html>