EVOLUTION-NINJA
Edit File: client_vendor_list.php
<?php $this->load->view('includes/client_header');?> <section class="mid_work_one"> <div class="container"> <div class="row middle_container"> <div class="row list_h4_search" style="margin-bottom:20px;"> <h4>List of Vendors</h4> </div> <!-- <div class="list_table"> <div class="table-responsive"> <table class="table"> <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> <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 href="<?php echo base_url('/sa-vendor-profile'); ?>/<?php echo $value['user_id']; ?>">View Profile</a></td> <td> <a 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></td> </tr> <?php } ?> </tbody> </table> </div> </div> --> <div class="table1 table-responsive text-nowrap"> <table class="table prio_table"> <thead> <tr> <th scope="col">#</th> <th scope="col" style="width: 235px;">Company Name</th> <th scope="col">Contact Person</th> <th scope="col">Phone No.</th> <th scope="col">Email ID</th> <th scope="col">Industry Segment</th> <th scope="col">Profile</th> <th scope="col" style="width: 80px;">Actions</th> </tr> </thead> <tbody> <?php $i=1; foreach($vendor as $key => $value) { ?> <tr class="row<?php echo $value['user_id']; ?>"> <td><?php echo $i; ?></td> <td><?php echo $value['company_name']; ?></td> <td><?php echo $value['first_name'];?></td> <td><?php echo $value['mobile_no'];?></td> <td><?php echo $value['email'];?></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 } } ?> <?php if(!empty($segment)){ if(in_array("6",$segment)) { ?> <option value="Chemicals">Chemicals</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("7",$segment)) { ?> <option value="Consumer Products">Consumer Products</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("8",$segment)) { ?> <option value="Engineering & Construction">Engineering & Construction</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("9",$segment)) { ?> <option value="Financial Services & Banking">Financial Services & Banking</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("10",$segment)) { ?> <option value="Forest Products & Paper">Forest Products & Paper</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("11",$segment)) { ?> <option value="Furniture">Furniture</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("12",$segment)) { ?> <option value="Healthcare">Healthcare</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("13",$segment)) { ?> <option value="High Tech & Electronics">High Tech & Electronics</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("14",$segment)) { ?> <option value="Higher Education & Research">Higher Education & Research</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("15",$segment)) { ?> <option value="Hospitality">Hospitality</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("16",$segment)) { ?> <option value="Industrial Machinery & Components">Industrial Machinery & Components</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("17",$segment)) { ?> <option value="Media">Media</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("18",$segment)) { ?> <option value="Metal Products">Metal Products</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("19",$segment)) { ?> <option value="Oil & Gas">Oil & Gas</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("20",$segment)) { ?> <option value="Pharmaceuticals">Pharmaceuticals</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("21",$segment)) { ?> <option value="Primary Metal & Steel">Primary Metal & Steel</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("22",$segment)) { ?> <option value="Public Sector">Public Sector</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("23",$segment)) { ?> <option value="Retail">Retail</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("24",$segment)) { ?> <option value="Service Provider">Service Provider</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("25",$segment)) { ?> <option value="Telecommunication">Telecommunication</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("26",$segment)) { ?> <option value="Texttile Production">Texttile Production</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("27",$segment)) { ?> <option value="Transportation & Storage">Transportation & Storage</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("28",$segment)) { ?> <option value="Utilities">Utilities</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("29",$segment)) { ?> <option value="Wholesale Distribution">Wholesale Distribution</option> <?php } } ?> <?php if(!empty($segment)){ if(in_array("30",$segment)) { ?> <option value="Other">Other</option> <?php } } ?> </select></td> <td><a href="<?php echo base_url('client-vendor-profile'); ?>/<?php echo $value['user_id']; ?>" class="btn btn-success btn-xs" role="button">View</a></td> <td> <!-- <a href="#"><span class="fa fa-trash" onclick="delete_vendor(<?php echo $value['user_id']; ?>);" aria-hidden="true"></span></a> <a href="<?php echo base_url('edit-client-vendor'); ?>/<?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> <!--<a href="<?php echo base_url('edit-client-vendor'); ?>/<?php echo $value['user_id']; ?>" class="btn btn-info btn-xs" role="button"><span class="fa fa-pencil-square-o" aria-hidden="true"></span></a>--> </td> </tr> <?php $i=$i+1; } ?> </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"> 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_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_liast_iadmin")?>", type: "POST", data: {id: id}, success: function(response) { response = jQuery.parseJSON(response); console.log(response); if (response.result == 1) { toastr["success"]("Deleted successfully"); setTimeout(function() { location.reload(); // Reload the current page after 1 second }, 1000); } } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } </script> <style type="text/css"> .table-responsive { /*overflow-x: hidden !important;*/ } .prio_table > thead > tr > th { //text-align:center; } .prio_table > tbody > tr > td { //text-align:center; } @media only screen and (min-width: 320px) and (max-width: 640px) { .table1 { width: 100%; overflow-x: scroll !important; } @media only screen and (min-width: 641px) and (max-width: 991px) { .table1 { width: 100%; overflow-x: scroll !important; } @media only screen and (min-width: 992px) and (max-width: 1258px) { .table1 { width: 100%; overflow-x: scroll !important; } </style> <style type="text/css"> .row { margin-right: 0px !important; margin-left: 0px !important; } </style>