siddharth_application/application/views/viewinwardgateregister.php
2017-06-21 11:14:54 +05:30

245 lines
8.4 KiB
PHP

<script>
// For table
(function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-9'l><'col-sm-3'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-9'i><'col-sm-3'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="&hellip;";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
</script>
<style>
.modal
{
padding-right:25% ! important;
}
.num{
text-align:right;
}
.modal-content
{
width:950px ! important;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Siddharth Industries - View Inward Gate Register </center>
</h1>
</section>
<section class="content"><br/>
<div class="row">
<div class="col-md-12">
<table id="Inwardgateregistertable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>S.NO</th>
<th>IGR No</th>
<th>PO NO</th>
<th>Supplier name</th>
<th>Invoice No</th>
<th>Date of Invoice</th>
<th>Vechicle No</th>
<th>CourierNo</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($IGR))
{ $index = 0;
foreach($IGR as $record)
{
$index = $index +1;
?>
<tr id="<?php echo $index ?>" >
<td><?php echo $index?></td>
<td><a data-toggle="modal" data-target="#Igrshow" data-id="<%=index%>" data-userid="<?php echo $record->IGRNO ?>" > <u><?php echo $record->IGRNO ?></u></a></td>
<td><?php echo $record->PONO ?></a></td>
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
<td><?php echo $record->DeliveryChellanDate ?></td>
<td><?php echo $record->VehicleNo ?></td>
<td><?php echo $record->CourierNo ?></td>
</tr>
<?php
//$SNo++;
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal fade" id="Igrshow" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<form>
<div class="modal-content" style="width:900px;">
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Inward Gate Register Details</h4></center> <!-- IGR number should display here-->
</div>
<div class="col-md-12">
<div class="col-md-3">
<label>IGR Number :</label>
</div>
<div class="col-md-3">
<input type="text" id="IGRNO1" readonly>
</div>
<div class="col-md-3">
<label> Purchase Order Number:</label>
</div>
<div class="col-md-3">
<input type="text" id="PONo" readonly>
</div>
</div>
<div class="col-md-12">
<div class="col-md-3">
<label>Delivery Challan/Invoice NO :</label>
</div>
<div class="col-md-3">
<input type="text" id="Invoice_No" readonly>
</div>
<div class="col-md-3">
<label>Delivery Challan / Invoice Date:</label>
</div>
<div class="col-md-3">
<input type="text" id="Invoice_Date" readonly>
</div>
</div>
<div class="col-md-12">
<div class="col-md-3">
<label>Supplier and Address :</label>
</div>
<div class="col-md-3">
<input type="text" id="Supplier" readonly>
<input type="text" id="Add1" readonly>
</div>
<div class="col-md-3">
<label>Comments Of Special Instructions :</label>
</div>
<div class="col-md-3">
<input type="text" id="ser" readonly>
</div>
</div>
<!-- Table to show the line item of po -->
<div id="content" > </div>
<table class="table table-bordered" id="Inwardgateregistertable1">
<thead>
<tr>
<th>SNo</th>
<th>Item Code</th>
<th>Item Description</th>
<th>UOM</th>
<th>Ordred Quantity</th>
<th>Received Quantity</th>
<th>Remarks</th>
</tr>
</thead>
<tbody id="tbleAppend1">
<!-- <tr>
<td>1</td>
<td>RM002</td>
<td>Raw sand</td>
<td>Kgs</td>
<td>10000</td>
<td>10000</td>
<td>Received</td>
</tr>-->
</tbody>
</table>
<div class="modal-footer">
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Cancel</a>
</div>
</div>
</form>
</div>
</div>
</section>
<script>
<!-- script for table , It works under the datatable plugin-->
$(function () {
$('#Inwardgateregistertable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
</script>
<script>
$("#Igrshow").on("shown.bs.modal", function(e) {
var igr = $(e.relatedTarget).data('userid');
$('#content').loader('show');
$.ajax({
data:{id:igr},
type:"POST",
//dataType: 'json',
url:"<?php echo base_url() ?>inwardgateregister/ViewIGR",
success:function(data) {
// success:function(data) {
$('#content').loader('hide');
var trHTML = '';
$.each(JSON.parse(data), function (i, item) {
if(igr == item.IGRNO)
{
$("#IGRNO1").val(item.IGRNO);
//alert(item.IGRNO);
$("#PONo").val(item.PONO);
$("#Supplier").val(item.SupplierName);
$("#Add1").val(item.Address);
$("#Invoice_No").val(item.DeliveryChellanOrInvoiceNo);
//alert(item.DeliveryChellanDate);
$("#Invoice_Date").val(item.DeliveryChellanDate);
$("#ser").val(item.ServiceDescription);
i=i+1;
trHTML += '<tr>' +
'<td>' + i + '</td>' +
'<td name="MaterialName" id="MaterialCode" onchange="test('+i+')">' + item.MaterialCode + '</td>' +
'<td>' + item.MaterialName + '</td>' +
'<td name="UOM">' + item.UOM + '</td>' +
'<td name="Quantity">' + item.Quantity + '</td>' +
'<td data-name="sel" >'+item.QuantityAsPerInvoice+'</td>' +
'<td>'+ item.Remarks+ '</td>' +
'</tr>';
}
});
$("#tbleAppend1").empty();
$('#Inwardgateregistertable1 > tbody').append(trHTML);
}
});
});
</script>
Add Comment