 <link href="<?php echo base_url();?>admin_assets/plugins/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
  <div class="body-content">
            <div class="row">
                <div class="col-md-4">
                	<?php //if($this->session->flashdata("msg")!==""){echo $this->session->flashdata("msg"); }?>
                    <div class="card mb-4">
                        <div class="card-header">
                            <div class="d-flex justify-content-between align-items-center">
                            <h6 class="fs-17 font-weight-600 mb-0"><i class="fa fa-user"></i> Add/Edit Vendors</h6>
                            </div>
                        </div>
                        <div class="card-body">
                        	<?php if($this->uri->segment(3)){
								$edit=$this->db->get_where("vendors",array("vend_id"=>$this->uri->segment(3)))->row();?>
                            <form action="<?php echo base_url();?>admin/update_vendor" method="post" enctype="multipart/form-data">
                            	  <input type="hidden" name="client_id" value="<?php echo $edit->vend_id;?>" />
                            	  <div class="form-group"> 
                                    <label for="email">Business Name</label>
                                    <input type="text" required value="<?php echo $edit->vend_bname;?>" class="form-control" name="client_comp_name">
                                  </div>
                                  <div class="form-group"> 
                                    <label for="email">Contact Name</label>
                                    <input type="text" required value="<?php echo $edit->vend_name;?>" class="form-control" name="client_name">
                                  </div>
                                  <div class="form-group ">
                                    <label for="email">Email</label>
                                    <input type="email"  class="form-control" value="<?php echo $edit->vend_email;?>" name="client_email" >
                                  </div>
                                  <div class="row">
                                      <div class="form-group col-md-6"> 
                                        <label for="email">Mobile No</label>
                                        <input type="text" required class="form-control" value="<?php echo $edit->vend_phone;?>" name="client_contact">
                                      </div>
                                      <div class="form-group col-md-6"> 
                                        <label for="email">Alternate No</label>
                                        <input type="text" class="form-control" value="<?php echo $edit->vend_phone2;?>" name="client_contact2">
                                      </div>
                                  </div> 
                                  <div class="form-group ">
                                    <label for="email">Static IP</label>
                                    <input type="text"  required class="form-control" value="<?php echo $edit->vend_ip;?>" name="client_ip" >
                                  </div>                      
                                  <button type="submit" class="btn btn-success">Update Vendor</button>
                                </form>
                            <?php }else{?>
                            <form action="<?php echo base_url();?>admin/add_vendor" method="post" enctype="multipart/form-data">
                            	  <input type="hidden" name="client_add_date" value="<?php echo date("Y-m-d");?>" />
                            	  <div class="form-group"> 
                                    <label for="email">Business Name</label>
                                    <input type="text" required class="form-control" name="client_comp_name">
                                  </div>
                                  <div class="form-group"> 
                                    <label for="email">Contact Name</label>
                                    <input type="text" required class="form-control" name="client_name">
                                  </div>
                                  <div class="form-group ">
                                    <label for="email">Email</label>
                                    <input type="email"  class="form-control" name="client_email" required>
                                  </div>
                                  <div class="row">
                                      <div class="form-group col-md-6"> 
                                        <label for="email">Mobile No</label>
                                        <input type="text" required class="form-control" name="client_contact">
                                      </div>
                                      <div class="form-group col-md-6"> 
                                        <label for="email">Alternate No</label>
                                        <input type="text" class="form-control" name="client_contact2">
                                      </div>
                                  </div> 
                                   <div class="form-group ">
                                    <label for="email">Static IP</label>
                                    <input type="text"  class="form-control" required name="client_ip" >
                                  </div>                           
                                  <button type="submit" class="btn btn-success">Add Vendor</button>
                                </form>
                            <?php }?>
                        </div>
                     </div>
                </div> 
                <div class="col-md-8">
                    <div class="card mb-4">
                        <div class="card-header">
                            <div class="d-flex justify-content-between align-items-center">
                            <h6 class="fs-17 font-weight-600 mb-0"><i class="fa fa-list"></i> Listed All Vendors</h6>
                            </div>
                        </div>
                        <div class="card-body">
                        	<table class="table display table-bordered table-striped table-hover basic">
                                        <thead>
                                            <tr>
                                            	<th>S.No.</th>
                                                <th>Company/Name</th>
                                                <th>IP/Email/Mobile</th>
                                                <th>Action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        	<?php $i=1;foreach($clients as $u){?>
                                            <tr>
                                        <td><?php echo $i;?></td>
                                        <td><b><?php echo $u->vend_bname;?></b><br/>
                                        <span class="badge badge-dark"><?php echo $u->vend_added;?></span></td>
                                        <td><i class="fa fa-globe"></i> <?php echo $u->vend_ip;?><br/>
                                        <i class="fa fa-envelope"></i> <?php echo $u->vend_email.'<br/>
										<i class="fa fa-phone"></i> '.$u->vend_phone.' '.$u->vend_phone2;?></td>
                                        <td>
<a href="<?php echo base_url().'admin/vendors/'.$u->vend_id;?>" class="btn btn-sm btn-warning"><i class="fa fa-edit"></i></a>
<a href="#" id="<?php echo $u->vend_id;?>" class="btn btn-sm btn-danger client_delete"><i class="fa fa-trash"></i></a>
<a href="#<?php //echo base_url().'admin/vdetails/'.$u->vend_id;?>" class="btn btn-sm btn-dark"><i class="fa fa-eye"></i> VIEW</a></td>
                                            </tr>
                                            <?php $i++;}?>
                                        </tbody>
                                    </table>
                        </div>
                     </div>
                </div> 
            </div>
                         
                    </div><!--/.body content-->
                </div><!--/.main content-->
                
                
                

                <footer class="footer-content">
                    <div class="footer-text d-flex align-items-center justify-content-between">
                        <div class="copy">© 2024 CRM</div>
                    </div>
                </footer><!--/.footer content-->
                <div class="overlay"></div>
            </div><!--/.wrapper-->
        </div>
        <!--Global script(used by all pages)-->
        <script src="<?php echo base_url();?>admin_assets/dist/js/popper.min.js"></script>
        <script>
		$(document).ready(function(){
			$(".client_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_vendor_delete',
							 data: {id:id},
							 success: function(response){
								 //alert(response);
							 }
							 });
		});
			});
		</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>