ria/app/Views/ncrlist.php
2024-09-11 08:54:25 +05:30

172 lines
6.0 KiB
PHP
Executable File

<style>
.pagination {
margin:0px !important;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<center><h3 class="box-title">RESICO-Complaint List</h3></center>
</div>
<!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-hover editableTable" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr >
<!-- <th>#</th> -->
<th>Complaint Id</th>
<th>Date</th>
<th>Customer Name</th>
<th>Service Details</th>
<th>Details of Complaint/Reasons</th>
<th>Mode of Communication</th>
<th>Action Taken</th>
<th>Remarks</th>
<th>Action Card Ref No</th>
<th>Actions</th>
</tr>
</thead>
<tbody><?php
if(!empty($ncrarray)){
$index = 0;
foreach($ncrarray as $nc)
{
$index =$index+1;
//$dt= $nc->Created_Date;
$Ddt = new DateTime($nc->Created_Date);
$dt = $Ddt->format('d-m-Y');
?>
<tr id="<?php echo $index ; ?>">
<!-- <td align="left"><?php echo $index ; ?></td> -->
<!-- <td contenteditable="true"><?php echo $nc->CId?></td> -->
<td><a target="_blank" href="<?php echo base_url() ?>purchaseorder/EditComplaint?CId=<?php echo $nc->CId ?>" data-id="<%=index%>" data-userid="<?php echo $nc->CId ?>" ><u><?php echo "COM".$nc->CId ?></u>&nbsp;&nbsp;&nbsp;&nbsp;</a>
</td>
<td contenteditable="true"><?php echo $dt?></td>
<td contenteditable="true"><?php echo $nc->client_name?></td>
<td contenteditable="true"><?php echo $nc->Service_Details;?></td>
<td contenteditable="true"><?php echo $nc->Reason?></td>
<td contenteditable="true"><?php echo $nc->mode_of_communication?></td>
<td contenteditable="true"><?php echo $nc->Action_taken;?></td>
<td contenteditable="true"><?php echo $nc->Remark;?></td>
<?php if($nc->Ncr_Id == ""){
?>
<td contenteditable="true"><i class="fa fa-times-circle-o" style="color:#3498DB ;" data-toggle="tooltip" title="Action Report Is Not Entered"></i></td>
<?php }
else{?>
<td><a target="_blank" href="<?php echo base_url() ?>purchaseorder/EditNonconfirmative?Id=<?php echo $nc->Ncr_Id ?>" data-id="<%=index%>" data-userid="<?php echo $nc->Ncr_Id ?>" data-toggle="tooltip" title="Click here to View details" ><u><?php echo "ActRef".$nc->Ncr_Id ?></u>&nbsp;&nbsp;&nbsp;&nbsp;</a>
</td>
<?php }?>
<!-- <td data-name="sel" id="Action<?php echo $index ?>" onchange="saveToDatabase(this,'<?php echo $index ; ?>')">
<a class="btn btn-default" ID="Save" onclick="saveToDatabase(this,'<?php echo $index ; ?>')" >&nbsp;&nbsp;<span class="bold">Save</span></a>
</td> -->
<?php if($nc->Ncr_Id ==""){?>
<td> <a data-toggle="tooltip" href="<?php echo base_url().'Addaction?CId='.$nc->CId ;?>"><i class="fa fa-plus" data-toggle="tooltip" title="<?php echo $nc->CId; ?> - Click here to Enter details"></i></a></td>
<?php }
else{?>
<td><i class="fa fa-times-circle-o" style="color:#3498DB ;" data-toggle="tooltip" title="Action Report has been Entered You Can Only Edit it"></i></td>
<?php }?>
</tr>
<?php } }?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script> -->
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
$(function () {
$.fn.dataTable.moment( 'DD-MM-YYYY' );
$('#example1').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
// "columnDefs" : [{"targets":2, "type":"date-eu"}],
"aaSorting": [[ 1, "desc" ]],
"ordering": true,
"info": true,
"autoWidth": false
});
});
</script>
<script type="text/javascript">
function saveToDatabase(editableObj,Index)
{
//alert(Index)
var tr= document.getElementById(Index);
var cellval = tr.cells;
var date= cellval[1].innerHTML;
var cname=cellval[2].innerHTML;
var servicedetails=cellval[3].innerHTML;
var detailsofcoplaint=cellval[4].innerHTML;
var modeofcommunication=cellval[5].innerHTML;
var actiontaken=cellval[6].innerHTML;
var actioncardno=cellval[7].innerHTML;
var remark=cellval[8].innerHTML;
$.ajax(
{
data:{date:date,cname:cname,servicedetails:servicedetails,detailsofcoplaint:detailsofcoplaint,modeofcommunication:modeofcommunication,actiontaken:actiontaken,actioncardno,actioncardno,remark:remark},
// dataType:'json',
type:"POST",
url:"<?php echo base_url();?>purchaseorder/Savencrlist",
success:function(data)
{
$('#content').loader('hide');
if(data)
{
alert(data);
//window.location ="enquirylisting";
}
else
{
alert("Error");
}
}
});
}
</script>