297 lines
8.7 KiB
PHP
Executable File
297 lines
8.7 KiB
PHP
Executable File
|
|
|
|
<style>
|
|
.modal
|
|
{
|
|
padding-right:25% ! important;
|
|
}
|
|
.num{
|
|
text-align:right;
|
|
}
|
|
.modal-content
|
|
{
|
|
width:800px ! important;
|
|
}
|
|
</style>
|
|
<div class="content-wrapper">
|
|
|
|
<section class="content"><br/>
|
|
<div class="box">
|
|
<div class=" container-fluid">
|
|
<div class="box-header">
|
|
<CENTER><h3 class="box-title">Siddharth Industries -View Inward Gate Register</h3></CENTER>
|
|
</div>
|
|
<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>Courier No</th>
|
|
<th>File</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php
|
|
if(!empty($IGR))
|
|
{ $index = 0;
|
|
foreach($IGR as $record)
|
|
{
|
|
|
|
$index = $index +1;
|
|
?>
|
|
<tr id="<?php echo $index ?>" >
|
|
<td style="text-align: center;"><?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 align="right"><?php
|
|
$date = new DateTime($record->DeliveryChellanDate);
|
|
echo $date->format('d-m-Y'); ?></td>
|
|
<td><?php echo $record->VehicleNo ?></td>
|
|
<td><?php echo $record->CourierNo ?></td>
|
|
<td>
|
|
<?php
|
|
if(!empty($record->file))
|
|
{
|
|
?>
|
|
<a target="_blank" href="<?php echo base_url().$record->file ?>"><i class="fa fa-download" ></i></a>
|
|
<?php
|
|
|
|
}
|
|
|
|
else
|
|
{
|
|
echo "NO FILE";
|
|
}
|
|
?>
|
|
|
|
</td>
|
|
<!--<td><?php echo $record->file ?></td>-->
|
|
</tr>
|
|
<?php
|
|
//$SNo++;
|
|
}
|
|
}
|
|
?>
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal fade" id="Igrshow" role="dialog">
|
|
<div class="modal-dialog">
|
|
<!-- Modal content-->
|
|
<form>
|
|
<div class="modal-content" style="width:800px;">
|
|
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
|
<button type="button" class="close" data-dismiss="modal">×</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>
|
|
<br/>
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Supplier Name :</label>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<input type="text" id="Supplier" readonly>
|
|
|
|
</div>
|
|
|
|
</div>-->
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<label>IGR Number </label>
|
|
<?php
|
|
$data = array('name' => 'IGRNumber','value' => set_value('IGRNumber'),'id'=>'IGRNO1', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
|
|
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label>Purchase Order Number </label>
|
|
<?php
|
|
$data = array('name' => 'PurchaseOrderNumber','value' => set_value('PurchaseOrderNumber'),'id'=>'PONo', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
|
|
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label>Delivery Challan/Invoice NO </label>
|
|
<?php
|
|
$data = array('name' => 'DeliveryChallan/InvoiceNO','value' => set_value('DeliveryChallan/InvoiceNO'),'id'=>'Invoice_No', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
|
|
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12" style=" padding-bottom: 10px;">
|
|
<div class="col-md-4">
|
|
<label>Delivery Challan / Invoice Date </label>
|
|
<?php
|
|
$data = array('name' => 'DeliveryChallan/InvoiceDate','value' => set_value('DeliveryChallan/InvoiceDate'),'id'=>'Invoice_Date', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
|
|
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label>Supplier Name </label>
|
|
<?php
|
|
$data = array('name' => 'SupplierName','value' => set_value('SupplierName'),'id'=>'Supplier', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
|
|
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Table to show the line item of po -->
|
|
<div id="content" > </div>
|
|
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
|
|
<thead style="background-color:#ddf">
|
|
<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-primary" 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);
|
|
|
|
$("#PONo").val(item.PONO);
|
|
$("#Supplier").val(item.SupplierName);
|
|
$("#Add1").val(item.Address);
|
|
$("#Invoice_No").val(item.DeliveryChellanOrInvoiceNo);
|
|
//alert(item.DeliveryChellanDate);
|
|
var dcd = new Date(item.DeliveryChellanDate);
|
|
//alert(dcd.getDate()+ '.' + (dcd.getMonth() + 1)+ '.' + dcd.getFullYear());
|
|
var dcd2 = (dcd.getDate()+ '/' + (dcd.getMonth() + 1)+ '/' + dcd.getFullYear());
|
|
$("#Invoice_Date").val(dcd2);
|
|
$("#ser").val(item.ServiceDescription);
|
|
|
|
|
|
i=i+1;
|
|
trHTML += '<tr>' +
|
|
'<td align="right">' + i + '</td>' +
|
|
'<td name="MaterialName" id="MaterialCode" onchange="test('+i+')">' + item.MaterialCode + '</td>' +
|
|
'<td>' + item.MaterialName + '</td>' +
|
|
'<td name="UOM">' + item.UOM + '</td>' +
|
|
'<td align="right" name="Quantity">' + item.Quantity + '</td>' +
|
|
'<td align="right" data-name="sel" >'+item.QuantityAsPerInvoice+'</td>' +
|
|
'<td>'+ item.Remarks+ '</td>' +
|
|
'</tr>';
|
|
//alert(item.QuantityAsPerInvoice);
|
|
}
|
|
|
|
});
|
|
$("#tbleAppend1").empty();
|
|
$('#Inwardgateregistertable1 > tbody').append(trHTML);
|
|
}
|
|
});
|
|
});
|
|
|
|
</script>
|
|
|