<?php if(!empty($mode)){ ?>
	<div class="container-fluid" style="padding-bottom: 2rem;">
		<?php if(!empty($data_complaint)){ ?>
			<div class="card card-body">
				<h4 class="card-title" id="complaint_refer" data-id="<?php echo $data_complaint[0]->id; ?>">Complaint Resolution [Ref. No : <?php echo str_pad($data_complaint[0]->ref_no, 4,'0', STR_PAD_LEFT); ?> complaint by <?php echo $data_complaint[0]->client_name; ?>]</h4>
				<hr>
				<div class="row">
					<div class="col">
						<label for="complaint_actual_reso" class="col-form-label-sm"><b>Actual Resolution of the Problem</b></label>
						<textarea class="form-control form-control-sm" id="complaint_actual_reso" rows="4" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>><?php echo $data_complaint[0]->actual_reso; ?></textarea>
					</div>
				</div>
				<div class="row">
					<div class="col">
						<label for="complaint_promise" class="col-form-label-sm"><b>Promise/Commitment Made to the Client</b></label>
						<textarea class="form-control form-control-sm" id="complaint_promise" rows="4" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>><?php echo $data_complaint[0]->promise_made; ?></textarea>
					</div>
				</div>
				<div class="row">
					<div class="col-5">
						<label for="" class="col-form-label-sm"><b>Time Promises</b></label>
						<br>
						<div class="form-check form-check-inline">
							<input class="form-check-input" type="checkbox" name="complaint_time_promise" id="complaint_time_promise" value="1"
								<?php if($data_complaint_time){
									foreach ($data_complaint_time as $key => $row) {
										if($row['time_id'] == 1){
											echo 'checked';
										}
									}
								}?> 
							<?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>>
							<label class="form-check-label" for="complaint_time_promise">Immediately Resolved</label>
						</div><br>
						<div class="form-check form-check-inline">
							<input class="form-check-input" type="checkbox" name="complaint_time_promise" id="complaint_time_promise" value="2" onchange="openDate()"
								<?php if($data_complaint_time){
									foreach ($data_complaint_time as $key => $row) {
										if($row['time_id'] == 2){
											echo 'checked';
										}
									}
								}?>
							<?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>>
							<label class="form-check-label" for="complaint_time_promise">Resolved Based on Agreed Date</label>
						</div>
						<div class="form-check form-check-inline">
							<input id="complaint_time_promise_date" name="complaint_time_promise_date" type="text" class="form-control form-control-sm" size="50%" <?php if(!empty($date_promise[0]['date_promise'])){echo 'style="display: block;" value="'.date('d-m-Y', strtotime($date_promise[0]['date_promise'])).'"';} else {echo 'style="display: none;"';}?> <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>>
						</div><br>
						<div class="form-check form-check-inline">
							<input class="form-check-input" type="checkbox" name="complaint_time_promise" id="complaint_time_promise" value="3" onchange="openThrough()"
								<?php if($data_complaint_time){
									foreach ($data_complaint_time as $key => $row) {
										if($row['time_id'] == 3){
											echo 'checked';
										}
									}
								}?>
							<?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>>
							<label class="form-check-label" for="complaint_time_promise">Intermediate reply through :</label>
						</div>
						<div class="form-check form-check-inline">
							<input id="complaint_time_promise_through" name="complaint_time_promise_through" type="text" class="form-control form-control-sm" size="50%" <?php if(!empty($row['others_details'])){echo 'style="display: block;" value="'.$row['others_details'].'"';} else {echo 'style="display: none;"';}?> <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>>
						</div>
					</div>
					<div class="col-2">
						<label for="" class="col-form-label-sm"><b>Open Investigation Report?</b></label>
						<br>
						<?php if($data_complaint[0]->investigate_report == 0){ ?>
							<div class="form-check">
								<input class="form-check-input" type="radio" name="complaint_investigation_report" id="complaint_investigation_report_yes" value="1" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?> onchange="openInvestigation();">
								<label class="form-check-label" for="complaint_investigation_report">
								Yes
								</label>
							</div>
							<div class="form-check">
								<input class="form-check-input" type="radio" name="complaint_investigation_report" id="complaint_investigation_report_no" checked value="0" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?> onchange="closeInvestigation();">
								<label class="form-check-label" for="complaint_investigation_report">
								No
								</label>
							</div>
						<?php }else{ ?>
							<div class="form-check">
								<input class="form-check-input" type="radio" name="complaint_investigation_report" id="complaint_investigation_report_yes" checked value="1" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?> onchange="openInvestigation();">
								<label class="form-check-label" for="complaint_investigation_report">
								Yes
								</label>
							</div>
							<div class="form-check">
								<input class="form-check-input" type="radio" name="complaint_investigation_report" id="complaint_investigation_report_no" value="0" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?> onchange="closeInvestigation();">
								<label class="form-check-label" for="complaint_investigation_report">
								No
								</label>
							</div>
						<?php } ?>
					</div>
				</div>
				<br>
				<div id="investigation_report" <?php if($data_complaint[0]->investigate_report == 1){ echo "style='display: block;'"; }else{ echo "style='display: none;'";} ?>>
					<h4 class="card-title">Investigation Report</h4>
					<hr>
					<div class="row">
						<div class="col">
							<label for="" class="col-form-label-sm"><b>Root Causes</b></label>
							<textarea class="form-control form-control-sm" rows="4" id="complaint_root_cause" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>><?php echo $data_complaint[0]->root_cause; ?></textarea>
						</div>
					</div>
					<div class="row">
						<div class="col">
							<label for="" class="col-form-label-sm"><b>Action Taken</b></label>
							<textarea class="form-control form-control-sm" rows="4" id="complaint_action_taken" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>><?php echo $data_complaint[0]->action_taken; ?></textarea>
						</div>
					</div>
					<div class="row">
						<div class="col">
							<label for="" class="col-form-label-sm"><b>Recommendation to Prevent Recurrence</b></label>
							<textarea class="form-control form-control-sm" rows="4" id="complaint_prevent_recurrence" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>><?php echo $data_complaint[0]->prevent_recurrence; ?></textarea>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-5">
						<label for="" class="col-form-label-sm"><b>Action Taken?</b></label>
						<br>
						<?php if($data_complaint[0]->status >= 2){ ?>
							<div class="form-check">
								<input class="form-check-input" type="radio" name="complaint_resolved" id="complaint_resolved_yes" value="1" checked <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>>
								<label class="form-check-label" for="complaint_resolved">
								Yes
								</label>
							</div>
							<div class="form-check">
								<input class="form-check-input" type="radio" name="complaint_resolved" id="complaint_resolved_no" value="0" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>>
								<label class="form-check-label" for="complaint_resolved">
								No
								</label>
							</div>
						<?php }else{ ?>
							<div class="form-check">
								<input class="form-check-input" type="radio" name="complaint_resolved" id="complaint_resolved_yes" value="1" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>>
								<label class="form-check-label" for="complaint_resolved">
								Yes
								</label>
							</div>
							<div class="form-check">
								<input class="form-check-input" type="radio" name="complaint_resolved" id="complaint_resolved_no" value="0" checked <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>>
								<label class="form-check-label" for="complaint_resolved">
								No
								</label>
							</div>
						<?php } ?>
					</div>
					<div class="col-7">
						<label for="complaint_pic" class="col-form-label-sm"><b>Action Taken by</b></label>
						<select id="complaint_pic" type="text" class="form-control form-control-sm" <?php if($_SESSION['user']['id'] == $data_complaint[0]->pic_id){ echo 'disabled'; }?>>
							<option value="" selected="selected">Please Select</option>
							<?php if($department_staff){ foreach($department_staff as $key => $value) { ?>
								<option 
								<?php if($data_complaint[0]->pic_id == $value['id']) { 
									echo 'selected';
								}?>
								value="<?php echo $value['id']; ?>" <?php if($data_complaint[0]->status >= 3 || $data_complaint[0]->pic_id != $_SESSION['user']['id']){ echo "disabled"; }?>><?php echo $value['name']; ?></option>
							<?php }} ?>
						</select>
					</div>
				</div>
				<br>
				<div class="row">
					<div class="col">
						<h4>Handling Attachment</h4>
					</div>
					<div class="col text-right">
	                    <button class="btn btn-info btn-sm" data-toggle="modal" data-target="#attachmentModal" type="button"> <i class="fas fa-plus"></i> Add Attachment</button>
	                </div>
				</div>
				<hr>
				<div class="table-responsive">
					<table id="complaint_attachment_table" class="table table-bordered" style="width:100%">
						<thead> 
		                    <th class="text-center">#</th>
		                    <th class="text-center">Description</th>
		                    <th class="text-center">File Name</th>
		                    <th class="text-center">Action</th>
		                </thead>
		                <tbody>
		                	<?php 
		                	$i = 1;
		                	if($data_attachment){ foreach ($data_attachment as $value) { ?>
		                		<tr class="text-center">
		                			<td><?php echo $i++; ?></td>
		                			<td><?php echo $value->description; ?></td>
		                			<td><a target="_blank" href="<?php echo base_url($value->file_location.$value->filename); ?>"><?php echo $value->filename; ?></a></td>
		                			<td class="text-center">
										<div class="btn-group btn-group-sm" role="group">
											<a download href="<?php echo base_url($value->file_location.$value->filename); ?>" type="button" class="btn btn-primary" data-trigger="hover" data-toggle="tooltip" title="Download"><i class="fas fa-download"></i></a>
											<button type="button" class="btn btn-danger" onclick="deleteAttachment(<?php echo $value->id; ?>);" data-trigger="hover" data-toggle="tooltip" title="Delete" <?php if((($_SESSION['all_modules_access'][1]['access_lvl'] == 'admin') && ($_SESSION['user']['id'] != $value->created_by))){echo 'disabled'; }?>><i class="fas fa-trash"></i></button>
										</div>
									</td>
		                		</tr>
		                	<?php } } ?>
		                </tbody>
					</table>
				</div>
				<br>
				<?php if($data_complaint[0]->pic_id == $_SESSION['user']['id'] && $data_complaint[0]->status < 3){ ?>
					<button onclick="saveReso();" class="btn btn-success">Update Resolution</button>
				<?php } ?>
			</div>
		<?php } ?>
	</div>

<?php } else { ?>	
	<div class="container-fluid" style="padding-bottom: 2rem;">
		<?php if(!empty($data_complaint)){ ?>
			<div class="card card-body">
				<h4 class="card-title" id="complaint_refer" data-id="<?php echo $data_complaint[0]->id; ?>">Complaint Resolution [Ref. No : <?php echo str_pad($data_complaint[0]->ref_no, 4,'0', STR_PAD_LEFT); ?> complaint by <?php echo $data_complaint[0]->client_name; ?>]</h4>
				<hr>
				<div class="row">
					<div class="col">
						<label for="complaint_actual_reso" class="col-form-label-sm"><b>Actual Resolution of the Problem</b></label>
						<textarea class="form-control form-control-sm" id="complaint_actual_reso" rows="4"></textarea>
					</div>
				</div>
				<div class="row">
					<div class="col">
						<label for="complaint_promise" class="col-form-label-sm"><b>Promise/Commitment Made to the Client</b></label>
						<textarea class="form-control form-control-sm" id="complaint_promise" rows="4"></textarea>
					</div>
				</div>
				<div class="row">
					<div class="col-5">
						<label for="" class="col-form-label-sm"><b>Time Promises</b></label>
						<br>
						<div class="form-check form-check-inline">
							<input class="form-check-input" type="checkbox" name="complaint_time_promise" id="complaint_time_promise" value="1">
							<label class="form-check-label" for="complaint_time_promise">Immediately Resolved</label>
						</div><br>
						<div class="form-check form-check-inline">
							<input class="form-check-input" type="checkbox" name="complaint_time_promise" id="complaint_time_promise" value="2" onchange="openDate()">
							<label class="form-check-label" for="complaint_time_promise">Resolved Based on Agreed Date</label>
						</div>
						<div class="form-check form-check-inline">
							<input id="complaint_time_promise_date" name="complaint_time_promise_date" value="Insert date" type="text" class="form-control form-control-sm" size="50%" style="display: none;">
						</div>
						<br>
						<div class="form-check form-check-inline">
							<input class="form-check-input" type="checkbox" name="complaint_time_promise" id="complaint_time_promise" value="3" onchange="openThrough()">
							<label class="form-check-label" for="complaint_time_promise">Intermediate reply through :</label>
						</div>
						<div class="form-check form-check-inline">
							<input id="complaint_time_promise_through" name="complaint_time_promise_through" type="text" value="Intermediate reply through.." class="form-control form-control-sm" size="50%" style="display: none;">
						</div>
					</div>
					<div class="col-2">
						<label for="" class="col-form-label-sm"><b>Open Investigation Report?</b></label>
						<br>
						<div class="form-check">
							<input class="form-check-input" type="radio" name="complaint_investigation_report" id="complaint_investigation_report_yes" value="1" onchange="openInvestigation();">
							<label class="form-check-label" for="complaint_investigation_report">
							Yes
							</label>
						</div>
						<div class="form-check">
							<input class="form-check-input" type="radio" name="complaint_investigation_report" id="complaint_investigation_report_no" checked value="0" onchange="closeInvestigation();">
							<label class="form-check-label" for="complaint_investigation_report">
							No
							</label>
						</div>
					</div>
				</div>
				<br>
				<div id="investigation_report" style="display: none;">
					<h4 class="card-title">Investigation Report</h4>
					<hr>
					<div class="row">
						<div class="col">
							<label for="" class="col-form-label-sm"><b>Root Causes</b></label>
							<textarea class="form-control form-control-sm" rows="4" id="complaint_root_cause"></textarea>
						</div>
					</div>
					<div class="row">
						<div class="col">
							<label for="" class="col-form-label-sm"><b>Action Taken</b></label>
							<textarea class="form-control form-control-sm" rows="4" id="complaint_action_taken"></textarea>
						</div>
					</div>
					<div class="row">
						<div class="col">
							<label for="" class="col-form-label-sm"><b>Recommendation to Prevent Recurrence</b></label>
							<textarea class="form-control form-control-sm" rows="4" id="complaint_prevent_recurrence"></textarea>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-5">
						<label for="" class="col-form-label-sm"><b>Action Taken?</b></label>
						<br>
						<div class="form-check">
							<input class="form-check-input" type="radio" name="complaint_resolved" id="complaint_resolved_yes" value="1">
							<label class="form-check-label" for="complaint_resolved">
							Yes
							</label>
						</div>
						<div class="form-check">
							<input class="form-check-input" type="radio" name="complaint_resolved" id="complaint_resolved_no" value="0" checked>
							<label class="form-check-label" for="complaint_resolved">
							No
							</label>
						</div>
					</div>
					<div class="col-7">
						<label for="complaint_pic" class="col-form-label-sm"><b>Action Taken by</b></label>
						<select id="complaint_pic" type="text" class="form-control form-control-sm" <?php if($_SESSION['user']['id'] == $data_complaint[0]->pic_id){ echo 'disabled'; }?>>
							<option value="" selected="selected">Please Select</option>
							<?php if($department_staff){ foreach($department_staff as $key => $value) { ?>
								<option 
								<?php if($data_complaint[0]->pic_id == $value['id']) { 
									echo 'selected';
								}?>
								value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
							<?php }} ?>
						</select>
					</div>
				</div>
				<br>
				<div class="row">
					<div class="col">
						<h4>Handling Attachment</h4>
					</div>
					<div class="col text-right">
	                    <button class="btn btn-info btn-sm" data-toggle="modal" data-target="#attachmentModal" type="button"> <i class="fas fa-plus"></i> Add Attachment</button>
	                </div>
				</div>
				<hr>
				<div class="table-responsive">
					<table id="complaint_attachment_table" class="table table-bordered" style="width:100%">
						<thead> 
		                    <th class="text-center">#</th>
		                    <th class="text-center">Description</th>
		                    <th class="text-center">File Name</th>
		                    <th class="text-center">Action</th>
		                </thead>
		                <tbody>
		                	<?php 
		                	$i = 1;
		                	if($data_attachment){ foreach ($data_attachment as $value) { ?>
		                		<tr class="text-center">
		                			<td><?php echo $i++; ?></td>
		                			<td><?php echo $value->description; ?></td>
		                			<td><a target="_blank" href="<?php echo base_url($value->file_location.$value->filename); ?>"><?php echo $value->filename; ?></a></td>
		                			<td class="text-center">
										<div class="btn-group btn-group-sm" role="group">
											<a download href="<?php echo base_url($value->file_location.$value->filename); ?>" type="button" class="btn btn-primary" data-trigger="hover" data-toggle="tooltip" title="Download"><i class="fas fa-download"></i></a>
											<button type="button" class="btn btn-danger" onclick="deleteAttachment(<?php echo $value->id; ?>);" data-trigger="hover" data-toggle="tooltip" title="Delete" <?php if((($_SESSION['all_modules_access'][1]['access_lvl'] == 'admin') && ($_SESSION['user']['id'] != $value->created_by))){echo 'disabled'; }?>><i class="fas fa-trash"></i></button>
										</div>
									</td>
		                		</tr>
		                	<?php } } ?>
		                </tbody>
					</table>
				</div>
				<br>
				<button onclick="saveReso();" class="btn btn-success">Save Resolution</button>
			</div>
		<?php } ?>
	</div>

<?php } ?>

