308 lines
8.7 KiB
PHP
308 lines
8.7 KiB
PHP
<script>
|
|
$(document).ready(function () {
|
|
|
|
$("#client_name").select2();
|
|
$("#item_name").select2();
|
|
|
|
});
|
|
</script>
|
|
|
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
|
|
|
<style>
|
|
.dataTables_filter input {padding: 4px;}
|
|
.dataTables_filter {
|
|
width: 50%;
|
|
float: right;
|
|
text-align: right;
|
|
}
|
|
.dataTables_paginate {
|
|
width: 50%;
|
|
float: right;
|
|
text-align: right;
|
|
}
|
|
div.dt-buttons {
|
|
position: relative;
|
|
float: right;
|
|
|
|
}
|
|
.btn-success {
|
|
background-color: #3c8dbc;
|
|
border-color: #3c8dbc;
|
|
}
|
|
th, td { white-space: nowrap; }
|
|
|
|
|
|
table.dataTable thead > tr > th.sorting_asc,
|
|
table.dataTable thead > tr > th.sorting_desc,
|
|
table.dataTable thead > tr > th.sorting,
|
|
table.dataTable thead > tr > td.sorting_asc,
|
|
table.dataTable thead > tr > td.sorting_desc,
|
|
table.dataTable thead > tr > td.sorting {
|
|
padding-right: inherit;
|
|
}
|
|
|
|
|
|
</style>
|
|
<div class="content-wrapper">
|
|
<section class="content">
|
|
<div class="row" style="min-height: 600px;">
|
|
<!-- Left col -->
|
|
<div class="col-md-12">
|
|
<!-- TABLE: LATEST ORDERS -->
|
|
<div class="box box-info">
|
|
<div class="box-header with-border">
|
|
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Siddharth Industries - Material History</b><br><br>
|
|
<?php
|
|
|
|
if($this->input->post('item_name')){
|
|
$it=$this->input->post('item_name');
|
|
echo $it;
|
|
echo ' '.' ';
|
|
}
|
|
|
|
|
|
if($this->input->post('from_date') && $this->input->post('to_date')){
|
|
$frm = $this->input->post('from_date');
|
|
$t = $this->input->post('to_date');
|
|
echo $frm.'-to-'.$t;
|
|
}
|
|
|
|
?></p></h3></center>
|
|
</div>
|
|
<!-- /.box-header -->
|
|
|
|
<div class="panel-body">
|
|
|
|
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
|
|
|
<div class="form-group has-feedback">
|
|
<div class="col-md-3">
|
|
<label for="client_name">
|
|
<?php echo'Material'; ?>
|
|
</label>
|
|
<div class="input-group">
|
|
<select class="form-control" id="item_name" name="item_name">
|
|
<option value="">Select Material</option>
|
|
<?php
|
|
|
|
|
|
foreach($material_name as $it):
|
|
|
|
{?>
|
|
|
|
<option value="<?php echo $it->MaterialName;?>"><?php echo $it->MaterialName ; ?></option>
|
|
|
|
|
|
<?php } endforeach; ?>
|
|
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<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-3">
|
|
<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-3" style="margin-top: 4px;"> <br>
|
|
<input type="submit" class="btn btn-success" name="btn_submit"
|
|
value="View Report">
|
|
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
<table class="table table-bordered" id="cc" style="font-size:12px !important;">
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align:center">Stock ID</th>
|
|
<th style="text-align:center">Supplier Name</th>
|
|
<th style="text-align:center">Material Name</th>
|
|
<th style="text-align:center">UpdatedON</th>
|
|
<th style="text-align:center">Transaction Type</th>
|
|
<th style="text-align:center">Ref Type</th>
|
|
<th style="text-align:center">Ref NO</th>
|
|
<th style="text-align:center">Quantity</th>
|
|
<th style="text-align:center">Item Value</th>
|
|
|
|
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if(!empty($material)){
|
|
|
|
|
|
foreach($material as $rel)
|
|
{
|
|
?>
|
|
<tr>
|
|
|
|
<td style="text-align:center"><span><?php echo $rel->StockId;?></span></td>
|
|
<td><span><?php echo $rel->SupplierName;?></span></td>
|
|
<td><span><?php echo $rel->MaterialName;?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
echo $rel->updatedOn;?></span></td>
|
|
<td><span><?php
|
|
echo $rel->Transaction_type;?></span></td>
|
|
<td><span><?php
|
|
echo $rel->Ref_Type;?></span></td>
|
|
<td><span><?php
|
|
echo $rel->Ref_No;?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
echo $rel->Quantity;?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
echo $rel->ItemValue;?></span></td>
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
?>
|
|
</tbody>
|
|
|
|
<?php
|
|
}
|
|
|
|
?>
|
|
</table>
|
|
</div>
|
|
<!-- /.box -->
|
|
</div>
|
|
<!-- /.col -->
|
|
</div>
|
|
</section>
|
|
</div>
|
|
|
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.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.4.2/js/buttons.html5.min.js"></script>
|
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
|
|
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
// Bootstrap datepicker
|
|
// Set up your table
|
|
$(document).ready(function() {
|
|
|
|
|
|
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
|
table = $('#cc').DataTable( {
|
|
"searching" : true,
|
|
"ordering": true,
|
|
"aaSorting": [[ 3, "desc" ]],
|
|
|
|
"bInfo": true,
|
|
|
|
|
|
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
|
"<'row'<'col-md-6'><'col-md-6'>>" +
|
|
"<'row'<'col-md-12't>><'row'<'col-md-2'i><'col-md-10'p>>",
|
|
buttons: [
|
|
|
|
{
|
|
extend: 'excelHtml5',
|
|
footer: 'true',
|
|
messageTop: 'Material History',
|
|
title: $('h3').text(),
|
|
exportOptions: {
|
|
columns: ':visible'
|
|
|
|
}
|
|
},
|
|
|
|
'colvis'
|
|
]
|
|
|
|
} );
|
|
} );
|
|
$('#mySelect').on('change',function(){
|
|
|
|
table
|
|
.column(4)
|
|
.search(this.value)
|
|
.draw();
|
|
});
|
|
|
|
$( 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;
|
|
}
|
|
} );
|
|
|
|
function Reset()
|
|
{
|
|
$('#mySelect').val('');
|
|
|
|
}
|
|
$(document).ready(function(){
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
});
|
|
|
|
</script>
|