pdf and date filetr break down history
This commit is contained in:
parent
e5e20c226a
commit
702a9a71e2
@ -711,9 +711,25 @@ class batchcard extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getMaintListing(){
|
function getMaintListing(){
|
||||||
$data['MaintListing'] = $this->batchcard_model->getmaint_dtl();
|
|
||||||
|
if ($this->input->post('btn_submit'))
|
||||||
|
{
|
||||||
|
|
||||||
|
$fdate = $this->input->post('from_date');
|
||||||
|
|
||||||
|
$tdate = $this->input->post('to_date');
|
||||||
|
$type = $this->input->post('mySelect');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['MaintListing'] = $this->batchcard_model->getmaint_dtl( $fdate,$tdate, $type );
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'Siddharth : Maintenance/Breakdown Listing';
|
$this->global['pageTitle'] = 'Siddharth : Maintenance/Breakdown Listing';
|
||||||
$this->loadViews("BatchcardMaintListing", $this->global,$data,NULL);
|
$this->loadViews("BatchcardMaintListing", $this->global,$data,NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addMaint(){
|
function addMaint(){
|
||||||
|
|||||||
@ -233,19 +233,44 @@ class batchcard_model extends CI_Model
|
|||||||
return $res->result();
|
return $res->result();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getmaint_dtl()
|
function getmaint_dtl($fdate,$tdate,$type )
|
||||||
{
|
{
|
||||||
// $r->FirstName.' '.$r->LastName
|
|
||||||
$this->db->select('BMD.*');
|
|
||||||
|
$this->db->select('BMD.*');
|
||||||
|
// $this->db->select()
|
||||||
$this->db->select('CONCAT(ED1.FirstName, " - " , ED1.LastName) AS Approver_Name', FALSE);
|
$this->db->select('CONCAT(ED1.FirstName, " - " , ED1.LastName) AS Approver_Name', FALSE);
|
||||||
$this->db->select('CONCAT(ED2.FirstName, " - " , ED2.LastName) AS Worker_Name', FALSE);
|
$this->db->select('CONCAT(ED2.FirstName, " - " , ED2.LastName) AS Worker_Name', FALSE);
|
||||||
$this->db->from('T_Batchcard_MaintanceDetails BMD');
|
$this->db->from('T_Batchcard_MaintanceDetails BMD');
|
||||||
|
$this->db->like('BMD.CreatedOn', date('Y-m'));
|
||||||
$this->db->join('T_Employee_Details ED1', 'ED1.EmpID = BMD.Approved_By', 'left');
|
$this->db->join('T_Employee_Details ED1', 'ED1.EmpID = BMD.Approved_By', 'left');
|
||||||
$this->db->join('T_Employee_Details ED2', 'ED2.EmpID = BMD.WorkDone_By', 'left');
|
$this->db->join('T_Employee_Details ED2', 'ED2.EmpID = BMD.WorkDone_By', 'left');
|
||||||
$bmd = $this->db->get();
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($fdate and $tdate != ''){
|
||||||
|
|
||||||
|
|
||||||
|
$fromdate= date("Y-m-d",strtotime($fdate));
|
||||||
|
$todate=date("Y-m-d",strtotime($tdate));
|
||||||
|
|
||||||
|
$date = "date(BMD.CreatedOn) >= '".$fromdate."'
|
||||||
|
and date( BMD.CreatedOn) <= '". $todate."'";
|
||||||
|
$this->db->where($date);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($type!=""){
|
||||||
|
|
||||||
|
$this->db->where("BMD.type" ,$type);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
$bmd = $this->db->get();
|
||||||
return $bmd->result();
|
return $bmd->result();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getmaint_dtl_MntID($MntID)
|
function getmaint_dtl_MntID($MntID)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +1,91 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<!-- <link rel="stylesheet" href=" https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"> -->
|
||||||
|
<link rel="stylesheet" href=" https://cdn.datatables.net/buttons/1.5.1/css/buttons.dataTables.min.css">
|
||||||
|
<style>
|
||||||
|
|
||||||
|
|
||||||
|
.dataTables_wrapper .dt-buttons {
|
||||||
|
float:none;
|
||||||
|
text-align:right;
|
||||||
|
}
|
||||||
|
.dataTables_filter {
|
||||||
|
text-align: right !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<section class="content" id="loadingcontent">
|
<section class="content" id="loadingcontent">
|
||||||
<div>
|
<div>
|
||||||
<CENTER><h3>Siddharth Industries -Maintenance/Breakdown Listing</h3></CENTER>
|
<CENTER><h3>Siddharth Industries -Maintenance/Breakdown Listing</h3></CENTER>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
<div align="right" style="padding-right:10px">
|
<div align="right" style="padding-right:10px">
|
||||||
<a class="btn btn-Primary" style="padding-right:10px" align="right" href="<?php echo base_url(); ?>batchcard/addMaint">Add New</a>
|
<a class="btn btn-Primary" style="padding-right:10px" align="right" href="<?php echo base_url(); ?>batchcard/addMaint">Add New</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<!-- <form role="form" id="" action="<?php echo base_url()?>batchcard/daterange" method="post" enctype="multipart/form-data"> -->
|
||||||
|
|
||||||
|
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="from_date">
|
||||||
|
<?php echo 'From Date'; ?>
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<input name="from_date" id="max-date" class="form-control datepicker">
|
||||||
|
<span class="input-group-addon">
|
||||||
|
<i class="fa fa-calendar fa-fw"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="to_date">
|
||||||
|
<?php echo 'To Date'; ?>
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<input name="to_date" id="min-date" class="form-control datepicker">
|
||||||
|
<span class="input-group-addon">
|
||||||
|
<i class="fa fa-calendar fa-fw"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<select id="mySelect" name="mySelect" style="margin-top:27px">
|
||||||
|
<option value="">Select Option</option>
|
||||||
|
<option value="0">Maintenances</option>
|
||||||
|
<option value="1">Breakdown</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2" style="margin-top:24px;">
|
||||||
|
<input type="submit" class="btn btn-success" name="btn_submit"
|
||||||
|
value="View Report">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
<form role="form" id="" action="<?php echo base_url()?>" method="post" enctype="multipart/form-data">
|
<form role="form" id="" action="<?php echo base_url()?>" method="post" enctype="multipart/form-data">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-12">
|
<div class="col-xs-12 col-md-12">
|
||||||
@ -72,6 +145,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -83,14 +157,71 @@
|
|||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
$('#mnttable').DataTable({
|
$('#mnttable').DataTable({
|
||||||
|
dom: 'lBfrtip',
|
||||||
|
buttons: [
|
||||||
|
'pdf'
|
||||||
|
],
|
||||||
"paging": true,
|
"paging": true,
|
||||||
"lengthChange": true,
|
"lengthChange": true,
|
||||||
"searching": true,
|
"searching": true,
|
||||||
"ordering": true,
|
"ordering": true,
|
||||||
"info": true,
|
"info": true,
|
||||||
"autoWidth": true
|
"autoWidth": true,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
$( function() {
|
||||||
|
//var dateFormat = "mm/dd/yy",
|
||||||
|
from = $( "#min-date" )
|
||||||
|
.datepicker({
|
||||||
|
dateFormat: "dd-mm-yy",
|
||||||
|
defaultDate: "+0d",
|
||||||
|
changeMonth: true,
|
||||||
|
//numberOfMonths: 1
|
||||||
|
|
||||||
|
})
|
||||||
|
.on( "change", function() {
|
||||||
|
to.datepicker("option", "minDate", getDate( this ) );
|
||||||
|
}),
|
||||||
|
to = $( "#max-date" ).datepicker({
|
||||||
|
dateFormat: "dd-mm-yy",
|
||||||
|
defaultDate: "+0d",
|
||||||
|
changeMonth: true,
|
||||||
|
//numberOfMonths: 1
|
||||||
|
|
||||||
|
})
|
||||||
|
.on( "change", function() {
|
||||||
|
from.datepicker( "option", "maxDate", getDate( this ) );
|
||||||
|
});
|
||||||
|
|
||||||
|
function getDate( element ) {
|
||||||
|
var date;
|
||||||
|
|
||||||
|
try {
|
||||||
|
date = $.datepicker.parseDate( dateFormat, element.value );
|
||||||
|
|
||||||
|
} catch( error ) {
|
||||||
|
date = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
</script>
|
||||||
|
<!-- <!-- <script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
||||||
|
<script src=" https://code.jquery.com/jquery-3.3.1.js"></script> -->
|
||||||
|
<!-- <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script> -->
|
||||||
|
<script src="https://cdn.datatables.net/buttons/1.5.1/js/dataTables.buttons.min.js"></script>
|
||||||
|
<script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.flash.min.js"></script> -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
|
||||||
|
<script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.html5.min.js"></script>
|
||||||
|
<script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.print.min.js"></script>
|
||||||
Loading…
Reference in New Issue
Block a user