Service status update

This commit is contained in:
gandhimathi Bharathirajan 2017-07-21 16:13:13 +05:30
parent a5bd067d57
commit 37c934ae1e
2 changed files with 231 additions and 112 deletions

View File

@ -19,92 +19,65 @@
<table id="example1" class="table table-bordered table-hover editableTable" style="font-size:12px;">
<thead>
<tr bgcolor="LightSlateGray ">
<th>#</th>
<th>SNO#</th>
<th>PONO#</th>
<th>SupplierName</th>
<th>Material Code</th>
<th>Material Name</th>
<th>UOM</th>
<th>Quantity</th>
<th>Order Value</th>
<th>Cost Center Name</th>
<th>Description</th>
<th>Raised By</th>
<th>PO Raised By</th>
<th>Department</th>
<th>PO Date</th>
<th>Work Status</th>
<th>PO Date</th>
<th>Remarks</th>
<!--<th>Action</th>-->
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td><a href="#">P0001</a></td>
<td>A100</td>
<td>Iron</td>
<td>Kg</td>
<td>1000</td>
<td>C001</td>
<td>No</td>
<td>Rajasekar</td>
<td>Finance</td>
<td>18-7-2017</td>
<td ><select name="selectId">
<option value="-1" >Select Option</option>
<option value="1">In Progress</option>
<option value="2">Complete</option>
</select></td>
<td contenteditable="true"><?php
$data = array('name' => '','value' => set_value(''),'id'=>'POType', 'class' => 'form-control');
echo form_input($data);
?></td>
<!--<td><i class="fa fa-eye"></i></td>-->
</tr>
<tr>
<td>2</td>
<td><a href="#">P0002</a></td>
<td>A1001</td>
<td>Iron</td>
<td>Kg</td>
<td>1000</td>
<td>C002</td>
<td>No</td>
<td>Rajasekar</td>
<td>Finance</td>
<td>18-7-2017</td>
<td><select name="selectId">
<option value="-1" >Select Option</option>
<option value="1">In Progress</option>
<option value="2">Complete</option>
</select></td>
<td contenteditable="true"><?php
$data = array('name' => 'POType','value' => set_value('POType'),'id'=>'POType', 'class' => 'form-control');
echo form_input($data);
?></td>
<!--<td><i class="fa fa-eye"></i></td>-->
</tr><tr>
<td>3</td>
<td><a href="#">P0003</a></td>
<td>A1002</td>
<td>Iron</td>
<td>Kg</td>
<td>1000</td>
<td>C003</td>
<td>No</td>
<td>Rajasekar</td>
<td>Finance</td>
<td>18-7-2017</td>
<td><select name="selectId">
<option value="-1" >Select Option</option>
<option value="1">In Progress</option>
<option value="2">Complete</option>
</select></td>
<td contenteditable="true"><?php
$data = array('name' => '','value' => set_value('POType'),'id'=>'POType', 'class' => 'form-control');
echo form_input($data);
?></td>
<!--<td><i class="fa fa-eye"></i></td>-->
</tr>
<?php $SNo = 0;
if(!empty($Billing))
{
foreach($Billing as $record)
{
$SNo =$SNo + 1;
//print_r($MRIRDetails);
?>
<tr>
<td><?php echo $SNo?></td>
<td><a data-toggle="tooltip" href="<?php echo base_url().'purchaseorder/CreatePOPrint?PONO='.$record->PONO.'&ReqType='.SERVICE ?>" target="new"><?php echo $record->PONO?></a></td>
<td><?php echo $record->SupplierName?></td>
<td><?php echo $record->MaterialCode?></td>
<td><?php echo $record->MaterialName?></td>
<td><?php echo $record->UOM?></td>
<td><?php echo $record->Quantity?></td>
<td><?php echo $record->TotalValue?></td>
<td><?php echo $record->CostCenterName?></td>
<td><?php echo $record->ServiceMaterialDescription?></td>
<td><?php echo $record->FirstName?></td>
<td><?php echo $record->DepartmentName?></td>
<td><?php
$rdate = new dateTime($record->PODate);
$ReqDate = $rdate->format('d-m-Y');
echo $ReqDate ?></td>
<td><?php echo $record->ServiceWorkStatusRemarks ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>

View File

@ -7,8 +7,8 @@
$("#PONO").select2();
});
</script>
</script>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
@ -18,6 +18,11 @@
</h1>
</section>
<section class="content"><br/>
<?php
$attributes = array('class' => 'form-label-left Status ','name' => 'Status','id' => 'Status');
echo form_open($this->config->base_url().'servicepurchaseorder/UpdateServiceStatus',$attributes); ?>
<div class="row" style="padding-bottom:1%">
<div id="content" > </div>
<div class="col-md-12">
@ -26,19 +31,18 @@
/* $attributes = array('class' => 'form-label-left ','name' => 'IGR','id' => ''); */
/* echo form_open($this->config->base_url().'/inwardgateregister/addNewigr/',$attributes); */?>
<label>Select Purchase Order NO </label>
<label>Select Service Purchase Order NO </label>
<div>
<?php
$options = array("-1"=>'Purchase Order No');
if(!empty($PO_NO))
if(!empty($PO))
{
//print_r($PO_NO);
foreach ($PO_NO as $SI):
foreach ($PO as $SI):
$options[$SI->PONO] = $SI->PONO .'-'. $SI->SupplierName ;
$PONO = $SI->PONO;
$options[$SI->PONO] = $SI->PONO ;
// $PONO = $SI->PONO;
endforeach;
@ -50,6 +54,49 @@
</div>
</div>
<div class="col-md-3">
<label>Work Status</label>
<div>
<?php
$options = array();
if(!empty($WorkStatus))
{
//print_r($PO_NO);
foreach ($WorkStatus as $SI):
$options[$SI->StatusCode] = $SI->StatusName ;
endforeach;
}
echo form_dropdown('WorkStatus', $options,set_value('WorkStatus'),'id="WorkStatus"' ,'class="form-control"' , 'required="true"');
?>
</div>
</div>
<div class="col-md-3">
<label>Remarks</label>
<div>
<?php
$data = array('name' => 'Remarks','value' => set_value('Remarks'),'id'=>'Remarks', 'class' => 'form-control' );
echo form_input($data);
?>
</div>
</div>
<div class="col-md-1 col-md-offset-10">
<input type="submit" class="btn btn-primary">
</div>
</div>
@ -61,38 +108,26 @@
<div class="row">
<div class="col-md-12">
<table id="Inwardgateregistertable" class="table table-bordered table-hover editabletable IGR_Line" style="background-color:#fff;font-size:12px;">
<table id="StatusTable" class="table table-bordered table-hover editabletable IGR_Line" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>S.NO</th>
<th>S.NO</th>
<th>ReqNo</th>
<th>Reqedby</th>
<th>ReqDate</th>
<th>SupplierName</th>
<th>Item Code</th>
<th>Material</th>
<th>Description</th>
<th>UOM</th>
<th>Ordered Quantity</th>
<th>Accepted Quantity</th>
<th>Status</th>
<th>Remarks</th>
<th>Ordered Quantity</th>
<th>Rate</th>
<th>Work Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td><a href="#">P0001</a></td>
<td>Iron</td>
<td>Kg</td>
<td>1000</td>
<td>800</td>
<td><select name="selectId">
<option value="-1">Select Option</option>
<option value="1">In Progress</option>
<option value="2">Complete</option>
</select>
</td>
<td contenteditable="true"><?php
$data = array('name' => '','value' => set_value(''),'id'=>'', 'class' => 'form-control');
echo form_input($data);
?></td>
</tr>
<tbody id="tblAppend">
</tbody>
@ -101,12 +136,123 @@
</div>
<div class="col-md-1 col-md-offset-10">
<a class="btn btn-primary" onclick="Save();">Submit</a>
</div>
</div>
<script>
$(function () {
$('#PONO').change(function() {
$("#tblAppend").empty();
var id = $('#PONO').val();
if(id != '-1')
{
$('#content').loader('show');
var y = <?php echo json_encode($PO, JSON_PRETTY_PRINT) ?>;
$.each(y, function(idx, obj) {
if(id == obj.PONO)
{
//alert(obj.ServiceWorkStatus);
// $('#WorkStatus').val(obj.ServiceWorkStatus);
// $("#WorkStatus").append( $('<option></option>').val(obj.ServiceWorkStatus).html(obj.ServiceWorkStatus));
return;
}
});
$.ajax({
data:{id:id},
type:"POST",
url:"<?php echo base_url() ?>servicepurchaseorder/getPODetails",
success:function(data) {
$('#content').loader('hide');
$("#tblAppend").empty();
$('#tblAppend').append(data);
}
});
/*var rowcount =document.getElementById('StatusTable').rows.length;
for(i=1;i<=rowcount;i++)
{
alert($('#Status1').val());
// var tr= document.getElementById(i);
// cells = tr.getElementsByTagName('td');
// var Statusval = cells[0].innerHTML;
$('<input>').attr({
type: 'hidden',
id: 'hidStatus'+i,
name: 'hidStatus'+i,
value: $('#Status'+i).val()
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'hidRemarks'+i,
name: 'hidRemarks'+i,
value: $('#Remark'+i).val()
}).appendTo('form');
} //alert(rowcount);*/
}
else
{
alert('Please Select the Purchase Order Number to Create IGR');
}
});
});
function saveToDatabase(Index) {
var id = $('#Remarks'+Index).val();
var Status = $('#Status'+Index).val();
var strMsg = 'Do you want to Approve the Requisition?';
var answer = confirm(strMsg);
var Selectedvalue = [];
Selectedvalue[0]= id;
Selectedvalue[1]= Status;
Selectedvalue[2]= PONO;
if (answer)
{
$('#content').loader('show');
$.ajax({
data:{id:id},
type:"POST",
url:"<?php echo base_url() ?>requisitionform/ApproveRequest?Status="+StatusCode+"&ReqNo="+ReqId,
success:function(data) {
if(data)
{
$('#content').loader('hide');
alert(data);
location.reload();
}
else
{
alert("Error");
}
}
});
}
else
{
return;
}
}
</script>
</section>
</div>