EVOLUTION-NINJA
Edit File: employee_list.php
<?php $this->load->view('includes/admin_header');?> <div class="main-container " id="main-container"> <div id="sidebar" class="sidebar responsive ace-save-state"> <ul class="nav nav-list"> <li class=""> <a href=""></a> </li> <!-- <li class=""> <a href=""><span class="menu-text" > Employee </span></a> </li> --> <li class=""> <a href="<?php echo site_url('new-employee');?>"><span class="menu-text" > Add New Employee </span></a> <li class=""> <a href="<?php echo site_url('department');?>"><span class="menu-text" >Add Department </span></a> </li> <!-- <li class=""> <a href="<?php echo site_url('designation');?>"><span class="menu-text" >Add Designation </span></a> </li> --> <li class=""> <a href="<?php echo site_url('employee-list');?>"><span class="menu-text" >Employee List </span></a> </li> </ul><!-- /.nav-list --> </div> <div class="main-content"> <div class="main-content-inner"> <div class=" page-content" style="background-color:#f0f0f0;"> <div class="row"> <div class="col-sm-7 " style="margin-top:5px;"> <!-- <select name="" id="" class="breadcrumb"> <option value="">Employee View</option> <option value="">Disabled Employee View</option> <option value="">Inactive Employee View</option> </select> --> </div> <div class="col-sm-2" style="float:right;"> <ul class="breadcrumb"> <li> <div ><a href="<?php echo site_url('new-employee');?>"><i class=" fa fa-plus fa-2x"></i></a></div> </li> <!-- <li> <select class="breadcrumb"> <option>All Data</option> <option>Subordinate's+My Data</option> <option>Subordinate's Data</option> <option>My Data</option> </select> </li> --> </ul> <button type="button" id="employee_export" class="btn btn-sm">Export</button> </div> </div> <!-- Modal --> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <form id="import_employee"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Import Employees</h4> </div> <div class="modal-body"> <input type="file" name="import_employee" > </div> <div class="modal-footer"> <button type="sumit" class="btn">Import</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </form> </div> </div> <div class="row" style="background-color:white;margin-top:10px;"> <div class="col-xs-12"> <h3>Employee List</h3> <div class="hr dotted"></div> <div> <div class="row search-page" id="search-page-1"> <div class="col-xs-12"> <div class="row"> <div class="col-xs-12 col-sm-12 table-responsive"> <label><input type="radio" name="status" value="Active" class="inv_st">ACTIVE</label>   <label><input type="radio" name="status" value="Resigned" class="inv_st">RESIGNED</label>   <button type="button" class="btn" onclick="agents();">Add to Agents</button> <div class="row"> <div id="addele_more "> <table class="table" id="maintable"> <thead> <tr id="column_id"> <th></th> <th>Employee ID</th> <th>First Name</th> <th>Last Name</th> <th>E-Mail ID</th> <th>Department</th> <th>Location</th> <th>Title</th> <th>Status</th> - <th>Offer Letter</th> <th>Upload offer Letter</th> <th>Download</th> <th>Releaving Letter</th> <th>Upload Reliev Letter</th> <th>Download</th> <th>Documents</th> <th>Pay Slip</th> </tr> </thead> <tbody id="tbody_new"> <?php foreach($employee_list as $key=>$value){?> <tr class="hoverr click-on"> <?php if($value->agents=='AGENT'){ ?> <td><input type="checkbox" id="checkall" name="emp_id" value="<?php echo $value->emp_id; ?>" checked></input></td> <?php } else { ?> <td><input type="checkbox" id="checkall" name="emp_id" value="<?php echo $value->emp_id; ?>"></input></td> <?php } ?> <td><?php echo $value->emp_id?></td> <td><a href="<?php echo site_url("employee-info/")?><?php echo $value->emp_id;?>" id="<?php echo $value->emp_id;?>"><?php echo $value->first_name;?></td> <td><?php echo $value->last_name?></td> <td><?php echo $value->eid?></td> <td><?php echo $value->department_name?></td> <td><?php echo $value->location?></td> <td><?php echo $value->title?></td> <!-- <td><a class="delete_emil" href="javascript:void(0)" id="<?php echo $value->emp_id; ?>"> <img width="20px" height="20px" src="<?php echo base_url('admin_assets/assets/images/delete.png');?>" class=""/>Delete</a></td> --> <td><?php echo $value->employee_status; ?></td> <td><a href="<?php echo base_url('offer_letter');?>/<?php echo $value->emp_id; ?>" id="<?php echo $value->emp_id; ?>">Generate Offer Letter</a></td> <td onchange="test(<?php echo $key;?>);"> <form id="asiign_<?php echo $key;?>" action="<?php echo site_url("yaskawa/upload_emp_offer_letter");?>" method="post" enctype='multipart/form-data'> <input type="hidden" name="emp_id" value="<?php echo $value->emp_id; ?>"> <input type="file" name="upload_image" multiple> </form> </td> <td> <?php if($value->offer_letter != "") { ?> <p><a href="<?php echo base_url('offer_letter');?>/<?php echo $value->offer_letter;?>" target="_blank">Download</a></p> <?php } ?> </td> <td><a href="<?php echo base_url('releaving-letter');?>/<?php echo $value->emp_id; ?>" id="<?php echo $value->emp_id; ?>">Generate Releaving Letter</a></td> <td onchange="test1(<?php echo $key;?>);"> <form id="asiignn_<?php echo $key;?>" action="<?php echo site_url("yaskawa/upload_relieve_letter");?>" method="post" enctype='multipart/form-data'> <input type="hidden" name="emp_id" value="<?php echo $value->emp_id; ?>"> <input type="file" name="upload_relieve"> </form> </td> <td> <?php if($value->relieve_letter != "") { ?> <p><a href="<?php echo base_url('offer_letter');?>/<?php echo $value->relieve_letter;?>" target="_blank">Download</a></p> <?php } ?> </td> <td> <?php if (!empty($value->documents)) { $docs = json_decode($value->documents, true); if (!empty($docs)) { echo "<ul style='padding-left:15px;margin:0;'>"; foreach ($docs as $doc) { echo "<li>"; echo htmlspecialchars($doc['name'])." - "; echo "<a href='".base_url($doc['file'])."' target='_blank'>Download</a>"; echo "</li>"; } echo "</ul>"; } else { echo "No documents"; } } else { echo "No documents"; } ?> </td> <td><a href="<?php echo base_url('pay-slip');?>/<?php echo $value->emp_id; ?>" id="<?php echo $value->emp_id; ?>">Generate Pay Slip</a></td> </tr> <?php }?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> </div><!-- /.col --> </div><!-- /.row --> <div id="print_div"></div> </div><!-- /.page-content --> </div> </div><!-- /.main-content --> <div class="footer"> <div class="footer-inner"> <div class="footer-content"> <span class="blue">All Right Reserved © 2017</span> <a href=""> Jay Blues Technologies</a> </div> </div> </div> <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i> </a> </div><!-- /.main-container --> </body> </html> <script src="<?php echo base_url('admin_assets/assets/js/jquery-2.1.4.min.js'); ?>"></script> <script src="<?php echo base_url('admin_assets/assets/js/tree.min.js'); ?>"></script> <script src="<?php echo base_url('admin_assets/assets/js/select2.min.js'); ?>"></script> <script src="<?php echo base_url('admin_assets/assets/js/jquery-ui.custom.min.js'); ?>"></script> <script src="<?php echo base_url('admin_assets/assets/js/jquery.ui.touch-punch.min.js'); ?>"></script> <script src="<?php echo base_url('admin_assets/assets/js/holder.min.js'); ?>"></script> <script src="<?php echo base_url('admin_assets/assets/js/ace-elements.min.js'); ?>"></script> <script src="<?php echo base_url('admin_assets/assets/js/ace.min.js'); ?>"></script> <script src="<?php echo base_url('admin_assets/assets/js/jquery-ui.js');?>"></script> <script src="<?php echo base_url('admin_assets/assets/js/jquery.table2excel.js');?>"></script> <script src="<?php echo base_url('admin_assets/assets/datatables/jquery.dataTables.min.js');?>"></script> <script src="<?php echo base_url('admin_assets/assets/datatables/dataTables.bootstrap.min.js');?>"></script> <link rel="stylesheet" href="<?php echo base_url('admin_assets/assets/datatables/dataTables.bootstrap.css');?>"> <script src="<?php echo base_url('admin_assets/assets/js/jquery.table2excel.js');?>"></script> <script type="text/javascript"> var datatable; datatable = $('#maintable').DataTable(); $('#import_employee').submit(function(e){ e.preventDefault(); formdata = new FormData($(this)[0]); $.ajax({ type : 'post', url : '<?php echo site_url("import-employees")?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { alert("Imported Successfully"); location.reload(); } else { alert("Something went wrong..try again"); //$(".lead_submit").text("Submit"); //$(".lead_submit").removeAttr('disabled'); } } }); }); function test(id){ swal({ title: "Are you sure?", text: "You Want to Publish this Paper!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, Upload it!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $('#asiign_'+id).submit(); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } function test1(id){ swal({ title: "Are you sure?", text: "You Want to Publish this Paper!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, Upload it!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $('#asiignn_'+id).submit(); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } $('.inv_st').change(function(e){ e.preventDefault(); // $('#maintable').DataTable().destroy(); // $('#maintable').dataTable().fnClearTable(); // $('#maintable').dataTable().fnDestroy(); var status=$("input[type=radio][name=status]:checked" ).val(); $.ajax({ type : 'post', url : '<?php echo site_url("employee-status-data")?>', data : {'status':status}, success:function(response){ response=jQuery.parseJSON(response); var content=''; $.each(response,function(key,val){ key=key+1; content+='<tr>'; content+='<td>'+key+'</td>'; content+='<td>'+val.first_name+'</td>'; content+='<td>'+val.last_name+'</td>'; content+='<td>'+val.email_id+'</td>'; content+='<td>'+val.department_name+'</td>'; content+='<td>'+val.location+'</td>'; content+='<td>'+val.title+'</td>'; content+='<td>'+val.employee_status+'</td>'; content+='<td><a href="<?php echo base_url('offer_letter');?>/'+val.emp_id+'" id="'+val.emp_id+'">Generate Offer Letter</a></td>'; content+='<td onchange="test('+key+');">'; content+='<form id="asiign_'+key+'" action="<?php echo site_url("yaskawa/upload_emp_offer_letter");?>" method="post">'; content+='<input type="hidden" name="emp_id" value="'+val.emp_id+'">'; content+='<input type="file" name="upload_image">'; content+='</form>'; content+='</td>'; content+='<td>'; if(val.offer_letter != "") { content+='<p><a href="<?php echo base_url('offer_letter');?>/'+val.offer_letter+'" target="_blank">Download</a></p>'; } content+='</td>'; content+='<td><a href="<?php echo base_url('releaving-letter');?>/'+val.emp_id+'" id="'+val.emp_id+'">Generate Releaving Letter</a></td>'; content+='<td>'; content+='<td onchange="test1('+key+');">'; content+='<form id="asiignn_'+key+'" action="<?php echo site_url("yaskawa/upload_relieve_letter");?>" method="post">'; content+='<input type="hidden" name="emp_id" value="'+val.emp_id+'">'; content+='<input type="file" name="upload_relieve">'; content+='</form>'; content+='</td>'; content+='<td>'; if(val.relieve_letter != "") { content+='<p><a href="<?php echo base_url('offer_letter');?>/'+val.relieve_letter+'" target="_blank">Download</a></p>'; } content+='</td>'; content+='<td><a href="<?php echo base_url('pay-slip');?>/'+val.emp_id+'" id="'+val.emp_id+'">Generate Pay Slip</a></td>'; content+='</tr>'; }); $('#tbody_new').empty(); $('#tbody_new').append(content); //$('#maintable').DataTable(); } }); }); $(document).on("click", ".delete_emil", function(){ var id = $(this).attr('id'); //alert(id); var test = $(this); var row = $(this).closest('tr'); $.ajax({ type : 'post', url : '<?php echo site_url("delete-employee")?>', data : {id:id}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { alert("Deleted Successfully"); location.reload(); } else { alert("Something went wrong"); } } }); }); $(document).on("click", ".offer_letter", function(){ var id = $(this).attr('id'); $.ajax({ type : 'post', url : '<?php echo site_url("get-employee-details")?>', data : {id:id}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { var print_content=''; print_content += '<html>'; print_content += '<head>'; print_content += '<title>Offer Letter</title>'; print_content += '</head>'; print_content += '<body style="width: 800px;">'; print_content += '<div class="row_1" style="border-bottom: 1px solid #000;padding-bottom:5px;">'; print_content += '<img src="<?php echo base_url('admin_assets/assets/images/logo.png');?>">'; print_content += '</div>'; print_content += '<p>Jay Blues Technologies</p>'; print_content += '<p>Date: <?php echo date('d-m-Y');?></p>'; print_content += '<p style="padding-bottom:4px;">Dear, '+response.details.first_name+' '+response.details.last_name+'</p>'; print_content += '<p style="padding-bottom:2px;">We are pleased to appoint you as (Business Development Executive) with us. The following offer of employment to you on behalf of Jay Blues Technologies. Further to the interview and discussions you have had with us. You are expected to join duty on '+response.details.date_of_joining+'. Your starting monthly remuneration will be Rs 8,000/- (Rupees Eight Thousand only). You will be on a probation period for three months.</p>'; print_content += '<p style="padding-bottom:2px;">After successful completion of the probation and review thereof, you will be entitled to other allowances and benefits whatsoever as per policies of the organization. Regular performance reviews will be done to assess your suitability. You shall receive your payments on or before 05th of every month.</p>'; print_content += '<p style="padding-bottom:2px;">Offer stands canceled in case of any deviations in information or if you fail to report to me on or before pre-decided date.</p>'; print_content += '<p><b>Working Hours:</b></p>'; print_content += '<p style="padding-bottom:2px;">Your working hours start from 10:00 am to 7:00 pm with one hour break a day and you are scheduled to work through Monday to Saturday, which is 57 hours a week. The company reserves all the rights to change the above working hours and days.</p>'; print_content += '<p><b>Holidays and Leave Policy:</b></p>'; print_content += '<p style="padding-bottom:4px;">You will be entitled for the approved 10 holidays notified by the company and you will also be entitled to 1day per (month) as additional leave. You should inform us in advance about your additional leave as and when you wish to avail it. You will also be eligible for casual leave of (1 day) every month.</p>'; print_content += '<p><b>Termination and Resignation:</b></p>'; print_content += '<p style="padding-bottom:4px;">The Company has the right to terminate your services any time after the confirmation of your services by issuing a notice of (1 month) in writing or payment of salary of (1 month) in lieu of notice. You can also resign from the company after giving a notice of (1 month) in writing or payment of salary of (1 month) in lieu of notice.</p>'; print_content += "<p style='padding-bottom:4px;'>Company has all the rights to take a legal action on an employee, if they disclose /data lose, information sharing, & damage for a company's integrity.</p>"; print_content += '<p style="padding-bottom:4px;">You will need to submit all your photo copy of original qualification documents, relieving documents and salary slip (if any) of last three months with a copy of each, on the date of joining.</p>'; print_content += '<p style="padding-bottom:4px;">I look forward to an enduring relationship with you.</p>'; print_content += '<br>'; print_content += '<p>Yours sincerely,</p>'; print_content += '<p>Ajay Kumar H S <br>CEO <br>Jay Blues Technologies</p>'; print_content += '</body>'; print_content += '</html>'; $("#print_div").html(print_content); var divContents = $("#print_div").html(); newWin= window.open(""); newWin.document.write(divContents); newWin.print(); newWin.close(); } else { alert("Something went wrong"); } } }); }); </script> <script type="text/javascript"> $("#employee_export").click(function(){ //alert(); $("#maintable").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Account list", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); }); </script> <script type="text/javascript"> $("#employee_export").click(function(){ //alert(); $(".employee_list").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "employee-list", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); }); </script> <style type="text/css"> #treeview-searchable .node-disabled { display: none; } .hoverr:hover .addd { display:block; } .addd{ display:none; } .add_more { padding: 0px 7px !important; font-size: 12px !important; } #block{display:none;padding-left:10px;} .pd-7{ padding-right:7px !important; padding-left:7px !important; } .pd-9{ padding:2px 9px !important; } </style> <script> $(".col1").click(function(){ var text = $(this).val(); var test = $(this); if($(this).is(':checked')) { $("#column_id").append('<th>'+text+'</th>'); } else { $(".column_id").empty(); $('input[name="columns[]"]:checked').each(function() { console.log(this.value); $(".column_id").append('<th>'+this.value+'</th>'); }); } }); function agents(){ var arr=[]; $('input[name="emp_id"]:checked').each(function() { arr.push($(this).val()); }); $.ajax({ type : 'post', url : '<?php echo site_url("yaskawa/update_employee_agent")?>', data : {'arr':arr}, success:function(response){ response=jQuery.parseJSON(response); if(response.result=='1'){ toastr["success"](response.msg); }else{ toastr["error"]('Unsucessfull'); } } }); } </script> <script> $('#cbxShowHide').click(function(){ this.checked?$('#block').show():$('#block').hide(); }); // function offer_letter() // { // var print_content=''; // print_content += '<html>'; // print_content += '<head>'; // print_content += '<title>Offer Letter</title>'; // print_content += '</head>'; // print_content += '<body style="width: 800px;">'; // print_content += '<p>Jay Blues Technologies</p>'; // print_content += '<p>Date: </p>'; // print_content += '<br>'; // print_content += '<p style="padding-bottom:10px;">Dear, </p>'; // print_content += '<p style="padding-bottom:10px;">We are pleased to appoint you as (Business Development Executive) with us. The following offer of employment to you on behalf of Jay Blues Technologies. Further to the interview and discussions you have had with us. You are expected to join duty on . Your starting monthly remuneration will be Rs 8,000/- (Rupees Eight Thousand only). You will be on a probation period for three months.</p>'; // print_content += '<p style="padding-bottom:10px;">After successful completion of the probation and review thereof, you will be entitled to other allowances and benefits whatsoever as per policies of the organization. Regular performance reviews will be done to assess your suitability. You shall receive your payments on or before 05th of every month.</p>'; // print_content += '<p style="padding-bottom:10px;">Offer stands cancelled in case of any deviations in information or if you fail to report to me on or before pre-decided date.</p>'; // print_content += '<p><b>Working Hours:</b></p>'; // print_content += '<p style="padding-bottom:10px;">Your working hours start from 10:00 am to 7:00 pm with one hour break a day and you are scheduled to work through Monday to Saturday, which is 57 hours a week. The company reserves all the rights to change the above working hours and days.</p>'; // print_content += '<p style="padding-bottom:10px;">You will be entitled for the approved 10 holidays notified by the company and you will also be entitled to 1day per (month) as additional leave. You should inform us in advance about your additional leave as and when you wish to avail it. You will also be eligible for casual leave of (1 day) every month.</p>' // print_content += '<p><b>Termination and Resignation:</b></p>'; // print_content += '<p style="padding-bottom:10px;">The Company has the right to terminate your services any time after the confirmation of your services by issuing a notice of (1 month) in writing or payment of salary of (1 month) in lieu of notice. You can also resign from the company after giving a notice of (1 month) in writing or payment of salary of (1 month) in lieu of notice.</p>'; // print_content += "<p style='padding-bottom:10px;'>Company has all the rights to take a legal action on an employee, if they disclose /data lose, information sharing, & damage for a company's integrity.</p>" // print_content += '<p style="padding-bottom:10px;">You will need to submit all your photo copy of original qualification documents, relieving documents and salary slip (if any) of last three months with a copy of each, on the date of joining.</p>'; // print_content += '<p style="padding-bottom:10px;">I look forward to an enduring relationship with you.</p>'; // print_content += '<br>'; // print_content += '<p>Yours sincerely,</p>'; // print_content += '<p>Ajay Kumar H S <br>CEO <br>Jay Blues Technologies</p>'; // print_content += '</body>'; // print_content += '</html>'; // $("#print_div").html(print_content); // var divContents = $("#print_div").html(); // newWin= window.open(""); // newWin.document.write(divContents); // newWin.print(); // newWin.close(); // } </script>