EVOLUTION-NINJA
Edit File: lead_report.php
<?php $this->load->view('includes/admin_header');?> <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');?>"> <link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="<?php echo base_url('admin_assets/assets/js/jquery.table2excel.js');?>"></script> <div class="main-content"> <div class="main-content-inner"> <div class="page-content"> <div class="row"> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="export_table" class="export_table"></table></div> <form id="invoice_reports"> <div class="col-xs-12"> <!-- PAGE CONTENT BEGINS --> <div class="row" style="background-color:#f8f8f8;padding-top: 10px;padding-bottom: 10px;"> <div class="col-sm-12 col-md-2"> <span style="font-size:25px;">Lead Report</span> </div> <div class="col-sm-7"></div> </div> <div class="row"> <div class="col-sm-12 col-xs-12 col-md-6"> <label class="col-sm-4">From Date <span style="color:red">*</span></label> <div class="col-sm-8 yes_form"> <input type="text" name="from_date" id="sel1" class="form-control from_date" autocomplete="off" id="sel1" required> </div> </div> <div class="col-sm-12 col-xs-12 col-md-6"> <label class="col-sm-4">To Date<span style="color:red">*</span></label> <div class="col-sm-8 yes_form"> <input type="text" name="to_date" id="sel2" class="form-control to_date" autocomplete="off" id="sel2"> </div> </div> </div> <div class="row" style="background-color:#f8f8f8;padding-top: 10px;padding-bottom: 10px;"> <div class="col-sm-10"></div> <div class="col-sm-2"> <button type="submit" class="btn btn-sm submit">Submit</button> <button type="reset" class="btn btn-sm">Cancel</button> </div> </div> </div> </form> <!-- PAGE CONTENT ENDS --> <div class="toat_count"></div> <div class="row" style="background-color:white;margin-top:10px;"> <div class="col-xs-12"> <!-- PAGE CONTENT BEGINS --> <div class="hr dotted"></div> <div class="row col-sm-12 table-responsive"> <label><input type="radio" name="status" value="ALL" class="inv_st all_data">All</label>   <input type="radio" name="status" value="CONTACTED" class="inv_st">CONTACTED</label>   <label><input type="radio" name="status" value="CLOSED" class="inv_st">CLOSED</label>   <label><input type="radio" name="status" value="CONVERTED" class="inv_st">CONVERTED</label>   <div id="addele_more"> <table class="table" id="maintable" > <thead> <tr id="column_id"> <th>Sl.No.</th> <th>Lead Name</th> <th>Company</th> <th>Mobile</th> <th>Email Id</th> <th>Lead Status</th> <th>Lead Source</th> <th>Lead Date</th> </tr> </thead> <tbody id="tobdy_new"> </tbody> </table> </div> </div> </div><!-- /.col --> </div><!-- /.row --> </div> <div class="row search-page" id="search-page-1"> </div><!-- /.col --> </div><!-- /.row --> </div><!-- /.page-content --> </div><!-- /.main-content --> <link rel="stylesheet" href="<?php echo base_url('admin_assets/css/datepicker3.css');?>" /> <link rel="stylesheet" href="<?php echo base_url('admin_assets/css/fullcalendar.min.css');?>" /> <script src="<?php echo base_url('admin_assets/event/assets/js/bootstrap-datepicker.js');?>"></script> <script src="<?php echo base_url('admin_assets/event/assets/js/fullcalendar.min.js');?>"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid-bootstrap.css'); ?>" /> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <!-- This is the localization file of the grid controlling messages, labels, etc. <!-- We support more than 40 localizations --> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/i18n/grid.locale-en.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <!-- The link to the CSS that the grid needs --> <script type="text/javascript"> $('#sel1').datepicker({ format: "dd-mm-yyyy", }).on('changeDate', function(ev){ $('#sel1').datepicker('hide'); }); $('#sel2').datepicker({ format: "dd-mm-yyyy", }).on('changeDate', function(ev){ $('#sel2').datepicker('hide'); }); </script> <script type="text/javascript"> $('#invoice_reports').submit(function(e){ e.preventDefault(); var from_date = $(".from_date").val(); var to_date = $(".to_date").val(); $(".submit").attr('disabled', 'disabled'); $(".submit").text("Submitting..."); formdata = new FormData($(this)[0]); $.ajax({ type : 'post', url : '<?php echo site_url("generate-lead-report")?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); $(".submit").text("Submit"); $(".submit").removeAttr('disabled'); var content=''; $('.all_data').attr('checked',true); //$(".all_data").attr("width","500"); $.each(response,function(key,val){ key=key+1; content+='<tr>'; content+='<td>'+key+'</td>'; if(val.del_state=='INACTIVE'){ content+='<td><a href="#" onclick="alert(\'This lead is may converted/deleted. So Not able to view.\');">'+val.first_name+'</a></td>'; }else{ content+='<td><a href="<?php echo site_url("lead_report_view/")?>'+val.lead_id+'" id="'+val.lead_id+'">'+val.first_name+'</a></td>'; } content+='<td>'+val.company_name+'</td>'; content+='<td>'+val.mobile+'</td>'; content+='<td>'+val.email+'</td>'; content+='<td>'+val.lead_status+'</td>'; content+='<td>'+val.lead_source+'</td>'; var c_date=val.created_at.split('-'); var dd=c_date[2]; var mm=c_date[1]; var yy=c_date[0]; var d=dd+'-'+mm+'-'+yy; content+='<td>'+d+'</td>'; content+='</tr>'; }); $('#tobdy_new').html(content); datatable = $('.table').DataTable(); //$('#invoice_reports')[0].reset(); } }); }); $('.inv_st').change(function(e){ e.preventDefault(); $('#maintable').DataTable().destroy(); var status=$("input[type=radio][name=status]:checked" ).val(); var from=$('#sel1').val(); var to=$('#sel2').val(); $.ajax({ type : 'post', url : '<?php echo site_url("lead-status-sort-data")?>', data : {'status':status,'from':from,'to':to}, success:function(response){ response=jQuery.parseJSON(response); var content=''; $.each(response,function(key,val){ var key=key+1; content+='<tr>'; content+='<td>'+key+'</td>'; if(val.del_state=='INACTIVE'){ content+='<td><a href="#" onclick="alert(\'This lead is may converted/deleted. So Not able to view.\');">'+val.first_name+'</a></td>'; }else{ content+='<td><a href="<?php echo site_url("lead_report_view/")?>'+val.lead_id+'" id="'+val.lead_id+'">'+val.first_name+'</a></td>'; } content+='<td>'+val.company_name+'</td>'; content+='<td>'+val.mobile+'</td>'; content+='<td>'+val.email+'</td>'; content+='<td>'+val.lead_status+'</td>'; content+='<td>'+val.lead_source+'</td>'; var c_date=val.created_at.split('-'); var dd=c_date[2]; var mm=c_date[1]; var yy=c_date[0]; var d=dd+'-'+mm+'-'+yy; content+='<td>'+d+'</td>'; content+='</tr>'; }); $('#tobdy_new').empty(); $('#tobdy_new').append(content); datatable = $('.table').DataTable(); } }); // DATA }); </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; } #jaytab3 { width: 100% !important; overflow-x: scroll; } .ui-jqdialog .ui-jqdialog-titlebar { height: 29px !important; background-color: #001a00; color: white; padding-left: 10px; } .fm-button { height: 21px !important; padding: 1px; margin-right: 10px !important; height: 21px !important; width: 50%; margin-top: -7px !important; } .ui-jqdialog-content td.navButton { padding-top: 12px !important; } .ui-jqgrid .ui-jqgrid-titlebar { height: 7px !important; background:steelblue !important; color:white !important; } .ui-jqgrid-bdiv { height: auto !important; } .ui-widget-overlay { z-index:0 !important; } .ui-widget-header { background: #1e7ad7 !important; } .ui-jqgrid-hdiv ui-state-default { //width: 873px !important; cursor: default!important } ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #fed22f; background: #ffe45c; } .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { font-weight: bold; color: black; } .ui-jqgrid { //width: 988px !important; overflow-x: scroll !important; } @media only screen and (min-width:641px) and (max-width:991px){ .ui-jqgrid{ text-indent: 0; color: #307ECC; float: none; right: 2px; } #jaytab3{ margin-top: 0 !important; margin-left: 0 !important; //overflow-x: hidden; width: 100% !important; padding-left:0 !important; padding-right:9px !important; } } @media only screen and (min-width:320px) and (max-width:641px){ .ui-jqgrid{ } .yes_form input{ width:100% !important; border:none !important; border-bottom:1px solid gray !important; margin-bottom:5%; } .yes_form select{ width:100% !important; border:none !important; border-bottom:1px solid gray !important; margin-bottom:5%; } .yes_form textarea{ width:100% !important; border:none !important; border-bottom:1px solid gray !important; margin-bottom:5%; } </style> <?php $this->load->view('includes/admin_footer');?>