siddharth_application/application/views/materialinspectionreport.php
2017-07-08 02:37:54 +05:30

357 lines
12 KiB
PHP
Executable File

<?php
$IGRNO="";
$PONO="";
$VehicleNo="";
$CourierNo="";
$DeliveryChellanOrInvoiceNo="";
$SupplierName="";
$DeliveryChellanDate="";
$dcdate="";
$Address="";
$PORasiedbyName="";
$PODate="";
$podate="";
$IGRDate="";
$igrdate="";
$ServiceDescription="";
$RowCount = 0;
if(!empty($IGRDetails))
{
foreach ($IGRDetails as $IGR)
{
$IGRNO = $IGR->IGRNO;
$PONO = $IGR->PONO;
$VehicleNo = $IGR->VehicleNo;
$CourierNo= $IGR->CourierNo;
$DeliveryChellanOrInvoiceNo=$IGR->DeliveryChellanOrInvoiceNo;
$SupplierName=$IGR->SupplierName;
//$DeliveryChellanDate=$IGR->DeliveryChellanDate;
$dc_date = new DateTime( $IGR->DeliveryChellanDate );
$dcdate = $dc_date->format('d/m/Y');;
$Address=$IGR->Address;
$PORasiedbyName=$IGR->FirstName;
$PODate=$IGR->PODate;
$po_date = strtotime( $PODate );
$podate = date( 'd/m/Y', $po_date );
$IGRDate=$IGR->CreatedDate;
$igr_date = strtotime( $IGRDate );
$igrdate = date( 'd/m/Y', $igr_date );
$ServiceDescription=$IGR->ServiceDescription;
}
}
?>
<script>
$(document).ready(function(){
$("#QualityIncharge").select2();
$("#plantIncharge").select2();
});//ready closed.
</script>
<style>
.modal
{
padding-right:25% ! important;
}
.select2
{
width: 100% ! important;
}
.num{
text-align:right;
}
.dataTables_wrapper {
padding-bottom: 0px;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<center>Siddharth Industries - Material Receipt And Inspection Report (MRIR)<!-- MRIR Number Should come --></center>
</h1>
<?php
$attributes = array('class' => 'form-label-left MRIR ','name' => 'MRIR','id' => 'MRIR');
echo form_open($this->config->base_url().'/MRIRcontroller/generateMRIR/',$attributes); ?>
</section>
<section class="content"><br/>
<div id="content"></div>
<div class="row">
<div class="col-md-9">
<div class="col-md-12">
<div class="col-md-4">
<label for="IGRNO">Inward Gate Register Number</label>
<div class="form-group">
<?php
$data = array('name' => 'IGRNO','value' => set_value('IGRNO',$IGRNO),'id'=>'IGRNO', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4">
<label for="IGRNO">Inward Gate Register Date</label>
<div class="form-group">
<?php
$data = array('name' => 'IGRDate','value' => set_value('IGRDate',$igrdate),'id'=>'IGRDate', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4">
<label for="SupplierName">Supplier Name </label>
<div class="form-group">
<?php
$data = array('name' => 'SupplierName','value' => set_value('SupplierName',$SupplierName),'id'=>'SupplierName', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="col-md-12">
<div class="col-md-4">
<label for="PONO">Purchase Order Number</label>
<div class="form-group"><?php
$data = array('name' => 'PONO','value' => set_value('PONO',$PONO),'id'=>'PONO', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4">
<label for="PODate">Purchase Order Date</label>
<div class="from-group">
<?php
$data = array('name' => 'PODate','value' => set_value('PODate',$podate),'id'=>'PODate', 'class' => 'form-control num' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4">
<label for="PORasiedbyName">Purchase Order Raised By</label>
<div class="from-group"><?php
$data = array('name' => 'PORasiedbyName','value' => set_value('PORasiedbyName',$PORasiedbyName),'id'=>'PORasiedbyName', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="col-md-12">
<div class="col-md-4">
<label for="DeliveryChellanOrInvoiceNo">Delivery Challan / Invoice Number</label>
<div class="form-group">
<?php
$data = array('name' => 'DeliveryChellanOrInvoiceNo','value' => set_value('DeliveryChellanOrInvoiceNo',$DeliveryChellanOrInvoiceNo),'id'=>'DeliveryChellanOrInvoiceNo', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4">
<label for="DeliveryChellanDate">Delivery Challan / Invoice Date </label>
<div class="form-group"><?php
$data = array('name' => 'DeliveryChellanDate','value' => set_value('DeliveryChellanDate',$dcdate),'id'=>'DeliveryChellanDate', 'class' => 'form-control num','readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4">
<label>Store Incharge</label>
<?php
$data = array('name' => 'StoreIncharge','value' => set_value('StoreInchargeID',$name),'id'=>'StoreIncharge', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-12">
<div class="col-md-4">
<label for="VehicleNo">Vehicle Number</label>
<div class="form-group">
<?php
$data = array('name' => 'VehicleNo','value' => set_value('VehicleNo',$VehicleNo),'id'=>'VehicleNo', 'class' => 'form-control' ,'readonly' => 'true','align' => 'left');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-4">
<label for="CourierNo">Courier Number</label>
<div class="form-group"><?php
$data = array('name' => 'CourierNo','value' => set_value('CourierNo',$CourierNo),'id'=>'CourierNo', 'class' => 'form-control','readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="col-md-12">
<label for="Address">Supplier Address</label>
<div class="form-group">
<?php
$data = array('name' => 'Address','value' => set_value('Address',$Address),'id'=>'Address', 'class' => 'form-control' ,'readonly' => 'true' , 'rows'=>'4' ,'columns'=> '3');
echo Form_textarea($data);
?>
</div>
</div>
<div class="col-md-12">
<label for="Address">Service Description</label>
<div class="form-group">
<?php
$data = array('name' => 'ServiceDescription','value' => set_value('ServiceDescription',$ServiceDescription),'id'=>'ServiceDescription', 'class' => 'form-control' ,'readonly' => 'true' , 'rows'=>'4' ,'columns'=> '3');
echo Form_textarea($data);
?>
</div>
</div>
</div>
<div class="row" style="padding:3%;">
<div class="col-md-12">
<table id="mytable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>S.NO</th>
<th>Item Code</th>
<th>Material</th>
<th>UOM</th>
<th>Ordered Quantity</th>
<th>Adviced Quantity as per the Challan</th>
<th>Actual Quantity Received</th>
<!--<th>Accepted_Quantity</th>-->
<!--<th>Rejected_Quantity</th>-->
<th>Remarks</th>
</tr>
</thead>
<tbody id="tbleAppend">
<?php $SNo =0;
if(!empty($IGRDetails))
{
foreach($IGRDetails as $record)
{
$SNo =$SNo + 1;
?>
<tr>
<td><?php echo $SNo?></td>
<td><?php echo $record->MaterialCode?></td>
<input type="hidden" name="<?php echo 'MaterialCode'.$SNo ?>" id="<?php echo 'MaterialCode'.$SNo ?>" value=" <?php echo $record->MaterialCode ?> "/>
<td><?php echo $record->MaterialName?></td>
<td><?php echo $record->UOM?></td>
<td class="num"><?php echo $record->Quantity?></td>
<td class="num"><?php echo $record->QuantityAsPerInvoice?></td>
<input type="hidden" name="<?php echo 'QuantityAsPerInvoice'.$SNo ?>" id="<?php echo 'QuantityAsPerInvoice'.$SNo ?>" />
<td><input type="text" id="<?php echo 'ActualQuantity'.$SNo;?>" name="<?php echo 'ActualQuantity'.$SNo;?>" onchange="setactual('<?php echo $SNo;?>');"></td>
<input type="hidden" name="<?php echo 'ActualQuantityReceived'.$SNo ?>" id="<?php echo 'ActualQuantityReceived'.$SNo ?>" value=""/>
<td><input type="text" id="<?php echo 'Remark'.$SNo ?>" name="<?php echo 'Remark'.$SNo ?>" onchange="setremark('<?php echo $SNo;?>');"></td>
<input type="hidden" name="<?php echo 'Remarks'.$SNo ?>" id="<?php echo 'Remarks'.$SNo ?>" />
</tr>
<?php
} //echo $SNo;
}
$RowCount = $SNo;
?>
</tbody>
</table>
<div id="content"></div>
<div class="col-md-1 col-md-offset-11">
<a class="btn btn-primary" type="submit" onclick="savemrir()">Generate MRIR</a>
<input type="hidden" name="RowCount" id="RowCount " value="<?php echo $RowCount ?>" />
</div>
</div>
</div>
</div>
</section>
</div>
<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>
function setactual(rowId)
{
//alert(rowId);
var actual = parseFloat($('#ActualQuantity'+rowId).val());
//alert(actual);
}
function setremark(rowId)
{
var remark = ($('#Remark'+rowId).val());
//alert(remark);
}
</script>
<script>
function savemrir()
{
//alert("save function worked ");
$("#content").load('show');
$.ajax({
data:$('.MRIR').serialize(),
type:"POST",
url:"<?php echo base_url() ?>MRIRcontroller/stored_db",
success:function(data) {
if(data){
$("#content").load('hide');
alert(data);
window.location ="viewmaterialinspectionreport";
}
else
{
alert("Error");
}
}//success function closed
});//ajax closed
}//save function closed
</script>