<div class="modal fade" id="attachmentModal">
	<div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLongTitle">Add Attachment</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <form method="post" id="attachmentForm" enctype="multipart/form-data">
                <div class="modal-body">
                    <div class="row">
                        <div class="col">
                            <label for="item"><b>Description</b></label>
                        </div>
                    </div>

                    <div class="row form-group">
                        <div class="col">
                           <textarea class="form-control" rows="5" id="complaint_attachment_desc" placeholder="Attachment's Descriptive Information "></textarea>
                        </div>
                    </div>
                    <div class="row form-group">
                        <div class="col-lg-8">
                            <input type="file" class="form-control form-control-sm" placeholder="Upload Attachment" name="complaint_attachment" id="complaint_attachment">
                        </div>
                        <div class="col">
                            <button type="button" onclick="upload_complaint_attachment(<?php echo $data_complaint[0]->id; ?>);" class="btn btn-primary text-white btn-block">Save</button>
                        </div>
                    </div>  
                </div>
            </form>
        </div>
    </div>
</div>

<script type="text/javascript">

	$('#complaint_time_promise_date').datepicker({
		uiLibrary: 'bootstrap4',
		format: 'dd-mm-yyyy'
	});

	function RefreshTableOnly() 
	{
		$('.table').load("your-current-page.html .table");
	}


	function openThrough()
    {
		jQuery("#complaint_time_promise_through").show();
    }

    function openDate()
    {
		jQuery("#complaint_time_promise_date").show();
    }

    function openInvestigation()
    {
    	jQuery("#investigation_report").show();
    }

    function closeInvestigation()
    {
    	jQuery("#investigation_report").hide();
    }

    function saveReso()
	{
		var id = $('#complaint_refer').attr('data-id');

		if($('#complaint_investigation_report_no').is(':checked')) {
			var investigate_report = 0; 
		} else if($('#complaint_investigation_report_yes').is(':checked')) {
			var investigate_report = 1; 
		} else{
			return;
		}

		if($('#complaint_resolved_no').is(':checked')) {
			var complaint_resolved = 0; 
		} else if($('#complaint_resolved_yes').is(':checked')) {
			var complaint_resolved = 1; 
		} else{
			return;
		}

		var complaint_time_promise = []
		$("input:checkbox[name=complaint_time_promise]:checked").each(function(){
		    complaint_time_promise.push($(this).val());
		});  

		var postData = {
			'id'							 : id,
			'actual_reso' 					 : $('#complaint_actual_reso').val(),
			'promise_made'					 : $('#complaint_promise').val(),
			'investigate_report'			 : investigate_report,
			'time_promise'					 : complaint_time_promise,
			'complaint_time_promise_through' : $('#complaint_time_promise_through').val(),
			'complaint_time_promise_date' 	 : $('#complaint_time_promise_date').val(),
			'complaint_resolved'			 : complaint_resolved,
			'root_cause' 					 : $('#complaint_root_cause').val(),
			'action_taken' 					 : $('#complaint_action_taken').val(),
			'prevent_recurrence' 			 : $('#complaint_prevent_recurrence').val()

		};

		$.ajax({
			type: 'POST',
			dataType: 'json',
			url: '<?php echo base_url(); ?>hr/ServiceForm/saveResolution',
			data: postData,
			success: function(data) {
				window.location.href = "<?php echo base_url().'hr/serviceform/complaint_reso/'?>"+id+'/view';

			}
		});
	}

	function upload_complaint_attachment(id)
	{
		validateForm("#attachmentForm", "Are you sure you want to upload this attachment?", function(){
			if($('#complaint_attachment').prop('files').length > 0)
			{
				var attachment_data = new FormData();
				
				attachment_data.append("complaint_id", id);
				attachment_data.append("attachment", $('#complaint_attachment').prop('files')[0]);
				attachment_data.append("description", $('#complaint_attachment_desc').val());
				attachment_data.append("class_id", 2);

				$.ajax({
					url: "<?php echo base_url('hr/serviceform/upload_complaint_attachment'); ?>",
					type: "POST",
					data: attachment_data,
					dataType: "JSON",
					processData: false,
					contentType: false,
					success: function(data) {
						if(data.status == 'Success')
						{
							$('#attachmentModal').modal('hide');
							
							localStorage.setItem("status",data.status);
							localStorage.setItem("msg",data.msg);

							RefreshTableOnly();
						}
					}
				});
			}
		});
	}

	function deleteAttachment(id)
	{
		toastConfirm("Are you sure you want to delete this attachment?", function(){
			$.ajax({
				type: 'POST',
				url: '<?php echo base_url('hr/serviceform/delete_complaint_attachment'); ?>',
				data: {
					'id' : id
				},
				dataType: 'JSON',
				success: function(data) {
					if(data.status == 'Success')
					{
						localStorage.setItem("status",data.status);
						localStorage.setItem("msg",data.msg);

						RefreshTableOnly();
					}
				}
			});
		})
	}

</script>