 <script src="//cdn.ckeditor.com/4.7.3/standard/ckeditor.js"></script>
 <link href="<?php echo base_url();?>admin_assets/plugins/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
  <div class="body-content">
                        <div class="card mb-4">
                            <div class="card-body">
                            <?php if($this->session->flashdata("msg")){echo $this->session->flashdata("msg");}?>
                            	<?php if($this->uri->segment(3)){$edit=$this->db->get_where("projects",array("pro_id"=>$this->uri->segment(3)))->row();
								$ttt=explode(",",$edit->ptechs);?>
                                <form action="<?php echo base_url().'admin/update_project';?>" method="post">
                                		<input type="hidden" name="proid" value="<?php echo $this->uri->segment(3);?>" />
                                    	<div class="row">
                                        <div class="form-group col-md-9">
                                        	<label>Project Title</label>
                                            <input type="text" value="<?php echo $edit->pro_title;?>" placeholder="Enter Project Title" name="pro_title" required class="form-control" />
                                        </div>
                                        <div class="form-group col-md-3">
                                        	<label>Last Apply Date</label>
                                            <input type="date" placeholder="" value="<?php echo $edit->last_date;?>" name="last_date" required class="form-control" />
                                        </div>
                                        </div>
                                        <p>Select Technologies</p>
                                        <div class="row">
                                        	<?php $techs=$this->db->get('techs')->result();
											foreach($techs as $t){?>
                                           	<div class="checkbox checkbox-inline">
                                                <input type="checkbox" <?php if(in_array($t->tid,$ttt)){echo "checked";}?> id="check<?php echo $t->tid;?>" value="<?php echo $t->tid;?>" name="techs[]">
                                                <label for="check<?php echo $t->tid;?>"> <?php echo $t->tech_name;?></label>
                                            </div>
                                            <?php }?>
                                        </div>
                                        <div class="form-group">
                                        	<label>Project Description</label>
                                            <textarea required class="form-control" name="editor1"><?php echo $edit->pdesc;?></textarea>
                                        </div>
                                        <button type="submit" class="btn btn-success">Update Project</button>	
                                </form>
                                <?php }else{?>
                                <form action="<?php echo base_url().'admin/post_project';?>" method="post" id="addform" style="display:none;">
                                    	<div class="row">
                                        <div class="form-group col-md-9">
                                        	<label>Project Title</label>
                                            <input type="text" placeholder="Enter Project Title" name="pro_title" required class="form-control" />
                                        </div>
                                        <div class="form-group col-md-3">
                                        	<label>Last Apply Date</label>
                                            <input type="date" placeholder="" name="last_date" required class="form-control" />
                                        </div>
                                        </div>
                                        <p>Select Technologies</p>
                                        <div class="row">
                                        	<?php $techs=$this->db->get('techs')->result();
											foreach($techs as $t){?>
                                           	<div class="checkbox checkbox-inline">
                                                <input type="checkbox" id="check<?php echo $t->tid;?>" value="<?php echo $t->tid;?>" name="techs[]">
                                                <label for="check<?php echo $t->tid;?>"> <?php echo $t->tech_name;?></label>
                                            </div>
                                            <?php }?>
                                        </div>
                                        <div class="form-group">
                                        	<label>Project Description</label>
                                            <textarea required class="form-control" name="editor1"></textarea>
                                        </div>
                                        <button type="submit" class="btn btn-success">Add Project</button>	
                                        <button type="button" class="btn btn-success addform">Cancel</button>	
                                </form>
                                
                                        <button type="button" class="btn btn-success addform float-right">Add New Project</button>	
                                <?php }?>
                                <div class="table-responsive">
                                    <table class="table display table-bordered table-striped table-hover basic">
                                        <thead>
                                            <tr>
                                            	<th>S.No.</th>
                                                <th>ProjectID</th>
                                                <th>PostDate</th>
                                                <th>Title</th>
                                                <th>Techs</th><th>Last Date</th>
                                                <th>Action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        	<?php $i=1;foreach($projects as $u){?>
                                            <tr>
                                        <td><?php echo $i;?></td>
                                        <td><?php echo $u->pro_id;?></td>
                                        <td><?php echo $u->post_date;?></td>
                                        <td><?php echo $u->pro_title;?></td>
                                        <td><?php $techs=explode(",",$u->ptechs);
										foreach($techs as $t){
											$tt=$this->db->get_where("techs",array("tid"=>$t))->row();
											 echo '<label class="badge badge-success">'.$tt->tech_name.'</label>&nbsp;&nbsp;';}?></td>
                                        <td><?php echo $u->last_date;?></td>
                                        <td>
                                        <a href="<?php echo base_url().'admin/proposals/'.$u->pro_id;?>" target="_blank" class="btn btn-sm btn-success"><?php echo $this->db->get_where("applied",array("pro_id"=>$u->pro_id))->num_rows();?> Proposals</a>
                                       <a href="<?php echo base_url().'admin/projects/'.$u->pro_id;?>" target="_blank" class="btn btn-sm btn-warning"><i class="fa fa-edit"></i></a>
                                        <a href="#" id="<?php echo $u->pro_id;?>" class="btn btn-sm btn-danger proj_delete"><i class="fa fa-trash"></i></a></td>
                                            </tr>
                                            <?php $i++;}?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                       
                        <!--Language - Comma decimal place-->
                        
                        <!--Language options-->
                        
                    </div><!--/.body content-->
                </div><!--/.main content-->
                <!--/.footer content-->
                <div class="overlay"></div>
            </div><!--/.wrapper-->
        </div>
        <!--Global script(used by all pages)-->
        <script>
		CKEDITOR.replace( 'editor1' );
		$(".addform").click(function(){
			$("#addform").slideToggle();
		});
		</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)-->
        <script src="<?php echo base_url();?>admin_assets/plugins/datatables/dataTables.min.js"></script>
        <script src="<?php echo base_url();?>admin_assets/plugins/datatables/dataTables.bootstrap4.min.js"></script>
        <!--Page Active Scripts(used by this page)-->
        <script src="<?php echo base_url();?>admin_assets/plugins/datatables/data-basic.active.js"></script>
        <!--Page Scripts(used by all page)-->
        <script src="<?php echo base_url();?>admin_assets/dist/js/sidebar.js"></script>
    </body>

<!-- Mirrored from bhulua.thememinister.com/tables_data_basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 28 Sep 2019 13:44:34 GMT -->
</html>