EVOLUTION-NINJA
Edit File: employee_activity.php
<?php $this->load->view('includes/admin_header');?> <div class="main-container " id="main-container"> <div id="sidebar" class="sidebar responsive ace-save-state"> <div class="text-center"> <h4>Folder</h4> </div> <ul class="nav nav-list"> <li> <input type="text" class="form-control" placeholder="Search Folder"> </li> <li class=""><a href="<?php echo base_url('other-account');?>">Individual sales </a></li> <li class=""><a href="<?php echo base_url('sales-pipeline-and-trend');?>"> Sales pipeline and trend </a></li> <li class=""><a href="<?php echo base_url('industry-wise-sales');?>"> Industry wise sales </a></li> <li class=""><a href="<?php echo base_url('region-wise-sales');?>"> Region wise sales </a></li> <li class=""><a href="<?php echo base_url('employee-activity');?>"> Employee activity </a></li> <!-- <li class=""><a href="<?php echo base_url('model-wise-sales');?>"> Model wise sales </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 row-form1"> <div class="col-sm-6 col-md-3"> <h4>Employee Activity</h4> </div> <div class="col-xs-12 col-sm-12 col-md-3" style="float:right;"> <select theme="dark" width="220px" style="" placeholder="Select Your Favorite" data-search="true" class="employee_member" name="member" class="data_filter"> <option value=" ">Select</option> <?php foreach($number_of_users as $value){ if($value->user_name != "All Users" && $value->user_name != "Admin"){?> <option value="<?php echo $value->user_id; ?>"><?php echo $value->user_name; ?></option> <?php }} ?> </select> </div> <div class="col-xs-12 col-sm-12 col-md-3" style="float:right;"> <input type="text" id="to_date" name="to_date" placeholder="To date" class="data_filter" /> </div> <div class="col-xs-12 col-sm-12 col-md-3" style="float:right;"> <input type="text" id="from_date" name="from_date" placeholder="From date" class="data_filter" /> </div> </div> <div class="row" style="background-color:white;margin-top:10px;"> <div class=""> <!-- PAGE CONTENT BEGINS --> <div class="hr dotted"></div> <!------------------Lead details------------------> <div class=""> <div class="panel with-nav-tabs panel-primary"> <div class="panel-heading"> <ul class="nav nav-tabs"> <li class="active"><a href="#tab1primary" data-toggle="tab">Leads</a></li> <li><a href="#tab2primary" data-toggle="tab">Accounts</a></li> <li><a href="#tab3primary" data-toggle="tab">Potential</a></li> </ul> </div> <div class="panel-body"> <div class="tab-content"> <div class="tab-pane fade in active" id="tab1primary"> <table class="table table-responsive export_todays_sales" id="maintable"> <thead> <tr id="column_id"> <th>Lead Name</th> <th>Lead Activities</th> <th>Date</th> <th>Lead Owner</th> </tr> </thead> <tbody id="filer_data"> <?php foreach($lead_employees as $value){ ?> <tr> <td><?php echo $value->first_name;?></td> <td><?php echo $value->activity; ?></td> <td><?php echo date("d-m-Y", strtotime($value->created_at)); ?></td> <td><?php echo $value->user_name;?></td> </tr> <?php } ?> </tbody> </table> </div> <div class="tab-pane fade" id="tab2primary"> <table class="table table-responsive export_todays_sales" id="maintable"> <thead> <tr id="column_id"> <th>Accounts Name</th> <th>Accounts Activity</th> <th>Date</th> <th>Accounts Owner</th> </tr> </thead> <tbody id="filer_data1"> <?php foreach($account_employees as $value){ ?> <tr> <td><?php echo $value->account_name;?></td> <td><?php echo $value->activity; ?></td> <td><?php echo date("d-m-Y", strtotime($value->created_at)); ?></td> <td><?php echo $value->user_name;?></td> </tr> <?php } ?> </tbody> </table> </div> <div class="tab-pane fade" id="tab3primary"> <table class="table table-responsive export_todays_sales" id="maintable"> <thead> <tr id="column_id"> <th>Potential Name</th> <th>Potential Activity</th> <th>Date</th> <th>Potentail Owner</th> </tr> </thead> <tbody id="filer_data2"> <?php foreach($potential_employees as $value){ ?> <tr> <td><?php echo $value->potential_name;?></td> <td><?php echo $value->activity; ?></td> <td><?php echo date("d-m-Y", strtotime($value->created_at)); ?></td></td> <td><?php echo $value->user_name;?></td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </div> </div><!-- /.col --> </div><!-- /.row --> </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=""> Yaskawa</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 --> <!-- <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/bootstrap.min.js');?>"></script> --> <!-- page specific plugin scripts --> <!-- ace scripts --> <!-- inline scripts related to this page --> <link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> <script src="<?php echo base_url('admin_assets/assets/js/jquery-ui.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');?>"> </body> </html> <style> article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block} body{line-height:1;} ol,ul{list-style:none} blockquote,q{quotes:none} blockquote:before,blockquote:after,q:before,q:after{content:none} table{border-collapse:collapse;border-spacing:0} body{background:#F7F7F7;width:100%;height:100%;font-family:'Roboto', helvetica, sans-serif;} .container { margin:150px auto; max-width:600px;} h2 { margin:30px auto;} </style> <style type="text/css"> .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 type="text/javascript"> $(document).ready(function(){ var datatable; var tbody = $('#table_body'); datatable = $('.table').DataTable({ }); }); </script> <script> $('#cbxShowHide').click(function(){ this.checked?$('#block').show():$('#block').hide(); }); </script> <script type="text/javascript"> $(function(){ $("#from_date").datepicker({ dateFormat: 'dd-mm-yy', }).on('changeDate', function(ev){ $('#from_date').datepicker('hide'); }); $("#to_date").datepicker({ dateFormat: 'dd-mm-yy', }).on('changeDate', function(ev){ $('#to_date').datepicker('hide'); }); }); </script> <script> $(function() { $('#popup-datepic').datepicker({ //.. }); }); </script> <script> $('#calendar').datepicker({ }); !function ($) { $(document).on("click","ul.nav li.parent > a > span.icon", function(){ $(this).find('em:first').toggleClass("glyphicon-minus"); }); $(".sidebar span.icon").find('em:first').addClass("glyphicon-plus"); }(window.jQuery); $(window).on('resize', function () { if ($(window).width() > 768) $('#sidebar-collapse').collapse('show') }) $(window).on('resize', function () { if ($(window).width() <= 767) $('#sidebar-collapse').collapse('hide') }) </script> <style> .tab-content { border:1px none !important; } .panel-heading { background-color: #438EB9 !important; } .nav-tabs { text-align: center; } .nav-tabs li { width: 10%; } .favourite_icon { color: white } .favourite_icon2 { color: black } .favourite_icon.yellow { color: #438EB9 } .panel.with-nav-tabs .panel-heading{ padding: 5px 5px 0 5px; } .panel.with-nav-tabs .nav-tabs{ border-bottom: none; } .panel.with-nav-tabs .nav-justified{ margin-bottom: -1px; } /********************************************************************/ /*** PANEL PRIMARY ***/ .with-nav-tabs.panel-primary .nav-tabs > li > a, .with-nav-tabs.panel-primary .nav-tabs > li > a:hover, .with-nav-tabs.panel-primary .nav-tabs > li > a:focus { color: #000; } .with-nav-tabs.panel-primary .nav-tabs > .open > a, .with-nav-tabs.panel-primary .nav-tabs > .open > a:hover, .with-nav-tabs.panel-primary .nav-tabs > .open > a:focus, .with-nav-tabs.panel-primary .nav-tabs > li > a:hover, .with-nav-tabs.panel-primary .nav-tabs > li > a:focus { color: #fff; background-color: #3071a9; border-color: transparent; } .with-nav-tabs.panel-primary .nav-tabs > li.active > a, .with-nav-tabs.panel-primary .nav-tabs > li.active > a:hover, .with-nav-tabs.panel-primary .nav-tabs > li.active > a:focus { color: black; background-color: #fff; border-color: #428bca; border-bottom-color: transparent; } .with-nav-tabs.panel-primary .nav-tabs > li.dropdown .dropdown-menu { background-color: #428bca; border-color: #3071a9; } .with-nav-tabs.panel-primary .nav-tabs > li.dropdown .dropdown-menu > li > a { color: #fff; } .with-nav-tabs.panel-primary .nav-tabs > li.dropdown .dropdown-menu > li > a:hover, .with-nav-tabs.panel-primary .nav-tabs > li.dropdown .dropdown-menu > li > a:focus { background-color: #3071a9; } .with-nav-tabs.panel-primary .nav-tabs > li.dropdown .dropdown-menu > .active > a, .with-nav-tabs.panel-primary .nav-tabs > li.dropdown .dropdown-menu > .active > a:hover, .with-nav-tabs.panel-primary .nav-tabs > li.dropdown .dropdown-menu > .active > a:focus { background-color: #4a9fe9; } </style> <script type="text/javascript"> $(document).ready(function(){ $('.employee_member').change(function(){ var employee_id = $('.employee_member').val(); $.ajax({ type:'POST', url: '<?php echo site_url('yaskawa/employee_lead_filter'); ?>', data : {'employee_id':employee_id}, success : function(response){ var res=jQuery.parseJSON(response); console.log(response); var content=''; if(res.result==1) { $.each(res.date_result,function(idx,vx) { content+='<tr>'; content+='<td>'+vx.first_name+'</td>'; content+='<td>'+vx.activity+'</td>'; content+='<td>'+vx.created_at+'</td>'; content+='<td>'+vx.user_name+'</td>'; content+='</tr>'; $("#filer_data").html(content); }); } else if(res.result==0) { //alert("Date not found"); $("#filer_data").empty(); } } }); }); }); $(document).ready(function(){ $('.employee_member').change(function(){ var employee_id = $('.employee_member').val(); $.ajax({ type:'POST', url: '<?php echo site_url('yaskawa/employee_account_filter'); ?>', data : {'employee_id':employee_id}, success : function(response){ var res=jQuery.parseJSON(response); console.log(response); var content=''; if(res.result==1) { $.each(res.date_result,function(idx,vx) { content+='<tr>'; content+='<td>'+vx.account_name+'</td>'; content+='<td>'+vx.activity+'</td>'; content+='<td>'+vx.created_at+'</td>'; content+='<td>'+vx.user_name+'</td>'; content+='</tr>'; $("#filer_data1").html(content); }); } else if(res.result==0) { //alert("Date not found"); $("#filer_data1").empty(); } } }); }); }); $(document).ready(function(){ $('.employee_member').change(function(){ var employee_id = $('.employee_member').val(); $.ajax({ type:'POST', url: '<?php echo site_url('yaskawa/employee_potential_filter'); ?>', data : {'employee_id':employee_id}, success : function(response){ var res=jQuery.parseJSON(response); console.log(response); var content=''; if(res.result==1) { $.each(res.date_result,function(idx,vx) { content+='<tr>'; content+='<td>'+vx.potential_name+'</td>'; content+='<td>'+vx.activity+'</td>'; content+='<td>'+vx.created_at+'</td>'; content+='<td>'+vx.user_name+'</td>'; content+='</tr>'; $("#filer_data2").html(content); }); } else if(res.result==0) { //alert("Date not found"); $("#filer_data2").empty(); } } }); }); }); </script> <script type="text/javascript"> $(document).on("change",".data_filter",function() { var from_date = $("#from_date").val(); var to_date = $("#to_date").val(); $.ajax({ type:"POST", url:"<?php echo site_url('yaskawa/employee_activity_filter1'); ?>", data:{'from_date':from_date,'to_date':to_date}, success : function(response){ var res=jQuery.parseJSON(response); console.log(response); var content=''; if(res.result==1) { $.each(res.date_result,function(idx,vx) { content+='<tr>'; content+='<td>'+vx.first_name+'</td>'; content+='<td>'+vx.activity+'</td>'; content+='<td>'+vx.created_at+'</td>'; content+='<td>'+vx.user_name+'</td>'; content+='</tr>'; content+='</tr>'; $("#filer_data").html(content); }); } else if(res.result==0) { //alert("Date not found"); $("#filer_data").empty(); } } }); }); $(document).on("change",".data_filter",function() { var from_date = $("#from_date").val(); var to_date = $("#to_date").val(); $.ajax({ type:"POST", url:"<?php echo site_url('yaskawa/employee_activity_filter2'); ?>", data:{'from_date':from_date,'to_date':to_date}, success : function(response){ var res=jQuery.parseJSON(response); console.log(response); var content=''; if(res.result==2) { $.each(res.date_result1,function(idx,vx) { content+='<tr>'; content+='<td>'+vx.account_name+'</td>'; content+='<td>'+vx.activity+'</td>'; content+='<td>'+vx.created_at+'</td>'; content+='<td>'+vx.user_name+'</td>'; content+='</tr>'; content+='</tr>'; $("#filer_data1").html(content); }); } else if(res.result==0) { //alert("Date not found"); $("#filer_data1").empty(); } } }); }); $(document).on("change",".data_filter",function() { var from_date = $("#from_date").val(); var to_date = $("#to_date").val(); $.ajax({ type:"POST", url:"<?php echo site_url('yaskawa/employee_activity_filter3'); ?>", data:{'from_date':from_date,'to_date':to_date}, success : function(response){ var res=jQuery.parseJSON(response); console.log(response); var content=''; if(res.result==3) { $.each(res.date_result3,function(idx,vx) { content+='<tr>'; content+='<td>'+vx.potential_name+'</td>'; content+='<td>'+vx.activity+'</td>'; content+='<td>'+vx.created_at+'</td>'; content+='<td>'+vx.user_name+'</td>'; content+='</tr>'; content+='</tr>'; $("#filer_data2").html(content); }); } else if(res.result==0) { //alert("Date not found"); $("#filer_data2").empty(); } } }); }); $('#from_date').on('change', function(){ var date = $(this).val(); $('#to_date').datepicker({ dateFormat: 'dd-mm-yy', minDate: date, }); }); </script>