1153 lines
42 KiB
PHP
1153 lines
42 KiB
PHP
<?php
|
|
|
|
$Department='';
|
|
$Created_Date='';
|
|
$Auditor='';
|
|
$Auditee='';
|
|
$Iqra= '';
|
|
$NC_Details= '';
|
|
$Review_Details= '';
|
|
$Ncr_status = '';
|
|
$Comments='';
|
|
$rw = 0;
|
|
$index = 0;
|
|
$Id='';
|
|
|
|
if(!empty($masterdetails))
|
|
{
|
|
foreach($masterdetails as $mas)
|
|
{
|
|
$Department=$mas->Department;
|
|
$Created_Date=$mas->Created_Date;
|
|
$Ddt = new DateTime($mas->Created_Date);
|
|
$dt = $Ddt->format('d-m-Y');
|
|
|
|
$Auditor=$mas->Auditor;
|
|
$Auditee=$mas->Auditee;
|
|
$Iqra= $mas->Iqra;
|
|
$NC_Details= $mas->NC_Details;
|
|
$Review_Details= $mas->Review_Details;
|
|
$Ncr_status = $mas->Ncr_status;
|
|
$Comments=$mas->Comments;
|
|
$Id=$mas->Id;
|
|
}
|
|
}
|
|
//echo $dt;
|
|
?>
|
|
|
|
|
|
|
|
|
|
<style type="text/css">
|
|
[contenteditable=true]:empty:before{
|
|
content: attr(placeholder);
|
|
display: block; /* For Firefox */
|
|
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
$(function() {
|
|
|
|
var MaxDate = '<?php echo $MaxPoDate;?>';
|
|
var d = new Date(MaxDate);
|
|
var t='<?php echo $CurrentDate;?>';
|
|
var m=new Date(t);
|
|
|
|
$("#Date").datepicker({
|
|
minDate : d,
|
|
//maxDate : 'now',
|
|
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
<div class="content-wrapper">
|
|
<section class="content" style="font-size: 12px;">
|
|
<div id="content"></div>
|
|
|
|
<div class="box">
|
|
<div class="box-header">
|
|
<center><h3 class="box-title">Siddharth Industries - ACTION REPORT <?php echo " - ActRef".$Id?></h3></center>
|
|
</div>
|
|
<!-- /.box-header -->
|
|
<div class="box-body">
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div id="content"></div>
|
|
|
|
<div class="row">
|
|
|
|
<?php
|
|
$attributes = array('class' => 'form-label-left action_report ','name' => 'action_report','id' => 'action_report');
|
|
|
|
echo form_open($this->config->base_url().'/purchaseorder/Action_Report/',$attributes);
|
|
?>
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
|
|
<label>DEPT./FN.</label>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
// if(!empty($Suplist))
|
|
// {
|
|
// foreach ($Suplist as $SID):
|
|
|
|
|
|
// $options2[$SID->SupplierID] = $SID->SupplierID.' '.' - '.' '.$SID->SupplierName;
|
|
|
|
// endforeach;
|
|
// }
|
|
|
|
// echo form_dropdown('DEPTFN', $options2,set_value('DEPTFN',$SupId),'id="DEPTFN"' ,'required="true"' ,'class="form-control select2');
|
|
|
|
$data = array('name' => 'Department','value' => set_value('Department',$Department),'id'=>'Department', 'class' => 'form-control' ,'required' => 'true');
|
|
echo form_input($data);
|
|
|
|
?>
|
|
|
|
</div>
|
|
<!-- <div class="col-md-3">
|
|
<label>Date</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Date','value' => set_value('Date',$Date),'id'=>'Date', 'class' => 'form-control num' ,'required' => 'true', 'onkeypress'=>'return false;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div> -->
|
|
<div class="col-md-3">
|
|
<label>Date</label>
|
|
<?php
|
|
$data = array('name' => 'Date','value' => set_value('Date',$dt),'id'=>'Date', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-3">
|
|
|
|
<label>AUDITOR </label>
|
|
<div class="form-group">
|
|
<?php
|
|
// $data = array('name' => 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
|
// echo form_input($data);
|
|
$data = array('name' => 'AUDITOR','value' => set_value('AUDITOR',$Auditor),'id'=>'AUDITOR', 'class' => 'form-control' ,'required' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
<label>AUDITEE </label>
|
|
<div class="form-group">
|
|
<?php
|
|
// $data = array('name' => 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
|
// echo form_input($data);
|
|
$data = array('name' => 'AUDITEE','value' => set_value('AUDITEE',$Auditee),'id'=>'AUDITEE', 'class' => 'form-control' ,'required' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
|
|
<label>IQA REF. </label>
|
|
<div class="form-group">
|
|
<?php
|
|
// $data = array('name' => 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
|
// echo form_input($data);
|
|
$data = array('name' => 'IQAREF','value' => set_value('IQAREF',$Iqra),'id'=>'IQAREF', 'class' => 'form-control' ,'required' => 'true');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Non Conformance Details, Objective Evidence</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ObjectiveEvidence','value' => set_value('ObjectiveEvidence',$NC_Details),'id'=>'ObjectiveEvidence', 'class' => 'form-control' ,'required' => 'true', 'rows' => '3', 'cols' => '40');
|
|
echo Form_textarea($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<!-- <label>Attributed</label> -->
|
|
<label>NCR No:</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ObjectiveEvidence1','value' => set_value('ObjectiveEvidence1',$Id),'id'=>'ObjectiveEvidence1', 'class' => 'form-control' ,'required' => 'true', 'rows' => '3', 'cols' => '40');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div><!--row end-->
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="container-fluid">
|
|
<div><legend>Disposition Action Plan</legend></div>
|
|
<table class="table table-bordered" style="border:1px solid #333">
|
|
<div align="right" style="padding-right:10px">
|
|
<div align="right">
|
|
|
|
|
|
<a type="button" class="btn btn-primary btn-md" data-toggle="modal" data-target="#myModal">Add Disposition Action</a>
|
|
<!-- Add line Item -->
|
|
<div class="modal fade" id="myModal" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<center><h4>Add Line Item </h4></center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
<label>Action</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Action','value' => set_value('Action'),'id'=>'Action', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label>Resp</label>
|
|
<div>
|
|
<?php
|
|
$data = array('name' => 'Resp','value' => set_value('Resp'),'id'=>'Resp', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label>Target</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Target','value' => set_value('Target'),'id'=>'Target', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<a class="btn btn-primary font addClick" ID="addClick" > <span class="bold">Add</span></a>
|
|
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Edit Line Item -->
|
|
|
|
<div class="modal fade" id="EditItem" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<center><h4>Edit Line Item </h4></center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
<div class="col-md-12">
|
|
<label>Action</label>
|
|
<div >
|
|
<?php
|
|
|
|
$data = array('name' => 'EditAction','value' => set_value('EditAction'),'id'=>'EditAction', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
<label>Resp</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditResp','value' => set_value('EditResp'),'id'=>'EditResp', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label>Target</label>
|
|
<div>
|
|
<?php
|
|
$data = array('name' => 'EditTarget','value' => set_value('EditTarget'),'id'=>'EditTarget', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<a class="btn btn-primary font EditItem" ID="EditItem" > <span class="bold">Edit</span></a>
|
|
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="row" style="padding: 0px 15px 0px 10px;">
|
|
<table id="mytable" class="table table-bordered table-hover editableTable" style="background-color:#fff;font-size:12px;">
|
|
<thead style="background-color: #CFCFCF;">
|
|
<th>S.No</th>
|
|
<th></th>
|
|
<th>Action</th>
|
|
<th>Resp</th>
|
|
<th>Target</th>
|
|
<th></th>
|
|
</thead>
|
|
<tbody id="actionappend">
|
|
<?php
|
|
if(!empty($DispositionDetails)){
|
|
foreach($DispositionDetails as $dis){
|
|
$index= $index+1;
|
|
|
|
//echo $index;
|
|
?>
|
|
<tr id="action_plan<?php echo $index ; ?>">
|
|
<td><?php echo $index;?></td>
|
|
<td id="ActionIdhid"><input type="hidden" name="Did" id="Did<?php echo $index?>" value="<?php echo "$dis->DispositionId"?>"></td>
|
|
<td><?php echo $dis->Action;?></td>
|
|
<td><?php echo $dis->Resp;?></td>
|
|
<td><?php echo $dis->Target;?></td>
|
|
|
|
|
|
<input type="hidden" name="<?php echo 'ActionId'.$index ?>" id="<?php echo 'ActionId'.$index ?>" value="<?php echo $dis->DispositionId ; ?>" readonly/>
|
|
|
|
<input type="hidden" name="<?php echo 'action'.$index ?>" id="<?php echo 'action'.$index ?>" value="<?php echo $dis->Action ; ?>" />
|
|
|
|
<input type="hidden" name="<?php echo 'resp'.$index ?>" id="<?php echo 'resp'.$index ?>" value="<?php echo $dis->Resp ; ?>" />
|
|
|
|
<input type="hidden" name="<?php echo 'target'.$index ?>" id="<?php echo 'target'.$index ?>" value="<?php echo $dis->Target ; ?>" />
|
|
|
|
<td> <a data-target='#EditItem' data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <a href='#' onclick = "DeleteactionRow(<?php echo $index?>);" class="link" data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td>
|
|
</tr>
|
|
|
|
<?php } }?>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!--second table-->
|
|
<div class="container-fluid">
|
|
<div><legend>Root Cause (s)</legend></div>
|
|
<table class="table table-bordered" style="border:1px solid #333">
|
|
<div align="right" style="padding-right:10px">
|
|
<div align="right">
|
|
<a type="button" class="btn btn-primary btn-md" data-toggle="modal" data-target="#RootCausemodal">Add Root Cause</a><!-- Add line Item -->
|
|
<div class="modal fade" id="RootCausemodal" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<center><h4>Add Line Item </h4></center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
<label>Root Cause (s)</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'RootCause','value' => set_value('RootCause'),'id'=>'RootCause', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<a class="btn btn-primary font rootaddClick" ID="rootaddClick" > <span class="bold">Add</span></a>
|
|
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Edit Line Item -->
|
|
|
|
<div class="modal fade" id="EditRootCausemodal" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<center><h4>Edit Line Item </h4></center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
<div class="col-md-12">
|
|
<label>Root Cause (s)</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'editRootCause','value' => set_value('editRootCause'),'id'=>'editRootCause', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<a class="btn btn-primary font rootEditItem" ID="rootEditItem" > <span class="bold">Edit</span></a>
|
|
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="row" style="padding: 0px 15px 0px 10px;">
|
|
<table id="rootmytable" class="table table-bordered table-hover editableTable" style="background-color:#fff;font-size:12px;">
|
|
<thead style="background-color: #CFCFCF;">
|
|
<th>S.No</th>
|
|
<th>RootCause</th>
|
|
<th></th>
|
|
</thead>
|
|
<tbody id="roottbody">
|
|
<?php if(!empty($RootcauseDetails)){
|
|
$int=0;
|
|
foreach($RootcauseDetails as $rt){
|
|
$int=$int+1;?>
|
|
<tr id="root<?php echo $int?>">
|
|
<td><?php echo $int?></td>
|
|
<td id="rootcause<?php echo $int?>"><?php echo $rt->Root_cause;?></td>
|
|
<td>
|
|
<a data-target='#EditRootCausemodal' data-id="<?php echo $int ; ?>" data-rootuserid="<?php echo $int ; ?>" data-toggle="modal" href="#EditRootCausemodal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <a href='#' onclick = "DeleteRootRow(<?php echo $int ; ?>)" class="link" data-id="<?php echo $int ; ?>" data-rootuserid="<?php echo $int ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
|
</td>
|
|
</tr>
|
|
|
|
<input type="hidden" name="<?php echo 'RootCauseId'.$int ?>" id="<?php echo 'RootCauseId'.$int ?>" value="<?php echo $rt->RootId ; ?>" />
|
|
|
|
<input type="hidden" name="<?php echo 'RootCause'.$int ?>" id="<?php echo 'RootCause'.$int ?>" value="<?php echo $rt->Root_cause ; ?>" />
|
|
|
|
<?php } }?>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!--third table-->
|
|
<div class="container-fluid">
|
|
<div><legend>Counter Measure Action Plan</legend></div>
|
|
<table class="table table-bordered" style="border:1px solid #333">
|
|
<div align="right" style="padding-right:10px">
|
|
<div align="right">
|
|
<a type="button" class="btn btn-primary btn-md" data-toggle="modal" data-target="#Counter">Add Counter Measure Action</a>
|
|
<!-- Add line Item -->
|
|
<div class="modal fade" id="Counter" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<center><h4>Add Line Item </h4></center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
<label>Action</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CounterAction','value' => set_value('CounterAction'),'id'=>'CounterAction', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label>Resp</label>
|
|
<div>
|
|
<?php
|
|
$data = array('name' => 'CounterResp','value' => set_value('CounterResp'),'id'=>'CounterResp', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<label>Target</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'CounterTarget','value' => set_value('CounterTarget'),'id'=>'CounterTarget', 'class' => 'form-control');
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<a class="btn btn-primary font CounteraddClick" ID="CounteraddClick" > <span class="bold">Add</span></a>
|
|
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Edit Line Item -->
|
|
|
|
<div class="modal fade" id="EditCounter" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<center><h4>Edit Line Item </h4></center>
|
|
</div>
|
|
<div align="left">
|
|
|
|
<div class="col-md-6">
|
|
<label>Action</label>
|
|
<div >
|
|
<?php
|
|
|
|
$data = array('name' => 'EditCounterAction','value' => set_value('EditCounterAction'),'id'=>'EditCounterAction', 'class' => 'form-control' );
|
|
echo form_input($data);
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<label>Resp</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'EditCounterResp','value' => set_value('EditCounterResp'),'id'=>'EditCounterResp', 'class' => 'form-control' );
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label>Target</label>
|
|
<div>
|
|
<?php
|
|
$data = array('name' => 'EditCounterTarget','value' => set_value('EditCounterTarget'),'id'=>'EditCounterTarget', 'class' => 'form-control' );
|
|
echo form_input($data);
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<a class="btn btn-primary font CounterEditItem" ID="CounterEditItem" > <span class="bold">Edit</span></a>
|
|
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="row" style="padding: 0px 15px 0px 10px;">
|
|
<table id="mytablecorrective" class="table table-bordered table-hover editableTable" style="background-color:#fff;font-size:12px;">
|
|
<thead style="background-color: #CFCFCF;">
|
|
<th>S.No</th>
|
|
<th>Action</th>
|
|
<th>Resp</th>
|
|
<th>Target</th>
|
|
<th></th>
|
|
</thead>
|
|
<tbody id='countertable'>
|
|
<?php if(!empty($CounteractionDetails)){
|
|
$in=0;
|
|
foreach($CounteractionDetails as $cou){
|
|
$in=$in+1;?>
|
|
<tr id="counter<?php echo $in;?>">
|
|
<td ><?php echo $in;?></td>
|
|
<td id="counteraction1<?php echo $in?>"><?php echo $cou->Action;?></td>
|
|
<td id="counterresp1<?php echo $in;?>"><?php echo $cou->Resp;?></td>
|
|
<td id="countertarget1<?php echo $in?>"><?php echo $cou->Target;?></td>
|
|
<td>
|
|
|
|
<a data-target='#EditCounter' data-id="<?php echo $in ; ?>" data-userid="<?php echo $in ; ?>" data-toggle="modal" href="#EditCounter"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit;"></i> </a> <a href='#' onclick = "DeleteCounterRow(<?php echo $in ; ?>)" class="link" data-id="<?php echo $in ; ?>" data-userid="<?php echo $in ; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
|
</td>
|
|
</tr>
|
|
|
|
<input type="hidden" name="<?php echo 'CounterId'.$in ?>" id="<?php echo 'CounterId'.$in ?>" value="<?php echo $cou->CounterId ; ?>" />
|
|
|
|
<input type="hidden" name="<?php echo 'counteraction'.$in ?>" id="<?php echo 'counteraction'.$in ?>" value="<?php echo $cou->Action ; ?>" />
|
|
|
|
<input type="hidden" name="<?php echo 'counterresp'.$in ?>" id="<?php echo 'counterresp'.$in ?>" value="<?php echo $cou->Resp ; ?>" />
|
|
|
|
<input type="hidden" name="<?php echo 'countertarget'.$in ?>" id="<?php echo 'countertarget'.$in ?>" value="<?php echo $cou->Target ; ?>" />
|
|
|
|
<?php } }?>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<legend>Effectiveness of Corrective Action Taken</legend>
|
|
<div class="col-md-12">
|
|
<label>Review Details/ Follow up Audit Details </label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'ReviewDetails','value' => set_value('ReviewDetails',$Review_Details),'id'=>'ReviewDetails', 'class' => 'form-control' ,'rows' => '3', 'cols' => '40' );
|
|
echo form_textarea($data);
|
|
?>
|
|
</div>
|
|
</div><!--end new fields 1 sep-->
|
|
|
|
<div class="col-md-2">
|
|
<div class="form-group">
|
|
<lebel><b>NCR Closed</b></lebel>
|
|
<select id="ncrstatus">
|
|
<?php if($Ncr_status == "Yes"){?>
|
|
<option value="Yes">Yes</option>
|
|
<option value="No">No</option>
|
|
<?php }
|
|
else if($Ncr_status == "No"){?>
|
|
<option value="No">No</option>
|
|
<option value="Yes">Yes</option>
|
|
|
|
<?php }?>
|
|
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-md-12">
|
|
<label>MANAGEMENT REPRESENTATIVE COMMENTS</label>
|
|
<div class="form-group">
|
|
<?php
|
|
$data = array('name' => 'Comments','value' => set_value('Comments',$Comments),'id'=>'Comments', 'class' => 'form-control' ,'rows' => '3', 'cols' => '40' );
|
|
echo form_textarea($data);
|
|
?>
|
|
</div>
|
|
</div><!--end new fields 1 sep-->
|
|
|
|
<input type="hidden" name="ActionRow" id="ActionRow" value="<?php echo $index?>">
|
|
<input type="hidden" name="RootRow" id="RootRow" value="<?php echo $int?>">
|
|
<input type="hidden" name="CounterRow" id="CounterRow" value="<?php echo $in?>">
|
|
|
|
|
|
|
|
<div class="col-md-2 col-md-offset-11">
|
|
<a class="btn btn-primary Save" ID="Save" onclick="Save()" > <span class="bold">Save</span></a>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div><!--end box-->
|
|
</section>
|
|
</div>
|
|
|
|
<script type="text/html" id="actionplan">
|
|
<tr id="action_plan<%=index%>">
|
|
<td align="left" ><%=index%></td>
|
|
<td align="left" id="action<%=index%>"><%=Action%></td>
|
|
<td align="left" id="resp<%=index%>"><%=Resp%></td>
|
|
<td align="left" id="target<%=index%>"><%=Target%></td>
|
|
|
|
|
|
<td>
|
|
<a data-target='#EditItem' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#editimportpomodel"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit details"></i> </a> <a href='#' onclick = "DeleteActionRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
</script>
|
|
|
|
|
|
<script type="text/html" id="rootcause">
|
|
<tr id="root<%=rootindex%>">
|
|
<td align="left"><%=rootindex%></td>
|
|
<td align="left" id="rootcause<%=rootindex%>"><%=RootCause%></td>
|
|
|
|
<td>
|
|
<a data-target='#EditRootCausemodal' data-id="<%=rootindex%>" data-rootuserid="<%=rootindex%>" data-toggle="modal" href="#EditRootCausemodal"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the details"></i> </a> <a href='#' onclick = "DeleteRootRow(<%=rootindex%>)" class="link" data-id="<%=rootindex%>" data-rootuserid="<%=rootindex%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
</script>
|
|
|
|
<script type="text/html" id="counter">
|
|
<tr id="counter<%=counterindex%>">
|
|
<td align="left"><%=counterindex%></td>
|
|
<td align="left" id="counteraction1<%=counterindex%>"><%=Action%></td>
|
|
<td align="left" id="counterresp1<%=counterindex%>"><%=Resp%></td>
|
|
<td align="left" id="countertarget1<%=counterindex%>"><%=Target%></td>
|
|
|
|
|
|
<td>
|
|
<a data-target='#EditCounter' data-id="<%=counterindex%>" data-userid="<%=counterindex%>" data-toggle="modal" href="#editimportpomodel"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit details"></i> </a> <a href='#' onclick = "DeleteCounterRow(<%=counterindex%>)" class="link" data-id="<%=counterindex%>" data-userid="<%=counterindex%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
</script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var index= '<?php echo $index; ?>';
|
|
var rootindex = '<?php echo $int?>';
|
|
var counterindex = '<?php echo $in?>';
|
|
// alert(index)
|
|
|
|
//var index=1;
|
|
//var rootindex=1;
|
|
//var counterindex=1;
|
|
var userid = '';
|
|
var rootuserid = '';
|
|
var counteruserid = '';
|
|
|
|
|
|
$('.addClick').click(function()
|
|
{
|
|
|
|
var action= $('#Action').val();
|
|
var resp = $('#Resp').val();
|
|
var target= $('#Target').val();
|
|
index = parseInt(index)+1;
|
|
var temp = index
|
|
|
|
var template = jQuery("#actionplan").html();
|
|
|
|
// alert(template)
|
|
$('#actionappend').append(_.template(template,{index:temp,Action:action,Resp:resp,Target:target}));
|
|
|
|
var theForm = $(".action_report");
|
|
|
|
addHidden(theForm,"action"+temp,action);
|
|
addHidden(theForm,"resp"+temp,resp);
|
|
addHidden(theForm,"target"+temp,target);
|
|
|
|
$('#Action').val('');
|
|
$('#Resp').val('');
|
|
$('#Target').val('');
|
|
$('#ActionRow').val(temp)
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function addHidden(theForm, key, value)
|
|
{
|
|
// Create a hidden input element, and append it to the form:
|
|
var input = document.createElement('input');
|
|
input.type = 'hidden';
|
|
input.name = key;'name-as-seen-at-the-server';
|
|
input.id = key;'name-as-seen-at-the-server';
|
|
input.value = value;
|
|
theForm.append(input);
|
|
}
|
|
|
|
|
|
|
|
function Save()
|
|
{
|
|
|
|
var txtactionrow = $('#ActionRow').val();
|
|
var txtrootrow = $('#RootRow').val();
|
|
var txtcounterrow = $('#CounterRow').val();
|
|
var ncrstatus = $('#ncrstatus').val();
|
|
var date=$('#Date').val();
|
|
var newdate = date.split("-").reverse().join("-");
|
|
|
|
//alert(newdate)
|
|
$('#content').loader('show');
|
|
$.ajax({
|
|
|
|
data:$('.action_report').serialize()+"&txtactionrow="+txtactionrow+"&txtrootrow="+txtrootrow+"&txtcounterrow="+txtcounterrow+"&ncrstatus="+ncrstatus+"&newdate="+newdate,
|
|
type:"POST",
|
|
url:"<?php echo base_url() ?>purchaseorder/UpdateAction_Report",
|
|
success:function(data) {
|
|
if(data)
|
|
{
|
|
|
|
alert(data);
|
|
$('#content').loader('hide');
|
|
window.location = "Nonconfirmativelist";
|
|
|
|
}
|
|
else
|
|
{
|
|
alert("Error");
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
|
|
|
|
$("#EditItem").on("shown.bs.modal", function(e)
|
|
{
|
|
userid = $(e.relatedTarget).data('userid');
|
|
var tr= document.getElementById(userid);
|
|
|
|
$('#EditAction').val($('#action'+userid).val());
|
|
$('#EditResp').val($('#resp'+userid).val());
|
|
$('#EditTarget').val($('#target'+userid).val());
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.EditItem').click(function()
|
|
{
|
|
var editaction = $("#EditAction").val();
|
|
var editresp = $('#EditResp').val();
|
|
var edittarget= $('#EditTarget').val();
|
|
|
|
var tr= document.getElementById(userid);
|
|
var cellval = tr.cells;
|
|
|
|
cellval[1].innerHTML = editaction;
|
|
cellval[2].innerHTML = editresp;
|
|
cellval[3].innerHTML = edittarget;
|
|
|
|
$('#action'+userid).val(editaction);
|
|
$('#resp'+userid).val(editresp);
|
|
$('#target'+userid).val(edittarget);
|
|
|
|
|
|
});
|
|
|
|
|
|
$('.rootaddClick').click(function()
|
|
{
|
|
|
|
var rootcause= $('#RootCause').val();
|
|
rootindex = parseInt(rootindex)+1;
|
|
var temp = rootindex
|
|
|
|
var template = jQuery("#rootcause").html();
|
|
//alert(template)
|
|
$('#roottbody').append(_.template(template,{rootindex:temp,RootCause:rootcause}));
|
|
var theForm = $(".action_report");
|
|
addHidden(theForm,"RootCause"+temp,rootcause);
|
|
$('#RootCause').val('');
|
|
$('#RootRow').val(temp)
|
|
|
|
});
|
|
|
|
|
|
$("#EditRootCausemodal").on("shown.bs.modal", function(e)
|
|
{
|
|
rootuserid = $(e.relatedTarget).data('rootuserid');
|
|
var tr= document.getElementById(userid);
|
|
$('#editRootCause').val($('#RootCause'+rootuserid).val());
|
|
|
|
|
|
});
|
|
|
|
|
|
$('.rootEditItem').click(function()
|
|
{
|
|
var editroot = $("#editRootCause").val();
|
|
var tr= document.getElementById(rootuserid);
|
|
// var cellval = tr.cells;
|
|
//cellval[1].innerHTML = editroot;
|
|
document.getElementById('rootcause'+rootuserid).innerHTML = editroot;
|
|
$('#RootCause'+rootuserid).val(editroot);
|
|
});
|
|
|
|
|
|
$('.CounteraddClick').click(function()
|
|
{
|
|
|
|
var action= $('#CounterAction').val();
|
|
var resp = $('#CounterResp').val();
|
|
var target= $('#CounterTarget').val();
|
|
counterindex = parseInt(counterindex)+1;
|
|
var temp = counterindex;
|
|
|
|
var template = jQuery("#counter").html();
|
|
|
|
// alert(template)
|
|
$('#countertable').append(_.template(template,{counterindex:temp,Action:action,Resp:resp,Target:target}));
|
|
|
|
var theForm = $(".action_report");
|
|
|
|
addHidden(theForm,"counteraction"+temp,action);
|
|
addHidden(theForm,"counterresp"+temp,resp);
|
|
addHidden(theForm,"countertarget"+temp,target);
|
|
|
|
$('#CounterAction').val('');
|
|
$('#CounterResp').val('');
|
|
$('#CounterTarget').val('');
|
|
$('#CounterRow').val(temp)
|
|
|
|
});
|
|
|
|
$("#EditCounter").on("shown.bs.modal", function(e)
|
|
{
|
|
|
|
// alert()
|
|
userid = $(e.relatedTarget).data('userid');
|
|
var tr= document.getElementById(userid);
|
|
|
|
$('#EditCounterAction').val($('#counteraction'+userid).val());
|
|
$('#EditCounterResp').val($('#counterresp'+userid).val());
|
|
$('#EditCounterTarget').val($('#countertarget'+userid).val());
|
|
|
|
|
|
});
|
|
|
|
|
|
$('.CounterEditItem').click(function()
|
|
{
|
|
var editaction = $("#EditCounterAction").val();
|
|
var editresp = $('#EditCounterResp').val();
|
|
var edittarget= $('#EditCounterTarget').val();
|
|
|
|
var tr= document.getElementById(userid);
|
|
var cellval = tr.cells;
|
|
|
|
// cellval[1].innerHTML = editaction;
|
|
// cellval[2].innerHTML = editresp;
|
|
// cellval[3].innerHTML = edittarget;
|
|
|
|
document.getElementById('counteraction1'+userid).innerHTML = editaction;
|
|
document.getElementById('counterresp1'+userid).innerHTML = editresp;
|
|
document.getElementById('countertarget1'+userid).innerHTML = edittarget;
|
|
|
|
$('#counteraction'+userid).val(editaction);
|
|
$('#counterresp'+userid).val(editresp);
|
|
$('#countertarget'+userid).val(edittarget);
|
|
|
|
|
|
});
|
|
|
|
|
|
// function DeleteActionRow(rowId)
|
|
// {
|
|
// alert(rowId)
|
|
// var id=[];
|
|
// var tr = document.getElementById("action_plan"+rowId);
|
|
|
|
// tr.parentNode.removeChild(tr);
|
|
// //var delactionId=$('#ActionId'+rowId).attr("name");
|
|
|
|
// var id= $('#Did'+rowId).val();
|
|
|
|
// alert(delactionId);
|
|
// //alert(tr);
|
|
|
|
|
|
// // $('#action'+rowId).val('')
|
|
// // $('#resp'+rowId).val('')
|
|
// // $('#target'+rowId).val('')
|
|
|
|
// //alert(delactionId)
|
|
|
|
// // $.ajax({
|
|
|
|
// // data:{delactionId,delactionId},
|
|
// // type:"POST",
|
|
// // url:"<?php echo base_url() ?>purchaseorder/DeleteAction_Report",
|
|
// // success:function(data) {
|
|
// // if(data)
|
|
// // {
|
|
// // alert(data);
|
|
// // }
|
|
// // else
|
|
// // {
|
|
// // alert("Error");
|
|
// // }
|
|
|
|
// // }
|
|
|
|
// // });s
|
|
// }
|
|
function DeleteactionRow(rowId)
|
|
{
|
|
//alert(rowId)
|
|
var id=[];
|
|
//trpopcountry.style.display = "block";
|
|
var delactionId=$('#ActionId'+rowId).val();
|
|
//alert(delactionId);
|
|
//$('#RootCause'+rowId).val('')
|
|
|
|
$('#action'+rowId).val('')
|
|
$('#resp'+rowId).val('')
|
|
$('#target'+rowId).val('')
|
|
|
|
//alert(delactionId)
|
|
|
|
$.ajax({
|
|
|
|
data:{delactionId,delactionId},
|
|
type:"POST",
|
|
url:"<?php echo base_url() ?>purchaseorder/DeleteAction_Report",
|
|
success:function(data) {
|
|
if(data)
|
|
{
|
|
alert(data);
|
|
var tr = document.getElementById("action_plan"+rowId);
|
|
tr.parentNode.removeChild(tr);
|
|
}
|
|
else
|
|
{
|
|
alert("Error");
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
|
|
function DeleteRootRow(rowId)
|
|
{
|
|
//alert(rowId)
|
|
var id=[];
|
|
|
|
|
|
//trpopcountry.style.display = "block";
|
|
var delactionId=$('#RootCauseId'+rowId).val();
|
|
//alert(delactionId);
|
|
$('#RootCause'+rowId).val('')
|
|
var tr = document.getElementById("root"+rowId);
|
|
tr.parentNode.removeChild(tr);
|
|
|
|
// alert(delactionId)
|
|
|
|
$.ajax({
|
|
|
|
data:{delactionId,delactionId},
|
|
type:"POST",
|
|
url:"<?php echo base_url() ?>purchaseorder/DeleteRoot_Cause",
|
|
success:function(data) {
|
|
if(data)
|
|
{
|
|
alert(data);
|
|
|
|
}
|
|
else
|
|
{
|
|
alert("Error");
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
|
|
|
|
function DeleteCounterRow(rowId)
|
|
{
|
|
//alert(rowId)
|
|
var id=[];
|
|
var tr = document.getElementById("counter"+rowId);
|
|
var delactionId=$('#CounterId'+rowId).val();
|
|
|
|
|
|
$('#counteraction'+rowId).val('');
|
|
$('#counterresp'+rowId).val('');
|
|
$('#countertarget'+rowId).val('');
|
|
|
|
//alert(delactionId)
|
|
|
|
$.ajax({
|
|
|
|
data:{delactionId,delactionId},
|
|
type:"POST",
|
|
url:"<?php echo base_url() ?>purchaseorder/DeleteCounter_Row",
|
|
success:function(data) {
|
|
if(data)
|
|
{
|
|
alert(data);
|
|
tr.parentNode.removeChild(tr);
|
|
|
|
}
|
|
else
|
|
{
|
|
alert("Error");
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|