EVOLUTION-NINJA
Edit File: iadmin_vendor_list.php
<?php $this->load->view('includes/iadmin_header');?> <section class="mid_work_one"> <div class="container-fluid"> <div class="row middle_container"> <div class="row list_h4_search" style="margin-bottom:15px;"> <h4>List of Vendors</h4> <!-- <form action="" class="search-form"> <div class="form-group has-feedback"> <label for="search" class="sr-only">Search</label> <input type="text" class="form-control" name="search" id="search" placeholder="search"> <span class="glyphicon glyphicon-search form-control-feedback"></span> </div> </form> --> </div> <div class="table-responsive"> <table class="table prio_table dataTable no-footer"> <thead> <tr> <th>Sl No.</th> <th>Company Name</th> <th>Contact Person</th> <th>Email Id</th> <th>Phone No.</th> <th>Clients</th> <th>Industrial Segment</th> <th>Company Profile</th> <th>Action</th> </tr> </thead> <tbody> <?php foreach($vendor as $key => $value) { ?> <tr class="row<?php echo $value['user_id']; ?>"> <td><?php echo $key+1; ?></td> <td><?php echo $value['company_name']; ?></td> <td><?php echo $value['first_name'];?></td> <td><?php echo $value['email'];?></td> <td><?php echo $value['mobile_no'];?></td> <td><a href="#" onclick="client_list(<?php echo $value['user_id'];?>);"><?php echo $value['client_count'];?></a></td> <td><select name=""> <?php $segment=json_decode($value['industries']); ?> <?php if(!empty($segment)){ if(in_array("1",$segment)) { ?> <option value="Aerospace & Defense">Aerospace & Defense</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("2",$segment)) { ?> <option value="Agriculture & Mining">Agriculture & Mining</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("3",$segment)) { ?> <option value="Automotive">Automotive</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("4",$segment)) { ?> <option value="Building Materials, Clay & Galss">Building Materials, Clay & Galss</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("5",$segment)) { ?> <option value="Insurance">Insurance</option> <?php } } ?> </select></td> <td><a class="btn btn-success btn-xs" style="color: #fff !important; background-color: #f0ad4e !important; border-color: #eea236 !important;" href="<?php echo base_url('/sa-vendor-profile'); ?>/<?php echo $value['user_id']; ?>">View </a></td> <td> <!-- <a class="btn btn-info btn-xs" href="<?php echo base_url('admin-vendor-edit'); ?>/<?php echo $value['user_id']; ?>"><span class="fa fa-pencil-square-o" aria-hidden="true"></span></a>--> <button type="button" class="btn btn-danger btn-xs"><span class="fa fa-trash" onclick="delete_vendor(<?php echo $value['user_id']; ?>);" aria-hidden="true"></span></button></td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </section> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">List of Client</h4> </div> <div class="modal-body"> <div class="client"></div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> </body> </html> <script type="text/javascript"> function delete_vendor(id) { var id = id; swal({ title: "Are you sure?", text: "You will not be able to recover this data!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, delete it!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); $.ajax({ url:"<?php echo site_url("delete-vendor-list-iadmin")?>", type:"POST", data:{id:id}, success:function(response) { response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { toastr["success"]("Deleted successfully"); $('.row'+id).hide(); } } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } var datatable; var tbody = $('#table_body'); datatable = $('.table').DataTable({ }); jQuery(document).ready(function($) { $('.ul_menu li.dropdown').hover(function() { $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500); }, function() { $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500); }); }); function client_list(id){ $('#myModal').modal('show'); $.ajax({ url:"<?php echo site_url("vendor-client-list")?>", type:"POST", data:{id:id}, success:function(response) { response=jQuery.parseJSON(response); var content=''; $.each(response,function(i,val){ content+='<p>'+val.company_name+'</p>'; }); $('.client').html(content); } }); } function delete_iadmin(id) { var id = id; swal({ title: "Are you sure?", text: "You will not be able to recover this data!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, delete it!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); $.ajax({ url:"<?php echo site_url("delete-iadmin")?>", type:"POST", data:{id:id}, success:function(response) { response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { toastr["success"]("Deleted successfully"); $('.row'+id).hide(); } } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } </script> <style type="text/css"> .table-responsive { overflow-x: hidden !important; } .prio_table > thead > tr > th { background: #abf3ad !important; border-bottom: 1px solid #61b79c !important; border-top: 1px solid #61b79c !important; color:#000; } .prio_table > tbody > tr > td { background: #f0fffc; color:#000; } @media only screen and (min-width: 320px) and (max-width: 640px) { .table-responsive { overflow-x: auto !important; } } </style>