<div class="body-content">
                        <div class="row">
                            <div class="col-md-8">
                                <div class="card mb-4">
                                    <div class="card-header">
                                        <div class="d-flex justify-content-between align-items-center">
                                            <div>
                                                <h6 class="fs-17 font-weight-600 mb-0">Certificates</h6>
                                            </div>
                                            
                                        </div>
                                    </div>
                                    <div class="card-body">
                                     <?php if($this->session->flashdata("msgc")){echo $this->session->flashdata("msgc");}?>
                                      <?php if(isset($_GET['cerid'])){
						$edit=$this->db->get_where("certificates",array("cerid"=>$_GET['cerid']))->row();?>
                        <form class="form-inline" action="<?php echo base_url();?>admin/update_cert" method="post" enctype="multipart/form-data">
                            
                            <input type="hidden" name="tid" value="<?php echo $edit->cerid;?>" />
                              <div class="form-group">
                              	<label>Type</label>
                                <select class="form-control" name="cer_type" required>
                                	<option value="">Select Type</option>
                <option value="CiscoCertifications" <?php if($edit->cer_type=="CiscoCertifications"){echo "selected";}?>>CiscoCertifications</option>
                <option value="NoCiscoCertifications" <?php if($edit->cer_type=="NoCiscoCertifications"){echo "selected";}?>>NoCiscoCertifications</option>
                <option value="CiscoProducts" <?php if($edit->cer_type=="CiscoProducts"){echo "selected";}?>>CiscoProducts</option>
                <option value="NoCiscoProducts" <?php if($edit->cer_type=="NoCiscoProducts"){echo "selected";}?>>NoCiscoProducts</option>
                                </select>
                              </div>
                              <div class="form-group "> 
                                <input type="text" required class="form-control" value="<?php echo $edit->cer_title	;?>"  name="cer_title">
                              </div>
                              <button type="submit" class="btn btn-success">Update</button>
                            </form>
                        <?php }else{?>
                        <form class="form-inline" action="<?php echo base_url();?>admin/add_cert" method="post" enctype="multipart/form-data">
                              <div class="form-group">
                                <select class="form-control" name="cer_type" required>
                              		<option value="">Select Type</option>
                                	<option value="CiscoCertifications">CiscoCertifications</option>
                                    <option value="NoCiscoCertifications">NoCiscoCertifications</option>
                                    <option value="CiscoProducts">CiscoProducts</option>
                                    <option value="NoCiscoProducts">NoCiscoProducts</option>
                                </select>
                              </div>
                              
                              <div class="form-group "> 
                                <input type="text" placeholder="Certificate Name" required class="form-control" name="cer_title">
                              </div>
                              <button type="submit" class="btn btn-success">Add</button>
                            </form>
                        <?php }?><hr/>
                        <table class="table">
                            <thead><tr><th>S.No.</th><th>Type</th><th>Title</th><th>Action</th></tr></thead>
                            <tbody>
                                <?php $i=1;foreach($certs as $t){?>
                                <tr><td><?php echo $i;?></td>
                                    <td><?php echo $t->cer_type;?></td>
                                    <td><?php echo $t->cer_title;?>
                                    </td>
                                    <td><a href="<?php echo base_url().'admin/techs?tid='.$t->cerid;?>" class="btn btn-sm btn-warning"><i class="fa fa-edit"></i></a>
        <a href="#" id="<?php echo $t->cerid;?>" class="btn btn-sm btn-danger dept_delete"><i class="fa fa-trash"></i></a></td></tr><?php $i++;}?>
                            </tbody>
                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div><!--/.body content-->
                </div><!--/.main content-->
                
            </div><!--/.wrapper-->
        </div>
        <!--Global script(used by all pages)-->
        <script>
$(document).ready(function(){
	
	$(".dept_delete").click(function(e){e.preventDefault();
	if(!confirm("Sure you want to delete?")){
		  return false;
		}
		var id=$(this).attr("id");$(this).closest("tr").remove();
		$.ajax({
			 type: "POST",
			 url: '<?php echo base_url();?>admin/ajax_cert_delete',
			 data: {id:id},
			 success: function(response){
				 //alert(response);
			 }
		});
	});
});
</script>
        <script src="<?php echo base_url();?>admin_assets/dist/js/popper.min.js"></script>
        <script src="<?php echo base_url();?>admin_assets/plugins/bootstrap/js/bootstrap.min.js"></script>
        <script src="<?php echo base_url();?>admin_assets/plugins/metisMenu/metisMenu.min.js"></script>
        <script src="<?php echo base_url();?>admin_assets/plugins/perfect-scrollbar/dist/perfect-scrollbar.min.js"></script>
        <!-- Third Party Scripts(used by this page)-->

        <!--Page Active Scripts(used by this page)-->
        <script src="<?php echo base_url();?>admin_assets/dist/js/pages/forms-basic.active.js"></script>
        <!--Page Scripts(used by all page)-->
        <script src="<?php echo base_url();?>admin_assets/dist/js/sidebar.js"></script>
    </body>
</html>